Techie Post: Opensim and Freeswitch problems

I was just replying to a note asking about Opensim and Freeswitch based on the fact I have it working(ish) on Ubuntu on a cloud server. I have been meaning to share where I am up to, though I have not found a complete solution to the problem I am having. However this snippet may help someone, or they may be able to help me 🙂

My Opensim and Freewswitch are running Ubuntu Karmic on a cloud service. Both opensim and freeswitch get built rather than binary distributions. However the ini files and config should be the same (as thats the beauty of this).

Freeswitch works by really just opening a conference call which any avatar will dial into. I am not sure how much digging you have done into the problem but there are a few things to look out for.
I am assuming you have followed the main instructions for config etc http://opensimulator.org/wiki/Freeswitch_Module

I had this all running from 6.8 onwards but recently moved to 0.7 I noticed in bin/config-include that there was now a line in StandaloneCommon.ini for Freeswitch not just the Opensim.ini. I think I had to uncomment that when I moved to 0.7

The main thing is to make sure that Freeswitch is started first and ready , then spark up opensim.

The default for the region in Opensim is to not have voice enabled at a land parcel and region level. In Hippo I enter god mode and set both the estate options and the parcel options to allow voice. Having done that (only needed if reloading the terrain or something major, I usually logoff and log on again with the view and it gets enabled. That one has caught em a few times.

The other thing to consider is some of the viewers, in particular the more recent open source ones are not allowed to package the SLVoice components with them. That one caught be when I asked someone to use Hippo on windows. The Mac hippo is old enough to still have the voice DLL but the newer windows one did not have it! SL Viewer 1 should of course be OK, but I think it is still not advisable to use SL Viewer 2 on opensim. Imprudence discusses a patch http://imprudenceviewer.org/wiki/How_to_Re-enable_Voice_Chat which is how I found out the root of the problem

The server firewall is another thing to check, as is the client firewall. As the ports are potentially different as freeswitch is a completely different application to opensim and the viewer can get blocked.

Should all of the above be ok then its console time for both Opensim and Freeswitch. There are some spurious errors it seems as things try to establish connections. However if you get a couple of clients connected (assuming you get the voice enabled in teh client) you can go into freeswitch and use the sofia commands. sofia status and sofia status profile internal both give a bit of information. I am no expert on the commands but I have been able to see if clients have connected from opensim.

This is where we get to a problem I now have. Freeswitch seems to not be working for everyone who comes to my sim. In my testing I used a mac and a windows machine on my own network at home but both talking to the remote cloud server. That has always worked (though technically it shows as the same IP address twice). I patched in someone else across the country who was using SL viewer 1 and we had a conversation, so I thought it was all working. However a few other people, when we have tried a larger meeting, have experienced problems.

It has been a mix of using a viewer with no SLVoice in it, firewalls but also some strange timing behaviour. It is quite difficult to test but that is why I have been using the sofia commands.

The first person to connect will generally get hold music playing. The second person to connect will enter the call, there is a beep as that happens the hold music ends. However you cannot always hear anyone speaking.
I suspect this is the client firewall operating. i.e. Opensim will talk to freeswitch at a server to server level to patch the person in. the Sofia status tends to show me all the users patched in to the freeswitch console. After that its the SL clients doing the work. When I get no voice response it tends to break the call for everyone. I have not found out how to check that or tell freeswitch to ignore bad calls. Getting the once that break it to logoff so there is only 1 person (i.e. me) in the call sometimes takes a few minutes before the hold music kicks in again. There are some sofia reset commands for the profile that I have dabbled with.

It was only a few weeks ago I hit this snag, the people using my freeswitch are not always in a position to mess with their company firewalls so it has been hard to get a test rig that fails consistently to try and debug it.

I have been meaning to write this down somewhere to help others but wanted to try and fix the problem first, but not many people are using or trying freeswitch.

Having said that if you get the voice connected (probably the god mode parcel audio solution at the start of this) you may find it just works. It could be my server having some bandwidth or memory issues etc. Its a tricky one to spot.

6 thoughts on “Techie Post: Opensim and Freeswitch problems

  1. Venkatesh

    Nice article!!! I’ve been trying to get opensim and freeswitch working on the cloud. But I’m facing issues like “You must define a domain called ‘10.254.95.226’ in your directory and add a user with the id=”xOl41855NQr-tfFnD4jE30g==” attribute”. I’ve followed the instructions in the opensim freeswitch configuration page. Please let me know how you managed to resolve it if at all you had faced it earlier.

    Thanks.

    -Venkat

  2. I have not seen that message (that I remember). I have in my xml_curl.conf.xml the external ip address (which is a fixed ip) of the opensim server even though I am running freeswitch on the same machine as the opensim server i.e. no local ip addresses as the voice modules in opensim are considered to be accessing a completely different machine.
    Likewise all the opensim.ini lines are the external IP (I have not used hostname)
    The opensim_well_known_http_address is commented out in my ini too
    I probably had to alter the server firewall settings though that would probably have just been the basic ports voice uses.
    The funny id you see looks like one opensim generates, it creates a call group when it calls out to freeswitch and puts each user in that call group.
    Also make sure you start freeswitch first and let it get its act together.

    In the freeswitch console I have used the commands
    sofia status
    sofia status profile internal

    and sofia profile rescan internal

    To try and see what is going on as users connect. I am no expert on that but the sofia status might pop something more obvious up for you.

    I hope that helps a little (or a lot ! ) 🙂

  3. I’ve been trying to get opensim and freeswitch working on the cloud. But I’m facing issues like “You must define a domain called ’10.254.95.226′ in your directory and add a user with the id=”xOl41855NQr-tfFnD4jE30g==” attribute”. I’ve followed the instructions in the opensim freeswitch configuration page. Please let me know how you managed to resolve it if at all you had faced it earlier.”

    In your vars.xml find where it says:

    and change it to:

    This is the link to the original source from which I found this fix:

    http://www.osgrid.org/forums/viewtopic.php?f=14&t=1773&start=0

  4. My apologies; it seems to have turned the strings into html tags.

  5. ok, let’s try this again.

    [I’m substituting less than and greater than symbols with parenthesis because I don’t blog enough on wordpress to know or care about how to make it look right. Hopefully this will work.]

    you need to change:
    (X-PRE-PROCESS cmd=”set” data=”domain=$${local_ip_v4}”/)

    to:

    (X-PRE-PROCESS cmd=”set” data=”domain=10.254.95.226″/)

    [or whatever your public IP happens to be]

    in vars.xml

Leave a Reply

Your email address will not be published. Required fields are marked *

Fctk Zp4

Please type the text above:

This site uses Akismet to reduce spam. Learn how your comment data is processed.