How to distinguish between the different type of call rejections from Javascript?
Hi, Say i originate a call to a mobile phone and the call fails. There are many possible reasons: congestion, user busy, call rejected by user, etc. Is there a way i can get the failure code from Javascript? Thanks, Max.
variable_originate_disposition On Aug 5, 2009, at 9:56 PM, Max Bridgewater wrote:
Hi,
Say i originate a call to a mobile phone and the call fails. There are many possible reasons: congestion, user busy, call rejected by user, etc. Is there a way i can get the failure code from Javascript? Thanks, Max. _______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
interesting! what values can contain "variable_originate_disposition"? And can I set them manually in a script to reject a call simulating user busy or call rejected? A lua example? Thanks, Raffaele On Wed, Aug 5, 2009 at 16:02, Seven Du <dujinfang@gmail.com> wrote:
variable_originate_disposition
On Aug 5, 2009, at 9:56 PM, Max Bridgewater wrote:
Hi,
Say i originate a call to a mobile phone and the call fails. There are many possible reasons: congestion, user busy, call rejected by user, etc. Is there a way i can get the failure code from Javascript? Thanks, Max. _______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Wed, Aug 5, 2009 at 3:54 PM, Raffaele P. Guidi < raffaele.p.guidi@gmail.com> wrote:
interesting! what values can contain "variable_originate_disposition"? And can I set them manually in a script to reject a call simulating user busy or call rejected? A lua example? Thanks, Raffaele
Start here: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_hangup And note the link to the hangup causes. As far as Lua, I'm not sure there's a good reason to do it there. Could you give us pseudo code example of what you're thinking of doing? -MC
Actually I was reading that page, right now. I wrote a small lua script that simulates a call with random wait time before answering, randomly not answering at all and saying things for a random times once answered. This would be useful for testing purposes simulating load, letting call center operators try scripts against "fake" numbers with a "realistic" behaviour and eventually to test and debug an automated dialer. The script is almost ready (can contribute it should you find it useful), I used it today to simulate load on my windows laptop with 50 concurrent calls and peaks of 20/30 simultaneous calls connected (cpu was below 3%). I only miss some use cases such as some CALL_REJECTED, USER_BUSY, NO_ANSWER On Thu, Aug 6, 2009 at 00:16, Michael Collins <msc@freeswitch.org> wrote:
On Wed, Aug 5, 2009 at 3:54 PM, Raffaele P. Guidi < raffaele.p.guidi@gmail.com> wrote:
interesting! what values can contain "variable_originate_disposition"? And can I set them manually in a script to reject a call simulating user busy or call rejected? A lua example? Thanks, Raffaele
Start here: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_hangup
And note the link to the hangup causes. As far as Lua, I'm not sure there's a good reason to do it there. Could you give us pseudo code example of what you're thinking of doing? -MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
The bigger problem is some end points won't hang up the call in a consistent manner... some phones say user_rejected or user_busy when you reject the call with the reject button. /b On Aug 5, 2009, at 5:16 PM, Michael Collins wrote:
On Wed, Aug 5, 2009 at 3:54 PM, Raffaele P. Guidi <raffaele.p.guidi@gmail.com
wrote: interesting! what values can contain "variable_originate_disposition"? And can I set them manually in a script to reject a call simulating user busy or call rejected? A lua example?
Thanks, Raffaele
Start here: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_hangup
And note the link to the hangup causes. As far as Lua, I'm not sure there's a good reason to do it there. Could you give us pseudo code example of what you're thinking of doing? -MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Well, I would randomly insert all of those cases to make it more realistic... only thing I cannot manage to issue USER_BUSY from lua (and neither from the dialplan, actually). <anti-action application="respond" data="407" /> (407 or 486 or whatever...) doesn't behave as I expected and neither <action application="hangup" data="407" /> (407 or 486 or USER_BUSY or whatever...) and I cannot find a a session:reject(<hangupcause>) method in lua. Can you give me a hint? On Thu, Aug 6, 2009 at 01:23, Brian West <brian@freeswitch.org> wrote:
The bigger problem is some end points won't hang up the call in a consistent manner... some phones say user_rejected or user_busy when you reject the call with the reject button. /b
On Aug 5, 2009, at 5:16 PM, Michael Collins wrote:
On Wed, Aug 5, 2009 at 3:54 PM, Raffaele P. Guidi < raffaele.p.guidi@gmail.com> wrote:
interesting! what values can contain "variable_originate_disposition"? And can I set them manually in a script to reject a call simulating user busy or call rejected? A lua example? Thanks, Raffaele
Start here: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_hangup
And note the link to the hangup causes. As far as Lua, I'm not sure there's a good reason to do it there. Could you give us pseudo code example of what you're thinking of doing? -MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Wed, Aug 5, 2009 at 6:44 PM, Raffaele P. Guidi < raffaele.p.guidi@gmail.com> wrote:
Well, I would randomly insert all of those cases to make it more realistic... only thing I cannot manage to issue USER_BUSY from lua (and neither from the dialplan, actually).
<anti-action application="respond" data="407" /> (407 or 486 or whatever...)
doesn't behave as I expected and neither
<action application="hangup" data="407" /> (407 or 486 or USER_BUSY or whatever...)
and I cannot find a a session:reject(<hangupcause>) method in lua.
Can you give me a hint?
You can execute pretty much any dialplan app with the session:execute command: http://wiki.freeswitch.org/wiki/Lua#session:execute Try something like: session:execute("hangup","USER_BUSY"); -MC
Done, it (of course, thanks) worked smoothly. I've published the example on the wiki. http://wiki.freeswitch.org/wiki/Fakecall_responder (and linked in mod_lua samples) Regards, Raffaele On Thu, Aug 6, 2009 at 04:03, Michael Collins <msc@freeswitch.org> wrote:
On Wed, Aug 5, 2009 at 6:44 PM, Raffaele P. Guidi < raffaele.p.guidi@gmail.com> wrote:
Well, I would randomly insert all of those cases to make it more realistic... only thing I cannot manage to issue USER_BUSY from lua (and neither from the dialplan, actually).
<anti-action application="respond" data="407" /> (407 or 486 or whatever...)
doesn't behave as I expected and neither
<action application="hangup" data="407" /> (407 or 486 or USER_BUSY or whatever...)
and I cannot find a a session:reject(<hangupcause>) method in lua.
Can you give me a hint?
You can execute pretty much any dialplan app with the session:execute command: http://wiki.freeswitch.org/wiki/Lua#session:execute
Try something like: session:execute("hangup","USER_BUSY");
-MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Thu, Aug 6, 2009 at 7:49 AM, Raffaele P. Guidi < raffaele.p.guidi@gmail.com> wrote:
Done, it (of course, thanks) worked smoothly. I've published the example on the wiki. http://wiki.freeswitch.org/wiki/Fakecall_responder (and linked in mod_lua samples)
Regards, Raffaele
Thanks for paying the wiki tax! We appreciate it when folks document their knowledge. Please let me know if you have any wiki questions in the future. -MC
I'm bridging 2 calls in a javascript file, I originate the first call and then execute a bridge with an origination string for the second call. If I hangup the first call while trying to make the second call, I get this on the console: 2009-08-05 16:44:05.69122 [NOTICE] switch_ivr_originate.c:1994 Hangup sofia/external/005622170039 [CS_CONSUME_MEDIA] [ORIGINATOR_CANCEL] 2009-08-05 16:44:05.69122 [DEBUG] switch_channel.c:1683 Send signal sofia/external/005622170039 [KILL] 2009-08-05 16:44:05.69122 [DEBUG] switch_core_session.c:932 Send signal sofia/external/005622170039 [BREAK] 2009-08-05 16:44:05.69122 [DEBUG] switch_ivr_originate.c:2134 Originate Cancelled by originator termination Cause: 487 [ORIGINATOR_CANCEL] 2009-08-05 16:44:05.69122 [INFO] mod_dptools.c:2092 Originate Failed. Cause: ORIGINATOR_CANCEL But if I check hangup_cause in the CHANNEL_HANGUP_COMPLETE event, I see NORMAL_CLEARING. And the variable_originate_disposition has a value of "failure". Where can I get the detail of knowing the call/bridge failed because of 'ORIGINATOR_CANCEL' as reported through the console? Thanks! Nicolas the value of variable_originate_disposition at the events level and when I have an origination failure due to 'ORIGINATOR_CANCEL On Wed, Aug 5, 2009 at 6:16 PM, Michael Collins <msc@freeswitch.org> wrote:
On Wed, Aug 5, 2009 at 3:54 PM, Raffaele P. Guidi < raffaele.p.guidi@gmail.com> wrote:
interesting! what values can contain "variable_originate_disposition"? And can I set them manually in a script to reject a call simulating user busy or call rejected? A lua example? Thanks, Raffaele
Start here: http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_hangup
And note the link to the hangup causes. As far as Lua, I'm not sure there's a good reason to do it there. Could you give us pseudo code example of what you're thinking of doing? -MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (6)
-
Brian West
-
Max Bridgewater
-
Michael Collins
-
Nicolas Brenner
-
Raffaele P. Guidi
-
Seven Du