public void Login(string server_address, string username, string password) { ops_client = new OpsClient(); ops_client.ErrorOccurred += OPSClientOnErrorOccurred; ops_client.LoginAsync(server_address, username, password, Completed); }
public void Login(UserInfo user) { ops_client = new OpsClient(); ops_client.ErrorOccurred += OPSClientOnErrorOccurred; ops_client.PhoneBookItemsChanged += OnPhoneBookChanged; User = user; ops_client.LoginAsync(user.ServerAddress, user.Username, user.Password, OnLoginCompleted); }
public void LoginAsync(string serverAddress, string username, string password, Action <bool> completed) { if (_client != null) { _client.ErrorOccurred -= _client_ErrorOccurred; } _client = new OpsClient(); _client.ErrorOccurred += _client_ErrorOccurred; _client.LoginAsync(serverAddress, username, password, completed); }
public bool Login(string serverAddress, string username, string password) { if (_client != null) { _client.ErrorOccurred -= _client_ErrorOccurred; } _client = new OpsClient(); _client.ErrorOccurred += _client_ErrorOccurred; return(_client.Login(serverAddress, username, password)); }
public MyCallRoutingInterceptor(OpsClient client) { dndExtensions = new List<string>(); _client = client; var ext0 = _client.GetAPIExtension(); var ext1 = _client.GetAPIExtension("1000"); var ext2 = _client.GetAPIExtension("9999"); var server = _client.GetAPIExtension("server"); var pgnotebook = _client.GetAPIExtension("pgnotebook"); //server.IncomingCall += server_IncomingCall; //server.Disconnected += server_Disconnected; //pgnotebook.IncomingCall += pgnotebook_IncomingCall; //pgnotebook.Disconnected += pgnotebook_Disconnected; }
public MyCallRoutingInterceptor(OpsClient client) { dndExtensions = new List <string>(); _client = client; var ext0 = _client.GetAPIExtension(); var ext1 = _client.GetAPIExtension("1000"); var ext2 = _client.GetAPIExtension("9999"); var server = _client.GetAPIExtension("server"); var pgnotebook = _client.GetAPIExtension("pgnotebook"); //server.IncomingCall += server_IncomingCall; //server.Disconnected += server_Disconnected; //pgnotebook.IncomingCall += pgnotebook_IncomingCall; //pgnotebook.Disconnected += pgnotebook_Disconnected; }
private static void Login(string serverAddress, string username, string password) { client = new OpsClient(); Console.WriteLine("Connecting..."); client.ErrorOccurred += client_ErrorOccurred; var result = client.Login(serverAddress, username, password); if (result) { Console.WriteLine("Successfully connected to {0} with username: {1}.", serverAddress, username); client.SessionCreated += new EventHandler <Ozeki.VoIP.VoIPEventArgs <OPSSDK.ISession> >(opsClient_SessionCreated); } else { Console.WriteLine("Connection fail try again."); Console.WriteLine("Please check whether the IP address is correct and the given user has right to use OPS SDK. This can be checked under PBX features/Preferences/User access profile."); ReadLoginInfos(); } }
private static void Login(string serverAddress, string username, string password) { client = new OpsClient(); Console.WriteLine("Connecting..."); client.ErrorOccurred += client_ErrorOccurred; var result = client.Login(serverAddress, username, password); if (result) { Console.WriteLine("Successfully connected to {0} with username: {1}.", serverAddress, username); client.SessionCreated += new EventHandler<Ozeki.VoIP.VoIPEventArgs<OPSSDK.ISession>>(opsClient_SessionCreated); } else { Console.WriteLine("Connection fail try again."); Console.WriteLine("Please check whether the IP address is correct and the given user has right to use OPS SDK. This can be checked under PBX features/Preferences/User access profile."); ReadLoginInfos(); } }
private static void SetRoutingInterceptor(OpsClient client) { client.SetCallRoutingInterceptor(new MyCallRoutingInterceptor(client)); }
/// <summary> /// Create an OPS Client, and try to login into PBX with the given parameters /// </summary> /// <param name="serverAddress">The address of your Ozeki Phone System XE PBX</param> /// <param name="username">Valid Username for your Ozeki Phone System XE PBX</param> /// <param name="password">Valid Password for the given Username</param> /// <returns>Can or cannot connect to the PBX</returns> private bool TryCreateConnectToClient(string serverAddress, string username, string password) { opsClient = new OpsClient(); opsClient.ErrorOccurred += ClientOnErrorOccurred; var result = opsClient.Login(serverAddress, username, password); if (!result) { Console.WriteLine("Cannot connect to the server, please check the login details and the availability of your PBX! Press Enter to continue!"); Console.ReadLine(); return false; } return true; }