[asterisk-dev] sip_devicestate and queue problems

Daniel Ferrer daniel at ipcontact.com.uy
Mon Aug 18 12:52:36 CDT 2008


Hi list,

We're using asterisk 1.4.21.1 in a callcenter enviroment, with some
queues, some of them relatively big queues (80 - 100 SIP agents, Xlite).
Normally, all agents are busy and there are 30-40 calls  waiting in the 
queue. We used 1.2 in the past and we migrated to 1.4 to take advantage 
of "autofill=yes" in app_queue.

We experienced some kind of trouble with "InUse" state of member queues 
when migrating to 1.4 (we've read UPGRADE.txt an added a call-limit to 
all sip peers).
The problem is that the state of the members of the queue sometimes goes 
wrong (members appears as Not in use when they are In use), resulting in 
  dispatching calls to busy agents (we use ringinuse=no for all queues). 
We experienced this in the past in a lab enviroment, and the cause was 
the same: a DNS problem

An analisys showed that Asterisk makes a DNS lookup with the channel 
name, every time a new SIP channel is created. For example, if I've a 
sip peer '151', when making a new channel named SIP/151-b7c317a0, 
asterisk does a DNS query of 151-b7c317a0.localdomain. (localdomain is 
ommited if we have no domain configured at the machine).
Apparently function sip_devicestate is called many times when creating a 
SIP channel, sometimes it hast "SIP/151" as argument (all goes ok in 
that case), and sometimes it is called with entire channel name: 
"SIP/151-b7c317a0", and it is in that case when a DNS query is make, 
because "151-b7c317a0" is not matched in the SIP peer list.

We suffered this problem twice:

1) If we have DNS queries blocked (no response from DNS server), we have 
a delay in propagating the member status, resulting in malfunction 
(delivering calls when members are in use)
2) If DNS server is ok, and response is "Server fail" (some Windows 
servers behave like that), sip_devicestate returns AST_DEVICE_UNKNOWN 
and all fails like before, and queue member state goes wrong, resulting 
in the same chaos.

What is the reason for this DNS query when peer not found in peer list?

I think there are 2 ways to fix this problem:
  1) Not querying a DNS server if peer not found in function 
sip_devicestate, this will elliminate innecesary dns queries.
  2) Not to call to "ast_device_state_changed_literal" (in function 
ast_setstate, channel.c) with ENTIRE channel name, SIP/peer-abcdef


Waiting for your comments.
bye
daniel

--
Ing. Daniel Ferrer
IPContact Software S.R.L.
(+5982) 4025420





More information about the asterisk-dev mailing list