JBoss.orgCommunity Documentation
The Mobicents Media Server is developed on top of existing Java technologies. The Java platform is ideal for network computing. It offers single, unified-and-unifying programming model that can connect all elements of a business infrastructure. The modularization effort is supported by use of the JBoss Microcontainer which allows to deploy services written as Plain Java Objects into a Standard Java SE runtime environment in controlled manner and achieve great level of customization.
The configurable aspects of MainDeployer are:
Specifies the location of the configuration XML files. Generally, this is the /deploy directory.
Specifies the file extensions that will be deployed or monitored. Supported file extensions are -beans.xml and -conf.xml
The modularization effort allows to construct and start more then one instance of the media server in the single JBoss microcontainer. The single server instance is defined by the following description
Example 5.1. The Media Server instance Declaration
<bean name="MediaServer" class="org.mobicents.media.Server">
<property name="rtpManager"><inject bean="RTPFactory"/></property>
<incallback method="addFactory" />
<uncallback method="removeFactory" />
</bean>
The configurable aspects of the server instance are:
Specifies the relationship between the Real Time Transmission Protocol Manager and Server instance
Thus it is possible to run Media several media server instances with different RTP configuration. Such configuration is used when Media server acts as gateway at the boundaries of the different networks.
Each media type to be processed must be declared. The following listing shows declaration of Audio and Video media types
<bean name="MediaType.audio" class="org.mobicents.media.server.spi.MediaType">
<constructor factoryClass="org.mobicents.media.server.spi.MediaType" factoryMethod="getInstance">
<parameter>audio</parameter>
</constructor>
</bean>
<bean name="MediaType.Video" class="org.mobicents.media.server.spi.MediaType">
<constructor factoryClass="org.mobicents.media.server.spi.MediaType" factoryMethod="getInstance">
<parameter>video</parameter>
</constructor>
</bean>
The configurable aspects of the Media type object are:
Format specifies a particular arrangement of data in a media stream. By examing the information stored in the format, components can discover how to interpret the bits in the binary sound data. Format accommodates a number of common encoding techniques, including pulse-code modulation (PCM), mu-law encoding or a-law encoding. These encoding techniques are predefined, but user can create new encoding types.
In addition to the encoding, the format includes other properties that further specify the exact arrangement of the data which are specific for each media type.
Audio specific parameters include the number of channels, sample rate, sample size, byte order. Sounds may have different numbers of audio channels: one for mono, two for stereo. The sample rate measures how many "snapshots" (samples) of the sound pressure are taken per second, per channel. (If the sound is stereo rather than mono, two samples are actually measured at each instant of time: one for the left channel, and another for the right channel; however, the sample rate still measures the number per channel, so the rate is the same regardless of the number of channels. This is the standard use of the term.) The sample size indicates how many bits are used to store each snapshot; 8 and 16 are typical values. For 16-bit samples (or any other sample size larger than a byte), byte order is important; the bytes in each sample are arranged in either the "little-endian" or "big-endian" style.
Example 5.2. Audio format definition
<bean name="PCMU" class="org.mobicents.media.format.AudioFormat">
<constructor>
<parameter>ULAW</parameter>
<parameter>8000</parameter>
<parameter>8</parameter>
<parameter>1</parameter>
</constructor>
</bean>
The respective parameters of the audio format are:
Encoding name
Sample rate
Sample size in bits
Number of channels
A codec is a component capable of encoding and/or decoding a digital data stream or signal
Example 5.3. Codec definition
<bean name="G711.ulaw.encoder"
class="org.mobicents.media.server.impl.dsp.audio.g711.ulaw.EncoderFactory" />
Codecs can be grouped into processors like depicted at the following example
Example 5.4. Codec definition
<bean name="DSP"
class="org.mobicents.media.server.impl.dsp.DspFactory">
<property name="name">dsp</property>
<property name="codecFactories">
<list>
<inject bean="G711.ulaw.encoder" />
<inject bean="G711.ulaw.decoder" />
</list>
</property>
</bean>
Real-time audio and video conferencing and communication applications that use the Real-time Transport Protocol (RTP) employ a standardized description format (Session Description Protocol, SDP) to describe the media streams carried in a multi-media session. This description format specifies the technical parameters of the media streams. Such a set of RTP parameters of the media stream and its compression or encoding methods is known as a media profile, or RTP audio video profile (RTP/AVP). Each profile is identified by a standardized payload type identifier (RFC 3551 and others)
Payload identifiers 96–127 are reserved for payloads defined dynamically during a session. The minimum payload support is defined as 0 (PCMU) and 5 (DVI4). The document recommends dynamically assigned port numbers, although 5004 and 5005 have been registered for use of the profile and can be used instead. The standard also describes the process of registering new payload types with IANA.
Dynamic payloads can be configured using Format description and A/V Profile description
This is the starting point for creating, maintaining and closing an RTP session. RTP Manager supports unicast session only.
The configurable aspects of the RTPFactory are:
List of encoders/decoders that this RtpFactory
is capable of transcoding.
Specifies the IP address which will be used for RTP session
Lowest port (in the range of lowest to highest port's) available for creating RTP session. The first free port in the given range is assigned to the session.
Highest port (in the range of lowest to highest port's) available for creating RTP session. The first free port in the given range is assigned to the session.
Specifies the size of the jitter buffer (in milliseconds) for incoming packets.
Example 5.5. RTP Manager definition
<bean name="RTPFactory" class="org.mobicents.media.server.impl.rtp.RtpFactory">
<property name="bindAddress">${mms.bind.address}</property>
<property name="jitter">100</property>
<property name="lowPort">1024</property>
<property name="highPort">65535</property>
<property name="codecs">
<map class="java.util.Hashtable" keyClass="org.mobicents.media.server.spi.MediaType" valueClass="java.util.List">
<entry>
<key><inject bean="MediaType.audio"></inject></key>
<value>
<list>
<inject bean="G711.ulaw.encoder" />
<inject bean="G711.ulaw.decoder" />
</list>
</value>
</entry>
</map>
</property>
</bean>
Dual-tone multi-frequency (DTMF) signaling is used for telephone signaling over the line in the voice-frequency band to the call switching center. The version of DTMF used for telephone tone dialing is known by the trademarked term Touch-Tone, and is standardised by ITU-T Recommendation Q.23. Other multi-frequency systems are used for signaling internal to the telephone network
DTMF detector is defined by the following component:
Example 5.6. DTMF detector
<bean name="dtmf.detector" class="org.mobicents.media.server.impl.resource.dtmf.DetectorFactory">
<property name="name">dtmf.detector</property>
<property name="duration">40</property>
<property name="interdigitInterval">150</property>
</bean>
Configurable aspects of the DTMF detector are
The name of the detector
The minimal duration of tone in milliseconds
The minimal interval between two tones in milliseconds
DTMF generator is defined by the following component:
Example 5.7. DTMF generator
<bean name="dtmf.generator" class="org.mobicents.media.server.impl.resource.dtmf.GeneratorFactory">
<property name="name">dtmf.generator</property>
<property name="duration">40</property>
</bean>
Configurable aspects of the DTMF generator are
The name of the detector
The minimal duration of tone in milliseconds
MBrola is free only for non comercial applications!
Changing text to speech is a capability to stream speach generated from text. Mobicents Media Server supports two TTS engines:
FreeTTS
MBrola
By default Server provides following set of voices:
Table 5.2. TTS Voices
Voice | Engine |
---|---|
alan | FreeTTS |
kevin | FreeTTS |
kevin16 | FreeTTS |
mbrola_us1 | MBrola |
mbrola_us2 | MBrola |
mbrola_us3 | MBrola |
MBrola engine picks up list of available voices from directory. It is specified at runtime with following switch:
. Following value is equal to default:-Dmbrola.base
-Dmbrola.base="$MMS_HOME/mbrola"
Mobicents Media Server has pool of voices.
At startup it creates desired number of voice generating objects. This reduces runtime overhead and delays in response from Server.
Size of pool, for each voice can be configured via media player configuration property: voices
.
Voices
property is of Map
type. Table below describes values stored in this propert:
Table 5.3. Voices Map property
Attribute | Type | Description |
---|---|---|
key | String | Defines pool name. It must match correct voice name, ie: alan |
value | Integer | Defines size of pool for voice. It must be positive integer. |
Example configuration looks as follows:
<bean name="media.audio"
class="org.mobicents.media.server.impl.resource.mediaplayer.audio.AudioPlayerFactory">
<property name="name">media.player</property>
<property name="audioMediaDirectory">${mms.media.dir}</property>
<property name="voices">
<map class="java.util.Hashtable" keyClass="java.lang.String"
valueClass="java.lang.Integer">
<entry>
<key>alan</key>
<value>1</value>
</entry>
<entry>
<key>kevin16</key>
<value>1</value>
</entry>
<entry>
<key>kevin</key>
<value>1</value>
</entry>
<entry>
<key>mbrola_us3</key>
<value>1</value>
</entry>
<entry>
<key>mbrola_us2</key>
<value>1</value>
</entry>
<entry>
<key>mbrola_us1</key>
<value>1</value>
</entry>
</map>
</property>
</bean>
The Connection
can be in one of the following four operational states.
NULL
The Connection
has been installed successfully and is ready to be activated. The Connection
is not running, i.e., its not receiving nor transmitting media
IDLE
The receiving or/and transmitting Channel
of Connection
is/are connected to Sink
or/and Source
of Endpoint
. However Connection
is still not running, i.e., its not receiving nor transmitting media. Connection
transits back to NULL when deleted in this stage.
HALF_OPEN
The Connection
is bound and can only receive media. Connection
transits back to NULL when deleted in this stage.
OPEN
The remote SDP
is set and now Connection
can receive as well as transmit media. Connection
transits back to NULL when deleted in this stage.
There is no direct control over the states of Connection
but only through Controller
module
The ConnectionStateManager
maps various state's of Connection
with life-time (in milli seconds) of Connection
in that state
ConnectionStateManager is defined by the following component:
<bean name="ConnectionStateManager" class="org.mobicents.media.server.ConnectionStateManager">
<constructor>
<parameter>
<map class="java.util.Hashtable" keyClass="org.mobicents.media.server.spi.ConnectionState" valueClass="java.lang.Integer">
<entry>
<key><inject bean="ConnectionState.NULL"></inject></key>
<value>0</value>
</entry>
<entry>
<key><inject bean="ConnectionState.IDLE"></inject></key>
<value>30000</value>
</entry>
<entry>
<key><inject bean="ConnectionState.HALF_OPEN"></inject></key>
<value>3600000</value>
</entry>
<entry>
<key><inject bean="ConnectionState.OPEN"></inject></key>
<value>3600000</value>
</entry>
<entry>
<key><inject bean="ConnectionState.CLOSED"></inject></key>
<value>0</value>
</entry>
</map>
</parameter>
</constructor>
</bean>
Irrespective if Connection
is running or not, the Connection
will be deleted after timeout (time starting from transition to this state) value specified for that state
MGCP Controller is implemented by the following component
<bean name="MgcpController"
class="org.mobicents.media.server.ctrl.mgcp.MgcpController">
<property name="server">
<inject bean="MediaServer" />
</property>
<property name="defaultNotifiedEntity">client@localhost:2727</property>
<property name="bindAddress">${mms.bind.address}</property>
<property name="port">2427</property>
<incallback method="addPackage" />
<uncallback method="removePackage" />
</bean>
Configurable aspects of the MGCP controller are
The server instance which is under control
The IP address to which controller is bound
The port number used by controller
Defines default notified entity value.