From my provider I get extensions of: +1<10digit number> 1<10 digit number> <10 digit number> seemingly randomly. What I'd like to do is exten=_!1234567890,1,Answer() which would match anything ending in 1234567890. But that doesn't work since ! can only be used at the end of a pattern. I tried [+\ ][1\ ]1234567890 which didn't work, probably because "\ " means space, not nothing. Any suggestions? sean
On Fri, Mar 15, 2019 at 9:19 AM sean darcy <seandarcy2 at gmail.com> wrote:> From my provider I get extensions of: > > +1<10digit number> > 1<10 digit number> > <10 digit number> > > seemingly randomly. > > What I'd like to do is > > exten=_!1234567890,1,Answer() > > which would match anything ending in 1234567890. > > But that doesn't work since ! can only be used at the end of a pattern. > > I tried > > [+\ ][1\ ]1234567890 > > which didn't work, probably because "\ " means space, not nothing. > > Any suggestions? >You must have multiple patterns to match the various starting sequences you receive. One that begins with + One that begins with 1 One that is for a 10 digit number Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20190315/49719a89/attachment.html>
On Friday 15 March 2019 at 15:18:04, sean darcy wrote:> From my provider I get extensions of: > > +1<10digit number> > 1<10 digit number> > <10 digit number> > > seemingly randomly. > > What I'd like to do is > > exten=_!1234567890,1,Answer()> Any suggestions?exten => _+1XXXXXXXXXX,Goto(${EXTEN:2}) exten => _1XXXXXXXXXX,Goto(${EXTEN:1}) exten => _XXXXXXXXXX,Rest of your dialplan Antony. -- What makes you think I know what I'm talking about? I just have more O'Reilly books than most people. Please reply to the list; please *don't* CC me.
Le 15/03/2019 à 15:18, sean darcy a écrit :> From my provider I get extensions of: > > +1<10digit number> > 1<10 digit number> > <10 digit number> > > seemingly randomly. > > What I'd like to do is > > exten=_!1234567890,1,Answer() > > which would match anything ending in 1234567890. > > But that doesn't work since ! can only be used at the end of a pattern. > > I tried > > [+\ ][1\ ]1234567890 > > which didn't work, probably because "\ " means space, not nothing. > > Any suggestions?exten = _+.,1,Goto(${EXTEN:-10}) exten = _X.,1,Goto(${EXTEN:-10}) ... Daniel