execute script before hangup
i'm trying to execute a script 1 or 2 seconds before a user hangs up. is this possible? i'm using "api_hangup_hook=" to execute the script currently but it executes after the user hangs up. is there anyway to have api_hangup_hook execute before the actual hang up of the call?
how would you know whether or not the user is going to hang up in 1 or 2 seconds? vip killa wrote:
i'm trying to execute a script 1 or 2 seconds before a user hangs up. is this possible? i'm using "api_hangup_hook=" to execute the script currently but it executes after the user hangs up. is there anyway to have api_hangup_hook execute before the actual hang up of the call? ------------------------------------------------------------------------
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
well, when the user hangs up, freeswitch detects it and reacts accordingly so there must be a way to execute a command between the time freeswitch detects and reacts. On Mon, Nov 16, 2009 at 11:36 AM, Shelby Ramsey <sramsey@sipinterchange.com>wrote:
how would you know whether or not the user is going to hang up in 1 or 2 seconds?
vip killa wrote:
i'm trying to execute a script 1 or 2 seconds before a user hangs up. is this possible? i'm using "api_hangup_hook=" to execute the script currently but it executes after the user hangs up. is there anyway to have api_hangup_hook execute before the actual hang up of the call? ------------------------------------------------------------------------
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
Yes but we can't time travel and do it 1 to 2 seconds before this takes place... Can you outline your reasoning as to WHY you need to do this? Are you trying to do your billing inline when the user hangs up? /b On Nov 16, 2009, at 10:44 AM, vip killa wrote:
well, when the user hangs up, freeswitch detects it and reacts accordingly so there must be a way to execute a command between the time freeswitch detects and reacts.
well, the actual time does not matter, i just need the command to execute before the user hangs up. what im trying to do is maintain a conference (i don't want it to end unless i choose to end it) but once the last person leaves the conference, it automatically ends. so i figure if i can do a pa call to the conference before that last user hangs up, then the conference will continue. On Mon, Nov 16, 2009 at 11:54 AM, Brian West <brian@freeswitch.org> wrote:
Yes but we can't time travel and do it 1 to 2 seconds before this takes place... Can you outline your reasoning as to WHY you need to do this? Are you trying to do your billing inline when the user hangs up?
/b
On Nov 16, 2009, at 10:44 AM, vip killa wrote:
well, when the user hangs up, freeswitch detects it and reacts accordingly so there must be a way to execute a command between the time freeswitch detects and reacts.
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
On Mon, 2009-11-16 at 12:08 -0500, vip killa wrote:
well, the actual time does not matter, i just need the command to execute before the user hangs up. what im trying to do is maintain a conference (i don't want it to end unless i choose to end it) but once the last person leaves the conference, it automatically ends. so i figure if i can do a pa call to the conference before that last user hangs up, then the conference will continue.
well there are a couple ways to attack this, and none have anything to do with the user "hanging up". If I put my phone on hook you cant stop that, you cant prevent it, you cant delay it, my phone is on hook - only then is a signal sent to FS to tell it that my phone is on hook, or "hung up". What you are saying is that you want the conference to run after the last person has left it (which could be for reasons other than hanging up). The conference is an application and has little to do with the channel state. The instant way would be to have the conference do an outcall to some application that just holds the conference open. Then your api hangup hook call could check to see if the conference only has that user in it and if so do whatever you wanted it to do. This would require 0 modification to any code in FS, but would allow you to achieve the task you have indicated. The other way would be to have a modification to the conference that would keep it running, this would not be as trivial as it might sound given which thread the conference runs in and all that. -- Trixter http://www.0xdecafbad.com Bret McDanel pgp key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8AE5C721
i don't understand how to do a conference outcall to an application, every time a try conference confname dial sofia/...../999999%192.168.9.999 i get Call Requested: result: [USER_NOT_REGISTERED] On Mon, Nov 16, 2009 at 2:59 PM, Trixter aka Bret McDanel < trixter@0xdecafbad.com> wrote:
On Mon, 2009-11-16 at 12:08 -0500, vip killa wrote:
well, the actual time does not matter, i just need the command to execute before the user hangs up. what im trying to do is maintain a conference (i don't want it to end unless i choose to end it) but once the last person leaves the conference, it automatically ends. so i figure if i can do a pa call to the conference before that last user hangs up, then the conference will continue.
well there are a couple ways to attack this, and none have anything to do with the user "hanging up". If I put my phone on hook you cant stop that, you cant prevent it, you cant delay it, my phone is on hook - only then is a signal sent to FS to tell it that my phone is on hook, or "hung up".
What you are saying is that you want the conference to run after the last person has left it (which could be for reasons other than hanging up). The conference is an application and has little to do with the channel state.
The instant way would be to have the conference do an outcall to some application that just holds the conference open. Then your api hangup hook call could check to see if the conference only has that user in it and if so do whatever you wanted it to do. This would require 0 modification to any code in FS, but would allow you to achieve the task you have indicated.
The other way would be to have a modification to the conference that would keep it running, this would not be as trivial as it might sound given which thread the conference runs in and all that. -- Trixter http://www.0xdecafbad.com Bret McDanel pgp key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8AE5C721
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
because the user isn't registered... and 192.168.9.999 is not a valid IP or domain. /b On Nov 16, 2009, at 3:18 PM, vip killa wrote:
i don't understand how to do a conference outcall to an application, every time a try conference confname dial sofia/...../ 999999%192.168.9.999
i get Call Requested: result: [USER_NOT_REGISTERED]
On Mon, Nov 16, 2009 at 1:18 PM, vip killa <vipkilla@gmail.com> wrote:
i don't understand how to do a conference outcall to an application, every time a try conference confname dial sofia/...../999999%192.168.9.999
i get Call Requested: result: [USER_NOT_REGISTERED]
Is 999999%192.168.9.999 a registered user on your system? -MC
it is a valid user that is not registered but the extension points to a park action On Mon, Nov 16, 2009 at 4:32 PM, Michael Collins <msc@freeswitch.org> wrote:
On Mon, Nov 16, 2009 at 1:18 PM, vip killa <vipkilla@gmail.com> wrote:
i don't understand how to do a conference outcall to an application, every time a try conference confname dial sofia/...../999999%192.168.9.999
i get Call Requested: result: [USER_NOT_REGISTERED]
Is 999999%192.168.9.999 a registered user on your system? -MC
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
On Mon, Nov 16, 2009 at 1:41 PM, vip killa <vipkilla@gmail.com> wrote:
it is a valid user that is not registered but the extension points to a park action
If I read this correctly... http://wiki.freeswitch.org/wiki/Dialplan_XML#Dialing_A_Registered_User ... Then you shouldn't be using % with a non-registered user. How about using the standard user@domain syntax? -MC
If you want to go back in the dialplan you can use the loopback channel, since you arent making any actual call out of the system, you do not wanrt to use sofia. Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca On 16-Nov-09, at 1:41 PM, vip killa wrote:
it is a valid user that is not registered but the extension points to a park action
On Mon, Nov 16, 2009 at 4:32 PM, Michael Collins <msc@freeswitch.org> wrote:
On Mon, Nov 16, 2009 at 1:18 PM, vip killa <vipkilla@gmail.com> wrote: i don't understand how to do a conference outcall to an application, every time a try conference confname dial sofia/...../ 999999%192.168.9.999
i get Call Requested: result: [USER_NOT_REGISTERED]
Is 999999%192.168.9.999 a registered user on your system? -MC
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
I personally wouldn't ever encourage anyone to use loopback. :) /b On Nov 16, 2009, at 3:53 PM, Mathieu Rene wrote:
If you want to go back in the dialplan you can use the loopback channel, since you arent making any actual call out of the system, you do not wanrt to use sofia.
Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca
Indeed, it reminds me of a PSTN switch that had some signalling links from one port to another to 'fix' a routing issue.. It's a hack and before you know it you can't go back :) On Mon, 2009-11-16 at 16:21 -0600, Brian West wrote:
I personally wouldn't ever encourage anyone to use loopback. :)
/b
On Nov 16, 2009, at 3:53 PM, Mathieu Rene wrote:
If you want to go back in the dialplan you can use the loopback channel, since you arent making any actual call out of the system, you do not wanrt to use sofia.
Mathieu Rene Avant-Garde Solutions Inc Office: + 1 (514) 664-1044 x100 Cell: +1 (514) 664-1044 x200 mrene@avgs.ca
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
On Mon, 2009-11-16 at 11:44 -0500, vip killa wrote:
well, when the user hangs up, freeswitch detects it and reacts accordingly so there must be a way to execute a command between the time freeswitch detects and reacts.
I think there is some terminology that is causing confusion. When a user hangs up the state of the channel is changed, this cannot be avoided, and probably should not be avoided. Depending on the channel type it can do somewhat evil things to have a call still "up" even though the remote end point has indicated it is no longer "up". What is it that you want to do that cannot be done using just the hangup hook? -- Trixter http://www.0xdecafbad.com Bret McDanel pgp key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8AE5C721
Conferences are totally dynamic, if there is no one in it, why does it matter that it ends? On Nov 16, 2009, at 11:44 AM, vip killa wrote:
well, when the user hangs up, freeswitch detects it and reacts accordingly so there must be a way to execute a command between the time freeswitch detects and reacts.
On Mon, Nov 16, 2009 at 11:36 AM, Shelby Ramsey <sramsey@sipinterchange.com> wrote: how would you know whether or not the user is going to hang up in 1 or 2 seconds?
vip killa wrote:
i'm trying to execute a script 1 or 2 seconds before a user hangs up. is this possible? i'm using "api_hangup_hook=" to execute the script currently but it executes after the user hangs up. is there anyway to have api_hangup_hook execute before the actual hang up of the call? ------------------------------------------------------------------------
to maintain a recording On Tue, Nov 17, 2009 at 12:35 PM, Michael Jerris <mike@jerris.com> wrote:
Conferences are totally dynamic, if there is no one in it, why does it matter that it ends?
On Nov 16, 2009, at 11:44 AM, vip killa wrote:
well, when the user hangs up, freeswitch detects it and reacts accordingly so there must be a way to execute a command between the time freeswitch detects and reacts.
On Mon, Nov 16, 2009 at 11:36 AM, Shelby Ramsey < sramsey@sipinterchange.com> wrote:
how would you know whether or not the user is going to hang up in 1 or 2 seconds?
vip killa wrote:
i'm trying to execute a script 1 or 2 seconds before a user hangs up. is this possible? i'm using "api_hangup_hook=" to execute the script currently but it executes after the user hangs up. is there anyway to have api_hangup_hook execute before the actual hang up of the call? ------------------------------------------------------------------------
_______________________________________________ FreeSWITCH-dev mailing list FreeSWITCH-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
participants (8)
-
Brian West
-
Leon de Rooij
-
Mathieu Rene
-
Michael Collins
-
Michael Jerris
-
Shelby Ramsey
-
Trixter aka Bret McDanel
-
vip killa