Overview
After configuring MBG to support WebRTC on a separate server, download the Software Development Kit (SDK) from the WebRTC. The SDK includes the settings you have configured on MBG (WebRTC address and port, WebRTC protocol security mode, Webserver shared secret, etc.) and allows you to deploy the application to your web server, customizing the look and operation of the pages if you desire.
Downloading the SDK and Opening the Files
To obtain the SDK:
Move to file to a location of your choosing (if necessary), unzip it and examine the contents. The SDK is an archive (zipped file) that contains:
index.php is the default template for Subscriber call mode. It includes a login interface and the SIP credentials required to enable the web phone (miwebphone.js) to work properly. As with any web site, it is the main page that allows dynamic content.
config.php contains WebRTC settings configured on MBG, which are used to generate dynamic web pages.
call.php is the default template for Anonymous call mode. It includes ephemeral credentials delivered through CAPTCHA verification. You can make this file “plug and play” by adding a destination number or SIP URI to it. The number/URI must also be configured on the ICP.
Adding the Files to the Web Server
There are two ways to implement WebRTC on your web server:
Implement the Complete SDK
To employ this option, simply extract the contents of the SDK onto the web server to a location such as the root directory. The server requires PHP. You can then begin using the standalone service by opening the appropriate URL in the SDK folder location. For example, to initiate a call, you would enter the following addresses in a web browser:
Optionally, you can modify the implementation as follows:
Implement Only the JS Files
You can build your own web application using only the Javascript files included with the SDK. If your web pages are dynamically created by PHP, you can include the config.php file as in your PHP code. If your implementation does not support PHP, you must manage these parameters manually.
You are required to use the following JavaScript libraries:
Correspondence table of config.php values and miwebphone.js constructor values:
config.php |
miwebphone.js constructor |
$websocket_secure |
'ws_secured' |
$websocket_server |
'ws_server' |
$websocket_port |
'ws_port' |
$disable_video |
'disable_video' |
$user_ipbx_server |
'pbxIpaddress' |
Config.php values used by the web pages but not provided to the constructor: