[sr-dev] git:master:cb3c461a: Return CSCF_RETURN_FALSE if AAR is not generated

Federico Favaro federico at aereo.lan.athonet.com
Mon Sep 7 17:05:31 CEST 2015


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

Author: Federico Favaro <federico at aereo.lan.athonet.com>
Committer: Federico Favaro <federico at aereo.lan.athonet.com>
Date: 2015-09-03T12:01:07+02:00

Return CSCF_RETURN_FALSE if AAR is not generated

Differentiate the cases where AAR is not sent because
of an error and the cases where AAR is not sent because
it is logically wrong to sent them at that point of the Transaction

---

Modified: modules/ims_qos/mod.c

---

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

---

diff --git a/modules/ims_qos/mod.c b/modules/ims_qos/mod.c
index 833532e..d826645 100644
--- a/modules/ims_qos/mod.c
+++ b/modules/ims_qos/mod.c
@@ -622,6 +622,7 @@ static int w_rx_aar(struct sip_msg *msg, char *route, char* dir, char *c_id, int
     //We don't ever do AAR on request for calling scenario...
     if (msg->first_line.type != SIP_REPLY) {
         LM_DBG("Can't do AAR for call session in request\n");
+		result = CSCF_RETURN_FALSE;
         return result;
     }
 
@@ -634,17 +635,19 @@ static int w_rx_aar(struct sip_msg *msg, char *route, char* dir, char *c_id, int
     }
 
     //we dont apply QoS if its not a reply to an INVITE! or UPDATE or PRACK!
-    if ((t->method.len == 5 && memcmp(t->method.s, "PRACK", 5) == 0)
-            || (t->method.len == 6 && (memcmp(t->method.s, "INVITE", 6) == 0
-            || memcmp(t->method.s, "UPDATE", 6) == 0))) {
-        if (cscf_get_content_length(msg) == 0
-                || cscf_get_content_length(t->uas.request) == 0) {
-            LM_DBG("No SDP offer answer -> therefore we can not do Rx AAR");
-            //goto aarna; //AAR na if we dont have offer/answer pair
-            return result;
-        }
+    if ((t->method.len == 5 && memcmp(t->method.s, "PRACK", 5) == 0) 
+		|| (t->method.len == 6 && (memcmp(t->method.s, "INVITE", 6) == 0 
+		|| memcmp(t->method.s, "UPDATE", 6) == 0))) {
+			if (cscf_get_content_length(msg) == 0 
+				|| cscf_get_content_length(t->uas.request) == 0) {
+				LM_DBG("No SDP offer answer -> therefore we can not do Rx AAR");
+				//goto aarna; //AAR na if we dont have offer/answer pair
+				result = CSCF_RETURN_FALSE;
+				return result;
+			}
     } else {
         LM_DBG("Message is not response to INVITE, PRACK or UPDATE -> therefore we do not Rx AAR");
+		result = CSCF_RETURN_FALSE;
         return result;
     }
 




More information about the sr-dev mailing list