Getting truncated ARI event occasionally

Hi Team,
I am getting a trunacted(invalid JSON) sometimes via ARI, when does this happen and why can this happen can you please help with this.

{“variable”:“STASISSTATUS”,“value”:“”,“type”:“ChannelVarset”,“timestamp”:“2026-07-08T1
9:01:04.888+0530”,“channel”:{“id”:“1783517464.460968”,“name”:“PJSIP/jio2dl.aws.sbc.exotel.com-00051aa9”,“state”:“Ring”,“protocol_id”:"18141699628720261914@100.64<88>^B^C

Where are you seeing the truncated message? If this is from your application or from an Asterisk log or CLI output? Please enable Asterisk ARI debug logging (ari set debug on) and provide the output showing a truncated message. A network trace showing the message would also help determine if Asterisk is sending a truncated message or if the issue lies beyond.

Hi mbradeen,
I am seeing the truncated message from asterisk, I have the TCP dump trace of such a kind of event. Also in my ari.conf the the websocket write timeout is 100ms and I have also enabled a few RTP events in it which I am getting from asterisk and my server would mostly have active channle count of around 700 to 800, does this ari configuration needs a tuning? Is this happeing because, asterisk is forming a bigger payload(including RTPQOS) and since write timeout is only 100 ms is it ending up writing incomplete messages over websocket to my appliaction?

Asterisk trace:-
{“variable”:“STASISSTATUS”,“value”:“SUCCESS”,“type”:“ChannelVarset”,“timestamp”:“2026-07-06T17:20:55.676+0530”,“channel”:{“id”:“1783338644.1023336”,“name”:“PJSIP/airvee1.aws.sbc.exotel.com-000ad372”,“state”:“Ring”,“protocol_id”:"LU-1783338644155296-436680551@bcf.mup08.ims.mnc092.mcc404.3gppnetwork.org",“caller”:{“name”:“Unavailable”,“number”:“+917948502152”},“connected”:{“name”:“”,“number”:“”},“accountcode”:“”,“dialplan”:{“context”:“from-internal”,“exten”:“+912241050000”,“priority”:3,“app_name”:“Stasis”,“app_data”:“exopbx”},“creationtime”:“2026-07-06T17:20:44.162+0530”,“language”:“en”,“channelvars”:{“RTPAUDIOQOS”

As soon as I hear “WebSocket” and “truncated”, I immediately think: are you sure you are correctly receiving all segments of a WebSocket message before trying to process it?

In these cases, I am not getting it in proper JSON, but there are cases where I do get a proper event. One more observation is that this happens only on STASISSTATUS variable. Not sure if that’s a useful observation.

A WebSocket message can be split across multiple segments.

For example, I use the Python wsproto module to handle WebSocket communication in Seaskirt. When receiving a message, you have to remember to check the message_finished flag on the event, to be sure you have the whole thing:

With wss getting data in multiple chunk, each chunks should be a proper json right? It is not like an incomplete json get’s sent via wss, a message can be divided into multiple chunks but each of those chunks should be in a valid json format. If you see the above trace that I have shared it is not in a problem json format from asterisk side.

I’m still a little confused. Is the debug output from the Asterisk CLI/log showing the truncated message or is the message only showing as truncated in your application? Does the tcp dump show the rest of the message in a subsequent packet?