[Freeswitch-users] Hangup hooks on B legs

Isaac Jurado ijurado at econcept.es
Wed Aug 3 21:24:59 MSD 2011

On Wed, Aug 3, 2011 at 6:09 PM, Avi Marcus <avi at avimarcus.net> wrote:
> Yes, you can export it, "nolocal" to activate only on the B leg, e.g.:
> <action application="export" data="nolocal:api_hangup_hook=lua file.lua"/>

It works!  Thanks a lot.  Now I have a small problem, the channels seem
to be destroyed or unaccessible when the hangup hook is executed.  I
tested a dialplan with the following line:

<action application="set" data="session_in_hangup_hook=true"/>
<action application="export" data="api_hangup_hook=uuid_exists ${uuid}"/>

And the FS log reports that none of the legs exists:

2011-08-03 19:01:30.609887 [DEBUG] switch_core_state_machine.c:492
Hangup Command with no Session
2011-08-03 19:01:30.645615 [DEBUG] switch_core_state_machine.c:492
Hangup Command with Session

This shows that the export works, as the hook is executed twice.
Although the ${uuid} is expanded only once.  But it's curious as the
channel uuid where the hook is beign executed has not been destroyed


Isaac Jurado
Internet Busines Solutions eConcept

Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list