How can I check a number is within a specified range in the dialplan? What's the greater than operator? How would I use a combination of greater than and less than in conjection with GotoIf()? The following seems to break the dialplan. I need to check callerid is _5XXX. _X./_5XXX,1,Set(CALLERID(number)=5551212) _X./_5XXX,n,NoOp(Dialplan dies before here) Presumably it's because we just changed the callerid number and the dialplan now has nowhere to go. Doug.
Douglas Garstang wrote:> How can I check a number is within a specified range in the dialplan? What's the greater than operator? How would I use a combination of greater than and less than in conjection with GotoIf()? > >I'm not really sure what _X./_5XXX does. I thought _X. would match anything that would start with a digit. What does the /_5XXX do on that same matching string? Anyway, this is what I have setup to limit the number of calls going to our fax using GotoIf() Doug ; **************** ; Front office FAX ; **************** exten => 734261xxxx,1,Set(GROUP()=Office_Fax_Max) exten => 734261xxxx,n,NoOP(Active Calls: ${GROUP_COUNT(Office_Fax_Max)}) exten => 734261xxxx,n,GotoIf($[ ${GROUP_COUNT(Office_Fax_Max)} > 1 ]?734261xxxx,100) exten => 734261xxxx,n,Set(CALLERID(name)=${DB(dnis/${CALLERIDNUM})}) exten => 734261xxxx,n,Dial(ZAP/37) exten => 734261xxxx,100,Set(PRI_CAUSE=17) exten => 734261xxxx,101,Hangup() Doug -- Ben Franklin quote: "Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
>>>>> "DG" == Douglas Garstang <dgarstang@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