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.
Termination Events
- GCEV_EXTENSION with ext_id GCIS_EXEV_PLAYTONE - indicates that the tone was successfully played.
- GCEV_EXTENSION with ext_id GCIS_EXEV_PLAYTONEFAIL - indicates that the request to play a tone failed.
- 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; }
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation