Connect Time-out from JS library

Ask any questions or talk about OpenTok here!

Connect Time-out from JS library

Postby redation » Tue Jul 17, 2012 5:35 am

Hi,

while trying production access I have the following errors

Code: Select all
[ERROR] opentok: TB.exception :: title: Connect Time-out (1008) msg: Connection to the server timed out. TicketID:90395F2E5B9BF4B98CBDF635372B972


Here are my session id and token

Code: Select all
var sessionId = '2_MX4xNjY1NzMzMn45NS4yNTQuMTg2LjE1M35UdWUgSnVsIDE3IDA1OjI4OjUzIFBEVCAyMDEyfjAuOTkxNzkxMQ';   
var token = 'T1==cGFydG5lcl9pZD0mc2lnPTJlMDdmYTMyN2MzYTg0MzgwN2M4MGJjNDNjZDYwZTNlYTEzNWRkMWE6c2Vzc2lvbl9pZD0mY3JlYXRlX3RpbWU9MTM0MjUyODEzMyZyb2xlPXB1Ymxpc2hlciZub25jZT0xMzQyNTI4MTMzLjcxMzgxNDcwNDcyNzQz';


I'm using production credentials so
Code: Select all
<script src="http://static.opentok.com/v0.91/js/TB.min.js"></script>

and
Code: Select all
https://api.opentok.com/hl


Below you can find full log from JS console. I got no error from PHP server libraries

Code: Select all
[DEBUG] opentok: OpenTok JavaScript library v0.91.58 TB.min.js:36
[DEBUG] opentok: Release notes: http://www.tokbox.com/opentok/api/tools/js/documentation/overview/releaseNotes.html TB.min.js:36
[DEBUG] opentok: Known issues: http://www.tokbox.com/opentok/api/tools/js/documentation/overview/releaseNotes.html#knownIssues TB.min.js:36
[DEBUG] opentok: TB.setLogLevel(4) TB.min.js:36
[DEBUG] opentok: TB.initSession(2_MX4xNjY1NzMzMn45NS4yNTQuMTg2LjE1M35UdWUgSnVsIDE3IDA1OjI4OjUzIFBEVCAyMDEyfjAuOTkxNzkxMQ) TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(sessionConnected) TB.min.js:36
[DEBUG] opentok: TB.addEventListener(sessionConnected) TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(streamCreated) TB.min.js:36
[DEBUG] opentok: TB.addEventListener(streamCreated) TB.min.js:36
[DEBUG] opentok: Session.connect(16657332) TB.min.js:36
[DEBUG] opentok: TB.checkSystemRequirements() TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(envLoaded) TB.min.js:36
[DEBUG] opentok: TB.addEventListener(envLoaded) TB.min.js:36
[DEBUG] opentok: TB.setLogLevel(4) TB.min.js:36
[DEBUG] opentok: TB.initSession(2_MX4xNjY1NzMzMn45NS4yNTQuMTg2LjE1M35UdWUgSnVsIDE3IDA1OjI4OjUzIFBEVCAyMDEyfjAuOTkxNzkxMQ) TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(sessionConnected) TB.min.js:36
[DEBUG] opentok: TB.addEventListener(sessionConnected) TB.min.js:36
[WARN] opentok: Session.connect :: Patience, please. TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(dynamicConfigChanged) TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(dynamicConfigLoadFailed) TB.min.js:36
[ERROR] opentok: TB.exception :: title: Connect Time-out (1008) msg: Connection to the server timed out. TicketID:97D8837DB8A03246C522C95F646B664B TB.min.js:36
[DEBUG] opentok: TB.dispatchEvent()


This is my PHP code

Code: Select all
$apiObj = new OpenTokSDK($OPENTOK_apikey, $OPENTOK_apisecret, true);   
$session = $apiObj->create_session($_SERVER["REMOTE_ADDR"]);
$sessionId = $session->getSessionId();
$token = $apiObj->generate_token($sessionId);
Was this post helpful? (0)
redation
 
Posts: 3
Joined: Tue Jul 17, 2012 5:25 am
Thumbs Up: 0

Re: Connect Time-out from JS library

Postby jtsai » Tue Jul 17, 2012 12:27 pm

Hi there

Are you behind a firewall (or do you have port 1935 blocked). Can you check your computer here and see if it is all green?

John
Was this post helpful? (0)
Very helpful resource: Devs Checklist
Examples with OpenTok: Examples
User avatar
jtsai
 
Posts: 2019
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 159

Re: Connect Time-out from JS library

Postby redation » Thu Jul 19, 2012 12:55 am

Hi, yes I was firewalled.

I got a different error now

Code: Select all
[ERROR] opentok: TB.exception :: title: Authentication error (1004) msg: Invalid authentication information passed in Session.connect(). Invalid partnerId TB.min.js:36
[ERROR] opentok: TB._exceptionHandler called but could not find a partner ID. TB.min.js:36


This is the full log

Code: Select all
[DEBUG] opentok: OpenTok JavaScript library v0.91.59 TB.min.js:36
[DEBUG] opentok: Release notes: http://www.tokbox.com/opentok/api/tools/js/documentation/overview/releaseNotes.html TB.min.js:36
[DEBUG] opentok: Known issues: http://www.tokbox.com/opentok/api/tools/js/documentation/overview/releaseNotes.html#knownIssues TB.min.js:36
[DEBUG] opentok: TB.setLogLevel(4) TB.min.js:36
[DEBUG] opentok: TB.initSession(1_MX4xNjY1NzMzMn44Ny4xMS4zMy4xOTN-VGh1IEp1bCAxOSAwMDo1MTowMCBQRFQgMjAxMn4wLjk0NzQxOQ) TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(sessionConnected) TB.min.js:36
[DEBUG] opentok: TB.addEventListener(sessionConnected) TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(streamCreated) TB.min.js:36
[DEBUG] opentok: TB.addEventListener(streamCreated) TB.min.js:36
[DEBUG] opentok: Session.connect(16657332) TB.min.js:36
[DEBUG] opentok: TB.checkSystemRequirements() TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(envLoaded) TB.min.js:36
[DEBUG] opentok: TB.addEventListener(envLoaded) TB.min.js:36
[DEBUG] opentok: TB.setLogLevel(4) TB.min.js:36
[DEBUG] opentok: TB.initSession(1_MX4xNjY1NzMzMn44Ny4xMS4zMy4xOTN-VGh1IEp1bCAxOSAwMDo1MTowMCBQRFQgMjAxMn4wLjk0NzQxOQ) TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(sessionConnected) TB.min.js:36
[DEBUG] opentok: TB.addEventListener(sessionConnected) TB.min.js:36
[WARN] opentok: Session.connect :: Patience, please. TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(dynamicConfigChanged) TB.min.js:36
[DEBUG] opentok: TB.removeEventListener(dynamicConfigLoadFailed) TB.min.js:36
[ERROR] opentok: TB.exception :: title: Authentication error (1004) msg: Invalid authentication information passed in Session.connect(). Invalid partnerId TB.min.js:36
[ERROR] opentok: TB._exceptionHandler called but could not find a partner ID. TB.min.js:36
[DEBUG] opentok: TB.dispatchEvent()


These are the token/session i got

Code: Select all
var sessionId = '1_MX4xNjY1NzMzMn44Ny4xMS4zMy4xOTN-VGh1IEp1bCAxOSAwMDo1MTowMCBQRFQgMjAxMn4wLjk0NzQxOQ';   
var token = 'T1==cGFydG5lcl9pZD0mc2lnPWQxMTQzYjE1ZWZmZGU0ZDQ0MDMwYmMxNjViOGQ5MjEwZWViNzYyZjU6c2Vzc2lvbl9pZD0mY3JlYXRlX3RpbWU9MTM0MjY4NDI2MCZyb2xlPXB1Ymxpc2hlciZub25jZT0xMzQyNjg0MjYwLjI0MDQxODAzODI3MjEx'; 


Thanks for your help
Was this post helpful? (0)
redation
 
Posts: 3
Joined: Tue Jul 17, 2012 5:25 am
Thumbs Up: 0

Re: Connect Time-out from JS library

Postby redation » Thu Jul 19, 2012 1:43 am

Sorry, it was my script problem, I was passing an empty sessionid to the token generation method.

Thanks
Was this post helpful? (0)
redation
 
Posts: 3
Joined: Tue Jul 17, 2012 5:25 am
Thumbs Up: 0


Return to Discussion and Questions



Who is online

Users browsing this forum: safdarjaved and 1 guest

cron