← Paracosm·Docs/Handbook
Contents · Voice

Voice: FreeSWITCH, or off

Paracosm ships with voice off, and we have not run voice at all. Nothing on this page has been tested here. It describes OpenSimulator 0.9.3.0's FreeSWITCH voice module from its source and example configs, so that someone who wants voice knows what they are taking on. Leaving it off loses nothing else: text chat, IM, sounds and every WorldBridge feature work without it.

Where voice stands in Paracosm

How OpenSim voice works

OpenSim has no voice server of its own. The FreeSwitchVoice region module (OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice) is the go-between for a separate FreeSWITCH server:

  1. The viewer asks the region for voice through two capabilities, ProvisionVoiceAccountRequest and ParcelVoiceInfoRequest.
  2. The region answers with a voice account name derived from the avatar's UUID, a password, the SIP domain (Realm) and an "account server" URL, http://<ExternalHostName>:<simulator port>/fsapi/, and, for the parcel, a SIP channel URI. There is a channel only if the estate allows voice (EstateSettings.AllowVoice) and the parcel has the Allow Voice flag.
  3. The viewer's voice client (SLVoice) signs in at that account server (the module serves viv_get_prelogin.php, viv_signin.php, viv_buddy.php, viv_watcher.php under /fsapi/ on the simulator port) and then speaks SIP and RTP to FreeSWITCH.
  4. FreeSWITCH asks the region who may connect and how to route calls: its mod_xml_curl posts to http://<simulator>:<port>/fsapi/freeswitch-config with section=directory or section=dialplan, and the FreeswitchService answers with generated XML.

So FreeSWITCH must reach the simulator's HTTP port, and viewers must reach FreeSWITCH (SIP and RTP).

Two things in the 0.9.3.0 source to know before exposing it:

Server config

bin/OpenSim.ini (add to config/paracosm.ini so make_config.py keeps it):

[FreeSwitchVoice]
    Enabled = true
    ; a standalone runs the service in-process
    LocalServiceModule = OpenSim.Services.FreeswitchService.dll:FreeswitchService

bin/config-include/StandaloneCommon.ini (add to config/StandaloneCommon-overlay.ini):

[FreeswitchService]
    ; the FreeSWITCH server's address; viewers must be able to reach it. Required: without it the service does not
    ; start ("No ServerAddress given")
    ServerAddress = 192.0.2.10
    ; optional, with their defaults (FreeswitchServiceBase)
    ; Realm = <ServerAddress>              the SIP domain
    ; SIPProxy = <ServerAddress>:5060
    ; EchoServer = <ServerAddress>
    ; EchoPort = 50505
    ; AttemptSTUN = false
    ; DefaultTimeout = 5000
    ; Context = default                    the FreeSWITCH dial-plan context

UserName and Password exist in the example but the example says both are unused. If Realm or the API prefix comes out empty, the module logs "Freeswitch service mis-configured. Not starting." and voice stays off.

Then, in the world: the estate must allow voice (Estate tools, "Allow Voice"), and each parcel where people should talk needs "Allow Voice Chat" on (About Land, Sound).

FreeSWITCH config (from the OpenSimulator wiki, not checked here)

The OpenSimulator wiki's Freeswitch_Module page is the reference; its shape, for orientation only:

Firewall on the FreeSWITCH machine: SIP (5060, UDP and TCP) and the RTP range from its switch.conf.xml, open to the viewers; the simulator's HTTP port reachable from FreeSWITCH.

The viewer side

A viewer needs a voice client that FreeSWITCH accepts. The packaged Firestorm-Paracosm has none (above). A viewer built from source carries Firestorm's SLVoice.exe; whether that client works with OpenSim's FreeSWITCH module is not known here and is the first thing to test. In the viewer, turn voice on in its preferences (the EnableVoiceChat setting).

Or leave it off

Nothing to do: that is the shipped state. Neither of OpenSim's voice modules is on ([FreeSwitchVoice] Enabled and [VivoxVoice] enabled both default to false), so the region registers no voice capabilities, and a viewer from elsewhere that has voice on finds none to use.