Quickstart
For those, who don’t want to wait/read and just want to test what the current state of voice chat is on OpenSim, here’s a brief introduction. You will need the secondlife viewer, the voiceforvw packages from sourceforge and you are set to go.
- Get the (windows) binaries of the SLVoice.exe replacement from: http://zaki.asia/slvoice.zip
- the contents of this .zip go into the second life installation folder (usually c:\program files\second life\) You don’t need to change anything in slvoice.ini, it should work as is.
- Set up a user account at http://zaki.asia/
- Connect to the grid at http://zaki.asia:8002/ and you can already test how chat works. Of course, if you have any feedback/constructive criticism, please let me know.
So what works at this point?
- Conference chat
- Private 1-1 chat
- Multiple codecs (PCMU, PCMA, iLBC)
Overview
If you want to set up voice chat for your grid, here is a rundown on what you will need and how it works.
The SIP server that is currently used with OpenSim is Asterisk. The setup is based on a dynamic, MySQL-based configuration that our frontend (at this point a python script that will be retired very soon) can communicate with. This frontend is invoked by the SLVoice replacement when the user REGISTERs to the SIP channel selected.
There are two questions at this point: how does SLVoice know where to contact the voice server and how does it know the SIP domain associated with our asterisk so that it can register.
The region server must be set up to provide the SIP domain to SLViewer which passes it down to SLVoice. Also, OpenSim.ini has the address of the frontend and the AsteriskVoice module in Region.Environment.Modules.Avatar.Voice invokes the registration methods of this frontend.
However SLVoice doesn’t always get the real SIP domain. Conference chat is no problem, but when private chat is initiated, it only receives a hard-coded SIP URI that it needs to change to the real URI. To be most flexible, this domain is queried at registration time from an HTTP server, the address of which is defined in slvoice.ini. This seems like a long-cut, but VoiceServer (the frontend) is being refactored already to include this functionality, so that this extraneous initialization and additional component can be removed.
When SLVoice registered via the frontend, it can contact the Asterisk service and start the real voice chat.
Installation
Zaptel
http://downloads.digium.com/pub/telephony/zaptel/
Zaptel is a dependency for Asterisk and absolutely a must if you have specialized telephony hardware. For voice chat though, the ztdummy kernel module is enough: this will provide a timer for asterisk.
Zaptel requires that you have
bison, bison-devel
newt, newt-devel
ncurses, ncurses-devel
Installation is straightforward: ./configure; make; make install
(Note: You need to be root to install zaptel, sudo won’t be enough even with the proper permissions)
After installation, make sure you run modprobe ztdummy; modprobe zaptel
Asterisk
First of all, asterisk has a linux and a windows version, but at this moment, setting up the windows version is very awkward to say the least. Also, recent distributions already include a package version of asterisk with proper dependencies resolved… that doesn’t seem to work. So your best bet is installing from source. I have done this on Fedora 8 and 9, Centos4(! it’s a pain, though) and 5 and Ubuntu.
Before you start, please make sure the following are installed:
mysql, mysql-connector-odbc
unixODBC-devel
libtool-ltdl-devel
kernel-devel (this should also match your currently installed kernel. On Fedora, if you haven’t done that already, you should update the kernel at this point if you can, unless you want to hunt down older versions of the kernel-devel package)
The latest versions of Asterisk don’t include the sources for the codec iLBC anymore. If you want those supported, please run contrib/scripts/get_ilbc_source.sh
It is advised that you run make menuselect and configure the modules before you instal asterisk. You will need res_odbc to interface properly with MySQL. Also make sure that ztdummy and app_meetme are marked for install. Then make; make install.
OpenSim
Get OpenSim and apply [Patch 1689] (http://opensimulator.org/mantis/view.php?id=1689) to get private chat working.
Asterisk Frontend
The current frontend requires Python2.5 with mysql support (http://sourceforge.net/projects/mysql-python if not included in the distribution) The frontend can be found in share/python/asterisk/
Setup
Asterisk
In MySQL, create a database: CREATE DATABASE asterisk; and add an ‘asterisk’ user by GRANT ALL ON asterisk.* TO asterisk@<host> IDENTIFIED BY ‘<password>’;
The frontend will create the schema on first start.
Set up ODBC:
/etc/odbcinst.ini
[MySQL]
Description = MySQL For Asterisk
Driver = /usr/lib/libmyodbc3.so
Setup = /usr/lib/libodbcmyS.so
FileUsage = 1
/etc/odbc.ini
[asterisk]
Driver = MySQL
Server = <server address>
Database = asterisk
Port = 3306
User = asterisk
Password = *********
Socket =
Option = 3
Stmt =
/etc/asterisk/extconfig.conf
sipusers => odbc,asterisk,ast_sipfriends
sippeers => odbc,asterisk,ast_sipfriends
extensions => odbc,asterisk,extensions_table
/etc/asterisk/extensions.conf
[avatare]
switch => Realtime/@
/etc/asterisk/modules.conf
[modules]
autoload => yes
noload => pbx_gtkconsole.so
load => res_musiconhold.so
noload => chan_alsa.so
preload => res_odbc.so
preload => res_config_odbc.so
/etc/asterisk/res_odbc.conf
[asterisk]
enabled => yes
dsn => asterisk
username => asterisk
password => *********
pre_connect => yes
Frontend
In asterisk-opensim.cfg, set
[xmlrpc]
baseurl = http://<frontendhost>:<frontendport>/
[mysql]
server = <mysqlhost>
database = asterisk
user = asterisk
password = ************
debug = true
[mysql-templates]
tables = create-table.sql
user = create-user.sql
region = create-region.sql
OpenSim
In OpenSim.ini, add the following section:
[AsteriskVoice]
enabled = true
sip_domain = <asterisk address>
conf_domain = <asterisk address>
asterisk_frontend = http://<frontendhost>:<frontendport>/
asterisk_password = **********
asterisk_timeout = 3000
asterisk_salt = paluempalum
SLVoice
Create an HTML page that has a single line stating the SIP URI to be used for private chats (same as <asterisk address>) Set this page’s address in slvoice.ini and connect to the region. Voice chat should be working now.
What’s next
- There is an ongoing effort to refactor the frontend code. The resulting architecture will be much cleaner with fewer connection.
- The new VoiceServer in progress already includes support for SIP proxies like OpenSER, the SLVoice replacement will be updated shortly to add proxy support as well.
