Question

I have written a SIP client with a SIP SDK that you can get online. Classic SIP stuff: you register with SIP server, make calls, get called ... This works all fine, but suppose that the SIP server restarts or for some other reason loses the registration of your SIP client. Now other clients can't call you because you are not found on the SIP server.

How is this handled? Do you periodically send another register message even if you're registered? Every 10 minutes or something like that? Do you first unregister then (which means for some time in between you're not reachable, would not be good) and then register or can you call register when you're already registered without problems?

I've also found register/options keep-alive messaging, but I'm not sure what its purpose is, can it handle this scenario where the sip server no longer has your registration? Is it always supported by the sip-servers?

Was it helpful?

Solution

In the response to your REGISTER, you should get an Expires header (you can send one too). You should send another REGISTER request before the expiry time. This should keep you registered in a typical scenario. The server itself shouldn't lose your registration, even if it restarts. If it really doesn't persist the data then there's not much you can do about it. Your registration will be refreshed close to the next expiry time.

As usual - if in doubt, read the RFC:

10.3 Processing REGISTER Requests

...

7. The registrar now processes each contact address in the Contact
     header field in turn.  For each address, it determines the
     expiration interval as follows:

     -  If the field value has an "expires" parameter, that value
        MUST be taken as the requested expiration.

     -  If there is no such parameter, but the request has an
        Expires header field, that value MUST be taken as the
        requested expiration.

     -  If there is neither, a locally-configured default value MUST
        be taken as the requested expiration.

This part should also explain some things: 10.2.1.1 Setting the Expiration Interval of Contact Addresses

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top