Do not disturb for Asterisk

It is a common misconception (for some reason) that *78 and *79 is default for enable and disable do not disturb. This has to be configured in your dialplan like everything else:

[dnd]
; Enable DnD
exten => *78,1,Set(DB(SIP/DND/${CALLERID(num)})=1)
exten => *78,n,Playback(beep)
; Disable DnD
exten => *79,1,NoOp(${DB_DELETE(SIP/DND/${CALLERID(num)})})
exten => *79,n,Playback(beep)

And then include in your dial macro/sub:

exten => s,5,Set(LOCAL(dnd)=${DB("SIP/DND"/${ext})})
exten => s,6,Gosubif($[${dnd}]?8:7)
exten => s,7,Dial(${dev},10)
exten => s,8,Gosub(somewhere,s,1(${ext}))

Note that you don’t really need to answer and play the beep file. It’s just a matter of taste.

Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

No Responses to “Do not disturb for Asterisk”

Leave a Reply:

Name (required):
Mail (will not be published) (required):
Website:
Comment (required):
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>