Quellcode durchsuchen

modules/ims_usrloc_scscf: fixed initializer when searching for contact

Jason Penton vor 10 Jahren
Ursprung
Commit
96478d66b7
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      modules/ims_usrloc_scscf/impurecord.c

+ 2 - 2
modules/ims_usrloc_scscf/impurecord.c

@@ -641,7 +641,7 @@ 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) {
 int get_ucontact(impurecord_t* _r, str* _c, str* _callid, str* _path, int _cseq, struct ucontact** _co) {
     unsigned int sl;
     unsigned int sl;
     ucontact_t* ptr;
     ucontact_t* ptr;
-    int with_callid = 1;
+    int with_callid = 0;
     ptr = 0;
     ptr = 0;
     *_co = 0;
     *_co = 0;
 
 
@@ -676,7 +676,7 @@ int get_ucontact(impurecord_t* _r, str* _c, str* _callid, str* _path, int _cseq,
     if (ptr) {
     if (ptr) {
 	LM_DBG("have partially found a contact\n");
 	LM_DBG("have partially found a contact\n");
         /* found -> check callid and cseq */
         /* found -> check callid and cseq */
-        if (!with_callid || (ptr->callid.len == _callid->len
+        if (!with_callid || (_callid && ptr->callid.len == _callid->len
                 && memcmp(_callid->s, ptr->callid.s, _callid->len) == 0)) {
                 && memcmp(_callid->s, ptr->callid.s, _callid->len) == 0)) {
             if (_cseq < ptr->cseq) {
             if (_cseq < ptr->cseq) {
 		LM_DBG("cseq less than expected\n");
 		LM_DBG("cseq less than expected\n");