
Description | Termination Events | Cautions | Example | Errors | See Also
Name: |
int cc_RetrieveCall(crn, mode) | |
Inputs: |
CRN crn |
|
unsigned long mode |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Hold and Retrieve | |
Mode: |
synchronous or asynchronous | |
Technology: |
BRI/2; BRI/SC; PRI (DPNSS and Q.SIG only) | |
The cc_RetrieveCall( ) function allows the application to retrieve a call from the Hold state. The call must be in the Hold state to use this function.
Parameter |
Description |
crn: |
The call reference number. Each call needs a CRN. |
mode: |
Specifies synchronous (EV_SYNC) or asynchronous (EV_ASYNC) mode. |
The cc_RetrieveCall( ) function can only be used when the call is in Hold state.
#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 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_RetrieveCall( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ABORTED |
Task aborted by 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