sipsorcery
sipsorcery copied to clipboard
How can I send a keepalive message to the server?
Hi! The server is located behind NAT. After some time, during an active conversation, the server terminates the connection due to the absence of incoming packets. Does the sipsorcery send the keepalive itself? If not, how can I do it myself? I use 4.0.51-pre sipsorcery version.
I'm guessing you mean for a SIP registration? The simple way would be to reduce the register expiry interval to less than the NAT connection timeout. Try a value of 180 seconds.
Other than that there was NAT keep alive logic in a previous sipsorcery SIP Registrar server, see here. There's currently no equivalent logic in the SIPRegistrationUserAgent, PR's welcome.
We tried to set the value using SetExpiry, but it is confused by another value from the header. I attach the wireshark log. https://disk.yandex.ru/d/bHM749PBDfOOjQ
We tried to set the value using SetExpiry, but it is confused by another value from the header.
Can you explain what you mean?
In your wireshark trace the client requested an expiry of 600 seconds and the server accepted it. Do you mean the server wouldn't accept vaues below 600? If so that's not unusual, SIP Registrars often set a limit on the minimum expiry time to avoid getting overloaded.