Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liblinphone call on terminate skips End or Error state and enters into Released state #199

Open
kpatil001 opened this issue Dec 2, 2021 · 0 comments

Comments

@kpatil001
Copy link

I am developing a c++ console program using c++ wrapper of liblinphone. I am able to perform a video call, however, when I terminate the ongoing call, my application crashes. From the logs I figured out the problem, which was liblinphone-fatal-Attempt to move CallSession [03501C44] to Released state while it was not previously in Error or End state, aborting

While hanging up the call, first the call is entering to Released state, I am getting above log then after a few millis call is entering into End state.

Any idea on what could be the possible reason for this.

Following is the code I used to perform video call and to terminate the call, I am following linphone-desktop repository and Csharp turtorials for this code::

void LinphoneManager::Call(string sipAddress) {
shared_ptr<Address> address = storedCore->interpretUrl(sipAddress);
shared_ptr<linphone::CallParams> params = storedCore->createCallParams(nullptr);
params->enableVideo(true);
params->setProxyConfig(storedCore->getDefaultProxyConfig());

currentCall = storedCore->inviteAddressWithParams(address, params); // Current call declared as class members ( shared_ptr<Call> currentCall ;)
currentCall->enableCamera(true);   

//After call is connected I am adding Dtmf listener to call
shared_ptr<DtmfListener> DTMF = make_shared<DtmfListener>(callBack);
currentCall->addListener(DTMF);
}

void LinphoneManager::callHangUp() {
    managerLogger->info("Inside call hangup");

    shared_ptr<linphone::Address> address = storedCore->interpretUrl(sipAddToCall);
    if (!address)
        managerLogger->warn("Cannot terminate Call. The address cannot be parsed : {}", sipAddToCall);
    else {
        std::shared_ptr<linphone::Call> call = storedCore->getCallByRemoteAddress2(address);
        if (call) {
            call->terminate();
        }
        else {
            managerLogger->warn("Cannot terminate call as it doesn't exist : {}",  sipAddToCall);
        }
    }
}

Following are the logs generated after call Hang up ::

[LinphoneManager] [info] Inside call hangup
2021-12-02 16:06:35:882 liblinphone-message-Terminate CallSession [03501C44] which is currently in state [LinphoneCallStreamsRunning]
2021-12-02 16:06:35:883 belle-sip-message-Dialog [00F40998]: now updated by transaction [0369C758].
2021-12-02 16:06:35:884 belle-sip-message-Transaction [0364B0C0] deleted
2021-12-02 16:06:35:884 belle-sip-message-Changing [client] [BYE] transaction [0369C758], from state [INIT] to [TRYING]
2021-12-02 16:06:35:886 belle-sip-message-channel [035AC588]: message sent to [TCP://edge.sip.onsip.com:5060], size: [825] bytes
BYE sip:username*[email protected];pn-key=bd73b246bef13e0d9d612e92e047c011;received=103.112.6.250;transport=tcp;gr SIP/2.0
Via: SIP/2.0/TCP 192.168.1.103:64022;branch=z9hG4bK.c21c65cUD;rport
From: <sip:username@domain>;tag=QQ66~WvEG
To: <sip:username@domain>;tag=KEA~NHy
CSeq: 21 BYE
Call-ID: UnzISR6utd
Max-Forwards: 70
Route: <sip:199.7.173.180;transport=tcp;r2=on;lr;ftag=QQ66~WvEG>
Route: <sip:199.7.173.180;r2=on;lr;ftag=QQ66~WvEG>
Route: <sip:199.7.173.100;lr;ftag=QQ66~WvEG;nc=1;did=d89.cead1604>
Route: <sip:199.7.173.100;lr;ftag=QQ66~WvEG;did=d89.dead1604>
Route: <sip:199.7.173.180;r2=on;lr;ftag=QQ66~WvEG>
Route: <sip:199.7.173.180;transport=tcp;r2=on;lr;ftag=QQ66~WvEG>
User-Agent: Tx3Voip_Linphone_Library/5.0.18-2-g480eff271
Content-Length: 0


2021-12-02 16:06:35:892 mediastreamer-message-ms_ticker_set_time_func: ticker's time method updated.
2021-12-02 16:06:35:896 mediastreamer-message-opus decoder stats: fec 38 packets - plc 140 packets.
2021-12-02 16:06:35:901 mediastreamer-message-Filter MSRtpRecv is not scheduled; nothing to do.
2021-12-02 16:06:35:901 ortp-message-===========================================================
2021-12-02 16:06:35:902 ortp-message-             AUDIO SESSION'S RTP STATISTICS
2021-12-02 16:06:35:903 ortp-message------------------------------------------------------------
2021-12-02 16:06:35:904 ortp-message-sent                                       2615 packets
2021-12-02 16:06:35:905 ortp-message-                                              0 duplicated packets
2021-12-02 16:06:35:906 ortp-message-                                         165478 bytes
2021-12-02 16:06:35:909 ortp-message-received                                   2426 packets
2021-12-02 16:06:35:909 ortp-message-                                              0 duplicated packets
2021-12-02 16:06:35:912 ortp-message-                                         110925 bytes
2021-12-02 16:06:35:913 ortp-message-incoming delivered to the app            110333 bytes
2021-12-02 16:06:35:913 ortp-message-incoming cumulative lost                     60 packets
2021-12-02 16:06:35:914 ortp-message-incoming received too late                    3 packets
2021-12-02 16:06:35:914 ortp-message-incoming bad formatted                        0 packets
2021-12-02 16:06:35:914 ortp-message-incoming discarded (queue overflow)           0 packets
2021-12-02 16:06:35:915 ortp-message-sent rtcp                                    31 packets
2021-12-02 16:06:35:915 ortp-message-received rtcp                                26 packets
2021-12-02 16:06:35:915 ortp-message-===========================================================
2021-12-02 16:06:35:916 mediastreamer-message-ms_filter_unlink: MSWASAPIRead:035DC2D0,0-->MSResample:035DBEB0,0
2021-12-02 16:06:35:916 mediastreamer-message-ms_filter_unlink: MSResample:035DBEB0,0-->MSEqualizer:035DC4B0,0
2021-12-02 16:06:35:917 mediastreamer-message-ms_filter_unlink: MSEqualizer:035DC4B0,0-->MSWebRTCAEC:035035B8,1
2021-12-02 16:06:35:917 mediastreamer-message-ms_filter_unlink: MSWebRTCAEC:035035B8,1-->MSVolume:035DC9F0,0
2021-12-02 16:06:35:917 mediastreamer-message-ms_filter_unlink: MSVolume:035DC9F0,0-->MSAudioMixer:035DBE50,0
2021-12-02 16:06:35:918 mediastreamer-message-ms_filter_unlink: MSAudioMixer:035DBE50,0-->MSOpusEnc:035DC750,0
2021-12-02 16:06:35:918 mediastreamer-message-ms_filter_unlink: MSOpusEnc:035DC750,0-->MSRtpSend:035034F8,0
2021-12-02 16:06:35:919 mediastreamer-message-ms_filter_unlink: MSRtpRecv:035DC210,0-->MSOpusDec:035DC330,0
2021-12-02 16:06:35:919 mediastreamer-message-ms_filter_unlink: MSOpusDec:035DC330,0-->MSAudioFlowControl:035DC930,0
2021-12-02 16:06:35:919 mediastreamer-message-ms_filter_unlink: MSAudioFlowControl:035DC930,0-->MSDtmfGen:035DC090,0
2021-12-02 16:06:35:920 mediastreamer-message-ms_filter_unlink: MSDtmfGen:035DC090,0-->MSVolume:035DC1B0,0
2021-12-02 16:06:35:920 mediastreamer-message-ms_filter_unlink: MSVolume:035DC1B0,0-->MSEqualizer:035DBFD0,0
2021-12-02 16:06:35:920 mediastreamer-message-ms_filter_unlink: MSEqualizer:035DBFD0,0-->MSAudioMixer:035DC450,0
2021-12-02 16:06:35:920 mediastreamer-message-ms_filter_unlink: MSFilePlayer:035DC510,0-->MSResample:035DC8D0,0
2021-12-02 16:06:35:921 mediastreamer-message-ms_filter_unlink: MSResample:035DC8D0,0-->MSAudioMixer:035DC450,1
2021-12-02 16:06:35:924 mediastreamer-message-ms_filter_unlink: MSAudioMixer:035DC450,0-->MSWebRTCAEC:035035B8,0
2021-12-02 16:06:35:925 mediastreamer-message-ms_filter_unlink: MSWebRTCAEC:035035B8,0-->MSResample:035DC0F0,0
2021-12-02 16:06:35:925 mediastreamer-message-ms_filter_unlink: MSResample:035DC0F0,0-->MSWASAPIWrite:035DC030,0
2021-12-02 16:06:35:926 mediastreamer-message-=================================================================================
2021-12-02 16:06:35:926 mediastreamer-message-                         FILTER USAGE STATISTICS                          
2021-12-02 16:06:35:926 mediastreamer-message-Name                          Count           Time/tick (ms)            CPU Usage
2021-12-02 16:06:35:926 mediastreamer-message-                                        min     mean    max     sd        
2021-12-02 16:06:35:927 mediastreamer-message----------------------------------------------------------------------------------
2021-12-02 16:06:35:927 mediastreamer-message-MSOpusEnc                     5206      0.00    1.91    12.00   2.14         60.2
2021-12-02 16:06:35:927 mediastreamer-message-MSPixConv                     529       0.00    0.49    3.00    0.64         15.5
2021-12-02 16:06:35:928 mediastreamer-message-MSWebRTCAEC                   5221      0.00    0.39    12.00   0.59         12.3
2021-12-02 16:06:35:928 mediastreamer-message-MSRtpSend                     10212     0.00    0.12    26.00   0.61          3.7
2021-12-02 16:06:35:928 mediastreamer-message-MSOpusDec                     5232      0.00    0.12    8.00    0.37          3.6
2021-12-02 16:06:35:929 mediastreamer-message-MSRtpRecv                     10744     0.00    0.05    15.00   0.48          1.5
2021-12-02 16:06:35:929 mediastreamer-message-MSWASAPIRead                  5232      0.00    0.02    12.00   0.31          0.7
2021-12-02 16:06:35:929 mediastreamer-message-MSResample                    10532     0.00    0.02    10.00   0.23          0.6
2021-12-02 16:06:35:930 mediastreamer-message-MSWASAPIWrite                 5355      0.00    0.02    5.00    0.15          0.5
2021-12-02 16:06:35:930 mediastreamer-message-MSVolume                      7796      0.00    0.02    1.00    0.12          0.5
2021-12-02 16:06:35:930 mediastreamer-message-MSVp8Enc                      4980      0.00    0.01    8.00    0.16          0.3
2021-12-02 16:06:35:931 mediastreamer-message-MSAudioFlowControl            2590      0.00    0.01    1.00    0.07          0.2
2021-12-02 16:06:35:931 mediastreamer-message-MSAudioMixer                  10464     0.00    0.01    1.00    0.07          0.2
2021-12-02 16:06:35:931 mediastreamer-message-MSJpegWriter                  529       0.00    0.00    1.00    0.06          0.1
2021-12-02 16:06:35:932 mediastreamer-message-MSDtmfGen                     5355      0.00    0.00    1.00    0.05          0.1
2021-12-02 16:06:35:932 mediastreamer-message-MSFilePlayer                  5355      0.00    0.00    1.00    0.05          0.1
2021-12-02 16:06:35:933 mediastreamer-message-MSDsCap                       4981      0.00    0.00    1.00    0.04          0.1
2021-12-02 16:06:35:933 mediastreamer-message-MSTee                         530       0.00    0.00    1.00    0.04          0.1
2021-12-02 16:06:35:934 mediastreamer-message-MSEqualizer                   7796      0.00    0.00    1.00    0.01          0.0
2021-12-02 16:06:35:934 mediastreamer-message-MSVoidSink                    51        0.00    0.00    0.00    0.00          0.0
2021-12-02 16:06:35:935 mediastreamer-message-=================================================================================
2021-12-02 16:06:35:943 mediastreamer-message-ms_ticker_synchronizer_destroy(): sound/wall clock skew was in average=0.978792 ms
2021-12-02 16:06:35:943 ortp-message-OrtpCongestionDetector: moving from state CongestionStateResolving to state CongestionStateNormal
2021-12-02 16:06:35:962 ortp-warning-rtp_session_avpf_enabled(): payload type not set, unreliable result returned.
2021-12-02 16:06:36:488 belle-sip-message-channel [035AC588]: received [838] new bytes from [TCP://edge.sip.onsip.com:5060]:
SIP/2.0 200 Ok
Via: SIP/2.0/TCP 192.168.1.103:64022;received=103.112.6.250;branch=z9hG4bK.c21c65cUD;rport=64022
From: <sip:username1@domain>;tag=QQ66~WvEG
To: <sip:username@domain>;tag=KEA~NHy
Call-ID: UnzISR6utd
CSeq: 21 BYE
User-Agent: MiEntry/2.1.1 Build 5068 (Redmi Note 7 Pro) LinphoneSDK/4.5.0-alpha.62+a749d75 ( master )
Supported: replaces, outbound, gruu
Record-route: <sip:199.7.173.180;transport=tcp;r2=on;lr;ftag=QQ66~WvEG>
Record-route: <sip:199.7.173.180;r2=on;lr;ftag=QQ66~WvEG>
Record-route: <sip:199.7.173.100;lr;ftag=QQ66~WvEG;did=d89.dead1604>
Record-route: <sip:199.7.173.100;lr;ftag=QQ66~WvEG;did=d89.cead1604;nc=1>
Record-route: <sip:199.7.173.180;r2=on;lr;ftag=QQ66~WvEG>
Record-route: <sip:199.7.173.180;transport=tcp;r2=on;lr;ftag=QQ66~WvEG>
Content-Length: 0


2021-12-02 16:06:36:501 belle-sip-message-channel [035AC588] [838] bytes parsed
2021-12-02 16:06:36:501 belle-sip-message-Found transaction matching response.
2021-12-02 16:06:36:502 belle-sip-message-Changing [client] [BYE] transaction [0369C758], from state [TRYING] to [COMPLETED]
2021-12-02 16:06:36:502 belle-sip-message-Dialog [00F40998]: now updated by transaction [0369C758].
2021-12-02 16:06:36:503 belle-sip-message-Dialog [00F40998] deleted (is_expired=0)
2021-12-02 16:06:36:503 liblinphone-message-op [03652E30] : setOrUpdateDialog() current=[00F40998] new=[00F40998]
2021-12-02 16:06:36:504 liblinphone-message-Op [03652E30] receiving call response [200], dialog is [00F40998] in state [BELLE_SIP_DIALOG_TERMINATED]
2021-12-02 16:06:36:504 belle-sip-message-Changing [client] [BYE] transaction [0369C758], from state [COMPLETED] to [TERMINATED]
2021-12-02 16:06:36:504 belle-sip-message-Client BYE transaction [0369C758] terminated
2021-12-02 16:06:36:525 liblinphone-message-Dialog [00F40998] terminated for op [03652E30]
2021-12-02 16:06:36:547 liblinphone-fatal-Attempt to move CallSession [03501C44] to Released state while it was not previously in Error or End state, aborting
2021-12-02 16:06:36:717 ortp-message-===========================================================
2021-12-02 16:06:36:718 ortp-message-             VIDEO SESSION'S RTP STATISTICS
2021-12-02 16:06:36:724 ortp-message------------------------------------------------------------
2021-12-02 16:06:36:727 ortp-message-sent                                      10915 packets
2021-12-02 16:06:36:729 ortp-message-                                              0 duplicated packets
2021-12-02 16:06:36:730 ortp-message-                                       12033575 bytes
2021-12-02 16:06:36:731 ortp-message-received                                    268 packets
2021-12-02 16:06:36:732 ortp-message-                                              0 duplicated packets
2021-12-02 16:06:36:733 ortp-message-                                          36903 bytes
2021-12-02 16:06:36:739 ortp-message-incoming delivered to the app             36903 bytes
2021-12-02 16:06:36:741 ortp-message-incoming cumulative lost                     10 packets
2021-12-02 16:06:36:742 ortp-message-incoming received too late                    0 packets
2021-12-02 16:06:36:743 ortp-message-incoming bad formatted                        0 packets
2021-12-02 16:06:36:743 ortp-message-incoming discarded (queue overflow)           0 packets
2021-12-02 16:06:36:744 ortp-message-sent rtcp                                    80 packets
2021-12-02 16:06:36:745 ortp-message-received rtcp                                95 packets
2021-12-02 16:06:36:745 ortp-message-===========================================================
2021-12-02 16:06:36:746 mediastreamer-message-ms_filter_unlink: MSDsCap:034FC358,0-->MSPixConv:037A39D0,0
2021-12-02 16:06:36:746 mediastreamer-message-ms_filter_unlink: MSPixConv:037A39D0,0-->MSTee:03501B18,0
2021-12-02 16:06:36:747 mediastreamer-message-ms_filter_unlink: MSTee:03501B18,0-->MSVp8Enc:034FC3B8,0
2021-12-02 16:06:36:747 mediastreamer-message-ms_filter_unlink: MSVp8Enc:034FC3B8,0-->MSRtpSend:03502F58,0
2021-12-02 16:06:36:749 mediastreamer-message-ms_filter_unlink: MSTee:03501B18,2-->MSJpegWriter:03503BB8,0
2021-12-02 16:06:36:753 mediastreamer-message-ms_filter_unlink: MSRtpRecv:037A2170,0-->MSVoidSink:037A2410,0
2021-12-02 16:06:36:754 mediastreamer-message-DSCapture::Release
2021-12-02 16:06:36:755 liblinphone-message-CallSession [03501C44] moving from state LinphoneCallStreamsRunning to LinphoneCallEnd
[2021-12-02 16:06:36.756] [core-listener] [info] Current Call State :: [14] Call terminated
[2021-12-02 16:06:36.757] [core-listener] [info] Call Ended
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant