
Description | Cautions | Example | Errors
Name: |
long sr_getparm(dev, parmno, valuep) | |
Inputs: |
long dev |
|
|
long parmno |
|
|
void *valuep |
|
Returns: |
0 if successful | |
|
-1 if failure | |
Includes: |
srllib.h | |
Type: |
SRL Parameter function | |
The sr_getparm( ) function returns the value of an SRL parameter. The function parameters are described as follows:
Parameter |
Description | |
dev |
Device handle. Generally, you should set this parameter to SRL_DEVICE, the predefined SRL device handle. However, if the parameter being set is SR_USERCONTEXT, then dev should be set to the handle returned by the technology-specific xx_open( ). | |
parmno |
Specifies the SRL parameter for which values are returned. Possible values are as follows: | |
|
|
Get the value for the model type. Returns an integer. |
|
|
Get the value for the polling granularity (the time between device polls in millisecond units). Returns an integer. |
|
|
Set user-specific context. This lets you quickly get application-specific context given on a dialogic device handle. |
valuep |
A pointer to an area of memory to receive the value for the specified parameter. This memory should be large enough to hold the parameter. Possible values are as follows: | |
|
|
SR_STASYNC or SR_MTASYNC . |
|
|
A number in milliseconds (ms). |
|
|
User-specific context set through the sr_setparm( ) function. |
Normally, when getting SRL parameters, you must set the dev parameter to SRL_DEVICE. However, if you set the parmno parameter to SR_USERCONTEXT, you must set the dev parameter to the device on which context is being retrieved.
#include <windows.h>
#include <srllib.h>
main()
{
int mode;
if( sr_getparm( SRL_DEVICE, SR_MODELTYPE, &mode ) == -1 ){
printf( "Error: cannot get srl modeltype\n" );
exit( -1 );
}
printf( "SRL is running in %s mode type\n",
(mode == SR_MTASYNC) ? "MTASYNC" : "STASYNC" );
}
If this function returns -1 to indicate failure, obtain the reason for the error by calling the SRL standard attribute function ATDV_LASTERR(SRL_DEVICE) or ATDV_ERRMSGP(SRL_DEVICE) to retrieve either the error code or a pointer to the error description, respectively. One of the following errors may be returned:
ESR_SYS |
|
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation