Is there a way to run AMD during an outgoing call, before the call being answered?
I’ve tried different macros, putting Answers in the extensions, using Dial() options, nothing seems to work. I need AMD to run before answer.This is what is happening to calls in my country:
Dial a number -> Receive an audio saying the number doesn’t exist -> Almost at the end of the audio, the phone’s company send me an ANSWERED sinalization -> AMD starts running, but the channel is dropped right after AMD starts.
This problem also happens with answering machines. The audio tell me to leave a message after the ‘beep’ is played, I receive an ANSWERED sinalization, the ‘beep’ is played after the answer and AMD detects it as if it was a ‘Hello’.
My point is: drop a call that has audio before being Answered.
I’ve tried
exten => s,1,Dial('myNumber',60,gM(analisechamada-amd))
exten => s,n,Hangup
;
[macro-analisechamada-amd]
exten => s,1,AMD
exten => s,n,Noop(AMD STATUS e ${AMDSTATUS})
exten => s,n,Noop(AMD CAUSE e ${AMDCAUSE})
exten => s,n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
;
exten => s,n(mach),SoftHangup(${CHANNEL})
exten => s,n,hangup
;
exten => s,n(humn),WaitForSilence(20)
exten => s,n,Hangup
This one gives me AMDSTATUS as Human for answering machines because it starts right before the ‘beep’.
Also tried
exten => s,1,Macro(analisechamada-amd)
exten => s,n,Hangup
;
[macro-analisechamada-amd]
exten => s,1,Answer
exten => s,n,AMD
exten => s,n,Dial('myNumber',60)
exten => s,n,Noop(AMD STATUS e ${AMDSTATUS})
exten => s,n,Noop(AMD CAUSE e ${AMDCAUSE})
exten => s,n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
;
exten => s,n(mach),SoftHangup(${CHANNEL})
exten => s,n,hangup
;
exten => s,n(humn),WaitForSilence(20)
exten => s,n,Hangup
This one doesn’t work at all. It runs AMD and, after AMD sets a result, it Dials to a number. Nothing else in this one uses AMD.
I’m running Asterisk 11.9.0 on Debian 7.5.