
Description | Caution | Example | Errors | See Also
Name: |
int cc_SetCallingNum(linedev, callingnum) | |
Inputs: |
LINEDEV linedev |
|
char *callingnum |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Optional call handling | |
Mode: |
synchronous | |
Technology: |
BRI/SC; PRI (all protocols) | |
The cc_SetCallingNum( ) function sets the default calling party number (caller ID) associated with the specific channel (line device) handle. The calling party number is contained in a NULL terminated ASCII string.
The calling party number may also be set in the cc_MakeCall( ) function. When the calling party number is specified in the MAKECALL_BLK structure, then the cc_MakeCall( ) function uses the number in the structure for the current call. Subsequent calls return to the default calling party number set by the cc_SetCallingNum( ) function when the MAKECALL_BLK structure is not used.
Parameter |
Description |
linedev: |
The line device handle. |
callingnum: |
The phone number of the calling party. |
This function is not supported for the BRI/2 board.
#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);
}
/*
* Using cc_SetCallingNum(devhndl, "9933000") to
* set default calling party number
*/
if ( cc_SetCallingNum(devhdl, "9933000") < 0 )
procdevfail(devhdl);
if ( cc_MakeCall(devhdl, &crn, "9933000", NULL, 30, EV_SYNC) < 0 )
procdevfail(devhdl);
.
.
.
.
.
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_SetCallingNum( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISBADTS |
Bad time slot |
ERR_ISDN_LIB | E_ISBADIF |
Bad interface number |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation