In a nut shell the CHANNEL variable is just that variable. It has a call leg id 
attached to it so if that is what you are storing it will change everytime you 
create a new channel. 
For example if I place a call Thru SIP channel polycom1 the channel is:

SIP/polycom1-23a3bc, You could look at parsing the channel name out but that 
may not work depending on your peer names.

You may instead try using the EXTEN variable and testing for it when they dial. 

 Kindly consider the environment before printing this e-mail.


> -----Original Message-----
> From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-users-
> boun...@lists.digium.com] On Behalf Of Haim Dimer
> Sent: Thursday, February 26, 2009 6:34 PM
> To: asterisk-users@lists.digium.com
> Subject: [asterisk-users] Question about Do Not Disturb
> 
> Hello,
> 
> Some of my users have phones lacking a DND button. I need to provide
> an extension they can dial that will put them in DND, i.e. tell the
> server not to send them any calls until they get off the DND.
> 
> I've researched it for almost 3 days now and tried a range of
> configurations. I'm hoping somebody here has an answer. Currently, I
> have this in extensions.conf
> 
> [app-dnd-on]
> exten => *78,1,Answer
> exten => *78,n,NoOp(${CALLERID(num)} channel ${CHANNEL} is going on
> DND ACTIVE)
> exten => *78,n,Set(DB(DND/${CALLERID(num)})=On)
> exten => *78,n,UserEvent(ASTDB|Family: DND^Channel: ${CHANNEL} ^Value:
> On)
> exten => *78,n,Playback(do-not-disturb&activated)
> exten => *78,n,Hangup
> 
> [app-dnd-off]
> exten => *79,1,Answer
> exten => *79,n,NoOp(${CALLERID(num)} is going OFF DND)
> exten => *79,n,DBdel(DND/${CALLERID(num)})
> exten => *79,n,UserEvent(ASTDB|Family: DND^Channel: ${CHANNEL} ^Value:
> ^)
> exten => *79,n,Playback(do-not-disturb&de-activated)
> exten => *79,n,Hangup
> 
> Using the above config, if I dial *78 I hear Allison's voice telling
> me that do not disturb is activated but I can still be called (either
> directly or as part of a queue). BTW, there are many people on the
> wiki stuck with the same problem : http://www.voip-
> info.org/wiki/index.php?page_id=787&tk=c7f21c26a40ee72393d7&comments_page=
> 1
> 
> About the system:
> 
> bell*CLI> core show version
> Asterisk 1.4.23.1 built by root @ bell on a i686 running Linux on
> 2009-01-26 01:57:36 UTC
> 
> GUI-version : SVN-branch-2.0-r4489 (It's the Digium GUI)
> 
> Thanks!
> 
> Haim.
> 
> 
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
> 
> --
> This message was scanned by Connected.Net and is believed to be clean.


--
This message was scanned by Connected.Net and is believed to be clean.

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to