<<

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 over­the­top style service platforms with the standards compliance expected of telco­grade communications network solutions, and its Cloud­oriented 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 S­CSCF over ISC interface, it’s actually integrated into the S­CSCF. 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/clearwater­docs/wiki/All­in­one%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 cw­aio 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/clearwater­docs/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 and 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 : ● Server Settings of the Blink SIP Account : ○ Outbound proxy : 192.168.0.16 ○ Port: 5060 ○ Transport: TCP ○ Auth Username: [email protected]

Jitsi Setup (Jitsi => File => Add Account => Click Advanced Button) ● SIP Id : [email protected] ● Password : ● Display Name : [email protected] ● Connection Tab of the Jitsi SIP Account : ○ Registrar : 192.168.0.16 ○ Port: 5060 ○ Authorization name: [email protected] ○ Proxy : 192.168.0.16 ○ Port: 5060 ○ Preferred Transport: TCP ○ Keep Alive Method : REGISTER ○ Disable VoiceMail ● Presence Tab : Disable Presence

When I tested with Jitsi and Blink on , 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/clearwater­docs/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/TelScale­Restcomm­JBoss­AS7­7.1.2.GA [email protected]:/home/ubuntu

Connect to Clearwater Image through SSH with ssh [email protected]

Edit the /home/ubuntu/TelScale­Restcomm­JBoss­AS7­7.1.2.GA/standalone/deployments/restc omm.war/WEB­INF/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 media­server­manager to look like this 192.168.0.16 2727 127.0.0.1 2427 response­timeout>500 ­­>

Edit the /home/ubuntu/TelScale­Restcomm­JBoss­AS7­7.1.2.GA/bin/standalone.conf and make the first 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/TelScale­Restcomm­JBoss­AS7­7.1.2.GA/telscale­media/telscale­medi a­server/deploy/server­beans.xml to change the properties to the following below (if your ip address is different recompute the subnet one) 192.168.0.16 127.0.0.1 192.168.0.0 255.255.255.0

Then you can start the Telscale Media Server by going in the following directory cd /home/ubuntu/TelScale­Restcomm­JBoss­AS7­7.1.2.GA/telscale­media/telscale­medi a­server and start it with sh bin/run.sh

Then you can start the Telscale RestComm by going in the following directory /home/ubuntu/TelScale­Restcomm­JBoss­AS7­7.1.2.GA/ and start it with sudo sh bin/standalone.sh ­Djboss.socket.binding.port­offset=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/TelScale­Restcomm­JBoss­AS7­7.1.2.GA/standalone/deployments/restc omm.war/demos/hello­play.xml to look like this http://192.168.0.16:8180/restcomm/audio/demo­prompt.wav

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/web­content/js/app­servers.json with sudo so it contains the following { "Restcomm" : "1 00 INVITEsip:192.168.0.16:51800" } Now configure the user you created in Ellis, through the Ellis user interface (http://192.168.0.16) so that it uses RestComm as an Application Server as described here https://github.com/Metaswitch/clearwater­docs/wiki/Configuring%20an%20Application%20Server#web­ui­co nfiguration­via­ellis

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/2012­04­24/Accounts/ACae6e420f425248d6a26948c17a9e2acf /IncomingPhoneNumbers.json ­d "PhoneNumber=4321" ­d "VoiceUrl=http://192.168.0.16:8180/restcomm/demos/hello­play.xml"

Accessing RestComm Management Interface Go to http://192.168.0.16:8180/restcomm­management/#/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 hello­play.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 5060­5300 ­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.