https://retellai.com/?utm_source=discord&utm_medium=seo logo
Pingpong issues when the agent is talking
# ❓・bug-report
v
We receive delayed pingpong events with timestamps a few seconds in the past relatively often (e.g. see the attached image, the 3rd row is 2.3s in the past). Sometimes, it can be up to 10 or 20s in the past, which causes disconnects. I am having trouble debugging whether the issue is on my side or on retell side, since the public log only has info when retell receives a pingpong back from me, but not when it is actually sent (and the timestamp). This seems to happen almost always when the agent is talking, which is very annoying since the agent randomly stops talking in the middle of the utterance (due to the disconnect). I wonder if there is some issue on retell side where pingpong events can get delayed when the agent talks (some kind of async issue when the TTS gets delayed?). The specific example is for call id 9389d0bc2072ec227237788cbb26b870, after response id 53. I think it is on retell side since there is not much happening on my server, the agent is just talking and the user is quiet.
Another, potentially related issue in call id 1378a3db38d630704d1621196b9807de. Some of the pingpong events that I am sending back are missing from the public log, and I get a disconnect in the middle of the call. The last pingpong received in public log shows up at ~29:37
Copy code
2024-06-06 21:29:37.187 verbose: LLM pingpong event received
After this there is a disconnect at ~29:44
Copy code
2024-06-06 21:29:44.024 verbose: Closing ws due to reconnection. Reconnection count: 0
And no pingpong received in between these two. However, looking at my server log, I am clearly sending back pingpong events in between these.
Copy code
2024-06-06 14:29:37,143 [INFO] Received ping pong with timestamp 1717709377147 (diff: -3.924ms), sending it back.
2024-06-06 14:29:39,501 [INFO] Received ping pong with timestamp 1717709379320 (diff: 181.918ms), sending it back.
2024-06-06 14:29:42,726 [INFO] Received ping pong with timestamp 1717709381549 (diff: 1177.469ms), sending it back.
Any explanation on why are these getting dropped? I was talking slowly, so responses kept getting cancelled and news ones required, but this shouldn't really affect pingpong events received on retell side?
n
I think I too had run into these issues with ping-pong event and disconnections. You can try turning off "auto_reconnect" and it will not rely on the ping-pong mechanism. Generally I havent ran into issues with auto_reconnect as False.
Copy code
const config: CustomLlmResponse = {
            response_type: "config",
            config: {
              auto_reconnect: false,
              call_details: true,
            },
          };
But I think @Todd - Cofounder@Retell AI if you can help here it would be great
v
Yeah I wasn't sure how important the auto_reconnect is. Since the retell documentation recommends to have it on, I've tried to keep it on and follow best practices. If it keeps happening might have to turn it off as well
m
@vtshitoyan any news?? I might turn my auto_reconnect off as well because my call is also dropping
v
We haven't had any issues with this lately. We also had a couple of blocking (non async) functions in the code, converting them to async might have helped too.
m
Thank you! Setting auto_reconnect to False, seems to have solve the issue here as well.