[asterisk-users] dialplan tips

Leif Madsen leif.madsen at asteriskdocs.org
Sun Jul 26 09:45:09 CDT 2009


harry R wrote:
> In advance sorry for my bad english and if my problem was already 
> exposed (I didn't find any tips in the mailing list archive. Bad luck)
> I have some questions about asterisk 1.6 release :
> 1) how can I do a n+101 priority jumping if a SIP canal is busy ?
> I read that the general parameter "priorityjumping" is depreciated in 
> the 1.6 release and I already try the "j" option in dial() application 
> but no way.
> Here a sample of my simple dialplan :
> 
> exten => 101,1,Ringing
> exten => 101,2,Answer()         
> exten => 101,3,Dial(SIP/quentin,10)  
> exten => 101,n,VoiceMail(101 at default,u)
> exten => 101,n,Playback(vm-goodbye)
> exten => 101,n,Hangup()
> exten => 101,104,Playback(busy)
> exten => 101,n,Wait(3)  
> exten => 101,n,VoiceMail(101 at default,b)
> exten => 101,n,Playback(vm-goodbye)
> exten => 101,n,Hangup()

As has be alluded to by a couple other posters, don't use priority jumping.

This is a very outdated method of handling busy status. You get much more 
flexibility with the dialplan when you use STATUS variables, such as 
${DIALSTATUS} to perform routing logic per the status value.

I would re-write your dialplan as follows. Note that I've removed all priority 
numbering (except for the necessary priority 1) as you should not be using 
priority numbering either.

If all you want to do is a simple ring and voicemail, then you could use 
something like:

; I always like using something informative on the first priority, rather
; than performing a *real* action
;
exten => 101,1,Verbose(1,Incoming call from ${CALLERID(all)})
;
; I prefer using this method to answer a line as it starts sending the
; RTP audio right away, and thus saves the audio clipping for the first few
; milliseconds of call answer (this is even more useful in front of an IVR
; prompt)
;
exten => 101,n,Playback(silence/1)
;
; Now you can call your device.
;
exten => 101,n,Dial(SIP/quentin,10)
;
; If all you care about is unavailable and busy status, you can control
; which prompt on a single line
;
exten => 101,n,Voicemail(101 at default,${IF($[${DIALSTATUS} = BUSY]?b:u)})
;
; You don't need to playback vm-goodbye yourself, sine Voicemail() should
; handle all the prompts
;
exten => 101,n,Hangup()


There you have it -- same functionality, in only 4 lines.

> 2) about asterisk voicemail maximum message limit, is it possible to 
> send a notification mail to an user if his vmbox is full ? How can i do 
> that if it's possible.

I believe you would do this via the 'externnotify' option in voicemail.conf, 
which upon a voicemail being left, will run that script. From there, you should 
be able to perform logic that checks if the voicemail box is full, and if so, to 
send an email, or whatever other action you want to take.

Leif Madsen.
http://www.leifmadsen.com
http://www.oreilly.com/catalog/asterisk



More information about the asterisk-users mailing list