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;
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);
if (!strcasecmp(pmap->iananame, iananame)) {
pt = pmap->pt;
recv_pt = pmap->recv_pt;
+ fmtp = pmap->rm_fmtp;
found++;
}
}
if (recv_ptP) {
*recv_ptP = recv_pt;
}
+
+ if (!zstr(fmtp) && fmtpP) {
+ *fmtpP = fmtp;
+ }
+
return SWITCH_STATUS_SUCCESS;
}
}
}
+ 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);
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);
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;
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++;
}
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"))) {