Explorar o código

kamailio.cfg: small sample for number normalization on pstw gw routing

Daniel-Constantin Mierla %!s(int64=7) %!d(string=hai) anos
pai
achega
b4ad3105e1
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      etc/kamailio.cfg

+ 7 - 0
etc/kamailio.cfg

@@ -854,6 +854,13 @@ route[PSTN] {
 		exit;
 	}
 
+	# normalize target number for pstn gateway
+	# - convert leading 00 to +
+	if (starts_with("$rU", "00")) {
+		strip(2);
+		prefix("+");
+	}
+
 	if (strempty($sel(cfg_get.pstn.gw_port))) {
 		$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
 	} else {