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

microx acmicrox at gmail.com
Tue Mar 12 12:37:11 CET 2013


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.



More information about the Users mailing list