SipManager无法创建SipService。无法在牛轧糖中绑定Context.SIP_SERVICE

时间:2018-10-16 21:51:05

标签: android sip voip

我有一个使用SipManager打开SIP配置文件的应用程序。我可以很轻松地在较旧的(KitKat)设备上打开SIP配置文件,但是我的新设备(Nougat)会引发SipException“ SipService已死,正在重新启动...”

单步执行SipManager会发现'createSipService'没有绑定'Context.SIP_SERVICE'。

我发现了this post,这似乎是同样的问题。

有人知道KitKat和Nougat之间发生的变化会导致这种错误吗?我该如何解决?

更新

这是我尝试运行mySipManager.open(mSipProfile,endingIntent,null)时遇到的异常;

`

W/System.err: android.net.sip.SipException: SipService is dead and is restarting...
W/System.err:     at android.net.sip.SipManager.checkSipServiceConnection(SipManager.java:183)
                  at android.net.sip.SipManager.open(SipManager.java:244)
W/System.err:     at com.example.angrinord.myApplication.MyApplication.refreshSipManager(MyApplication.java:59)
                  at com.example.angrinord.myApplication.MyApplication.onCreate(MyApplication.java:41)
W/System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
                  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6017)
W/System.err:     at android.app.ActivityThread.-wrap3(ActivityThread.java)
W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1727)
                  at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err:     at android.os.Looper.loop(Looper.java:154)
                  at android.app.ActivityThread.main(ActivityThread.java:6823)
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1557)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445

)`

这是在运行.open()和.close()时发生的。

更新2

我刚购买了Pixel 3(Android 9),但没有问题。我不能说5,6或8,但这可能是7的错误,因为4和9都没有问题。

1 个答案:

答案 0 :(得分:-1)

Is Wifi Calling enabled (or can be enabled) on your device?

I have the same issue with an Asus (model X00PD), android is 8.0.

SipManager.IsApiSupported() and SipManager.IsVoipSupported() both return true, however, if I view services under Developer options, Wifi Calling is not running, and the Asus ui disables the option to enable it.

To contrast the Wifi-Calling service is running on my S8 (also 8.0), by default. Same with an older S6(7.0) and a Nokia 6.1(8.1).