app/src/main/java/com/yahala/sip/IncomingCallReceiverOld.java
/**
     * Processes the incoming call, answers it, and hands it over to the
     * WalkieTalkieActivity.
     *
     * @param context The context under which the receiver is running.
     * @param intent  The intent being received.
     */
Processes the incoming call, answers it, and hands it over to the
WalkieTalkieActivity.

@param context The context under which the receiver is running.
@param intent  The intent being received.
Processes the incoming call answers it and hands it over to the WalkieTalkieActivity . @param context The context under which the receiver is running . @param intent The intent being received .
@Override
    public void onReceive(Context context, Intent intent) {
        SipAudioCall incomingCall = null;
        try {
            SipAudioCall.Listener listener = new SipAudioCall.Listener() {
                @Override
                public void onRinging(SipAudioCall call, SipProfile caller) {
                    try {
                        call.answerCall(30);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            };
            incomingCall.answerCall(30);
            incomingCall.startAudio();
            incomingCall.setSpeakerMode(true);
            if (incomingCall.isMuted()) {
                incomingCall.toggleMute();
            }
        } catch (Exception e) {
            if (incomingCall != null) {
                incomingCall.close();
            }
        }
    }
@ Override public void onReceive ( Context context , Intent intent ) { SipAudioCall incomingCall = null ; try { SipAudioCall . Listener listener = new SipAudioCall . Listener ( ) { @ Override public void onRinging ( SipAudioCall call , SipProfile caller ) { try { call . answerCall ( 30 ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } ; incomingCall . answerCall ( 30 ) ; incomingCall . startAudio ( ) ; incomingCall . setSpeakerMode ( true ) ; if ( incomingCall . isMuted ( ) ) { incomingCall . toggleMute ( ) ; } } catch ( Exception e ) { if ( incomingCall != null ) { incomingCall . close ( ) ; } } }
Processes the incoming call, answers it, and hands it over to the
 WalkieTalkieActivity.
Processes the incoming call answers it and hands it over to the WalkieTalkieActivity .
//       WalkieTalkieActivity wtActivity = (WalkieTalkieActivity) context; //      incomingCall = wtActivity.mSipManager.takeAudioCall(intent, listener); //      wtActivity.call = incomingCall; //      wtActivity.updateStatus(incomingCall);