[asterisk-users] Adding DND to dialplan
Philipp Kempgen
philipp.kempgen at amooma.de
Tue Apr 3 08:05:05 MST 2007
Brian McEntire wrote:
> 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?
Read the warnings.
Apart from that, what you do is good.
Right before you Dial() to a user you need to check the value
you have stored in DB(DND/${EXTEN}) and if it's "YES" simply
do not Dial().
Regards,
Philipp
--
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
Let's use IT to solve problems and not to create new ones.
Asterisk? -> http://www.das-asterisk-buch.de
Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998
More information about the asterisk-users
mailing list