You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

XMPP/Jingle To SIP Conversion

Heard about jingle, the add on for XMPP that enables point to point audio between to XMPP clients. No server config necessary. Actually quite cool feature. However, how good is it if you can not use those voice capabilities to do a PSTN phone cal, or call some SIP device you have. Well that aint the purpose of Jingle anyhow. So other tools can do that including Asterisk and Freeswitch and that is what we are going to do in the article below.

Prerequisites :

Good Linux Administration Knowlege
Basic Understanding Of XMPP and SIP
A XMPP server running on a public IP "Openfire used here"
Access to change DNS names for your domain
A SIP client such as XTEN
A XMPP client with jingle capabilities such as JABBIN

Setting up Jingle To SIP

Well first of you will have to install Freeswitch since it the one tool that worked for me in Jingle to SIP conversion.

Once you did that you will have a couple of working extensions including 1000 and 1001 with password 1234. Just to make sure that everything is running correctly, launch freeswitch using

/usr/local/freeswitch/bin/freeswitch

It should load normally and give you no errors once that is done login using a softphone such as xlite or xten to the extension 1000 and dial 1001 it should return with a voicemail notice or ring and allow to make a call if you have to SIP phones registered.

So far so good let the dingaling beging.

Now that we have freeswitch working fine and jingle support enabled, lets setup freeswitch to handle jingle traffic. What we want to achieve is the following. Login to your Gtalk account "You need two gtalk accounts for this test" and call the Gtalk account that you configured on your Freeswitch system, this will make the extenion that you assigned to your Gtalk account ring. If you have setup your dialplan correctly your cellphone could ring too. That way all that you friends have to do to contact you is call you on gtalk. However you would be paying for the bills .

As a side note to close freeswitch, type shutdown

Back to the config part.

Edit dingaling.conf and set debug value to 1, this will help to know if something went wrong. I like to use jed as a command line text editor it is a great tool. If you set debug to 1 you can see all the XMPP messages that are passed between freeswitch and the XMPP server.

Now we can setup dingaling. In either of two modes client mode or server mode. If we choose client mode it means that the client we are going to configure is going to login to our xmpp server "gtalk server" in this case and therefore other jingle clients can see it as "online" call it, so the FS server would act as a jingle client.

If we configure component mode, it means that you do NOT have to setup one xml file per client instead you can have a whole sub domain of your XMPP domain being called automatically. To do so you have to setup your XMPP server "I use Openfire" and add a component secret and create a subdomain on your DNS server. That would be

Setup Component Secret + Port on openfire
Add Component to server on openfire
If the component name is fs add fs.mydomain.net to your DNS server and make it point to the FS server
Configure an XML server on FS and enter the correct configuration
Restart Freeswitch and you should be able to see the component connected in OpenFire.
To make a call you should login to your XMPP server as ususal and add a contact for example ext+ 1000@fs.mydomain.net this will allow you to call ext 1000 on your FS server.

Now I have to state the following. I have tried Freeswitch in client mode using the following two approaches

With A Gtalk account and a gtalk client, this worked flawlessly
With server XMPP servers and jingle clients all register but FS was not able to do Jingle to SIP conversion in this case. The main reason as per FS developer Anthony is that jingle is a point to point protocol and FS was tested to work with Gtalk and telepathy. Note here that Freeswith does not use libjingle it uses it's own special jingle implementation
Another Approach I use was the component mode with my XMPP server, everything worked right expect jingle to sip conversion !! .

So Below I will show you a couple of sample configs however only the GTALK config really works.

You have to put the following configs in /usr/local/freeswitch/conf/jingle_profiles/

FS does read all XML files in this dir so if you want it to ignore one of those file either change the extension or change <profile></profile> to <x-profile></x-profile> FS is designed to ignore <x-etc></x-etc> directives.

GTALK Config "Works" this will allow you to call the account added below from any other gtalk client and the SIP extension defined in the lower part of the profile will ring

Well as said before only the GTALK configuration worked for jingle to sip conversion. Setup a xml file with the gtalk contents and restart freeswitch once you do that logon to your gtalk account and you should be able to see that account configured on freeswitch online, call that account and the extension configured in the XML file --> param name="exten" will ring. Make sure you are signed in to your FS using XTEN and that extension as the username.

One more thing that could be done is to setup a PSTN gateway and a dial plan that way every time someone calls you on GTALK FS converts jingle to SIP and it forwards it to your PSTN gateway which in turn converts SIP to the circuit switched network. To achieve this do the following:

Edit dialplan/default.xml and add the config below just below <context name="default">. This will cause all incoming calls to be routed to your PSTN gw. This config is NOT complete it's sole purpose is to demonstrate a FS feature. You can add/edit/remove conditions on this route as needed
<extension name="default">
<condition field="destination_number" expression=""/>
<action application="bridge" data="sofia/gateway/PSTNgateway/00yournumber"/>

</extension>

Once you did this you should be able to make a call from gtalk to your cellphone, to debug this configuration set sip_profiles/outbound.xml debug to 1 and trace to yes. This allows you to see SIP traces in the freeswitch console. If everything goes well it allows you to watch how the call starts in XMPP/Jingle and is later on routed to your PSTN GW as SIP.

The article above is in no way complete or guaranteed to work, it simply states how I got things to work in FS, the article also serves as a reminder for me because I could not complete the setup above untill a couple of days have passed and I asked in mailing lists, IRC and Google. The freeswitch documentation is cool but in jingle aspects it is very poor the only real reference to dinagling in the freeswitch documentation is: