PREV TOC HOME INDEX NEXT


gc_RespService( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_RespService(target_type, target_ID, datap, mode)
Inputs:

int target_type

  • type of target object
 

long target_ID

  • ID of target object
 

GC_PARM_BLKP datap

  • pointer to data associated with the response
 

unsigned long mode

  • async or sync
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

Global Call Service Request (GCSR)

Mode:

asynchronous or synchronous

Platform and Technology:

Springware: ISDN BRI

IP (host-based stack)

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

Description

The gc_RespService( ) function generates a response to a requested service. Notification of a request is indicated by the reception of a GCEV_SERVICEREQ event. The extevtdatap field of the event contains a pointer to a GC_PARM_BLK that contains an unsigned long value that is the Service ID associated with the event.

For more information about the gc_RespService( ) function, see the discussion of the Global Call Service Request (GCSR) feature in the Global Call API Programming Guide.

Parameter

Description

target_type target object type. Valid values are:
  • GCTGT_GCLIB_CHAN
  • GCTGT_GCLIB_CRN
target_id target object identifier. This identifier, along with target_type, uniquely specifies the target object. Valid identifiers are:
  • line device handle
  • call reference number
datap points to data associated with the response; contains user-specified values
mode set to EV_ASYNC for asynchronous execution or to EV_SYNC for synchronous execution

Termination Events

GCEV_SERVICERESPCMPLT
indicates that a response has been successfully generated
GCEV_TASKFAIL
indicates that the function failed
Note: The extevtdatap field of these events contains a pointer to a GC_PARM_BLK that contains an unsigned long value that is the Service ID associated with the event. This pointer is only valid until the next gc_GetMetaEvent( ) or gc_GetMetaEventEx( ) is called. See the appropriate Global Call Technology User's Guide for technology-specific information.

Cautions

Errors

If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function for error information. If the GCEV_TASKFAIL event is received, use the gc_ResultInfo( ) function to retrieve information about the event. 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 "gclib.h" 
void main( ) 
{
    LINEDEV         devh;
    unsigned long   serviceID;
    GC_PARM_BLKP    datap = NULL;
    GC_INFO         gc_error_info;   /* GlobalCall error information data */ 
    /* Following code assumes that:
     * 1. gc_OpenEx has been done with handle = devh
     * 2. a GCEV_SERVREQ event has been received and processed, with serviceID
     *    set to the appropriate value
     * / 
    /* Set up GC_PARM_BLK for reply */
    if ( gc_util_insert_parm_ref( &datap, GCSET_SERVREQ, PARM_SERVICEID,
         sizeof( unsigned long ), &serviceID ) != GC_SUCCESS )
    {
        /* Process error */
    }
    if ( gc_util_insert_parm_val( &datap, GCSET_SERVREQ, PARM_REQTYPE,
         sizeof( int ), 0 ) != GC_SUCCESS )
    {
        /* Process error */
    }
    if ( gc_util_insert_parm_val( &datap, GCSET_SERVREQ, PARM_ACK,
         sizeof( short ), GC_ACK ) != GC_SUCCESS )
    {
        /* Process error */
    }
    /* Insert any other technology-dependent parameters */ 
    if ( gc_RespService( GCTGT_GCLIB_CHAN, devh, datap, EV_SYNC ) != GC_SUCCESS )
    {
        /* Process error */
         /* Process error */
         gc_ErrorInfo( &gc_error_info );
         printf ("Error: gc_RespService() on device handle: 0x%lx, GC ErrorValue: 0x%hx - %s, 
                 CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n",
                 devh, gc_error_info.gcValue, gc_error_info.gcMsg, 
                 gc_error_info.ccLibId, gc_error_info.ccLibName,
                 gc_error_info.ccValue, gc_error_info.ccMsg);
    } 
    /* Delete GC_PARM_BLK */
    gc_util_delete_parm_blk( datap );
} 

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