[Asterisk-Users] n priority

Bill Seddon bill.seddon at lyquidity.com
Tue Feb 8 15:58:42 MST 2005


<< Oh, that's cool.  I presume it will only assign the priorities
monotonically increasing from the last assigned priority?  Are there docs
anywhere on this?  I checked the archives and voip-info.org...  I guess the
changelog in CVS might have it, eh?>>

Yes, it really is cool.  "n" does increase priorities monotonically but you
can do two things that make creating extension logic a lot easier.  The
first is that you can set labels:

exten => s,n(Start),Answer

As well as making the dialplan more readable, labels can be the target of
gotos:

exten => s,n,Goto(Start)

The second feature that makes using priorities easier is that arbitrary
increments can be defined:

exten => s,n+2,Dial(...)

Maybe its utility is not so obvious but inconjunction with labels it can be
pretty handy.  One of the things that needs to be done often is handle the
"+101" priority to handle the failure condition of an application like
Dial().  Without n, this is a pain in the neck because not only must the
Dial() priority change, so must the corresponding +101 priority.

With n priority increments, the following expression is possible:

exten => s,n(MainDial),Dial(...) ; Dial the main numbers for this context
...
...

exten => s,MainDial+101,Voicemail(u100)

Now when new dial plan instructions are added before (MainDial) there is no
need to update any priorities.  By the way, the "+101" priority can also
takes a label.  I'm not sure what practical value it has but it does help
make the dialplan more readable:

exten => s,MainDial+101(MainDialNotAnswered),Voicemail(u100)

Bill Seddon

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Michael George
Sent: February 08, 2005 12:57 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [Asterisk-Users] n priority

On Mon, Feb 07, 2005 at 09:04:25PM -0700, Kevin P. Fleming wrote:
> 
> >What are the n priorities in the above?  I thought the priorities had to
be
> >explicitly set on each exten line...
> 
> That's a feature of CVS HEAD... it allows Asterisk to compute the 
> priorities for you.
> 
> Some of us have been using it so long we've forgotten how to do it the 
> old (hard) way :-)

Oh, that's cool.  I presume it will only assign the priorities monotonically
increasing from the last assigned priority?  Are there docs anywhere on
this?
I checked the archives and voip-info.org...  I guess the changelog in CVS
might have it, eh?

Thanks!

-- 
-M

There are 10 kinds of people in this world:
	Those who can count in binary and those who cannot.
_______________________________________________
Asterisk-Users mailing list
Asterisk-Users at lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users







More information about the asterisk-users mailing list