Skip to navigation

Call quality detection

Read the audio quality reported for a call in a VoxEngine scenario.
View as Markdown

The CallEvents.AudioQualityDetected event reports the audio quality detected for a call. Read its quality property to log or handle the reported value. The Call API reference lists CallAudioQuality.HD for high-definition audio and CallAudioQuality.STANDARD for standard audio quality.

The scenario answers an incoming call and logs the reported quality:

voxengine-call-quality.js
VoxEngine.addEventListener(AppEvents.CallAlerting, ({ call }) => {
call.addEventListener(CallEvents.AudioQualityDetected, ({ quality }) => {
Logger.write(`Call audio quality: ${quality}`);
});
call.addEventListener(CallEvents.Disconnected, () => VoxEngine.terminate());
call.addEventListener(CallEvents.Failed, () => VoxEngine.terminate());
call.answer();
});

To try it, add the code as a scenario and attach it to an inbound routing rule. Place a call that matches the rule, then find the Call audio quality message in the call’s session logs. See Scenarios troubleshooting for where to view those logs.