Realtime API SIP inbound calls failing again before webhook dispatch
We found the root cause on our side: the payload we were sending to /v1/realtime/calls/{call_id}/accept was malformed or invalid.
However, the main issue is that the /accept endpoint was still returning HTTP 200 even though the payload was not valid enough to successfully establish the SIP/Realtime session.
This made troubleshooting very difficult because the flow looked successful from the HTTP side:
SIP INVITE reached OpenAI.
OpenAI dispatched the
realtime.call.incomingwebhook.Our server called
/v1/realtime/calls/{call_id}/accept./acceptreturned HTTP 200.After that, SIP failed with
400 Bad Request/error code: 504.The WebSocket connection returned
404 call_id_not_found.
The actual problem was the accept payload, but because /accept returned 200, the failure appeared to be a SIP/WebSocket/session propagation issue.
OpenAi should to improve the validation and error handling for the /accept endpoint
If the accept payload is invalid or malformed, the endpoint should return a clear 4xx response with details about the invalid field, instead of returning 200 and later failing the SIP session indirectly.
This would make the Realtime SIP integration much easier to debug and would prevent misleading downstream errors such as SIP 400 / error code: 504 and WebSocket call_id_not_found.
PS: Basically this problem was generated by the main INCIDENT after our team try to solve first problem that was not us.
Discussion in the ATmosphere