
Description | Cautions | Example | Errors | See Also
Name: |
int cc_GetBilling(crn, billing_buf) | |
Inputs: |
CRN crn |
|
char *billing_buf |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Optional call handling | |
Mode: |
synchronous | |
Technology: |
PRI (4ESS only) | |
The cc_GetBilling( ) function gets the call charge information associated with the specified call. The billing information is in a NULL terminated ASCII string. The information is retrieved from the network.
Parameter |
Description |
crn: |
The call reference number. Each call needs a CRN. |
billing_buf: |
Pointer to the buffer where the billing string will be stored. Use CC_BILLSIZE to define the buffer size. |
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
void main()
{
LINEDEV devhdl = 0;
CRN crn = 0;
char *devname = "dtiB1T1";
char billingbuf[CC_BILLSIZE];
if ( cc_Open( &devhdl, devname, 0 ) < 0 )
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
printf("Making call\n");
if ( cc_MakeCall(devhdl,&crn,"9933000",NULL,30,EV_SYNC) < 0 )
procdevfail(devhdl);
.
.
.
.
.
/* Drop the call */
if ( cc_DropCall(crn, NORMAL_CLEARING, EV_SYNC) < 0 )
callfail(crn);
/*
Using cc_ GetBilling(crn,billingbuf)to
retrieve the call charge information.
Note that not every network supports this feature
*/
if ( cc_GetBilling(crn,billingbuf) < 0 )
callfail(crn);
if ( cc_ReleaseCall(crn) < 0 )
callfail(crn);
if ( cc_Close( devhdl ) < 0 )
printf("Error closing device, errno = %d\n", errno);
}
int callfail(CRN crn)
{
LINEDEV ld;
cc_CRN2LineDev(crn,&ld);
procdevfail(ld);
}
int procdevfail(LINEDEV handle)
{
int reason;
char *msg;
reason = cc_CauseValue(handle);
cc_ResultMsg(handle,reason,&msg);
printf("reason = %x - %s\n",reason,msg);
}
If the function returns < 0 to indicate failure, use the cc_CauseValue( ) function to retrieve the reason code for the failure. The cc_ResultMsg( ) function can be used to interpret the reason code. Error codes are defined in the files ccerr.h, isdnerr.h, and isdncmd.h.
Error codes from the cc_GetBilling( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISBADCRN |
Bad call reference number |
ERR_ISDN_LIB | E_ISBADPAR |
Bad input parameter |
ERR_ISDN_LIB | E_ISNOINFOBUF |
Information buffer not ready |
None
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation