Android SDK SIP functions examples --> Android Phone - crashes happens

venkypokala

New Member
I have implemented in background service when start service function good. if i stop that service it will crashed every time.

SDK : wcs-android-sdk-1.1.0.13-release.aar

java.lang.IllegalArgumentException: Receiver not registered: org.webrtc.NetworkMonitorAutoDetect@817ea71
2020-06-21 20:28:46.449 5799-6024/com.evolgence.on W/System.err: at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:1429)
2020-06-21 20:28:46.449 5799-6024/com.evolgence.on W/System.err: at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1577)
2020-06-21 20:28:46.449 5799-6024/com.evolgence.on W/System.err: at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:664)
2020-06-21 20:28:46.449 5799-6024/com.evolgence.on W/System.err: at org.webrtc.NetworkMonitorAutoDetect.unregisterReceiver(NetworkMonitorAutoDetect.java:751)
2020-06-21 20:28:46.449 5799-6024/com.evolgence.on W/System.err: at org.webrtc.NetworkMonitorAutoDetect.destroy(NetworkMonitorAutoDetect.java:729)
2020-06-21 20:28:46.449 5799-6024/com.evolgence.on W/System.err: at org.webrtc.NetworkMonitor.stopMonitoring(NetworkMonitor.java:129)
2020-06-21 20:28:46.449 5799-6024/com.evolgence.on W/System.err: at org.webrtc.NetworkMonitor.stopMonitoring(NetworkMonitor.java:138)
2020-06-21 20:28:46.449 5799-6024/com.evolgence.on E/rtc: #
# Fatal error in: gen/sdk/android/generated_base_jni/jni/../../../../../../../../../usr/local/google/home/sakal/code/webrtc-aar-release/src/sdk/android/src/jni/jni_generator_helper.h, line 85
# last system error: 0
# Check failed: !env->ExceptionCheck()

#
 

Max

Administrator
Staff member
Good day.
Please check the recommendations on this page about background service implemetation. If this does not help, please provide us Android Phone code example with minimal changes to reproduce the problem using this link (please add code example archive).
 

venkypokala

New Member
Hi Max,

i sent example code archive. Please give us solution. we are start sip call in service then goes out side from our app then come back to our app then stop sip call in this scenario we getting error
 

Max

Administrator
Staff member
Good day.
Please don't try to speed up investigation by flooding the topic.
About your code. Please consider your code refactoring as shown in this example as we wrote above:
1. Don't use finish() in main activity right after service starting
2. Service should not implement SessionOptions. All the implementations concerning SIP call setup should be moved to main activity.
3. Call should be stopped in service onDestroy(), but session should be disconnected in main activity onDestroy().
4. Session should be declared as static in service implementation.
 
Last edited:

venkypokala

New Member
but session should be disconnected in main activity onDestroy()
As you mentioned, we tried in session disconnected in main activity onDestroy(). SIP call is disconnected.

1.Create session in main activity then it's move to service to store as static session.

2. Now we move to another activity. In main activity session disconnected onDestroy() call will closed.

Please give us any sample implementation or explain step by step
 

Max

Administrator
Staff member
2. Now we move to another activity. In main activity session disconnected onDestroy() call will closed.
This probably happens because you call finish() from main activity OnClick() rigth after service is starting. So, main activity finishes, and onDestroy works.
Please give us any sample implementation or explain step by step
Please take this example and replace stream publishing to voice call referring to Android Phone example.
 
Top