Asterisk Wildcard Question

Posted on 2013-08-27
Medium Priority
Last Modified: 2013-09-06
I'm using the extension _XXXXXXXXXXX (11 digits) to capture all UK numbers, but I've just noticed that a few 0800 numbers have 10 digits. How can I catch them with a single wildcard sequence?
Question by:Silas2
LVL 15

Accepted Solution

Phonebuff earned 500 total points
ID: 39443183
In the book Asterisk, the definitive guide see pattern matching starting on page 125..

Or Here -- http://www.voip-info.org/wiki/view/Asterisk+Dialplan+Patterns

but you can have two pattens close and it will always match the most specific left to right..

Sp exten =>   _XXXXXXXXXXX,1, ........................
      exten =>  _0800XXXXXXX,1,............................

Will always execute the second instruction if you dial 0800..................


Author Comment

ID: 39445806
Sorry, i know i was being lazy...i jut wondered if you could catch them with a single extension/wildcard combo.

at the moment i have:
exten => _XXXXXXXXXXX,1,Set(__dialednum=${EXTEN})
exten => _XXXXXXXXXXX,n,Goto(OutgoingForRecord,s,1)

would i then need:
exten => _XXXXXXXXXXX,1,Set(__dialednum=${EXTEN})
exten => _XXXXXXXXXXX,n,Goto(OutgoingForRecord,s,1)
exten => _0800XXXXXXX1,Set(__dialednum=${EXTEN})
exten => _0800XXXXXXX,n,Goto(OutgoingForRecord,s,1)
or is there a more elegant way of doing it?

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

So you think no one can listen in on your VOIP conversations, eh? Well... if you haven't setup Secure Real Time Transport (SRTP), your voice communications can be hacked into by just about anyone! First, let's talk about the intended audience for…
I recently purchased a Bluetooth headset called the Music Jogger (model BSH10). The control buttons on it look like this: One of my goals is to use it as the microphone and speakers for Skype calls. In that respect, it works well. However, I …
From store locators to asset tracking and route optimization, learn how leading companies are using Google Maps APIs throughout the customer journey to increase checkout conversions, boost user engagement, and optimize order fulfillment. Powered …
Did you know PowerShell can save you time with SaaS platforms? Simply leverage RESTfulAPIs to build your own PowerShell modules. These will kill repetitive tickets and tabs, using the command Invoke-RestMethod. Tune into this webinar to learn how…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question