Example #1
0
        private void OK_Button_Click(object sender, EventArgs e)
        {
            try
            {
                HelpHandler help = new HelpHandler();
                help.TextBoxEmptyChecked(this.groupBox1);
                site           = new SiteInfoEx();
                this.site.name = this.tb_site_Name.Text.ToString();
                this.site.uri  = this.tb_site_URI.Text.ToString();
                this.site.type = Convert.ToInt32(this.tb_site_Type.Text.ToString());
                this.conf_ID   = this.tb_conferenceID.Text.ToString();

                this.DialogResult = DialogResult.Yes;
            }
            catch (Exception error)
            {
                MessageBox.Show(error.ToString());
            }
        }
Example #2
0
        private void btn_scheduleConf_Click(object sender, EventArgs e)
        {
            try
            {
                if (sitesTable == null)
                {
                    return;
                }
                List <SiteInfoEx> siteslist = new List <SiteInfoEx>();
                for (int i = 0; i < sitesTable.Rows.Count; i++)
                {
                    if (sitesTable.Rows[i]["checked"].Equals("1"))
                    {
                        //新建会场
                        SiteInfoEx siteInfo1 = new SiteInfoEx();
                        //会场URI为01033001
                        siteInfo1.uri = sitesTable.Rows[i]["siteURI"].ToString();
                        //会场速率为1920K
                        siteInfo1.rate = "1920K";
                        //会场名称为site1
                        siteInfo1.name = sitesTable.Rows[i]["siteName"].ToString();
                        //呼叫方式为MCU主动呼叫会场
                        siteInfo1.dialingMode = 0;
                        //会场来源为内部会场
                        siteInfo1.from = 0;
                        //会场类型为H.323会场类型
                        siteInfo1.type = 4;
                        //会场视频格式为4CIF
                        siteInfo1.videoFormat = 0;
                        //会场视频协议为H.263
                        siteInfo1.videoProtocol     = 0;
                        siteInfo1.isLockVideoSource = 1;
                        siteInfo1.participantType   = 2;

                        siteslist.Add(siteInfo1);
                    }
                }

                ConferenceInfoEx conferenceInfo = new ConferenceInfoEx();
                conferenceInfo.name      = this.tb_Name.Text.ToString();
                conferenceInfo.beginTime = Convert.ToDateTime(this.tb_BeginTime.Text.ToString());
                conferenceInfo.duration  = this.tb_Duration.Text.ToString();
                conferenceInfo.rate      = this.tb_Rate.ToString();
                conferenceInfo.sites     = siteslist.ToArray <SiteInfoEx>();

                //调用会议服务的scheduleConfEx方法预约会议,返回TPSDKResponseEx<ConferenceInfoEx>对象
                TPSDKResponseEx <ConferenceInfoEx> result = cmService.scheduleConfEx(conferenceInfo);
                //调用TPSDKResponseEx<T>中的resultCode方法,获取返回码,如果返回码为0,则表示成功,否则,表示失败,具体失败原因,请参考错误码列表。
                int resultCode = result.resultCode;
                if (0 == resultCode)
                {
                    //预约成功,则返回预约后的会议信息
                    confercenceInfoEx = result.result;
                    string confId = confercenceInfoEx.confId;
                    this.ConsoleLog("queryScheduleConferencesEx resultCode = " + result.resultCode.ToString() + ";confId = " + confId);
                }
                else
                {
                    this.ConsoleLog("queryScheduleConferencesEx resultCode = " + result.resultCode.ToString());
                }
            }
            catch (Exception error)
            {
                MessageBox.Show(error.ToString());
            }
        }
Example #3
0
        private void Add_Button_Click(object sender, EventArgs e)
        {
            try
            {
                // 会议模板添加到的组织
                this.orgId = this.tb_orgId_Add.Text.ToString();

                // Adhoc会议模板参数
                this.adhocConfTemplate = new AdhocConfTemplateParamEx();
                // Adhoc模板ID, 新增时为0
                adhocConfTemplate.adhocConfTemplateId = this.tb_TemplateId_Add.Text.ToString();
                // 会议模板名称
                adhocConfTemplate.name = this.tb_TemplateName_Add.Text.ToString();
                // 会议激活号码
                adhocConfTemplate.accessCode = this.tb_AccessCode_Add.Text.ToString();
                adhocConfTemplate.duration   = this.tb_Duration_Add.Text.ToString();
                // 计费码
                adhocConfTemplate.billCode = this.tb_billcode_Add.Text.ToString();
                //
                adhocConfTemplate.password = this.tb_Password_Add.Text.ToString();
                // 多画面资源数
                adhocConfTemplate.cpResource = Convert.ToInt32(this.tb_cpResource_Add.Text.ToString());
                // 速率
                adhocConfTemplate.rate = this.tb_Rate_Add.Text.ToString();
                // 媒体流加密方式,0:自动协商是否使用加密
                adhocConfTemplate.mediaEncryptType = Convert.ToInt32(this.tb_mediaEncryptType_Add.Text.ToString());
                // 是否支持直播功能, 0:不支持 1:支持
                adhocConfTemplate.isLiveBroadcast = Convert.ToInt32(this.tb_isLiveBroadcast_Add.Text.ToString());
                // 是否支持录播功能, 0:不支持 1:支持
                adhocConfTemplate.isRecording = Convert.ToInt32(this.tb_isRecording_Add.Text.ToString());
                // 胶片演示方式
                adhocConfTemplate.presentation = 0;
                // 辅流视频参数
                VideoParamEx videoParam = new VideoParamEx();
                // 视频协议为H.261协议
                videoParam.protocol = 1;
                // 视频格式为Auto
                videoParam.format = 0;
                adhocConfTemplate.presentationVideo = videoParam;
                // 会议主会场
                //adhocConfTemplate.mainSiteUri = "01033001";
                // 会议通知信息
                ConferenceNoticeEx notice = new ConferenceNoticeEx();
                // 邮箱地址
                notice.email = "*****@*****.**";
                // 通知信息内容
                notice.content = "0";
                // 电话号码
                notice.telephone         = "051269993940";
                adhocConfTemplate.notice = notice;

                List <SiteInfoEx> sites = new List <SiteInfoEx>();
                //新建一个SiteInfoEx对象
                SiteInfoEx siteInfo1 = new SiteInfoEx();
                //会场URI为01033001
                siteInfo1.uri = this.tb_Site1_URI_Add.Text.ToString();
                //会场速率为1920k
                siteInfo1.rate = this.tb_Site1_Rate_Add.Text.ToString();
                //会场名称为site1
                siteInfo1.name = this.tb_Site1_Name_Add.Text.ToString();
                //呼叫方式为MCU主动呼叫会场
                siteInfo1.dialingMode = Convert.ToInt32(this.tb_Site1_Call_Add.Text.ToString());
                //会场来源为内部会场
                siteInfo1.from = Convert.ToInt32(this.tb_Site1_Come_Add.Text.ToString());
                //会场类型为H.323会场类型
                siteInfo1.type = Convert.ToInt32(this.tb_Site1_Type_Add.Text.ToString());
                //会场视频格式为Auto
                siteInfo1.videoFormat = Convert.ToInt32(this.tb_Site1_VF_Add.Text.ToString());
                //会场视频协议为H.261
                siteInfo1.videoProtocol = Convert.ToInt32(this.tb_Site1_VP_Add.Text.ToString());;
                //预约会议需要两个以上会场,所以再新建一个会场
                SiteInfoEx siteInfo2 = new SiteInfoEx();
                siteInfo2.uri           = this.tb_Site2_URI_Add.Text.ToString();
                siteInfo2.rate          = this.tb_Site2_Rate_Add.Text.ToString();
                siteInfo2.name          = this.tb_Site2_Name_Add.Text.ToString();
                siteInfo2.dialingMode   = Convert.ToInt32(this.tb_Site2_Call_Add.Text.ToString());
                siteInfo2.from          = Convert.ToInt32(this.tb_Site2_Come_Add.Text.ToString());
                siteInfo2.type          = Convert.ToInt32(this.tb_Site2_Type_Add.Text.ToString());
                siteInfo2.videoFormat   = Convert.ToInt32(this.tb_Site2_VF_Add.Text.ToString());
                siteInfo2.videoProtocol = Convert.ToInt32(this.tb_Site2_VP_Add.Text.ToString());
                //向会议模板中添加会场
                sites.Add(siteInfo1);
                sites.Add(siteInfo2);
                SiteInfoEx[] site = sites.ToArray();
                adhocConfTemplate.sites = site;

                this.DialogResult = DialogResult.Yes;
            }
            catch (Exception error)
            {
                MessageBox.Show(error.ToString());
            }
        }
Example #4
0
        private void OK_Button_Click(object sender, EventArgs e)
        {
            try
            {
                HelpHandler help = new HelpHandler();
                help.TextBoxEmptyChecked(this.groupBox1);

                #region 普通会议
                scheduleConf.name      = this.tb_Name.Text.ToString();
                scheduleConf.beginTime = Convert.ToDateTime(this.tb_BeginTime.Text.ToString());
                scheduleConf.duration  = this.tb_Duration.Text.ToString();
                scheduleConf.rate      = this.tb_Rate.Text.ToString();
                //新建会场
                SiteInfoEx siteInfo1 = new SiteInfoEx();
                //会场URI为01033001
                siteInfo1.uri = this.tb_Site1_URI.Text.ToString();
                //会场速率为1920K
                siteInfo1.rate = "1920K";
                //会场名称为site1
                siteInfo1.name = this.tb_Site1_Name.Text.ToString();
                //呼叫方式为MCU主动呼叫会场
                siteInfo1.dialingMode = 0;
                //会场来源为内部会场
                siteInfo1.from = 0;
                //会场类型为H.323会场类型
                siteInfo1.type = 4;
                //会场视频格式为4CIF
                siteInfo1.videoFormat = 0;
                //会场视频协议为H.263
                siteInfo1.videoProtocol     = 0;
                siteInfo1.isLockVideoSource = 1;
                siteInfo1.participantType   = 2;

                SiteInfoEx siteInfo2 = new SiteInfoEx();
                siteInfo2.uri               = this.tb_Site2_URI.Text.ToString();
                siteInfo2.name              = this.tb_Site2_Name.Text.ToString();
                siteInfo2.rate              = "1920K";
                siteInfo2.dialingMode       = 0;
                siteInfo2.from              = 0;
                siteInfo2.type              = 4;
                siteInfo2.videoFormat       = 0;
                siteInfo2.videoProtocol     = 0;
                siteInfo2.isLockVideoSource = 1;
                siteInfo2.participantType   = 2;
                //向会议中添加会场
                SiteInfoEx[] sites = { siteInfo1, siteInfo2 };
                scheduleConf.sites            = sites;
                scheduleConf.isRecording      = 0;
                scheduleConf.cpResouce        = Convert.ToInt32(this.tb_cpResouce_Add.Text.ToString());
                scheduleConf.password         = this.tb_PWD_Add.Text.ToString();
                scheduleConf.chairmanPassword = this.tb_chairmanPWD_Add.Text.ToString();
                scheduleConf.mainSiteUri      = this.tb_mainSite_Add.Text.ToString();
                //会议通知
                ConferenceNotice conferenceNotice = new ConferenceNotice();
                conferenceNotice.content      = "123";
                conferenceNotice.email        = "*****@*****.**";
                scheduleConf.conferenceNotice = conferenceNotice;
                #endregion

                #region 周期会议
                scheduleCurrenceConf.name      = this.tb_Name.Text.ToString();
                scheduleCurrenceConf.beginTime = Convert.ToDateTime(this.tb_BeginTime.Text.ToString());
                scheduleCurrenceConf.duration  = this.tb_Duration.Text.ToString();
                scheduleCurrenceConf.rate      = this.tb_Rate.Text.ToString();

                scheduleCurrenceConf.sites            = sites;
                scheduleCurrenceConf.isRecording      = 0;
                scheduleCurrenceConf.cpResouce        = Convert.ToInt32(this.tb_cpResouce_Add.Text.ToString());
                scheduleCurrenceConf.password         = this.tb_PWD_Add.Text.ToString();
                scheduleCurrenceConf.chairmanPassword = this.tb_chairmanPWD_Add.Text.ToString();
                scheduleCurrenceConf.mainSiteUri      = this.tb_mainSite_Add.Text.ToString();

                scheduleCurrenceConf.frequency = Convert.ToInt32(this.tb_frequency_Add.Text.ToString());
                scheduleCurrenceConf.interval  = Convert.ToInt32(this.tb_Interval_Add.Text.ToString());
                scheduleCurrenceConf.count     = Convert.ToInt32(this.tb_Count_Add.Text.ToString());
                scheduleCurrenceConf.timeZone  = this.tb_timeZone_Add.Text.ToString();

                #endregion

                this.DialogResult = DialogResult.Yes;
            }
            catch (Exception error)
            {
                MessageBox.Show(error.ToString());
            }
        }
Example #5
0
        public override string ToString()
        {
            if (tempClass != null)
            {
                if (typeof(T) == typeof(ConferenceInfoEx))
                {
                    ConferenceInfoEx temp = (ConferenceInfoEx)tempClass;
                    if (temp.sites != null && temp.beginTime != null)
                    {
                        StringBuilder buffer = new StringBuilder();
                        buffer.Append("(");
                        for (int i = 0; i < temp.sites.Length; i++)
                        {
                            buffer.Append("name = " + temp.sites[i].name + "," + "uri = " + temp.sites[i].uri);
                            if (i < temp.sites.Length - 1)
                            {
                                buffer.Append(";");
                            }
                        }
                        buffer.Append(")");
                        return("{confId = " + temp.confId + ",Name = " + temp.name + ",Status = " + temp.status + ",accessCode = " + temp.accessCode + ",beginTime = " + temp.beginTime.ToString() + ",sites = " + buffer.ToString() + "}");
                    }
                    return("{confId = " + temp.confId + ",Name = " + temp.name + ",Status = " + temp.status + ",accessCode = " + temp.accessCode + ",sites = null" + "}");
                }
                else if (typeof(T) == typeof(RecurrenceConfInfoEx))
                {
                    RecurrenceConfInfoEx temp = (RecurrenceConfInfoEx)tempClass;
                    return("{confId = " + temp.confId + ",Name = " + temp.name + ",Status = " + temp.status + ",accessCode = " + temp.accessCode + "}");
                }
                else if (typeof(T) == typeof(ConferenceStatusEx))
                {
                    ConferenceStatusEx temp = (ConferenceStatusEx)tempClass;
                    return("{confId = " + temp.id + ",Name = " + temp.name + ",Status = " + temp.status + ",beginTime = " + temp.beginTime + "}");
                }
                else if (typeof(T) == typeof(SiteStatusEx))
                {
                    SiteStatusEx temp = (SiteStatusEx)tempClass;
                    return("{siteUri = " + temp.uri + ",Name = " + temp.name + ",Status = " + temp.status + "}");
                }
                else if (typeof(T) == typeof(SiteAccessInfoEx))
                {
                    SiteAccessInfoEx temp = (SiteAccessInfoEx)tempClass;
                    return("{siteUri = " + temp.uri + ",Name = " + temp.name + ",confaccessCode = " + temp.confAccessCode + "}");
                }
                else if (typeof(T) == typeof(SiteMCUEx))
                {
                    SiteMCUEx temp = (SiteMCUEx)tempClass;
                    return("{siteUri = " + temp.siteUri + ",mcuId = " + temp.mcuId + "}");
                }
                else if (typeof(T) == typeof(AdhocConfFreeBusyStateEx))
                {
                    AdhocConfFreeBusyStateEx temp   = (AdhocConfFreeBusyStateEx)tempClass;
                    StringBuilder            buffer = new StringBuilder();
                    buffer.Append("(");
                    for (int i = 0; i < temp.freebusys.Length; i++)
                    {
                        buffer.Append("confId = " + temp.freebusys[i].confId + "," + "state = " + temp.freebusys[i].state);
                        if (i < temp.freebusys.Length - 1)
                        {
                            buffer.Append(";");
                        }
                    }
                    buffer.Append(")");
                    return("{confAccessCode = " + temp.confAccessCode + ",freebusys = " + buffer.ToString() + "}");
                }
                else if (typeof(T) == typeof(AdhocConferenceEx))
                {
                    AdhocConferenceEx temp = (AdhocConferenceEx)tempClass;
                    return("{Name = " + temp.name + ",confaccessCode = " + temp.confAccessCode + "}");
                }
                else if (typeof(T) == typeof(AdhocConfTemplateParamEx))
                {
                    AdhocConfTemplateParamEx temp = (AdhocConfTemplateParamEx)tempClass;
                    return("{Name = " + temp.name + ",adhocConfTemplateId = " + temp.adhocConfTemplateId + ",accessCode = " + temp.accessCode + "}");
                }
                else if (typeof(T) == typeof(MultiPointCDREx))
                {
                    MultiPointCDREx temp = (MultiPointCDREx)tempClass;
                    return("{siteName = " + temp.siteName + ",siteUri = " + temp.siteUri + ",siteType = " + temp.siteType.ToString() +
                           ",conferenceName = " + temp.conferenceName + ",conferenceId = " + temp.conferenceId + "}");
                }
                else if (typeof(T) == typeof(PointToPointCDREx))
                {
                    PointToPointCDREx temp = (PointToPointCDREx)tempClass;
                    return("{callingUri = " + temp.callingUri + ",calledUri = " + temp.calledUri + "}");
                }
                else if (typeof(T) == typeof(NotificationEx))
                {
                    NotificationEx temp = (NotificationEx)tempClass;
                    return("{" + "}");
                }
                else if (typeof(T) == typeof(TerminalInfoEx))
                {
                    TerminalInfoEx temp = (TerminalInfoEx)tempClass;
                    return("{siteName = " + temp.name + ",siteUri = " + temp.uri + ",siteType = " + temp.type.ToString() + "}");
                }
                else if (typeof(T) == typeof(SiteInfoEx))
                {
                    SiteInfoEx temp = (SiteInfoEx)tempClass;
                    return("{siteName = " + temp.name + ",siteUri = " + temp.uri + ",siteType = " + temp.type.ToString() + "}");
                }
                else if (typeof(T) == typeof(OrganizationItemEx))
                {
                    OrganizationItemEx temp = (OrganizationItemEx)tempClass;
                    return("{Name = " + temp.name + ",id = " + temp.id + "}");
                }
                else if (typeof(T) == typeof(MCUResourceEx))
                {
                    MCUResourceEx       temp    = (MCUResourceEx)tempClass;
                    MCUResourceItemEx[] temp1   = temp.resourceList;
                    StringBuilder       buffer1 = new StringBuilder();
                    StringBuilder       buffer2 = new StringBuilder();
                    buffer1.Append("(");
                    for (int i = 0; i < temp1.Length; i++)
                    {
                        ResourceOccupiedStatusEx[] temp2 = temp1[i].resourceStatus;
                        buffer1.Append(temp1[i].resourceType.ToString());
                        buffer2.Append("(");
                        for (int j = 0; j < temp2.Length; j++)
                        {
                            ResourceOccupiedStatusEx temp3 = temp2[i];
                            buffer2.Append("freeCount = " + temp3.freeCount + ",totalCount = " + temp3.totalCount);
                            if (i < temp2.Length - 1)
                            {
                                buffer2.Append(";");
                            }
                        }
                        if (i < temp1.Length - 1)
                        {
                            buffer1.Append(";");
                        }
                    }

                    buffer1.Append(")");
                    buffer2.Append(")");
                    return("{mcuId = " + temp.mcuId + ",resourceType = " + buffer1.ToString() + ",Count = " + buffer2.ToString() + "}");
                }
                else if (typeof(T) == typeof(MCUInfoEx))
                {
                    MCUInfoEx temp = (MCUInfoEx)tempClass;
                    return("{mucName = " + temp.name + ",mcuId = " + temp.id + "}");
                }
                else
                {
                    return("No this class type !");
                }
            }
            return("object is null!");
        }
Example #6
0
        /// <summary>
        /// 添加会场
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_addSiteToConf_Click(object sender, EventArgs e)
        {
            try
            {
                if (sitesTable == null)
                {
                    return;
                }
                List <SiteInfoEx> siteslist = new List <SiteInfoEx>();
                for (int i = 0; i < sitesTable.Rows.Count; i++)
                {
                    if (sitesTable.Rows[i]["checked"].Equals("1"))
                    {
                        //新建会场
                        SiteInfoEx siteInfo1 = new SiteInfoEx();
                        //会场URI为01033001
                        siteInfo1.uri = sitesTable.Rows[i]["siteURI"].ToString();
                        //会场速率为1920K
                        siteInfo1.rate = "1920K";
                        //会场名称为site1
                        siteInfo1.name = sitesTable.Rows[i]["siteName"].ToString();
                        //呼叫方式为MCU主动呼叫会场
                        siteInfo1.dialingMode = 0;
                        //会场来源为内部会场
                        siteInfo1.from = 0;
                        //会场类型为H.323会场类型
                        siteInfo1.type = 4;
                        //会场视频格式为4CIF
                        siteInfo1.videoFormat = 0;
                        //会场视频协议为H.263
                        siteInfo1.videoProtocol     = 0;
                        siteInfo1.isLockVideoSource = 1;
                        siteInfo1.participantType   = 2;

                        siteslist.Add(siteInfo1);
                    }
                }
                if (siteslist.Count == 0)
                {
                    return;
                }
                for (int i = 0; i < siteslist.Count; i++)
                {
                    //新建一个SiteInfoEX对象
                    SiteInfoEx siteInfo = siteslist[i];

                    //调用会议服务中的addSiteToConfEx方法,返回TPSDKResponseEx<List<SiteAccessInfoEx>>>对象。
                    TPSDKResponseEx <List <SiteAccessInfoEx> > result = cmService.addSiteToConfEx(this.txt_confId.Text, siteInfo, null);
                    //如果返回码为0,则表示成功,否则,表示失败,具体失败原因,请参考错误码列表。
                    this.ConsoleLog("addSiteToConfEx resultCode = " + result.resultCode);
                    if (0 == result.resultCode)
                    {
                        bool flag = false;
                        for (int j = 0; j < confSitesTable.Rows.Count; j++)
                        {
                            if (confSitesTable.Rows[j]["siteURI"].Equals(siteInfo.uri))
                            {
                                flag = true;
                            }
                        }
                        if (flag)
                        {
                            this.confSitesTable.Rows.Add(siteInfo.uri, siteInfo.name, siteInfo.type, 0);
                        }
                        else
                        {
                            this.ConsoleLog("The site is already exist: " + siteInfo.uri);
                        }
                    }
                }
                this.dgw_ConfSitesList.Update();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }