예제 #1
0
        /// <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());
            }
        }
예제 #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());
            }
        }
예제 #3
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!");
        }