CAF: Leg Creation Samples

From TBwiki
(Difference between revisions)
Jump to: navigation, search
(Creating a Standalone Outgoing Call)
(Creating a Media-only Leg)
Line 20: Line 20:
 
   TODO ADD SAMPLE CODE
 
   TODO ADD SAMPLE CODE
 
==== Creating a Media-only Leg ====
 
==== Creating a Media-only Leg ====
 +
You must first create a media only leg attribute:
 +
    PTRCTBCMC_MEDIA_ONLY_LEG_ATTRIBUTE ptrLegAttribute;
 +
 
 +
    ptrLegAttribute = tbnew CTBCMC_MEDIA_ONLY_LEG_ATTRIBUTE();
 +
    ptrLegAttribute->GetNetworkAccessPoint()      = "NAP_SS7_MONTREAL";
 +
   
 +
    pMediaDesc = ptrLegAttribute->GetProfile()->MediaDescription;
 +
    pMediaDesc->Type                              = TBCMC_MEDIA_TYPE_AUDIO;
 +
    pMediaDesc->Transport                        = TBCMC_MEDIA_TRANSPORT_TDM or TBCMC_MEDIA_TRANSPORT_IP;

Revision as of 16:34, 20 October 2009

Contents

Creating a Standalone Outgoing Call

First you must build the outgoing leg attribute:

   PTRCTBCMC_CALL_LEG_ATTRIBUTE ptrOutgoingLegAttribute;
 
   ptrOutgoingLegAttribute = tbnew CTBCMC_CALL_LEG_ATTRIBUTE();
 
   ptrOutgoingLegAttribute->GetCalledNumber()            = "123-4567";
   ptrOutgoingLegAttribute->GetCallingNumber()           = "987-6543";
   ptrOutgoingLegAttribute->GetNetworkAccessPoint()      = "NAP_SS7_MONTREAL";

Once you have all your parameters set, you can now create the outgoing call leg like this:

   PTRCTBCAFCallLeg ptrOutgoingCallLeg = CreateOutgoingCallLeg(ptrOutgoingLegAttribute);

The function CreateOutgoingCallLeg() will do all the work to create the leg and will return it. You have now an active outgoing call leg.

Bridging an Incoming Call (manual method)

 TODO ADD SAMPLE CODE

Bridging an Incoming Call (using CTBCAFBridge )

 TODO ADD SAMPLE CODE

Creating a Media-only Leg

You must first create a media only leg attribute:

   PTRCTBCMC_MEDIA_ONLY_LEG_ATTRIBUTE ptrLegAttribute;
 
   ptrLegAttribute = tbnew CTBCMC_MEDIA_ONLY_LEG_ATTRIBUTE();
   ptrLegAttribute->GetNetworkAccessPoint()      = "NAP_SS7_MONTREAL";
   
   pMediaDesc = ptrLegAttribute->GetProfile()->MediaDescription;
   pMediaDesc->Type                              = TBCMC_MEDIA_TYPE_AUDIO;
   pMediaDesc->Transport                         = TBCMC_MEDIA_TRANSPORT_TDM or TBCMC_MEDIA_TRANSPORT_IP;
Personal tools