Skip to content
Browse files

re-fixing host_info bug

  • Loading branch information...
1 parent d6259a4 commit 03f436c891d138ca8e20650dbf738113c385b475 @shimaore committed Feb 28, 2014
Showing with 8 additions and 2 deletions.
  1. +8 −2 common/opensips/fragments/authenticate.cfg
View
10 common/opensips/fragments/authenticate.cfg
@@ -37,11 +37,17 @@ route[authenticate] {
# This type of SBC must provide us with a Sock-Info header,
# similar to one we would get by doing a add_sock_hdr("Sock-Info") ,
# or with a RURI parameter "source" that contains the IP address of the actual originator.
+ $var(host_info) = null;
+
xlog("L_DBG","-- route(authenticate): Forwarding SBC $si, trying header Sock-Info = $(hdr(Sock-Info))");
$var(host_info) = $(hdr(Sock-Info){uri.host});
- if(!$var(host_info)) {
+ xlog("L_DBG","-- route(authenticate): Forwarding SBC $si, host_info = $var(host_info)\n");
+ if($var(host_info) == null) {
xlog("L_DBG","-- route(authenticate): Forwarding SBC $si, trying URI param source = $(ru{uri.param,source})");
- $avp(host_info) = $(ru{uri.param,source}); # See client-ocs-sbc.
+ $var(host_info) = $(ru{uri.param,source}); # See client-ocs-sbc.
+ }
+ if($var(host_info) == null) {
+ t_reply("503", "Missing source information");
}
# Replace the src_endpoint data with the data for the source specified by host_info.

0 comments on commit 03f436c

Please sign in to comment.
Something went wrong with that request. Please try again.