Adding An Event On Chan_sip.c (asterisk 1.8.22)

Home » Asterisk Users » Adding An Event On Chan_sip.c (asterisk 1.8.22)
Asterisk Users No Comments

In some situations I got the following message on asterisk console:

* Autodestruct on dialog ‘857128833@192.168.2.129
<857128833@192.168.2.129>‘ with owner SIP/1015-00000002 in place (Method:
BYE). Rescheduling destruction for 10000 ms*

I would like to raise a manager event, to take some action when it is happening.

To do so, I believed that was just a matter of adding an manger_event call as follows:

* owner = sip_pvt_lock_full(p);*
* if (owner) {*
* ast_log(LOG_WARNING, “Autodestruct on dialog ‘%s’ with owner %s in place
(Method: %s). Rescheduling destruction for 10000 ms\n”, p->callid, owner->name, sip_methods[p->method].text);*
* manager_event(EVENT_FLAG_SYSTEM, “MY-HANGUP-ALERT”, “channel: %s\r\n”, owner->name);*

But for some reason, I don’t get such event on my ami client.

What is going wrong?

Thanks,

Valter