PREV TOC HOME INDEX NEXT


gc_GetResourceH( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_GetResourceH(linedev, resourcehp, resourcetype)
Inputs:

LINEDEV linedev

  • Global Call line device handle
 

int *resourcehp

  • pointer to returned resource device handle
 

int resourcetype

  • type of resource
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

voice and media, system controls and tools

Mode:

synchronous

Platform and Technology:

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

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

IP (host-based stack and embedded stack)

See the Global Call Technology User's Guides for additional information.

Description

The gc_GetResourceH( ) function retrieves the resource device handle associated with the specified line device, linedev. The *resourcehp parameter is actually the SRL handle of the resource associated with the line device.

If the linedev parameter is not an IP media Global Call line device, the resource to be retrieved can be a network, voice, or media device, as determined by the resourcetype parameter.

If the linedev parameter is an IP media Global Call line device, the resource that is retrieved is the Global Call line device to which the media handle is attached, as determined by a resourcetype parameter with a value of GC_NET_GCLINEDEVICE.

Parameter

Description

linedev Global Call line device handle. This can be one of the following types:
  • A non-IP media Global Call line device handle
  • An IP media Global Call line device handle
resourcehp address at which the associated resource device handle will be stored
resourcetype type of resource. Possible values are:
  • GC_NETWORKDEVICE
  • GC_VOICEDEVICE
  • GC_MEDIADEVICE
  • GC_NET_GCLINEDEVICE (only valid if the linedev parameter is an IP media Global Call line device handle)

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_GetResourceH(ldev, voicehp, GC_VOICEDEVICE) == 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_GetResourceH() 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