Skip to content

Commit

Permalink
Fix conference api (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingster authored Jun 14, 2022
1 parent 688c52a commit 4f3dc20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tinyphone/phone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ namespace tp {
if (c->getId() != call->getId()){
try {
c->UnHoldCall();
aud_med2 = call->getAudioMedia(-1);
aud_med2 = c->getAudioMedia(-1);
aud_med.startTransmit(aud_med2);
aud_med2.startTransmit(aud_med);
} catch(...) {
Expand All @@ -512,7 +512,7 @@ namespace tp {
if (c->getId() != call->getId()){
try {
c->HoldCall();
aud_med2 = call->getAudioMedia(-1);
aud_med2 = c->getAudioMedia(-1);
aud_med.stopTransmit(aud_med2);
aud_med2.stopTransmit(aud_med);
} catch(...) {
Expand Down
5 changes: 5 additions & 0 deletions tinyphone/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,11 @@ void TinyPhoneHttpServer::Start() {
json response = {
{ "call_id" , call_id }
};
if (req.method == crow::HTTPMethod::Put && call->HoldState() == +HoldStatus::LOCAL_HOLD ){
response["message"] = "Bad Request, CallOnHold Currently";
response["status"] = "400";
return tp::response(400, response);
}
switch (req.method)
{
case crow::HTTPMethod::Put:
Expand Down

0 comments on commit 4f3dc20

Please sign in to comment.