
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 D/42 Series User's Guide for more information specific to your PBX. Examples showing the contents of the application buffer for each supported switch are as follows:
MITEL PBX (D/42D-SX)
text |
bb 2 2 1 _ C A L L I N G |
|
data |
20 32 32 31 5F 43 41 4C 4C 49 4E 47 00 xx xx xx |
xx xx xx xx xx xx xx xx |
byte |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
16 17 18 19 20 21 22 23 |
data |
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx |
xx xx xx xx xx xx xx xx |
byte |
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
40 41 42 43 44 45 46 47 |
Northern Telecom SL-1 (D/42D-SL)
text |
bb bb bb bb bb bb bb bb bb bb bb bb bb 2 2 1 |
|
data |
20 20 20 20 20 20 20 20 20 20 20 20 20 32 32 31 |
00 xx xx xx xx xx xx xx |
byte |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
16 17 18 19 20 21 22 23 |
text |
||
data |
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx |
xx xx xx xx xx xx xx xx |
byte |
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
40 41 42 43 44 45 46 47 |
Northern Telecom Norstar (D/42-NS)
text |
bb 2 2 1 _ 2 2 4 |
|
data |
20 32 32 31 5F 32 32 34 00 xx xx xx xx xx xx xx |
xx xx xx xx xx xx xx xx |
byte |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
16 17 18 19 20 21 22 23 |
text |
||
data |
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx |
xx xx xx xx xx xx xx xx |
byte |
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
40 41 42 43 44 45 46 47 |
NEC KTS/PBX (D/42-NE2)
text |
bb 2 0 0 _ 2 0 3 |
|
data |
20 32 30 30 5F 32 30 33 00 xx xx xx xx xx xx xx |
xx xx xx xx xx xx xx xx |
byte |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
16 17 18 19 20 21 22 23 |
text |
||
data |
xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx |
xx xx xx xx xx xx xx xx |
byte |
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
40 41 42 43 44 45 46 47 |
Parameter |
Description |
devh: |
specifies the valid channel device descriptor obtained by a call to dx_open( ) |
bufferp: |
pointer to the application buffer. The called/calling number ID is placed here |
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, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following (most common) errors. For a complete list of error codes and definitions, refer to Appendix C.
ED42_FWREQFAILURE |
Firmware error |
ED42_UNKNOWNBOARD |
Unknown D/42 board type |
ED42_BADDEVICE |
Invalid or wrong device handle |
ED42_UNSUPPORTED |
Function not supported on this board |
ED42_INVALARG |
Invalid argument passed to function |
DXLIB_INVNRB |
Internal voice library error |
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation