Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 267
retrieve a caller ID message — dx_gtextcallid( )
MACLIP_NAME can be used to get the calling line subscriber name for ACLIP
Caller ID information is available for the call from the moment the ring event is generated (if the
ring event is set to occur on or after the second ring (CLASS, ACLIP) or set to occur on or after the
first ring (CLIP, JCLIP)) until either of the following occurs:
If the call is answered (the application channel goes off-hook), the caller ID information is
available to the application until the call is disconnected (the application channel goes on-
hook).
If the call is not answered (the application channel remains on-hook), the caller ID information
is available to the application until rings are no longer received from the Central Office
(signaled by ring off event, if enabled).
!
!!
! Example
/*$ dx_gtextcallid( ) example to obtain all available caller ID information $*/
#include <windows.h>
#include <sys/types.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
/* Intel Dialogic Includes */
#include "srllib.h"
#include "dxxxlib.h"
int main()
{
int numRings = 2; /* In the US */
int ringTimeout = 20; /* 20 seconds */
int chdev; /* Channel descriptor */
unsigned short parmval;
unsigned char buffer[81];
/* Open channel */
if ((chdev=dx_open("dxxxB1C1", NULL)) == -1) {
/* process error */
exit(0);
}
/* Enable the caller ID functionality */
parmval = DX_CALLIDENABLE;
if (dx_setparm(chdev, DXCH_CALLID, (void *) &parmval) == -1) {
/* process error */
exit(0);
}
/******************************************************************
* Set the number of rings required for a RING event to permit
* receipt of the caller ID information. In the US, caller ID
* information is transmitted between the first and second rings
******************************************************************/
parmval = numRings; /* 2 in the US */
if (dx_setparm(chdev, DXCH_RINGCNT, &parmval) == -1) {
/* process error */
exit(0);
}