
Description | Cautions | Example | Errors | See Also
Name: |
int cc_HoldAck(crn) | |
Inputs: |
CRN crn |
|
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Hold and Retrieve | |
Mode: |
synchronous | |
Technology: |
BRI/2; BRI/SC; PRI (DPNSS and Q.SIG only) | |
The cc_HoldAck( ) function allows the application to accept a hold request from remote equipment. This function is called only after the call is in the Connected state and after the CCEV_HOLDCALL event is received. See Section 7.1. Event Categories for information on CCEV_HOLDCALL.
Parameter |
Description |
crn: |
The call reference number. Each call needs a CRN. |
A call must be in the Connected state and the CCEV_HOLDCALL event must be received before the cc_HoldAck( ) function is invoked or the function will fail.
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include <srllib.h>
#include <dtilib.h>
#include <cclib.h>
main()
{
char *devname = "dtiB1T1";
LINEDEV ldev;
.
.
.
.
if ( cc_Open( &ldev, devname, 0 ) < 0 )
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
if ( sr_enbhdlr( ldev,CCEV_HOLDCALL,HoldCallHdlr ) < 0 )
{
printf( "dtiEnable for HoldCallHdlr failed: %s\n",
ATDV_ERRMSGP( SRL_DEVICE ) );
return( 1 );
}
.
.
.
.
while (1)
{
/* wait for network event */
sr_waitevt(-1);
}
cc_Close(ldev);
}
/***************************************************/
/* HoldCallHdlr - accept the hold call request */
/***************************************************/
int HoldCallHdlr( )
{
CRN crn_buf;
int ldev = sr_getevtdev();
int len = sr_getevtlen();
vod *ev_datap = sr_getevtdatap();
cc_GetCRN(&crn_buf, ev_datap);
if ( cc_HoldAck( crn_buf ) < 0 )
procdevfail(ldev);
return( 0 );
}
int procdevfail(LINEDEV ldev)
{
int reason;
char *msg;
reason = cc_CauseValue(ldev);
cc_ResultMsg(ldev,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_HoldAck( ) function include the following:
Error Code |
Description |
ERR_ISDN_FW | ISDN_BADSTATE |
Cannot accept event in current state |
ERR_ISDN_LIB | E_ISNULL_PTR |
Null pointer error |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation