/// <summary> /// To find the Status of the Existing Meeting /// </summary> /// <param name="MeetingId">To find the Status of the Existing Meeting with the Specified MeetingId</param> /// <returns></returns> public dynamic IsMeetingRunning(IsMeetingRunning ismeetingrunning) { try { string querystring = ""; PropertyInfo[] properties = typeof(IsMeetingRunning).GetProperties(); foreach (PropertyInfo property in properties) { // Console.WriteLine("{0}:{1}", property.Name, property.GetValue(createmeeting, null)); if (property.GetValue(ismeetingrunning, null) != null) { //Avoid 0 value from class if (property.GetValue(ismeetingrunning, null).GetType() == typeof(int)) { if ((int)property.GetValue(ismeetingrunning, null) == 0) { continue; } } //Avoid false value from class if (property.GetValue(ismeetingrunning, null).GetType() == typeof(bool)) { if ((bool)property.GetValue(ismeetingrunning, null) == false) { continue; } } if (querystring == "") { querystring += property.Name + "=" + property.GetValue(ismeetingrunning, null); } else { querystring += "&" + property.Name + "=" + property.GetValue(ismeetingrunning, null); } } } Console.WriteLine("querystring" + querystring); string StrParameters = querystring; string StrSHA1_CheckSum = ClsData.getSha1("isMeetingRunning" + StrParameters + StrSalt); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(StrServerIPAddress + "isMeetingRunning?" + StrParameters + "&checksum=" + StrSHA1_CheckSum); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader sr = new StreamReader(response.GetResponseStream()); XDocument doc = XDocument.Parse(sr.ReadToEnd()); string jsonText = JsonConvert.SerializeXNode(doc); dynamic obj = JsonConvert.DeserializeObject <ExpandoObject>(jsonText); return(obj); } catch (Exception ex) { return(null); } }
/// <summary> /// To delete Recordings /// </summary> /// <param name="recordID"></param> /// <returns></returns> public dynamic deleteRecordings(deleteRecordingsParameters deleteRecordingsParameters) { try { string StrParameters = "recordID=" + deleteRecordingsParameters.recordID; string StrSHA1_CheckSum = ClsData.getSha1("deleteRecordings" + StrParameters + StrSalt); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(StrServerIPAddress + "deleteRecordings?" + "checksum=" + StrSHA1_CheckSum); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader sr = new StreamReader(response.GetResponseStream()); XDocument doc = XDocument.Parse(sr.ReadToEnd()); string jsonText = JsonConvert.SerializeXNode(doc); dynamic obj = JsonConvert.DeserializeObject <ExpandoObject>(jsonText); return(obj); } catch (Exception ex) { return(null); } }
/// <summary> /// To Get all the Meeting's Information running in the Server /// </summary> /// <returns></returns> public GetMeetingResponse getMeetings() { try { Random r = new Random(0); string StrParameters = ""; string StrSHA1_CheckSum = ClsData.getSha1("getMeetings" + StrParameters + StrSalt); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(StrServerIPAddress + "getMeetings?" + "checksum=" + StrSHA1_CheckSum); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader sr = new StreamReader(response.GetResponseStream()); XmlSerializer serializer = new XmlSerializer(typeof(Response.GetMeetingResponse)); var obj = (Response.GetMeetingResponse)serializer.Deserialize(sr); return(obj); } catch (Exception ex) { throw ex; } }
/// <summary> /// Creates the Meeting /// </summary> /// <param name="MeetingName">Creates the Meeting with the Specified MeetingName</param> /// <param name="MeetingId">Creates the Meeting with the Specified MeetingId</param> /// <param name="AttendeePW">Creates the Meeting with the Specified AttendeeePassword</param> /// <param name="moderatorPW">Creates the Meeting with the Specified ModeratorPassword</param> /// <returns></returns> public dynamic CreateMeeting(CreateMeetingParameters createmeeting) { try { //CreateMeetingParameters newcreatemeeting = new CreateMeetingParameters(); string querystring = ""; PropertyInfo[] properties = typeof(CreateMeetingParameters).GetProperties(); foreach (PropertyInfo property in properties) { Console.WriteLine("{0}:{1}", property.Name, property.GetValue(createmeeting, null)); if (property.GetValue(createmeeting, null) != null) { //Avoid 0 value from class if (property.GetValue(createmeeting, null).GetType() == typeof(int)) { if ((int)property.GetValue(createmeeting, null) == 0) { continue; } } bool toLower = false; //Avoid false value from class if (property.GetValue(createmeeting, null).GetType() == typeof(bool)) { if ((bool)property.GetValue(createmeeting, null) == false) { continue; } else { toLower = true; } } if (querystring == "") { querystring += property.Name + "=" + (toLower? property.GetValue(createmeeting, null).ToString().ToLower(): property.GetValue(createmeeting, null)); } else { querystring += "&" + property.Name + "=" + (toLower ? property.GetValue(createmeeting, null).ToString().ToLower() : property.GetValue(createmeeting, null)); } } } Console.WriteLine("querystring" + querystring); string StrParameters = querystring; string StrSHA1_CheckSum = ClsData.getSha1("create" + StrParameters + StrSalt); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(StrServerIPAddress + "create?" + StrParameters + "&checksum=" + StrSHA1_CheckSum); request.Method = "POST"; string xml = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "Slide.xml"); var stream = request.GetRequestStream(); byte[] messageBytes = System.Text.Encoding.UTF8.GetBytes(xml); stream.Write(messageBytes, 0, messageBytes.Length); stream.Flush(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); StreamReader sr = new StreamReader(response.GetResponseStream()); XDocument doc = XDocument.Parse(sr.ReadToEnd()); string jsonText = JsonConvert.SerializeXNode(doc); dynamic obj = JsonConvert.DeserializeObject <ExpandoObject>(jsonText); return(obj); } catch (Exception ex) { return(null); } }
/// <summary> /// To Join in the Existing Meeting /// </summary> /// <param name="MeetingName">To Join in the ExistingMeeting with the Specified MeetingName</param> /// <param name="MeetingId">To Join in the ExistingMeeting with the Specified MeetingId</param> /// <param name="Password">To Join in the ExistingMeeting with the Specified ModeratorPW/AttendeePW</param> /// <param name="ShowInBrowser">If its true,will Show the Meeting UI in the Browser </param> /// <returns></returns> public string JoinMeeting(Parameters joinmeeting) { try { string querystring = ""; PropertyInfo[] properties = typeof(Parameters).GetProperties(); foreach (PropertyInfo property in properties) { // Console.WriteLine("{0}:{1}", property.Name, property.GetValue(createmeeting, null)); if (property.GetValue(joinmeeting, null) != null) { //Avoid 0 value from class if (property.GetValue(joinmeeting, null).GetType() == typeof(int)) { if ((int)property.GetValue(joinmeeting, null) == 0) { continue; } } //Avoid false value from class if (property.GetValue(joinmeeting, null).GetType() == typeof(bool)) { if ((bool)property.GetValue(joinmeeting, null) == false) { continue; } } if (querystring == "") { querystring += property.Name + "=" + property.GetValue(joinmeeting, null); } else { querystring += "&" + property.Name + "=" + property.GetValue(joinmeeting, null); } } } Console.WriteLine("querystring" + querystring); string StrParameters = querystring; string StrSHA1_CheckSum = ClsData.getSha1("join" + StrParameters + StrSalt); return(StrServerIPAddress + "join?" + StrParameters + "&checksum=" + StrSHA1_CheckSum); //if (!joinmeeting.ShowInBrowser) //{ // HttpWebRequest request = (HttpWebRequest)WebRequest.Create(StrServerIPAddress + "join?" + StrParameters + "&checksum=" + StrSHA1_CheckSum); // HttpWebResponse response = (HttpWebResponse)request.GetResponse(); // StreamReader sr = new StreamReader(response.GetResponseStream()); // XDocument doc = XDocument.Parse(sr.ReadToEnd()); // string jsonText = JsonConvert.SerializeXNode(doc); // dynamic obj = JsonConvert.DeserializeObject<ExpandoObject>(jsonText); // return obj; //} //else //{ // Process.Start(StrServerIPAddress + "/bigbluebutton/api/join?" + StrParameters + "&checksum=" + StrSHA1_CheckSum); // return null; //} } catch (Exception ex) { return(null); } }