0
votes

I am working on a sip client - asterisk server. I am using tcp connections.

The client side is Zoiper as for a first test. Registration and outbound calls do work as expected, but after 3-4 minutes from registration process or an outgoing call, when testing incoming calls I do get this message on the server:

tcptls.c:446 ast_tcptls_client_start: Unable to connect SIP socket to ip:port: Connection timed out

The invite message (incoming call) never gets on the client (Zoiper softphone).

Why is this error showing up? The reason why this appears from my assumption is because of the fact that neither the client or the server are sending keep alive messages, so after a tcp socket timeout the client which is behind a nat will not be reachable from the server side anymore.

1

1 Answers

1
votes

This error come because your NAT (or 3g if you use 3g) drop connection. As result there are no way use same connection anymore.

Correct behavour of you app - send SIP OPTIONS message, if timeout - do registration again.

And yes, you need send keepalives(recomended method - OPTIONS message) or setup keepalive on asterisk side and setup in your side correct answer.