Table of Contents Index NMS Glossary Previous Page Next Page Version


Chapter 2

Programming Model


2.1 Using the AG TRAU Service
2.2 Compiling and Linking
2.3 AG Configuration Files
2.4 Setting Up the CT Access Environment
2.4.1 Creating Event Queues and CTA Contexts
2.4.2 Opening AG TRAU Services
2.5 Loading and Unloading AG TRAU Programs
2.5.1 Controlling AG TRAU Resources
2.5.2 Unloading AG TRAU Programs
2.6 Attaching and Detaching AG TRAU Channels
2.6.1 AG TRAU Channel Information
2.6.2 Detaching AG TRAU Channels
2.7 Enabling and Disabling AG TRAU Channels
2.8 Retrieving AG TRAU Channel Information
2.8.1 Retrieving AG TRAU Channel Switching information
2.8.2 Retrieving AG TRAU Channel Status Information
2.9 AG TRAU Channel States
2.10 Processing AG TRAU Events
2.11 Sending Commands to AG TRAU Programs

2.1 Using the AG TRAU ServiceTop of Page

The Fusion AG TRAU service provides functions for:

The AG TRAU service is a CT Access service that uses the ADI service manager. Gateway applications that use AG TRAU functions also use:

Figure 6 shows a typical procedure for setting up AG TRAU channels on a
TX-based Fusion system using CT Access, the ADI service, the Switching service, and the AG TRAU service. chap20.gif

Figure 6. TX-based Fusion Gateway Function Sequence

2.2 Compiling and LinkingTop of Page

When compiling an application, direct the compiler to \nms\include directory for the AG TRAU header files, as shown in the code sample below:

#include "traudef.h"        /*  Contains public interface to TRAU API */

Applications that use the AG TRAU service also need to link to trauapi.lib (or trauapi.so) in order to interface with the AG TRAU service. In addition, they need to link against libraries installed with Fusion software and CT Access. Shared libraries can be found under \nms\lib.

Note: Depending on application requirements, other CT Access include and library files may be required (refer the CT Access Installation Manual for more information).

Refer to the trauxsr sample program and its associated make file for sample code for a simple AG TRAU service application.

2.3 AG Configuration FilesTop of Page

AG configuration files list the types, locations, and roles of each of the AG boards. They also describe what software modules should be loaded to board DSPs. The AG board initialization utility, agmon, interprets AG configuration files and configures the boards as described in the file. These files determine how DSPs on the AG 2000 and AG 4000 boards are loaded and configured.

Before initializing CT Access, you must initialize the AG board environment by running agmon with a specific AG configuration file. For Fusion configurations this configuration file include statements that specify how AG TRAU programs loaded on the AG 2000 or AG 4000 board(s) will run.

Fusion AG configuration files may include the following keywords to control where AG TRAU channels are loaded, and how these channels communicate with the H.100 bus:
Keyword

Description

Fusion Implementation

AG2TaskProcessor

Configures DSPs on AG 2000 and AG 4000 boards.

Must be set to NULL for Fusion configurations. This reserves the specified DSPs for use by AG TRAU programs.

ConnectMode

Specifies HMIC switch connect mode.

Must be set to Framed for Fusion TX-Based configurations (it ensures that HDLC bonded timeslots stay contiguous).

Note: The ConnectMode statement should be omitted for Fusion host-based configurations.

For more information about configuring AG boards with agmon, refer to the
AG Runtime Configuration and Developer's Manual. For more information about Fusion-specific AG configuration files (as well as sample configuration files), refer to the Fusion Developer's Manual.

2.4 Setting Up the CT Access EnvironmentTop of Page

Before calling functions from the AG TRAU service, an application initializes CT Access and opens the CT Access services it will use (including the AG TRAU service).

To set up CT Access:

  1. Initialize CT Access and its services.

    
    
  2. Create event queues.

    
    
  3. Create CTA contexts (attaching to event queues).

    
    
  4. Open services on CTA contexts.

To initialize CT Access and its services, invoke ctaInitialize and specify the names of the services and service managers that the application will use. Applications can only use services initialized with ctaInitialize.

The following table shows the names of services and service managers used by Fusion applications:
This service...

With this service manager...

Provides...

ADI

ADIMGR

Call control functions

TRAU

ADIMGR

Data conversion functions

HBF

HBFMGR

Host-based data transfer functions

SWI

SWIMGR

CT bus switching functions

VCE

VCEMGR

Voice message play, record, and edit functions

2.4.1 Creating Event Queues and CTA ContextsTop of Page

After initializing CT Access and its services, create CT Access event queues and CTA contexts.

ctaCreateContext returns a CTA context handle (ctahd). When an application invokes AG TRAU functions, it must specify a CTA context handle. Events communicated back to the application are associated with the specified handle. Refer to the CT Access Developer's Reference Manual for more information about CT Access programming models and managing CT Access contexts and queues.

Note: Applications can use CTA context handles as either AG TRAU Load handles (loadhds) or channel handles.

2.4.2 Opening AG TRAU ServicesTop of Page

Opening a service on a CTA context creates a service instance. To open an AG TRAU service instance on a CTA context, invoke ctaOpenServices and specify a ctahd, the type of service (TRAU) to open, and the appropriate service manager (ADIMGR) for the specified service.

The AG TRAU service functions trauLoad and trauAttach enable applications to create and control AG TRAU resources. trauLoad creates AG TRAU channel resources, while trauAttach associates these channel resources with specific ctahds.

The following table describes handles and IDs used to control AG TRAU processes:
Resource Identifier

Description

Load handle

This CTA context handle (loadhd) controls AG TRAU DSP resources allocated to one or more AG TRAU programs. loadhds are used to load and unload AG TRAU programs. Load handles are obtained by opening AG TRAU service on CTA context handles. The ctahd, when used with trauLoad, becomes an AG TRAU service loadhd.

Note: Load handles should be used exclusively for the AG TRAU programs.

DSP ID

This provides a resource identifier (dspid) for unloading, and soliciting information about loaded AG TRAU programs. Several dspids may be associated with a single loadhd. dspids are returned by calls to trauLoad.

TRAU channel handle

CTA context handle (ctahds) for controlling specific AG TRAU channels. ctahds are used to attach, detach, enable, and disable AG TRAU channels (several ctahds may be associated with a single loadhd). The CTA context handles are obtained with ctaCreateContext, and then used with trauAttach.

Note: An AG TRAU channel handle can be used to open one or more other service instances, such as an ADI service (call control) or Voice Message (voice message recording and playback) service instance, while associated with a specific AG TRAU channel.

The following code demonstrates opening an AG TRAU service on a CTA context:

static CTA_SERVICE_DESC Services[] =       /* for ctaOpenServices */
{ 
    { {"TRAU","ADIMGR"}, { 0 }, { 0 }, { 0 } },
}
    ret = ctaOpenServices( loadhd,
        Services,
        sizeof(Services)/sizeof(CTA_SERVICE_DESC) );
    
    printf( "Waiting for open service on the loader \n" );
    while (1)
    {
        ret = ctaWaitEvent( ctaQue, &event, CTA_WAIT_FOREVER);
        if ( CTAEVN_OPEN_SERVICES_DONE == event.id )
            break;
    }
if (Event.value == CTA_REASON_FINISHED
printf ("Success.");

2.5 Loading and Unloading AG TRAU ProgramsTop of Page

An AG TRAU program is a DSP program capable of processing voice data on a specific number of channels. Use trauLoad to load an AG TRAU program to an available NMS board DSP. trauLoad requires the following arguments:

trauLoad immediately returns a TRAU resource identifier (dspid) that the application can use to unload the AG TRAU program. The dspid is a reference ID that the AG TRAU service uses to control to unload or retrieve information about a particular AG TRAU program. Once an AG TRAU program is loaded to an NMS board DSP, the DSP is reserved for performing AG TRAU processing until the program is unloaded.

For a list of available AG TRAU programs, refer to to the Fusion readme.txt file.

Multiple trauLoad calls can use the same board number until all DSPs on the specified board are loaded. When all DSPs are used (by AG TRAU programs and/or other DSP programs), the AG TRAU service returns TRAUERR_NO_FREE_DSP in the value field of the TRAUEVN_LOAD_DONE event (the application can, however, continue to load AG TRAU programs on another board).

If the host system contains more than one NMS DSP resource board, applications can invoke trauLoad with the board number set to ANY_FUSION_BOARD. When the board number is set to ANY_FUSION_BOARD, the AG TRAU service loads AG TRAU programs to available DSPs on any NMS board in the system. If no DSPs are available, the AG TRAU service returns TRAUERR_NO_FREE_DSP.

Note: ANY_FUSION_BOARD can only be used in systems that use a single type of NMS DSP resource board (for example, all AG 4000 boards).

The following code sample demonstrates loading an AG TRAU program to any available NMS board DSP:

printf( "Request for first load \n" );

ret =trauLoad (loadhd,ANY_FUSION_BOARD,vocfile,&dspid,ParmPtr,ParmSize );
if( ret != SUCCESS )
{
  printf ("Call to trauload failed:|t%x ", ret );
  exit( ret );
}

The TRAUEVN_LOAD_DONE event includes a data structure that provides the location of the loaded AG TRAU program (board and DSP number), the type of program loaded, and number of channels the program can support. Refer to Section 2.10 for information about retrieving AG TRAU program information from TRAUEVN_LOAD_DONE events.

2.5.1 Controlling AG TRAU ResourcesTop of Page

You can organize groups of AG TRAU programs under a single CTA context by invoking trauLoad multiple times with the same loadhd. Figure 7 shows an application loading two AG TRAU Full Rate GSM (FR FSM) programs under the same loadhd.

chap21.gif

Figure 7. Loading AG TRAU Programs With a Single loadhd


This programming model provides several options for organizing AG TRAU resources. You can, for example, specify separate loadhds for different types of AG TRAU programs (for example, G.711 or G.723.1), or for AG TRAU programs running on different boards.

Figure 8 shows several ways to organize AG TRAU programs underneath one or more loadhds.

2.5.2 Unloading AG TRAU ProgramsTop of Page

Use trauUnload to disable an AG TRAU program and free its DSP resources. Specify a dspid returned by trauLoad and a mode for unloading the program. Available trauUnload modes include:
Mode

Description

TRAU_UNLOAD_WAIT

Waits until all active channels are disabled before stopping an AG TRAU program.

TRAU_UNLOAD_IMMEDIATE

Interrupts all active channels and immediately shuts down the AG TRAU program.

TRAU_UNLOAD_CANCEL

Cancels a pending trauUnload call (e.g., one that is waiting for AG TRAU channels to be disabled).

After an AG TRAU program is unloaded, the application can load and run other AG TRAU programs with the freed DSP.

2.6 Attaching and Detaching AG TRAU ChannelsTop of Page

An AG TRAU channel is a path for processing voice data through an AG TRAU programs. Use trauAttach to associate a CTA context handle (ctahd) with a channel on a loaded AG TRAU program. When invoking trauAttach specify:

trauAttach searches for an AG TRAU program of the specified type associated with the specified loadhd. If a channel is available, trauAttach associates the AG TRAU channel with the specified ctahd.

Attached AG TRAU channels begin in an offline state and remain inactive until explicitly enabled (with trauEnable) to process voice data. Use the ctahd associated with an attached channel to enable, disable, or detach the channel.

Figure 9 shows attaching ctahds to AG TRAU channels running on different
AG TRAU programs.

chap23.gif

Figure 9. Attaching AG TRAU Channels


In Figure 9 the application supplies a unique ctahd for each channel to attach, and specifies an AG TRAU program type (in this case, G.729A or G.723.1) and a loadhd (in this case, load_a). The AG TRAU service selects an available channel of the specified type from within the loadhd, and binds the channel to the supplied ctahd. The AG TRAU service then returns the physical location of the channel (board, DSP and channel number) as well as switching information for the channel in the trauAttach data structure.

2.6.1 AG TRAU Channel InformationTop of Page

The AG TRAU service provides information about AG TRAU resources in the following ways:

A successful trauAttach call synchronously returns information about the physical location of the attached channel and (for AG TRAU channels running on AG 2000 or AG 4000 boards) switching information. This data is returned in a TRAU_ATTACH_DATA structure that provides the board, dspid, and channel number associated with the attached channel.

The following code sample shows attaching an AG TRAU channel and reading the returned information about channel's location:


{
ctaCreateContext( ctaQue, 0, "TRAUCHNHD", &trauchnhd[ channel_index ] );
                            
printf( "open service request on channel %d...", channel_index );
ctaOpenServices( trauchnhd[ channel_index ],Services,
      sizeof(Services)/sizeof(CTA_SERVICE_DESC) );
static CTA_SERVICE_DESC Services[] =        /* for ctaOpenServices */
{ 
    { {"TRAU","ADIMGR"}, { 0 }, { 0 }, { 0 } },
};         /* Initialize other services as needed.           */
while (1)
{
  ctaWaitEvent( ctaQue, &event, CTA_WAIT_FOREVER);
  if ( CTAEVN_OPEN_SERVICES_DONE == event.id )
  {
  if ( value == CTA_REASON_FINISHED)
  puts("..success!");
  printf ("Success.");
  break;
  }
  else
  {
   ProcessError( loadhd, event.id );
   puts("..Unknown event!");
    }
 }
/* All channel service set up so do the first attach */
ret = trauAttach (trauchnhd[ channel_index ], loadhd, type[0], &attach_data ); if ( ret == SUCCESS ) { printf( "trauAttach successful for %d \n", channel_index ); printf( "\t dspid = %x\n",attach_data.dspid); printf( "\t board = %x\n",attach_data.board); printf( "\t dsp = %x\n",attach_data.dsp); printf( "\t channel = %x\n",attach_data.channel); if ( loaddata->pcm_stream_from_dsp != 0 ) { /* Now print switching information */ printf ("\t Switching info:\n"); printf ("\t PCM from DSP\t= %d:%01d\n",
attach_data.pcm_stream_from_dsp, attach_data.pcm_slot );
printf ("\t PCM to DSP\t\t= %d:%01d\n", attach_data.pcm_stream_to_dsp, attach_data.pcm_slot ); if ( attach_data.tx_count != 0 ) /* print the output tx side */ { printf ("\t HDLC Data from DSP\t= %d:", attach_data.tx_stream_from_dsp ); for (index = 0; index < attach_data.tx_count;index++) { if ( index != 0 ) printf(","); printf ("%01d",attach_data.tx_slot[index]); } printf ("\n"); printf ("\t HDLC Data to DSP \t= %d:",
attach_data.tx_stream_to_dsp );
for (index = 0; index < attach_data.tx_count;index++) { if ( index != 0 ) printf(","); printf ("%01d",attach_data.tx_slot[index]); } printf ("\n\n"); } } channel_index++; }

2.6.2 Detaching AG TRAU ChannelsTop of Page

Use trauDetach with a ctahd to disassociate an attached AG TRAU channel from a CTA context. The channel remains reserved for AG TRAU processing, and can be assigned to another ctahd.

Note: If a channel is still enabled when the application invokes trauDetach, the channel is asynchronously disabled before being detached.

2.7 Enabling and Disabling AG TRAU ChannelsTop of Page

Invoke trauEnable with a specific ctahd to begin processing data on an attached AG TRAU channel. Always switch data to AG TRAU channel immediately before enabling the channels. For information about retrieving AG TRAU channel switching information, refer to Section 2.8.1.

To stop an AG TRAU channel from processing voice data and return it to an offline state, use trauDisable and specify the ctahd of the channel you want to disable.

The following sample code shows invoking trauEnable and waiting for the result of the enable request:

/* Submit an enable request */                            
   ret = trauEnable ( ctahd );
   if( ret != SUCCESS )
   {
   printf ("Call to trauEnable failed:\t%x ", ret );
   exit( ret );
   }
    while (1)
    {
        ret = ctaWaitEvent( ctaQue, &event, CTA_WAIT_FOREVER);
        if ( TRAUEVN_ENABLE_DONE == event.id )
            break;
    }
     /* process the TRAUEVN_ENABLE_DONE */
      if ( event.value == CTA_REASON_FINISHED )
     {   /* this enable was successful */
         enabled_ctahd = event.ctahd;
         printf ("TRAU Enable received, channel ctahd  handle= %x\n",
enabled_ctahd );
} else printf ("Done event for trauEnable failed:\t%x ", event.value ); exit(event.value);

2.8 Retrieving AG TRAU Channel InformationTop of Page

In order to control the processing of voice data, Fusion gateway applications must keep track of the number and type of available AG TRAU channels available on the system. The following table shows AG TRAU functions that provide information about AG TRAU programs and channels:
AG TRAU Function

AG TRAU Program Information

AG TRAU Channel Information

Return Method

trauLoad

· Type of program

· dspid

· Board number

· DSP number

· Number of available channels

· Frame/buffer size
(host-based configurations only)

· Switching information *

None.

TRAUEVN_LOAD_DONE: Event returned asynchronously.

trauAttach

None.

· dspid

· Board number

· DSP number

· Channel number

· Switching information *

ATTACH_DATA:
Data structure returned synchronously.

trauShowDSPInfo

· loadhd

· Type of program

· Total channels loaded

· Number of available channels

· Frame/buffer size

· Underrun data

· Switching information *

· ctahd

· Channel state

· Maximum frame size

· Duration of voice data in frame packet

· Underrun data

· Switching information *

TRAU_INFO:
Data structure returned synchronously (contains AG TRAU program information).

TRAU_CHN_INFO_DATA:
Array of substructures returned synchronously (contains AG TRAU channel information).

* Switching information is provided only on systems that use AG 2000 or AG 4000 boards.

2.8.1 Retrieving AG TRAU Channel Switching informationTop of Page

Fusion gateway applications need to track AG TRAU program switching information so they can switch voice data from the PSTN to and from attached channels, and (in the case of TX-based Fusion gateways) to and from TX board resources. trauLoad, trauAttach, and trauShowDSPInfo return the following AG TRAU channel switching information:

For more information about creating switch connections with the CT Access Switching service, refer to the Switching Service Developer's Reference Manual.

2.8.2 Retrieving AG TRAU Channel Status InformationTop of Page

trauShowDSPInfo retrieves information about channels on particular AG TRAU programs. trauShowDSPInfo requires a dspid returned by trauLoad as one of its arguments, and returns a TRAU_INFO data structure that contains the following:

The TRAU_CHN_DATA array returns the ctahd, and one of the following state values for each attached AG TRAU channel running on the specified AG TRAU program:
Value

Description

TRAU_CHN_ON_LINE

Channel attached and enabled.

TRAU_CHN_OFF_LINE

Channel attached but not enabled.

TRAU_CHN_DETACHED

Channel not attached.

The following code shows information returned by trauShowDSPInfo for a
TX-based Fusion gateway application (output formatting is provided by the application):

     ======== TRAU INFO ===============
         load hdl  = 80000001
         type      = 1f01
         channels  = 3
         detached #= 0
         Vocoder type is MVIP based: Specific Data follows
         CHANNEL INFO for channel 0
                 state = b....TRAU_CHN_ON_LINE
                 ctahd for this channel = 80010002
         Switching info:
             PCM from DSP       = 28:0
             PCM to DSP         = 29:0
             HDLC Data from DSP = 30:0,1,2,3
             HDLC Data to DSP   = 31:0,1,2,3

         CHANNEL INFO for channel 1
                 state = b....TRAU_CHN_ON_LINE
                 ctahd for this channel = 80020003
         Switching info:
             PCM from DSP       = 28:1
             PCM to DSP         = 29:1
             HDLC Data from DSP = 30:0,1,2,3
             HDLC Data to DSP   = 31:0,1,2,3

         CHANNEL INFO for channel 2
                 state = a....TRAU_CHN_OFF_LINE
                 ctahd for this channel = 80030004
         Switching info:
             PCM from DSP       = 28:2
             PCM to DSP         = 29:2
             HDLC Data from DSP = 30:0,1,2,3
             HDLC Data to DSP   = 31:0,1,2,3

Note: For more sample code, refer to trauexr.c.
The following code shows information returned by trauShowDSPInfo for a Fusion host-based gateway application (output formatting is provided by the application):

======== TRAU INFO ===============
         load hdl  = 80000001
         type      = 4b49
         channels  = 1
         detached #= 0
         Vocoder type is host-based: Specific Data follows
                 frame tic in .25ms increments  = 120
                 frame size in bytes    = 32
                 under run count read  =   0
                 under run count write =   0
         CHANNEL INFO for channel 0
                 state = b....TRAU_CHN_ON_LINE
                 ctahd for this channel = 80020003

2.9 AG TRAU Channel StatesTop of Page

Figure 10 shows AG TRAU channel state transitions as they are visible to applications that process data with AG TRAU programs. You can obtain the current status of an AG TRAU channel by calling trauShowDSPInfo.

chap24.gif

Figure 10. AG TRAU Channel State Diagram

2.10 Processing AG TRAU EventsTop of Page

The following AG TRAU commands return DONE events that provide information about AG TRAU programs and channels.

Use the CT Access function ctaWaitEvent to retrieve AG TRAU events from the CT Access event queue, and trauReleaseBuffer to return event buffers to the AG TRAU event buffer pool.

Note: To receive AG TRAU events, applications must continually read and process the events associated with AG TRAU loadhds. If the application does not release returned event buffers, return information will not be sent when the buffer pool is exhausted.

If the CTA event queue receives events from more than one AG TRAU channel, distinguish events for different channels by checking the event.ctahd field within the retrieved AG TRAU events for specific ctahds. Refer to the CT Access Developer's Reference Manual for more information about processing events.

The following code demonstrates retrieving buffered AG TRAU event information and releasing the buffer:

case TRAUEVN_LOAD_DONE:
{
  if ( event.value == CTA_REASON_FINISHED )
  {
  /* The following code provides examples of 
     how to extract load done buffer speific data with
     the use of tthe load_done_data structure. */
                        
     /* Make sure a buffer is returned with load_data */
      if ( event.size != 0 )
      {
   loaddata = event.buffer;
                            
   type[ total_trau_count ] = loaddata->type;  /* vocoder type */
   trauhd[total_trau_count] = loaddata->dspid; /* dsp identifier */  
   board  =  loaddata->board;   /* brd # 0-n */
   DSP =  loaddata->dsp;     /* DSP used */
   channels =  loaddata->channels;/* # of supported chns */
   frame_tic =  loaddata->frame_tic;
   bufsize  =  loaddata->max_frame_size;
                            
   printf ("TRAU board #       \t= %d\n", board );
   printf ("TRAU channel count \t= %d\n", channels);
   printf ("TRAU dsp used      \t= %d\n", DSP );
   printf ("TRAU dsp id (hex) \t= %x\n", trauhd[total_trau_count]);
   printf ("TRAU vocoder type (hex)\t= %x\n",type[total_trau_count] );
   if ( bufsize != 0 ) 
   {
     puts ("Detected vocoder transmission type is host-based");
     printf (" TRAU frame duration in .25ms tics = %d\n",frame_tic);
     printf (" TRAU Buffer size for each frame   = %d\n",bufsize);
   }
   else
     puts ("Detected vocoder transmission type is MVIP ");
     if ( loaddata->pcm_stream_from_dsp != 0 )
     {











    /* Now print switching information */
    printf ("Switching info:\n");
    printf (" PCM from DSP\t\t= %d:",loaddata->pcm_stream_from_dsp);
    for (index = 0; index < loaddata->pcm_count; index++)
    {
      if ( index != 0 )
     printf(",");
      printf ("%01d",loaddata->pcm_slot[index]);
    }
    printf ("\n");
    printf ("  PCM to DSP\t\t= %d:", loaddata->pcm_stream_to_dsp );
    for (index = 0; index < loaddata->pcm_count; index++)
    {
      if ( index != 0 )
     printf(",");
      printf ("%01d",loaddata->pcm_slot[index]);
    }
    printf ("\n");
    if ( bufsize == 0 ) /* print the output tx side.  */
    {
      printf (" HDLC from DSP\t= %d:",loaddata->tx_stream_from_dsp);
      for (index = 0; index < loaddata->tx_count;index++)
      {
     if ( index != 0 )
       printf(",");
     printf ("%01d",loaddata->tx_slot[index]);
      }
      printf ("\n");
      printf (" HDLC to DSP\t= %d:",loaddata->tx_stream_to_dsp );
      for (index = 0; index < loaddata->tx_count;index++)
      {
     if ( index != 0 )
       printf(",");
     printf ("%01d",loaddata->tx_slot[index]);
      }
      printf ("\n");
    }
     }
     /* We know trauload returns a buffer, so release it.              */   
     trauReleaseBuffer( event.ctahd, event.buffer );

   }
   else
   {
   /* Can't exercise from here since we do not have load 
      data, so abort program with this message               */
      puts("Size is Zero...probably forgot to release buffers\n");
      exit (-1);
   }

2.11 Sending Commands to AG TRAU ProgramsTop of Page

Applications can send AG TRAU programs messages to perform specific types of configuration routines (different types of AG TRAU programs accept different kinds of messages). Use trauSendMsg with a ctahd attached to an AG TRAU channel to convey specific messages, or set parameters for that channel.

When trauSendMsg routines generate response events, the lower byte of the CTA_EVENT.id field shows the message ID passed to trauSendMsg. The value field indicates the success or failure of the command, or any return information resulting from the command. Response events also return the ctahd of the channel that received the message.

The following code sample shows code that produces the text for a trauSendMsg return event where the EVENT.ID value is 0x000A210A:

 ctaGetText(event.ctahd, event.id, text, sizeof(text) );
 printf ("\t\t EVENT: %s\n",text );

The code above prints the following message:

 EVENT: TRAUEVN_SNDMSG_DONE_0A

Note: Messages are vocoder specific. Refer to the appropriate .h file for more information.
The AG TRAU service supports trauSendMsg routines that perform the following tasks:

trauSendMsg routines are vocoder specific. Refer to Appendix C file for a list of valid trauSendMsg routines and messages for various AG TRAU programs.



Table of Contents Index NMS Glossary Previous Page Next Page Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights reserved.