完善rtc异常管理

This commit is contained in:
xia-chu
2021-04-07 17:51:06 +08:00
parent d354c9466c
commit b96052d387
3 changed files with 65 additions and 10 deletions

View File

@@ -1081,7 +1081,6 @@ void installWebApi() {
});
#ifdef ENABLE_WEBRTC
static list<WebRtcTransportImp::Ptr> rtcs;
api_regist("/index/api/webrtc",[](API_ARGS_STRING_ASYNC){
CHECK_ARGS("app", "stream");
@@ -1108,7 +1107,6 @@ void installWebApi() {
rtc->attach(src, true);
val["sdp"] = rtc->getAnswerSdp(offer_sdp);
val["type"] = "answer";
rtcs.emplace_back(rtc);
invoker(200, headerOut, val.toStyledString());
} catch (std::exception &ex) {
val["code"] = API::Exception;
@@ -1142,7 +1140,6 @@ void installWebApi() {
rtc->attach(push_src, false);
val["sdp"] = rtc->getAnswerSdp(offer_sdp);
val["type"] = "answer";
rtcs.emplace_back(rtc);
invoker(200, headerOut, val.toStyledString());
} catch (std::exception &ex) {
val["code"] = API::Exception;