<div class="gmail_quote">On Wed, Apr 18, 2012 at 1:27 AM, Vieri <span dir="ltr"><<a href="mailto:rentorbuy@yahoo.com">rentorbuy@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
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".<br>
<br>
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?<br>
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?<br>
<br></blockquote><div><br>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...<br>
<br><br>[mainmenu]<br>; Main IVR<br>exten => s,1,Verbose(Inbound call to main number - checking if night mode or normal)<br>exten => s,n,Set(NIGHTMODE=${DB(nightmode/enable)})<br>exten => s,n,GotoIf($["${NIGHTMODE}" = "1"]?nightmode)<br>
exten => s,n,Verbose(Normal mode - Proceeding Normally)<br>exten => s,n,...<br>exten => s,n,...<br>exten => s,n,...<br>exten => s,n(nightmode),Verbose(Night mode - going straight to voicemail)<br>exten => s,n,Voicemail(XXXX@default,su)<br>
exten => s,n,Hangup()<br><br><br>[internal]<br>; Night Mode<br>exten => *280,1,Answer()<br>exten => *280,n,GotoIf($["${DB(nightmode/enable)}" = "1"]?disable:enable)<br>exten => *280,n(enable),Verbose(Enabling night mode)<br>
exten => *280,n,Set(DB(nightmode/enable)=1)<br>exten => *280,n,Set(DEVICE_STATE(Custom:lamp)=BUSY)<br>exten => *280,n,Playback(enabled)<br>exten => *280,n,Hangup()<br>exten => *280,n(disable),Verbose(Disabling night mode)<br>
exten => *280,n,Set(DB(nightmode/enable)=0)<br>exten => *280,n,Set(DEVICE_STATE(Custom:lamp)=NOT_INUSE)<br>exten => *280,n,Playback(disabled)<br>exten => *280,n,Hangup()<br><br><br> </div></div>-- <br>Thanks,<br>
--Warren Selby, dCAP<br><a href="http://www.selbytech.com" target="_blank">http://www.SelbyTech.com</a><br><br>