Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.
This repository was archived by the owner on May 6, 2024. It is now read-only.

Issue with strophe.jingle.adapter.js createDataChannel() #40

@wififorhumanity

Description

@wififorhumanity

Any thoughts on why adding 'createDataChannel' causes the following connection issue with supposedly malformed SDP? Removing that line makes it work perfectly again. The dataChannel is successfully created, and it appears that it is only sent on the offer SDP, not on answer. Reading everything related online to dataChannels doesn't point to the solution, has this been successfully implemented? peerconnection.ondatachannel is never called, which may be why the answerer never sends it back?

In Chrome/Canary console:

setRemoteDescription error Failed to set remote answer sdp: Offer and answer descriptions m-lines are not matching. Rejecting answer.

Affected code:

function TraceablePeerConnection(ice_config, constraints) {
    var self = this;
    var RTCPeerconnection = navigator.mozGetUserMedia ? mozRTCPeerConnection : webkitRTCPeerConnection;
    this.peerconnection = new RTCPeerconnection(ice_config, constraints);

    try {
        // Data Channel api supported from Chrome M25. 
        // You might need to start chrome with  --enable-data-channels flag.
        var dataConstraint = {reliable:false};//null;
        sendChannel = this.peerconnection.createDataChannel("sendDataChannel", dataConstraint);
         this.peerconnection.ondatachannel = receiveChannelCallback;

        self.trace('Created send data channel');
    } catch (e) {
        alert('Failed to create data channel. ' +
          'You need Chrome M25 or later with --enable-data-channels flag');
       self.trace('Create Data channel failed with exception: ' + e.message);  
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions