Hi Daniel,
Thanks for the quick response. So if I do not use Netstrings, does
Kamailio allow me to create a custom logic in the script. For eg. if I
decide to use newline as a delimiter, can I keep buffering the message
until I encounter the delimiter from the event route and then execute
whatever I have to within the script??
Thanks,
- Jayesh
On Thu, Sep 10, 2015 at 1:29 PM, Daniel-Constantin Mierla <
miconda(a)gmail.com> wrote:
Hello,
tcb is stream protocol and several messages can be queued on the pipe at
the same time. That is the reason for netstring format, to be able to
easily detect the boundaries of each message. If netstring format is
enabled and kamailio receives several messages at once, it splits them and
for each is executing the event route.
If netstring format is not used, the kamailio is executing the event
route with the entire content that was read at once from the tcp connection.
Cheers,
Daniel
On 09/09/15 22:01, Jayesh Nambiar wrote:
Hello,
I'm exploring the evapi module for my kamailio to interface with an
external node.js app for third party stuff like AAA, billing engine tasks,
notifications and so on. I followed and took some ideas from the rtjson and
evapi tutorial found here(
<http://kb.asipto.com/kamailio:k43-async-sip-routing-nodejs>
http://kb.asipto.com/kamailio:k43-async-sip-routing-nodejs) to build the
node.js app consuming events.
When I stress tested the scenario using SIPp and tried sending a lot of
events at 300-350cps from Kamailio, I noticed that at times the client is
receiving 2-3 events in a single message together although I do
event_sync_relay once per SIP message received and have netstrings enabled.
I believe this is a typical behavior of TCP and needs to be handled by the
client using some kind of Netstring handler. Please correct me if I'm wrong.
And hence I'd like to know what particularly needs to be taken care of
while writing a client that is listening for events on raw tcp socket and
how does kamailio handle this situation while receiving messages over TCP
socket?? Does kamailio recognize the end of netstring properly on
evapi:message-received and give exactly one message to take care of on
every "message-received" event or should that be handled in the script
somewhere !!
I also referred cgrates client over evapi example which is written in GO,
but I couldnt find them handling TCP streams clearly either.
I'd really appreciate some expert suggestion here to make an informed
decision on using the evapi module for a large scale solution.
Thanks,
- Jayesh
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin
Mierlahttp://twitter.com/#!/miconda -
http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio -
http://www.asipto.com
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin -
http://asipto.com/u/kat
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users