Re: [OpenSIPS-Users] An error exists in recording the number of ongoing sessions at RTP Proxies
Hi all, I still have no solution to this issue. The relevant code of my script about the statistics is attached in the previous post and list below. From the source code of set_dlg_profile in dlg_profile.c (see the following), I doubt the cause is profile value is not protected by a critical section. Any help is appreciated so much. Best regards, Chen-Che source code of set_dlg_profile in dlg_profile.c /* set the value */ if (profile-has_value) { linker-value.s = (char*)(linker+1); memcpy( linker-value.s, value-s, value-len); linker-value.len = value-len; } # my script code when receiving an INVITE request get_static_lock(RTP); $var(RTPProxyTry) = 0; $var(SelectedRTPProxyCount) = 0; while ($var(RTPProxyTry) 2) { $avp(thisRTPProxySet) = $shv(currRTPProxySet); set_rtp_proxy_set($avp(thisRTPProxySet)); switch ($shv(currRTPProxySet)) { case 1: get_profile_size(RTPProxyCount21, $avp(size21)); $var(SelectedRTPProxyCount) = $avp(size21); xlog(Try RTP proxy 1 with ongoing calls: $avp(size21)\n); break; case 2: get_profile_size(RTPProxyCount22, $avp(size22)); xlog(Try RTP proxy 2 with ongoing calls: $avp(size22)\n); $var(SelectedRTPProxyCount) = $avp(size22); break; default: xlog(Error: Invalid RTP proxy set\n); } if (($var(SelectedRTPProxyCount) 25) rtpproxy_offer()) { create_dialog(); xlog(Select RTP proxy: $avp(thisRTPProxySet)\n); switch ($shv(currRTPProxySet)) { case 1: set_dlg_profile(RTPProxyCount21, $avp(size21)); get_profile_size(RTPProxyCount21, $avp(size21)); break; case 2: set_dlg_profile(RTPProxyCount22, $avp(size22)); get_profile_size(RTPProxyCount22, $avp(size22)); break; default: xlog(Error: \n); } xlog(RTP proxies (1, 2) with ongoing calls: ($avp(size21), $avp(size22))\n); $shv(currRTPProxySet) = $shv(currRTPProxySet) + 1; if ($shv(currRTPProxySet) == 3) $shv(currRTPProxySet) = 1; t_on_reply(Invite); t_on_branch(Invite); t_on_failure(Invite); release_static_lock(RTP); route(Go); } $shv(currRTPProxySet) = $shv(currRTPProxySet) + 1; if ($shv(currRTPProxySet) == 3) $shv(currRTPProxySet) = 1; $var(RTPProxyTry) = $var(RTPProxyTry) + 1; } sl_send_reply(503, Service Unavailable); xlog(Warning: no available RTP proxy currently\n); release_static_lock(RTP); exit; -- 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-tp7584841p7585246.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] An error exists in recording the number of ongoing sessions at RTP Proxies
Hi, If you would share the relevant script, we might help :) Regards, Bogdan-Andrei Iancu OpenSIPS Founder and Developer http://www.opensips-solutions.com On 03/05/2013 03:31 AM, microx wrote: Hi all, Can someone help me solve this problem? It seems that the lock mechanism works correctly and the cause is malfunctioning of set_dlg_profile. I say so because in the critical section, the other printed information are correct and only get_profile_size is not correct all the time. I appreciate any help or suggestion very much. Yours sincerely, 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-tp7584841p7585050.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] An error exists in recording the number of ongoing sessions at RTP Proxies
Hi all, Can someone help me solve this problem? It seems that the lock mechanism works correctly and the cause is malfunctioning of set_dlg_profile. I say so because in the critical section, the other printed information are correct and only get_profile_size is not correct all the time. I appreciate any help or suggestion very much. Yours sincerely, 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-tp7584841p7585050.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] An error exists in recording the number of ongoing sessions at RTP Proxies
Hi Bogdan-Andrei, I tried to use the get_static_lock and release_static_lock to set up the critical session. However, I still get an incorrect result (please refer to the attached log). It is likely that I misuse the locking mechanism and thus I also provide the corresponding code. Please help me solve this issue. Many thanks in advance. PS. search RTP proxies (1, 2) with ongoing calls: (25, null) for the errors. Best regards, Chen-Che NewCode http://opensips-open-sip-server.1449251.n2.nabble.com/file/n7584966/NewCode rtpproxy_session_record_log http://opensips-open-sip-server.1449251.n2.nabble.com/file/n7584966/rtpproxy_session_record_log -- 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-tp7584841p7584966.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] An error exists in recording the number of ongoing sessions at RTP Proxies
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@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] An error exists in recording the number of ongoing sessions at RTP Proxies
Hi Bogdan-Andrei, Very grateful for your quick reply. I did think that the error results from my own critical session but I cannot resolve this issue since the version I use is 1.8.2. I will try the locking mechanism as you suggest. Many thanks. Best regards, 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-tp7584841p7584847.html Sent from the OpenSIPS - Users mailing list archive at Nabble.com. ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users