Introducing 1 second answer delay

Hello. I’ve a call scenario where calls are received from the A-Party - Asterisk - B-Pary ,So the asterisk is in between. Calls are originated from A and terminated at B. I’ve some of the calls that are terminated exactly after less than second. Thus I would like to introduce a 1 second answer delay on asterisk , i.e , not to forward the sip 200 from B to A immediately. The 1 second delay should not register the short calls on the A-party switch as connected calls.

Any help would be appreciated.

1 Like

Hello Ali!

What is the specific need? As soon as the call is terminated with BYE, immediately comes 200OK after, I can’t tell you how to effect a delay in the BYE response…

But maybe by letting me know the need for the delay, we can progress in another way.

Call Wait before you call Dial.

It’s not clear whether this is one second from initiation or one second from answer. In the latter case, you could call answer, explicitly, before Dial (not normally a good thing) and specify a delay on the Answer.

Thank for your reply.
The terminating party has an IVR problem , where some calls connects for less than 1 second and disconnects. Thus if i set the sip answer delay on asterisk for 1 second, those calls won’t be registered as connected calls on the originating switch. While normal calls will be answered normally , with 1 sec less duration registered in the cdr , which is not a big problem for me in this case .

I don’t think there’s any way to do exactly that. You’re asking for Asterisk to ignore the answer/bye for up to 1 second, which it’s not going to do and no real configuration to do exactly that, and then I assume turn it into some other rejection.

hi
if I understand the problem correctly B has bugs in there SIP handling and should be replaced with something else
but until then you would like a workaround
my best suggestion is to use the “g” option i Dial and then check if the duration is less than X and then re-Dial that extension

I found this feature outside the asterisk and it is exactly what i want to do on asterisk.
Anti-FAS connection delay (milliseconds)
Specifies delay of connection signal (200 OK) for the anti-FAS call processing logic: when terminator connects the call, this signal is delivered to originator with delay. Should be greater than duration of connected FAS calls. FAS calls usually have short duration: 1-2 seconds. If we make a delay greater than the 1-2 seconds (let’s say 2500 milliseconds), the FAS calls will still be in “ringing” state at originator’s side, and not connected, so there will be no FAS at orignator’s side.

Thank you all for your help.
Here is the solution finally. The ‘U’ paramater with the DIAL() function.

[mycontext]
exten => _1234.,1,Dial(SIP/1.2.3.4/${EXTEN},U(mycontext1))
same => n,Hangup()

[mycontext1]
exten => s,1,NoOp(call answered)
same => n, wait(1)

For reference, this was cross-posted on the freeswitch forums as well

Sounds sketchy to me…

Thanks for the great addition to the topic !

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.