Re: [asterisk-users] Adding DND to dialplan
Don't think that was it unless I still have a typo. Here's my line from extensions.conf: exten = _#78,n,Set(DB(DND/${CALLERID(num)})=1) in the CLI issued 'reload' after saving the updated extensions.conf and then picked up the phone and dialed #78. Still getting this error: [Apr 4 08:56:20] WARNING[6866]: func_db.c:94 function_db_write: DB requires an argument, DB(family/key)=value Should DB support be built in by default? Is there a DB schema I need to consult to make sure I have the right family key pair? I'm using a Zaptel driver so maybe the CALLERID(num) var is not set or is confusing the Set line. I think the zap comes up Zap/2. On 4/4/07, Bruce Reeves [EMAIL PROTECTED] wrote: You have a syntax error. exten = _#78,n,Set(DB(${DND/CALLERID (num)})=1) should read exten = _#78,n,Set(DB(DND/ ${CALLERID (num)})=1) On 4/3/07, Brian McEntire [EMAIL PROTECTED] wrote: Hmmm... Had hoped this would be easy, maybe still is, but running into a problem: When I dial #78, I get a fast busy and these errors on the CLI [Apr 4 00:39:29] ERROR[4046]: pbx.c:1523 ast_func_read: Function DND/CALLERID not registered [Apr 4 00:39:29] WARNING[4046]: func_db.c:87 function_db_write: DB requires an argument, DB(family/key)=value - - - Here is the extensions.conf entry: [dnd-on] exten = _#78,1,Answer() exten = _#78,n,Wait(1) exten = _#78,n,Set(DB(${DND/CALLERID(num)})=1) exten = _#78,n,Playback(do-not-disturb) exten = _#78,n,Playback(enabled) exten = _#78,n,Hangup() - - - It appears to me that Set(DB ... as a function isn't working, isn't built in, or needs more information. I saw something about GLOBAL variables, perhaps I can use those instead? On 4/3/07, Doug Lytle [EMAIL PROTECTED] wrote: 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. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Bruce Reeves Nortex Networks ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
On Wed, 4 Apr 2007, Brian McEntire wrote: Don't think that was it unless I still have a typo. Here's my line from extensions.conf: exten = _#78,n,Set(DB(DND/${CALLERID(num)})=1) in the CLI issued 'reload' after saving the updated extensions.conf and then picked up the phone and dialed #78. Still getting this error: [Apr 4 08:56:20] WARNING[6866]: func_db.c:94 function_db_write: DB requires an argument, DB(family/key)=value Should DB support be built in by default? It seems that it's already there (else you'd not get an error from func_db) Is there a DB schema I need to consult to make sure I have the right family key pair? I do the same with: exten = *49,n,Set(DB(${CALLERID(num)}/doNotDisturb)=1) So I keep them the other way round. Why not put in something like: exten = _#78,n,Noop(DB(DND/${CALLERID(num)})=1) and just see what it says? Maybe your callerId is somehow not being set correctly? I'm using a Zaptel driver so maybe the CALLERID(num) var is not set or is confusing the Set line. I think the zap comes up Zap/2. I'd definately check the caller-id - if it's a local phone on an FXS port, then you might even want to hard-wire the caller-id in the /etc/asterisk/zapata.conf file. eg. ; Channel 1: Local analogue line context=internal group=0 signalling=fxo_ks sendcalleridafter=2 rxgain=3 txgain=3 mailbox=100 callerid=Shared DECT 100 channel = 1 Gordon ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
Ah! Got it. Hard coding CallerID is a good idea and thank you for the example. I decided to try the Noop(DB(...)) to see what was getting passed and the empty CALLERID was the issue. I decided to skip that and implement a global DND since that's what I wanted anyway so I just set DND/ALL=1 in the DB line. I'll post a full example here when I put on the finishing touches but it is working now. Thanks all for the help. One question... are there any places to get extra sound files like activated or deactivated or do not disturb is... ?? I didn't find them in the sounds directory after a vanilla install of the latest stable asterisk 1.4. On 4/4/07, Gordon Henderson [EMAIL PROTECTED] wrote: On Wed, 4 Apr 2007, Brian McEntire wrote: Don't think that was it unless I still have a typo. Here's my line from extensions.conf: exten = _#78,n,Set(DB(DND/${CALLERID(num)})=1) in the CLI issued 'reload' after saving the updated extensions.conf and then picked up the phone and dialed #78. Still getting this error: [Apr 4 08:56:20] WARNING[6866]: func_db.c:94 function_db_write: DB requires an argument, DB(family/key)=value Should DB support be built in by default? It seems that it's already there (else you'd not get an error from func_db) Is there a DB schema I need to consult to make sure I have the right family key pair? I do the same with: exten = *49,n,Set(DB(${CALLERID(num)}/doNotDisturb)=1) So I keep them the other way round. Why not put in something like: exten = _#78,n,Noop(DB(DND/${CALLERID(num)})=1) and just see what it says? Maybe your callerId is somehow not being set correctly? I'm using a Zaptel driver so maybe the CALLERID(num) var is not set or is confusing the Set line. I think the zap comes up Zap/2. I'd definately check the caller-id - if it's a local phone on an FXS port, then you might even want to hard-wire the caller-id in the /etc/asterisk/zapata.conf file. eg. ; Channel 1: Local analogue line context=internal group=0 signalling=fxo_ks sendcalleridafter=2 rxgain=3 txgain=3 mailbox=100 callerid=Shared DECT 100 channel = 1 Gordon ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
One question... are there any places to get extra sound files like activated or deactivated or do not disturb is... ?? I didn't find them in the sounds directory after a vanilla install of the latest stable asterisk 1.4. As I couldn't find such files under 'sounds', I created them by hand. It's easy, only if you have a few minutes: 1. Download and install a free mp3/wma recorder - I found http://www.xaudiotools.com/ to be quite handy 2. Record the required sounds - I chose .wav format with PCM 8000khz; 16bit; Mono for two reasons: First, the file size was small so i could ftp fast back to the server. Second, the sound quality after converting to .gsm was fantastic. 3. convert .wav to .gsm using sox: $ sox soundfile.wav soundfile.gsm 4. copy the file back to sounds directory - Original Message - From: Brian McEntire [EMAIL PROTECTED] To: Asterisk Users Mailing List - Non-Commercial Discussion asterisk-users@lists.digium.com Sent: Wednesday, April 04, 2007 2:52 PM Subject: Re: [asterisk-users] Adding DND to dialplan Ah! Got it. Hard coding CallerID is a good idea and thank you for the example. I decided to try the Noop(DB(...)) to see what was getting passed and the empty CALLERID was the issue. I decided to skip that and implement a global DND since that's what I wanted anyway so I just set DND/ALL=1 in the DB line. I'll post a full example here when I put on the finishing touches but it is working now. Thanks all for the help. One question... are there any places to get extra sound files like activated or deactivated or do not disturb is... ?? I didn't find them in the sounds directory after a vanilla install of the latest stable asterisk 1.4. On 4/4/07, Gordon Henderson [EMAIL PROTECTED] wrote: On Wed, 4 Apr 2007, Brian McEntire wrote: Don't think that was it unless I still have a typo. Here's my line from extensions.conf: exten = _#78,n,Set(DB(DND/${CALLERID(num)})=1) in the CLI issued 'reload' after saving the updated extensions.conf and then picked up the phone and dialed #78. Still getting this error: [Apr 4 08:56:20] WARNING[6866]: func_db.c:94 function_db_write: DB requires an argument, DB(family/key)=value Should DB support be built in by default? It seems that it's already there (else you'd not get an error from func_db) Is there a DB schema I need to consult to make sure I have the right family key pair? I do the same with: exten = *49,n,Set(DB(${CALLERID(num)}/doNotDisturb)=1) So I keep them the other way round. Why not put in something like: exten = _#78,n,Noop(DB(DND/${CALLERID(num)})=1) and just see what it says? Maybe your callerId is somehow not being set correctly? I'm using a Zaptel driver so maybe the CALLERID(num) var is not set or is confusing the Set line. I think the zap comes up Zap/2. I'd definately check the caller-id - if it's a local phone on an FXS port, then you might even want to hard-wire the caller-id in the /etc/asterisk/zapata.conf file. eg. ; Channel 1: Local analogue line context=internal group=0 signalling=fxo_ks sendcalleridafter=2 rxgain=3 txgain=3 mailbox=100 callerid=Shared DECT 100 channel = 1 Gordon ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
On Wed, 4 Apr 2007, Brian McEntire wrote: One question... are there any places to get extra sound files like activated or deactivated or do not disturb is... ?? I didn't find them in the sounds directory after a vanilla install of the latest stable asterisk 1.4. They are in the asterisk-sounds package. gordon @ yakko: ls *act* activated.gsm de-activated.gsm etc. Gordon ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
Brian McEntire wrote: One question... are there any places to get extra sound files like activated or deactivated or do not disturb is... ?? I didn't find them in the sounds directory after a vanilla install of the latest stable asterisk 1.4. Maybe the asterisk-sounds tarball has some you could use. http://ftp.digium.com/pub/asterisk/releases/asterisk-sounds-1.2.1.tar.gz 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 ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Adding DND to dialplan
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-disturbactivated) 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-disturbde-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-disturbactivated 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-disturbactivated 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. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
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-disturbactivated) 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-disturbde-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-disturbactivated 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-disturbactivated 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 ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
Brian, DND is not real hard. You basicly want to to note the extension is set to DND and then when someone calls that extension you check for DND status and if it is yes then you go on to voicemail instead of dial. It sounds like you are miss understanding the dialplan and how to use it. In your sample, do the macros user-callerid and hangupcall exist? Do the sound files you specified exist in var/lib/asterisk/sounds? A simple DND would look like so: exten = *73,1,Answer() exten = *73,n,Wait(0.5) exten = *73,n,Set(DB(${CALLERID(number)}/DND)=1) exten = *73,n,Playback(do-not-disturb) exten = *73,n,Playback(enabled) exten = *73,n,Hangup() and then When someone calls say extension 1000 I would have a macro check for : exten = s,n,Set(DNDStatus=$[${DB(1000/DND)} = 1]) = returns a 1 if enabled or a 0 exten = s,n,GoToIf($[${DNDStatus} = 1]?DND) exten = s,n(DND),Voicemail([EMAIL PROTECTED],u) On 4/3/07, Brian McEntire [EMAIL PROTECTED] wrote: 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-disturbactivated) 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-disturbde-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-disturbactivated 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-disturbactivated 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. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Bruce Reeves Nortex Networks ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
Bruce Reeves wrote: exten = *73,1,Answer() exten = *73,n,Wait(0.5) exten = *73,n,Set(DB(${CALLERID(number)}/DND)=1) Would prefer Set(DB(${DND/CALLERID(num)})=1) exten = *73,n,Playback(do-not-disturb) exten = *73,n,Playback(enabled) exten = *73,n,Hangup() and then When someone calls say extension 1000 I would have a macro check for : exten = s,n,Set(DNDStatus=$[${DB(1000/DND)} = 1]) = returns a 1 if enabled or a 0 exten = s,n,GoToIf($[${DNDStatus} = 1]?DND) exten = s,n(DND),Voicemail([EMAIL PROTECTED],u) More complete: [macro-check-dnd] exten = s,n,Answer() exten = s,n,Wait(1) exten = s,n,Set(DNDStatus=$[${DB(DND/${ARG1})} = 1]) exten = s,n,GotoIf($[${DNDStatus} = 1]?DND) exten = s,n,Dial(SIP/${ARG1}) exten = s,n,Hangup() exten = s,n(DND),Voicemail([EMAIL PROTECTED],u) exten = s,n,Hangup() [default] exten = _,1,Macro(check-dnd,${EXTEN}) 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 ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
Ahh... got it now. Thanks for all the replies. I was thinking that it was a function that was already built in, but I see by setting a value and then testing it before ringing extensions, it's easily added to the dialplan. On 4/3/07, Philipp Kempgen [EMAIL PROTECTED] wrote: Bruce Reeves wrote: exten = *73,1,Answer() exten = *73,n,Wait(0.5) exten = *73,n,Set(DB(${CALLERID(number)}/DND)=1) Would prefer Set(DB(${DND/CALLERID(num)})=1) exten = *73,n,Playback(do-not-disturb) exten = *73,n,Playback(enabled) exten = *73,n,Hangup() and then When someone calls say extension 1000 I would have a macro check for : exten = s,n,Set(DNDStatus=$[${DB(1000/DND)} = 1]) = returns a 1 if enabled or a 0 exten = s,n,GoToIf($[${DNDStatus} = 1]?DND) exten = s,n(DND),Voicemail([EMAIL PROTECTED],u) More complete: [macro-check-dnd] exten = s,n,Answer() exten = s,n,Wait(1) exten = s,n,Set(DNDStatus=$[${DB(DND/${ARG1})} = 1]) exten = s,n,GotoIf($[${DNDStatus} = 1]?DND) exten = s,n,Dial(SIP/${ARG1}) exten = s,n,Hangup() exten = s,n(DND),Voicemail([EMAIL PROTECTED],u) exten = s,n,Hangup() [default] exten = _,1,Macro(check-dnd,${EXTEN}) 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 ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
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. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
Hmmm... Had hoped this would be easy, maybe still is, but running into a problem: When I dial #78, I get a fast busy and these errors on the CLI [Apr 4 00:39:29] ERROR[4046]: pbx.c:1523 ast_func_read: Function DND/CALLERID not registered [Apr 4 00:39:29] WARNING[4046]: func_db.c:87 function_db_write: DB requires an argument, DB(family/key)=value - - - Here is the extensions.conf entry: [dnd-on] exten = _#78,1,Answer() exten = _#78,n,Wait(1) exten = _#78,n,Set(DB(${DND/CALLERID(num)})=1) exten = _#78,n,Playback(do-not-disturb) exten = _#78,n,Playback(enabled) exten = _#78,n,Hangup() - - - It appears to me that Set(DB ... as a function isn't working, isn't built in, or needs more information. I saw something about GLOBAL variables, perhaps I can use those instead? On 4/3/07, Doug Lytle [EMAIL PROTECTED] wrote: 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. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] Adding DND to dialplan
You have a syntax error. exten = _#78,n,Set(DB(${DND/CALLERID(num)})=1) should read exten = _#78,n,Set(DB(DND/${CALLERID(num)})=1) On 4/3/07, Brian McEntire [EMAIL PROTECTED] wrote: Hmmm... Had hoped this would be easy, maybe still is, but running into a problem: When I dial #78, I get a fast busy and these errors on the CLI [Apr 4 00:39:29] ERROR[4046]: pbx.c:1523 ast_func_read: Function DND/CALLERID not registered [Apr 4 00:39:29] WARNING[4046]: func_db.c:87 function_db_write: DB requires an argument, DB(family/key)=value - - - Here is the extensions.conf entry: [dnd-on] exten = _#78,1,Answer() exten = _#78,n,Wait(1) exten = _#78,n,Set(DB(${DND/CALLERID(num)})=1) exten = _#78,n,Playback(do-not-disturb) exten = _#78,n,Playback(enabled) exten = _#78,n,Hangup() - - - It appears to me that Set(DB ... as a function isn't working, isn't built in, or needs more information. I saw something about GLOBAL variables, perhaps I can use those instead? On 4/3/07, Doug Lytle [EMAIL PROTECTED] wrote: 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. ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -- Bruce Reeves Nortex Networks ___ --Bandwidth and Colocation provided by Easynews.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users