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

Could not use this with different server #22

Closed
sojharo opened this issue Dec 18, 2014 · 5 comments
Closed

Could not use this with different server #22

sojharo opened this issue Dec 18, 2014 · 5 comments

Comments

@sojharo
Copy link

sojharo commented Dec 18, 2014

I was trying to use your project with a server of mine. For this, I had made some changes it two of your classes. (just of signalling purposes). Now, the createAnswer() function is not calling the sendMessage function to send messages to other party using my signalling server. I have given details about the problem on the following link:

http://stackoverflow.com/questions/27554912/webrtc-android-library-function-not-getting-called

Please, help in this regards.

This is not an issue. This is just a question. I was trying to give it a label of question but I could not find how to give it label of question.

@sojharo
Copy link
Author

sojharo commented Dec 18, 2014

Thanks for replying me on stackoverflow. Here is the detailed answer to your question.

  1. I run the web client on chrome, it waits for the android client to join.
  2. When Android Client is started, it does the following process.

2.1. When it connects to the socket.io server and gets the id from the server, it joins the room "sojharo" using:

    if(s.equals("id")) {

        JSONObject message = new JSONObject();

        message.put("room", "sojharo");
        message.put("username", "android");

        client.emit("create or join livehelp",
                new JSONArray().put(message));

    }

2.2. When successfully joined the room, android gets "joined" message from the socket.io server.

2.3. At this, I call the function startcam() directly in oncallready(), I did not use the dialogue to share the link as I don't require this in my case.

2.4. When camera is captured, I call the function start(). I modified this, it is sending the message "got user media" to server which the server sends to other party waiting at chrome.

2.5. Other party captures the camera on chrome and sends the similar message "got user media" using socket.io to client.

2.5. Android gets the message "got user media" and simply ignores it.

2.6. After this it gets the offer from the other party and this code is reached.

private class CreateAnswerCommand implements Command{
public void execute(String peerId, JSONObject payload) throws JSONException {
Log.d(TAG,"CreateAnswerCommand");
Peer peer = peers.get(peerId);
SessionDescription sdp = new SessionDescription(
SessionDescription.Type.fromCanonicalForm(payload.getString("type")),
payload.getString("sdp")
);
peer.pc.setRemoteDescription(peer, sdp);
peer.pc.createAnswer(peer, pcConstraints);
}
}

2.7. After this, I expect the sendMessage() to be called. But nothing happens and android simply receives candidates from the other party. It does not send the candidates to other party.

@pchab
Copy link
Owner

pchab commented Dec 22, 2014

Sorry for the wait.
peer.pc.createAnswer(...) should trigger the callback onCreateSuccess which does the call to sendMessage(). Can you confirm that it is triggered ?
If not, Could you log what the JSON payload look like (in createAnswerCommand )?

@sojharo
Copy link
Author

sojharo commented Dec 23, 2014

This is how the payload looks like:

{"type":"offer","sdp":"v=0\r\no=- 3994135483093964290 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS 1Vzl4XcY6MYqu3grPhFsrWFUc21qOGCO3FqD\r\nm=audio 1 RTP/SAVPF 111 103 104 0 8 106 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:YBq8LzjZBuEIY8kM\r\na=ice-pwd:dCzEBX9ft43bQavKhVG0XpSb\r\na=ice-options:google-ice\r\na=fingerprint:sha-256 EB:A5:DB:3C:E7:09:09:80:D0:91:D0:45:19:D0:CC:51:D4:A4:4C:B9:23:9D:FE:7D:B6:A5:09:1C:E7:C2:3B:41\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\na=ssrc:546054797 cname:He9sYnDAcvw6qHbT\r\na=ssrc:546054797 msid:1Vzl4XcY6MYqu3grPhFsrWFUc21qOGCO3FqD 777dc1e8-9d1f-4912-bdca-e1a3c599733d\r\na=ssrc:546054797 mslabel:1Vzl4XcY6MYqu3grPhFsrWFUc21qOGCO3FqD\r\na=ssrc:546054797 label:777dc1e8-9d1f-4912-bdca-e1a3c599733d\r\nm=video 1 RTP/SAVPF 100 116 117 96\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:YBq8LzjZBuEIY8kM\r\na=ice-pwd:dCzEBX9ft43bQavKhVG0XpSb\r\na=ice-options:google-ice\r\na=fingerprint:sha-256 EB:A5:DB:3C:E7:09:09:80:D0:91:D0:45:19:D0:CC:51:D4:A4:4C:B9:23:9D:FE:7D:B6:A5:09:1C:E7:C2:3B:41\r\na=setup:actpass\r\na=mid:video\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:100 VP8/90000\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=rtcp-fb:100 goog-remb\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=rtpmap:96 rtx/90000\r\na=fmtp:96 apt=100\r\na=ssrc-group:FID 899037719 3507766067\r\na=ssrc:899037719 cname:He9sYnDAcvw6qHbT\r\na=ssrc:899037719 msid:1Vzl4XcY6MYqu3grPhFsrWFUc21qOGCO3FqD bf9b249a-67aa-49f4-81e3-86e945f786f1\r\na=ssrc:899037719 mslabel:1Vzl4XcY6MYqu3grPhFsrWFUc21qOGCO3FqD\r\na=ssrc:899037719 label:bf9b249a-67aa-49f4-81e3-86e945f786f1\r\na=ssrc:3507766067 cname:He9sYnDAcvw6qHbT\r\na=ssrc:3507766067 msid:1Vzl4XcY6MYqu3grPhFsrWFUc21qOGCO3FqD bf9b249a-67aa-49f4-81e3-86e945f786f1\r\na=ssrc:3507766067 mslabel:1Vzl4XcY6MYqu3grPhFsrWFUc21qOGCO3FqD\r\na=ssrc:3507766067 label:bf9b249a-67aa-49f4-81e3-86e945f786f1\r\n","from":"MTmyvZH-KJKEst942CCw"}

onCreateSuccess is not triggered. I checked the other parameter 'peer' too, just to see if it was null. It was also referencing an object.

One more thing, are you using any android simulator? I wasn't able to use the simulator, it crashed. I am using real device.

@pchab
Copy link
Owner

pchab commented Dec 23, 2014

I'm using a real device too. You should look closely at what happen in each line of the CreateAnswerCommand function. See if the sdp is correctly created and set.

@sojharo
Copy link
Author

sojharo commented Dec 24, 2014

Yes, I am now trying to replace the libjingle library and just use the source code from webrtc on google code. I would then try to check what is happening inside createAnswer function of pc. I have also forked your code and made a commit to highlight the changes I have made to your original code. You can see the changes here:

sojharo@32e2a77

@pchab pchab closed this as completed Mar 27, 2015
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

2 participants