I'm trying to use SIP API in my android application and geting some strange situation. If i'm use VitrualBox device with android 4.2.2 it's work well, but when i'm installing the same app to real devices with the same android version it says that SipManager.newInstance(this)
return null
and getApiVersion()
return false
(Testing on Lenovo & GSmart). But when i'm installing another SIP application from play market to device it works well.
I'm trying to find reason, maybe that device firmware some strange but other SIP app works. Can you help to find solution to solve this and get SipManager on device?
Manifest file
<uses-permission android:name="android.permission.USE_SIP" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".WalkieTalkieActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SipSettings"
android:label="set_preferences" />
<receiver
android:name=".IncomingCallReceiver"
android:label="Call Receiver" />
</application>
Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.uniphone.dev3.siptest"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}
So, all i find is that (custom)android phone firmware still goes disgusting with SIP and not all devices can run SIP API. And only one case is to use 3d party library on C++.
As final i used JAIN-SIP java library from Oracle. Examples i found at Mobicents/restcomm-android-sdk