[sr-dev] git:master:c4daee86: misc/examples/ims/pcscf: Add support for IPSec in the P-CSCF examples

Tsvetomir Dimitrov tsv.dimitrov at gmail.com
Wed Aug 22 14:30:27 CEST 2018


Module: kamailio
Branch: master
Commit: c4daee863519b1795c605e3896506e5ec7e26a41
URL: https://github.com/kamailio/kamailio/commit/c4daee863519b1795c605e3896506e5ec7e26a41

Author: Tsvetomir Dimitrov <tsv.dimitrov at gmail.com>
Committer: Tsvetomir Dimitrov <tsv.dimitrov at gmail.com>
Date: 2018-08-22T15:28:11+03:00

misc/examples/ims/pcscf: Add support for IPSec in the P-CSCF examples

---

Modified: misc/examples/ims/pcscf/kamailio.cfg
Modified: misc/examples/ims/pcscf/pcscf.cfg.sample

---

Diff:  https://github.com/kamailio/kamailio/commit/c4daee863519b1795c605e3896506e5ec7e26a41.diff
Patch: https://github.com/kamailio/kamailio/commit/c4daee863519b1795c605e3896506e5ec7e26a41.patch

---

diff --git a/misc/examples/ims/pcscf/kamailio.cfg b/misc/examples/ims/pcscf/kamailio.cfg
index 8502ce6dc0..0c3f65de77 100644
--- a/misc/examples/ims/pcscf/kamailio.cfg
+++ b/misc/examples/ims/pcscf/kamailio.cfg
@@ -162,6 +162,9 @@ loadmodule "statistics"
 loadmodule "ims_dialog"
 loadmodule "ims_usrloc_pcscf" 
 loadmodule "ims_registrar_pcscf"
+#!ifdef WITH_IPSEC
+loadmodule "ims_ipsec_pcscf"
+#!endif
 
 #!ifdef WITH_XMLRPC
 loadmodule "xmlrpc"
@@ -366,6 +369,12 @@ modparam("ims_registrar_pcscf", "subscribe_to_reginfo", 0)
 modparam("ims_registrar_pcscf", "publish_reginfo", 0)
 #!endif
 
+#!ifdef WITH_IPSEC
+modparam("ims_ipsec_pcscf", "ipsec_listen_addr", IPSEC_LISTEN_ADDR)
+modparam("ims_ipsec_pcscf", "ipsec_client_port", IPSEC_CLIENT_PORT)
+modparam("ims_ipsec_pcscf", "ipsec_server_port", IPSEC_SERVER_PORT)
+#!endif
+
 #!ifdef WITH_RX
 # -- CDP params --
 modparam("cdp","config_file","/etc/kamailio_pcscf/pcscf.xml")
@@ -700,7 +709,11 @@ route[REQINIT] {
 		send_reply("503", "Server shutting down");
 		exit;
 	}
-	
+
+	if (!is_method("REGISTER")) {
+        ipsec_forward("location");
+    }
+
 	# Ignore Re-Transmits:
 	if (t_lookup_request()) {
 		exit;
@@ -852,6 +865,7 @@ event_route[uac:reply] {
 			}
 			xlog("  Unregistering $uac_req(ruri);$var(alias)\n");
 			setdebug("9");
+			ipsec_destroy("location");
 			pcscf_unregister("location", "$uac_req(ruri);$var(alias)", "$(uac_req(ouri){uri.host})", "$(uac_req(ouri){uri.port})");
 			resetdebug();
 			$sht(natping=>$uac_req(ouri)) = $null;
diff --git a/misc/examples/ims/pcscf/pcscf.cfg.sample b/misc/examples/ims/pcscf/pcscf.cfg.sample
index 5a89ee1020..6b7a7231ca 100644
--- a/misc/examples/ims/pcscf/pcscf.cfg.sample
+++ b/misc/examples/ims/pcscf/pcscf.cfg.sample
@@ -7,6 +7,11 @@ listen=udp:11.22.33.44:5060
 # SIP / TCP/TLS
 #listen=tls:11.22.33.44:5061
 
+# IPSEC / UDP
+#!define IPSEC_LISTEN_ADDR "11.22.33.44"
+#!define IPSEC_CLIENT_PORT 5062
+#!define IPSEC_SERVER_PORT 5063
+
 alias=pcscf.mnc001.mcc001.3gppnetwork.org
 
 #!define MY_WS_PORT 80
@@ -104,4 +109,4 @@ alias=pcscf.mnc001.mcc001.3gppnetwork.org
 ##!define WITH_REGINFO
 ##!define WITH_RTPPING
 ##!define WITH_WEBSOCKET
-
+##!define WITH_IPSEC




More information about the sr-dev mailing list