Cordova-plugin-iosrtc: setRemoteDescription() failed: Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer

Created on 16 Jan 2020  路  4Comments  路  Source: cordova-rtc/cordova-plugin-iosrtc

Expected behavior

setRemoteDescription() failed: Failed to set remote answer sdp: The order of m-lines in answer doesn't match order in offer

Observerd behavior

Steps to reproduce the problem

caller Register > caller Invite > callee answer > caller error 488 > caller hangup

Platform information

iOS

  • Cordova version:5.0.4
  • Plugin version:6.0.5
  • iOS version: 13
  • Xcode version:11.2.1

I try more time for sipjs, jssip, sipm5 and result same error
iosrtc-jssip-error.txt

Please help me !

Unified-Plan help wanted

All 4 comments

Hello @hatinfotech

This issue is most likely caused by Unified-Plan that is now the default behavior of iosRTC since 6.0.2.
To confirm this is the issue you can install iosRTC version 6.0.1 to test "Plan-B" by default.
To fix this issue with 6.0.5+ you can force the sdpSemantics of the PeerConnection to plan-b.

Example or RTCPeerConnection config options:

var pc = new RTCPeerConnection({
    offerToReceiveVideo: true,
    offerToReceiveAudio: true,
    //iceTransportPolicy: 'relay',
    //sdpSemantics: 'unified-plan',
    sdpSemantics: 'plan-b',
    bundlePolicy: 'max-compat',
    rtcpMuxPolicy: 'negotiate',
    iceServers: [
        {
            url: "stun:stun.stunprotocol.org"
        }
    ]
});

What make me think the issue is "Unified-Plan" is the following recent exchnage on the iosRTC Google Group: https://groups.google.com/forum/#!topic/cordova-plugin-iosrtc/afR1W9_EKfE

More Info about Unified-Plan transition:

@hatinfotech Let me know if using Plan-B fix your issue, but on the long run you will need to migrate to Unified-Plan on you SIP Server (FreeSWITCH 1.6+ does support Unfied-Plan to my knowlege).

Hi @hthetiot,

Thanks so must !
Your answer is really helpful.

I try downgrade plug to 6.0.1 and it worked
And iosrtc 6.0.5 worked with sipjs config

session = userAgent.invite("103", {
    sessionDescriptionHandlerOptions: {
      constraints: {
        audio: true,
        video: true
      }
    },
    rtcConfiguration: {
      sdpSemantics: "plan-b",
      bundlePolicy: "max-compat",
      rtcpMuxPolicy: "negotiate"
    }
  });

Thanks and best regards !

Was this page helpful?
0 / 5 - 0 ratings