Dialogic Dialogic Global Call IP IP Phone User Manual


 
265
Dialogic Corporation
if (gc_SetAlarmParm(hMediaDevice, ALARM_SOURCE_ID_NETWORK_ID,
ParmSetID_qosthreshold_alarm, &alarm_parm_list, EV_SYNC)!= GC_SUCCESS)
{
/* handle gc_SetAlarmParm() failure */
printf("SetAlarmParm(hMediaDevice=%d, mode=EV_SYNC) Failed", hMediaDevice);
return;
}
printf("SetAlarmParm(hMediaDevice=%d, mode=EV_SYNC) Succeeded", hMediaDevice);
}
4.21.4 Retrieving QoS Threshold Values
To retrieve QoS threshold values, use the gc_GetAlarmParm( ) function. See Section 8.3.9,
“gc_GetAlarmParm( ) Variances for IP”, on page 451 for more information.
The following code demonstrates how to retrieve QoS threshold values.
Note: The following code uses the IPM_QOS_THRESHOLD_INFO structure from the IP Media Library
(IPML). See the Dialogic
®
IP Media Library API Library Reference and the Dialogic
®
IP Media
Library API Programming Guide for more information.
/*****************************************************************************
Routine: GetAlarmParm
Assumptions/Warnings: None
Description: calls gc_GetAlarmParm()
Parameters: handle of Media device
Returns: None
******************************************************************************/
void GetAlarmParm(int hMediaDevice)
{
ALARM_PARM_LIST alarm_parm_list;
unsigned int n;
IPM_QOS_THRESHOLD_INFO QoS_info;
IPM_QOS_THRESHOLD_INFO *QoS_infop;
QoS_info.unCount=2;
QoS_info.QoSThresholdData[0].eQoSType = QOSTYPE_LOSTPACKETS;
QoS_info.QoSThresholdData[1].eQoSType = QOSTYPE_JITTER;
/* get QoS thresholds for LOSTPACKETS and JITTER */
alarm_parm_list.alarm_parm_fields[0].alarm_parm_data.pstruct = (void *) &QoS_info;
alarm_parm_list.n_parms = 1;
if (gc_GetAlarmParm(hMediaDevice, ALARM_SOURCE_ID_NETWORK_ID,
ParmSetID_qosthreshold_alarm, &alarm_parm_list, EV_SYNC) != GC_SUCCESS)
{
/* handle gc_GetAlarmParm() failure */
printf("gc_GetAlarmParm(hMediaDevice=%d, mode=EV_SYNC) Failed", hMediaDevice);
return;
}
/* display threshold values retrieved */
printf("n_parms = %d\n", alarm_parm_list.n_parms);
QoS_infop = alarm_parm_list.alarm_parm_fields[0].alarm_parm_data.pstruct;
for (n=0; n < QoS_info.unCount; n++)
{
printf("QoS type = %d\n", QoS_infop->QoSThresholdData[n].eQoSType);
printf("\tTime Interval = %u\n", QoS_infop->QoSThresholdData[n].unTimeInterval);
printf("\tDebounce On = %u\n", QoS_infop->QoSThresholdData[n].unDebounceOn);
printf("\tDebounce Off = %u\n", QoS_infop->QoSThresholdData[n].unDebounceOff);
printf("\tFault Threshold = %u\n", QoS_infop->QoSThresholdData[n].unFaultThreshold);
printf("\tPercent Success Threshold = %u\n",