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

Author: easyrider14 <[email protected]>
Committer: easyrider14 <[email protected]>
Date: 2021-03-10T10:54:25+01:00

 cplc: permanent contact not skipped by lookup anymore

- a permanently registered contact has an "expires" value of 0 in usrloc
  when processing lookup, cplc module checks that contacts are not expired by
  checking that the "expires" value of the contact is not lower than current
  time
  as a consequence, permanently registered contact are alsways skipped and
  never targeted

---

Modified: src/modules/cplc/cpl_run.c

---

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

---

diff --git a/src/modules/cplc/cpl_run.c b/src/modules/cplc/cpl_run.c
index 768f6b3d4a..437e512667 100644
--- a/src/modules/cplc/cpl_run.c
+++ b/src/modules/cplc/cpl_run.c
@@ -283,7 +283,7 @@ static inline char *run_lookup( struct cpl_interpreter 
*intr )
                } else {
                        contact = r->contacts;
                        /* skip expired contacts */
-                       while ((contact) && (contact->expires <= tc))
+                       while ((contact) && (contact->expires > 0) && 
(contact->expires <= tc))
                                contact = contact->next;
                        /* any contacts left? */
                        if (contact) {


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to