PREV TOC HOME INDEX NEXT


gc_GetNetworkH( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_GetNetworkH(linedev, networkhp)
Inputs:

LINEDEV linedev

  • Global Call line device handle
 

int *networkhp

  • pointer to returned network device handle
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

system controls and tools

Mode:

synchronous

Platform and Technology:

Springware: T-1/E-1, ISDN

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

SS7

IP (embedded stack)

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

Description

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

The gc_GetNetworkH( ) function retrieves the network device handle associated with the specified linedev line device. The *networkhp parameter is actually the SRL device handle of the network resource associated with the line device. The *networkhp parameter can be used as an input to functions requiring a network handle, such as the SCbus routing function nr_scroute( ).

See also the appropriate Global Call Technology User's Guide for technology-specific information.

Parameter

Description

linedev Global Call line device handle
networkhp points to the address where the network device handle is to 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 (ldev) has been opened, specifying a
 *          network time slot and a protocol
 *          For example, 'devicename' could be ":N_dtiB1T1:P_br_r2_i".
 */
int route_fax_to_gc(LINEDEV ldev, int faxh)
{
    GC_INFO        gc_error_info;    /* GlobalCall error information data */
    int            networkh;         /* network device handle */ 
    if (gc_GetNetworkH(ldev, &networkh) == GC_SUCCESS) {
       /*
        * Route the fax resource to the network device in
        * a full duplex manner.
        */
        if (nr_scroute(networkh,SC_DTI,faxh,SC_FAX,SC_FULLDUP) == -1) {
          /* process error */
        }
        else {
           /* proceed with the fax call */
        } 
    } else {
        /* process error return as shown */
        gc_ErrorInfo( &gc_error_info );
        printf ("Error: gc_GetNetworkH() 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); 
    }
    /*
     * Application may now generate or wait for a call on this line
     * device.
     */
    return (0);
} 

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