freeswitch


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.