[asterisk-dev] [Code Review] 2996: allow uncached realtime sip peers to be queue members
Joshua Colp
reviewboard at asterisk.org
Thu Nov 7 09:39:12 CST 2013
> On Nov. 7, 2013, 3:37 p.m., Joshua Colp wrote:
> > To make sure I better understand the situation...
> >
> > Is it caching an old stale entry without address?
> >
> > Then when device state is queried it uses that old stale entry instead of requerying realtime... so it thinks it has no address when in realtime there really is an address?
Well, no, cause your title says uncached... I'm more confused about how it's returning a peer because devicestate purposely doesn't check realtime.
- Joshua
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2996/#review10134
-----------------------------------------------------------
On Nov. 5, 2013, 2:41 p.m., wdoekes wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2996/
> -----------------------------------------------------------
>
> (Updated Nov. 5, 2013, 2:41 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> 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.
>
>
> Diffs
> -----
>
> /branches/1.8/channels/chan_sip.c 402467
>
> Diff: https://reviewboard.asterisk.org/r/2996/diff/
>
>
> Testing
> -------
>
> 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.
>
>
> Thanks,
>
> wdoekes
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20131107/704786cd/attachment.html>
More information about the asterisk-dev
mailing list