private static bool OnCallDetectMachine(CallingEventParams.DetectParams detectParams) { return (detectParams.Detect.Type == CallingEventParams.DetectParams.DetectType.machine && detectParams.Detect.Parameters.Event == "MACHINE" || detectParams.Detect.Parameters.Event == "READY"); }
private void OnCallingEvent_Detect(Client client, BroadcastParams broadcastParams, CallingEventParams callEventParams) { CallingEventParams.DetectParams detectParams = null; try { detectParams = callEventParams.ParametersAs <CallingEventParams.DetectParams>(); } catch (Exception exc) { Log(LogLevel.Warning, exc, "Failed to parse DetectParams"); return; } if (!mCalls.TryGetValue(detectParams.CallID, out Call call)) { Log(LogLevel.Warning, string.Format("Received DetectParams with unknown CallID: {0}", detectParams.CallID)); return; } call.DetectHandler(callEventParams, detectParams); }
private static bool OnCallDetectDigit(CallingEventParams.DetectParams detectParams) { // TODO // Improve test by looking for specific digit sequence or whatever return(detectParams.Detect.Type == CallingEventParams.DetectParams.DetectType.digit); }
private static bool OnCallDetectFax(CallingEventParams.DetectParams detectParams) { return(detectParams.Detect.Type == CallingEventParams.DetectParams.DetectType.fax); }
private static bool OnCallDetectHuman(CallingEventParams.DetectParams detectParams) { return (detectParams.Detect.Type == CallingEventParams.DetectParams.DetectType.machine && detectParams.Detect.Parameters.Event == "HUMAN"); }