[Freeswitch-users] FreeSWITCH SLEEP
Michael Collins
msc at freeswitch.org
Mon Jul 28 22:03:16 MSD 2014
The api_hangup_hook quite literally launches an API command when the
channel hangs up. There is also a reporting_hangup_hook that executes a bit
earlier in the life cycle of the channel. In any case, if you need to "do
stuff" you can do it in a script that is launched. The
session_in_hangup_hook will let you access channel variables from the
channel that just got hung up.
Here is a link to a Lua example in the wiki that shows how to use the
session_in_hangup_hook in a Lua script that gets executed at hangup:
https://wiki.freeswitch.org/wiki/Lua#Special_Case:_env_object
I don't know anything about mod_managed so I'll have to defer to those who
do. However, If you copied and pasted code directly from the source then
I'd wager that check_hangup_hok() should probably be check_hangup_hook().
-MC
On Mon, Jul 28, 2014 at 10:06 AM, Andre Demattia <andretodd at verizon.net>
wrote:
> How does the API Hangup hook work?
> Also in mod managed a Hangup hook crashes, not sure if its the hook you
> are suggesting.
>
> void MangedSession::check_hangup_hok()
> {
> ATTACH_THREADS
> if(!hangupDelegate){
> switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "hangupDelegate is
> null.");
> return;
> }
> hangupDelegate(); // crashes here for null object
>
>
>
> https://jira.freeswitch.org/browse/FS-6484
> Thanks
> Andre
> ------------------------------
> From: Michael Collins <msc at freeswitch.org>
> Sent: 7/28/2014 12:46 PM
> To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
> Subject: Re: [Freeswitch-users] FreeSWITCH SLEEP
>
> Do you necessarily need the channel to be active while "doing stuff" or
> would an api_hangup_hook
> <https://wiki.freeswitch.org/wiki/Variable_api_hangup_hook> be
> sufficient?
> -MC
>
>
> On Fri, Jul 25, 2014 at 11:40 AM, Andre <andretodd at verizon.net> wrote:
>
>> After a call I have transfer after bridge on. When the call goes back to
>> the dial plan I want to sleep the call do some stuff and hang-up.
>>
>>
>>
>> On the original bridge I do have hangup after bridge on.
>>
>>
>>
>> What is the correct syntax for me to sleep then hangup?
>>
>> Do I have to Answer the call for sleep to work?
>>
>> Example: After transfer go to :
>>
>> //do I need to Answer again for sleep to work?
>>
>> <action application="sleep" data="5000"/>
>>
>> // run some scripts not related to freeswitch
>>
>> <action application="hangup"/>
>>
>> _________________________________________________________________________
>> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140728/cad00aeb/attachment.html
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list