ApprtcDemo with local server works between browsers but not Android native to browser.

3,454 views
Skip to first unread message

Biraj Zalavadia

unread,
Jan 13, 2014, 8:15:01 AM1/13/14
to discuss...@googlegroups.com
What steps will reproduce the problem?

What is the expected result?
The app must work properly.

What do you see instead?
Able to run AppRtcDemo at local server and Its working fine between browsers but not works between Android Native ApprtcApp to browser

What version of the product are you using? On what operating system? Android-4.2.2 Android-4.1.2 Android-4.0.2 Please provide any additional information below.


I am developing a chat application and done with it. Now I want to implement video chat also. After research a lot I decided to go with "WebRTC" library.

What I have done?

1) Able to run AppRtcDemo at local server and Its working fine between browsers but not works between Android Native ApprtcApp to browser.

Reference : http://www.webrtc.org/reference/getting-started

2) I installed latest rfc5766TurnServer recommended by webrtc. I got success to run turn server.

Reference : http://code.google.com/p/rfc5766-turn-server/

I do following changes to ApprtcDemo (web)  to work with my Turn server

1) apprtc.py

 replace 

turn_url = 'https://computeengineondemand.appspot.com/' turn_url = turn_url + 'turn?' + 'username=' + user + '&key=4080218913'

with Point to my turn server turn_url = 'http://192.168.5.85:3478/?service=turn&username=biraj'

2) index.html

replace

var pcConfig = {{ pc_config|safe }};

with

var pcConfig = {"iceServers": [{"url": "stun:stun.l.google.com:19302"}, {"url":"turn:bi...@192.168.5.85:3479", "credential":"0x5b04123c3eec4cf0be64ab909bb2ff5b"}]};

I do following changes to ApprtcDemo (web)  to work with my Turn server

1)AppRTCDemoActivity.java

replace

roomInput.setText("https://apprtc.appspot.com/?r=");

with my local apprtc server.

roomInput.setText("http://192.168.5.86:8080/?r=");

2) AppRTCClient.java

In private PeerConnection.IceServer requestTurnServer(String url){} function

replace

connection.addRequestProperty("origin", "https://apprtc.appspot.com");

with

connection.addRequestProperty("origin", "http://192.168.5.86:8080");

3) /assets/channel.html

replace

<script src="https://apprtc.appspot.com/_ah/channel/jsapi"></script>

with

<script src="http://192.168.5.86:8080/_ah/channel/jsapi"></script>


Log Produced  between browsers.



Initializing; room=testroom. main.js:32
Opening channel. main.js:51
Requested access to local media with mediaConstraints:
 
'{"video":true,"audio":true}' main.js:129
Channel opened. main.js:257
User has granted access to local media. main.js:290

S
->C: {"type":"candidate","label":0,"id":"audio","candidate":"a=candidate:124254220 1 udp 2113937151 192.168.5.74 32831 typ host generation 0\r\n"} main.js:262
S
->C: {"type":"candidate","label":0,"id":"audio","candidate":"a=candidate:124254220 2 udp 2113937151 192.168.5.74 32831 typ host generation 0\r\n"} main.js:262
S
->C: {"type":"candidate","label":1,"id":"video","candidate":"a=candidate:124254220 1 udp 2113937151 192.168.5.74 32831 typ host generation 0\r\n"} main.js:262
S
->C: {"type":"candidate","label":1,"id":"video","candidate":"a=candidate:124254220 2 udp 2113937151 192.168.5.74 32831 typ host generation 0\r\n"} main.js:262
S
->C: {"type":"candidate","label":0,"id":"audio","candidate":"a=candidate:1239680252 1 tcp 1509957375 192.168.5.74 0 typ host generation 0\r\n"} main.js:262

S
->C: {"sdp":"v=0\r\no=- 206665166771500886 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS Mem0i9HsefdXKa9PUcYVzpTYJh5ubK6F8k84\r\nm=audio 1 RTP/SAVPF 111 103 0 8 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufragZvPr+IUOsfQIsJd\r\na=ice-pwdeEnKpyvUgVJ2MsPftWxvIlt\r\na=ice-options:google-ice\r\na=fingerprintha-256 BE:80:FB:07:32:53:A8:A6:52:95:18:81:7C:1E:32:F2:42:1F:37:5B:E8:2F:77:34:F0:43:32:2F:71:15:3ED\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1 urn:ietfarams:rtp-hdrextsrc-audio-level\r\na=sendrecv\r\na=rtcp-mux\r\na=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:0PGKgPLQ3GjY0LvqVwg5O3z00sPI0/HCjpNmGqhY\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\na=ssrc:3938331154 cname:iNx+PmHVSRLIVyWF\r\na=ssrc:3938331154 msid:Mem0i9HsefdXKa9PUcYVzpTYJh5ubK6F8k84 Mem0i9HsefdXKa9PUcYVzpTYJh5ubK6F8k84a0\r\na=ssrc:3938331154 mslabel:Mem0i9HsefdXKa9PUcYVzpTYJh5ubK6F8k84\r\na=ssrc:3938331154 label:Mem0i9HsefdXKa9PUcYVzpTYJh5ubK6F8k84a0\r\nm=video 1 RTP/SAVPF 100 116 117\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufragZvPr+IUOsfQIsJd\r\na=ice-pwdeEnKpyvUgVJ2MsPftWxvIlt\r\na=ice-options:google-ice\r\na=fingerprintha-256 BE:80:FB:07:32:53:A8:A6:52:95:18:81:7C:1E:32:F2:42:1F:37:5B:E8:2F:77:34:F0:43:32:2F:71:15:3ED\r\na=setup:actpass\r\na=mid:video\r\na=extmap:2 urn:ietfarams: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=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:0PGKgPLQ3GjY0LvqVwg5O3z00sPI0/HCjpNmGqhY\r\na=rtpmap:100 VP8/90000\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 goog-remb\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=ssrc:3697912854 cname:iNx+PmHVSRLIVyWF\r\na=ssrc:3697912854 msid:Mem0i9HsefdXKa9PUcYVzpTYJh5ubK6F8k84 Mem0i9HsefdXKa9PUcYVzpTYJh5ubK6F8k84v0\r\na=ssrc:3697912854 mslabel:Mem0i9HsefdXKa9PUcYVzpTYJh5ubK6F8k84\r\na=ssrc:3697912854 label:Mem0i9HsefdXKa9PUcYVzpTYJh5ubK6F8k84v0\r\n","type":"offer"} main.js:262

Creating PeerConnection. main.js:161
Created RTCPeerConnnection with:
 config
: '{"iceServers"{"url":"stuntun.l.google.com:19302"},{"url":"turn:bi...@192.168.5.85:3479","credential":"0x5b04123c3eec4cf0be64ab909bb2ff5b"}]}';
 constraints
: '{"optional"{"DtlsSrtpKeyAgreement":true}]}'. main.js:142
Adding local stream. main.js:163
No preference on audio send codec. main.js:545
Sending answer to peer. main.js:194
Remote stream added. main.js:341
Set session description success. main.js:311
Prefer audio receive codec: opus/48000 main.js:557
C
->S: {"sdp":"v=0\r\no=- 2011873284792728586 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS xsEc0bBit2mBH9pXHpnic1sFVJrEHy7UunVS\r\nm=audio 1 RTP/SAVPF 111 103 0 8 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:RRghcikyDatYg13b\r\na=ice-pwd:8DqYBccZRGnF5N67QEm6WLIy\r\na=fingerprintha-256 B5:23:4F:68:B4:60:23:F0:7A:70:390:A8:70:FB:8A:E6:EF9:41:A2:13:2E:2E:59A:40:CD:37:91:0F:08\r\na=setup:active\r\na=mid:audio\r\na=extmap:1 urn:ietfarams:rtp-hdrextsrc-audio-level\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:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\na=ssrc:558656959 cname:wMUFRWob/2cxYNvz\r\na=ssrc:558656959 msid:xsEc0bBit2mBH9pXHpnic1sFVJrEHy7UunVS xsEc0bBit2mBH9pXHpnic1sFVJrEHy7UunVSa0\r\na=ssrc:558656959 mslabel:xsEc0bBit2mBH9pXHpnic1sFVJrEHy7UunVS\r\na=ssrc:558656959 label:xsEc0bBit2mBH9pXHpnic1sFVJrEHy7UunVSa0\r\nm=video 1 RTP/SAVPF 100 116 117\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:RRghcikyDatYg13b\r\na=ice-pwd:8DqYBccZRGnF5N67QEm6WLIy\r\na=fingerprintha-256 B5:23:4F:68:B4:60:23:F0:7A:70:390:A8:70:FB:8A:E6:EF9:41:A2:13:2E:2E:59A:40:CD:37:91:0F:08\r\na=setup:active\r\na=mid:video\r\na=extmap:2 urn:ietfarams: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 goog-remb\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=ssrc:250028088 cname:wMUFRWob/2cxYNvz\r\na=ssrc:250028088 msid:xsEc0bBit2mBH9pXHpnic1sFVJrEHy7UunVS xsEc0bBit2mBH9pXHpnic1sFVJrEHy7UunVSv0\r\na=ssrc:250028088 mslabel:xsEc0bBit2mBH9pXHpnic1sFVJrEHy7UunVS\r\na=ssrc:250028088 label:xsEc0bBit2mBH9pXHpnic1sFVJrEHy7UunVSv0\r\n","type":"answer"} main.js:226

Set session description success. main.js:311
C
->S: {"type":"candidate","label":0,"id":"audio","candidate":"a=candidate:3362589025 1 udp 2113937151 192.168.5.69 45669 typ host generation 0\r\n"} main.js:226
C
->S: {"type":"candidate","label":1,"id":"video","candidate":"a=candidate:3362589025 1 udp 2113937151 192.168.5.69 45669 typ host generation 0\r\n"} main.js:226
C
->S: {"type":"candidate","label":0,"id":"audio","candidate":"a=candidate:2263807377 1 tcp 1509957375 192.168.5.69 0 typ host generation 0\r\n"} main.js:226
C
->S: {"type":"candidate","label":1,"id":"video","candidate":"a=candidate:2263807377 1 tcp 1509957375 192.168.5.69 0 typ host generation 0\r\n"} main.js:226
S
->C: {"type":"candidate","label":0,"id":"audio","candidate":"a=candidate:1239680252 2 tcp 1509957375 192.168.5.74 0 typ host generation 0\r\n"} main.js:262
S
->C: {"type":"candidate","label":1,"id":"video","candidate":"a=candidate:1239680252 2 tcp 1509957375 192.168.5.74 0 typ host generation 0\r\n"} main.js:262
End of candidates. main.js:336
S
->C: {"type":"candidate","label":1,"id":"video","candidate":"a=candidate:1239680252 1 tcp 1509957375 192.168.5.74 0 typ host generation 0\r\n"} main.js:262

Log Produced between Android Native app and browser.

Initializing; room=romio. main.js:32
Opening channel. main.js:51
Requested access to local media with mediaConstraints:
 
'{"video":true,"audio":true}' main.js:129
Channel opened. main.js:257
User has granted access to local media. main.js:290

S
->C: {"type":"offer","sdp":"v=0\r\no=- 5807229488589666472 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS ARDAMS\r\nm=audio 1 RTP\/SAVPF 103 111 9 102 0 8 106 105 13 127 126\r \nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:tB6VbGg0o9g64TSU\r\na=ice-pwd:2K7H2eXkstEA2KLyEI+NXyvV\r\na=ice-options:google-ice\r\na=fingerprintha-1 74:6DE:6E:8D:91:42:E0:A7:A17:69:F05:CD1:49:79:25:A8\r\na=setup:actpass\r\na=mid:audio\r\na=extmap:1 urn:ietfarams:rtp-hdrextsrc-audio-level\r\na=sendrecv\r\na=rtcp-mux\r\na=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:0FSEkDwI1m\/CEqsAFjAb5cKqHhIb1H0jNRNl\/fuw\r\na=rtpmap:111 opus\/48000\/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:103 ISAC\/16000\r\na=rtpmap:9 G722\/16000\r\na=rtpmap:102 ILBC\/8000\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:127 red\/8000\r\na=rtpmap:126 telephone-event\/8000\r\na=maxptime:60\r\na=ssrc:1908466135 cname:ge10wiRoHcESV5iJ\r\na=ssrc:1908466135 msid:ARDAMS ARDAMSa0\r\na=ssrc:1908466135 mslabel:ARDAMS\r\na=ssrc:1908466135 label:ARDAMSa0\r\nm=video 1 RTP\/SAVPF 100 116 117\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:tB6VbGg0o9g64TSU\r\na=ice-pwd:2K7H2eXkstEA2KLyEI+NXyvV\r\na=ice-options:google-ice\r\na=fingerprintha-1 74:6DE:6E:8D:91:42:E0:A7:A17:69:F05:CD1:49:79:25:A8\r\na=setup:actpass\r\na=mid:video\r\na=extmap:2 urn:ietfarams: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=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:0FSEkDwI1m\/CEqsAFjAb5cKqHhIb1H0jNRNl\/fuw\r\na=rtpmap:100 VP8\/90000\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 goog-remb\r\na=rtpmap:116 red\/90000\r\na=rtpmap:117 ulpfec\/90000\r\na=ssrc:4115278321 cname:ge10wiRoHcESV5iJ\r\na=ssrc:4115278321 msid:ARDAMS ARDAMSv0\r\na=ssrc:4115278321 mslabel:ARDAMS\r\na=ssrc:4115278321 label:ARDAMSv0\r\n"} main.js:262

Creating PeerConnection. main.js:161
Created RTCPeerConnnection with:
 config
: '{"iceServers"{"url":"stuntun.l.google.com:19302"},{"url":"turn:bi...@192.168.5.85:3479","credential":"0x5b04123c3eec4cf0be64ab909bb2ff5b"}]}';
 constraints
: '{"optional"{"DtlsSrtpKeyAgreement":true}]}'. main.js:142
Adding local stream. main.js:163
No preference on audio send codec. main.js:545
Sending answer to peer. main.js:194
Remote stream added. main.js:341
Set session description success. main.js:311
Prefer audio receive codec: opus/48000 main.js:557
C
->S: {"sdp":"v=0\r\no=- 8014258827249529117 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS 60c9wiCAirJ7BM3aohqS84qC5GnBsJs0vehq\r\nm=audio 1 RTP/SAVPF 111 103 0 8 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:LxQGjYWyvRKUf76s\r\na=ice-pwd:1AgqUaxfSPUof/lo+yxDzFFP\r\na=fingerprintha-256 B5:23:4F:68:B4:60:23:F0:7A:70:390:A8:70:FB:8A:E6:EF9:41:A2:13:2E:2E:59A:40:CD:37:91:0F:08\r\na=setup:active\r\na=mid:audio\r\na=extmap:1 urn:ietfarams:rtp-hdrextsrc-audio-level\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:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\na=ssrc:1763302589 cname:h6mgIOb+/A6A3i/W\r\na=ssrc:1763302589 msid:60c9wiCAirJ7BM3aohqS84qC5GnBsJs0vehq 60c9wiCAirJ7BM3aohqS84qC5GnBsJs0vehqa0\r\na=ssrc:1763302589 mslabel:60c9wiCAirJ7BM3aohqS84qC5GnBsJs0vehq\r\na=ssrc:1763302589 label:60c9wiCAirJ7BM3aohqS84qC5GnBsJs0vehqa0\r\nm=video 1 RTP/SAVPF 100 116 117\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:LxQGjYWyvRKUf76s\r\na=ice-pwd:1AgqUaxfSPUof/lo+yxDzFFP\r\na=fingerprintha-256 B5:23:4F:68:B4:60:23:F0:7A:70:390:A8:70:FB:8A:E6:EF9:41:A2:13:2E:2E:59A:40:CD:37:91:0F:08\r\na=setup:active\r\na=mid:video\r\na=extmap:2 urn:ietfarams: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 goog-remb\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=ssrc:1205138370 cname:h6mgIOb+/A6A3i/W\r\na=ssrc:1205138370 msid:60c9wiCAirJ7BM3aohqS84qC5GnBsJs0vehq 60c9wiCAirJ7BM3aohqS84qC5GnBsJs0vehqv0\r\na=ssrc:1205138370 mslabel:60c9wiCAirJ7BM3aohqS84qC5GnBsJs0vehq\r\na=ssrc:1205138370 label:60c9wiCAirJ7BM3aohqS84qC5GnBsJs0vehqv0\r\n","type":"answer"} main.js:226

Set session description success. main.js:311

C
->S: {"type":"candidate","label":0,"id":"audio","candidate":"a=candidate:3362589025 1 udp 2113937151 192.168.5.69 38440 typ host generation 0\r\n"} main.js:226
C
->S: {"type":"candidate","label":1,"id":"video","candidate":"a=candidate:3362589025 1 udp 2113937151 192.168.5.69 38440 typ host generation 0\r\n"} main.js:226
C
->S: {"type":"candidate","label":0,"id":"audio","candidate":"a=candidate:2263807377 1 tcp 1509957375 192.168.5.69 0 typ host generation 0\r\n"} main.js:226
C
->S: {"type":"candidate","label":1,"id":"video","candidate":"a=candidate:2263807377 1 tcp 1509957375 192.168.5.69 0 typ host generation 0\r\n"} main.js:226
S
->C: {"id":"audio","type":"candidate","candidate":"a=candidate:312900489 1 udp 2113937151 192.168.5.162 37735 typ host generation 0\r\n","label":0} main.js:262
S
->C: {"id":"audio","type":"candidate","candidate":"a=candidate:312900489 2 udp 2113937151 192.168.5.162 37735 typ host generation 0\r\n","label":0} main.js:262
S
->C: {"id":"video","type":"candidate","candidate":"a=candidate:312900489 1 udp 2113937151 192.168.5.162 37735 typ host generation 0\r\n","label":1} main.js:262
S
->C: {"id":"video","type":"candidate","candidate":"a=candidate:312900489 2 udp 2113937151 192.168.5.162 37735 typ host generation 0\r\n","label":1} main.js:262
S
->C: {"id":"audio","type":"candidate","candidate":"a=candidate:1545963385 1 tcp 1509957375 192.168.5.162 36296 typ host generation 0\r\n","label":0} main.js:262
S
->C: {"id":"audio","type":"candidate","candidate":"a=candidate:1545963385 2 tcp 1509957375 192.168.5.162 36296 typ host generation 0\r\n","label":0} main.js:262
S
->C: {"id":"video","type":"candidate","candidate":"a=candidate:1545963385 1 tcp 1509957375 192.168.5.162 36296 typ host generation 0\r\n","label":1} main.js:262
S
->C: {"id":"video","type":"candidate","candidate":"a=candidate:1545963385 2 tcp 1509957375 192.168.5.162 36296 typ host generation 0\r\n","label":1} main.js:262
S
->C: {"id":"audio","type":"candidate","candidate":"a=candidate:2481880381 1 udp 1845501695 122.179.175.158 37735 typ srflx raddr 192.168.5.162 rport 37735 generation 0\r\n","label":0} main.js:262
S
->C: {"id":"audio","type":"candidate","candidate":"a=candidate:2481880381 2 udp 1845501695 122.179.175.158 37735 typ srflx raddr 192.168.5.162 rport 37735 generation 0\r\n","label":0} main.js:262
S
->C: {"id":"video","type":"candidate","candidate":"a=candidate:2481880381 1 udp 1845501695 122.179.175.158 37735 typ srflx raddr 192.168.5.162 rport 37735 generation 0\r\n","label":1} main.js:262
S
->C: {"id":"video","type":"candidate","candidate":"a=candidate:2481880381 2 udp 1845501695 122.179.175.158 37735 typ srflx raddr 192.168.5.162 rport 37735 generation 0\r\n","label":1} main.js:262
End of candidates.


why this is working between browsers but not between android AppRtcDemo and browser.

When I run AppRtcDemo on android after doing above changes local camera preview is started at right-top corner and message prompt "waiting for ICEcandidates" then nothing happens.

I have spent almost a month,Now please someone give me a break through.

Thanks in Advance.

Ami Fischman

unread,
Jan 13, 2014, 1:50:29 PM1/13/14
to discuss...@googlegroups.com

I do following changes to ApprtcDemo (web)  to work with my Turn server

1) apprtc.py

 replace 

turn_url = 'https://computeengineondemand.appspot.com/' turn_url = turn_url + 'turn?' + 'username=' + user + '&key=4080218913'
with Point to my turn server turn_url = 'http://192.168.5.85:3478/?service=turn&username=biraj'
This variable is used by apprtc to request a TURN server (from computeengineondemand); you're using it to point at the TURN server itself, so I don't imagine that'll work.  But anyway this is irrelevant b/c you hard-code a turn: URL in pc_config, which should make both getParametersForRoomUrl (Android) and maybeRequestTurn (browser) skip trying to acquire a TURN server dynamically (and thus ignore this variable).

2) index.html

replace

var pcConfig = {{ pc_config|safe }};

with

var pcConfig = {"iceServers": [{"url": "stun:stun.l.google.com:19302"}, {"url":"turn:bi...@192.168.5.85:3479", "credential":"0x5b04123c3eec4cf0be64ab909bb2ff5b"}]};


The port specified for the turn: URL here is 3479, not 3478.  Why?

AFAICT none of your cases (browser/android) ever get a TURN-based ICE candidate ("typ relay" in the JS console), so if I were you my next step (after trying 3478 in the turn: URL above) would be to wireshark communications between the TURN server and everything else.
Assuming your 192.168.5. network is set up so that the browser & android can't see each other (it's a common setting on some routers, for example, that wired & wireless devices can't see each other), that would certainly explain your symptoms.

Cheers,
-a

Oleg Moskalenko

unread,
Jan 13, 2014, 2:25:23 PM1/13/14
to discuss...@googlegroups.com


On Monday, January 13, 2014 10:50:29 AM UTC-8, Ami Fischman wrote:
it's a common setting on some routers, for example, that wired & wireless devices can't see each other

exactly, that's what I observed.

Oleg
 

Biraj Zalavadia

unread,
Jan 16, 2014, 12:18:44 AM1/16/14
to discuss...@googlegroups.com
Wired and wireless network may not be the issue because android chrome browser to pc browser is also working. Only issue is from android native ApprtcApp to pc browser.

Biraj Zalavadia

unread,
Jan 16, 2014, 6:25:09 AM1/16/14
to discuss...@googlegroups.com
Hi guys I got success to work apprtc demo with local server and custom turn server. Now its working between android native app and browser. Now will start with iphone to work with this custom setup.

Biraj Zalavadia

unread,
Jan 22, 2014, 11:10:32 PM1/22/14
to discuss...@googlegroups.com
Thanks to All for supporting my question.After long rocky ride with ApprtcDemo I got success  and it works fine.I am posting the solution.

Find the "GAEChannelClient.java" java file.

and do change as below.

   
/*
     * libjingle
     * Copyright 2013, Google Inc.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *
     *  1. Redistributions of source code must retain the above copyright notice,
     *     this list of conditions and the following disclaimer.
     *  2. Redistributions in binary form must reproduce the above copyright notice,
     *     this list of conditions and the following disclaimer in the documentation
     *     and/or other materials provided with the distribution.
     *  3. The name of the author may not be used to endorse or promote products
     *     derived from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
     * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */

   
   
package org.appspot.apprtc;
   
   
import java.io.InputStream;
   
   
import android.annotation.SuppressLint;
   
import android.app.Activity;
   
import android.util.Log;
   
import android.webkit.ConsoleMessage;
   
import android.webkit.JavascriptInterface;
   
import android.webkit.WebChromeClient;
   
import android.webkit.WebView;
   
import android.webkit.WebViewClient;
   
   
/**
     * Java-land version of Google AppEngine's JavaScript Channel API:
     * https://developers.google.com/appengine/docs/python/channel/javascript
     *
     * Requires a hosted HTML page that opens the desired channel and dispatches JS
     * on{Open,Message,Close,Error}() events to a global object named
     * "androidMessageHandler".
     */

   
public class GAEChannelClient {
   
private static final String TAG = "GAEChannelClient";
   
private WebView webView;
   
private final ProxyingMessageHandler proxyingMessageHandler;
   
   
/**
    * Callback interface for messages delivered on the Google AppEngine
    * channel.
    *
    * Methods are guaranteed to be invoked on the UI thread of |activity|
    * passed to GAEChannelClient's constructor.
    */

   
public interface MessageHandler {
   
public void onOpen();
   
   
public void onMessage(String data);
   
   
public void onClose();
   
   
public void onError(int code, String description);
   
}
   
   
/** Asynchronously open an AppEngine channel. */
   
@SuppressLint("SetJavaScriptEnabled")
   
public GAEChannelClient(Activity activity, String token, MessageHandler handler) {
    webView
= new WebView(activity);
   
    webView
.getSettings().setJavaScriptEnabled(true);
    webView
.getSettings().setAllowFileAccessFromFileURLs(true); // Maybe you
   
// don't
   
// need this
   
// rule
    webView
.getSettings().setAllowUniversalAccessFromFileURLs(true);
   
    webView
.setWebChromeClient(new WebChromeClient() { // Purely for
   
// debugging.
   
public boolean onConsoleMessage(ConsoleMessage msg) {
   
Log.d(TAG, "console: " + msg.message() + " at " + msg.sourceId() + ":" + msg.lineNumber());
   
return false;
   
}
   
});
    webView
.setWebViewClient(new WebViewClient() { // Purely for debugging.
   
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
   
Log.e(TAG, "JS error: " + errorCode + " in " + failingUrl + ", desc: " + description);
   
}
   
   
@Override
   
public boolean shouldOverrideUrlLoading(WebView view, String url) {
   
System.out.println("HI");
   
return super.shouldOverrideUrlLoading(view, url);
   
}
   
});
   
    proxyingMessageHandler
= new ProxyingMessageHandler(activity, handler, token);
    webView
.addJavascriptInterface(proxyingMessageHandler, "androidMessageHandler");
   
// webView.loadUrl("file:///android_asset/channel.html");
   
try {
   
InputStream is = activity.getAssets().open("channel.html");
   
StringBuilder builder = new StringBuilder();
   
byte[] buffer = new byte[1024];
   
while (is.read(buffer) != -1) {
    builder
.append(new String(buffer));
   
}
   
is.close();
   
String str = builder.toString();
    webView
.loadDataWithBaseURL("http://192.168.5.86:8080", str, "text/html", "utf-8", null);
   
} catch (Exception e) {
    e
.printStackTrace();
   
}
   
   
}
   
   
/** Close the connection to the AppEngine channel. */
   
public void close() {
   
if (webView == null) {
   
return;
   
}
    proxyingMessageHandler
.disconnect();
    webView
.removeJavascriptInterface("androidMessageHandler");
    webView
.loadUrl("about:blank");
    webView
= null;
   
}
   
   
// Helper class for proxying callbacks from the Java<->JS interaction
   
// (private, background) thread to the Activity's UI thread.
   
private static class ProxyingMessageHandler {
   
private final Activity activity;
   
private final MessageHandler handler;
   
private final boolean[] disconnected = { false };
   
private final String token;
   
   
public ProxyingMessageHandler(Activity activity, MessageHandler handler, String token) {
   
this.activity = activity;
   
this.handler = handler;
   
this.token = token;
   
}
   
   
public void disconnect() {
    disconnected
[0] = true;
   
}
   
   
private boolean disconnected() {
   
return disconnected[0];
   
}
   
   
@JavascriptInterface
   
public String getToken() {
   
return token;
   
}
   
   
@JavascriptInterface
   
public void onOpen() {
   
   
System.out.println("GAEClient : Open" );
    activity
.runOnUiThread(new Runnable() {
   
public void run() {
   
if (!disconnected()) {
    handler
.onOpen();
   
}
   
}
   
});
   
}
   
   
@JavascriptInterface
   
public void onMessage(final String data) {
   
System.out.println("GAEClient : Message : " +data );
    activity
.runOnUiThread(new Runnable() {
   
public void run() {
   
if (!disconnected()) {
    handler
.onMessage(data);
   
}
   
}
   
});
   
}
   
   
@JavascriptInterface
   
public void onClose() {
   
System.out.println("GAEClient : Close" );
    activity
.runOnUiThread(new Runnable() {
   
public void run() {
   
if (!disconnected()) {
    handler
.onClose();
   
}
   
}
   
});
   
}
   
   
@JavascriptInterface
   
public void onError(final int code, final String description) {
   
System.out.println("GAEClient : Erroe : " + description);
    activity
.runOnUiThread(new Runnable() {
   
public void run() {
   
if (!disconnected()) {
    handler
.onError(code, description);
   
}
   
}
   
});
   
}
   
}
   
}

Ami Fischman

unread,
Jan 23, 2014, 4:21:08 PM1/23/14
to discuss...@googlegroups.com
In case others are curious, the changes here (excluding debugging statements and whitespace changes) amount to:
1) add to GAEChannelClient's ctor:
webView.getSettings().setAllowFileAccessFromFileURLs(true);
webView.getSettings().setAllowUniversalAccessFromFileURLs(true);
Might be necessary b/c of the change to channel.html, but shouldn't be, according to the docs: setAllowFileAccessFromFileURLs and setAllowUniversalAccessFromFileURLs.

2) Replace
webView.loadUrl("file:///android_asset/channel.html");
with
    try {
      InputStream is = activity.getAssets().open("channel.html");
      StringBuilder builder = new StringBuilder();
      byte[] buffer = new byte[1024];
      while (is.read(buffer) != -1) {
        builder.append(new String(buffer));
      }
      is.close();
      String str = builder.toString();
      webView.loadDataWithBaseURL("http://192.168.5.86:8080", str, "text/html", "utf-8", null);
    } catch (Exception e) {
      e.printStackTrace();
    }
Again, shouldn't be necessary AFAICT.

Cheers,
-a

--
 
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Shashank Kedlaya

unread,
Jan 24, 2014, 12:00:45 AM1/24/14
to discuss...@googlegroups.com
Hi,
I'm new to this Apprtc demo for android. 
I followed the changes as suggested by all, but when i build the apk and run it, i get an error saying "Missing channelToken in Html:" 
Can anyone guide me on this ?

Thanks in advance 
Shashank kedlaya 

Guy

unread,
Feb 11, 2014, 8:47:51 AM2/11/14
to discuss...@googlegroups.com
Hi, 
Thank you very much for posting your solution. It was very helpful.
if you don't mind me asking, have you made any progress with making the call with iphone?
If so do you have any advice???

Thanks again

בתאריך יום חמישי, 16 בינואר 2014 13:25:09 UTC+2, מאת Biraj Zalavadia:
Message has been deleted

Jenco Danger

unread,
Apr 22, 2014, 6:28:21 PM4/22/14
to discuss...@googlegroups.com
I made the suggested changes to point to my local turn server but there's a problem in the app when trying to get "channelToken" in AppRTCClient.java -> getParametersForRoomUrl(String url) -> String token = getVarValue(roomHtml, "channelToken", true);.  "Fatal error: Missing channelToken in HTML". The turn server is only returning the title "Turn Server" and the app is looking for the key "channelToken" and it's not part of the response. The browser also prints "Turn Server" when I type my turn server ip and the port in it. Could this be a configuration issue with my turn server? I have static long term credentials set up for my turn server. Thanks in advance for any help.

04-22 18:04:19.828: W/dalvikvm(3335): threadid=14: thread exiting with uncaught exception (group=0x417e2898)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): Fatal error: Missing channelToken in HTML: <!DOCTYPE html>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): <html>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   <head>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):     <title>TURN Server</title>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   </head>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   <body>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):     TURN Server
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   </body>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): </html>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): java.lang.RuntimeException: An error occured while executing doInBackground()
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at android.os.AsyncTask$3.done(AsyncTask.java:299)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at java.lang.Thread.run(Thread.java:841)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): Caused by: java.lang.RuntimeException: java.io.IOException: Missing channelToken in HTML: <!DOCTYPE html>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): <html>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   <head>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):     <title>TURN Server</title>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   </head>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   <body>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):     TURN Server
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   </body>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): </html>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at org.appspot.apprtc.AppRTCClient$RoomParameterGetter.doInBackground(AppRTCClient.java:219)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at org.appspot.apprtc.AppRTCClient$RoomParameterGetter.doInBackground(AppRTCClient.java:1)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at android.os.AsyncTask$2.call(AsyncTask.java:287)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): ... 4 more
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): Caused by: java.io.IOException: Missing channelToken in HTML: <!DOCTYPE html>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): <html>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   <head>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):     <title>TURN Server</title>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   </head>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   <body>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):     TURN Server
04-22 18:04:19.828: E/AppRTCDemoActivity(3335):   </body>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): </html>
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at org.appspot.apprtc.AppRTCClient$RoomParameterGetter.getVarValue(AppRTCClient.java:381)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at org.appspot.apprtc.AppRTCClient$RoomParameterGetter.getParametersForRoomUrl(AppRTCClient.java:254)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): at org.appspot.apprtc.AppRTCClient$RoomParameterGetter.doInBackground(AppRTCClient.java:217)
04-22 18:04:19.828: E/AppRTCDemoActivity(3335): ... 7 more
04-22 18:04:29.497: D/dalvikvm(3335): Debugger has detached; object registry had 1 entries

   
System.out.println("GAEClient : Close" <span sty
...

Ami Fischman

unread,
Apr 23, 2014, 1:48:35 PM4/23/14
to discuss...@googlegroups.com
You appear to be trying to load an apprtc room from the TURN server, which is not going to work.
The apprtc room HTML needs to come from an appengine server.


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jed

unread,
Apr 24, 2014, 3:06:54 PM4/24/14
to discuss...@googlegroups.com
The appEngine is that for the signaling? I reverted my changes for the AppRTCDemoActivity android app and I see where the turn server is been set. I change it to point to my local turn server. Here are the outputs I see in the turn server logs. I want to force the apps to use my turn server for testing. There's always an empty user that tries to connect when the apps are connecting and it shows 401. Then after that it shows success. It doesn't seem though the traffic is going through my turn server. Changes I've made :

    private PeerConnection.IceServer requestTurnServer(String url) {
      try {
        URLConnection connection = (new URL(url)).openConnection();
        connection.addRequestProperty("user-agent", "Mozilla/5.0");
        connection.addRequestProperty("origin", "https://apprtc.appspot.com");
        String response = drainStream(connection.getInputStream());
        JSONObject responseJSON = new JSONObject(response);

        //change from 
        //String uri = responseJSON.getJSONArray("uris").getString(0);
        //String username = responseJSON.getString("username");
        //String password = responseJSON.getString("password");
      
         //to
        String username = "turnrtc";
        String password = "mypassword";
        String uri = "turn:10.40.10.106:3478?transport=udp";
        //
        return new PeerConnection.IceServer(uri, username, password);
      } catch (JSONException e) {
        throw new RuntimeException(e);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
  }

I've also tried  sending candidate with "relay" type :

private class PCObserver implements PeerConnection.Observer {
    @Override public void onIceCandidate(final IceCandidate candidate){
    //jenco
runOnUiThread(new Runnable() {
         public void run() {
           JSONObject json = new JSONObject();
           jsonPut(json, "type", "candidate");
           jsonPut(json, "label", candidate.sdpMLineIndex);
           jsonPut(json, "id", candidate.sdpMid);
           jsonPut(json, "candidate", candidate.sdp);

           if(!candidate.sdp.contains("relay"))
           {
            return;
           }
           sendMessage(json);
         }
       });

    }


96: session 130000000000000001: user <>: incoming packet message processed, error 401: Unauthorised
96: IPv4. Server relay addr: 10.40.10.106:3478
96: IPv4. Local relay addr: 10.40.10.106:53887
96: session 130000000000000001: new, username=<turnrtc>, lifetime=600
96: session 130000000000000001: user <turnrtc>: incoming packet ALLOCATE processed, success
462: handle_udp_packet: New UDP endpoint: local addr 10.40.10.106:3478, remote addr 172.16.41.55:58392
462: session 130000000000000002: user <>: incoming packet message processed, error 401: Unauthorised
462: IPv4. Server relay addr: 10.40.10.106:3478
462: IPv4. Local relay addr: 10.40.10.106:53374
462: session 130000000000000002: new, username=<turnrtc>, lifetime=600
462: session 130000000000000002: user <turnrtc>: incoming packet ALLOCATE processed, success
496: handle_udp_packet: New UDP endpoint: local addr 10.40.10.106:3478, remote addr 172.16.41.212:35822
496: session 130000000000000003: user <>: incoming packet message processed, error 401: Unauthorised
496: IPv4. Server relay addr: 10.40.10.106:3478
496: IPv4. Local relay addr: 10.40.10.106:62130
496: session 130000000000000003: new, username=<turnrtc>, lifetime=600
496: session 130000000000000003: user <turnrtc>: incoming packet ALLOCATE processed, success
496: session 130000000000000003: user <turnrtc>: incoming packet CREATE_PERMISSION processed, success
496: session 130000000000000003: user <turnrtc>: incoming packet CREATE_PERMISSION processed, success
496: session 130000000000000003: user <turnrtc>: incoming packet CREATE_PERMISSION processed, success
610: handle_udp_packet: New UDP endpoint: local addr 10.40.10.106:3478, remote addr 172.16.41.55:55227
610: session 130000000000000004: user <>: incoming packet message processed, error 401: Unauthorised
610: IPv4. Server relay addr: 10.40.10.106:3478
610: IPv4. Local relay addr: 10.40.10.106:58072
610: session 130000000000000004: new, username=<turnrtc>, lifetime=600
610: session 130000000000000004: user <turnrtc>: incoming packet ALLOCATE processed, success



   
   
System.<span style="co
...

Ami Fischman

unread,
Apr 24, 2014, 3:34:35 PM4/24/14
to discuss...@googlegroups.com
On Thu, Apr 24, 2014 at 12:06 PM, Jed <jdn...@gmail.com> wrote:
The appEngine is that for the signaling?

Yes.
 
I reverted my changes for the AppRTCDemoActivity android app and I see where the turn server is been set. I change it to point to my local turn server. Here are the outputs I see in the turn server logs. I want to force the apps to use my turn server for testing. There's always an empty user that tries to connect when the apps are connecting and it shows 401.

Sounds like your problem is your TURN-server configuration.  If it has a mailing list you might want to try there.

Cheers,
-a

Jed

unread,
Apr 28, 2014, 9:03:08 PM4/28/14
to discuss...@googlegroups.com
I posted this question so far no respond after 3 days. Do you know if database like mysql is required for authentication. I'm only setting the user in turnserver.conf file and turnuserdb.conf file. The link below has the turnserver.conf file and turnuserdb.conf files, if you can please take a look and point me to the right direction. Thanks


Ami Fischman

unread,
Apr 28, 2014, 10:20:10 PM4/28/14
to discuss...@googlegroups.com

No, I don't know how to configure your turn server.  I recommend you try on a support list or forum for that server.

--

Alexandre GOUAILLARD

unread,
Apr 28, 2014, 10:37:37 PM4/28/14
to discuss...@googlegroups.com
Alright, I think there is a confusion here. The channel token as nothing to do with TURN.

The channel token is supposed to be generated by the web/signalling server. In appRTC implementation, there is only one server to do all. Upon connection of a client (request for the page), the server create a channel, and set the token in the returned html page. Below is an example generated from appRTC:

  var errorMessages = [];
  var channelToken = 'AHRlWrrOgavKSef0agIeC1JFz6xBe6XOVRtXzfnAI204_KjI1j5tdCnFPv3vrCY-3q9rZKrE95gYWCeY5eM8NubPXJVbSJmsJCUTtGL3jEIwCC0f2r1_TNY';
  var me = '08824306';
  var roomKey = '12318860';
  var initiator = 0;
  var pcConfig = {"iceServers": [{"urls": "stun:stun.l.google.com:19302"}]};
  var pcConstraints = {"optional": []};
  var offerConstraints = {"optional": [], "mandatory": {}};
  var mediaConstraints = {"audio": true, "video": true};
  var stereo = false;
  var audio_send_codec = '';
  var audio_receive_codec = 'opus/48000';
  setTimeout(initialize, 1);

Now, the appRTCDemo code is loading the HTML page, and parsing those variable out (ouch, I know). In this specific case, the channelToken is used later for the creation of a GAE channel object and connection to the signaling server.

In your case it looks like you are parsing a page returned by your turn server (?), which does not contain this variable.

If you want your own GAE server instead of using apprtc.appspot.com, you will have to make some changes on the server side as well. The obvious ones are:
- roomLink
- turnURL

Note that you can handle turn URI on the server side, or on the client side using AJAX (like it is done in appRTC web). For mobile, doing it on server side might make your life easier.

alex.





--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alex. Gouaillard, PhD, PhD, MBA
------------------------------------------------------------------------------------
CTO - Temasys Communications, S'pore / Mountain View
President - CoSMo Software, Cambridge, MA
------------------------------------------------------------------------------------

Ranjit Kumar

unread,
Nov 10, 2015, 8:27:58 AM11/10/15
to discuss-webrtc
Hi Biraj Zalavadia
We are also working on chat application. we want to implement video call.can you please provide proper url to download AppRTC code .
I have seen the steps what you have followed and success to change the google server to your own server in video call.
Can you please provide the AppRTC code URL link which you have worked and got success.Please do the Needful.


Thanking you Advance
Ranjit




...

Pranjulya Bajpai

unread,
Mar 9, 2017, 5:27:26 AM3/9/17
to discuss-webrtc
HI biraj can you please let me know how you could achieve video chat functionality between mobile to browser.


On Monday, January 13, 2014 at 6:45:01 PM UTC+5:30, Biraj Zalavadia wrote:
Reply all
Reply to author
Forward
0 new messages