Confused about what constant to use
I just want that my SIP application detects if the other peer has answered my outgoing call, if yes, i want to make write some code(like vibrating the phone or something like this).
I verified the documentation and i find this. I don't know what constants should i use and where to put it(normally in the 开发者_StackOverflow社区onCallEstablished(SipAudioCall call)
function ?.
Thank you for your help.
The doc says that onCallEstablished(SipAudioCall call)
is called right after the session has been established so the peer has answered the call by that time ( and 200OK, ACK went through ). So you can hang your "vibrate" or whatever code right on that callback. Also the state that the call
object should be in is IN_CALL
.
If you don't want to process the call establishment but rather just a peer pressing "Answer" button (that does not guarantee that the call will be established since there might be loss of 200OK or ACK message, codec incompatibility or failure to bring up media streams due to NAT or some other networking problems) then I guess you will have to override onChanged(SipAudioCall call)
and check the state for INCOMING_CALL_ANSWERING
.
Cheers
精彩评论