o Juha Heinanen on 05/19/2011 05:35 PM:
Juha Heinanen writes:

when conference app receives invite from conf_auth, there is one
record-route entry added by the proxy and of course the same when
conf_auth app receives 200 ok from conference app.  but when conf_auth
then sends ack to this 200 ok, the ack contains TWO route entries, which
looks wrong to me.

now i remember that this is exactly the same problem that i reported a
week ago about sbc module adding an extra route entry when i had
outbound_proxy defined in sbc profile config, but no next_hop_ip and
next_hop_port.

how can i get rid of the this extra route entry to outbound_proxy when i
am not using sbc?  there is no next_hop_* params in sems.conf or at
least they are not listed in core/etc/sems.conf.sample.
indeed. it doesn't seem so complicated to add, though. you could just cherry-pick 51a4137 which should apply nicely to 1.4, too.

BR
Stefan


-- juha



--
Stefan Sayer
VoIP Services Consulting and Development

Warschauer Str. 24
10243 Berlin

tel:+491621366449
sip:[email protected]
email/xmpp:[email protected]


diff --git a/core/AmConfig.cpp b/core/AmConfig.cpp
index 1b7c474..a4d2a5d 100644
--- a/core/AmConfig.cpp
+++ b/core/AmConfig.cpp
@@ -72,6 +72,9 @@ int          AmConfig::MediaProcessorThreads   = NUM_MEDIA_PROCESSORS;
 int          AmConfig::SIPServerThreads        = NUM_SIP_SERVERS;
 string       AmConfig::OutboundProxy           = "";
 bool         AmConfig::ForceOutboundProxy      = false;
+string       AmConfig::NextHopIP               = "";
+unsigned int AmConfig::NextHopPort             = 0;
+bool         AmConfig::NextHopForReplies       = false;
 bool         AmConfig::ProxyStickyAuth         = false;
 bool         AmConfig::DisableDNSSRV           = false;
 string       AmConfig::Signature               = "";
@@ -287,6 +290,18 @@ int AmConfig::readConfiguration()
     ForceOutboundProxy = (cfg.getParameter("force_outbound_proxy") == "yes");
   }
 
+  if(cfg.hasParameter("next_hop_ip")) {
+    NextHopIP = cfg.getParameter("next_hop_ip");
+  }
+
+  if(cfg.hasParameter("next_hop_port")) {
+    NextHopPort = cfg.getParameterInt("next_hop_port", 0);
+  }
+
+  if(cfg.hasParameter("next_hop_for_replies")) {
+    NextHopForReplies = (cfg.getParameter("next_hop_for_replies") == "yes");
+  }
+
   if(cfg.hasParameter("proxy_sticky_auth")) {
     ProxyStickyAuth = (cfg.getParameter("proxy_sticky_auth") == "yes");
   }
diff --git a/core/AmConfig.h b/core/AmConfig.h
index b0b6997..89c2f7e 100644
--- a/core/AmConfig.h
+++ b/core/AmConfig.h
@@ -126,6 +126,12 @@ struct AmConfig
   static string OutboundProxy;
   /** force Outbound Proxy to be used for in dialog requests */
   static bool ForceOutboundProxy;
+  /** force next hop IP */
+  static string NextHopIP;
+  /** force next hop port */
+  static unsigned int NextHopPort;
+  /** force next hop for replies, too */
+  static bool NextHopForReplies;
   /** update ruri-host to previously resolved IP:port on SIP auth */
   static bool ProxyStickyAuth;
   /** skip DNS SRV lookup for resolving destination address*/
diff --git a/core/AmSipDialog.cpp b/core/AmSipDialog.cpp
index 125bd88..0abcf68 100644
--- a/core/AmSipDialog.cpp
+++ b/core/AmSipDialog.cpp
@@ -49,7 +49,9 @@ AmSipDialog::AmSipDialog(AmSipDialogEventHandler* h)
     force_outbound_proxy(AmConfig::ForceOutboundProxy),
     reliable_1xx(AmConfig::rel100),
     rseq(0), rseq_1st(0), rseq_confirmed(false),
-    next_hop_port(0), next_hop_for_replies(false),
+    next_hop_port(AmConfig::NextHopPort),
+    next_hop_ip(AmConfig::NextHopIP),
+    next_hop_for_replies(AmConfig::NextHopForReplies),
     outbound_interface(-1), out_intf_for_replies(false)
 {
 }
diff --git a/core/etc/sems.conf.sample b/core/etc/sems.conf.sample
index e194e5c..c0652c2 100644
--- a/core/etc/sems.conf.sample
+++ b/core/etc/sems.conf.sample
@@ -86,14 +86,31 @@ sip_port=5080
 # optional parameter: force_outbound_proxy={yes|no}
 #
 # - forces SEMS to send any request to the outbound proxy in any
-#   situation. This option will only have an effect if the 
-#   outbound_proxy option has been set.
+#   situation, by adding an extra first Route to the outbound_proxy.
+#   This option will only have an effect if the outbound_proxy
+#   option has been set, and it will break 3261 compatibility
+#   in some cases; better use next_hop_ip/next_hop_port.
 #
 #   default: no
 #
 # Example:
 #   force_outbound_proxy=yes
 
+# optional parameter: next_hop_ip
+# - if this is set, all outgoing requests will be sent to
+#   this IP, regardless of R-URI etc.
+#
+#next_hop_ip=192.168.5.106
+
+# optional parameter: next_hop_port
+# defaults to 5060
+#next_hop_port=5060
+
+# optional parameter:next_hop_for_replies
+# - use next_hop for replies, too?
+#
+#next_hop_for_replies=yes
+
 # optional parameter: rtp_low_port=<port>
 #
 # - sets lowest for RTP used port
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to