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
- The viewer. Firestorm-Paracosm starts with voice off (
EnableVoiceChat0; viewer patch 0007), because a private OpenSim world has no Vivox and Firestorm's voice client started every session for nothing. The same patch stops the Vivox client ever posting crash dumps to a third party. The packaged viewer (packaging.md) goes further and leaves the Vivox voice binaries out (SLVoice.exe,vivoxsdk_x64.dll,ortp_x64.dll), so the packaged viewer has no voice client: turning voice on in its preferences does nothing. A viewer built from source keepsSLVoice.exein its build tree. - The server.
[FreeSwitchVoice]is not set, so the module is off (Enableddefaults to false).
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:
- The viewer asks the region for voice through two capabilities,
ProvisionVoiceAccountRequestandParcelVoiceInfoRequest. - 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. - The viewer's voice client (
SLVoice) signs in at that account server (the module servesviv_get_prelogin.php,viv_signin.php,viv_buddy.php,viv_watcher.phpunder/fsapi/on the simulator port) and then speaks SIP and RTP to FreeSWITCH. - FreeSWITCH asks the region who may connect and how to route calls: its
mod_xml_curlposts tohttp://<simulator>:<port>/fsapi/freeswitch-configwithsection=directoryorsection=dialplan, and theFreeswitchServiceanswers 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:
- Every voice account's password is
1234.FreeSwitchVoiceModule.ProvisionVoiceAccountRequestandFreeswitchServiceboth hard-code it ("temp hack"; "hard coded for now"). Account names come from avatar UUIDs, which are not secret. Anyone who can reach your FreeSWITCH can sign in as any avatar's voice account. - The account-server URL is always
http://, even with OpenSim's HTTPS listener on (tls.md).
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:
- load
mod_xml_curl(autoload_configs/modules.conf.xml); - in
autoload_configs/xml_curl.conf.xml, a binding for the directory and one for the dialplan, each withgateway-urlhttp://<simulator>:<port>/fsapi/freeswitch-configandbindingsdirectoryordialplan; - a SIP profile listening where
SIPProxysays (5060), and an RTP port range the viewers can reach.
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.