PREV TOC HOME INDEX NEXT


gc_SndMsg( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_SndMsg(linedev, crn, msg_type, sndmsgptr)
Inputs:

LINEDEV linedev

  • line device number for the B channel
 

CRN crn

  • call reference number
 

int msg_type

  • ISDN message type
 

GC_IE_BLK *sndmsgptr

  • pointer to the Information Element (IE) block
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

interface specific (deprecated)

Mode:

synchronous

Platform and Technology:

Springware: ISDN

DM3: ISDN

SS7

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

Description

Note: The gc_SndMsg( ) function is deprecated in this software release. The suggested equivalent is gc_Extension( ).

The gc_SndMsg( ) function sends non-call state related ISDN messages to the network over the D channel while a call exists. The data is sent transparently over the D channel data link with LAPD protocol.

Note: The message must be sent over a channel that has a call reference number (CRN) assigned to it.

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

Parameter

Description

linedev line device number for the time slot level line device (the B channel)
crn call reference number
msg_type specifies the type of message to be sent. See the appropriate Global Call Technology User's Guide for details.
sndmsgptr points to the buffer containing the IEs to be sent in the message. See GC_IE_BLK for data structure details.

Termination Events

None

Cautions

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

/*
 * Assume the following has been done:
 * 1. device has been opened (e.g. :N_dtiB1T1:P_isdn, 
 *    :N_dtiB1T2:P_isdn, etc...)
 * 2. gc_WaitCall() has been issued to wait for a call.
 * 3. gc_MetaEvent() or gc_GetMetaEventEx() (Windows) has been 
 *    called to convert the event into metaevent.
 * 4. a GCEV_OFFERED has been detected.
 * 5. a call has been established.
 */ 
#include <stdio.h>
#include <srllib.h>
#include <gclib.h>
#include <gcerr.h>
#include <gcisdn.h> 
/*
 * the following ISDN info elem block structure can be passed to the function
   via the GC_IE_BLK structure).
 *    IE_BLK ie;
 *    ie.length = 0x08;       ===> Length of the info elem block.
 *    ie.data[0] = 0x7e;      ===> User-User Info elem id.
 *    ie.data[1] = 0x06;      ===> Length of the info elem.
 *    ie.data[2] = 0x08;      ===> Protocol Discriminator.      
 *    ie.data[3] = 0x41;      ===> the following is the message.
 *    ie.data[4] = 0x42;
 *    ie.data[5] = 0x43;
 *    ie.data[6] = 0x44;
 *    ie.data[7] = 0x45;
 */ 
int send_message(CRN crn, int msg_type, GC_IE_BLK *sndmsgp)
{
    LINEDEV  ldev;            /* Line device */
    GC_INFO  gc_error_info;   /* GlobalCall error information data */ 
    if(gc_CRN2LineDev(crn, &ldev) != GC_SUCCESS) {
        /* process error return as shown */
        gc_ErrorInfo( &gc_error_info );
        printf ("Error: gc_CRN2LineDev() on crn: 0x%lx, GC ErrorValue: 0x%hx - %s, 
                CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n",
                crn, 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); 
    }
    if(gc_SndMsg(ldev, crn, msg_type, sndmsgp) != GC_SUCCESS) {
        gc_ErrorInfo( &gc_error_info );
        printf ("Error: gc_SndMsg() on device handle: 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);
    }
    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