Recently I tried to use OpenTok's WebRTC demo for a web application requiring peer-to-peer video/audio communication.
I went through the tutorials on http://www.tokbox.com/opentok/webrtc/docs/js/tutorials/ and http://www.tokbox.com/opentok/docs/server/server_side_libraries.html and I got something working using JavaScript (client-side) and PHP's library (server-side) for token/session generation.
I managed to code a basic peer-to-peer chat room locally. However, as soon as I upload it to a web server it blows up returning the following error:
Fatal error: Uncaught exception 'RequestException' with message 'Request error: Failed
to connect to 70.42.47.98: Permission denied' in /home/www/dummy_url.com/php-
sdk/SDK/Opentok-PHP-SDK/OpenTokSDK.php:192 Stack trace: #0 /home/www/dummy_url.com/php-
sdk/SDK/Opentok-PHP-SDK/OpenTokSDK.php(107): OpenTokSDK->_do_request('/session/create',
Array) #1 /home/www/dummy_url.com/php-sdk/SDK/Opentok-PHP-SDK/OpenTokSDK.php(221):
OpenTokSDK->createSession('74.96.245.119', Array) #2 /home/www/dummy_url.com/php-
sdk/index.php(16): OpenTokSDK->create_session('74.96.245.119', Array) #3 {main} thrown
in /home/www/dummy_url.com/php-sdk/SDK/Opentok-PHP-SDK/OpenTokSDK.php on line 192
I took a look at line 192:
//die(function_exists('curl_version')); // debugging
$res = curl_exec($ch);
if(curl_errno($ch)) {
throw new RequestException('Request error: ' . curl_error($ch)); // <=== LINE 192
}
curl_close($ch);
and verified the server had curl enabled. It does.
Then I tried to run the demo test and it fails at:
Assertion Failed: File '/home/www/skillfullearning.net/test/test/TestOpenTokSDK.php'
Line '102'
Code ''
What's in Line '102'? This:
...
$token = $a->generateToken("mysession", RoleConstants::MODERATOR, gmmktime() + 100000);
assert('$token');
$token = $a->generateToken("mysession", RoleConstants::MODERATOR, gmmktime());
assert('$token');
try {
$token = $a->generateToken("mysession", RoleConstants::MODERATOR, gmmktime() +
1000000);
assert(false);
} catch (Exception $e) {
assert('$e'); // <================ LINE 102
}
...
I really don't know where to go from here. I would really appreciate some help with this matter.
/E