[asterisk-users] Adding DND to dialplan

Brian McEntire brian.mcentire at gmail.com
Tue Apr 3 07:45:36 MST 2007


Hello -
I've read Asterisk should be able to activate a do not disturb feature
to turn off the ringers on extensions. I checked the wiki and can't
find documentation for how to do it.

Here's my attempt, added to extensions.conf:

[dnd-on]
exten => _#78,1,Answer
exten => _#78,n,Wait(1)
exten => _#78,n,Macro(user-callerid,)
exten => _#78,n,Set(DB(DND/${CALLERID(number)})=YES)
exten => _#78,n,Playback(do-not-disturb&activated)
exten => _#78,n,Macro(hangupcall,)

[dnd-off]
exten => _#79,1,Answer
exten => _#79,n,Wait(1)
exten => _#79,n,Macro(user-callerid,)
exten => _#79,n,dbDel(DND/${CALLERID(number)})
exten => _#79,n,Playback(do-not-disturb&de-activated)
exten => _#79,n,Macro(hangupcall,)

;further down
include => dnd-on
include => dnd-off

- - -

Monitoring asterisk from the CLI, when I dial #78 on an extension, I
just get a fast busy signal and this information is reported on the
CLI:

Apr  3 10:41:33 WARNING[30702]: app_macro.c:144 macro_exec: No such
context 'macro-user-callerid' for macro 'user-callerid'
Apr  3 10:41:33 WARNING[30702]: func_db.c:97 function_db_write: DB
requires an argument, DB(<family>/<key>)=value
Apr  3 10:41:33 WARNING[30702]: file.c:504 ast_openstream_full: File
do-not-disturb does not exist in any format
Apr  3 10:41:33 WARNING[30702]: file.c:816 ast_streamfile: Unable to
open do-not-disturb (format unknown): No such file or directory
Apr  3 10:41:33 WARNING[30702]: app_playback.c:106 playback_exec:
ast_streamfile failed on Zap/2-1 for do-not-disturb&activated
Apr  3 10:41:33 WARNING[30702]: file.c:504 ast_openstream_full: File
activated does not exist in any format
Apr  3 10:41:33 WARNING[30702]: file.c:816 ast_streamfile: Unable to
open activated (format unknown): No such file or directory
Apr  3 10:41:33 WARNING[30702]: app_playback.c:106 playback_exec:
ast_streamfile failed on Zap/2-1 for do-not-disturb&activated
Apr  3 10:41:33 WARNING[30702]: app_macro.c:144 macro_exec: No such
context 'macro-hangupcall' for macro 'hangupcall'

- - -

Any tips?

All I really want to do is turn off the ringers / do not ring
extenstions when I've activated DND. Right now I'm just using a hack
which is to shutdown asterisk altogether when I don't want the phones
to ring, which of course also prevents dialing out, it's a
sledgehammer approach and I'm looking for something more typical.


More information about the asterisk-users mailing list