Code example for SipAudioCall

Methods: getPeerProfileisMutedsetListenerstartAudiotoggleMute

4
                // Much of the client's interaction with the SIP Stack will 
                // happen via listeners.  Even making an outgoing call, don't 
                // forget to set up a listener to set things up once the call is established. 
                @Override 
                public void onCallEstablished(SipAudioCall call) {
                	call.setListener(this);
                	call.startAudio();
                    //call.setSpeakerMode(true); 
                    if(call.isMuted()) call.toggleMute();
                    updateStatus(call);
                } 
 
                @Override 
                public void onCallEnded(SipAudioCall call) {
                    updateStatus("Ready."); 
                } 
            }; 
 
            call = manager.makeAudioCall(me.getUriString(), sipAddress, listener, 30);
            //call.startAudio(); 
 
        } 
        catch (Exception e) {
            Log.i("WalkieTalkieActivity/InitiateCall", "Error when trying to close manager.", e);
            if (me != null) {
                try { 
                    manager.close(me.getUriString());
                } catch (Exception ee) {
                    Log.i("WalkieTalkieActivity/InitiateCall",
                            "Error when trying to close manager.", ee);
                    ee.printStackTrace();
                } 
            } 
            if (call != null) {
                call.close();
            } 
        } 
    } 
	 
	public void updateStatus(final String status) {
        // Be a good citizen.  Make sure UI changes fire on the UI thread. 
        /*this.runOnUiThread(new Runnable() { 
            public void run() { 
                TextView labelView = (TextView) findViewById(R.id.sipLabel); 
                labelView.setText(status); 
            } 
        });*/ 
    } 
	public void updateStatus(SipAudioCall call) {
        String useName = call.getPeerProfile().getDisplayName();
        if(useName == null) {
          useName = call.getPeerProfile().getUserName();
        } 
        updateStatus(useName + "@" + call.getPeerProfile().getSipDomain());
    } 
	 
}