
Description | Termination Events | Cautions | Example | Errors | See Also
Name: |
int cc_HoldCall(crn, mode) | |
Inputs: |
CRN crn |
|
unsigned long mode |
| |
Returns: |
0 on success <0 on failure | |
Includes: |
cclib.h | |
Category: |
Hold and Retrieve | |
Mode: |
synchronous or asynchronous | |
Technology: |
BRI/2; BRI/SC; PRI (DPNSS and Q.SIG only) | |
The cc_HoldCall( ) function allows the application to place an active call on hold. For PRI protocols and for BRI Network-side, the call must be in the Connected state to be put on hold. For BRI User-side, the call can be put on hold any time after the CCEV_PROCEEDING message is received.
Parameter |
Description |
crn: |
The call reference number. Each call needs a CRN. |
mode: |
Specifies synchronous (EV_SYNC) or asynchronous (EV_ASYNC) mode. |
In synchronous mode, the CCEV_TASKFAIL event is returned if the function fails.
For PRI protocols and BRI Network-side, the cc_HoldCall( ) function is valid only when the call is in the Connected state. For BRI User-side, the function can be called any time after the CCEV_PROCEEDING message is received.
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include <memory.h>
#include <srllib.h>
#include <dtilib.h>
#include <cclib.h>
void main()
{
LINEDEV ldev;
CRN crn_buf = 0;
char *devname = "dtiB1T1";
if ( cc_Open( &ldev, devname, 0 ) < 0 )
{
printf("Error opening device: errno = %d\n", errno);
exit(1);
}
printf("Waiting for call\n");
if ( cc_WaitCall(ldev, &crn_buf, NULL, -1, EV_SYNC) < 0 )
{
procdevfail(ldev);
.
}
if ( cc_AnswerCall(crn_buf, 0, EV_SYNC) < 0 )
{
procdevfail(ldev);
.
}
.
.
if ( cc_HoldCall(crn_buf, EV_SYNC) < 0 )
{
procdevfail(ldev);
.
}
.
.
if ( cc_RetrieveCall(crn_buf, EV_SYNC) < 0 )
{
procdevfail(ldev);
.
}
.
.
/* Drop the call */
if ( cc_DropCall(crn_buf, NORMAL_CLEARING, EV_SYNC) < 0 )
{
procdevfail(ldev);
.
}
if ( cc_ReleaseCall(crn_buf) < 0 )
{
procdevfail(ldev);
.
}
/* Close the device */
if ( cc_Close( ldev ) < 0 )
printf("Error closing device, errno = %d\n", errno);
}
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_HoldCall( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ABORTED |
Task aborted by the cc_Restart( ) function |
ERR_ISDN_LIB | E_BADSTATE |
The cc_Restart( ) function is in progress |
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