Range of Extensions

Hi gang:
How can one test for a range of extensions in the diaplan? For example I would like to have any DID between 3500 and 3520 dial the same SIP phone.

Thanks.

exten => _350X,1,Dial (Sip/Someone/${EXTEN})
exten => _351X,1,Dial (Sip/Someone/${EXTEN})
exten => _3520,1,Dial (Sip/Someone/${EXTEN})

couldn’t you also do it this way?

exten => _35[0-2]X,1,Dial(SIP/someone/${EXTEN})

Thanks rusty but I actually defined my question wrong. What I intended to ask was I want to check for a range like 3510 to 3516 but 3517/8/9 is excluded. :smile:

this should work:

exten => _351[0-6],1,Dial…

Cool whoiswes didnt know you could do that :smiley:

…neither did i…so off to voip-info i went, and found out you could. i was thinking about doing this exact thing this morning anyways, kind of a funny coincidence. :stuck_out_tongue:

every time i figure something like this out, i become more giddy (giddier???) about using asterisk. :smiley:

Thanks wes! Now why didn’t I thought of that pattern since I am a programmer by trade :smile:. I tried so many different ones except for that. BTW I looked at the wiki too but must have searched for the wrong thing. :blush:

Thanks for the help gang!

no problem, glad to help.

FYI, here is the page i found that info on, and i hadn’t seen this one before today:

voip-info.org/wiki-Asterisk+ … n+Patterns