N-priority in dial plan

I am changing my dial plan from numbered priority:

exten=>1222,1,Dial(SIP/1222,20,tT)
exten=>1222,2,VoiceMail(u1222@default)
exten=>1222,3,Hangup()
exten=>1222,102,VoiceMail(b1222@default)
exten=>1222,103,Hangup()

to the n-priority:

exten=>1222,1,Dial(SIP/1222,20,tT)
exten=>1222,n,VoiceMail(u1222@default)
exten=>1222,n,Hangup()
exten=>1222,n+101,VoiceMail(b1222@default) :unamused:
exten=>1222,n,Hangup() :unamused:

I am not sure about the last to lines in the above example
In the book AsteriskTFOT is writtin on page 87:
“Dial() will go to priority n+101, if it exist (where n is the priority where the Dial() application was called).”

Q1: What is the value of n in the line exten=>1222,1,Dial(SIP/1222,20,tT) ?
n=1 or n=0 ?
Q2: Should the line exten=>1222,102,VoiceMail(b1222@default) be converted to
exten=>1222,n+101,VoiceMail(b1222@default) or exten=>1222,n+102,VoiceMail(b1222@default)
Q3: Should the last line be : exten=>1222,n,Hangup() or exten=>1222,n+102,Hangup() or exten=>1222,n+103,Hangup() ?

Thanks
Henk

ah, the n+101 stuff came around before the ‘n’ could be used as a priority.

Your first example is a correct use of n+101

however as of version 1.2, priority jumping is considered ‘bad’ and most applications won’t jump unless explicitly told to with a flag. Instead, Dial() returns while setting a variable ${DIALSTATUS} which will be busy, unavailable, etc. You can then use ExecIF in the two lines after it to go to voicemail, or I BELIEVE (could be wrong) that voicemail will read the dialstatus variable on its own and generate the right greeting…

do it like this:

exten=>1222,1(foo),Dial(SIP/1222,20,tT)
exten=>1222,n,VoiceMail(u1222@default)
exten=>1222,n,Hangup()
exten=>1222,foo+101,VoiceMail(b1222@default)
exten=>1222,n,Hangup()

wouldnt dial need a ‘j’ flag to make it jump?

confusion here, sorry. i wasn’t addressing how Dial did or didn’t jump, but how to integrate the ‘n’ priority with priority jumping.

[quote=“IronHelix”]ah, the n+101 stuff came around before the ‘n’ could be used as a priority.

… or I BELIEVE (could be wrong) that voicemail will read the dialstatus variable on its own and generate the right greeting…[/quote]

If that is the case, I could use:

exten=>1222,1,Dial(SIP/1222,20,tT)
exten=>1222,n,VoiceMail(1222@default)
exten=>1222,n,Hangup()

correct…OR… :confused:

I will test it.

Henk

[quote=“henkoegema”][quote=“IronHelix”]ah, the n+101 stuff came around before the ‘n’ could be used as a priority.

… or I BELIEVE (could be wrong) that voicemail will read the dialstatus variable on its own and generate the right greeting…[/quote]

If that is the case, I could use:

exten=>1222,1,Dial(SIP/1222,20,tT)
exten=>1222,n,VoiceMail(1222@default)
exten=>1222,n,Hangup()

correct…OR… :confused:

I will test it.

Henk[/quote]

This gives me: Please leave your message after the tone…
It doesn’t give ‘unavailable’ or ‘busy’ message. :unamused:

Even better is to check the DIALSTATUS channel variable After Dial Exits.

Once this is done you can jump to what you want

example

exten => 2000,1,NoOp(Get a starting Place)
exten => 2000,n,Dial(SIP/${EXTEN},20,tr)
exten => 2000,n,GotoIf($[${DIALSTATUS} = BUSY]?busy:hangup)

exten => 2000,n(busy),Voicemail(b${EXTEN})
exten => 2000,n(hangup),Hangup()

Note you may want to check DIALSTATUS for other status and act on them accordingly see the Dial docs for what DIALSTATUS will get set to.

[quote=“SwK”]Even better is to check the DIALSTATUS channel variable After Dial Exits.

Once this is done you can jump to what you want

example

exten => 2000,1,NoOp(Get a starting Place)
exten => 2000,n,Dial(SIP/${EXTEN},20,tr)
exten => 2000,n,GotoIf($[${DIALSTATUS} = BUSY]?busy:hangup)

exten => 2000,n(busy),Voicemail(b${EXTEN})
exten => 2000,n(hangup),Hangup()

I liked your solution :smiley: and thanks for the example.
This is how I finally ended up:

exten=>1200,1,Dial(SIP/${henkoegema}&SIP/1000,40,tr)
exten=>1200,n,GotoIf($[${DIALSTATUS} = BUSY]?busy)
exten=>1200,n,VoiceMail(u${EXTEN}@default)
exten=>1200,n,Hangup()
exten=>1200,n(busy),VoiceMail(b${EXTEN}@default)
exten=>1200,n,Hangup()