Module: sip-router
Branch: master
Commit: 9bf9a7448848580aa883dbdfb26125e27d5ac32d
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9bf9a74…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Apr 9 10:42:15 2014 +0200
evapi: netstring format option applies for sent messages
---
modules/evapi/evapi_dispatch.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/modules/evapi/evapi_dispatch.c b/modules/evapi/evapi_dispatch.c
index 7b42320..60c5bfa 100644
--- a/modules/evapi/evapi_dispatch.c
+++ b/modules/evapi/evapi_dispatch.c
@@ -524,9 +524,16 @@ int evapi_relay(str *evdata)
return -1;
}
sbuf->s = (char*)sbuf + sizeof(str);
- sbuf->len = snprintf(sbuf->s, sbsize+32,
- EVAPI_RELAY_FORMAT,
- sbsize, evdata->len, evdata->s);
+ if(_evapi_netstring_format) {
+ /* netstring encapsulation */
+ sbuf->len = snprintf(sbuf->s, sbsize+32,
+ EVAPI_RELAY_FORMAT,
+ sbsize, evdata->len, evdata->s);
+ } else {
+ sbuf->len = snprintf(sbuf->s, sbsize+32,
+ "%.*s",
+ evdata->len, evdata->s);
+ }
if(sbuf->len<=0 || sbuf->len>sbsize+32) {
shm_free(sbuf);
LM_ERR("cannot serialize event\n");