[asterisk-users] Re: Range Operator

Benny Amorsen benny+usenet at amorsen.dk
Tue Oct 10 06:34:38 MST 2006


>>>>> "DG" == Douglas Garstang <dgarstang at oneeighty.com> writes:

DG> How can I check a number is within a specified range in the
DG> dialplan? What's the greater than operator? How would I use a
DG> combination of greater than and less than in conjection with
DG> GotoIf()? The following seems to break the dialplan. I need to
DG> check callerid is _5XXX.

DG> _X./_5XXX,1,Set(CALLERID(number)=5551212)
DG> _X./_5XXX,n,NoOp(Dialplan dies before here)

DG> Presumably it's because we just changed the callerid number and
DG> the dialplan now has nowhere to go.

How about simply:

_X./_5XXX,1,Goto(handle5xxx,${EXTEN},1)

[handle5xxx]
_X.,1,Set(CALLERID(number)=5551212)
_X.,n,NoOp(foo)


If you want the other one, you can:

_X./_5XXX,1,Set(CALLERID(number)=5551212)
_X./_5551212,2,NoOp(foo)

(n probably works here too, but since n always increments, I'm wary of
using n with exgirlfriend logic)


/Benny




More information about the asterisk-users mailing list