[Freeswitch-users] hangup extension

Michael Collins msc at freeswitch.org
Wed May 15 20:58:02 MSD 2013


On Tue, May 14, 2013 at 11:28 PM, Ashish gautam <ashish at nms.co.in> wrote:

> Hi Michael,
>
> I set in my dialplan:
> <action application="set" data="session_in_hangup_hook=true"/>
>
> and in my hangup hook I am doing this:
>
> sub hupHook{
> freeswitch::consoleLog("err","In Sub hupHook\n");
> my $endDispo = $api->executeString("uuid_getvar $uuid endpoint_disposition
> XML");
>     chomp($endDispo);#
> freeswitch::consoleLog("INFO","Endpoint dispostion huphook is:
> $endDispo\n");
> }
>
> on console its showing this:
>
> 2013-05-15 11:51:13.157662 [INFO] switch_cpp.cpp:1275 Endpoint dispostion
> huphook is: -ERR No such channel!
>

The channel itself is gone - the endpoints have been disconnected. This
means you cannot use uuid_getvar. However, the hangup hook script should
receive an object that contains all the information about the channel.
According to the wiki you just need to use "our $env;" at the beginning of
the script and you should be able to glean everything you need from the
$env object. Check this page for details:

http://wiki.freeswitch.org/wiki/Mod_perl_Hangup_Hook

-MC


>
>
> On Wed, May 15, 2013 at 3:42 AM, Michael Collins <msc at freeswitch.org>wrote:
>
>>
>>
>>
>> On Mon, May 13, 2013 at 10:31 PM, Ashish gautam <ashish at nms.co.in> wrote:
>>
>>> Session gets dissolved in hangupHook and we cannot do anything on the
>>> basis of UUID
>>
>> Normally yes, but that's why we have the chan var session_in_hangup_hook<https://wiki.freeswitch.org/wiki/Channel_Variables#session_in_hangup_hook>.
>> Try setting that to true and then using your api_hangup_hook.
>> -MC
>>
>>
>>>
>>> On Mon, May 13, 2013 at 2:34 PM, Telecube - John <john at telecube.com.au>wrote:
>>>
>>>>  If you are using Lua script there is ' session:setHangupHook' detailed
>>>> here: http://wiki.freeswitch.org/wiki/Mod_lua#session:setHangupHook
>>>>
>>>> I assume there's something similar in the xml configs
>>>>
>>>> Regards,
>>>> John
>>>>
>>>>
>>>>
>>>> On 13/05/13 5:20 PM, Ashish gautam wrote:
>>>>
>>>> Hi,
>>>>
>>>>  Is there anything like hangup extension which gets executed after the
>>>> call is hung up for which the UUID is same and based on that I can do
>>>> things for the same call like we have in Asterisk?
>>>>
>>>>  Thanks.
>>>>
>>>>  Regards,
>>>>
>>>>  --Ashish
>>>>
>>>>
>>>> _________________________________________________________________________
>>>> Professional FreeSWITCH Consulting Services:consulting at freeswitch.orghttp://www.freeswitchsolutions.com
>>>>
>>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server
>>>>
>>>> Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
>>>>
>>>> FreeSWITCH-users mailing listFreeSWITCH-users at lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.freeswitch.org
>>>>
>>>>
>>>>
>>>>
>>>> _________________________________________________________________________
>>>> Professional FreeSWITCH Consulting Services:
>>>> consulting at freeswitch.org
>>>> http://www.freeswitchsolutions.com
>>>>
>>>> 
>>>> 
>>>>
>>>> Official FreeSWITCH Sites
>>>> http://www.freeswitch.org
>>>> http://wiki.freeswitch.org
>>>> http://www.cluecon.com
>>>>
>>>> FreeSWITCH-users mailing list
>>>> FreeSWITCH-users at lists.freeswitch.org
>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>> UNSUBSCRIBE:
>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>> http://www.freeswitch.org
>>>>
>>>>
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> 
>>> 
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://wiki.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>>
>>
>>
>> --
>> Michael S Collins
>> Twitter: @mercutioviz
>> http://www.FreeSWITCH.org
>> http://www.ClueCon.com
>> http://www.OSTAG.org
>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> 
>> 
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
Michael S Collins
Twitter: @mercutioviz
http://www.FreeSWITCH.org
http://www.ClueCon.com
http://www.OSTAG.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130515/4a66a431/attachment-0001.html 


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