Browse code

kamailio.cfg: add option to set pstn gw port

Daniel-Constantin Mierla authored on 31/10/2012 19:21:07
Showing 1 changed files
... ...
@@ -191,6 +191,7 @@ tcp_connection_lifetime=3605
191 191
 #
192 192
 # - by default is empty to avoid misrouting
193 193
 pstn.gw_ip = "" desc "PSTN GW Address"
194
+pstn.gw_port = "" desc "PSTN GW Port"
194 195
 #!endif
195 196
 
196 197
 #!ifdef WITH_VOICEMAIL
... ...
@@ -826,7 +827,12 @@ route[PSTN] {
826 826
 		exit;
827 827
 	}
828 828
 
829
-	$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
829
+	if (strempty($sel(cfg_get.pstn.gw_port))) {
830
+		$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
831
+	} else {
832
+		$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":"
833
+					+ $sel(cfg_get.pstn.gw_port);
834
+	}
830 835
 
831 836
 	route(RELAY);
832 837
 	exit;