Skip to content

Commit

Permalink
capture rtp host and port from sdp
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-i2x committed Oct 30, 2019
1 parent 1e6af75 commit d8fe5d2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,21 @@ char * call::get_last_header(const char * name)
ERROR("call::get_last_header: Header to parse bigger than %d (%zu)", MAX_HEADER_LEN, strlen(name));
}

#if defined(PCAPPLAY) || defined(RTP_STREAM) || defined(GTEST)
if(strcmp(name, "media_ip")==0) {
// get media ip from sdp
static std::string host;
host = find_in_sdp(media_ip_is_ipv6 ? "c=IN IP6 " : "c=IN IP4 ", last_recv_msg);
return const_cast<char*>(host.c_str());
}
if(strcmp(name, "media_port")==0) {
// get media port from sdp
static std::string port;
port = find_in_sdp("m=audio ", last_recv_msg);
return const_cast<char*>(port.c_str());
}
#endif

if (name[len - 1] == ':') {
return get_header(last_recv_msg, name, false);
} else {
Expand Down

0 comments on commit d8fe5d2

Please sign in to comment.