
Description | Cautions | Example | See Also
Name: |
long sr_getevtlen(ehandle) | |
Inputs: |
unsigned long ehandle |
· event handle returned by sr_waitevtEx( ), or zero if sr_waitevt( ) is used |
Returns: |
length of data if successful | |
|
-1 if no current event | |
Includes: |
srllib.h | |
Type: |
Event Data Retrieval function | |
The sr_getevtlen( ) function returns the length of the variable data associated with the current event. If there is no data associated with the current event, a value of zero is returned.
This function is called differently when used with sr_waitevt( ) or sr_waitevtEx( ).
For applications using sr_waitevt( ), pass a 0 parameter:
sr_getevtlen(0). Do not use the event descriptor handle parameter, ehandle.
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
long chdev[MAXDEVS];
unsigned long evt_handle;
main( ... )
{
char channel_name[12];
int ch;
for (ch = 0; ch < MAXDEVS; ch++) {
/* Build the channel name for each channel */
if ( (chdev[ch] = dx_open(channel_name, 0) ) == -1 ) {
printf("dx_open failed\n");
exit(1);
}
}
/*
* Now initialize each device setting up the event masks and then issue
* the command asynchronously to start off the state machine.
*/
for (ch = 0; ch < MAXDEVS; ch++) {
/* Set up the event masks and other initialization */
/* set the channel onhook asynchronously */
if (dx_sethook( chdev[ch]. DX_ONHOOK, EV_ASYNC) == -1) {
/* sethook failed, handle the error */
}
}
/* This is the main loop to control the Voice hardware */
while (FOREVER) {
/* wait for the event */
sr_waitevtEx( chdev, MAXDEVS, -1, &evt_handle);
process_event( evt_handle);
}
int process_event( ehandle)
unsigned long ehandle;
{
long varlen
int voxhandle = sr_getevtdev(ehandle);
switch(sr_getevttype(ehandle)) {
case TDX_CST:
varlen = sr_getevtlen(ehandle)
break;
case TDX_PLAY:
.
break;
}
}
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation