incoming call-initiated Callback with sys.Callback

Catalog of dial plans
Post Reply
rybshik
Posts: 33
Joined: Mon Jun 08, 2009 2:20 am

incoming call-initiated Callback with sys.Callback

Post by rybshik » Sun Sep 16, 2012 7:31 pm

Hello,

I want to trigger/initiate a callback to My_PSTN_Number (say, 14161234567) by (physically, with my hands) dialing out from the same My_PSTN_Number to SS (via some Did). So my dial-in plan is as follows:

if sys.In then
sys.Callback("My_PSTN_Number"@freephoneline", "Preset_Number"@freephoneline")
rejectCall("Number's empty")
end

Immediately after executing sys.Callback, I want to quickly terminate the call so that my My_PSTN_Number line is ready to receive the incoming call initiated by sys.Callback.

How to achieve that? With the code above, the call is not quickly aborted, instead I am getting a system message that user is not available and voice mail prompt. It takes several seconds and i miss my incoming callback call. How to abort/skip that?

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Re: incoming call-initiated Callback with sys.Callback

Post by Aaron » Mon Sep 17, 2012 12:07 pm

You won't be able to get the hangup to happen any quicker but you can get the callback delayed so that the hangup has time to complete.

In the example below the callback will be delayed by 5 seconds which gives you time to hang up your phone and allow it to be ready to receive the new call.

Code: Select all

if sys.In then
sys.Callback("My_PSTN_Number"@freephoneline", "Preset_Number"@freephoneline", 5)
rejectCall("Number's empty")
end

rybshik
Posts: 33
Joined: Mon Jun 08, 2009 2:20 am

Re: incoming call-initiated Callback with sys.Callback

Post by rybshik » Mon Sep 17, 2012 4:42 pm

Thanks, I will add the delay as you advised.

But as far as time until hangup, does it depends on the choice of a "Hung-up" function?

Also, as far as telephone/long distance per minute charge is concerned, is there a chargeable PSTN connection established until the hung up with any of the functions?

What will be the difference (if any) if using one of the following?

Code: Select all

  rejectCall("Number's empty")
  sys.Respond(182, "Busted")    
  sys.Respond(488, "Not Answering")
  sys.Respond(600,"Hanging up.") 
  sys.Respond(BYE,"ending callback")
Is any other function/code wich would do better?

Ideally, I would like to have a quicker hang-up and no telco charges for the time prior to the hang up. The latter is particularly important while being overseas and using a costly long-distance to call a remote Did to initiate the callback.

And one more question here... As discussed in some other topic, I want to add music to the first leg while waiting for the second leg to connect:

Code: Select all

sys.Callback("sip:early_music@iptel.org&My_PSTN_Number"@freephoneline", "Preset_Number"@freephoneline", 5)
It does not work though...

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Re: incoming call-initiated Callback with sys.Callback

Post by Aaron » Tue Sep 18, 2012 11:37 am

There is no chargeable connection made if all you don't answer the call in your SIPSorcery dialplan (unless you are using a dodgy SIP provider for your incoming DID that answers calls to play progress tones).

When you call into your SIPSorcery dialplan, initiate the callback and then hangup the call using sys.Respond the call is never answered and no bilable time should be incurred. As far as the SIPSorcery dialplan processing time to handle that it's likely to be under one second and even if it could be made faster it's unlikely you'd be able to notice.

Of your hangup options only the ones below are valid:

Code: Select all

sys.Respond(488, "Not Answering")
sys.Respond(600,"Hanging up.") 
To get the progress indication on your callback you need to put the early media on the second call leg as per below. Also note your original code snippet has some invalid double quotes in it.

Code: Select all

sys.Callback("My_PSTN_Number@freephoneline", "Preset_Number@freephoneline&early_music@iptel.org", 5)

Post Reply