CommuniGate Pro
Version 1.0
Test Form

Media Plugin: HTML Test Form

This page presents a test form utilizing the CommuniGate Pro Media Plugin packaged as an ActiveX component.

You can use the form buttons to call various Media Plugin methods, or you can use a simple XIMSS session to make a real call and to process call update and call disconnect events.

Test Form

The form below loads the Media Plugin. The form allows you to manually call Media Plugin methods.

Media Leg:


Test XIMSS Session

You may want to test the Media Plugin with a simple XIMSS session.

Use a regular "telnet"-type application to connect to a XIMSS server such as CommuniGate Pro.
End each command by pressing ctrl-@ to enter binary zero.

Log into your server:

C:<login id="login" authData="your_account_name@your_domain" password="your_password" />
S:<session id="login" urlID="7891-loHobstRuBPH6z1hoLwg" userName="your_account_name@your_domain" realName="your real name" />
S:<response id="login"/>

Select the Media Leg name Leg1 in the form above, and click the Create Leg button to create a Media Leg.

Click the Play Locally button to test the newly created leg.
You may want to lower the volume by setting a value in the 1-100 range using the Out Level button.
The test sound plays in loop for 2 minutes. To stop it, clear the field next to the Play Locally button and click that button.

Click the Get Local SDP button to retrieve the Media Leg Session Descriptor (in the XML format).

Start a call to a test destination (such as pbx@your_domain) using the copied SDP.

C:<callStart id="call" callLeg="leg1" peer="destination">

S:<response id="call"/>

You may receive one or several provisioning report messages from the server, followed by one success or failure report.

If the call fails, use the callKill command to release the "leg1" identifier, and make a new call attempt:

S:<callProvisioned callLeg="leg1"/>
S:<callProvisioned callLeg="leg1"><sdp>some_optional_sdp</sdp></callProvisioned>
S:<callDisconnected callLeg="leg1" errorText="Unknown account" signalCode="404" />
C:<callKill id="kill" callLeg="leg1" />
S:<response id="kill"/>

If the call succeeds, you will receive the Session Descriptor (SDP) of the remote peer:

S:<callProvisioned callLeg="leg1"/>
S:<callProvisioned callLeg="leg1"><sdp>some_optional_sdp</sdp></callProvisioned>
S:<callProvisioned callLeg="leg1"/>
S:<callConnected callLeg="leg1"><sdp>peer_sdp</sdp></callConnected>
Quickly copy the received SDP (<sdp>peer_sdp</sdp>) into the form field next to the Remote SDP button, and click that button. You should now hear the peer.

Click the Activate Leg button to allow 2-way communication.

If you have connected to some IVR application, you can control it by selecting a command next to the Send DTMF button, and clicking that button.

If you have switched peers, or the peer application has switched its media streams, you will receive the callUpdate report message from the server:

S:<callUpdated callLeg="leg1"><sdp>new_peer_sdp</sdp></callUpdated>
Quickly copy the received SDP (<sdp>new_peer_sdp</sdp>) into the form field next to the Remote SDP button, and click that button. You should now hear the new peer media.

To end the call, use the callKill command. Use it even if the peer has finished the call first and you have received the callDisconnected report message from the server:

C:<callKill id="kill" callLeg="leg1" />
S:<response id="kill"/>
You now can release the Media Leg by clicking the Destroy Leg button.

Using with C++ Programs

You may want to use the ActiveX component containing the CommuniGate Pro Media Plugin with your C++ programs.

The Plugin library Interface is defined in the CGateAV.tlb file, copy it to your development system.

The following sample code allows you to access the Media Plugin functions:
#import "CGateAV.tlb" named_guids

void MainInit(void) {
  CoInitialize(NULL);	       // initialize COM libraries

void MainRetire(void) {
  CoUninitialize(NULL);	       // retire COM libraries

bool MyTest(const char* legName) {
  using CGATEAVLib::ICommuniGateAVPtr;
  using CGATEAVLib::CommuniGateAV;
  bstr_t leg = bstr_t(legName);

  ICommuniGateAVPtr pControl;
  if(pControl.CreateInstance(__uuidof(CommuniGateAV)) != S_OK) return(false);

  bstr_t retrievedSDP = pControl->GetLocalSDP(leg,"xml");

CommuniGate® Pro Guide. Copyright © 1998-2010, Stalker Software, Inc.