]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
set sdp_zrtp_hash_string earlier when inbound-late-negotiation is enabled
authorTravis Cross <tc@traviscross.com>
Tue, 3 Apr 2012 21:14:52 +0000 (21:14 +0000)
committerTravis Cross <tc@traviscross.com>
Wed, 4 Apr 2012 17:24:54 +0000 (17:24 +0000)
Previously in this case it was only being set after the dialplan had
already executed.

src/mod/endpoints/mod_sofia/sofia_glue.c

index de42845ba4b31294f1dc3a9c93c04a6d5da624e8..0d7d3ac6e1699a5ec9c593156bbbe8cd4e38f9ee 100644 (file)
@@ -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) {