string TestConnectCentral() { string error = ""; try { PhConfig = new PhoneConfig(int.Parse(cnf.puerto)); PhConfig.AnadeAcount(cnf.extension, cnf.desencriptadaSecret, cnf.extension, cnf.centralita, cnf.puerto); CallManager.StackProxy = pjsipStackProxy.Instance; CallManager.Config = PhConfig; pjsipStackProxy.Instance.Config = PhConfig; pjsipRegistrar.Instance.Config = PhConfig; int resultado = CallManager.Initialize(); if (resultado != 0) { error = "Error de inicialización de cliente"; } else { resultado = pjsipRegistrar.Instance.registerAccounts(); if (resultado != PhConfig.Accounts.Count) { error = "Error de registro"; } } } catch (Exception ex) { error = "Error: " + ex.Message; } return(error); }
string TestConnectCentral() { string error = ""; try { PhoneConfig Config = new PhoneConfig(int.Parse(tbPort.Text)); CCallManager CallManager = CCallManager.Instance; Config.AnadeAcount(tbExtension.Text, tbSecret.Text, tbExtension.Text, tbCentralita.Text, tbPort.Text); CallManager.StackProxy = pjsipStackProxy.Instance; CallManager.Config = Config; pjsipStackProxy.Instance.Config = Config; pjsipRegistrar.Instance.Config = Config; int resultado = CallManager.Initialize(); if (resultado != 0) { error = "Error de inicialización de cliente"; } else { resultado = pjsipRegistrar.Instance.registerAccounts(); if (resultado != Config.Accounts.Count) { error = "Error de registro"; } } //System.Threading.Thread.Sleep(2000); //CallManager.Shutdown(); } catch (Exception ex) { error = "Error: " + ex.Message; } return(error); }
string TestConnectCentral() { string error = ""; try { PhoneConfig Config = new PhoneConfig(int.Parse(tbPort.Text)); CCallManager CallManager = CCallManager.Instance; Config.AnadeAcount(tbExtension.Text, tbSecret.Text, tbExtension.Text, tbCentralita.Text, tbPort.Text); CallManager.StackProxy = pjsipStackProxy.Instance; CallManager.Config = Config; pjsipStackProxy.Instance.Config = Config; pjsipRegistrar.Instance.Config = Config; int resultado = CallManager.Initialize(); if (resultado != 0) error = "Error de inicialización de cliente"; else { resultado = pjsipRegistrar.Instance.registerAccounts(); if (resultado != Config.Accounts.Count) error = "Error de registro"; } //System.Threading.Thread.Sleep(2000); //CallManager.Shutdown(); } catch (Exception ex) { error = "Error: " + ex.Message; } return error; }
string TestConnectCentral() { string error = ""; try { PhConfig = new PhoneConfig(int.Parse(cnf.puerto)); PhConfig.AnadeAcount(cnf.extension, cnf.desencriptadaSecret, cnf.extension, cnf.centralita, cnf.puerto); CallManager.StackProxy = pjsipStackProxy.Instance; CallManager.Config = PhConfig; pjsipStackProxy.Instance.Config = PhConfig; pjsipRegistrar.Instance.Config = PhConfig; int resultado = CallManager.Initialize(); if (resultado != 0) error = "Error de inicialización de cliente"; else { resultado = pjsipRegistrar.Instance.registerAccounts(); if (resultado != PhConfig.Accounts.Count) error = "Error de registro"; } } catch (Exception ex) { error = "Error: " + ex.Message; } return error; }