Module: kamailio
Branch: master
Commit: 72099714de86311b704621034b5ef07ec05a1147
URL:
https://github.com/kamailio/kamailio/commit/72099714de86311b704621034b5ef07…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2019-07-19T09:56:45+02:00
Merge pull request #2013 from surendratiwari3/no_evapi_client_send_failed
evapi:return code and log fixed for no evapi client while sending
---
Modified: src/modules/evapi/evapi_dispatch.c
---
Diff:
https://github.com/kamailio/kamailio/commit/72099714de86311b704621034b5ef07…
Patch:
https://github.com/kamailio/kamailio/commit/72099714de86311b704621034b5ef07…
---
diff --git a/src/modules/evapi/evapi_dispatch.c b/src/modules/evapi/evapi_dispatch.c
index b6997e2295..52a62d8551 100644
--- a/src/modules/evapi/evapi_dispatch.c
+++ b/src/modules/evapi/evapi_dispatch.c
@@ -728,6 +728,7 @@ int _evapi_relay(str *evdata, str *ctag, int unicast)
int len;
int sbsize;
+ int evapi_send_count;
evapi_msg_t *emsg;
LM_DBG("relaying event data [%.*s] (%d)\n",
@@ -781,7 +782,12 @@ int _evapi_relay(str *evdata, str *ctag, int unicast)
cfg_update();
LM_DBG("dispatching [%p] [%.*s] (%d)\n", emsg,
emsg->data.len, emsg->data.s, emsg->data.len);
- evapi_dispatch_notify(emsg);
+ evapi_send_count = evapi_dispatch_notify(emsg);
+ if (evapi_send_count == 0) {
+ shm_free(emsg);
+ LM_ERR("no evapi client to send the message, failed to send message\n");
+ return -1;
+ }
shm_free(emsg);
}
return 0;