Hi,
I have a simple auto-dialer that works fine.
The dialer dials a number through a Zap channel and then playback sound file. The dialer works by placing a call file in /var/spool/asterisk/outgoing.
I have however a problem, I can’t detect when the number dialed actually picks the phone. (When using a call file or manager api).
The problem I encounter is that I am not sure when to start the playback.
Now I use a delay of 8 seconds that works fine, but if the dialed person pick the phone in the first ring then he/she need to wait 1,2 sec, or if they pick the phone after 4 rings then they miss the start of the sound file.
Any idea how to detect when the other party actually picked the call?
(From Asterisk view the channel is up once Zap answered it)
The DIALSTATUS returns null.
Looking at manager events I also could not see an event that corresponds to the event that the called party picked the phone.
Here is the code of the call file and extesnion.conf:
Call file:
Channel: Zap/3/www9542922900
MaxRetries: 5
WaitTime: 30
Set: AUTODIALFILE=/var/lib/asterisk/sounds/PTV/broadcast_msg
Context: autodial-out
Extension: s
Priority: 1
extension.conf:
[autodial-out]
;exten => s,1,Answer
exten => s,1,NoOp(${DIALSTATUS})
exten => s,n,Wait(9)
exten => s,n,NoOp(${DIALSTATUS})
exten => s,n,Background(${AUTODIALFILE})
exten => s,n,Hangup(end-of-auto-dial)
Thanks