Hi,
I'm using evapi to emit JSON blobs to share presence event transitions
with a TCP client:
loadmodule "evapi"
modparam("evapi", "workers", 4)
modparam("evapi", "bind_addr", "0.0.0.0:8010")
modparam("evapi", "netstring_format", 0)
if($hdr(Event) eq 'dialog' && $cl > 0) {
$xml(u=>doc) = $rb;
$var(state) =
$xml(u=>xpath:/di:dialog-info/di:dialog/di:state/text());
evapi_relay("{ \"type\": \"state_transition\", "
"\"sip_user\": \"$(fU{s.escape.common})\", "
"\"sip_domain\": \"$(fd{s.escape.common})\", "
"\"state\": \"$var(state)\" }");
}
Every once in a while, however, my consumer service's JSON.parse()
throws a parsing exception. There seems to be no particular pattern.
When I investigated the actual string being sent, I found two objects
concatenated:
JSON parsing exception: SyntaxError: Unexpected token {
Raw received string was: { "type": "state_transition", "sip_user":
"6789540671", "sip_domain": "sip.evaristesys.com", "state": "" }{
"type": "state_transition", "sip_user": "6789540671", "sip_domain":
"sip.evaristesys.com", "state": "" }
Any ideas as to why this might happen?
Thanks,
-- Alex
--
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
CC (gcc) [M statsd.so] lib_statsd.o
lib_statsd.c:96: warning: ‘statsd_set’ defined but not used
lib_statsd.c:110: warning: ‘statsd_gauge’ defined but not used
lib_statsd.c:116: warning: ‘statsd_count’ defined but not used
lib_statsd.c:130: warning: ‘statsd_timing’ defined but not used
lib_statsd.c:136: warning: ‘statsd_init’ defined but not used
lib_statsd.c:149: warning: ‘statsd_destroy’ defined but not used
/O
Module: kamailio
Branch: master
Commit: 54028ccb2082bbf33e510c0549afcdd862aa3920
URL: https://github.com/kamailio/kamailio/commit/54028ccb2082bbf33e510c0549afcdd…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)edvina.net>
Date: 2015-01-10T16:24:32+01:00
h350 remove svn ID's and history
---
Modified: modules/h350/h350_exp_fn.c
Modified: modules/h350/h350_exp_fn.h
Modified: modules/h350/h350_mod.c
Modified: modules/h350/h350_mod.h
---
Diff: https://github.com/kamailio/kamailio/commit/54028ccb2082bbf33e510c0549afcdd…
Patch: https://github.com/kamailio/kamailio/commit/54028ccb2082bbf33e510c0549afcdd…
---
diff --git a/modules/h350/h350_exp_fn.c b/modules/h350/h350_exp_fn.c
index ddbed57..f92e210 100644
--- a/modules/h350/h350_exp_fn.c
+++ b/modules/h350/h350_exp_fn.c
@@ -1,13 +1,10 @@
/*
- * $Id: $
- *
* Kamailio H.350 Module
*
* Copyright (C) 2007 University of North Carolina
*
* Original author: Christian Schlatter, cs(a)unc.edu
*
- *
* This file is part of Kamailio, a free SIP server.
*
* Kamailio is free software; you can redistribute it and/or modify
@@ -24,9 +21,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * History:
- * --------
- * 2007-03-12: Initial version
*/
#include <regex.h>
diff --git a/modules/h350/h350_exp_fn.h b/modules/h350/h350_exp_fn.h
index fc6bef9..283f4bc 100644
--- a/modules/h350/h350_exp_fn.h
+++ b/modules/h350/h350_exp_fn.h
@@ -1,13 +1,10 @@
/*
- * $Id: $
- *
* Kamailio H.350 Module
*
* Copyright (C) 2007 University of North Carolina
*
* Original author: Christian Schlatter, cs(a)unc.edu
*
- *
* This file is part of Kamailio, a free SIP server.
*
* Kamailio is free software; you can redistribute it and/or modify
@@ -24,9 +21,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * History:
- * --------
- * 2007-03-12: Initial version
*/
#ifndef H350_EXP_FN_H
diff --git a/modules/h350/h350_mod.c b/modules/h350/h350_mod.c
index 2e49393..e2216d6 100644
--- a/modules/h350/h350_mod.c
+++ b/modules/h350/h350_mod.c
@@ -1,6 +1,4 @@
/*
- * $Id: $
- *
* Kamailio H.350 Module
*
* Copyright (C) 2007 University of North Carolina
@@ -24,9 +22,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * History:
- * --------
- * 2007-03-12: Initial version
*/
#include "../../ut.h"
diff --git a/modules/h350/h350_mod.h b/modules/h350/h350_mod.h
index a3d7e0c..b2b78f7 100644
--- a/modules/h350/h350_mod.h
+++ b/modules/h350/h350_mod.h
@@ -1,6 +1,4 @@
/*
- * $Id: $
- *
* Kamailio H.350 Module
*
* Copyright (C) 2007 University of North Carolina
@@ -24,9 +22,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
- * History:
- * --------
- * 2007-03-12: Initial version
*/
Module: kamailio
Branch: master
Commit: 508b11011c85bb21e5bd4212a16fabb9136e22fa
URL: https://github.com/kamailio/kamailio/commit/508b11011c85bb21e5bd4212a16fabb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-01-10T11:39:01+01:00
docbook/Makefile: use default system catalog implicitely
- custom catalog can be forced with nocatalog=no
---
Modified: docbook/Makefile
---
Diff: https://github.com/kamailio/kamailio/commit/508b11011c85bb21e5bd4212a16fabb…
Patch: https://github.com/kamailio/kamailio/commit/508b11011c85bb21e5bd4212a16fabb…
---
diff --git a/docbook/Makefile b/docbook/Makefile
index 0fd61e2..ec5841d 100644
--- a/docbook/Makefile
+++ b/docbook/Makefile
@@ -99,6 +99,10 @@ html_css ?= /css/sr-doc.css
# file or docbook xsl stylesheets are being installed.
catalog ?= $(docbook_dir)/catalog.xml
+# Use standard catalog from OS, set it to no to use the above path to a
+# custom catalog file.
+nocatalog ?= yes
+
lynx ?= lynx
dia ?= dia
xsltproc ?= xsltproc