diff --git a/tinyphone/phone.cpp b/tinyphone/phone.cpp index 1c4c0cb..379107b 100644 --- a/tinyphone/phone.cpp +++ b/tinyphone/phone.cpp @@ -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(...) { @@ -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(...) { diff --git a/tinyphone/server.cpp b/tinyphone/server.cpp index 6eb0567..44aa1fc 100644 --- a/tinyphone/server.cpp +++ b/tinyphone/server.cpp @@ -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: