On Wed, Apr 18, 2012 at 1:27 AM, Vieri <rentor...@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@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>
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

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

Reply via email to