Zap receive answer event before call is answered

Hi, I’m running Asterisk 1.2. We have an IVR in which we do call transfer to agent. Basically, a call is received and then we dial to our agent and the call itself gets connected.

This is working fine, the problem occurs when the agent doesn’t answers or is busy. In both these case, we don’t get the status, instead Zap receives the answer event, but if we listen on the line/phone, we can hear that the phone is still ringing (i.e. agent is ringing but Zap receives answer event prematurely.)

This is how we are doing the transfer:


exten => s,1,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
exten => s,n,Set(TIMEOUT(response)=5) ; Set Response Timeout to 10 seconds
exten => s,n,set(Tries=0)
exten => s,n(_MainMenu),Set(Tries=$[${Tries} + 1])
exten => s,n,playback(${SoundFilePath}12_TransferCallMenu)
exten => s,n,dial(zap/4/34524517)
exten => s,n,WaitExten(8)
exten => s,n,Goto(s-${DIALSTATUS},1)

exten => s-BUSY,1,GotoIf($[${Tries} > 1]?calltransfer-sub-x,s,1)
exten => s-BUSY,n,Goto(s,_MainMenu)

exten => s-CHANUNAVAIL,1,GotoIf($[${Tries} > 1]?calltransfer-sub-x,s,1)
exten => s-CHANUNAVAIL,n,Goto(s,_MainMenu)

exten => s-CONGESTION,1,GotoIf($[${Tries} > 1]?calltransfer-sub-x,s,1)
exten => s-CONGESTION,n,Goto(s,_MainMenu)[/code]
exten => s,n,dial(zap/4/34524517) is where do dialing. This is the output on Asterisk console.

Executing Dial("Zap/3-1", "zap/4/34524517|6") in new stack -- Called 4/34524517 -- Zap/4-1 answered Zap/3-1 -- Attempting native bridge of Zap/3-1 and Zap/4-1
Here it shows that the call is answered, but if we listen on the phone, it (i.e. the agent) is still ringing.

I did NoOp(${DIALSTATUS}) after the Dial() application, but it doesn’t show up on the Asterisk console.

We are using analog card, if that helps.

That’s an obsolete system!

Asterisk infers an answer on analogue lines by default as many analogue lines do not provide any answer supervision, so that is all that it can do.

At least for current versions, if you knwo that the PTT is providing line reversal answer supervision, you can enable it in chan_dahdi.conf (answeronpolarityswitch). I don’t know when this capability was added.

If the PTT is not providing answer supervision in this way, you will need to talk to the PTT.

Is it possible to do it in version 1.2?

The documentation is in the sample configuration files. You should make sure that your PTT is actually providing suitable answer supervision, first, as enabling it in Asterisk when the PTT doesn’t provide it will result in the call never appearing to be answered.