mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 01:02:12 +00:00
FS-5958 this should pass it through in late mode too
This commit is contained in:
parent
ce690418a1
commit
0030ce440e
@ -310,7 +310,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_get_payload_code(switch_core
|
||||
switch_media_type_t type,
|
||||
const char *iananame,
|
||||
switch_payload_t *ptP,
|
||||
switch_payload_t *recv_ptP);
|
||||
switch_payload_t *recv_ptP,
|
||||
char **fmtpP);
|
||||
|
||||
SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_session_t *session,
|
||||
switch_media_type_t type,
|
||||
|
@ -167,6 +167,7 @@ struct switch_media_handle_s {
|
||||
const switch_codec_implementation_t *negotiated_codecs[SWITCH_MAX_CODECS];
|
||||
int num_negotiated_codecs;
|
||||
switch_payload_t ianacodes[SWITCH_MAX_CODECS];
|
||||
char *fmtps[SWITCH_MAX_CODECS];
|
||||
int video_count;
|
||||
|
||||
uint32_t owner_id;
|
||||
@ -464,13 +465,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_get_payload_code(switch_core
|
||||
switch_media_type_t type,
|
||||
const char *iananame,
|
||||
switch_payload_t *ptP,
|
||||
switch_payload_t *recv_ptP)
|
||||
switch_payload_t *recv_ptP,
|
||||
char **fmtpP)
|
||||
{
|
||||
payload_map_t *pmap;
|
||||
switch_media_handle_t *smh;
|
||||
switch_rtp_engine_t *engine;
|
||||
switch_payload_t pt = 0, recv_pt = 0;
|
||||
int found = 0;
|
||||
char *fmtp = NULL;
|
||||
|
||||
switch_assert(session);
|
||||
|
||||
@ -488,6 +491,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_get_payload_code(switch_core
|
||||
if (!strcasecmp(pmap->iananame, iananame)) {
|
||||
pt = pmap->pt;
|
||||
recv_pt = pmap->recv_pt;
|
||||
fmtp = pmap->rm_fmtp;
|
||||
found++;
|
||||
}
|
||||
}
|
||||
@ -500,6 +504,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_get_payload_code(switch_core
|
||||
if (recv_ptP) {
|
||||
*recv_ptP = recv_pt;
|
||||
}
|
||||
|
||||
if (!zstr(fmtp) && fmtpP) {
|
||||
*fmtpP = fmtp;
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -5391,6 +5400,10 @@ static void generate_m(switch_core_session_t *session, char *buf, size_t buflen,
|
||||
}
|
||||
}
|
||||
|
||||
if (smh->fmtps[i]) {
|
||||
fmtp = smh->fmtps[i];
|
||||
}
|
||||
|
||||
if (smh->ianacodes[i] > 95 || switch_channel_test_flag(session->channel, CF_VERBOSE_SDP)) {
|
||||
int channels = get_channels(imp->iananame, imp->number_of_channels);
|
||||
|
||||
@ -5665,7 +5678,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
||||
const char *fmtp_out;
|
||||
const char *fmtp_out_var = switch_channel_get_variable(session->channel, "rtp_force_audio_fmtp");
|
||||
switch_event_t *map = NULL, *ptmap = NULL;
|
||||
const char *b_sdp = NULL;
|
||||
//const char *b_sdp = NULL;
|
||||
const char *local_audio_crypto_key = switch_core_session_local_crypto_key(session, SWITCH_MEDIA_TYPE_AUDIO);
|
||||
const char *local_sdp_audio_zrtp_hash = switch_core_media_get_zrtp_hash(session, SWITCH_MEDIA_TYPE_AUDIO, SWITCH_TRUE);
|
||||
const char *local_sdp_video_zrtp_hash = switch_core_media_get_zrtp_hash(session, SWITCH_MEDIA_TYPE_VIDEO, SWITCH_TRUE);
|
||||
@ -5750,6 +5763,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
||||
for (i = 0; i < smh->mparams->num_codecs; i++) {
|
||||
const switch_codec_implementation_t *imp = smh->codecs[i];
|
||||
switch_payload_t orig_pt = 0;
|
||||
char *orig_fmtp = NULL;
|
||||
|
||||
smh->ianacodes[i] = imp->ianacode;
|
||||
|
||||
@ -5765,8 +5779,12 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
||||
if (orig_session &&
|
||||
switch_core_session_get_payload_code(orig_session,
|
||||
imp->codec_type == SWITCH_CODEC_TYPE_AUDIO ? SWITCH_MEDIA_TYPE_AUDIO : SWITCH_MEDIA_TYPE_VIDEO,
|
||||
imp->iananame, &orig_pt, NULL) == SWITCH_STATUS_SUCCESS) {
|
||||
imp->iananame, &orig_pt, NULL, &orig_fmtp) == SWITCH_STATUS_SUCCESS) {
|
||||
smh->ianacodes[i] = orig_pt;
|
||||
|
||||
if (orig_fmtp) {
|
||||
smh->fmtps[i] = switch_core_session_strdup(session, orig_fmtp);
|
||||
}
|
||||
} else {
|
||||
smh->ianacodes[i] = (switch_payload_t)smh->payload_space++;
|
||||
}
|
||||
@ -5829,9 +5847,9 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
||||
return;
|
||||
}
|
||||
|
||||
if (!a_engine->cur_payload_map->rm_encoding && (b_sdp = switch_channel_get_variable(session->channel, SWITCH_B_SDP_VARIABLE))) {
|
||||
switch_core_media_sdp_map(b_sdp, &map, &ptmap);
|
||||
}
|
||||
//if (!a_engine->cur_payload_map->rm_encoding && (b_sdp = switch_channel_get_variable(session->channel, SWITCH_B_SDP_VARIABLE))) {
|
||||
//switch_core_media_sdp_map(b_sdp, &map, &ptmap);
|
||||
//}
|
||||
|
||||
if (zstr(sr)) {
|
||||
if ((var_val = switch_channel_get_variable(session->channel, "media_audio_mode"))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user