Exemplo n.º 1
0
        public string  RegisterAndUnregisterSip(string connectionString, FreeSwitchRegisterParameters requestParams)
        {
            string status = String.Empty;

            try
            {
                Press3.BusinessRulesLayer.SipPhoneRegistration sips = new Press3.BusinessRulesLayer.SipPhoneRegistration();
                JObject registrationdetails = sips.RegisterAndUnRegister(connectionString, requestParams);
                this.Message = registrationdetails.SelectToken("Message").ToString();
            }catch (Exception ex) {
                Logger.Error("Exception while unregistering sip user:" + ex.ToString());
            }


            return(this.Message);
        }
Exemplo n.º 2
0
        public string GetSipPhonePassword(string connectionString, string number, string domain, string userPort, string UserIp, string requestPort, string requestIp, string eventCallingFile)
        {
            string password = String.Empty;

            Press3.BusinessRulesLayer.SipPhoneRegistration sips = new Press3.BusinessRulesLayer.SipPhoneRegistration();
            JObject passworddetails = sips.GetSipPhoneDetails(connectionString, number, domain, userPort, UserIp, requestPort, requestIp, eventCallingFile);

            try
            {
                if (passworddetails.SelectToken("Success").ToString() == "True")
                {
                    JArray softPhoneDetails = (JArray)passworddetails.SelectToken("SipPhoneDetails");

                    if (softPhoneDetails != null)
                    {
                        if (softPhoneDetails[0].SelectToken("PASSWORD") != null)
                        {
                            password = softPhoneDetails[0].SelectToken("PASSWORD").ToString();
                        }
                    }
                    else
                    {
                        this.Message = passworddetails.SelectToken("Message").ToString();
                    }
                }
                else
                {
                    password     = "******";
                    this.Message = passworddetails.SelectToken("Message").ToString();
                }
            }catch (Exception ex) {
                Logger.Error("Exception while Fetching Password for verto user:"******", with domain:" + domain + ",Exception:" + ex.ToString());
            }


            return(password);
        }