/// <summary> /// 利用Ad hoc会议模板预约会议 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btn_scheduleConfEx_Click(object sender, EventArgs e) { try { if (adhocConfTemplate == null) { return; } ConferenceInfoEx conferenceInfo = new ConferenceInfoEx(); conferenceInfo.name = adhocConfTemplate.name; conferenceInfo.beginTime = DateTime.Now; conferenceInfo.duration = adhocConfTemplate.duration; conferenceInfo.rate = adhocConfTemplate.rate; conferenceInfo.sites = adhocConfTemplate.sites; TPSDKResponseEx <ConferenceInfoEx> result = cmService.scheduleConfEx(conferenceInfo); //调用TPSDKResponseEx<T>中的resultCode方法,获取返回码,如果返回码为0,则表示成功,否则,表示失败,具体失败原因,请参考错误码列表。 int resultCode = result.resultCode; if (0 == resultCode) { //预约成功,则返回预约后的会议信息 string confId = result.result.confId; this.ConsoleLog("scheduleConfEx by adhocTemplate resultCode = " + resultCode.ToString() + ";confId = " + confId); } else { this.ConsoleLog("scheduleConfEx by adhocTemplate resultCode = " + resultCode.ToString()); } } catch (Exception error) { MessageBox.Show(error.ToString()); } }
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()); } }