I am developing a sip application that do sip to sip and sip to other phone calls. I also wanted to record the both. Finally, I found out that the linphone-sdk can solve the problems. I had integrated Linphone-sdk from their maven repository to my app. I am using another Sip client for calls (Not a linphone account). Outgoing calls are working perfectly. But, whenever we receive an incoming call to the sip account, the app gets terminated with an error in log cat.
As answered in this question, I changed the corresponding linphone service to a long running service, which can receive incoming calls when the app is not in the foreground. But that doesn't solve the problem.
mHandler = new Handler();
// This will be our main Core listener, it will change activities depending on events
mCoreListener = new CoreListenerStub() {
@Override
public void onCallStateChanged(Core core, Call call, Call.State state, String message) {
android.util.Log.i(TAG, "onCallStateChanged: ");
if (state == Call.State.IncomingReceived || state == Call.State.IncomingEarlyMedia) {
Log.i(TAG, "onCallReceived: ");
// For this sample we will automatically answer incoming calls
CallParams params = getCore().createCallParams(call);
params.enableVideo(false);
call.acceptWithParams(params);
.....
}
};
As per the code, the call will be answered automatically, But for incoming calls, onCallStateChanged()never gets called and the logical output is as follows :
... ...
2019-07-23 14:56:50.468 9248-9248/com.call.mysipapp I/liblinphone: Found payload AMR/8000 fmtp=mode-change-period=2
2019-07-23 14:56:50.469 9248-9248/com.call.mysipapp I/liblinphone: Found payload AMR/8000 fmtp=mode-change-period=1
--------- beginning of crash
2019-07-23 14:56:50.473 9248-9248/com.call.mysipapp A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x28 in tid 9248 (m.call.mysipapp)