Reputation: 167
I am working on iOS VOIP app using pjsip. I am able to make call and also able to hang up answered call but the problem is I can't hangup call when it is in its ringing state. So if anyone has any idea about it then please help.
Upvotes: 0
Views: 2885
Reputation: 14148
You can't call pjsua_call_hangup on a call that hasn't been established state yet. This is a sip part of the sip protocol.
What you do is send a response with a rejection status code. So in pjsip you call pjsua_call_answer with a status code of something like 486 (busy here) or 603 (decline). This will effectively "hangup" your ringing leg of the call. You could also return a status code of 600 (busy everywhere) if you want all ringing legs to be released (assuming the sip proxy handles this status code correctly).
Upvotes: 3