public void CreateAndVerifyConferenceActionCallbackTest() { ConferenceCreateActionCallback cs = ConferenceCreateActionCallback.fromJson("{\"accountId\":\"AC766bc3fb87212042619f41ac6344feef2f1b0d00\",\"callId\":\"CA98fed82dfb2295fdd9f4a8c102c321cb6cedace6\",\"callStatus\":\"inProgress\",\"conferenceId\":\"CFa31a223c04ac99576d14ce3e50815449fe673bde\",\"direction\":\"inbound\",\"from\":\"1000000051\",\"parentCallId\":null,\"queueId\":null,\"to\":\"+11112223333\"}"); Assert.IsNotNull(cs); Assert.AreEqual(cs.getAccountId, "AC766bc3fb87212042619f41ac6344feef2f1b0d00"); Assert.AreEqual(cs.getConferenceId, "CFa31a223c04ac99576d14ce3e50815449fe673bde"); }
[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")); }