public override void OnExternalAction(CallButlerScriptContext scriptContext, string command, string commandData) { if (command == "JoinConference") { int participants = 0; if (conferences.ContainsKey(commandData)) { participants = conferences[commandData].Count; } else { conferences[commandData] = new List <CallButlerScriptContext>(); } conferences[commandData].Add(scriptContext); scriptContext.SetScriptVariable("NumberInConference", participants.ToString()); } else if (command == "PersonJoining") { if (conferences.ContainsKey(commandData)) { // Loop through the conferences and play our joining sound List <CallButlerScriptContext> participants = conferences[commandData]; for (int index = 0; index < participants.Count; index++) { participants[index].SignalExternalScriptEvent("PersonJoining"); } } } else if (command == "LeaveConference") { if (conferences.ContainsKey(commandData)) { if (conferences[commandData].Contains(scriptContext)) { conferences[commandData].Remove(scriptContext); // Loop through the conferences and play our leaving sound List <CallButlerScriptContext> participants = conferences[commandData]; for (int index = 0; index < participants.Count; index++) { participants[index].SignalExternalScriptEvent("PersonLeaving"); } } if (conferences[commandData].Count == 0) { conferences[commandData].Clear(); conferences.Remove(commandData); } } } }
public override void OnExternalAction(CallButlerScriptContext scriptContext, string command, string commandData) { if (command == "ValidatePasscode") { // Check on the passcode foreach (string passcode in Properties.Settings.Default.Passcodes) { if (passcode == commandData) { scriptContext.SignalExternalScriptEvent("ValidPasscode"); } } scriptContext.SignalExternalScriptEvent("InvalidPasscode"); } }
public override string OnStartScript(CallButlerScriptContext scriptContext) { return(Properties.Resources.ExternalDialtoneModuleScript); }
public override string OnStartScript(CallButlerScriptContext scriptContext) { return(Properties.Resources.Conference_Bridge_Script); }