/// <summary>
        /// 群组管理员邀请用户加入群组(用户加人)
        /// </summary>
        /// <param name="restAddress">地址</param>
        /// <param name="restPort">端口号</param>
        /// <param name="subAccountSid">子账号</param>
        /// <param name="subToken">子账号Token</param>
        /// <param name="groupId">群组ID</param>
        /// <param name="members">被邀请成员列表</param>
        /// <param name="member">被邀请成员</param>
        /// <param name="confirm">是否需要被邀请人确认 0 :需要 1:不需要(自动加入群组)</param>
        /// <param name="declared">邀请理由</param>
        /// <returns></returns>
        public FoundationsViewModel InviteJoinGroup(string restAddress, string restPort, string subAccountSid, string subToken, string groupId, List <string> members, string confirm, string declared)
        {
            string date = DateTime.Now.ToString("yyyyMMddhhmmss");

            // 构建URL内容
            string sigstr = MD5Encrypt(subAccountSid + subToken + date);
            ///{SoftVersion}/SubAccounts/{subAccountSid}/Group/InviteJoinGroup
            string uriStr = string.Format("https://{0}:{1}/{2}/SubAccounts/{3}/Group/InviteJoinGroup?sig={4}", restAddress, restPort, m_softVer, subAccountSid, sigstr);

            StringBuilder sb = new StringBuilder();

            sb.Append("<?xml version='1.0' encoding='UTF-8'?> <Request>");
            sb.Append("<groupId>").Append(groupId).Append("</groupId>");
            sb.Append(" <members>");  //member 填写:VoIP号码
            if (members != null && members.Count > 0)
            {
                foreach (var item in members)
                {
                    sb.Append("<member>").Append(item).Append("</member>");
                }
            }
            sb.Append("</members>");
            sb.Append("<confirm>").Append(confirm).Append("</confirm>");
            sb.Append("<declared>").Append(declared).Append("</declared>");
            sb.Append("</Request> ");

            string responseStr             = CreateHttpPost(uriStr, date, subAccountSid, sb.ToString(), EBodyType.EType_XML);
            FoundationsViewModel viewModel = XMLDeserialize(typeof(FoundationsViewModel), responseStr) as FoundationsViewModel;

            return(viewModel);
        }
        /// <summary>
        /// 按条件搜索公共群组
        /// </summary>
        /// <param name="restAddress">服务器地址</param>
        /// <param name="restPort">端口</param>
        /// <param name="subAccountSid">子账号</param>
        /// <param name="mainToken">子账号的授权令牌</param>
        /// <param name="groupId">根据群组ID查找(模糊查询,同时具备两个条件,查询以此为先)</param>
        /// <param name="name">根据群组名查找(模糊查询,结果集中不包含私有群组)</param>
        /// <returns></returns>
        public string SearchPublicGroups(string restAddress, string restPort, string subAccountSid, string subToken, string groupId, string name)
        {
            string date = DateTime.Now.ToString("yyyyMMddhhmmss");

            // 构建URL内容
            string sigstr = MD5Encrypt(subAccountSid + subToken + date);
            //{SoftVersion}/SubAccounts/{subAccountSid}/Group/SearchPublicGroups
            string uriStr = string.Format("https://{0}:{1}/{2}/SubAccounts/{3}/Group/SearchPublicGroups?sig={4}", restAddress, restPort, m_softVer, subAccountSid, sigstr);

            StringBuilder sb = new StringBuilder();
            //sb.Append("<?xml version='1.0' encoding='UTF-8'?> <Request>");
            //sb.Append("<name>").Append(name).Append("</name>");
            //sb.Append("<type>").Append(type).Append("</type>");
            //sb.Append("<permission>").Append(permission).Append("</permission>");
            //sb.Append("<declared>").Append(declared).Append("</declared>");
            //sb.Append("</Request> ");

            string responseStr             = CreateHttpPost(uriStr, date, subAccountSid, sb.ToString(), EBodyType.EType_XML);
            FoundationsViewModel viewModel = XMLDeserialize(typeof(FoundationsViewModel), responseStr) as FoundationsViewModel;

            //if (viewModel != null)
            //{
            //    if (viewModel.statusCode == MessageStatusCode.Success)
            //    {
            //        return true;
            //    }
            //}

            //return false;

            return("");
        }
        /// <summary>
        /// 成员主动退出群组
        /// </summary>
        /// <param name="restAddress">地址</param>
        /// <param name="restPort">端口号</param>
        /// <param name="subAccountSid">子账号</param>
        /// <param name="subToken">子账号Token</param>
        /// <param name="groupId">群组ID</param>
        /// <returns>
        /// statusCode:请求状态码,取值000000(成功)
        /// </returns>
        public FoundationsViewModel LogoutGroup(string restAddress, string restPort, string subAccountSid, string subToken, string groupId)
        {
            string date = DateTime.Now.ToString("yyyyMMddhhmmss");

            // 构建URL内容
            string sigstr = MD5Encrypt(subAccountSid + subToken + date);
            string uriStr = string.Format("https://{0}:{1}/{2}/SubAccounts/{3}/Group/LogoutGroup?sig={4}", restAddress, restPort, m_softVer, subAccountSid, sigstr);

            StringBuilder sb = new StringBuilder();

            sb.Append("<?xml version='1.0' encoding='UTF-8'?> <Request>");
            sb.Append("<groupId>").Append(groupId).Append("</groupId>");
            sb.Append("</Request> ");

            string responseStr             = CreateHttpPost(uriStr, date, subAccountSid, sb.ToString(), EBodyType.EType_XML);
            FoundationsViewModel viewModel = XMLDeserialize(typeof(FoundationsViewModel), responseStr) as FoundationsViewModel;

            return(viewModel);
        }