
Description | Cautions | Example | Errors
The d42_gtcallid( ) function retrieves the called/calling number ID of the incoming call and places it in an application buffer. The application buffer must be 49 bytes, and will hold the entire data string (see below) plus a null. The length of the data string is variable. Refer to the PBX Integration User's Guide for more information specific to your PBX. An example showing the contents of the application buffer for any supported switch is as follows:
The application buffer must be 49 bytes. The length of the called/calling number ID data is variable (not exceeding 48 bytes), and is stored as a null-terminated ASCII string (total length--49 bytes).
void main(void)
{
int devh;
int rc = 0;
char bufferp[49];
/* Open Channel Device */
if ( (devh = dx_open("dxxxB1C1",NULL))==-1)
{
printf("Error dx_open()\n");
exit(-1);
} /* End dx_open */
/* Wait for incoming call */
if ( (rc = dx_wtring(devh, 2, DX_ONHOOK, -1))==-1)
{
printf("Error dx_wtring()\n");
dx_close(devh);
exit(-1);
}
/* Get the Calling/Caller Id */
if ( (rc = d42_gtcallid(devh, bufferp)) == -1)
{
printf("Error d42_gtcallid()\n");
dx_close(devh);
exit(-1);
} /* End d42_gtcallid */
printf("Caller Id = %s\n",bufferp);
dx_close(devh);
} /* End main */
If this function returns -1 to indicate a failure, one of the following (most common) codes will be contained in dx_errno. For a complete list of error codes and definitions, refer to Appendix C.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation