I am using native methods of sip calling and it is working fine but some time it is giving registration error IN_PROGRESS (Error Code -9 ) .I have search in Sip Error codes
SIP is a transaction based protocol, this means, every negotiation process is a transaction (e.g. a basic registration process would imply sending a REISTER request and receive 200 OK response). I posted a small example in this response.
IN_PROGRESS error initially indicates that you tried to start a new transaction, in your scenario you're trying to send a REGISTER request, when client is already in another related one.
A quite typical scenario is, in a fast logout/login, trying to register when unregistration process is still running (no 200 OK final response has been received).
Main problem regarding Android's SIP implementation and this error code is that it's used when as generic error when processing a SIP request fails so, previous meaning loses its significance.
Because of previous problem you would need to check logcat to get more information (you should see something like "~~~~~ SipSessionGroup:: processing ") but, best way to handle this, would be working with different listeners provided by the stack.
The stack provides two listeners that can get registration errors: SipRegistrationListener and SipSession.Listener. Both provides onRegistrationFailed callback but, later one, also provides onRegistrationTimeout, that can be quite helpful. Actually, you already used SipRegistrationListener in your code but I don't really get why you say that it should be set after open
because open
would try to automatically register and, if some error occurs, you won't be notified.
On the other hand, main problem with this listeners is that registration can fail because of several reason (you can check a list of different error responses here) and current implementation only notifies of error codes >= 500 (those are server and global failures) but not others like quite common 406. This is, in my opinion, an important bug in this stack.