[asterisk-users] Dialplan matching

2011-04-04 Thread Asterisk User
Hello all, I am trying to figure out the logic in on prefix matching for
Asterisk 1.4.5. I want to be able to pass all international calls EXCEPT
calls to 011870, 01137455 and so on.

exten = _011870.,1,Goto(intl-disabled,s,1)
exten = _01137455.,2,Goto(intl-disabled,s,1)
exten = _01137477.,3,Goto(intl-disabled,s,1)
exten = _0113749.,4,Goto(intl-disabled,s,1)
exten = _011.,5,Goto(intl-disabled,s,1)
exten = _011.,6,Playback(all-outgoing-lines-unavailable)
exten = _011.,7,Wait(1)
exten = _011.,8,Playback(please-hang-up-and-dial-operator)
exten = _011.,9,Hangup

Is this correct or should it be:

exten = _011870X,1,Goto(intl-disabled,s,1)
exten = _01137455X,2,Goto(intl-disabled,s,1)

I tried searching for definitive information on voip-wiki, nerd vittles, but
there is a lot of confusion.
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Dialplan matching

2011-04-04 Thread Steve Murphy
On Mon, Apr 4, 2011 at 8:09 AM, Asterisk User asteruserl...@gmail.comwrote:


 Hello all, I am trying to figure out the logic in on prefix matching for
 Asterisk 1.4.5. I want to be able to pass all international calls EXCEPT
 calls to 011870, 01137455 and so on.

 exten = _011870.,1,Goto(intl-disabled,s,1)
 exten = _01137455.,2,Goto(intl-disabled,s,1)
 exten = _01137477.,3,Goto(intl-disabled,s,1)
 exten = _0113749.,4,Goto(intl-disabled,s,1)
 exten = _011.,5,Goto(intl-disabled,s,1)
 exten = _011.,6,Playback(all-outgoing-lines-unavailable)
 exten = _011.,7,Wait(1)
 exten = _011.,8,Playback(please-hang-up-and-dial-operator)
 exten = _011.,9,Hangup

 Is this correct or should it be:

 exten = _011870X,1,Goto(intl-disabled,s,1)
 exten = _01137455X,2,Goto(intl-disabled,s,1)

 I tried searching for definitive information on voip-wiki, nerd vittles,
 but there is a lot of confusion.


Assuming that 011870 is followed by more than digit, normally, I'd say your
first set is more applicable.
The . in the pattern at the end means any number of digits, followed by a
timeout.
If you know the number of digits, and it is fixed, then you could use
_011870XXX or similar to avoid the timeout, and begin the Goto
immediately on reception of the final digit.

The X in the second set will match just one digit, and the Goto will be be
executed.

Does that help?




 --

Steve Murphy

ParseTree Corporation
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Dialplan matching

2011-04-04 Thread A J Stiles
On Monday 04 Apr 2011, Asterisk User wrote:
 Hello all, I am trying to figure out the logic in on prefix matching for
 Asterisk 1.4.5. I want to be able to pass all international calls EXCEPT
 calls to 011870, 01137455 and so on.

Asterisk's default behaviour is always to try the hardest-to-match expression 
first  (i.e. the exact extension number).  If there is no match there, it 
then tries progressively easier-to-match expressions; only ever trying 
something like _. if nothing else matched.

(Compare the rules of poker when wild cards are introduced:  a natural hand 
beats an otherwise-equivalent hand containing wild cards.)

-- 
AJS

Answers come *after* questions.

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Dialplan matching

2011-04-04 Thread Tilghman Lesher
On Monday 04 April 2011 09:09:28 Asterisk User wrote:
 Hello all, I am trying to figure out the logic in on prefix matching for
 Asterisk 1.4.5. I want to be able to pass all international calls EXCEPT
 calls to 011870, 01137455 and so on.
 
 exten = _011870.,1,Goto(intl-disabled,s,1)

This one is okay.

 exten = _01137455.,2,Goto(intl-disabled,s,1)

Change this to priority 1.

 exten = _01137477.,3,Goto(intl-disabled,s,1)

Change this to priority 1.

 exten = _0113749.,4,Goto(intl-disabled,s,1)

Change this to priority 1.

 exten = _011.,5,Goto(intl-disabled,s,1)

Change this to priority 1.

 exten = _011.,6,Playback(all-outgoing-lines-unavailable)
 exten = _011.,7,Wait(1)
 exten = _011.,8,Playback(please-hang-up-and-dial-operator)
 exten = _011.,9,Hangup

This looks like it should be starting from priority 1, extension s,
context [intl-disabled].

 Is this correct or should it be:
 
 exten = _011870X,1,Goto(intl-disabled,s,1)
 exten = _01137455X,2,Goto(intl-disabled,s,1)
 
 I tried searching for definitive information on voip-wiki, nerd vittles,
 but there is a lot of confusion.

The major problem in your dialplan is that you WANT to have multiple start
points, but the way you have it written, there is only ONE start point.
Everything else is simply ignored.  Extensions will only start in the
dialplan from priority 1.

-- 
Tilghman

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] Dialplan matching problem

2009-05-19 Thread michel freiha
Hi all,
I'm using asterisk in Realtime mode  and all my dialplans are defined in
extensions table...My problem is the following...
If I have for a specific context an extension with value _X. and another
entry for the same context with extension 123456, if an incoming call from
the same context comes to asterisk to extension 123456 the _X. is matched
first...is there a way to force asterisk to match the 12345 extension first
before _X. match?

Regards
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Dialplan matching problem

2009-05-19 Thread Danny Nicholas
Maybe a Gotoif or an ex-girlfriend exception.

 

  _  

From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of michel freiha
Sent: Tuesday, May 19, 2009 3:50 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] Dialplan matching problem

 

Hi all,
I'm using asterisk in Realtime mode  and all my dialplans are defined in
extensions table...My problem is the following...
If I have for a specific context an extension with value _X. and another
entry for the same context with extension 123456, if an incoming call from
the same context comes to asterisk to extension 123456 the _X. is matched
first...is there a way to force asterisk to match the 12345 extension first
before _X. match?

Regards

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users