mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-27 04:50:59 +00:00
FS-10613: [core] freeswitch using the the wrong PT value (using the transmit PT instead of the receive PT) #resolve
This commit is contained in:
parent
3c524021ca
commit
e2a186cb37
@ -820,6 +820,7 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
|
|||||||
|
|
||||||
switch_mutex_lock(smh->sdp_mutex);
|
switch_mutex_lock(smh->sdp_mutex);
|
||||||
|
|
||||||
|
|
||||||
for (pmap = engine->payload_map; pmap && pmap->allocated; pmap = pmap->next) {
|
for (pmap = engine->payload_map; pmap && pmap->allocated; pmap = pmap->next) {
|
||||||
|
|
||||||
if (sdp_type == SDP_TYPE_RESPONSE) {
|
if (sdp_type == SDP_TYPE_RESPONSE) {
|
||||||
@ -831,7 +832,16 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
|
|||||||
exists = (type == pmap->type && !strcasecmp(name, pmap->iananame) && pmap->pt == pt && (!pmap->rate || rate == pmap->rate) && (!pmap->ptime || pmap->ptime == ptime));
|
exists = (type == pmap->type && !strcasecmp(name, pmap->iananame) && pmap->pt == pt && (!pmap->rate || rate == pmap->rate) && (!pmap->ptime || pmap->ptime == ptime));
|
||||||
break;
|
break;
|
||||||
case SWITCH_MEDIA_TYPE_VIDEO:
|
case SWITCH_MEDIA_TYPE_VIDEO:
|
||||||
|
if (sdp_type == SDP_TYPE_RESPONSE) {
|
||||||
|
exists = (pmap->sdp_type == SDP_TYPE_REQUEST && type == pmap->type && !strcasecmp(name, pmap->iananame));
|
||||||
|
} else {
|
||||||
exists = (type == pmap->type && !strcasecmp(name, pmap->iananame));
|
exists = (type == pmap->type && !strcasecmp(name, pmap->iananame));
|
||||||
|
}
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "CHECK PMAP %s:%s %d %s:%s %d ... %d\n",
|
||||||
|
name, sdp_type == SDP_TYPE_REQUEST ? "REQ" : "RES", pt,
|
||||||
|
pmap->iananame, pmap->sdp_type == SDP_TYPE_REQUEST ? "REQ" : "RES", pmap->pt, exists);
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -883,8 +893,6 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
|
|||||||
pmap->channels = 1;
|
pmap->channels = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pmap->sdp_type = sdp_type;
|
|
||||||
|
|
||||||
if (ptime) {
|
if (ptime) {
|
||||||
pmap->ptime = ptime;
|
pmap->ptime = ptime;
|
||||||
}
|
}
|
||||||
@ -921,6 +929,10 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
|
pmap->sdp_type = sdp_type;
|
||||||
|
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "ADD PMAP %s %s %d\n", sdp_type == SDP_TYPE_REQUEST ? "REQ" : "RES", name, pt);
|
||||||
|
|
||||||
if (pmap == engine->payload_map) {
|
if (pmap == engine->payload_map) {
|
||||||
engine->pmap_tail = pmap;
|
engine->pmap_tail = pmap;
|
||||||
} else if (!engine->payload_map) {
|
} else if (!engine->payload_map) {
|
||||||
@ -5791,7 +5803,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||||||
SWITCH_MEDIA_TYPE_VIDEO,
|
SWITCH_MEDIA_TYPE_VIDEO,
|
||||||
matches[j].map->rm_encoding,
|
matches[j].map->rm_encoding,
|
||||||
matches[j].imp->modname,
|
matches[j].imp->modname,
|
||||||
matches[j].map->rm_fmtp,
|
consider_video_fmtp ? matches[j].map->rm_fmtp : NULL,
|
||||||
sdp_type,
|
sdp_type,
|
||||||
matches[j].map->rm_pt,
|
matches[j].map->rm_pt,
|
||||||
matches[j].imp->samples_per_second,
|
matches[j].imp->samples_per_second,
|
||||||
|
@ -5463,7 +5463,7 @@ static int check_recv_payload(switch_rtp_t *rtp_session)
|
|||||||
{
|
{
|
||||||
int ok = 1;
|
int ok = 1;
|
||||||
|
|
||||||
if (rtp_session->pmaps && *rtp_session->pmaps) {
|
if (!(rtp_session->rtp_bugs & RTP_BUG_ACCEPT_ANY_PAYLOAD) && rtp_session->pmaps && *rtp_session->pmaps) {
|
||||||
payload_map_t *pmap;
|
payload_map_t *pmap;
|
||||||
ok = 0;
|
ok = 0;
|
||||||
|
|
||||||
@ -5474,7 +5474,7 @@ static int check_recv_payload(switch_rtp_t *rtp_session)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rtp_session->last_rtp_hdr.pt == pmap->recv_pt) {
|
if (rtp_session->last_rtp_hdr.pt == pmap->pt) {
|
||||||
ok = 1;
|
ok = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5639,7 +5639,8 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
|
|||||||
int accept_packet = 1;
|
int accept_packet = 1;
|
||||||
|
|
||||||
|
|
||||||
if (rtp_session->pmaps && *rtp_session->pmaps) {
|
if (!(rtp_session->rtp_bugs & RTP_BUG_ACCEPT_ANY_PAYLOAD) &&
|
||||||
|
!(rtp_session->rtp_bugs & RTP_BUG_ACCEPT_ANY_PACKETS) && rtp_session->pmaps && *rtp_session->pmaps) {
|
||||||
payload_map_t *pmap;
|
payload_map_t *pmap;
|
||||||
accept_packet = 0;
|
accept_packet = 0;
|
||||||
|
|
||||||
@ -5655,7 +5656,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rtp_session->last_rtp_hdr.pt == pmap->recv_pt) {
|
if (rtp_session->last_rtp_hdr.pt == pmap->pt) {
|
||||||
accept_packet = 1;
|
accept_packet = 1;
|
||||||
if (pmapP) {
|
if (pmapP) {
|
||||||
*pmapP = pmap;
|
*pmapP = pmap;
|
||||||
@ -5666,7 +5667,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
|
|||||||
switch_mutex_unlock(rtp_session->flag_mutex);
|
switch_mutex_unlock(rtp_session->flag_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!accept_packet && !(rtp_session->rtp_bugs & RTP_BUG_ACCEPT_ANY_PAYLOAD) && !(rtp_session->rtp_bugs & RTP_BUG_ACCEPT_ANY_PACKETS)) {
|
if (!accept_packet) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG1,
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG1,
|
||||||
"Invalid Packet SEQ: %d TS: %d PT:%d ignored\n",
|
"Invalid Packet SEQ: %d TS: %d PT:%d ignored\n",
|
||||||
ntohs(rtp_session->recv_msg.header.seq), ntohl(rtp_session->last_rtp_hdr.ts), rtp_session->last_rtp_hdr.pt);
|
ntohs(rtp_session->recv_msg.header.seq), ntohl(rtp_session->last_rtp_hdr.ts), rtp_session->last_rtp_hdr.pt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user