[asterisk-users] How to handle "+" prefix

Brandon Kruse bkruse at digium.com
Sun Sep 2 11:45:08 CDT 2007


I had to do some work on the GUI for bandwidth, which sends
and matches + on every number.

To combat this, I just added one that says
exten => +extensionhere,1,Goto(${EXTEN:1})
exten => extensionhere,1,Noop("sweet.")

-bk
----- Original Message -----
From: "Steve Murphy" <murf at digium.com>
To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users at lists.digium.com>
Sent: Saturday, September 1, 2007 5:49:17 PM (GMT-0800) America/Los_Angeles
Subject: Re: [asterisk-users] How to handle "+" prefix

On Thu, 2007-08-30 at 10:17 -0500, Brian West wrote:
> On Aug 30, 2007, at 10:11 AM, Jared Smith wrote:
> 
> > On Thu, 2007-08-30 at 15:42 +0100, Adrian Marsh wrote:
> >> Is there a way of using variables within the dialplan, eg:
> >>
> >> [globals]
> >> SOMEVAR=0179344
> >>
> >> [local]
> >> exten => _${SOMEVAR}.,1,NoOp(Dialled own number)
> >
> > No, unfortunately you can't use variables as part of the extension  
> > name
> > or pattern match.
> >
> 
> 
> Since when?  I knew you couldn't use them for pattern matches but in  
> 1.2 you could at one point I tested this personally.

Brian's right. But, the variable has to be a global, and is evaluated at
the time the extensions.conf file is read in; so, really, it's a
constant, and isn't evaluated at all at dial time. So, if you do one of
those "dialplan show" things, you'll see that the variable has been
substituted. Just had to fix a bug where AEL didn't provide the same
service.

murf


-- 
Steve Murphy
Software Developer
Digium




More information about the asterisk-users mailing list