Android中不支持VOIP API?

时间:2016-08-01 07:56:03

标签: android android-studio sip voip android-wifi

当我使用本机SIP呼叫

时,在轰鸣声线上发生崩溃
  

call = manager.makeAudioCall(me.getUriString(),sipAddress,listener,   30);

public SipAudioCall makeAudioCall(String localProfileUri,
            String peerProfileUri, SipAudioCall.Listener listener, int timeout)
            throws SipException {
        if (!isVoipSupported(mContext)) {
            throw new SipException("VOIP API is not supported");
        }
        try {
            return makeAudioCall(
                    new SipProfile.Builder(localProfileUri).build(),
                    new SipProfile.Builder(peerProfileUri).build(), listener,
                    timeout);
        } catch (ParseException e) {
            throw new SipException("build SipProfile", e);
        }
    }

崩溃日志。

08-01 13:26:54.627 9574-9574/com.example.android.sip I/WalkieTalk: Error when trying to close manager.
                                                                   android.net.sip.SipException: VOIP API is not supported
                                                                       at android.net.sip.SipManager.makeAudioCall(SipManager.java:368)
                                                                       at com.example.android.sip.WalkieTalkieActivity.initiateCall(WalkieTalkieActivity.java:213)
                                                                       at com.example.android.sip.WalkieTalkieActivity$5.onClick(WalkieTalkieActivity.java:324)
                                                                       at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:163)
                                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                       at android.os.Looper.loop(Looper.java:148)
                                                                       at android.app.ActivityThread.main(ActivityThread.java:5443)
                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

我在Device上测试过:Mi,Moto x

1 个答案:

答案 0 :(得分:0)

Android中的SIP Stack已经过时了。见https://telestax.com/jain-sip-stack-for-android/

我建议实际上进入更高级别并使用类似restcomm-android-sdk的内容。如果您确实需要使用原始SIP堆栈,您仍然可以使用https://github.com/RestComm/jain-sip

来执行此操作