private void ProcessEndCall(CallButler.Telecom.TelecomProviderBase telecomProvider)
 {
     if (outboundTsInterface != null && conferenceID == 0)
     {
         telecomProvider.EndCall(outboundTsInterface.LineNumber);
     }
     else
     {
         telecomProvider.EndConference(conferenceID, true);
     }
 }
        protected override void OnExternalCommand(string command, string commandData, string eventToken, TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider)
        {
            // Parse out our external event action
            if (Enum.IsDefined(typeof(TransferConferenceParticipantExternalCommands), command))
            {
                TransferConferenceParticipantExternalCommands externalCommand = WOSI.Utilities.EnumUtils <TransferConferenceParticipantExternalCommands> .Parse(command);

                switch (externalCommand)
                {
                case TransferConferenceParticipantExternalCommands.CALLBUTLERINTERNAL_EndConference:

                    telecomProvider.EndConference(conferenceID, true);

                    break;

                case TransferConferenceParticipantExternalCommands.CALLBUTLERINTERNAL_MainMenu:

                    break;
                }
            }

            tsInterface.IMLInterpreter.SignalEventCallback(eventToken);
        }
        protected override void OnExternalCommand(string command, string commandData, string eventToken, TelecomScriptInterface tsInterface, CallButler.Telecom.TelecomProviderBase telecomProvider, WOSI.CallButler.Data.DataProviders.CallButlerDataProviderBase dataProvider)
        {
            // Parse out our external event action
            if (callerTsInterface != null && Enum.IsDefined(typeof(TransferConferenceExternalCommands), command))
            {
                TransferConferenceExternalCommands externalCommand = WOSI.Utilities.EnumUtils <TransferConferenceExternalCommands> .Parse(command);

                switch (externalCommand)
                {
                case TransferConferenceExternalCommands.CALLBUTLERINTERNAL_EndConference:

                    telecomProvider.EndConference(conferenceID, true);

                    break;

                case TransferConferenceExternalCommands.CALLBUTLERINTERNAL_RecordingStarted:

                    // Notify the other caller that recording has started
                    callerTsInterface.IMLInterpreter.SignalExternalEvent(TransferConferenceExternalEvents.CALLBUTLERINTERNAL_RecordingStarted.ToString());

                    break;

                case TransferConferenceExternalCommands.CALLBUTLERINTERNAL_RecordingFinished:

                    // Notify the other caller that recording has finished
                    callerTsInterface.IMLInterpreter.SignalExternalEvent(TransferConferenceExternalEvents.CALLBUTLERINTERNAL_RecordingFinished.ToString());

                    vmMailerService.QueueVoicemailEmail(extension, "Your Call Recording", "Call Recording", tsInterface.IMLInterpreter.GetLocalVariable("RecordingFilename"));

                    break;

                case TransferConferenceExternalCommands.CALLBUTLERINTERNAL_TransferCaller:

                    TransferCaller(telecomProvider, commandData);

                    break;

                case TransferConferenceExternalCommands.CALLBUTLERINTERNAL_HoldCaller:

                    // Remove this call from the conference
                    tsInterface.ProcessOnHold(conferenceID, true);

                    // Tell the other caller to play hold music
                    callerTsInterface.IMLInterpreter.SignalExternalEvent(TransferConferenceExternalEvents.CALLBUTLERINTERNAL_HoldCall.ToString());

                    break;

                case TransferConferenceExternalCommands.CALLBUTLERINTERNAL_UnholdCaller:

                    // Add this caller back into the conference
                    tsInterface.ProcessOnHold(conferenceID, false);

                    // Tell the other caller to stop hold music
                    callerTsInterface.IMLInterpreter.SignalExternalEvent(TransferConferenceExternalEvents.CALLBUTLERINTERNAL_UnholdCall.ToString());

                    break;
                }
            }

            tsInterface.IMLInterpreter.SignalEventCallback(eventToken);
        }