<div class="gmail_quote">On Wed, Apr 18, 2012 at 1:27 AM, Vieri <span dir="ltr">&lt;<a href="mailto:rentorbuy@yahoo.com">rentorbuy@yahoo.com</a>&gt;</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&#39;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&#39;t then the extension is considered to be &quot;available&quot;.<br>

<br>
If my statement is correct then is there a way to set the extesnion as &quot;busy&quot; even if there&#39;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&#39;s no way I can use hints in this scenario, or is there? Is it possible to somehow create a &quot;dummy&quot; channel whenever an extension sets &quot;server-side DND&quot; (custom context) and delete it whenever it unsets it?<br>

<br></blockquote><div><br>I&#39;ve done something similar using &quot;night-mode&quot; 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&#39;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&#39;s some snippets from existing dialplan...<br>
<br><br>[mainmenu]<br>; Main IVR<br>exten =&gt; s,1,Verbose(Inbound call to main number - checking if night mode or normal)<br>exten =&gt; s,n,Set(NIGHTMODE=${DB(nightmode/enable)})<br>exten =&gt; s,n,GotoIf($[&quot;${NIGHTMODE}&quot; = &quot;1&quot;]?nightmode)<br>
exten =&gt; s,n,Verbose(Normal mode - Proceeding Normally)<br>exten =&gt; s,n,...<br>exten =&gt; s,n,...<br>exten =&gt; s,n,...<br>exten =&gt; s,n(nightmode),Verbose(Night mode - going straight to voicemail)<br>exten =&gt; s,n,Voicemail(XXXX@default,su)<br>
exten =&gt; s,n,Hangup()<br><br><br>[internal]<br>; Night Mode<br>exten =&gt; *280,1,Answer()<br>exten =&gt; *280,n,GotoIf($[&quot;${DB(nightmode/enable)}&quot; = &quot;1&quot;]?disable:enable)<br>exten =&gt; *280,n(enable),Verbose(Enabling night mode)<br>
exten =&gt; *280,n,Set(DB(nightmode/enable)=1)<br>exten =&gt; *280,n,Set(DEVICE_STATE(Custom:lamp)=BUSY)<br>exten =&gt; *280,n,Playback(enabled)<br>exten =&gt; *280,n,Hangup()<br>exten =&gt; *280,n(disable),Verbose(Disabling night mode)<br>
exten =&gt; *280,n,Set(DB(nightmode/enable)=0)<br>exten =&gt; *280,n,Set(DEVICE_STATE(Custom:lamp)=NOT_INUSE)<br>exten =&gt; *280,n,Playback(disabled)<br>exten =&gt; *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>