
Description | Termination Event | Cautions | Example | Errors | See Also
Name: |
int cc_CallAck(crn, newLineDev, msg_id) | |
Inputs: |
CRN crn |
|
LINEDEV newLineDev |
| |
int msg_id |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Optional call handling | |
Mode: |
asynchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_CallAck( ) function allows the application to send the first response to an incoming call, after the CCEV_OFFERED event is received, in asynchronous mode, or after cc_WaitCall( ) returns, in synchronous mode.
Parameter |
Description |
crn: |
The call reference number. Each call needs a valid CRN. |
newLineDev: |
The new line device handle for the channel to be used for the call. This parameter is reserved for future use. Set newLineDev to 0. |
msg_id: |
The message ID, either CALL_PROCEEDING or CALL_SETUP_ACK.
|
The application can use this function to indicate one of the following conditions to the network:
None
#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";
if ( cc_Open( &devhdl, devname, 0 ) < 0 )
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
if ( cc_WaitCall(devhdl, &crn, NULL, -1, EV_SYNC) < 0 )
procdevfail(devhdl);
/*
* The cc_CallAck() function needs to be called after
* cc_WaitCall and before cc_CallProgress(), cc_AcceptCall()
* and cc_AnswerCall()
*/
if ( cc_CallAck(crn,0,CALL_PROCEEDING) < 0 )
callfail(crn);
printf("Accepting call\n");
if ( cc_AcceptCall(crn, 0, EV_SYNC) < 0 )
callfail(crn);
if ( cc_AnswerCall(crn, 0, EV_SYNC) < 0 )
callfail(crn);
.
.
.
.
.
if ( cc_DropCall(crn, NORMAL_CLEARING, EV_SYNC) < 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 a value < 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_CallAck( ) function include the following:
Error Code |
Description |
E_ISBADIF | ERR_ISDN_LIB |
Bad interface number |
E_ISBADTS | ERR_ISDN_LIB |
Bad time slot |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation