Actions

CallRouting

Revision as of 16:07, 24 August 2010 by Ktrueman (talk | contribs) (added category)

Routing is important for gateway applications in general. The routing block is in charge of giving routes for incoming call attributes and/or depending on external factors like the time of the day or congestion. The routes are responsible of providing call attributes for incoming and outgoing legs; they contain common routing information like the called number, the calling number and the network access point.

The media profile may be changed by a route so that a route can also change the media of a leg. This can be used to force specific codecs to be used for certain routes or to specify the transcoding type. The transcoding type is only important for VOIP calls since it indicates when the adapter should include itself in the media path. Transcoding is limited limited to the following type:

  • Forced: always transcode.
  • Only as a fallback: to try to save hardware resources.
  • Disabled: if the the hardware resources are not available.


Usage

The default routing implementation routes on only three optional criteria (there must be at least one per rule):

  • Called number.
  • Calling number.
  • Incoming network access point.

When it finds a route matching the call attribute’s criteria, it applies remapping on the desired fields and creates a route that is returned to the application. Remapping can be done on:

  • Called number
  • Calling number
  • Destination network access point

In the default route implementation, the media profile is also changed depending on the transcoding type. This is done by the route in GetIncomingAttributes and GetOutgoingAttributes which will instantiate the attribute based on the transcoding type. This works fine for this initial profile but the leg’s profile may be changed during the call’s life and that change must be handled depending on the transcoding type. The attribute class is the one that is aware of the transcoding type because it is stored in the leg, and will be queried (through SetMediaProfile) when a profile change occurs.

    {
       switch( mRoutingEntry.TranscodingType )
       {
           case TBCAF_ROUTING_TRANSCODING_TYPE_NORMAL:
           {
             pAttributes = tbnew CTBCMC_CALL_LEG_ATTRIBUTE;
           }break;
           case TBCAF_ROUTING_TRANSCODING_TYPE_FORCED:
           {
             pAttributes = tbnew CTBCMC_CALL_LEG_FT_ATTRIBUTE;
           }break;
           case TBCAF_ROUTING_TRANSCODING_TYPE_NEVER:
           {
             pAttributes = tbnew CTBCMC_CALL_LEG_NT_ATTRIBUTE;
           }break;
           
           default:
           {
             TBX_EXIT_ERROR( TBX_RESULT_INVALID_STATE, 0, "Invalid transcoding type." );
           }
        }
     }


Caveats

For now only forced transcoding is supported by the CMC server but this might change in the future. Video support in CMC might force the issue because video transcoding is not cheap.