Summary:ASTERISK-02661: request for dialing feature 'exten => (555)1234,1,app'
Reporter:Lee Howard (faxguy)Labels:
Date Opened:2004-10-23 16:22:27Date Closed:2004-10-24 20:17:11
Versions:Frequency of
Description:When using incoming DID and when using the internal extensions as the last digits of the DID, it certainly would save some lines in extensions.conf if we could do this:

exten => (555)1234,1,app

Instead of needing to do this:

exten => 5551234,1,Goto(1234)
exten => 1234,1,app
Comments:By: twisted (twisted) 2004-10-23 16:25:37

This was a discussion on IRC.  The way I see it working is simiar to the current pattern matching, however, the parts within ()'s are not required, but if present will match, ie:

exten => 1234,1,NoOp()

will match normally, and

exten => (555)1234,1,NoOp()

would match the same as the first (normal) entry, as well as on 5551234.  This could also be expanded to allow multiple optional strings, such as this:

exten => (555|355|321)1234,1,NoOp

would match on 1234, 5551234, 3551234, and 3211234.

It's got my vote.

By: Mark Spencer (markster) 2004-10-23 16:27:56

You can already do exten => _555XXXX,1,Goto(${EXTEN:3},1) to do thsi same thing.

By: Lee Howard (faxguy) 2004-10-23 16:41:01

Mark, I already mentioned that "this same thing" could be done with a Goto().  This was a feature request to save us some coding in extensions.conf.

By: Mark Spencer (markster) 2004-10-23 17:25:11

Yah but your example suggests you have to have a line for each extension, when in reality you only need one line for the entire dialplan.  Am I missing something?

By: Brian West (bkw918) 2004-10-23 17:32:57

exten => 5551234,1,Goto(1234)
exten => 1234,1,app

can be done with

exten => _NXXXXXXX,1,app

So what am I missing here... someone trying to make this harder than it really is?


By: twisted (twisted) 2004-10-23 17:38:41

No.  See my examples.   You'll see what we're getting at.   we want an EXACT match, with certain parts optional.

By: Lee Howard (faxguy) 2004-10-23 17:54:47

We're trying to match an extension based on the last digits, not the first ones, with a set of optional prefixes.


   exten => _555XXXX,1,Goto(${EXTEN:3},1)

matches extensions based on the prefixes, not the last digits.  Thus, it would match "5551235" and 9998 other numbers when I only want it to match "5551234".

By: Mark Spencer (markster) 2004-10-23 23:12:00

Okay, as a (hopefully) reasonable and more generally valuable compromise, I created "pbx_loopback" which would allow you to do the following:

exten => 1234,1,app

lswitch => Loopback/${EXTEN}@extens/_555.

By: Russell Bryant (russell) 2004-10-24 20:17:11

not included in 1.0