Module: kamailio
Branch: master
Commit: cae9b5655b1779e4f968f9ab16a5bae41151e4a4
URL:
https://github.com/kamailio/kamailio/commit/cae9b5655b1779e4f968f9ab16a5bae…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-10-18T18:41:20+02:00
sipdump: details of running processes written in meta file
---
Modified: src/modules/sipdump/sipdump_mod.c
Modified: src/modules/sipdump/sipdump_write.c
---
Diff:
https://github.com/kamailio/kamailio/commit/cae9b5655b1779e4f968f9ab16a5bae…
Patch:
https://github.com/kamailio/kamailio/commit/cae9b5655b1779e4f968f9ab16a5bae…
---
diff --git a/src/modules/sipdump/sipdump_mod.c b/src/modules/sipdump/sipdump_mod.c
index 4a7dfd4c16..c95e0b091a 100644
--- a/src/modules/sipdump/sipdump_mod.c
+++ b/src/modules/sipdump/sipdump_mod.c
@@ -169,7 +169,6 @@ int sipdump_buffer_write(sipdump_info_t *sdi, str *obuf)
ti = localtime(&tv.tv_sec);
obuf->len = snprintf(_sipdump_wbuf, SIPDUMP_WBUF_SIZE,
"====================\n"
- "v: 1.0\n"
"tag: %.*s\n"
"pid: %d\n"
"process: %d\n"
diff --git a/src/modules/sipdump/sipdump_write.c b/src/modules/sipdump/sipdump_write.c
index d3b2a8a7fe..03ed711d81 100644
--- a/src/modules/sipdump/sipdump_write.c
+++ b/src/modules/sipdump/sipdump_write.c
@@ -28,6 +28,8 @@
#include "../../core/dprint.h"
#include "../../core/ut.h"
#include "../../core/globals.h"
+#include "../../core/ver.h"
+#include "../../core/pt.h"
#include "../../core/rpc.h"
#include "../../core/rpc_lookup.h"
@@ -133,6 +135,7 @@ static int sipdump_write_meta(char *fpath)
{
char mpath[SIPDUMP_FPATH_SIZE];
int len;
+ int i;
FILE *mfile = NULL;
struct tm *ti;
@@ -156,9 +159,19 @@ static int sipdump_write_meta(char *fpath)
ti = localtime(&up_since);
fprintf(mfile,
"v: 1.0\n"
- "start: %s",
- asctime(ti)
+ "version: %s %s\n"
+ "start: %s"
+ "nrprocs: %d\n",
+ ver_name, ver_version,
+ asctime(ti),
+ *process_count
);
+ for (i=0; i<*process_count; i++) {
+ fprintf(mfile,
+ "process: %d %d %s\n",
+ i, pt[i].pid, pt[i].desc);
+ }
+
fclose(mfile);
return 0;
}