TeleStax Restcomm integration in MetaSwitch Clearwater IMS Core as TAS
Description Project Clearwater RestComm Main Goal Clearwater Setup RestComm as Application Server in Clearwater Accessing RestComm Management Interface TroubleShooting ClearWater Restcomm Acknowledgements
Description
Project Clearwater Clearwater is an open source implementation of IMS (the IP Multimedia Subsystem) designed from the ground up for massively scalable deployment in the Cloud to provide voice, video and messaging services to millions of users. Clearwater combines the economics of overthetop style service platforms with the standards compliance expected of telcograde communications network solutions, and its Cloudoriented design makes it extremely well suited for deployment in a Network Functions Virtualization (NFV) environment. Clearwater is a solution from MetaSwitch
RestComm Restcomm is a next generation Cloud Communications Platform to rapidly build voice and text messaging applications, using mainstream web development skills. RestComm, is a Twilio in a box implemented on top of Mobicents. Restcomm is a turnkey Cloud Communications solution from Telestax, Inc.
Main Goal The main goal of this work was to integrate RestComm as a Telephony Application Server (TAS) in Clearwater IMS Core over the IMS ISC standard interface. The TAS that forms part of the Clearwater distribution is not a separate TAS that talks to the SCSCF over ISC interface, it’s actually integrated into the SCSCF. It supports a limited set of features: Call Diversion, Call Barring and Caller ID Presentation and Restriction. These are all services that can be implemented in a proxy – many other services require the app server to be a B2BUA. RestComm, which is a B2BUA at the core, aims to fit that purpose as well as offering the ability to expose the IMS Network assets through the simple and powerful web APIs from Twilio, that are implemented by RestComm. The work was done on RestComm, but for Application Developers that want have more control on the SIP Services, RestComm can be replaced with TeleStax SIP Servlets container as well.
Clearwater Setup
The Installation of ClearWater on VirtualBox on Ubuntu 13.10 is pretty straightforward and well explained in Clearwater Wiki : https://github.com/Metaswitch/clearwaterdocs/wiki/Allinone%20OVF%20Installation VM Settings : allocate 2048MB memory to the VM before starting it and use Bridged Adapter for the Network (very important!), when the VM is started, login with ubuntu and cwaio password and type ifconfig to check the ip address, let’s assume the IP Address is 192.168.0.16 for this setup
In order the make a first call between 2 sip phones, the following instructions need to be followed : https://github.com/Metaswitch/clearwaterdocs/wiki/Making%20your%20first%20call
Setting up the SIP Phones took a little bit more time fiddling with the SIP Settings but I finally got it working with both Blink and Jitsi on Ubuntu. For the Configuration of the SIP Phones, we will assume Blink will be using 6505550647 as username and Jitsi will be using 6505550020 as username Blink Setup : (Blink => Account => Add Account) ● Display Name : [email protected] ● SIP Address : [email protected] ● Password :
Jitsi Setup (Jitsi => File => Add Account => Click Advanced Button) ● SIP Id : [email protected] ● Password :
When I tested with Jitsi and Blink on Linux, the registration succeeded but trying to call from one Phone to the other gives 404 (confirmed by wireshark, looks like one of the IMS Core node returns 404, I noticed in the sprout logs that ENUM lookups are failing)
RestComm as Application Server in Clearwater
To configure RestComm as App Server in Clearwater, we will follow the instructions here and modify them to integrate RestComm https://github.com/Metaswitch/clearwaterdocs/wiki/Configuring%20an%20Application%20Server
Get latest Restcomm binaries from TeleStax Support Portal http://www.telestax.com/support/ Copy unzipped RestComm to home directory of the “all in one” Clearwater instance with following command (change location to your own) scp r /media/jean/Data/servers/TelScale/TelScaleRestcommJBossAS77.1.2.GA [email protected]:/home/ubuntu
Connect to Clearwater Image through SSH with ssh [email protected]
Edit the /home/ubuntu/TelScaleRestcommJBossAS77.1.2.GA/standalone/deployments/restc omm.war/WEBINF/conf/restcomm.xml and change all references to http://127.0.0.1:8080 in that file to point to http://192.168.0.16:8180. Also modify the mediaservermanager to look like this
Edit the /home/ubuntu/TelScaleRestcommJBossAS77.1.2.GA/bin/standalone.conf and make the first line of the JAVA_OPTS look like JAVA_OPTS="XX:+CMSIncrementalPacing XX:CMSIncrementalDutyCycle=100 XX:CMSIncrementalDutyCycleMin=100 XX:+UseConcMarkSweepGC XX:+CMSIncrementalMode" ie remove Xms6144m Xmx6144m Xmn256m and XX:MaxPermSize=256m as the memory is limited on the VM and otherwise the SIP Servlets server with the RestComm app on it can’t start as the mem heap can’t be reserved.
Edit the /home/ubuntu/TelScaleRestcommJBossAS77.1.2.GA/telscalemedia/telscalemedi aserver/deploy/serverbeans.xml to change the properties to the following below (if your ip address is different recompute the subnet one)
Then you can start the Telscale Media Server by going in the following directory cd /home/ubuntu/TelScaleRestcommJBossAS77.1.2.GA/telscalemedia/telscalemedi aserver and start it with sh bin/run.sh
Then you can start the Telscale RestComm by going in the following directory /home/ubuntu/TelScaleRestcommJBossAS77.1.2.GA/ and start it with sudo sh bin/standalone.sh Djboss.socket.binding.portoffset=100 b 192.168.0.16 we need to start the server with an offset of 100 as opposed to regular port so the JBoss AS7 doesn't conflict with the port used by Ellis for the provisioning UI.
Now we need to modify the default app that ships with RestComm as we use a different port for HTTP, so edit the file at /home/ubuntu/TelScaleRestcommJBossAS77.1.2.GA/standalone/deployments/restc omm.war/demos/helloplay.xml to look like this
The Media Server may crash due to lack of memory (see TroubleShooting Section at the end of this tutorial) in this case replace the default app to hangup right away when it receives a call
The next step is to configure the IMS Core through Ellis configuration file Edit /usr/share/clearwater/ellis/webcontent/js/appservers.json with sudo so it contains the following { "Restcomm" : "
The next step is to bind a number to the default app so it gets triggered when receiving a call which is done through the following command curl X POST http://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166@192 .168.0.16:8180/restcomm/20120424/Accounts/ACae6e420f425248d6a26948c17a9e2acf /IncomingPhoneNumbers.json d "PhoneNumber=4321" d "VoiceUrl=http://192.168.0.16:8180/restcomm/demos/helloplay.xml"
Accessing RestComm Management Interface Go to http://192.168.0.16:8180/restcommmanagement/#/login and click Login button
Make call to RestComm as SIP AS in ClearSwitch IMS Core
Just dial sip:[email protected] from your SIP Phone. The phone should connect and then get an announcement played to it and the call will hang up. (If you changed the helloplay.xml file above to contain Hangup, then the call will disconnect right away)
TroubleShooting
Use the following command to perform a tcpdump and be able to see it with wireshark later sudo tcpdump i lo n s 0 portrange 50605300 vvv w /home/ubuntu/ha_test
Use following command to retrieve sprout logs from the running image scp r [email protected]:/var/log/sprout /media/jean/Data/tmp/clearwater/
ClearWater access the ellis UI, it failed with "Failed to update server (see detailed diagnostics in developer console). Please refresh the page." which seems to be coming from homestead as I see this in logs Rejecting request because of overload
Solution: restart all nodes with the following commands : sudo service homestead stop sudo service homestead start sudo service homer stop sudo service homer start sudo service sprout stop sudo service sprout start sudo service bono stop sudo service bono start
Restcomm It may happen the Media Server shipped with RestComm can’t allocate enough memory and throws an OutOfMemoryException when it is asked to play the announcement. Solution : Depending on your memory usage on the host make sure there is enough memory left to be used and close other applications and memory parameters set when creating the VM
Acknowledgements
Thanks to the Metaswitch employees Andy Caldwell for the peer review of this document and to Matt Williams for his continuous help, guidance and quick turnaround for making this integration happen fast.