[asterisk-users] how to determine if a SIP extension has DND onoroff

Steve Langstaff steve.langstaff at citel.com
Thu Sep 13 10:44:28 CDT 2007


> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com 
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Vieri
> Sent: 13 September 2007 16:38
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] how to determine if a SIP 
> extension has DND onoroff
> 
> 
> --- Steve Langstaff <steve.langstaff at citel.com> wrote:
> 
> > Sending the phone a SIP OPTIONS message *should* get you 
> the response 
> > code that the phone would respond with if you sent it an INVITE - I 
> > don't know how to do that from AGI though.
> 
> Do you know another way?
> I suppose it could be done by programming sockets and send 
> SIP protocol commands but I would need to do it
> *from* the server *to* the client (ie. the request would 
> originate on the * server).
> Is there a simple example as to how one may implement this, 
> say, in PHP or Perl? (I can create sockets but am unfamiliar 
> with SIP) 
> 
> Also, can this problem be handled the other way around? Can 
> Asterisk be configured somehow so that whenever someone tries 
> to call a particular extension and the latter yields a 
> 'response 486 "Do Not Disturb"' then the DND field in AstDB 
> for that extension is updated?
> This way the custom AGI script would only need to execute 
> "database show dnd"...
> 
> I need this particularly for queues that have the strict 
> option for joining and leaving.
> In this situation a custom cron script adds and removes 
> members dynamically from the queues. The problem I found is 
> that "strict" behavior works "as expected" when the agents, 
> even if added via AddQueueMember, are logged off or have 
> their softphone turned off but "fails" if they activate DND 
> (either by pressing the softphone DND button or dialing *78).
> So a "solution" I am thinking of implementing is to change 
> this custom cron script and make it "detect" if certain SIP 
> extensions have DND on or not (either with "database show 
> dnd" or any other reliable method). If it detects an 
> activated DND then it will execute a 
> RemoveQueueMember(queuenum, sipnum). If it detects that DND 
> is off again then it will run an AddQueueMember(queuenum, sipnum).
> 
> Help appreciated ;-)

Can you hook into the "qualify" code somehow? - that uses SIP OPTIONS.



More information about the asterisk-users mailing list