[asterisk-dev] [Code Review] 2996: allow uncached realtime sip peers to be queue members

wdoekes reviewboard at asterisk.org
Tue Nov 5 08:41:12 CST 2013

This is an automatically generated e-mail. To reply, visit:

Review request for Asterisk Developers.

Repository: Asterisk


When using realtime SIP peers as queue members, the device state as returned by sip_devicestate() is AST_DEVICE_UNAVAILABLE when the peer is not loaded into memory.

For uncached realtime SIP peers, this is practically always. That means that my queue doesn't have any available members.

This patch changes all p->realtime peers with a null p->addr to return AST_DEVICE_UNKNOWN instead. If we set the queue to accept unknown members, the queue correctly copes with devices with this UNKNOWN state:

    static int member_status_available(int status)
        return status == AST_DEVICE_NOT_INUSE || status == AST_DEVICE_UNKNOWN;

A different approach would have been to set the p->defaddr to non-null, but that would put the device in NOT_INUSE state which is not entirely correct, since I don't know if the device *is* available. And I haven't checked what other side-effects setting the p->defaddr has.


  /branches/1.8/channels/chan_sip.c 402467 

Diff: https://reviewboard.asterisk.org/r/2996/diff/


Tested on asterisk 10 and 11 with the SIP-devices in the state_interface column. Without the patch, the device state is unavailable, and the queue will report the members as unavailable. With the patch, the members have the unknown state and things work properly. 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131105/fd40f6a0/attachment-0001.html>

More information about the asterisk-dev mailing list