After I have upgraded to Asterisk 1.2.1 I have been receiving this odd behavior regarding events.
Any event following a ParkedCall or a ParkedCallGiveUp event will be pre-pended with a \r\n. I am trying to locate the origin of these events in the source code but haven’t been successful thus far. It seems to be in the features.c file but I have found only the features.h file and cannot locate the features.c file.
Anyone have noticed the same behavior or knows where the features.c file is loacted at? A whereis features.c at the terminal prompt only show features.h.
Actually any of the Parked call related events has this behavior. I have also located the features.c, it is actually called res_features.c and is located in the asterisk.res directory.
I looked at the file and it looks fine to me, with my little C knowledge . For a test I created an app where the socket connection just sits there and read until it finds a /r/n/r/n and then it logs it. And any event after any of the parked call related events have a /r/n infront of it. Maybe it is a bug, can someone else confirm the same?
Yep it is a bug in the res_feature.c file. Every where the manger_event is called it has /r/n/r/n at the end where as in other files it only has /r/n because the manager_event method in the manager.c appends the last /r/n.
Here is the code from manager.c where it is calling the same method:
manager_event(EVENT_FLAG_CALL,
“OriginateSuccess”,
"%s"
“Channel: %s/%s\r\n”
“Context: %s\r\n”
“Exten: %s\r\n”
“Reason: %d\r\n”
“Uniqueid: %s\r\n”, <== only one /r/n
And here is the code of the method showing it is appending the /r/n: