Hi guys,
I am stucked with variables. In my dial plan when incomning call come,
if incoming did matches extension I just cut last three numbers from
did an call that extension, something like this:
exten => _079586XXX,1,Dial(SIP/${EXTEN:6})
same => n,Hangup()
but sometimes did doesnt match ext. and then I setup global variable
something like this:
DID079586458=108
and then with that variable I can call extension 108. So I want to make
something like GotoIf, where if variable with “DIDsomenumber” exist go to that part
of dial plan if not just Dial(SIP/${EXTEN:6})
So I am stucked with ways to discover in dial plan is variable set or not,
if I let say in macro put somethin like this, where MACRO_EXTEN is icnoming
DID:
same => n,NoOp(************ ${DID${MACRO_EXTEN}} *************)
same => n,GotoIf($[${EXISTS(${DID{MACRO_EXTEN}})}]?yes:no)
asterisk always see that variable doesnt exist, NoOp detect correctly
value of variable which is in this case 102 and function EXIST doesnt:
NoOp(“SIP/sometrunk-00000027”, “************ 102 *************”) in new stack
– Executing [s@macro-searchExt:4] GotoIf(“SIP/sometrunk-00000029”, “0?yes:no”) in new stack
I also try with LEN without success. Is there any better way to solve this?