I noticed a strange problem while trying to use rtpproxy sets. Opensips version 1.6.4-2.
Everything works fine, if i add 1 or 2 rtpproxies into the group/set, they are randomly selected from the set which is chosen for my invite.
But if i add 3 servers into a set, not only the rtpproxies from my set are used but every rtpproxy regardless of the setid. I did not change
anything about the script logic, just changed entries in the db. I am able to reproduce this every time i use 3 or more Rtpproxies in one set.
I will also try a few more things, and report back if i find anything.
if(is_method("INVITE") && !has_totag()) {
switch ($Ri) {
case "X.X.X.X":
$avp(s:rtpsets)="1";
break;
case "X.X.X.X":
$avp(s:rtpsets)="2";
break;
default:
$avp(s:rtpsets)="2";
}
}
......
if($avp(s:rtpsets) == 1){
set_rtp_proxy_set("1");
rtpproxy_offer("o");
} else {
set_rtp_proxy_set("2");
rtpproxy_offer("o");
}
If i change the part where i set the rtpproxy, so i am not setting static values but i am using the avp instead it works perfectly and only rtpproxies from my set are chosen. But this behavior seems like a bug to me, or is there something wrong in the script logic?
if($avp(s:rtpsets) == 1){
set_rtp_proxy_set("$avp(s:rtpsets)");
rtpproxy_offer("o");
} else {
set_rtp_proxy_set("$avp(s:rtpsets)");
rtpproxy_offer("o");
}