
Description | Cautions | Example | Errors | See Also
Name: |
||
Inputs: |
unsigned int channel |
|
unsigned char *bufferp |
| |
Returns: |
0 |
|
Includes: |
D42LIB.H | |
Mode: |
immediate | |
The d42_getnewmessage( ) function allows messages to be returned to a board from a Norstar PBX. The function retrieves the next message for the specified channel and places it in the user buffer. This feature has to be turned on by setting the parameter D4CH_MESG_Q with the dx_setparm( ) function
Parameter |
Description |
channel |
specifies the channel number. |
bufferp |
points to the buffer where messages are placed |
This function is valid only with the Nortel Norstar PBX.
The pointer to the user buffer is assumed to be large enough to hold the entire string plus a NULL, which is a total of 49 characters. The associated buffer must be 49 bytes. An application which passes anything smaller will not be backward compatible.
int rc =0;
unsigned char buffer[49];
unsigned int channel = 1;
/* Get new message */
if ( (rc = d42_getnewmessage(channel, &buffer))
== ERR_SUCC)
{
printf("d42_getnewmessage() == %d %s, channel
= %d, Message = %s\n", channel, buffer);
}
else
{
printf("d42_getnewmessage() == %d %s\n", rc,
d42_geterror(rc));
}
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.
ED42_UNSUPPORTED |
Function not supported on this board |
ED42_SYSTEM |
System level error |
ED42_INVALARG |
Invalid argument passed to function |
ERR_NOBOARD |
No board present |
ERR_NODBFW |
No firmware loaded |
ERR_BADCH |
Invalid channel number |
ERR_NULLPTR |
Null pointer passed to function |
ERR_QEMPTY |
Message queue is empty |
ERR_QOVRFLOW |
Message queue is full |
The final two messages listed are returned when the host computer PBX message queue is full or empty, respectively. This queue is 8K, so up to 96 messages may be stored before the overflow state occurs. When the queue is full, incoming messages are lost until the application clears the queue.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation