Thursday, July 23, 2009

Mobicents JSR-309 Impl 2.0.0.BETA2 Released!

We are happy to release 2.0.0.CR2 version of Mobicents JSR309 Implementation. There are quite a few changes in JSR309 API and hence the implementation too has changed.

Specifically the Events structure have changed. Now the MediaEvent has method isSuccessful() which returns true if the event is for success, false otherwise. Hence every listener will have to have this preliminary check done and act accordingly.


Every NetworkConnection now has a SdpPortManager. The SdpPortManager is compatible with the offer/answer model. Please look at API to understand SdpPortManager. Its an important change


New features that have been added is there is an implementation for MediaConfig now. MediaConfig defines the internal structure of ResourceContainer (NetworkConnection, MediaGroup, MediaMixer etc). For predefined configurations like NetworkConnection.BASIC, MediaGroup.PLAYER, MediaGroup.PLAYER_RECORDER_SIGNALDETECTOR the implementation already has corresponding predefined MediaConfigs. The access to this predefined MediaConfigs can be achieved by calling MsControlFactory.getMediaConfig(Configuration configuration) passing one of the predefined Configuration as parameter.

The MediaConfig implementation shows the mapping between the JSR309 events/signals and corresponding MGCP events. Also it shows the endpoint name on Mobicents Media Server (MMS) that this ResourceContainer is firing signals/events on. Hence if you change the endpoint name on MMS, get the handle to existing MediaConfig impl and create a custom clone by passing new set of Parameters for example


MediaConfig playerConfig = msControlFactory.getMediaConfig(MediaGroup.PLAYER_RECORDER_SIGNALDETECTOR);
Parameters pNew = msControlFactory.createParameters();
pNew.put(ExtendedParameter.ENDPOINT_LOCAL_NAME, "/thisis/new/endpointname/1");

MediaConfigImpl clone = (MediaConfigImpl) playerConfig.createCustomizedClone(pNew);

mediaSession.createMediaGroup(clone, someParams);

In this case someParams could be null as mobicents JSR309 impl still doesn't take them into consideration.

Other way of doing this get the handle to existing MediaConfig impl and get the XML string by calling marshall()

String xml = playerConfig.marshall();

The xml will look like

<?xml version="1.0" encoding="UTF-8"?>
< resource-container>
  < parameter>
    < key> ENDPOINT_LOCAL_NAME < &frasl key >
    < value > &frasl mobicents &frasl media &frasl IVR &frasl$ < &frasl value >
  < &frasl parameter >
  < player >
    < signal >
      < mgcp-event > ann < &frasl mgcp-event >
      < mgcp-package > A < &frasl mgcp-package >
      < on-endpoint > true < &frasl on-endpoint >
    < &frasl signal >
    < event >
      < mgcp-event > oc < &frasl mgcp-event >
      < mgcp-package > A < &frasl mgcp-package >
      < on-endpoint > true < &frasl on-endpoint >
      < media-event > PLAY_COMPLETED< &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > of < &frasl mgcp-event >
      < mgcp-package > A<&frasl mgcp-package >
      < on-endpoint > true < &frasl on-endpoint >
      < media-event > PLAY_COMPLETED< &frasl media-event >
    < &frasl event >
  < &frasl player >
  < recorder >
    < signal >
      < mgcp-event > aupr < &frasl mgcp-event >
      < mgcp-package > AU<&frasl mgcp-package >
      < on-endpoint > true < &frasl on-endpoint >
    < &frasl signal >
  < &frasl recorder >
  < signal-detector >
    < event >
      < mgcp-event > dtmf0< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmf1< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmf2< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmf3< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmf4< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmf5< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmf6< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmf7< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmf8< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmf9< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmfA< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmfB< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmfC< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmfD< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmfStar< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
    < event >
      < mgcp-event > dtmfHash< &frasl mgcp-event >
      < mgcp-package > D<&frasl mgcp-package >
      < on-endpoint > false < &frasl on-endpoint >
      < media-event > SIGNAL_DETECTED < &frasl media-event >
    < &frasl event >
  < &frasl signal-detector>
< &frasl resource-container>

use you favorite XML parser and replace the /mobicents/media/IVR/$ with your value for enpoint for example /thisis/new/endpointname/1. Again get the String of this new XML and create a new MediaConfig object by calling

Reader xmlDoc = new StringReader(xml);
MediaConfig config = msControlFactory.getMediaConfig(xmlDoc);

And then get the corresponding ResourceContainer by passing this MediaConfig to mediaSession. Though this is lengthy process process, it will be useful in future to create a custom MediaConfig when JSR309Impl is mature enough to take custom MediaConfigs.

For now we have flexibility to change the MGCP vs JSR309 events and Endpoint names.

Please note that JSR309 is still under public review and not final. However unless and untill there are major change in API, mobicents JSR309 impl will not change.

Mobicents JSR309 impl version 2.0.0.BETA2 can be downloaded from https://sourceforge.net/projects/mobicents/files/

The Mobicents JSR309 home page is at http://www.mobicents.org/mms-jsr309-main.html

Follow the announcement here http://groups.google.com/group/mobicents-public/browse_thread/thread/5791bdce0143d5f9#

Please post your comments to http://groups.google.com/group/mobicents-public


Enjoy the JSr309 :)

Mobicents Media Server Team

1 comment:

  1. Hi All,
    I am extending pure-jruby-telco example of JSR309 and want to Play
    Multiple Announcements Simultaneously. I tried to initiates multiple
    announcements but only able to listen one.
    I tried to call two phone and pick one phone it start playing and in
    middle of Phone1 call i pick call of Phone2 after that Phone1 become
    mute and Phone2 start playing.
    Please guide how i could accomplish it.
    I also converted jruby code into java.
    Regards,
    imran

    ReplyDelete