Module: kamailio
Branch: 5.0
Commit: 2c05352309b1b60eb2503f8a07cef5753bd38a6e
URL: 
https://github.com/kamailio/kamailio/commit/2c05352309b1b60eb2503f8a07cef5753bd38a6e

Author: lazedo <[email protected]>
Committer: Luis Azedo <[email protected]>
Date: 2017-05-19T12:37:12+01:00

registrar: set expires field inside xavp_rcd

- match docs and build_contact() behaviour
- part of PR #1111

(cherry picked from commit 82916f01bfcd58c80cbecbfa84f33f9763ba0d43)

---

Modified: src/modules/registrar/lookup.c

---

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

---

diff --git a/src/modules/registrar/lookup.c b/src/modules/registrar/lookup.c
index 9f99d37e1f..1c0259e310 100644
--- a/src/modules/registrar/lookup.c
+++ b/src/modules/registrar/lookup.c
@@ -105,6 +105,7 @@ int xavp_rcd_helper(ucontact_t* ptr)
        str xname_ruid = {"ruid", 4};
        str xname_received = { "received", 8};
        str xname_contact = { "contact", 7};
+       str xname_expires = {"expires", 7};
        sr_xval_t xval;
 
        if(ptr==NULL) return -1;
@@ -130,6 +131,11 @@ int xavp_rcd_helper(ucontact_t* ptr)
        xval.v.s = ptr->c;
        xavp_add_value(&xname_contact, &xval, xavp);
 
+       memset(&xval, 0, sizeof(sr_xval_t));
+       xval.type = SR_XTYPE_INT;
+       xval.v.i = (int) (ptr->expires - time(0));
+       xavp_add_value(&xname_expires, &xval, xavp);
+
        if(list==NULL) {
                /* no reg_xavp_rcd xavp in root list - add it */
                xval.type = SR_XTYPE_XAVP;


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

Reply via email to