Thanks Juha

That makes it somehow easier to understand my capture. My Kamailio must then have detected a broken TCP connection, though I cannot see why in the capture, neither in the log, but I only run on debug level 2.
It receives a 200 OK on port 37148, and then establishes 37150 to reply with an ACK. 

However two seconds before receiving the 200 OK, there are some spurious retransmissions and out of order on 37148. Perhaps this has caused Kamailio to deem the connection bad, but it still receives data on it.
Now I assume that the providers server (Which also is flying Kamailio) should detect the new port, and continue using that. I got a trace from the provider, where there is no disturbance. Thus the server thinks that the connection is OK. 

Now my next question is, what makes a Kamailio detect this change?
Is it a problem that I only rewrite To and From in the INVITE, thus the ACK contains some other values. 


It is also a bit strange that I get this error exactly, the same place in the conversation every time I make a call. Somehow I suspect some NAT timeout in the router. (it is not carrier grade NAT).
Can I do anything to prevent a NAT timeout from the client side?


Another thing. I assume that sending my internal port in the From field, or any kind of advertising, should be ignored by the server.

Regards Kjeld



Den fre. 6. nov. 2020 kl. 07.45 skrev Juha Heinanen <jh@tutpro.com>:
Kjeld Flarup writes:

> How is TCP SIP actually supposed to handle a BYE, when the client is
> behind NAT.

Client behind NAT is supposed to keep its TCP connection to SIP Proxy
alive and use it for all requests of the call.  If the connection breaks
for some reason, the client sets up a new one for the remaining
requests.

-- Juha

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--

--------------------- Med Liberalistiske Hilsner ----------------------

   Civilingeniør, Kjeld Flarup - Mit sind er mere åbent end min tegnebog
   Sofienlundvej 6B, 7560 Hjerm, Tlf: 40 29 41 49
   Den ikke akademiske hjemmeside for liberalismen - www.liberalismen.dk