-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hey guys,
I have trouble to get this working with my strophe.jinglejs library, receiving Chromium 45.0.2454.101 prints me:
Uncaught (in promise) Failed to parse SessionDescription. m= 1 RTP/SAVPF
Expects m line.
Your example works, but I think it is outdated, so maybe something changed.
I use this snippet to send a file via my lib:
getFile: function() {
// the otalk logo
var otalkLogo = 'data:image/png;base64,.....';
var data = otalkLogo.match(/data:([^;]*);(base64)?,([0-9A-Za-z+/]+)/);
var raw = atob(data[3]);
var arr = new Uint8Array(raw.length);
for (var i = 0; i < raw.length; i++) {
arr[i] = raw.charCodeAt(i);
}
var file = new Blob([arr], {
type: data[1]
});
file.name = 'somename';
file.lastModifiedDate = new Date();
return file;
},
sendFile: function(jid, file) {
var self = jsxc.webrtc;
// manager is JSM
var sess = self.conn.jingle.manager.createFileTransferSession(jid);
sess.on('change:sessionState', function() {
jsxc.debug('Session state', sess.state);
});
sess.on('change:connectionState', function() {
jsxc.debug('Connection state', sess.connectionState);
});
sess.start(file);
}
The incoming jingle on receiver side:
<body xmlns:stream="http://etherx.jabber.org/streams" xmlns="http://jabber.org/protocol/httpbind" sid="0595d003-70b4-40e8-9369-7dd4dca4fbd9">
<iq xmlns="jabber:client" type="set" to="georg@localhost/c9c4730f-591d-4d83-8b6a-f392602631c9" from="klaus@localhost/4f349287-864f-44f3-bea4-bda635f01e8e" id="">
<jingle xmlns="urn:xmpp:jingle:1" sid="f440e73c-11ef-4bfe-8d90-d3a34ffe57f3" action="session-initiate">
<content creator="initiator" name="data">
<description xmlns="urn:xmpp:jingle:apps:file-transfer:3">
<offer>
<file>
<date>2015-11-05T12:45:03.472Z</date>
<name>somename</name><size>1682</size>
<hash xmlns="urn:xmpp:hashes:1" algo="sha-1"/>
</file>
</offer>
</description>
<transport xmlns="urn:xmpp:jingle:transports:ice-udp:1" ufrag="tg8d1Df56Gx7CcJj" pwd="WFj9rg2TDCms9qICz+JFIUZ5">
<fingerprint xmlns="urn:xmpp:jingle:apps:dtls:0" hash="sha-256" setup="actpass">E4:26:89:C3:AF:36:29:DA:3D:F6:4D:D9:C8:F7:13:16:7D:5B:D9:98:E3:F7:B7:E8:17:47:D9:D2:62:72:33:A7</fingerprint>
<sctpmap xmlns="urn:xmpp:jingle:transports:dtls-sctp:1" number="5000" streams="1024" protocol="webrtc-datachannel"/>
</transport>
</content>
</jingle>
</iq>
</body>
I guess the sctpmap
line is not correct used, but the JXT parser should work fine, because stanza._extensions.jingle._extensions._jingleContent._iceUdp.sctp
looks good.
@legastero @fippo Do you have any idea, where the JXT object to sdp translation happens? I tried to get it, but without success.
Metadata
Metadata
Assignees
Labels
No labels