{"action":"created","issue":{"url":"https://api.github.com/repos/otalk/jingle-filetransfer-session/issues/6","labels_url":"https://api.github.com/repos/otalk/jingle-filetransfer-session/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/otalk/jingle-filetransfer-session/issues/6/comments","events_url":"https://api.github.com/repos/otalk/jingle-filetransfer-session/issues/6/events","html_url":"https://github.com/otalk/jingle-filetransfer-session/issues/6","id":115286096,"number":6,"title":"Expects m line","user":{"login":"sualko","id":2974196,"avatar_url":"https://avatars.githubusercontent.com/u/2974196?v=3","gravatar_id":"","url":"https://api.github.com/users/sualko","html_url":"https://github.com/sualko","followers_url":"https://api.github.com/users/sualko/followers","following_url":"https://api.github.com/users/sualko/following{/other_user}","gists_url":"https://api.github.com/users/sualko/gists{/gist_id}","starred_url":"https://api.github.com/users/sualko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sualko/subscriptions","organizations_url":"https://api.github.com/users/sualko/orgs","repos_url":"https://api.github.com/users/sualko/repos","events_url":"https://api.github.com/users/sualko/events{/privacy}","received_events_url":"https://api.github.com/users/sualko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-11-05T13:44:05Z","updated_at":"2015-11-19T11:05:19Z","closed_at":null,"body":"Hey guys,\r\n\r\nI have trouble to get this working with my [strophe.jinglejs](https://github.com/sualko/strophe.jinglejs) library, receiving Chromium 45.0.2454.101 prints me:\r\n\r\n```\r\nUncaught (in promise) Failed to parse SessionDescription. m= 1 RTP/SAVPF \r\nExpects m line.\r\n```\r\n\r\nYour [example](http://legastero.github.io/jingle-interop-demos/stanzaio/) works, but I think it is outdated, so maybe something changed.\r\n\r\nI use this snippet to send a file via my lib:\r\n\r\n```\r\n  getFile: function() {\r\n      // the otalk logo\r\n      var otalkLogo = 'data:image/png;base64,.....';\r\n      var data = otalkLogo.match(/data:([^;]*);(base64)?,([0-9A-Za-z+/]+)/);\r\n      var raw = atob(data[3]);\r\n      var arr = new Uint8Array(raw.length);\r\n      for (var i = 0; i < raw.length; i++) {\r\n         arr[i] = raw.charCodeAt(i);\r\n      }\r\n      var file = new Blob([arr], {\r\n         type: data[1]\r\n      });\r\n      file.name = 'somename';\r\n      file.lastModifiedDate = new Date();\r\n      return file;\r\n   },\r\n   sendFile: function(jid, file) {\r\n      var self = jsxc.webrtc;\r\n\r\n      // manager is JSM\r\n      var sess = self.conn.jingle.manager.createFileTransferSession(jid);\r\n\r\n      sess.on('change:sessionState', function() {\r\n         jsxc.debug('Session state', sess.state);\r\n      });\r\n      sess.on('change:connectionState', function() {\r\n         jsxc.debug('Connection state', sess.connectionState);\r\n      });\r\n\r\n      sess.start(file);\r\n   }\r\n```\r\n\r\nThe incoming jingle on receiver side: \r\n\r\n```\r\n<body xmlns:stream=\"http://etherx.jabber.org/streams\" xmlns=\"http://jabber.org/protocol/httpbind\" sid=\"0595d003-70b4-40e8-9369-7dd4dca4fbd9\">\r\n  <iq xmlns=\"jabber:client\" type=\"set\" to=\"georg@localhost/c9c4730f-591d-4d83-8b6a-f392602631c9\" from=\"klaus@localhost/4f349287-864f-44f3-bea4-bda635f01e8e\" id=\"\">\r\n    <jingle xmlns=\"urn:xmpp:jingle:1\" sid=\"f440e73c-11ef-4bfe-8d90-d3a34ffe57f3\" action=\"session-initiate\">\r\n      <content creator=\"initiator\" name=\"data\">\r\n        <description xmlns=\"urn:xmpp:jingle:apps:file-transfer:3\">\r\n          <offer>\r\n            <file>\r\n              <date>2015-11-05T12:45:03.472Z</date>\r\n              <name>somename</name><size>1682</size>\r\n              <hash xmlns=\"urn:xmpp:hashes:1\" algo=\"sha-1\"/>\r\n            </file>\r\n          </offer>\r\n        </description>\r\n        <transport xmlns=\"urn:xmpp:jingle:transports:ice-udp:1\" ufrag=\"tg8d1Df56Gx7CcJj\" pwd=\"WFj9rg2TDCms9qICz+JFIUZ5\">\r\n          <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>\r\n          <sctpmap xmlns=\"urn:xmpp:jingle:transports:dtls-sctp:1\" number=\"5000\" streams=\"1024\" protocol=\"webrtc-datachannel\"/>\r\n        </transport>\r\n      </content>\r\n    </jingle>\r\n  </iq>\r\n</body>\r\n```\r\n\r\nI guess the <code>sctpmap</code> line is not correct used, but the JXT parser should work fine, because <code>stanza._extensions.jingle._extensions._jingleContent._iceUdp.sctp</code> looks good.\r\n\r\n@legastero @fippo Do you have any idea, where the JXT object to sdp translation happens? I tried to get it, but without success."},"comment":{"url":"https://api.github.com/repos/otalk/jingle-filetransfer-session/issues/comments/158024128","html_url":"https://github.com/otalk/jingle-filetransfer-session/issues/6#issuecomment-158024128","issue_url":"https://api.github.com/repos/otalk/jingle-filetransfer-session/issues/6","id":158024128,"user":{"login":"sualko","id":2974196,"avatar_url":"https://avatars.githubusercontent.com/u/2974196?v=3","gravatar_id":"","url":"https://api.github.com/users/sualko","html_url":"https://github.com/sualko","followers_url":"https://api.github.com/users/sualko/followers","following_url":"https://api.github.com/users/sualko/following{/other_user}","gists_url":"https://api.github.com/users/sualko/gists{/gist_id}","starred_url":"https://api.github.com/users/sualko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sualko/subscriptions","organizations_url":"https://api.github.com/users/sualko/orgs","repos_url":"https://api.github.com/users/sualko/repos","events_url":"https://api.github.com/users/sualko/events{/privacy}","received_events_url":"https://api.github.com/users/sualko/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T11:05:19Z","updated_at":"2015-11-19T11:05:19Z","body":"Yes:\r\n```\r\n{\r\n \"action\": \"session-initiate\",\r\n \"sid\": \"d4c96cc9-26e0-4ca9-8ed7-0fc17e9a0040\",\r\n \"contents\": [\r\n  {\r\n   \"creator\": \"initiator\",\r\n   \"disposition\": \"session\",\r\n   \"name\": \"data\",\r\n   \"senders\": \"both\",\r\n   \"description\": {\r\n    \"descType\": \"filetransfer\",\r\n    \"offer\": {\r\n     \"hash\": {\r\n      \"algo\": \"sha-1\"\r\n     },\r\n     \"name\": \"image001.png\",\r\n     \"size\": 7217,\r\n     \"date\": \"2015-11-03T10:11:23.000Z\",\r\n     \"hashes\": [\r\n      {\r\n       \"algo\": \"sha-1\"\r\n      }\r\n     ]\r\n    },\r\n    \"request\": {}\r\n   },\r\n   \"transport\": {\r\n    \"transType\": \"iceUdp\",\r\n    \"pwd\": \"F0JY3g+c9...\",\r\n    \"ufrag\": \"xt08cgdsmrEVpi5q\",\r\n    \"fingerprints\": [\r\n     {\r\n      \"hash\": \"sha-256\",\r\n      \"setup\": \"actpass\",\r\n      \"value\": \"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\"\r\n     }\r\n    ],\r\n    \"sctp\": [\r\n     {\r\n      \"number\": \"5000\",\r\n      \"protocol\": \"webrtc-datachannel\",\r\n      \"streams\": \"1024\"\r\n     }\r\n    ]\r\n   }\r\n  }\r\n ]\r\n}\r\n```\r\n\r\nI still have the feeling, that something is messed up (but this comes maybe from the fact, that it is very complicated with all this libs). E.g. in the jingle-filetransfer-session lib the descType seems to be inconsistent.\r\n\r\nhttps://github.com/otalk/jingle-filetransfer-session/blob/master/index.js#L51\r\nhttps://github.com/otalk/jingle-filetransfer-session/blob/master/index.js#L85\r\n\r\nAlso the jingle.js lib looks for filetransfer:\r\n\r\nhttps://github.com/otalk/jingle.js/blob/master/index.js#L26\r\n\r\nAlso the stanza definitions uses filetransfer as value:\r\n\r\nhttps://github.com/otalk/jxt-xmpp/blob/master/src/file.js#L50"}}