[sr-dev] git:master:e3ccc859: modules/imsr_usrloc_scscf: small cleanup in lookup

Jason Penton jason.penton at gmail.com
Mon Jan 5 12:51:01 CET 2015


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

Author: Jason Penton <jason.penton at gmail.com>
Committer: Jason Penton <jason.penton at gmail.com>
Date: 2015-01-05T13:50:19+02:00

modules/imsr_usrloc_scscf: small cleanup in lookup

---

Modified: modules/ims_usrloc_scscf/impurecord.c

---

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

---

diff --git a/modules/ims_usrloc_scscf/impurecord.c b/modules/ims_usrloc_scscf/impurecord.c
index a3d64c0..9859796 100644
--- a/modules/ims_usrloc_scscf/impurecord.c
+++ b/modules/ims_usrloc_scscf/impurecord.c
@@ -641,9 +641,8 @@ static inline struct ucontact* contact_path_match(unsigned int slot, str* _c, st
 int get_ucontact(impurecord_t* _r, str* _c, str* _callid, str* _path, int _cseq, struct ucontact** _co) {
     unsigned int sl;
     ucontact_t* ptr;
-    int no_callid;
+    int with_callid = 1;
     ptr = 0;
-    no_callid = 0;
     *_co = 0;
 
     sl = core_hash(_c, 0, contact_list->size);
@@ -658,11 +657,11 @@ int get_ucontact(impurecord_t* _r, str* _c, str* _callid, str* _path, int _cseq,
             break;
         case CONTACT_CALLID:
             ptr = contact_callid_match(sl, _c, _callid);
-            no_callid = 1;
+            with_callid = 1;
             break;
         case CONTACT_PATH:
             ptr = contact_path_match(sl, _c, _path);
-            break;
+	    break;
 	case CONTACT_PORT_IP_ONLY:
 	    ptr = contact_port_ip_match(sl, _c);
 	    break;
@@ -677,7 +676,7 @@ int get_ucontact(impurecord_t* _r, str* _c, str* _callid, str* _path, int _cseq,
     if (ptr) {
 	LM_DBG("have partially found a contact\n");
         /* found -> check callid and cseq */
-        if (no_callid || (ptr->callid.len == _callid->len
+        if (!with_callid || (ptr->callid.len == _callid->len
                 && memcmp(_callid->s, ptr->callid.s, _callid->len) == 0)) {
             if (_cseq < ptr->cseq) {
 		LM_DBG("cseq less than expected\n");




More information about the sr-dev mailing list