[asterisk-users] Dialplan extension priorities

Mojo with Horan & Company, LLC mojo at horanappraisals.com
Fri Apr 18 14:42:44 CDT 2008


Tilghman Lesher wrote:
> On Friday 18 April 2008 13:48:04 Roderick A. Anderson wrote:
>   
>> Second questions.
>>
>> Well possibly three questions.
>>
>> Can I create in a context a priority that skips a chunk.  The example in
>> Paul Mahler's book indicates so but I'd like to confirm, without/before
>> testing, my code.
>>     This is desired so I can add/remove/augment dialplans/contexts that
>> have a common jump to point.
>>
>> exten => 701,1, ...
>> exten => 701,2, ...
>> exten => 701,n, ...
>>
>> exten => 701,n, GotoIf( ... , 701,33)
>>
>> exten => 701,n, ...
>>
>> exten => 701,33, ...
>>
>> So I can add and and remove lines both before and after the GotoIf  line.
>>     
>
> Yes.  The priority n simply means "take the last priority that was used in the
> dialplan and add 1 to it".
>
>   
>> So second part/question.  Is there a "Manual' for * 1.4.x?
>> And the third par/question.  Is the any books out or nearly so that
>> cover * 1.4.  I really hate typing in a bunch of stuff only to find it
>> doesn't work.  :-)
>>     
>
> Try O'Reilly for "Asterisk: The Future of Telephony", second edition.
>
> Full disclosure:  I assisted in the technical review of the book, and a few
> sections of the appendices are almost completely my contribution.  Not to
> mention some of the modules.
>
>   
In the example, I believe the OP was using n algebraically to show the 
areas between 2 and 33 without realizing that n was in fact a valid 
priority number.

Roderick, yes, you can use Goto or GotoIf to skip entire sections of 
dialplan logic.  You either need to number your priorities fully or use 
labels with your n's if you choose to use n priorities.

exten => s,1,
exten => s,2,Goto(s,4)
exten => s,3,
exten => s,4,

OR

exten => s,1
exten => s,n,Goto(s,superjump)
exten => s,n
exten => s,n(superjump),

I believe that's how it works, but it's from memory, so might not be 
quite right.

Moj


-- 

*Mojo Wentworth*
HORAN & COMPANY, LLC
403 Lincoln Street, Suite 210
Sitka, AK 99835
(907) 747-6666
(907) 747-7417 - Fax
mojo at horanappraisals.com



More information about the asterisk-users mailing list