コード例 #1
0
ファイル: ScriptService.cs プロジェクト: hostitherepc/Fork-1
        public bool PlaceOutboundCall(string jobID, string callID, WOSI.CallButler.Data.CallButlerDataset.ProvidersRow provider, string callTo, string fromCallerID, string fromCallerNumber, string scriptToRun, string answeringMachineScriptToRun, string answeringMachineDetectionSettings, System.Collections.Specialized.NameValueCollection scriptVariables, int timeout, CallButler.Service.Plugin.CallButlerDialerPlugin dialerPlugin)
        {
            if (File.Exists(scriptToRun))
            {
                int openLine = FindAndHoldOpenLine();

                if (openLine != 0)
                {
                    tsInterfaces[openLine].ScriptProcessor = new AutoDialerProcessor(telecomProvider, tsInterfaces[openLine], jobID, callID, scriptToRun, answeringMachineScriptToRun, answeringMachineDetectionSettings, timeout, scriptVariables, dialerPlugin);

                    // Place our outbound call
                    telecomProvider.Call(openLine, callTo, fromCallerID, fromCallerNumber, false, provider);

                    return true;
                }
                else
                {
                    if (dialerPlugin != null)
                        dialerPlugin.OnCallStatus(jobID, callID, CallButler.Service.Plugin.CallButlerDialerPlugin.CallStatus.NoLinesAvailable);
                }
            }
            else
            {
                if (dialerPlugin != null)
                    dialerPlugin.OnError(jobID, callID, "Could not find the script located at '" + scriptToRun + "'");
            }

            return false;
        }