开发者

[SIP]How to verify that the other peer has answered the call

I'm developping a SIP application and want to do some treatment when the other peer has answered an outgoing call.

A is calling B. If B answered the call make 开发者_StackOverflow中文版some treatment in A

I verified the documentation and i'm not finding a solution: Link1 Link 2

Any idea please of how solve this problem ?

Thank you very much.


part of sample code SipDemo

A call B

call = manager.makeAudioCall(me.getUriString(), "b-username@domain", listener, 30);

When B answer

SipAudioCall.Listener listener = new SipAudioCall.Listener() {

    @Override
    public void onCallEstablished(SipAudioCall call) {  
        Log.v("call","b answering");                
        call.startAudio();
    }


Okay i've found it, but i have a question

public int getState ()

Since: API Level 9
Gets the session state. The value returned must be one of the states in SipSession.State.
Returns

the session state

How to put the constant INCOMING_CALL_ANSWERINGin the gesState() ?

if (call.getState(INCOMING_CALL_ANSWERING)) 

?? It's not working.

EDIT: okay , i ahve to do like this:

if (call.getState()== 4)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜