
Description | Termination Event | Cautions | Example | Errors | See Also
Name: |
int cc_GetMoreDigits(crn, numofdigs, timeout, mode) | |
Inputs: |
CRN crn |
|
int numofdigs |
| |
long timeout |
| |
unsigned long mode |
| |
Returns: |
0 on success | |
Includes: |
cclib.h | |
Category: |
Call control | |
Mode: |
asynchronous or synchronous | |
Technology: |
PRI (excluding DPNSS) | |
The cc_GetMoreDigits( ) function collects more digits via overlap receiving. After an incoming call is received, the application examines the completeness of the destination address. If more digits are needed, the application calls the cc_GetMoreDigits( ) function with the number of additional digits to be collected. The function is returned when all requested digits are collected.
The collected digits can be retrieved by calling the cc_GetDNIS( ) function. When enough digits have been collected, the application must use the cc_CallAck( ) function to acknowledge the setup message.
Parameter |
Description |
crn: |
The call reference number. Each call needs a valid CRN. |
numofdigs: |
The number of digits to be collected. |
timeout: |
Specifies the amount of time in seconds in which the additional digits must be collected. The function returns unconditionally when the timer expires. The timeout parameter is used to prevent a blocked situation in which the application expects more digits than the network provides. The timeout value must be a non-zero positive value. (A value < 0 means that the additional digits can be collected "forever.")
|
mode: |
Specifies either asynchronous (EV_ASYNC) or synchronous (EV_SYNC) mode. |
This function is not supported for the PRI DPNSS protocol.
#include <windows.h> /* For Windows applications only */
#include <stdio.h>
#include <errno.h>
#include "srllib.h"
#include "dtilib.h"
#include "cclib.h"
#define MIN_DNIS 4
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);
}
if ( cc_WaitCall(devhdl, &crn, NULL, -1, EV_SYNC) < 0 )
procdevfail(devhdl);
if ( cc_GetDNIS(crn, dnis_buf) < 0 )
callfail(crn);
/*
* The cc_GetMoreDigits() function can only be called
* after the cc_WaitCall and before cc_CallProgress(),
* cc_AcceptCall() and cc_AnswerCall().
*/
if ( (more_digits = (MIN_DNIS - strlen(dnis_buf) ) > 0)
if ( cc_GetMoreDigits(crn, more_digits, time_out, EV_SYNC) < 0 )
callfail(crn);
printf("Accepting call\n");
if ( cc_AcceptCall(crn, 0, EV_SYNC) < 0 )
callfail(crn);
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);
/* Close the device */
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 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_GetMoreDigits( ) function include the following:
Error Code |
Description |
ERR_ISDN_LIB | E_ISBADIF |
Bad interface number |
ERR_ISDN_LIB | E_ISBADTS |
Bad time slot |
cc_WaitCall( )
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation