Muhajreen
asked on
Nesting Variables in Asterisk dialplan
Hello experts,
In my asterisk dialplan, when user dials extension 1, sip trunk (GSM1) should be dialled, and an email should be sent to (Email1) address. The same with extension 2,3 and 4
I wrote this in my dialplan:
[gsmplan]
exten => _[1234],1,dial(SIP/siptrun k/GSM${EVA L(${EXTEN} )},60)
exten => h,1,System(/usr/local/bin/ sendEmail -f me@domain.com -t Email${EVAL(${Email1})} -m 'This is a test message' )
In the verbose, I am having:
Executing [1@gsmplan:1] Dial("SIP/user-0000064b", "SIP/siptrunk/GSM1,60") in new stack
The problem is that it's dialing GSM1 while it should be replaced with it's variable value.
Any help?
In my asterisk dialplan, when user dials extension 1, sip trunk (GSM1) should be dialled, and an email should be sent to (Email1) address. The same with extension 2,3 and 4
I wrote this in my dialplan:
[gsmplan]
exten => _[1234],1,dial(SIP/siptrun
exten => h,1,System(/usr/local/bin/
In the verbose, I am having:
Executing [1@gsmplan:1] Dial("SIP/user-0000064b", "SIP/siptrunk/GSM1,60") in new stack
The problem is that it's dialing GSM1 while it should be replaced with it's variable value.
Any help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for the mistake, the verbose is:
Set("SIP/gsmgw-00001184", "emailDest=GSMh")
Set("SIP/gsmgw-00001184", "emailDest=GSMh")
Try this....
If you accept this as part of your solution, please make sure Feptias get's points and best answer.
exten => _[1234],1,dial(SIP/${GSM${ EXTEN}}@si ptrunk,60)
exten => _[1234],n,Set(numdialed=${ EXTEN})
exten => h,1,Set(emailDest=Email${n umdialed})
exten => h,2,System(/usr/local/bin/ sendEmail -f me@domain.com -t ${emailDest} -m 'This is a test message' )
If you accept this as part of your solution, please make sure Feptias get's points and best answer.
exten => _[1234],1,dial(SIP/${GSM${
exten => _[1234],n,Set(numdialed=${
exten => h,1,Set(emailDest=Email${n
exten => h,2,System(/usr/local/bin/
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Remember that ${EXTEN} always evaluates the current extension....
ASKER
Thank you both ! Asterisk, EE and you are great !
ASKER
Actually this worked perfectly:
exten => _[1234],1,dial(SIP/${GSM${
But this didn't work:
exten => h,1,Set(emailDest=${EVAL(E
exten => h,2,System(/usr/local/bin/
In console, I am getting: Set("SIP/gsmgw-00001184", "smsDest=GSMh")
Here are two problems: GSM and h.
Thank you in advance.