
Description | Termination Events | Cautions | Example | Errors | See Also
Name: |
int cl_GetSemanticsStateName(hDevice, iSemanticsStateIndex, pszSemanticsStateName, iSemanticsStateNameSize) | |
Inputs: |
long hDevice |
|
int iSemanticsStateIndex |
| |
char* pszSemanticsStateName |
| |
int iSemanticsStateNameSize |
| |
Returns: |
0 on success | |
Includes: |
cllib.h | |
Mode: |
synchronous | |
The cl_GetSemanticsStateName( ) function returns the name of a semantics state according to its index. Semantics states, such as dialing, connected or disconnected, represent the current status of the monitored call. The names of semantics states are returned as ASCIIZ strings.
Semantics states are indexed from 0 to the number of semantics states minus one. The list of semantics states (count, names, and indexes) is protocol dependent.
Parameter |
Description |
hDevice: |
The device handle of the call logging device. |
iSemanticsStateIndex: |
The index of the semantics state. |
pszSemanticsStateName: |
The pointer to the buffer into which the name of the indexed semantics state is to be returned. The name is returned as an ASCIIZ string. |
iSemanticsStateNameSize: |
The size of the buffer into which the name of the indexed semantics state is to be returned, where the maximum size includes the terminating NUL of the returned ASCIIZ string. |
None
The Call Logging API is not multi-thread safe. Call logging functions must be called within the same thread.
#include <srllib.h>
#include <cllib.h>
#include <stdio.h>
/* The Call Logging Device Handle */
extern long g_hDevice;
void GetSemanticsStates(void)
{
int nStates;
int iState;
char szState[64];
if (g_hDevice != EV_ANYDEV)
{
if (cl_GetSemanticsStateCount(g_hDevice, &nStates) != 0)
{
printf("GetSemanticsStates - cl_GetSemanticsStateCount() failed\n");
return;
}
printf("There are %i semantics states:\n", nStates);
for (iState = 0 ; (iState < nStates) ; ++iState)
{
if (cl_GetSemanticsStateName(g_hDevice, iState, szState, sizeof(szState)) != 0)
{
printf("GetSemanticsStates - cl_GetSemanticsStateName() failed\n");
return;
}
printf("%i: \"%s\"\n", iState, szState);
}
}
}
If the function returns a value < 0, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive error message. The error codes that can be returned by ATDV_LASTERR( ) are:
Error Code Value |
Returned When |
ECL_NULLPARAMETER |
invalid NULL parameter |
ECL_INVALIDPARAMETER |
invalid parameter |
ECL_INTERNAL |
internal Call Logging error; cause unknown |
See 2.2 Error Handling for more information about what kinds of errors can cause these codes to be returned
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation