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? Thanks, Vieri
isrlgb at gmail.com
2012-Apr-18 06:40 UTC
[asterisk-users] hints and server-side DND (do not disturb)
??? -----Original Message----- From: Vieri <rentorbuy at yahoo.com> Sender: asterisk-users-bounces at lists.digium.com Date: Tue, 17 Apr 2012 23:27:10 To: <asterisk-users at lists.digium.com> Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users at lists.digium.com> Subject: [asterisk-users] hints and server-side DND (do not disturb) 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? Thanks, Vieri -- _____________________________________________________________________ -- 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
Warren Selby
2012-Apr-18 16:20 UTC
[asterisk-users] hints and server-side DND (do not disturb)
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>
--- On Wed, 4/18/12, Warren Selby <wcselby at selbytech.com> wrote:> exten => *280,n,Set(DEVICE_STATE(Custom:lamp)=BUSY)Thanks! So in short, it's all about DEVICE_STATE or DEVSTATE for * 1.4. I've just one last issue and was wondering how to run the following command on a remote Asterisk server: Set(DEVSTATE(Custom:mycustomstate)=BUSY) ie. how can I set a DEVICE STATE from one Asterisk server to another (for clustering purposes). Can I do it via AMI by running something like this? Setvar(DEVSTATE(Custom:mycustomstate)=BUSY) Thanks, Vieri