2012-12-19 113 views
11

我有一个快速示例应用程序,我正在尝试构建,以演示来自Nexus 7的简单SIP调用。该设备当前正在运行Android 4.2.1。Android SIP API:显示支持,但错误'不支持'

logcat中显示了错误:

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

我从API文档(和代码)看到这种情况的发生,如果SipManager.isApiSupported(上下文的背景下)返回false。良好的措施,我查了两个:

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

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

我看到很多类似问题的帖子,但没有发现任何报告trueSipManager.isVoipSupported(Context context)调用。有任何想法吗?

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

UPDATE(12/20/12):我尝试了每个pboy的建议SipDemo。那也行不通。注册步骤中,该应用和我的应用都失败。使用调试器,我在的onRegistrationFailed回调中断。从这里我可以看到-9的int errorCode和“0”的String errorMessage。我抬头一看这个错误代码,它对应于以下(从SIP API文档拍摄):

public static final int IN_PROGRESS 

Added in API level 9
The client is in a transaction and cannot initiate a new one.
Constant Value: -9 (0xfffffff7)

我有没有运行其它程序的SIP。我的应用程序只是刚刚安装,并且目前没有运行。我不确定在这期间还会有其他交易吗?

+1

CSipSimple使用外部库,因此它不会告诉它是否真正起作用。尝试SipDemo,它使用本地库。 – plmaheu

回答

0

我希望你有提到按照您的清单许可,

<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连接,因为Android的SIP是提供连接,当你带wifi连接不与其他网络。