Hello,
I’ve been using the Asterisk addon for some time. Works great to make automated calls when my alarm triggers. Sometimes I need to change numbers depending on whether I know I will be available or not (for example, when flying long haul flights). For such situations, I just change the Asterisk dialplan and reload Asterisk. I can also point the originate command to a different context depending on how the calls should be placed and who Asterisk should call.
This is my current dialplan:
[alarm-trigger-calls]
exten => _[67]XXXXXXXX,1,NoOP(Llamadas por alarma)
same => n,Set(CHANNEL(language)=es_ES)
same => n,Set(CALLERID(all)=${my_number} <${my_number}>)
same => n,NoOp(CALLERID(all))
same => n,DBdeltree(lastcallerout)
same => n,set(DB(lastcallerout/lastcallerout)=${EXTEN})
;Llamadas simultáneas a recipient_1 y recipient_2. Si no contestan, llamada a recipient_3.
same => n,Dial(PJSIP/Movistar_endpoint/sip:${EXTEN}@telefonica.net:5070&PJSIP/Movistar_endpoint/sip:[email protected]:5070,15)
same => n,Dial(PJSIP/Movistar_endpoint/sip:[email protected]:5070,15)
;Llamada a recipient_1. Si no contesta, llamada a recipient_2
;same => n,Dial(PJSIP/Movistar_endpoint/sip:${EXTEN}@telefonica.net:5070,15)
;same => n,Dial(PJSIP/Movistar_endpoint/sip:[email protected]:5070,20)
;Llamada a recipient_1.
;same => n,Dial(PJSIP/Movistar_endpoint/sip:${EXTEN}@telefonica.net:5070,15)
same => n,Hangup(21)
same => n,${my_number},1,Goto(home,11,1)
And this is the originate command that I execute when alarm is triggered:
data:
addon: 3e533915_asterisk
input: >-
originate Local/686xxxxxx@alarm-trigger-calls application Playback
/media/asterisk/sounds/my_sounds/atencion_alarma_4s
action: hassio.addon_stdin
However, I would like to know whether it is possible to pass variables to Asterisk on top of the ${EXTEN} one, so I can just create a single dialplan context and pass numbers from (for instance) number input fields included in the dashboard, so I don’t have to tweak the dialplan. Basically, I would like to find a cleaner way to set numbers according to needs. Any advice, please?
TIA