login | register
Wed 01 of Aug, 2007 [09:22 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.

Web www.voip-info.org
Shoutbox
  • Aykut, Wed 01 of Aug, 2007 [07:53 UTC]: Hi all, does anybody know about Thomson ST2030 SIP phone. I have upgraded it to latest version (1.56) but "Hold" and "Conf" features are not working after the upgrade ?? Do you know any solution or do you have Ver. 1.52 ?? Where can I find it?
  • Edward J Brown, Tue 31 of Jul, 2007 [23:33 UTC]: Has anybody experienced Choppy voice quality when using a Linksys SPA942 in an Asterisk Conference bridge? It works fine with my polycom and Cisco, but sucks with my Linksys.
  • www.astawerks.com, Fri 27 of Jul, 2007 [18:00 UTC]: does anyone use asterisk on top of clark connect? does it work good?
  • simon, Fri 27 of Jul, 2007 [14:16 UTC]: Hi All, Has anyone here managed to get the Cisco79x1 to successfully fail over to the backup proxy. I have 2 asterisk servers , handsets all register and function, except that backup proxy function doesn't work. Any working example would be very apprecia
  • Matthew Richmond, Thu 26 of Jul, 2007 [03:40 UTC]: using the page() application to page across our building...often the meetme conferences don't disconnect after the caller hangs up. Anyone else having this problem. (using Polycom phones)
  • Matthew Richmond, Wed 25 of Jul, 2007 [02:58 UTC]: thanks Nicholas Blasgen! I haven't worked with AGI before, but there's always a first! Thanks again!
  • Nicholas Blasgen, Tue 24 of Jul, 2007 [19:18 UTC]: Matthew Richmond, AGI will handle all that for you.
  • sam, Mon 23 of Jul, 2007 [16:39 UTC]: need help - certain voicemail extension will stop working and recording voicemail on asterisk - anyone know why and how to fix it? Thanks
  • john haji, Mon 23 of Jul, 2007 [14:55 UTC]: free calls to pakistan
  • bong, Sat 21 of Jul, 2007 [19:09 UTC]: hi good day to all can anyone help me how to configured the nortel sip to the signaling server and how to activate in mobile w/ sip compatible without mcs
Server Stats
  • Execution time: 0.18s
  • Memory usage: 2.21MB
  • Database queries: 32
  • GZIP: Disabled
  • Server load: 3.11

Asterisk priorities

Introduction to Asterisk Dialplan Priorities

Asterisk Priorities are used within a dialplan, in the extensions.conf configuration file.

Priorities are numbered steps in the execution of each command that make up an extension. Each priority represents one specific application. Typically, priority numbers start at 1 and increment consecutively for each line in the context. Priority numbers are not always consecutive, but we will worry about that later. For now, just remember that for each extension, Asterisk runs each priority in numerical order — as opposed to the order in which they appear in the file.

Example


   exten => 555,1,Answer
   exten => 555,2,Playback(tt-weasels)
   exten => 555,3,Voicemail(44)
   exten => 555,4,Hangup

This example is a definition of a single extension with the name "555". When a call is made to extension 555, Asterisk will answer the call itself, play a sound file called "tt-weasels", give the user an opportunity to leave a voicemail message for mailbox 44, and then hangup.

In the example, "exten =>" tells the dialplan that the next thing it sees will be a command.

"555" are the actual digits received (i.e. what the caller dialed, or the "extension" number dialed).

"1", "2", "3", and "4" represent the priority, which determines the order in which commands for that extension will be executed.

Note that Asterisk does not care about the order in which you put the lines in the extensions.conf file. You could mix the lines into a different order, like this following example, and it would make no difference because Asterisk uses the priority of each line to determine order of execution:

   exten => 555,4,Hangup
   exten => 555,1,Answer
   exten => 555,3,Voicemail(44)
   exten => 555,2,Playback(tt-weasels)

The n Priority (Asterisk 1.2.x and later versions)


Instead of having to manually number (and renumber) priorities within a given extension, you may use "n" to represent the next priority. The "n" automatically increases a priority's value incrementally. Previously, if you wanted to insert a command between the third and fourth line of a 20-priority extension, you would need to manually renumber each priority after the inserted line.

Example


   exten => 555,1,Answer
   exten => 555,n,Playback(tt-weasels)
   exten => 555,n,Voicemail(44)
   exten => 555,n,Hangup

Using "n" priorities, there are two things you can do 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 in conjunction with labels, it can be pretty handy. In a typical dialplan, Asterisk must often handle the "+101" priority to handle the failure condition of an application, like Dial(). Without the n priority, if you were to change one of the lines within an extension, 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.

Note that the "+101" priority may also use a label:

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

See also



Created by oej, Last modification by Michael Davis on Tue 24 of Jul, 2007 [18:30 UTC]

Comments Filter

n Priority Labels to other extensions?

by chochos on Wednesday 01 of August, 2007 [01:14:16 UTC]
Is there a way to jump from one extension to a label on another extension using n Priority? I'm updating my DialPlan Compiler (http://ast-dpc.sourceforge.net/) to include the option to compile using this syntax, but for this to work, there must be a way to jump to a label on one extension from another extension.

Legal Format for a Label

by Nicole on Saturday 21 of April, 2007 [19:08:46 UTC]
I'm not sure about what other characters are not permitted in a label, but a hyphen (dash, - ) is not allowed. If your label contains an illegal character, the error will be along the lines of "cannot find label XXX-XXX"!

I can't be bothered to read the code this evening to find the complete list of allowed characters, so I'm sticking to the very conservative set of: start with a letter and follow this with only letters and digits.

The n Priority & RealTime

by Soeren Anderson on Monday 06 of February, 2006 [20:43:20 UTC]
Would that be possible?
"n" works in the extensions file because you can get the priority by "linecount"/"the dialplan flow".
What to search for with RealTime to get the priority?

The n Priority & RealTime

by Jan Van Nieuwenhove on Tuesday 06 of December, 2005 [20:03:08 UTC]
the n priority does not seem to work in conjuction with Asterisk RealTime extensions.<br>
Is this simply overlooked, or is it deliberatly not implemented in RealTime mode? (sry for double post, blame the browsers 'back' functionality ;P)

The n Priority & RealTime

by Jan Van Nieuwenhove on Tuesday 06 of December, 2005 [20:01:11 UTC]
the n priority does not seem to work in conjuction with Asterisk RealTime extensions.<br>
Is this simply overlooked, or is it deliberatly not implemented in RealTime mode?

Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2007 Arte Marketing, Inc.

Powered by bitweaver