Solved

# Asterisk Wildcard Question

Posted on 2013-08-27
Medium Priority
217 Views
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?
0
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..................

================
0

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?
0

## Featured Post

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.