pyVoIP
pyVoIP copied to clipboard
[2.0.0a5][Twilio] ACK not received from the SIP endpoint
Here is the abstract .pcap log showing that an outbound call ends in almost 30 seconds due to the lack of ACK to OK:
09:03:04.155141 IP US > THEM: SIP: INVITE sip:<TO_NUMBER>@<TO_HOST> SIP/2.0
09:03:04.155291 IP THEM > US: SIP: SIP/2.0 100 trying -- your call is important to us
09:03:06.696807 IP THEM > US: SIP: SIP/2.0 183 Session progress
09:03:09.582168 IP THEM > US: SIP: SIP/2.0 200 OK
09:03:10.081730 IP THEM > US: SIP: SIP/2.0 200 OK
09:03:11.081714 IP THEM > US: SIP: SIP/2.0 200 OK
09:03:13.081666 IP THEM > US: SIP: SIP/2.0 200 OK
09:03:17.082214 IP THEM > US: SIP: SIP/2.0 200 OK
09:03:21.082937 IP THEM > US: SIP: SIP/2.0 200 OK
09:03:25.084040 IP THEM > US: SIP: SIP/2.0 200 OK
09:03:29.085199 IP THEM > US: SIP: SIP/2.0 200 OK
09:03:33.084364 IP THEM > US: SIP: SIP/2.0 200 OK
09:03:37.087025 IP THEM > US: SIP: SIP/2.0 200 OK
09:03:41.086770 IP THEM > US: SIP: SIP/2.0 200 OK
09:03:42.088682 IP THEM > US: SIP: BYE sip:<FROM_NUMBER>@<FROM_HOST> SIP/2.0
09:03:42.245376 IP US > THEM: SIP: SIP/2.0 200 OK
Error
Related document
https://www.twilio.com/docs/sip-trunking/troubleshooting#problem30
The call connects, there is two-way audio, but the call drops after 20 or 30 seconds
Cause: You SIP communications infrastructure is incorrectly Sending an ACK to Twilio using an IP address other than the Contact header's IP address found in Twilio's 200 OK in the Request-URI. This causes Twilio to not process the ACK, so the transaction times out after 30 seconds, and the call is torn down via a BYE sent from Twilio's side to both sides of the call.
- Your SIP communications infrastructure should use the IP address in the Contact header of Twilio's
200 OK
in the Request-URI of the ACK, and send the ACK to the IP address in the Record-Route header of the same200 OK
.Cause: Your SIP communications infrastructure is incorrectly adjusting/replacing the Twilio Private IP addresses in the URI and headers of the ACK they return with their own Public IP addresses. This is causing Twilio to route the ACK back to the SIP communications infrastructure, and as such not process it. Because the ACK is not processed, Twilio (correctly) times out and tears down the call.
- Your SIP communications infrastructure should never replace any of Twilio's own IP addresses; they should only adjust their own IP addresses.
Related
- https://github.com/tayler6000/pyVoIP/issues/242