[sr-dev] git:master:82916f01: registrar: set expires field inside xavp_rcd
Daniel-Constantin Mierla
miconda at gmail.com
Tue May 16 17:04:28 CEST 2017
Module: kamailio
Branch: master
Commit: 82916f01bfcd58c80cbecbfa84f33f9763ba0d43
URL: https://github.com/kamailio/kamailio/commit/82916f01bfcd58c80cbecbfa84f33f9763ba0d43
Author: lazedo <luis.azedo at factorlusitano.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-05-16T17:00:26+02:00
registrar: set expires field inside xavp_rcd
- match docs and build_contact() behaviour
- part of PR #1111
---
Modified: src/modules/registrar/lookup.c
---
Diff: https://github.com/kamailio/kamailio/commit/82916f01bfcd58c80cbecbfa84f33f9763ba0d43.diff
Patch: https://github.com/kamailio/kamailio/commit/82916f01bfcd58c80cbecbfa84f33f9763ba0d43.patch
---
diff --git a/src/modules/registrar/lookup.c b/src/modules/registrar/lookup.c
index bff0e0e..03be948 100644
--- a/src/modules/registrar/lookup.c
+++ b/src/modules/registrar/lookup.c
@@ -111,6 +111,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;
@@ -136,6 +137,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;
More information about the sr-dev
mailing list