protected void LoadCamera(IVR vr, CameraSettingsSO cameraSettings, string cameraJsonSettings = null) { if(cameraJsonSettings == null) { cameraJsonSettings = @"{""clearFlags"":""Skybox"",""backgroundColor"":[0.13,0.15,0.2,0.01],""depth"":-1,""clearFlags"":""Skybox"",""textureResourcesName"":""Skybox/Skybox""}"; } var cameraPrefab = Resources.Load<VRCameraFactory>("Camera"); var cameraGOInstance = Object.Instantiate(cameraPrefab.gameObject) as GameObject; //make sure this doesn't end up in the scene perm //VRCameraFactory.SetHideflagsRecursive(cameraGOInstance, HideFlags.DontSave | HideFlags.DontSaveInEditor | HideFlags.DontSaveInBuild); var cameraFactory = cameraGOInstance.GetComponent<VRCameraFactory>(); var cursorController = cameraGOInstance.GetComponent<CursorController>(); var fadeCube = cameraGOInstance.GetComponentInChildren<FadeSphere>(); cameraFactory.SetCameraSettingsSO(cameraSettings); injectionBinder.Bind<CursorController>().ToValue(cursorController); injectionBinder.Bind<FadeSphere>().ToValue(fadeCube); injectionBinder.Bind<VRCameraFactory>().ToValue(cameraFactory); injectionBinder.GetBinding<IVR>().ToSingleton(); //let's see if this fixes the IVR being imported as a factory... cameraFactory.enabled = true; var serializedCamera = cameraJsonSettings.JsonDeserialize<SerializedCameraSettings>(); cameraFactory.SetCameraSettingsOnAllCameras(serializedCamera); if(serializedCamera.customCameraSettings != null) vr.SetCustomCameraSettings(serializedCamera.customCameraSettings); //cameraPrefab.enabled = true; }
public void PostIvrsTest() { // TODO: add unit test for the method 'PostIvrs' IVR body = null; // TODO: replace null with proper value var response = instance.PostIvrs(body); Assert.IsInstanceOf <IVR> (response, "response is IVR"); }
public void PutIvrsIvrIdTest() { // TODO: add unit test for the method 'PutIvrsIvrId' string ivrId = null; // TODO: replace null with proper value IVR body = null; // TODO: replace null with proper value var response = instance.PutIvrsIvrId(ivrId, body); Assert.IsInstanceOf <IVR> (response, "response is IVR"); }
private void InitializeMethodMembers() { Extensions = new Extensions(this); ExtensionGroups = new ExtensionGroups(this); Users = new Users(this); CallLogs = new CallLogs(this); CallQueueLogs = new CallQueueLogs(this); CurrentCalls = new CurrentCalls(this); CallQueues = new CallQueues(this); IVR = new IVR(this); }
public void Run(params string[] args) { IVR ivradd = PhoneSystem.Root.GetTenants()[0].CreateIVR(args[1]); ivradd.Name = "TestIVR"; ivradd.PromptFilename = "empty.wav"; ivradd.Timeout = 30; ivradd.TimeoutForwardType = IVRForwardType.VoiceMail; ivradd.TimeoutForwardDN = PhoneSystem.Root.GetTenants()[0].GetExtensions()[0]; ivradd.Save(); Console.WriteLine(ivradd); }
static void Main(string[] args) { IVR _ivr = new IVR(); try { _ivr.Start(); Console.WriteLine("Initialized and started in IVR mode...\r\n Press ENTER to exit."); Console.ReadLine(); } catch (Exception _ex) { Console.WriteLine(string.Format("Exception while Initializing...{0}\r\n Press ENTER to exit.", _ex)); Console.ReadLine(); return; } finally { _ivr.Stop(); } Console.WriteLine("Exit?"); Environment.Exit(0); }
public void Run(params string[] args) { PhoneSystem ps = PhoneSystem.Root; IVR ivr = ps.GetDNByNumber(args[1]) as IVR; Extension ext = ps.GetDNByNumber(args[2]) as Extension; String filename; if (ivr == null || ivr.GetActiveConnections().Length != 0) { Console.WriteLine("ERROR: IVR " + args[1] + " does not exist or currently active"); return; } if (ext == null || !ext.IsRegistered || ext.GetActiveConnections().Length != 0) { Console.WriteLine("ERROR: Extension " + args[2] + " does not exist, is busy or is not registered"); return; } bool checkUpdateOfFile = false; if (args.Length < 4) { filename = Path.GetFileNameWithoutExtension(ivr.PromptFilename).ToLowerInvariant(); } else { filename = args[3].ToLowerInvariant(); } String fileNameToRecord = Path.Combine(ps.GetParameterByName("IVRPROMPTPATH").Value, filename + ".wav"); if (args.Length > 3 && File.Exists(fileNameToRecord) && Path.GetFileNameWithoutExtension(ivr.PromptFilename).ToLowerInvariant() != filename) { Console.WriteLine("ERROR: File already exist but not selected for IVR:" + ivr.Number + "(" + ivr.Name + ")"); return; } DateTime filedt = DateTime.UtcNow; if (File.Exists(fileNameToRecord)) { checkUpdateOfFile = true; filedt = File.GetLastWriteTimeUtc(fileNameToRecord); } Dictionary <String, String> a = new Dictionary <string, string>(); a["extension"] = args[2]; a["filename"] = fileNameToRecord; PBXConnection pbx = Utilities.CreatePbxConn(); pbx.MakeCall("RecordFile", a); Console.Write("Wait for the call."); for (int i = 0; i < 20 && ext.GetActiveConnections().Length == 0; i++) { Console.Write("."); Thread.Sleep(1000); } if (ext.GetActiveConnections().Length == 0) { Console.WriteLine("FAILED"); return; } Console.WriteLine("Done"); Console.Write("Wait for the end of the call."); while (ext.GetActiveConnections().Length > 0) { Console.Write("."); Thread.Sleep(1000); } Console.WriteLine("Done"); if (checkUpdateOfFile) { Console.Write("Waiting for file update."); for (int i = 0; i < 20 && File.GetLastWriteTimeUtc(fileNameToRecord) == filedt; i++) { Console.Write("."); Thread.Sleep(1000); } if (File.GetLastWriteTimeUtc(fileNameToRecord) == filedt) { Console.WriteLine("FAILED"); return; } else { Console.WriteLine("Done"); } } else { Console.Write("Waiting for new file."); for (int i = 0; i < 20 && !File.Exists(fileNameToRecord); i++) { Console.Write("."); Thread.Sleep(1000); } if (!File.Exists(fileNameToRecord)) { Console.WriteLine("FAILED"); return; } else { Console.WriteLine("Done"); } } ivr.PromptFilename = filename + ".wav"; ivr.Save(); Console.WriteLine("Prompt successfuly changed on IVR:" + ivr.Number + "(" + ivr.Name + ")"); }
public void Init() { instance = new IVR(); }