SIP
502 Bad Gateway
The server, acting as a gateway or proxy, received an invalid response from a downstream server it accessed in attempting to fulfill the request.
When You See This Code
When a SIP proxy receives a malformed or invalid response from the next-hop server. Common in interop scenarios between different vendors.
How to Fix
Check the downstream server's health and configuration. Verify SIP message formatting between the two servers. Review network connectivity.