[asterisk-users] hints and server-side DND (do not disturb)

Warren Selby wcselby at selbytech.com
Wed Apr 18 11:20:22 CDT 2012


On Wed, Apr 18, 2012 at 1:27 AM, Vieri <rentorbuy at yahoo.com> wrote:

> Hi,
>
> Currently I'm using hints to determine SIP presence. As I understand it, a
> SIP extension can be labeled as busy, ringing, etc, based on a channel
> status. So a channel MUST be present. If it isn't then the extension is
> considered to be "available".
>
> If my statement is correct then is there a way to set the extesnion as
> "busy" even if there's no channel associated with this extension?
> eg. when an extension sets server-side DND (Do Not Disturb), it actually
> sets a boolean value in astdb. Whenever asterisk tries to route a call to
> this extension, it first checks this value. Obviously, there's no way I can
> use hints in this scenario, or is there? Is it possible to somehow create a
> "dummy" channel whenever an extension sets "server-side DND" (custom
> context) and delete it whenever it unsets it?
>
>
I've done something similar using "night-mode" type logic.  All calls
coming into the system first do a check against the db to see if night-mode
is enabled or not.  If it is, route calls to voicemail, if it's not, route
calls normally.  You can also use custom hints to set busy lamps on
appropriate phones.  The receptionist can then hit the monitored button on
her phone to turn on or turn off night-mode.  Here's some snippets from
existing dialplan...


[mainmenu]
; Main IVR
exten => s,1,Verbose(Inbound call to main number - checking if night mode
or normal)
exten => s,n,Set(NIGHTMODE=${DB(nightmode/enable)})
exten => s,n,GotoIf($["${NIGHTMODE}" = "1"]?nightmode)
exten => s,n,Verbose(Normal mode - Proceeding Normally)
exten => s,n,...
exten => s,n,...
exten => s,n,...
exten => s,n(nightmode),Verbose(Night mode - going straight to voicemail)
exten => s,n,Voicemail(XXXX at default,su)
exten => s,n,Hangup()


[internal]
; Night Mode
exten => *280,1,Answer()
exten => *280,n,GotoIf($["${DB(nightmode/enable)}" = "1"]?disable:enable)
exten => *280,n(enable),Verbose(Enabling night mode)
exten => *280,n,Set(DB(nightmode/enable)=1)
exten => *280,n,Set(DEVICE_STATE(Custom:lamp)=BUSY)
exten => *280,n,Playback(enabled)
exten => *280,n,Hangup()
exten => *280,n(disable),Verbose(Disabling night mode)
exten => *280,n,Set(DB(nightmode/enable)=0)
exten => *280,n,Set(DEVICE_STATE(Custom:lamp)=NOT_INUSE)
exten => *280,n,Playback(disabled)
exten => *280,n,Hangup()



-- 
Thanks,
--Warren Selby, dCAP
http://www.SelbyTech.com <http://www.selbytech.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120418/1e0092d1/attachment.htm>


More information about the asterisk-users mailing list