예제 #1
0
 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");
 }
예제 #2
0
        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);
        }
예제 #3
0
 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);
 }
예제 #4
0
 private static bool OnCallDetectFax(CallingEventParams.DetectParams detectParams)
 {
     return(detectParams.Detect.Type == CallingEventParams.DetectParams.DetectType.fax);
 }
예제 #5
0
 private static bool OnCallDetectHuman(CallingEventParams.DetectParams detectParams)
 {
     return
         (detectParams.Detect.Type == CallingEventParams.DetectParams.DetectType.machine &&
          detectParams.Detect.Parameters.Event == "HUMAN");
 }