JBoss.orgCommunity Documentation
A common theme for JBoss Communications Media Server is the breaking out of internal fixed subsystems into stand-alone components.JBoss Communications Media Server strategy for making available the various voice/video services as independent components, so that they can be wired-together on demand
JBoss Communications Media server architecture promotes the usage of Service Objects to represent the media flow path. The component architecture divides the process of constructing media services into two major parts:
Implementing components that generate, or consume, media data.
Assembling media component chains to build a media flow path.
The role of channel is to construct media flow path by joining components using pipes. Channel can be connected to any source/sink or to other channel. The following diagram explains channel structure.
Respective channel declaration:
Example 6.1. Channel definition
<bean name="tx-channel" class="org.mobicents.media.server.resource.ChannelFactory">
<property name="components">
<list>
<inject bean="audio.mixer" />
<inject bean="media.player" />
<inject bean="dtmf.generator" />
</list>
</property>
<property name="pipes">
<list>
<inject bean="tx-pipe-1" />
<inject bean="tx-pipe-2" />
<inject bean="tx-pipe-3" />
<inject bean="tx-pipe-4" />
</list>
</property>
</bean>
Configurable aspects of the channel are:
The list of components used by the channel
The list of pipes wich defines the actual media flow path
Pipe is used to join two components inside channel. Each Pipe has either inlet or outlet or both defined. A Pipe with only inlet defined acts as exhaust for a channel while Pipe with only outlet acts as intake for a Channel. If a Pipe has both inlet and outlet defined, it means its an internal pipe joining two components.
The definition of the Pipe:
Example 6.2.
<bean name="tx-pipe-1"
class="org.mobicents.media.server.resource.PipeFactory">
<property name="outlet">media.player</property>
<property name="outlet">audio.mixer</property>
<property name="valve"><inject bean="Valve.open"></inject></property>
</bean>
Configurable aspects of the pipe are:
Identifies the component connected to the input of the pipe
Identifies the component connected to the output of the pipe
Valve shows the default state of the pipe. By default pipe is always closed.
The valve defines the initial state of the pipe and is defined as
Example 6.3.
<bean name="Valve.open" class="org.mobicents.media.server.spi.Valve">
<constructor factoryClass="org.mobicents.media.server.spi.Valve" factoryMethod="getInstance">
<parameter<open</parameter>
</constructor>
</bean>
<bean name="Valve.close" class="org.mobicents.media.server.spi.Valve">
<constructor factoryClass="org.mobicents.media.server.spi.Valve" factoryMethod="getInstance">
<parameter<close</parameter>
</constructor>
</bean>
To achieve the modularization every media component's in JBoss Communications Media Server are identified as either MediaSource or MediaSink. As name suggests MediaSource is the one that has capability to generate media while MediaSink is the one that consumes media.
Several MediaSource of different MediaType can be grouped together in one MultiMediaSource. For example media player is source of the audio and video content
ResourceGroup is collection of MediaSource and MediaSink. These MediaSource and MediaSink can be of different MediaTypes
Some of the components are not itself media sink or source but they provide access to the actual media source or sink. Such components are called Inlet and Outlet respectively.
For creating any component Media Server uses suitable Factory. Each component has its unique identifier and name defined by its factory. Component identifier is unique within the entire server implementation. The name of component in opposite way is shared across component produced by same factory.
If the endpoint is implemented by software components only (virtual endpoint) then in this case endpoint can be constucted dynamic
Example 6.4.
<bean name="PacketRelayEndpoint" class="org.mobicents.media.server.EndpointFactoryImpl">
<property name="localName">/mobicents/media/packetrelay/[1..10] </property>
<property name="connectionFactory">
<inject bean="default-connection" />
</property>
<property name="groupFactory">
<inject bean="PacketRelayBridgeFactory" />
</property>
</bean>
Configurable aspects of the virtual endpoint are:
Specifies factory used to construct connection.
Specified resource group.
Specifies media source component
Specifies media sink component
Connection consits from collection of channels specific for direction and media type:
Example 6.5.
<bean name="default-connection" class="org.mobicents.media.server.ConnectionFactory">
<property name="txChannelFactory">\>
<map class="java.util.Hashtable" keyClass="java.lang.String" valueClass="org.mobicents.media.server.resource.ChannelFactory">
<entry><key>audio</key><value><inject bean="tx-channel"/></value></entry>
</map>
</property>
<property name="rxChannelFactory">
<map class="java.util.Hashtable" keyClass="java.lang.String" valueClass="org.mobicents.media.server.resource.ChannelFactory">
<entry><key>audio</key><value><inject bean="rx-channel"/></value></entry>
</map>
</property>
<property name="connectionStateManager"><inject bean="ConnectionStateManager"/></property>
</bean>