Call answer event triggered while call is in ringing state


User makes call using soft-phone,
Asterisk progress the call and dial to gateway,
Called party (GSM mobile) starts ringing.

What is happening: soft-phones start call-timer as mobile starts ringing.
What I want: call-timer should start when called party answer the call.

Is there a problem with Asterisk or am I missing any configuration or dialplan application?

Asterisk v. 12.8.2

What is the console output? It may be that the gateway is answering the call, in which case there’s nothing Asterisk can do.

I see only this on console output:

-- Executing [120xxxxxxxx@sip-call:31] Dial("SIP/mayanktest-000092d9", "SIP/gatewayname/120xxxxxxxx,40,M(sipanswer,457966827091_sipcall)") in new stack

== Using SIP RTP CoS mark 5
– Called SIP/gatewayname/120xxxxxxxx
– SIP/gatewayname-000092da is making progress passing it to SIP/mayanktest-000092d9

timer start when “Called SIP/gatewayname/120xxxxxxxx” line appears.

I tried same with FreeSwitch and it worked fine i.e. timer started when called party answered the call.

Either there is an issue with the soft phones, in particular in relation to early media, or your dialplan has answered the incoming call. We need to see the earlier parts of the dialplan, in particular to look for any call of Progress, or Answer, or anything which would implicitly answer the incoming side.

I don’t think you are actually answering, as I don’t think you would get the making progress message if the incoming channel was up.

I think avoiding calling Progress (and of course not answering) will avoid early media reaching the phone. However, if the gateway doesn’t send early media, you will probably here a locally generated ringback even when the network is sending busy in band.

If the phones are triggering on 183 itself, the only tactic I can think of is to use & and a local channel that never answers, in the dialstring.

I’m guessing that FreeSwitch either doesn’t support early media, or fails to forward 183, i.e. this is an interaction between a buggy phone and a more complete implementation of SIP.

Thanks for guiding,

I can’t paste complete dialplan but I tried by commenting specific lines and got that after removing the backgrounddetect as written in line below, it works as I need.
“same => n,BackgroundDetect(/var/lib/asterisk/sounds/en/silence/4,1,1)”

but I was using BackgroundDetect to check if rtp communication with caller (softphone) is possible or not. If not I used to disconnect the call.

I need both backgrounddetect and proper call start trigger. Is there any option?

I did not get it, that backgrounddetect is performed before dial then How/why it is affecting to Dial application behavior?

You need to ask that of the soft phone developers. It is a bug/feature in the phone. I would say that the phone is starting the timer when it receives RTP, so you cannot test whether it can receive RTP without starting the timer.

The BackgroundDetect application answers to ensure a full media path so it receives media. There’s currently no option to disable this.