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)
exten=>1222,n,Hangup()

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âŚ

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âŚ

I will test it.

Henk[/quote]

It doesnât give âunavailableâ or âbusyâ message.

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

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.

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 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()