gc_GetBilling( )
Termination Events | Cautions | Errors | Example | See Also
Name: int gc_GetBilling(crn, billing_buf) Inputs: Returns: Includes: Category: Mode: Platform and Technology: †See the Global Call Technology User's Guides for additional information.
Description
The gc_GetBilling( ) function retrieves the billing information associated with the specified call. The charge information is in ASCII string format. The information is retrieved from the Global Call software.
The gc_GetBilling( ) function is used only in ISDN applications that use AT&T's Vari-A-Bill service. See also the appropriate Global Call Technology User's Guide for technology-specific information.
crn call reference number billing_buf address of the buffer where the requested information is stored. See the appropriate Global Call Technology User's Guide for the format and usage of this field. Termination Events
Cautions
- Ensure that the billing_buf buffer is large enough to store the greatest expected amount of billing information, which is defined by GC_BILLSIZE.
- 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
/* * Assume the following has been done: * 1. device was 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_GetMetaEvent() 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 connected. * 6. the call has been disconnected after conversation. */ #include <stdio.h> #include <srllib.h> #include <gclib.h> #include <gcerr.h> #include <gcisdn.h> /* The gc_GetBilling( ) function is exclusively used for the AT&T Vari-A-Bill service. */ int get_billing_info(CRN crn, char *billing_buffer) { 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_GetBilling(crn, billing_buffer) != GC_SUCCESS) { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_GetBilling() 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); } return(0); }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation