Hi. This was my experience:
I created an extension:
softphone
deny=0.0.0.0/0.0.0.0
dtmfmode=rfc2833
canreinvite=no
context=xxxxxxxx
host=dynamic
trustrpid=yes
sendrpid=no
type=friend
nat=yes
qualify=yes
qualifyfreq=60
transport=udp
avpf=no
icesupport=no
encryption=no
callgroup=
pickupgroup=
permit=0.0.0.0/0.0.0.0
callcounter=yes
faxdetect=no
100
callerid=My Id <100>
dial=SIP/100
mailbox=100@default
secret=YyYyYyYyYyYyYyYy
And Its dialplan:
[marcador-automatico]
exten => _[123]XX, 1, NoOp(Llamada a una extension desde MARCADOR AUTOMATICO)
exten => _[123]XX, n, Dial(SIP/${EXTEN},${GLOBAL(DIAL_TIMEOUT)})
exten => _[123]XX, n, NoOp(Marcador Automatico el resultado d contestar fue: ${DIALSTATUS})
exten => _[123]XX, n, Hangup()
exten => _XXXNXXXXXX, 1, NoOp(Llamada a un celular desde MARCADOR AUTOMATICO)
exten => _XXXNXXXXXX, n, Dial(${GLOBAL(CANAL_SALIDA)}, ${GLOBAL(DIAL_TIMEOUT)}, D(w03${EXTEN}))
exten => _XXXNXXXXXX, n, Hangup()
[mensaje-automatico]
exten => s, 1, NoOp(Marcador Automatico el resultado d contestar fue: ${DIALSTATUS})
exten=> s, n, Background(en/silence/1)
exten=> s, n, AMD()
exten=> s, n, NoOp(El resultado del analisis ${AMDSTATUS})
exten=> s, n, GotoIf("${AMDSTATUS}"=“HUMAN”?humn:mach)
exten=> s, n(humn), NoOp(Es un humano!!!)
exten=> s, n, Playback(/var/lib/asterisk/sounds/${GLOBAL(ORGANIZACION)}/marcadorAutomatico/tmp/mensaje-marcador)
exten=> s, n, Hangup()
exten=> s, n(mach), NoOp(Es una Maquina!!!)
exten=> s, n, WaitForSilence(4500,2,16)
exten=> s, n, Hangup()
I created 2 call files, one for the extension, one for a mobile:
Channel: LOCAL/100@marcador-automatico
CallerID: Marcador NSS <888888>
MaxRetries: 1
RetryTime: 1
WaitTime: 10
Account: marcador-aut
Context: mensaje-automatico
Extension: s
Priority: 1
;##############################
hannel: LOCAL/XXXXXXXXXX@marcador-automatico
CallerID: “Marcador NSS” <888888>
MaxRetries: 1
RetryTime: 1
WaitTime: 25
Account: marcador-aut
Context: mensaje-automatico
Extension: s
Priority: 1
;#######################
This was the situation: When extensioncall file was enabled, that worked fine. This is the output:
[root@astsk-local ~]# cp /var/lib/asterisk/sounds/softfarr/marcadorAutomatico/scripts/call/100-archivo.call /var/spool/asterisk/outgoing/;exit exit
– Attempting call on LOCAL/100@marcador-automatico for s@mensaje-automatico:1 (Retry 1)
– Executing [100@marcador-automatico:1] NoOp(“Local/100@marcador-automatico-00000014;2”, “Llamada a una extension desde MARCADOR AUTOMATICO”) in new stack
– Executing [100@marcador-automatico:2] NoOp(“Local/100@marcador-automatico-00000014;2”, “MARCADOR AUTOMATICO - Paso 1”) in new stack
– Executing [100@marcador-automatico:3] Dial(“Local/100@marcador-automatico-00000014;2”, “SIP/100,25”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/100
– SIP/100-00000020 is ringing
– SIP/100-00000020 answered Local/100@marcador-automatico-00000014;2
> Channel Local/100@marcador-automatico-00000014;1 was answered
– Executing [s@mensaje-automatico:1] NoOp(“Local/100@marcador-automatico-00000014;1”, "Marcador Automatico el resultado d contestar fue: ") in new stack
– Executing [s@mensaje-automatico:2] BackGround(“Local/100@marcador-automatico-00000014;1”, “en/silence/1”) in new stack
– <Local/100@marcador-automatico-00000014;1> Playing ‘en/silence/1.gsm’ (language ‘en’)
> 0xa73cf80 – Probation passed - setting RTP source address to 192.168.1.150:65356
== Spawn extension (marcador-automatico, 100, 3) exited non-zero on ‘Local/100@marcador-automatico-00000014;2’
– Executing [s@mensaje-automatico:3] AMD(“SIP/100-00000020”, “”) in new stack
– AMD: SIP/100-00000020 888888 (N/A) (Fmt: slin)
– AMD: initialSilence [4000] greeting [9000] afterGreetingSilence [2250] totalAnalysisTime [15000] minimumWordLength [100] betweenWordsSilence [50] maximumNumberOfWords [5] silenceThreshold [256] maximumWordLength [5000]
– AMD: Channel [SIP/100-00000020]. Changed state to STATE_IN_SILENCE
– AMD: Channel [SIP/100-00000020]. ANSWERING MACHINE: silenceDuration:4000 initialSilence:4000
– Executing [s@mensaje-automatico:4] NoOp(“SIP/100-00000020”, “El resultado del analisis MACHINE”) in new stack
– Executing [s@mensaje-automatico:5] GotoIf(“SIP/100-00000020”, ““MACHINE”=“HUMAN”?humn:mach”) in new stack
– Goto (mensaje-automatico,s,6)
– Executing [s@mensaje-automatico:6] NoOp(“SIP/100-00000020”, “Es un humano!!!”) in new stack
– Executing [s@mensaje-automatico:7] Playback(“SIP/100-00000020”, “/var/lib/asterisk/sounds/softfarr/marcadorAutomatico/tmp/mensaje-marcador”) in new stack
– <SIP/100-00000020> Playing ‘/var/lib/asterisk/sounds/softfarr/marcadorAutomatico/tmp/mensaje-marcador.gsm’ (language ‘en’)
[2016-07-05 14:00:17] NOTICE[2005]: chan_sip.c:28236 handle_request_register: Registration from ‘“907” sip:907@179.33.205.204:5060’ failed for ‘89.163.242.218:5117’ - Wrong password
== Spawn extension (mensaje-automatico, s, 7) exited non-zero on ‘SIP/100-00000020’
[2016-07-05 14:00:31] NOTICE[30012]: pbx_spool.c:427 attempt_thread: Call completed to LOCAL/100@marcador-automatico
When I got enabled mobile call file, then this happened: Asterisk detected ANSWERED status, then the audio began to be played but the mobile wasn’t ringing. When audio had advanced some seconds, mobile began to ring and when I attended the call the message ended. Then I hung up.
This is the output:
[root@astsk-local ~]# cp /var/lib/asterisk/sounds/softfarr/marcadorAutomatico/scripts/call/100-archivo.call /var/spool/asterisk/outgoing/;exit exit
– Attempting call on LOCAL/100@marcador-automatico for s@mensaje-automatico:1 (Retry 1)
– Executing [100@marcador-automatico:1] NoOp(“Local/100@marcador-automatico-00000014;2”, “Llamada a una extension desde MARCADOR AUTOMATICO”) in new stack
– Executing [100@marcador-automatico:2] NoOp(“Local/100@marcador-automatico-00000014;2”, “MARCADOR AUTOMATICO - Paso 1”) in new stack
– Executing [100@marcador-automatico:3] Dial(“Local/100@marcador-automatico-00000014;2”, “SIP/100,25”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/100
– SIP/100-00000020 is ringing
– SIP/100-00000020 answered Local/100@marcador-automatico-00000014;2
> Channel Local/100@marcador-automatico-00000014;1 was answered
– Executing [s@mensaje-automatico:1] NoOp(“Local/100@marcador-automatico-00000014;1”, "Marcador Automatico el resultado d contestar fue: ") in new stack
– Executing [s@mensaje-automatico:2] BackGround(“Local/100@marcador-automatico-00000014;1”, “en/silence/1”) in new stack
– <Local/100@marcador-automatico-00000014;1> Playing ‘en/silence/1.gsm’ (language ‘en’)
> 0xa73cf80 – Probation passed - setting RTP source address to 192.168.1.150:65356
== Spawn extension (marcador-automatico, 100, 3) exited non-zero on ‘Local/100@marcador-automatico-00000014;2’
– Executing [s@mensaje-automatico:3] AMD(“SIP/100-00000020”, “”) in new stack
– AMD: SIP/100-00000020 888888 (N/A) (Fmt: slin)
– AMD: initialSilence [4000] greeting [9000] afterGreetingSilence [2250] totalAnalysisTime [15000] minimumWordLength [100] betweenWordsSilence [50] maximumNumberOfWords [5] silenceThreshold [256] maximumWordLength [5000]
– AMD: Channel [SIP/100-00000020]. Changed state to STATE_IN_SILENCE
– AMD: Channel [SIP/100-00000020]. ANSWERING MACHINE: silenceDuration:4000 initialSilence:4000
– Executing [s@mensaje-automatico:4] NoOp(“SIP/100-00000020”, “El resultado del analisis MACHINE”) in new stack
– Executing [s@mensaje-automatico:5] GotoIf(“SIP/100-00000020”, ““MACHINE”=“HUMAN”?humn:mach”) in new stack
– Goto (mensaje-automatico,s,6)
– Executing [s@mensaje-automatico:6] NoOp(“SIP/100-00000020”, “Es un humano!!!”) in new stack
– Executing [s@mensaje-automatico:7] Playback(“SIP/100-00000020”, “/var/lib/asterisk/sounds/softfarr/marcadorAutomatico/tmp/mensaje-marcador”) in new stack
– <SIP/100-00000020> Playing ‘/var/lib/asterisk/sounds/softfarr/marcadorAutomatico/tmp/mensaje-marcador.gsm’ (language ‘en’)
[2016-07-05 14:00:17] NOTICE[2005]: chan_sip.c:28236 handle_request_register: Registration from ‘“907” sip:907@179.33.205.204:5060’ failed for ‘89.163.242.218:5117’ - Wrong password
== Spawn extension (mensaje-automatico, s, 7) exited non-zero on ‘SIP/100-00000020’
[2016-07-05 14:00:31] NOTICE[30012]: pbx_spool.c:427 attempt_thread: Call completed to LOCAL/100@marcador-automatico
astsk-local*CLI> !bash
[root@astsk-local ~]#
[root@astsk-local ~]# cp /var/lib/asterisk/sounds/softfarr/marcadorAutomatico/scripts/call/softfarr-2016-06-27-3176362421.call /var/spool/asterisk/outgoing/;exit
exit
[2016-07-05 14:00:57] NOTICE[2005]: chan_sip.c:28236 handle_request_register: Registration from ‘“200” sip:200@179.33.205.204:5060’ failed for ‘89.163.242.218:5083’ - Wrong password
– Attempting call on LOCAL/3176362421@marcador-automatico for s@mensaje-automatico:1 (Retry 1)
– Executing [3176362421@marcador-automatico:1] NoOp(“Local/3176362421@marcador-automatico-00000015;2”, “Llamada a un celular desde MARCADOR AUTOMATICO”) in new stack
– Executing [3176362421@marcador-automatico:2] Dial(“Local/3176362421@marcador-automatico-00000015;2”, “SIP/201,25,D(w033176362421)”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/201
– SIP/201-00000021 is ringing
– SIP/201-00000021 answered Local/3176362421@marcador-automatico-00000015;2
– Sending DTMF ‘w033176362421’ to the called party.
> 0xa73cf80 – Probation passed - setting RTP source address to 192.168.1.165:5012
> Channel Local/3176362421@marcador-automatico-00000015;1 was answered
– Executing [s@mensaje-automatico:1] NoOp(“Local/3176362421@marcador-automatico-00000015;1”, "Marcador Automatico el resultado d contestar fue: ") in new stack
– Executing [s@mensaje-automatico:2] BackGround(“Local/3176362421@marcador-automatico-00000015;1”, “en/silence/1”) in new stack
– <Local/3176362421@marcador-automatico-00000015;1> Playing ‘en/silence/1.gsm’ (language ‘en’)
== Spawn extension (marcador-automatico, 3176362421, 2) exited non-zero on ‘Local/3176362421@marcador-automatico-00000015;2’
– Executing [s@mensaje-automatico:3] AMD(“SIP/201-00000021”, “”) in new stack
– AMD: SIP/201-00000021 888888 (N/A) (Fmt: slin)
– AMD: initialSilence [4000] greeting [9000] afterGreetingSilence [2250] totalAnalysisTime [15000] minimumWordLength [100] betweenWordsSilence [50] maximumNumberOfWords [5] silenceThreshold [256] maximumWordLength [5000]
– AMD: Channel [SIP/201-00000021]. Changed state to STATE_IN_SILENCE
– AMD: Channel [SIP/201-00000021]. HUMAN: silenceDuration:2260 afterGreetingSilence:2250
– Executing [s@mensaje-automatico:4] NoOp(“SIP/201-00000021”, “El resultado del analisis HUMAN”) in new stack
– Executing [s@mensaje-automatico:5] GotoIf(“SIP/201-00000021”, ““HUMAN”=“HUMAN”?humn:mach”) in new stack
– Goto (mensaje-automatico,s,6)
– Executing [s@mensaje-automatico:6] NoOp(“SIP/201-00000021”, “Es un humano!!!”) in new stack
– Executing [s@mensaje-automatico:7] Playback(“SIP/201-00000021”, “/var/lib/asterisk/sounds/softfarr/marcadorAutomatico/tmp/mensaje-marcador”) in new stack
– <SIP/201-00000021> Playing ‘/var/lib/asterisk/sounds/softfarr/marcadorAutomatico/tmp/mensaje-marcador.gsm’ (language ‘en’)
[2016-07-05 14:01:44] NOTICE[2005]: chan_sip.c:28236 handle_request_register: Registration from ‘“100” sip:100@179.33.205.204:5060’ failed for ‘89.163.242.218:5092’ - Wrong password
– Executing [s@mensaje-automatico:8] Hangup(“SIP/201-00000021”, “”) in new stack
== Spawn extension (mensaje-automatico, s, 8) exited non-zero on ‘SIP/201-00000021’
[2016-07-05 14:01:56] NOTICE[30558]: pbx_spool.c:427 attempt_thread: Call completed to LOCAL/3176362421@marcador-automatico
How do I sync that the audio begins to be played only when the mobile is off the hook and not before as is happening now, even before the mobile starts ringing?
Thankyou in advance for your help.