主动发送rtp接口(startSendRtp)支持返回本地端口: #538

This commit is contained in:
xiongziliang
2021-01-02 20:43:02 +08:00
parent 113430345c
commit c69e9b8ec1
10 changed files with 36 additions and 28 deletions

View File

@@ -812,11 +812,12 @@ void installWebApi() {
}
//src_port为空时则随机本地端口
src->startSendRtp(allArgs["dst_url"], allArgs["dst_port"], allArgs["ssrc"], allArgs["is_udp"], allArgs["src_port"], [val, headerOut, invoker](const SockException &ex){
src->startSendRtp(allArgs["dst_url"], allArgs["dst_port"], allArgs["ssrc"], allArgs["is_udp"], allArgs["src_port"], [val, headerOut, invoker](uint16_t local_port, const SockException &ex){
if (ex) {
const_cast<Value &>(val)["code"] = API::OtherFailed;
const_cast<Value &>(val)["msg"] = ex.what();
}
const_cast<Value &>(val)["local_port"] = local_port;
invoker("200 OK", headerOut, val.toStyledString());
});
});