Hi, i´m a beginner in asterisk and I created a dialplan/rule to use 2 differents trunks depending if it´s an internal call (start with 2) or not. I´m getting from asterisk log that it can´t understand “n” and, when I remove it, the fails msg stop too, but then I can´t use asterisk how I need, my calls didn´t work. I know that something is not right, but I already tried in a lot of different ways but I didn´t find the correct way to do that. Can you help me please? If possible, can you explain me why it´s not working to I be able fix it by myself in future cases?
[disc-from-trunk-SkypeTroncoAuto]
exten => _[#0-9].,n,GotoIf($["${EXTEN:0:1}" != “2”]?7)
exten => _[#0-9].,1,Set(GLOBAL(TRUNK)=SkypeTroncoAuto)
exten => _[#0-9].,2,Set(FROM_DID=${EXTEN}|)
exten => _[#0-9].,3,NoOp(${ACCOUNTCODE})
exten => _[#0-9].,4,NoOp(${EXTEN})
exten => _[#0-9].,5,Set(Description=“Exten = ${EXTEN} / Channel = ${CHANNEL} / CalledID = ${CALLERID(all)}”)
exten => [#0-9].,6,Goto(disc-from-internal-additional,${EXTEN},1)
exten => _[#0-9].,7,Set(GLOBAL(TRUNK)=SkypeTronco)
exten => [#0-9].,8,Set(FROM_DID=${EXTEN})
exten => _[#0-9].,9,Goto(disc-inrt-SkypeIn,[*#0-9].,1)
exten => s,1,Set(GLOBAL(TRUNK)=SkypeTronco)
exten => s,2,Set(FROM_DID=s)
exten => s,3,Goto(disc-inrt-SkypeIn,[*#0-9].,1)
The error msg: ERROR : safe_strtoint: caught bad lex cast exception in strtoint, [] is not convertible
Thanks in advance.
Magno
magno_jr@terra.com.br