public OzekiLiveStream() { softPhone = SoftPhoneFactory.CreateSoftPhone(SoftPhoneFactory.GetLocalIP(), 5700, 5750); softPhone.IncomingCall += SoftPhone_IncomingCall; conferenceRoom = new ConferenceRoom(); conferenceRoom.StartConferencing(); }
[HttpPost("GetDigitsDone")] // POST /voice/GetDigitsDone public ActionResult GetDigitsDone(GetDigitsActionCallback request) { // Make OutDial request once conference has been created PerCLScript script = new PerCLScript(); string callId = request.getCallId; string digits = request.getDigits; ConferenceRoom room = conferenceRooms[digits]; if (room == null) { // Handle case where no room with the given code exists } // if participants can't be added yet (actionUrl callback has not been called) notify caller and hang up if (room.isConferencePending) { Say say = new Say(); say.setText("We are sorry, you cannot be added to the conference at this time. Please try again later."); script.Add(say); script.Add(new Hangup()); } else { Say say = new Say(); say.setText("You will be added to the conference momentarily."); script.Add(say); script.Add(makeOrAddToConference(room, digits, callId)); } return(Content(script.toJson(), "application/json")); }
protected virtual ConferenceRoom GetConferenceRoomFromReader(IDataReader reader) { EntityConverter <ConferenceRoom> conferenceRoomEntity = new EntityConverter <ConferenceRoom>(); ConferenceRoom conferenceRoom = conferenceRoomEntity.Convert(reader); return(conferenceRoom); }
public ActionResult ConferenceStatus([FromQuery(Name = "roomCode")] string roomCode, ConferenceStatusCallback request) { PerCLScript script = new PerCLScript(); EConferenceStatus status = request.getStatus; String conferenceId = request.getConferenceId; // find which conference room the conference belongs to ConferenceRoom room = conferenceRooms[roomCode]; if (room == null) { // Handle case where callback is called for a room that does not exist } if (status == EConferenceStatus.Empty && room.canConferenceTerminate) { try { terminateConference(conferenceId); room.conferenceId = null; } catch (FreeClimbException pe) { // Handle error when terminateConference fails } } // after first EMPTY status update conference can be terminated room.canConferenceTerminate = true; return(Content(script.toJson(), "application/json")); }
public async Task <IActionResult> PutConferenceRoom(int id, ConferenceRoom conferenceRoom) { if (id != conferenceRoom.Number) { Log.Information("Nie można aktualizować. Nieprawdiłowy numer pokoju"); return(BadRequest()); } _context.Entry(conferenceRoom).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConferenceRoomExists(id)) { Log.Information("Nie można aktualizować. Pokój nr" + id + " nie istnieje"); return(NotFound()); } else { Log.Information("Zaktualizowano pokój NR:" + id); throw; } } return(NoContent()); }
public async Task <ActionResult <ConferenceRoom> > PostConferenceRoom(ConferenceRoom conferenceRoom) { _context.Rooms.Add(conferenceRoom); await _context.SaveChangesAsync(); Log.Information("Utworzono pokój NR: " + conferenceRoom.Number); return(CreatedAtAction("GetConferenceRoom", new { id = conferenceRoom.Number }, conferenceRoom)); }
public IActionResult Post([FromBody] ConferenceRoom pokoj) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } return(CreatedAtAction("get", pokoj.Number)); }
public Channel(string name, string description, string password) { this.name = name; this.description = description; this.password = password; this.conferenceRoom = new ConferenceRoom(); this.userList = new List <User>(); conferenceRoom.StartConferencing(); }
public ConferenceReply RoomAdd(ConferenceRoom roomAdded) { ConferenceReply conferenceReply = new ConferenceReply(); ConferenceManagement.getInstance().Add(roomAdded); conferenceReply.Name = roomAdded.Name; conferenceReply.IsPrivate = roomAdded.IsPrivate; conferenceReply.Creator = roomAdded.Creator; conferenceReply.AddStatus = "Successful"; return(conferenceReply); }
public void Init() { manager = new ConferenceRoomsManager(); defaultRoom = manager.GetRooms()[0]; var from = new DateTime(2018, 06, 01, 11, 00, 00); var to = new DateTime(2018, 06, 01, 11, 30, 00); var newReservation = new Reservation() { From = from, To = to }; defaultRoom.Reservations.Add(newReservation); }
public void newRoom() { int randomRoom = Random.Range(0, 5); switch (randomRoom) { case 0: // Another corridor // Instantiate and generate the corridor corridorInstance = Instantiate(corridorPrefab).GetComponent <Corridor> (); corridorInstance.Generate(); // Put putin in it putPutinInRoom(corridorInstance); break; case 1: // Instantiate conferenceRoomInstance = Instantiate(conferenceRoomPrefab).GetComponent <ConferenceRoom>(); // Put putin in it putPutinInRoom(conferenceRoomInstance); break; case 2: // Instantiate barInstance = Instantiate(barPrefab).GetComponent <Bar> (); // Put putin in it putPutinInRoom(barInstance); break; case 3: // Instantiate bedroomInstance = Instantiate(bedroomPrefab).GetComponent <Bedroom> (); // Put putin in it putPutinInRoom(bedroomInstance); break; case 4: // Instantiate poolInstance = Instantiate(poolPrefab).GetComponent <Pool> (); // Put putin in it putPutinInRoom(poolInstance); break; } }
private PerCLCommand makeOrAddToConference(ConferenceRoom room, String roomCode, String callId) { // If a conference has not been created for this room yet, return a CreateConference PerCL command if (room.conferenceId == null) { room.isConferencePending = true; room.canConferenceTerminate = false; var conferenceActionUrl = getAppUrl() + $"/voice/ConferenceCreated?roomCode={roomCode}"; var conferenceStatusUrl = getAppUrl() + $"/voice/ConferenceStatus?roomCode={roomCode}"; CreateConference createConference = new CreateConference(conferenceActionUrl); createConference.setStatusCallbackUrl(conferenceStatusUrl); return(createConference); } else { // If a conference has been created and the actionUrl callback has been called, return a AddToConference PerCL command return(new AddToConference(room.conferenceId, callId)); } }
public void newRoom() { int randomRoom = Random.Range (0, 5); switch (randomRoom) { case 0: // Another corridor // Instantiate and generate the corridor corridorInstance = Instantiate (corridorPrefab).GetComponent<Corridor> (); corridorInstance.Generate (); // Put putin in it putPutinInRoom (corridorInstance); break; case 1: // Instantiate conferenceRoomInstance = Instantiate (conferenceRoomPrefab).GetComponent<ConferenceRoom>(); // Put putin in it putPutinInRoom (conferenceRoomInstance); break; case 2: // Instantiate barInstance = Instantiate (barPrefab).GetComponent<Bar> (); // Put putin in it putPutinInRoom (barInstance); break; case 3: // Instantiate bedroomInstance = Instantiate (bedroomPrefab).GetComponent<Bedroom> (); // Put putin in it putPutinInRoom (bedroomInstance); break; case 4: // Instantiate poolInstance = Instantiate (poolPrefab).GetComponent<Pool> (); // Put putin in it putPutinInRoom (poolInstance); break; } }
[HttpPost("ConferenceCreated")] // POST /voice/ConferenceCreated public ActionResult ConferenceCreated([FromQuery(Name = "roomCode")] string roomCode, ConferenceCreateActionCallback request) { PerCLScript script = new PerCLScript(); string conferenceId = request.getConferenceId; string callId = request.getCallId; // find which conference room the newly created conference belongs to ConferenceRoom room = conferenceRooms[roomCode]; if (room == null) { // Handle case where callback is called for a room that does not exist } room.conferenceId = conferenceId; room.isConferencePending = false; Say welcomeToConference = new Say(); welcomeToConference.setText("You are now being added to the conference"); script.Add(welcomeToConference); // Add initial caller to conference script.Add(new AddToConference(conferenceId, request.getCallId)); return(Content(script.toJson(), "application/json")); }
public string GetRoomAsString(ConnectionType connectionType, int roomId) { string result = ""; ConferenceRoom room = null; roomList = connection.RoomList; try { room = roomList.SingleOrDefault(x => x.RoomId == roomId); result = String.Format($"Room Id: {room.RoomId}, Name: {room.Name}, Description: {room.Description}, Site: {room.Site} , Equipments: {string.Join(", ", room.EquipmentList.ToArray())}"); } catch (InvalidOperationException) { Console.WriteLine($"There is no unique room with id: {roomId}."); } catch (NullReferenceException) { Console.WriteLine($"There is no room with id: {roomId}."); } return(result); }
/// <summary> /// Constructor for Hotel /// </summary> /// <param name="name">The name of the hotel</param> public Hotel(string name) { this.name = name; rooms = new List <BedRoom>(); conferenceRoom = new ConferenceRoom(); }
/// <summary> /// Use this method to add a new conference to this ConferenceList. If /// a meeting with this Id already exists, ArgumentException is thrown. /// </summary> /// <param name="confId"> Id of the Conference to be added </param> /// <param name="conference"> Reference to Conference object associated with Id </param> public void Add(String confId, ConferenceRoom conference) { ConfList.Add(confId, conference); }
public void Cleanup() { manager = null; defaultRoom = null; }
public string AddOrUpdateConferenceRoom(string crJsonObject) { Result result = new Result(); ConferenceRoom conferenceRoom = null; bool resourceAdd = false; bool priceAdd = false; try { conferenceRoom = JsonConvert.DeserializeObject <ConferenceRoom>(crJsonObject); } catch (Exception ex) { return(JsonConvert.SerializeObject(Result.Exception(msg: "json转换对象异常,请查阅异常信息并检查字段!", exmsg: ex.StackTrace))); } try { DbContext dc = DbContextFactory.Create(); var resource = dc.Set <T_Resource>().Where(a => a.ID == conferenceRoom.CRNo).FirstOrDefault(); var price = dc.Set <T_ResourcePrice>().Where(a => a.ResourceID == conferenceRoom.CRNo).FirstOrDefault(); if (price == null) { price = new T_ResourcePrice(); priceAdd = true; } if (resource == null) { result.Msg = "目标数据库无此数据,随后进行添加操作;"; resource = new T_Resource(); resourceAdd = true; } else { result.Msg = "目标数据库存在此数据,随后进行更新操作;"; } resource.ID = conferenceRoom.CRNo; resource.Name = conferenceRoom.CRName; resource.Number = conferenceRoom.CRCapacity; resource.RangeNum = conferenceRoom.CRCapacity.ToString(); resource.Area = conferenceRoom.CRBuildSize; resource.Loc1 = conferenceRoom.ParkNo; resource.ResourceKindID = 3; resource.Location = conferenceRoom.CRAddr; resource.Deposit = conferenceRoom.CRDeposit; resource.Enable = conferenceRoom.CRISEnable; resource.CreateUser = conferenceRoom.CRCreator; resource.CreateTime = conferenceRoom.CRCreateDate; resource.UpdateTime = conferenceRoom.CRUpdateDate; resource.UpdateUser = conferenceRoom.CRUpdateUser; price.ResourceID = conferenceRoom.CRNo; price.HourEnable = conferenceRoom.CRIsHour; price.HourInPrice = conferenceRoom.CRINPriceHour; price.HourOutPrice = conferenceRoom.CROUTPriceHour; price.HDayEnable = conferenceRoom.CRIsHalfDay; price.HDayInPrice = conferenceRoom.CRINPriceHalfDay; price.HDayOutPrice = conferenceRoom.CROUTPriceHalfDay; price.DayEnable = conferenceRoom.CRIsDay; price.DayInPrice = conferenceRoom.CRINPriceDay; price.DayOutPrice = conferenceRoom.CROUTPriceDay; price.DelayEnable = true; price.DelayInPrice = conferenceRoom.CRINPriceDelay; price.DelayOutPrice = conferenceRoom.CROUTPriceDelay; if (resourceAdd) { dc.Set <T_Resource>().Add(resource); } else { dc.Set <T_Resource>().AddOrUpdate(resource); } if (priceAdd) { dc.Set <T_ResourcePrice>().Add(price); } else { dc.Set <T_ResourcePrice>().AddOrUpdate(price); } dc.SaveChanges(); result.Msg += "操作成功!"; result.Flag = 1; } catch (Exception ex) { return(JsonConvert.SerializeObject(Result.Exception(msg: "添加或更新异常,请查阅异常信息!", exmsg: ex.StackTrace))); } return(JsonConvert.SerializeObject(result)); }
public void InitializeConferenceRoom() { conferenceRoom = new ConferenceRoom(); conferenceRoom.StartConferencing(); }
public JsonResult UpdateStudentRecord(ConferenceRoom stdn) { return(Json(ConferenceManagement.getInstance().EditRoom(stdn))); }
public async Task CreateConferenceRoomAsync([FromBody] ConferenceRoom conferenceRoom) { await _repository.InsertEntityAsync(CollectionName, conferenceRoom); }
public async Task UpdateConferenceRoomAsync(string id, [FromBody] ConferenceRoom conferenceRoom) { conferenceRoom.id = Guid.Parse(id).ToString(); await _repository.UpdateEntityAsync(CollectionName, id, conferenceRoom); }