gc_SndMsg( )
Termination Events | Cautions | Errors | Example | See Also
Name: int gc_SndMsg(linedev, crn, msg_type, sndmsgptr) Inputs: Returns: Includes: Category: Mode: Platform and Technology: †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.
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
Cautions
- If this function is invoked for an unsupported technology, the function will fail. The error value EGC_UNSUPPORTED will be the Global Call value returned when the gc_ErrorInfo( ) function is used to retrieve the error code.
- For some call control libraries (for example, the ISDN library), if an invalid parameter is used for a gc_SndMsg( ) call, the invalid parameter is ignored, processing continues, and the function terminates normally.
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
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation