This tutorial covers hosting RVD External Services in the Cloud. Since the introduction of the Restcomm Visual Designer(RVD), a lot of developers have been able to experience first hand an unprecedented productivity in building telephony apps.
Restcomm Visual Designer has inspired a number of more complex applications which inevitably require the ability to interact and integrate with third party systems and APIs. In order to support this requirement, RVD introduced the External Service function.
We will see how developers can leverage the power of the external service function by hosting their databases and business logic code on a public cloud machine.
For the purpose we will built a hypothetic phone system for a car service business. We will reuse the ABCauto app which was introduced a couple of weeks ago on our blog.
The database and scripts will be hosted on the Red Hat Openshift Cloud Application Platform. You may use any public or private cloud platform for your own Restcomm apps.
Why host in the cloud?
- When you build an app with RVD (Restcomm Visual Designer) that is intended to be distributed to a variety of end users, , you may want those users to be immediately able to run it without the hassle of complex setup and configuration of a database and code on a local machine.
- Having the data and code hosted on a centralized cloud service makes it easier to work and update your app remotely from anywhere.
- Ultimately these improvements lead to better user experience and potential for more commercial success.
- Restcomm AMI or Local Binary Install
- Knowledge of Restcomm Visual Designer
- Openshift Account
It is assumed that you have your application already built using Restcomm and all that is missing is linking the application to your database and script hosted in the cloud.
- Get your free Openshift account
- Go to the Openshift getting started page
- The guide above will let you start an instance with a programming language like PHP, Python, Java, Ruby, etc.
- In the example of the ABCauto Restcomm app, the root page for the PHP instance on openshift is http://abcauto-telestax.rhcloud.com/
- The page will be similar to the screen below
- Next, you must install a database on your Openshift cloud
- With the ABCauto example, Mysql was installed as shown HERE
- The next step is to create your database and tables
- You must also move all you files, in this case, php files to the cloud using git
- check to make sure your files are accessible on the cloud through the http page (http://abcauto-telestax.rhcloud.com/XYZ.php)
You might get a mysql error when trying to connect to the new database hosted on Openshift. The error output could be similar to the one below
In order to resolve this issue,
- log into your mysql DB installation,
- go to the database mysql
- check the table user
Make sure the Host and the User are the same as used in your php files. In some cases, you might need to use the IP address instead of localhost.
This is where you need to point all your files stored in the cloud to the RVD External Services module. Below you we are going to show you an example of how it can be done.
This is the old External Services module hosted on a server running Restcomm
When the External Services is hosted in the cloud like in the case of the abcauto, the Service URLwill look like the one in the screen below: