Hi,
Could you help me focus on a solution?
I need a crontab in the system that every day at 18:00 generates an automatic call:
00 18 * * * /home/script/Call.sh
sudo asterisk -rx "channel originate Local/5007@dp_pruebas application Dial"
exten => _5001,1,NoOP()
same => n,Set(VOLUME(TX)=2)
same => n,PlayBack(/etc/asterisk/Locuciones/MensajeFlotas)
same => n,Hangup()
exten => 5007,1,NoOP()
same => n,Set(CALLERID(name)=IT)
same => n,Dial(PJSIP/100,30,G(dp_pruebas,5001,1))
same => n,Dial(PJSIP/00XXXXXXXXX@itsp-endpoint,30,G(dp_pruebas,5001,1))
same => n,System(echo Hola, > /tmp/llamadaPerdidaOPS6.txt)
same => n,System(echo >> /tmp/llamadaPerdidaOPS6.txt)
same => n,System(echo Llamante: IT >> /tmp/llamadaPerdidaOPS6.txt)
same => n,System(echo Llamado: 100 >> /tmp/llamadaPerdidaOPS6.txt)
same => n,System(echo Fecha: ${STRFTIME(${EPOCH},,%d-%m-%Y)} >> /tmp/llamadaPerdidaOPS6.txt)
same => n,System(echo Hora: ${STRFTIME(${EPOCH},,%H:%M)} >> /tmp/llamadaPerdidaOPS6.txt)
same => n,System(echo Motivo: Se ha llamado tanto a la extension corta como al DDI y no lo han descolgado o no esta registrado. >> /tmp/llamadaPerdidaOPS6.txt)
same => n,System(echo >> /tmp/llamadaPerdidaOPS6.txt)
same => n,System(echo Un saludo, >> /tmp/llamadaPerdidaOPS6.txt)
same => n,System(cat /tmp/llamadaPerdidaOPS6.txt | mail -s "Llamada no atendida - IT" XXXX@outlook.com)
same => n,System(rm /tmp/llamadaPerdidaOPS6.txt)
same => n,Hangup(1)
With the first dial 30 seconds the dialplan no longer continues with PJSIP/00XXXXX and then SYSTEM if it fails.
Thanks,
Regards.