PREV TOC HOME INDEX NEXT


gc_GetVoiceH( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_GetVoiceH(linedev, voicehp)
Inputs:

LINEDEV linedev

  • Global Call line device handle
 

int *voicehp

  • pointer to returned voice device handle
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

voice and media

Mode:

synchronous

Platform and Technology:

Springware: T-1/E-1, ISDN, Analog

DM3: T-1/E-1, ISDN, Analog

SS7

IP (embedded stack)

Description

Note: For technologies that support the gc_GetResourceH( ) function, it is recommended that the gc_GetResourceH( ) function be used instead of the gc_GetVoiceH( ) function to retrieve the voice device handle. See the gc_GetResourceH( ) function description for more information.

The gc_GetVoiceH( ) function retrieves the voice device handle associated with the specified line device, linedev. The *voicehp parameter is actually the SRL handle of the voice resource associated with the line device. The *voicehp parameter can be used as an input to functions requiring a voice handle, such as the voice library's dx_play( ) function.

Parameter

Description

linedev Global Call line device handle
voicehp address at which the device handle of the voice resource associated with the Global Call line device, linedev, will be stored

Termination Events

None

Cautions

If this function is invoked for an unsupported technology, the function fails. The error value EGC_UNSUPPORTED will be the Global Call value returned when the gc_ErrorInfo( ) function is used to retrieve the error code.

Errors

If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function to retrieve the reason for the error. See the "Error Handling" section in the Global Call API Programming Guide. All Global Call error codes are defined in the gcerr.h file. If the error returned is technology specific, see the technology-specific error header file(s) for the error definition (for example, ccerr.h or isdnerr.h file for the ISDN call control library).

Example

#include <stdio.h>
#include <srllib.h>
#include <gclib.h>
#include <gcerr.h> 
/*
 * Assume the following has been done:
 *    1. A line device has been opened specifying voice resource
 *    2. A call associated with ldev is in the connected state
 */
int get_voice_handle(LINEDEV ldev, int *voicehp)
{
    GC_INFO        gc_error_info;    /* GlobalCall error information data */ 
    if (gc_GetVoiceH(ldev, voicehp) == GC_SUCCESS) {
       /*
        * Application may now perform voice processing (e.g., play a prompt)
        * using the voice handle.
        */
       return(0);
    } else {
        /* process error return as shown */
        gc_ErrorInfo( &gc_error_info );
        printf ("Error: gc_GetVoiceH() on linedev: 0x%lx, GC ErrorValue: 0x%hx - %s, 
                 CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n",
                 ldev, gc_error_info.gcValue, gc_error_info.gcMsg, 
                 gc_error_info.ccLibId, gc_error_info.ccLibName,
                 gc_error_info.ccValue, gc_error_info.ccMsg);
        return (gc_error_info.gcValue);
    }
} 

See Also


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

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