PREV TOC HOME INDEX NEXT


1.7.9. Play a User-Defined Tone

The GCIS_EXID_PLAYTONE extension ID is supported when using Springware boards only. When using DM3 boards, the GCIS_EXID_PLAYTONE extension ID is not supported.

The GCIS_EXID_PLAYTONE extension ID allows the application to play a user-defined tone.

The following table provides the parameter inputs for the gc_Extension( ) function.

Parameter

Input

target_type

GCTGT_GCLIB_CHAN

target_id

line device handle of the device
ext_id GCIS_EXID_PLAYTONE

parmblkp

set_id - GCIS_SET_TONE

parm_id - GCIS_PARM_TONE_DURATION


values - range is 1 to 65535. Set to -1 to play forever


value_type - unsigned short


parm_id - GCIS_PARM_TONE_FREQ1 -


values - range is 200 to 3100 Hz.


value_type - unsigned short


parm_id - GCIS_PARM_TONE_AMP1


values - range is -40 to +3 dB


value_type - short


parm_id - GCIS_PARM_TONE_FREQ2-


values - range is 200 to 3100 Hz


value_type - unsigned short


parm_id - GCIS_PARM_TONE_AMP2


values - range is -40 - +3 dB.


value_type - short


parm_id - GCIS_PARM_TONE_ON1


values - 1 to 65535 ms. Set to 1 or greater for continuous tone.


value_type - unsigned short


parm_id - GCIS_PARM_TONE_OFF1


values - range is 0 to 65534 ms. Set to 0 to play a continuous tone.


value_type - unsigned short

mode EV_SYNC, EV_ASYNC

Termination Events

Note: The channel must be in the IDLE state when calling this function. This command is a host tone command that allows the application to play a user-defined tone. This command cannot be used to set or play the firmware-applied call progress tones. The call progress tones and user-defined tones operate independently, except that when the firmware is playing a tone, the application may not play a tone on the same channel at the same time. For information on changing the firmware-applied call progress tones, see the GCIS_EXID_TONEREDEFINE extension ID description.

This extension ID is not supported for the BRI/2 board or for PRI protocols.

Example

int extPlayTone (LINEDEV handle)
{
         GC_PARM_BLKP parm_blkp = NULL, ret_blkp = NULL;
         unsigned long mode;
         int ret_val = 0;
         GC_INFO  t_Info;
         short stmp3;
         unsigned short ustmp4; 
         ustmp4 = 400;
         gc_util_insert_parm_ref(&parm_blkp, GCIS_SET_TONE,
                 GCIS_PARM_TONE_DURATION, sizeof( unsigned short ), &ustmp4);
         ustmp4 = (unsigned short)350;
         gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_TONE,				
                 GCIS_PARM_TONE_FREQ1, sizeof( unsigned short ), ustmp4); 
         stmp3 = (short)-10;
         gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_TONE, GCIS_PARM_TONE_AMP1,
                 sizeof( short ), &stmp3); 
         ustmp4 = (unsigned short)460;
         gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_TONE,
                 GCIS_PARM_TONE_FREQ2, sizeof( unsigned short ), &ustmp4); 
         stmp3 = (short)-10;
         gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_TONE,
                 GCIS_PARM_TONE_AMP2, sizeof( short ), &stmp3); 
         ustmp4 = (unsigned short)400; 
         gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_TONE,
                 GCIS_PARM_TONE_ON1, sizeof( unsigned short ), &ustmp4); 
         ustmp4 = (unsigned short)0;
         gc_util_insert_parm_ref( &parm_blkp, GCIS_SET_TONE,
                 GCIS_PARM_TONE_OFF1, sizeof( unsigned short ), &ustmp4); 
         mode = EV_SYNC 
         ret_val = gc_Extension( GCTGT_GCLIB_CHAN, handle
                   GCIS_EXID_PLAYTONE, parm_blkp, &ret_blkp, mode);
         if ( ret_val )
         {
                ret_val = gc_ErrorInfo(&t_Info);
                if (ret_val == GC_SUCCESS) {
                         printf("gc_ErrorInfo() successfully called\n");
                         PrintGC_INFO(&t_Info);
                } else {
                         printf("gc_ErrorInfo() call failed\n");
                }
         }  
        	 	gc_util_delete_parm_blk( ret_blkp );
         gc_util_delete_parm_blk( parm_blkp );
         return ret_val;
} 

PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated January, 2003