Call file playback executes before the person answer the call

hi i have a call file as below. it sends the call to context

----Channel: DAHDI/g0/909133
MaxRetries: 2
RetryTime: 60
WaitTime: 30
Context: pooria
Extension: 21

[pooria]
exten => 21,1,Answer()
exten => 21,n,Wait(5)
exten => 21,n,Playback(custom/basalam)
exten => 21,n,AGI(khareji.php)

when call file is running the playback executes before the pair answer the call. i used wait application to postpone the playback app. what should i do to play the sound after answering the person.

thanks in advance

What DAHDI technology are you using? If analog this is normal as there is no call supervision provided on analog lines. They are considered answered immediately. There is an option which turns on extremely experimental code to try to guess the state of things, but it may disconnect calls.

If the service provider provides line reversal supervision, you should be able to enable that. If they don’t the call will never answer if you enable it.

Generally, though anything that requires reliable answer or disconnect supervision should use ISDN, directly, or indirectly via VoIP.

well, im using Digium Analog card. so you say there is no way to find out if the call is answered?
thanks.

Correct. In the world of analog telephony, there is no sure answer supervision. Once the channel is up, the call is up.

1 Like

so if i use E1/T1 Digital Card there shouldn’t be any problem?

With a digital line you should receive an answer only when they actually answer.