浏览代码

kamailio.cfg: add option to set pstn gw port

Daniel-Constantin Mierla 13 年之前
父节点
当前提交
4ef839851e
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      etc/kamailio.cfg

+ 7 - 1
etc/kamailio.cfg

@@ -191,6 +191,7 @@ tcp_connection_lifetime=3605
 #
 # - by default is empty to avoid misrouting
 pstn.gw_ip = "" desc "PSTN GW Address"
+pstn.gw_port = "" desc "PSTN GW Port"
 #!endif
 
 #!ifdef WITH_VOICEMAIL
@@ -826,7 +827,12 @@ route[PSTN] {
 		exit;
 	}
 
-	$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
+	if (strempty($sel(cfg_get.pstn.gw_port))) {
+		$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
+	} else {
+		$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":"
+					+ $sel(cfg_get.pstn.gw_port);
+	}
 
 	route(RELAY);
 	exit;