Permalink
Browse files

Only route ENUM/loopback after making checks (and obtaining P-Charge-…

…Info data)
  • Loading branch information...
1 parent 58f175d commit 134be85a40b411efddde890e86d4362c7139a369 @shimaore committed Feb 21, 2014
Showing with 22 additions and 22 deletions.
  1. +22 −22 common/opensips/fragments/invite-outbound-proxy.cfg
@@ -22,28 +22,6 @@ route[invite-handler]
# For the outbound-proxy, needs to be able to do LCR.
# See http://www.opensips.org/html/docs/modules/1.5.x/drouting.html
- # Attempt to find a local number first.
- # Alternatively, use Carrier ENUM.
- $avp(number) := null;
- if(!cache_fetch("local","number $rU",$avp(number))) {
- if(!avp_db_load("$rU","$avp(number)")) {
- $avp(number) := '{}';
- }
- cache_store("local","number $rU","$avp(number)",${cache_timeout});
- }
-
- $json(dst_number) := $avp(number);
- $avp(number) := null;
-
- if($json(dst_number/inbound_uri)) {
- xlog("L_DBG","-- invite-oubound-proxy -- Using local inbound_uri");
- $ru = $json(dst_number/inbound_uri);
- setflag(${flag_trunk_routing});
- t_on_branch("1");
- route(initial-forwarder); # Forward
- return;
- }
-
if use_registrant
$avp(number) := null;
if(!cache_fetch("local","number $fU",$avp(number))) {
@@ -83,6 +61,28 @@ route[invite-handler]
route(lookup-src);
+ # Attempt to find a local number first.
+ # Alternatively, use Carrier ENUM.
+ $avp(number) := null;
+ if(!cache_fetch("local","number $rU",$avp(number))) {
+ if(!avp_db_load("$rU","$avp(number)")) {
+ $avp(number) := '{}';
+ }
+ cache_store("local","number $rU","$avp(number)",${cache_timeout});
+ }
+
+ $json(dst_number) := $avp(number);
+ $avp(number) := null;
+
+ if($json(dst_number/inbound_uri)) {
+ xlog("L_DBG","-- invite-oubound-proxy -- Using local inbound_uri");
+ $ru = $json(dst_number/inbound_uri);
+ setflag(${flag_trunk_routing});
+ t_on_branch("1");
+ route(initial-forwarder); # Forward
+ return;
+ }
+
# LCR
route(invite-trunk-drouting);

0 comments on commit 134be85

Please sign in to comment.