From: Travis Cross Date: Tue, 3 Apr 2012 21:14:52 +0000 (+0000) Subject: set sdp_zrtp_hash_string earlier when inbound-late-negotiation is enabled X-Git-Tag: v1.2-rc1~17^2~324 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b83b567dae390ed481b953b446791bfe0b47f2a0;p=thirdparty%2Ffreeswitch.git set sdp_zrtp_hash_string earlier when inbound-late-negotiation is enabled Previously in this case it was only being set after the dialplan had already executed. --- diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index de42845ba4..0d7d3ac6e1 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -3892,13 +3892,25 @@ void sofia_glue_set_r_sdp_codec_string(switch_core_session_t *session, const cha if (zstr(attr->a_name)) { continue; } - if (!strcasecmp(attr->a_name, "ptime")) { dptime = atoi(attr->a_value); break; } } + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "Looking for zrtp-hash to set sdp_zrtp_hash_string\n"); + for (m = sdp->sdp_media; m; m = m->m_next) { + for (attr = m->m_attributes; attr; attr = attr->a_next) { + if (zstr(attr->a_name)) continue; + if (!strcasecmp(attr->a_name, "zrtp-hash") && attr->a_value) { + switch_log_printf(SWITCH_CHANNEL_CHANNEL_LOG(channel), SWITCH_LOG_DEBUG, "Found zrtp-hash, setting sdp_zrtp_hash_string=%s\n", attr->a_value); + switch_channel_set_variable(channel, "sdp_zrtp_hash_string", attr->a_value); + switch_channel_set_flag(channel, CF_ZRTP_HASH); + break; + } + } + } + for (m = sdp->sdp_media; m; m = m->m_next) { ptime = dptime; if (m->m_type == sdp_media_image && m->m_port) {