[sr-dev] git:master:8f5b70ca: misc/examples/ims/pcscf/route: Update the rest of the routing scripts for P-CSCF with IPSec support; Fix Rx_AAR() calls.

Tsvetomir Dimitrov tsv.dimitrov at gmail.com
Wed Aug 22 15:04:46 CEST 2018


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

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

misc/examples/ims/pcscf/route: Update the rest of the routing scripts for P-CSCF with IPSec support; Fix Rx_AAR() calls.

---

Modified: misc/examples/ims/pcscf/route/mo.cfg
Modified: misc/examples/ims/pcscf/route/mt.cfg
Modified: misc/examples/ims/pcscf/route/register.cfg

---

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

---

diff --git a/misc/examples/ims/pcscf/route/mo.cfg b/misc/examples/ims/pcscf/route/mo.cfg
index f00aad61fc..235b9f1275 100644
--- a/misc/examples/ims/pcscf/route/mo.cfg
+++ b/misc/examples/ims/pcscf/route/mo.cfg
@@ -95,6 +95,7 @@ onreply_route[MO_reply] {
 		remove_hf("C-Params");	
 		append_hf("Contact: $ct;$hdr(C-Params)\r\n");
 	}
+	ipsec_forward("location");
 	# In case of 1xx and 2xx do NAT
 	if(status=~"[12][0-9][0-9]")
 		route(NATMANAGE);
@@ -112,7 +113,7 @@ onreply_route[MO_reply] {
 		$avp(TTAG_CUSTOM_AVP)=$tt;
 		$avp(CALLID_CUSTOM_AVP)=$ci;
 
-		$var(aarret) = Rx_AAR("MO_aar_reply","orig");
+		$var(aarret) = Rx_AAR("MO_aar_reply","orig","",-1);
                 xlog("L_DBG", "AAR return code is $var(aarret)\n");
 
 		switch ($var(aarret)) {
@@ -135,6 +136,7 @@ onreply_route[MO_reply] {
 
 		}
 	}
+}
 
 route[MO_aar_reply]
 {
@@ -184,7 +186,7 @@ onreply_route[MO_indialog_reply] {
 		$avp(TTAG_CUSTOM_AVP)=$tt;
 		$avp(CALLID_CUSTOM_AVP)=$ci;
 
-		$var(aarret) = Rx_AAR("MO_indialog_aar_reply","orig");
+		$var(aarret) = Rx_AAR("MO_indialog_aar_reply","orig","",-1);
 		xlog("L_DBG", "AAR return code is $var(aarret)\n");
 
 		switch ($var(aarret)) {
diff --git a/misc/examples/ims/pcscf/route/mt.cfg b/misc/examples/ims/pcscf/route/mt.cfg
index 3ee9d66c52..eab2c7c37e 100644
--- a/misc/examples/ims/pcscf/route/mt.cfg
+++ b/misc/examples/ims/pcscf/route/mt.cfg
@@ -30,7 +30,7 @@ onreply_route[MT_reply] {
 		$avp(TTAG_CUSTOM_AVP)=$tt;
 		$avp(CALLID_CUSTOM_AVP)=$ci;
 
-		$var(aarret) = Rx_AAR("MT_aar_reply","term");
+		$var(aarret) = Rx_AAR("MT_aar_reply","term","",-1);
 		xlog("L_DBG", "AAR return code is $var(aarret)\n");
 
 		 switch ($var(aarret)) {
@@ -104,7 +104,7 @@ onreply_route[MT_indialog_reply] {
 		$avp(TTAG_CUSTOM_AVP)=$tt;
 		$avp(CALLID_CUSTOM_AVP)=$ci;
 
-		$var(aarret) = Rx_AAR("MT_indialog_aar_reply","term");
+		$var(aarret) = Rx_AAR("MT_indialog_aar_reply","term","",-1);
 		xlog("L_DBG", "AAR return code is $var(aarret)\n");
 
 		switch ($var(aarret)) {
diff --git a/misc/examples/ims/pcscf/route/register.cfg b/misc/examples/ims/pcscf/route/register.cfg
index df7ddcd1cd..b2d1f92638 100644
--- a/misc/examples/ims/pcscf/route/register.cfg
+++ b/misc/examples/ims/pcscf/route/register.cfg
@@ -156,7 +156,13 @@ onreply_route[REGISTER_reply]
         	xlog("L_DBG", "REGISTER SUCCESS[$ci] took $var(stat_add)ms\n"); 
         	update_stat("register_success", "+1");
         	update_stat("register_time", "$var(stat_add)");
+		ipsec_forward("location");
    	}
+	else {  
+		if (t_check_status("401")) {
+			ipsec_create("location");
+        	}
+    	}
 	exit;
 }
 




More information about the sr-dev mailing list