[OpenSIPS-Users] An error exists in recording the number of ongoing sessions at RTP Proxies

Bogdan-Andrei Iancu bogdan at opensips.org
Wed Feb 20 15:33:34 CET 2013


Hi Chen-Che,

It is an error in your scripting logic - at a first, you do not properly 
implement a critical region (for the rtpp selection) as your test and 
set over the $shv(mutualLock)variable is not done in an atomic way.

Also, the "$shv(numOfInvites) = $shv(numOfInvites) + 1;"operations is 
not atomic, and may lead to wrong values.

I would suggest looking at 1.9 script locking mechanism :
     http://lists.opensips.org/pipermail/news/2012-November/000220.html

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 02/20/2013 02:55 PM, microx wrote:
> Hi all,
>
> In my environment, I have one outbound proxy, two proxy servers and two RTP
> proxies. The outbound proxy uses ds_select_dst() to dispatch SIP requests to
> the two proxy servers. When receiving an INVITE request, a proxy server
> runs a round-robin algorithm to select an RTP proxy for relaying audio/video
> packets. A proxy server keeps track of the
> numbers of ongoing sessions served by the two RTP proxies. Normally, suppose
> that a proxy server receives 10 INVITE
> requests, it will have (5, 5) that means each RTP proxy is serving 5
> sessions.
>
> However, when an RTP proxy is suddently disconnected, the numbers of ongoing
> sessions associated with RTP proxies may go wrong (not always, please refer
> to the attached log). A normal message is shown below.
>
> SIP server 2:
> New call from Caller: 10138 to Callee: 10139 -->  33th received INVITE
> packets
> Try RTP proxy 1 with ongoing calls: 16
> Select RTP proxy: 1
> RTP proxies (1, 2) with ongoing calls: (17,<null>)
>
> I used SIPp to simulate multiple concurrent calls to encounter such an
> issue.
> In addition to the attached log, I give the corresponding processing code of
> my script.
> Please help me solve this problem. Thanks so much.
>
> Code
> <http://opensips-open-sip-server.1449251.n2.nabble.com/file/n7584841/Code>
> Error_log
> <http://opensips-open-sip-server.1449251.n2.nabble.com/file/n7584841/Error_log>
>
> Best wishes,
> Chen-Che
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/An-error-exists-in-recording-the-number-of-ongoing-sessions-at-RTP-Proxies-tp7584841.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



More information about the Users mailing list