# [Asterisk-Dev] Re: dialplan eval problem?

Tony Mountifield tony at softins.clara.co.uk
Tue Jun 7 09:46:00 MST 2005

```In article <03a101c56b7c\$8e506f80\$3400000a at cytelcom.com>,
Matthew Boehm <mboehm at cytelcom.com> wrote:
> Just discovered this "problem". Here is the dial plan.
>
> exten => _9.,1,GotoIf(\$[\${CALLERIDNUM} : 3091|3144]?cscid:ncid)
>
> exten => _9.,n(cscid),Set(CALLERID(number)=8322008636)
> exten => _9.,n,Goto(callout)
>
> exten => _9.,n(ncid),Set(CALLERID(name)=Cypress)
> exten => _9.,n,Set(CALLERID(number)=2814494000)
>
> exten => _9.,n(callout),Dial(ZAP/R1d/\${EXTEN:1},60,WT)
>
> Extension 3030's callerid is set to "" (ie: null).
>
> If extension 3030 dials out, using the above dialplan, 3030 incorrectly goes
> to priority cscid.
>
> Doesn't pri 1 read as "if \${CALLERIDNUM} contains 3091 or 3144 goto cscid,
> otherwise goto ncid" ?

Assuming the | for alternation works, it would mean "if \${CALLERIDNUM}
starts with 3091 or 3144". Matches with the : operator have an implicit
anchor at the start.

> If so, then how does "if NULL contains 3091 or 3144" eval to true?

I think you need "quotes" around \${CALLERIDNUM} if it could be empty.
Ext 3030 may be currently doing: GotoIf(\$[ : 3091|3144]?cscid:ncid)

Hope this helps
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org

```