Module: kamailio
Branch: master
Commit: 6887f4b05a7b9dc58d90cee6aae22cb380ef0647
URL:
https://github.com/kamailio/kamailio/commit/6887f4b05a7b9dc58d90cee6aae22cb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-01-30T12:01:49+01:00
kemix: exported function to get timestamp
---
Modified: src/modules/kemix/kemix_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6887f4b05a7b9dc58d90cee6aae22cb…
Patch:
https://github.com/kamailio/kamailio/commit/6887f4b05a7b9dc58d90cee6aae22cb…
---
diff --git a/src/modules/kemix/kemix_mod.c b/src/modules/kemix/kemix_mod.c
index 7c87b7c68b..8ec834d365 100644
--- a/src/modules/kemix/kemix_mod.c
+++ b/src/modules/kemix/kemix_mod.c
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include "../../core/sr_module.h"
#include "../../core/dprint.h"
@@ -710,6 +711,14 @@ static sr_kemi_xval_t* ki_kx_gete_duri(sip_msg_t *msg)
return ki_kx_get_duri_mode(msg, SR_KEMI_XVAL_NULL_EMPTY);
}
+/**
+ *
+ */
+static int ki_kx_get_timestamp(sip_msg_t *msg)
+{
+ return (int)time(NULL);
+}
+
/**
*
*/
@@ -901,7 +910,11 @@ static sr_kemi_t sr_kemi_kx_exports[] = {
{ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
-
+ { str_init("kx"), str_init("get_timestamp"),
+ SR_KEMIP_INT, ki_kx_get_timestamp,
+ { SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE,
+ SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+ },
{ {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
};