Hello,<br>I have a question about LCR which I have been unable to solve. I have 4 upstream carrier gateways owned by 2 carriers. Each carrier provides a primary and secondary gateway for load balancing purposes. On a 5XX error I am trying to send the same call to the other carrier. If both carriers reject the call with 5XX, I allow the response to go downstream to my asterisk server. The issue I am running into is that in a scenario where both my carriers respond with a 5XX, I end up presenting the same call to all 4 gateways. I would like to present the call to one gateway on each carrier and not try the same carriers second gateway for the same call. Here is what is happening now:<br>
<br>ASTERISK --> INVITE --> KAMAILIO<br>INVITE --> CARRIER A/GATEWAY 1 <-- 5XX Error<br>INVITE --> CARRIER A/GATEWAY 2 <-- 5XX Error<br>INVITE --> CARRIER B/GATEWAY 1 <-- 5XX Error<br>INVITE --> CARRIER B/GATEWAY 2 <-- 5XX Error<br>
KAMAILIO --> 5XX Error --> ASTERISK<br><br>OR any combination of the above... i.e.<br><br>ASTERISK --> INVITE --> KAMAILIO<br>
INVITE --> CARRIER A/GATEWAY 1 <-- 5XX Error<br>
INVITE --> CARRIER B/GATEWAY 2 <-- 5XX Error<br>
INVITE --> CARRIER B/GATEWAY 1 <-- 5XX Error<br>
INVITE --> CARRIER A/GATEWAY 2 <-- 5XX Error<br>
KAMAILIO --> 5XX Error --> ASTERISK<br><br><br>What I want to happen is:<br><br>ASTERISK --> INVITE --> KAMAILIO<br>
INVITE --> CARRIER A/GATEWAY 1 or 2 <-- 5XX Error<br>
INVITE --> CARRIER B/GATEWAY 1 or 2 <-- 5XX Error<br>
KAMAILIO --> 5XX Error --> ASTERISK<br><br>I tried dealing with the issue using some flags on the gateway, but i couldn't get the logic to work properly. Here is the path I was heading down, but my plan fell apart after some testing.<br>
<br>CARRIER A has a gateway flag of "1"<br>CARRIER B has a gateway flag of "2"<br><br>failure_route[1]{<br> $var(gw_flag) = $avp(i:712);<br> <br> while(next_gw()){<br> if($var(gw_flag) != $avp(i:712)){<br>
xlog("L_INFO","Found an LCR destination which is different than current, routing. ($ci)");<br> t_on_reply("1");<br> t_on_failure("1");<br>
t_relay();<br> exit;<br> }else{<br> xlog("L_INFO","The next destination in LCR has the same AVP flag, skipping. ($ci)"); <br> }<br> }<br>
<br> # let the reply go upstram - it is the default action<br> xlog("L_ERR", "No Next Gateway - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br> exit;<br>}<br><br><br>Any help would be greatly appreciated.<br>
<br>Thanks,<br>Geoff<br>