コード例 #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");
 }