3

I am Trying to get PhoneRTC demo up and running. https://github.com/alongubkin/phonertc/

I actually have a bunch of doubts

First of all, my understanding: 1. We need a TURN server 2. We need a signaling Server (demo/server in repo) 3. We need a cordova project which will use phoneRTC project (demo/client in repo)

  1. started AWS instance, assigned a dynamic DNS. installed TURN server and started it - but now I'm confused over private ip and public ip part mentioned in tutorial as my ip changes every time I restart the instance. I have one dns name (from noip) which will stick to it. So I'm exploring on how to set TURN server with that

  2. I checked out the source code and followed the npm install cordva etc steps,

  3. For Signaling server, I navigated to demo/server in the source code and tried node index.js after npm install, but got several errors regarding the module not found.

  4. demo/client is also a nodeJS project, right ? If i get it up and running, that is the video chat, right ?

Tejas
  • 6,508
  • 1
  • 21
  • 25

2 Answers2

4

Amazon provides Elastic IPs which allow you to make permanent IP addresses for your EC2 hosts.

Here are the full commands required to run the demo from scratch:

# install global dependencies
npm install -g cordova bower grunt-cli

# clone phonertc
git clone https://github.com/alongubkin/phonertc.git

# build client
cd demo/client
npm install
bower install

cordova plugin add org.apache.cordova.device
cordova plugin add org.apache.cordova.console
cordova plugin add https://github.com/alongubkin/phonertc.git

# follow the instructions for iOS after running this command
cordova platform add ios android  

# before running the next command, make sure to
# change your server details in demo/client/app/scripts/signaling.js 
# and in demo/client/app/scripts/CallCtrl.js 
grunt build --force

# build server
cd ../server
npm install

To run the server:

cd demo/server
node index.js

To run the client on Android:

cordova run android

To run the client on iOS run:

cordova build ios

And run the project from Xcode on a real iOS device.

Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
  • does running 2 devices on same ip could cause problems with the TURN? – itsme Oct 19 '14 at 08:45
  • 4
    When I run `cordova plugin add org.apache.cordova.device` from `demo/client`, I see a `Current working directory is not a Cordova-based project.`. Am I missing something here? Isn't the demo client already a `Cordova` project? – Neo Nov 03 '14 at 07:13
  • @Neo I run into the same error... How did you solve? We are running Cordova 4.0 CLI – Mark Veenstra Nov 06 '14 at 08:39
  • I actually faced the same issue, and as I was running out for time, I moved on to weemo/sightcall for the time being even though it is paid. But I'm quite interested in using phonertc for my needs. – Tejas Nov 06 '14 at 08:49
  • @Napster I got the demo running on Android. Trying IOS now. I answered your question with my steps – Mark Veenstra Nov 06 '14 at 10:03
  • 2
    @neo I solved that problem by running `grunt cordova` once before `cordova plugin add` – cwohlman Feb 05 '15 at 15:16
4

I got the demo up and running, doing the next steps (Android), with ionic CLI:

# install global dependencies
npm install -g cordova bower grunt-cli

# Get a GIT clone, needed for copying files
git clone https://github.com/alongubkin/phonertc.git

# start new ionic project
ionic create phonertc-ionic
cd phonertc

# Copy files from GIT clone to your ionic project
cp -R phonertc-gitclone\demo\client\* phonertc-ionic\

# install dependencies
npm install
bower install

# install plugins
cordova plugin add org.apache.cordova.device
cordova plugin add org.apache.cordova.console
cordova plugin add https://github.com/alongubkin/phonertc.git

# add android platform
cordova platform add android

# install/running signaling server
cd phonertc-gitclone/demo/server
npm install
node index.js

# setting up turn server (not sure if needed)
# I installed it on a VirtualBox Ubuntu server, also see:
# https://github.com/alongubkin/phonertc/wiki/Installation
# Next ports should be open to your Ubuntu TURN server:
# TCP 443
# TCP 3478-3479
# TCP 32355-65535
# UDP 3478-3479
# UDP 32355-65535
sudo apt-get install rfc5766-turn-server
# Edit /etc/turnserver.conf and change:
listening-ip=<internal IP VirtualBox Ubuntu>
relay-ip=<internal IP VirtualBox Ubuntu>
external-ip=<internal IP VirtualBox Ubuntu>
min-port=32355 
max-port=65535
realm=<your domain>
# Also uncomment
lt-cred-mech
fingerprint
# Edit /etc/turnuserdb.conf and at the end, add:
username:password
# Start TURN server
sudo /etc/init.d/rfc5766-turn-server start

# before running the next command, make sure to
# change your server details in demo/client/app/scripts/signaling.js 
# and in demo/client/app/scripts/CallCtrl.js 
cd phonertc-ionic/
grunt build --force

# Copy files from phonertc-ionic app dir to www dir
cp -R phonertc-ionic/app/* phonertc-ionic/www/

# Build and run to android
ionic run android

NOTE:

Fill phonertc-ionic and phonertc-gitclone dirs with yours. At this moment I can only test between 2 Android devices. Sound is crap at the moment, but video is great. Trying to build on IOS now.

Mark Veenstra
  • 4,691
  • 6
  • 35
  • 66
  • I get a splash screen showing the Cordova logo and then a blank screen showing nothing. – Dois May 27 '15 at 01:31
  • Ok so the problem was because I was running it on the browser. The demo app will only work phone to phone. – Dois May 27 '15 at 06:21