Search code examples
node.jscordovaphonertc

PhoneRTC demo application


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 ?


Solution

  • 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.