Hi, I have very simple execIF testing the ${EXTEN} and then to remove some digits from the start of the number before dialing out.
Here is what i have for the dialplan
exten => _X.,1,Noop(Calls to UK)
same => n,Set(CALLERID(num)=+${CALLERID(num)})
same => n,Noop(extens = ${EXTEN:0:2})
same => n,Set(NEW=${EXTEN})
same => n,ExecIF($["${NEW:0:2}"="00"]?Set(${NEW}=${NEW:2}))
same => n,ExecIF($["${NEW:0:1}"="0"]?Set(${NEW}=${NEW:1}))
same => n,Dial(PJSIP/+${NEW}@peer-1uk)
same => n,Hangup()
Nothing special, I’m getting no errors, and the debug shows its setting it to true and running it, but its not overiding the current value.
Executing [00441111111111@UK:1] NoOp("PJSIP/3531222222-00000002", "Calls to UK") in new stack
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:823 pbx_substitute_variables_helper_full_location: Function CALLERID(num) result is '35312222222'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx.c:2953 pbx_extension_helper: Launching 'Set'
-- Executing [00441111111111@UK:2] Set("PJSIP/35316856408-00000002", "CALLERID(num)=+353122222222") in new stack
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:389 ast_str_retrieve_variable: Result of 'EXTEN' is '00441111111111'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx.c:2953 pbx_extension_helper: Launching 'NoOp'
-- Executing [00441111111111@UK:3] NoOp("PJSIP/35312222222-00000002", "extens = 00") in new stack
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:389 ast_str_retrieve_variable: Result of 'EXTEN' is '00441111111111'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx.c:2953 pbx_extension_helper: Launching 'Set'
-- Executing [00441111111111@UK:4] Set("PJSIP/35316856408-00000002", "NEW=00441111111111") in new stack
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:389 ast_str_retrieve_variable: Result of 'NEW' is '00441111111111'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:899 pbx_substitute_variables_helper_full_location: Expression result is '1'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:389 ast_str_retrieve_variable: Result of 'NEW' is '00441111111111'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:389 ast_str_retrieve_variable: Result of 'NEW' is '00441111111111'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx.c:2953 pbx_extension_helper: Launching 'ExecIf'
-- Executing [00441111111111@UK:5] ExecIf("PJSIP/35316856408-00000002", "1?Set(00441111111111=441111111111)") in new stack
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:389 ast_str_retrieve_variable: Result of 'NEW' is '00441111111111'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:899 pbx_substitute_variables_helper_full_location: Expression result is '1'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:389 ast_str_retrieve_variable: Result of 'NEW' is '00441111111111'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:389 ast_str_retrieve_variable: Result of 'NEW' is '00441111111111'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx.c:2953 pbx_extension_helper: Launching 'ExecIf'
-- Executing [00441111111111@UK:6] ExecIf("PJSIP/35316856408-00000002", "1?Set(00441111111111=0441111111111)") in new stack
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx_variables.c:389 ast_str_retrieve_variable: Result of 'NEW' is '00441111111111'
[Oct 15 09:29:09] DEBUG[73051][C-00000002]: pbx.c:2953 pbx_extension_helper: Launching 'Dial'
-- Executing [00441111111111@UK:7] Dial("PJSIP/35316856408-00000002", "PJSIP/+00441111111111@peer-1uk") in new stack
Kinda stumped on this, am I making a school boy error?