【问题标题】:Android SIP API: Shows supported, yet error 'not supported'Android SIP API:显示支持,但错误“不支持”
【发布时间】:2012-12-19 19:46:24
【问题描述】:

我正在尝试构建一个快速示例应用程序,用于演示与 Nexus 7 之间的简单 SIP 调用。该设备当前运行的是 Android 4.2.1。

LogCat 显示错误:

SipBroadcastRequest / SIP VOIP not supported: com.android.phone.SIP_REMOVE_PHONE

我从 API 文档(和代码)中看到,如果 SipManager.isApiSupported(Context context) 返回 false,就会发生这种情况。为了更好的衡量,我检查了两个:

SipManager.isVoipSupported(this);
SipManager.isApiSupported(this);

两者都返回 true。我还看到(从 API 代码)如果 api 调用返回 false,SipManager.newInstance(Context context) 将返回 null。当我使用 SipManager.newInstance(this); 创建一个经理时,我得到了一个有效的经理。

我看到很多类似问题的帖子,但没有找到报告trueSipManager.isVoipSupported(Context context) 电话。有什么想法吗?

注意:我不确定这是否重要,但 cSipSimple(另一个适用于 android 的 SIP/Voip 应用程序)可以在此设备上运行。

更新(12/20/12):我按照 pboy 的建议尝试了 SipDemo。那也不行。该应用程序和我的应用程序都在注册步骤中失败。使用调试器,我中断了onRegistrationFailedSipRegistrationListener 回调。从这里我可以看到 -9 的 int errorCode 和“0”的 String errorMessage。我查找了这个错误代码,它对应于以下内容(取自 SIP API 文档):

public static final int IN_PROGRESS  

在 API 级别 9 中添加
客户端处于事务中,无法发起新的事务。
常数值:-9 (0xfffffff7)

我没有运行其他 SIP 程序。我的应用程序只是新安装的,目前也没有运行。我不确定它会在中间进行什么其他交易?

【问题讨论】:

  • CSipSimple 使用外部库,因此它不知道它是否真的有效。试试 SipDemo,它使用原生库。

标签: android api sip


【解决方案1】:

我希望您在清单中提及以下权限,

<uses-permission android:name="android.permission.USE_SIP" />   
<uses-permission android:name="android.permission.INTERNET" />   
<uses-feature android:name="android.hardware.sip.voip" android:required="true" />   
<uses-feature android:name="android.hardware.wifi" android:required="true" />   
<uses-feature android:name="android.hardware.microphone" android:required="true" />

另外请确保您在连接 wifi 时进行测试,因为当您连接 wifi 而不是其他网络时,android SIP 会提供连接。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多