Unexpected behavior in QUE_MEMBER function


I’m trying to develop a scheme whereby low priority incoming calls could be routed into a high priority queue if there are at least some minimum number of free agents available. I was hoping to use the QUEUE_MEMBER(${my_que},ready) function to determine the number of free agents, but it’s giving me a number higher than what I would expect in the case where an agent’s SIP phone has other lines. After some experimentation with the hint feature, I’ve discovered that QUEUE_MEMBER is checking only the status of the phone line logged in to the queue, and so a phone that’s conversing on a different line is still considered free.

I have set ringinuse = no and strategy = ringall for the queue. The internal Asterisk algorithm for ringing queue members isn’t attempting to ring an in-use phone, so it must consider the corresponding agent line to not be free, and I’m surprised that QUE_MEMBER() doesn’t also act this way.

Is this a bug in the QUE_MEMBER() function, or is there some other parameter setting I’ve missed? (Running A* vrsn on Fedora 17).


  • Dennis :frowning:

If the phone has multiple lines which are separately registered with Asterisk, Asterisk will not know that they are related to each other, although the phone may still generate a busy response.

The code which implements QUEUE_MEMBER behaves as though ringinuse was always set.

If you want a device to recognize multiple extension numbers, but only allow one call, you should do this in extensions.conf, not in the device itself. People often name sip.conf sections after extensions, but this perpetuates a confusion between devices and extensions, and is bad for security.

So that behavior is a feature - I was afraid of that. Still, because multiple lines on the same phone will all have the same IP address, I would think A* could link them together.

On david55’s advice, I wrote a subroutine in extensions.conf to determine the count of whole phones with NOT_INUSE status containing the logged-in member SIP lines. The trick is that each logged-in line gets a corresponding hint extension designed to query the state of all lines for that phone. The subroutine has about 20 lines of code. This achieves my goal.