-
Notifications
You must be signed in to change notification settings - Fork 305
Installation
Wiki ▸ Installation
In order to use PhoneRTC in your app, you will need to set up 3 things:
- PhoneRTC Cordova plugin
- TURN server
- Signaling server
Install Cordova:
npm install -g cordova ios-deploy
Create a new Cordova project:
cordova create <name>
cordova platform add ios android
cordova platform add browser --usegit
Add the plugin:
cordova plugin add https://github.com/alongubkin/phonertc.git
For iOS, follow these steps:
- Go
platforms/ios
and click on [ProjectName].xcodeproj to open it with XCode - Go to your project settings
- In General, change Deployment Target to 7.0 or above
- Go to Build Settings and change:
Valid Architectures => armv7
Build Active Architecture Only => No
Objective-C Bridging Header => [ProjectName]/Plugins/com.dooble.phonertc/Bridging-Header.h
Repeat step 4 for the CordovaLib project
When starting a call, PhoneRTC tries to establish a peer-to-peer connection between 2 users. It uses the signaling server to exchange network-related information between the 2 users.
The signaling server is simply a way to exchange messages between 2 users. It's something that you need to provide that works with the user system of your app. You don't care about the content of the messages, you just need to provide a way to exchange messages.
We recommend using socket.io or SignalR for this purpose.
A SocketIO-based signaling server is provided in the demo/server directory as an example.
In case the peer-to-peer connection fails, PhoneRTC will use your TURN server. The TURN server is simply a proxy.
To set up a TURN server, create an Amazon EC2 instance with the latest Ubuntu. Open the following ports in the instance security group:
TCP 443
TCP 3478-3479
TCP 32355-65535
UDP 3478-3479
UDP 32355-65535
Open SSH and run:
sudo apt-get install rfc5766-turn-server
Next, edit /etc/turnserver.conf
and change the following options:
listening-ip=<private EC2 ip address>
relay-ip=<private EC2 ip address>
external-ip=<public EC2 ip address>
min-port=32355
max-port=65535
realm=<your domain>
Also uncomment the following options:
lt-cred-mech
fingerprint
Next, open /etc/turnuserdb.conf
and add a new user at the end of the file. The format is:
username:password
To start the TURN server, run the following command:
sudo /etc/init.d/rfc5766-turn-server start