I use SIP to connect a Twilio caller to gpt-realtime, then monitor the call with a websocket connection. I’ve noticed that when the call ends (like when the caller hangs up) the websocket is not sent a CLOSE frame, it just exits suddenly with EOF. This makes an unintentional disconnect indistinguishable from an intentional disconnect at the end of a call. My current workaround is to attempt to reconnect the websocket every time there is a disconnect, and if the call has ended I’ll get a 404 error because the call_id is no longer valid. But ideally the websocket connection would be terminated nicely so that I could distinguish between accidental disconnects that need reconnecting and intentional disconnects that don’t.
4 Likes
Great idea! I will add that. Will drop a message here when complete
5 Likes
On the same topic, it would be great to have a ‘status’ REST endpoint alongside the accept/reject/hangup/refer endpoints.
Maybe easier to implement than the WS close frame for a similar outcome.
Thanks for your work !