
Description | Termination Events | Cautions | Example | Errors | See Also
Name: |
int cc_DropCall(crn, cause, mode) | |
Inputs: |
CRN crn |
|
int cause |
| |
unsigned long mode |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Call control | |
Mode: |
synchronous or asynchronous | |
Technology: |
BRI/2; BRI/SC; PRI (all protocols) | |
The cc_DropCall( ) function allows the application to disconnect a call, specified by a CRN, at any time. The application must specify a reason for dropping the call. Valid causes are listed in Table 18.
Parameter |
Description |
crn: |
The call reference number. Each call needs a CRN. |
cause: |
The reason for disconnecting or rejecting the call. The values listed in Table 18 indicate common causes for dropping a call. |
mode: |
Specifies asynchronous (EV_ASYNC) or synchronous (EV_SYNC) mode. |
Table 18. cc_DropCall( ) Causes
Value |
Description |
ACCESS_INFO_DISCARDED |
Access information discarded |
BAD_INFO_ELEM |
Information element nonexistent or not implemented |
BEAR_CAP_NOT_AVAIL |
Bearer capability not available |
CALL_REJECTED |
Call rejected |
CAP_NOT_IMPLEMENTED |
Bearer capability not implemented |
CHAN_DOES_NOT_EXIST |
Channel does not exist |
CHAN_NOT_IMPLEMENTED |
Channel type not implemented |
CHANNEL_UNACCEPTABLE |
Channel is unacceptable |
DEST_OUT_OF_ORDER |
Destination out of order |
FACILITY_NOT_IMPLEMENT |
Requested facility not implemented |
FACILITY_NOT_SUBSCRIBED |
Facility not subscribed |
FACILITY_REJECTED |
Facility rejected |
INCOMPATIBLE_DEST |
Incompatible destination |
INCOMING_CALL_BARRED |
Incoming call barred |
INTERWORKING_UNSPEC |
Interworking unspecified |
INVALID_CALL_REF |
Invalid call reference |
INVALID_ELEM_CONTENTS |
Invalid information element |
INVALID_MSG_UNSPEC |
Invalid message, unspecified |
INVALID_NUMBER_FORMAT |
Invalid number format |
MANDATORY_IE_LEN_ERR |
Message received with mandatory information element of incorrect length |
MANDATORY_IE_MISSING |
Mandatory information element missing |
NETWORK_CONGESTION |
Network congestion |
NETWORK_OUT_OF_ORDER |
Network out of order |
NO_CIRCUIT_AVAILABLE |
No circuit available |
NONEXISTENT_MSG |
Message type nonexistent or not implemented |
NORMAL_CLEARING |
Normal clearing |
NO_ROUTE |
Network has no route to the specified transient network, or the network has no route to the destination. |
NO_USER_RESPONDING |
No user responding |
NUMBER_CHANGED |
Number changed |
OUTGOING_CALL_BARRED |
Outgoing call barred |
PRE_EMPTED |
Call preempted |
PROTOCOL_ERROR |
Protocol error, unspecified |
REQ_CHANNEL_NOT_AVAIL |
Requested circuit/channel unavailable |
RESP_TO_STAT_ENQ |
Response to status inquiry |
SERVICE_NOT_AVAIL |
Service not available |
TEMPORARY_FAILURE |
Temporary failure |
TIMER_EXPIRY |
Recovery on timer expired |
UNASSIGNED_NUMBER |
Unassigned number |
UNSPECIFIED_CAUSE |
Unspecified cause |
USER_BUSY |
User busy |
WRONG_MESSAGE |
Message type invalid in call state or not implemented |
WRONG_MSG_FOR_STATE |
Message type not compatible with call state |
In order to release the call reference number, this function must be followed by a cc_ReleaseCall( ) to prevent a blocking condition or memory allocation errors.
#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);
}
printf("Waiting for call\n");
if ( cc_WaitCall(devhdl, &crn, NULL, -1, EV_SYNC) < 0 )
procdevfail(devhdl);
if ( cc_AnswerCall(crn, 0, EV_SYNC) < 0 )
callfail(crn);
.
.
.
.
.
/* Drop the call */
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 < 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_DropCall( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISBADIF |
Bad interface number |
ERR_ISDN_LIB | E_ISBADCALLID |
Bad call identifier |
ERR_ISDN_LIB | E_ISBADTS |
Bad time slot |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation