On Wed, Aug 3, 2011 at 6:09 PM, Avi Marcus <avi@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 uuid_exists(2bd2ce25-99fe-41fe-bcfe-d8224a9d6f18): false [...] 2011-08-03 19:01:30.645615 [DEBUG] switch_core_state_machine.c:492 Hangup Command with Session uuid_exists(2bd2ce25-99fe-41fe-bcfe-d8224a9d6f18): false 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 yet. Cheers. -- Isaac Jurado Internet Busines Solutions eConcept