[asterisk-users] Adding DND to dialplan

Doug Lytle support at drdos.info
Tue Apr 3 17:48:58 MST 2007


Brian McEntire wrote:
> Hello -
> I've read Asterisk should be able to activate a do not disturb feature

Instead of using 2 extensions, you can get away with just one.  Check 
the database entry at the start, if it's already set, remove it.  If 
it's not there, add it.

[dnd]

; **************************************
; Do not disturb can be set via Asterisk
; instead of the phones by dialing this
; number.
; **************************************

exten => 79*,1,Set(CALLBACK=${DB(DND/${CALLERIDNUM})})
exten => 79*,2,GotoIf($["${CALLBACK}" = "YES"]?79*,3:79*,101)
exten => 79*,3,Set(DB(DND/${CALLERIDNUM})=NO)
exten => 79*,4,Playback(local/stutter)
exten => 79*,5,Playback(de-activated)
exten => 79*,6,Hangup()
exten => 79*,101,Set(DB(DND/${CALLERIDNUM})=YES)
exten => 79*,102,Playback(local/stutter)
exten => 79*,103,Playback(activated)
exten => 79*,104,Hangup()


Doug

-- 
Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."




More information about the asterisk-users mailing list