]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
wip
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 18 Jan 2013 04:39:32 +0000 (22:39 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 1 Apr 2013 02:27:19 +0000 (21:27 -0500)
src/switch_core_media.c
src/switch_rtp.c

index e6e38b4cb9c619119ff95d377527d04afe718e42..787b16cdeb0157fe32a199afc0009b3cf9601af0 100644 (file)
@@ -635,7 +635,7 @@ static switch_status_t switch_core_media_build_crypto(switch_media_handle_t *smh
                type_str = SWITCH_RTP_CRYPTO_KEY_32;
        }
 
-#define SAME_KEY
+//#define SAME_KEY
 #ifdef SAME_KEY
        if (switch_channel_test_flag(channel, CF_WEBRTC) && type == SWITCH_MEDIA_TYPE_VIDEO) {
                if (direction == SWITCH_RTP_CRYPTO_SEND) {
@@ -2258,7 +2258,8 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
                                        ptime = atoi(attr->a_value);
                                } else if (!strcasecmp(attr->a_name, "maxptime") && attr->a_value) {
                                        maxptime = atoi(attr->a_value);
-                               } else if (!got_crypto && !strcasecmp(attr->a_name, "crypto") && !zstr(attr->a_value)) {
+                               } else if (!got_crypto && !strcasecmp(attr->a_name, "crypto") && !zstr(attr->a_value) && 
+                                                  (!switch_channel_test_flag(session->channel, CF_WEBRTC) || switch_stristr(SWITCH_RTP_CRYPTO_KEY_80, attr->a_value))) {
                                        int crypto_tag;
 
                                        if (!(smh->mparams->ndlb & SM_NDLB_ALLOW_CRYPTO_IN_AVP) && 
index ecf5869c8960783b75e73a742bce99246375ae9a..68bd5c5ea0c737bf52ed2cce3557bfd427dd7e80 100644 (file)
@@ -1888,9 +1888,11 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
        policy->key = (uint8_t *) crypto_key->key;
        policy->next = NULL;
        
+       policy->window_size = 1024;
+       policy->allow_repeat_tx = 1;
 
-       policy->rtp.sec_serv = sec_serv_conf_and_auth;
-       policy->rtcp.sec_serv = sec_serv_conf_and_auth;
+       //policy->rtp.sec_serv = sec_serv_conf_and_auth;
+       //policy->rtcp.sec_serv = sec_serv_conf_and_auth;
 
        switch (direction) {
        case SWITCH_RTP_CRYPTO_RECV:
@@ -1914,8 +1916,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
                }
                break;
        case SWITCH_RTP_CRYPTO_SEND:
-               policy->ssrc.type = ssrc_specific;
-               policy->ssrc.value = rtp_session->ssrc;
+               policy->ssrc.type = ssrc_any_outbound;
+               //policy->ssrc.type = ssrc_specific;
+               //policy->ssrc.value = rtp_session->ssrc;
 
                if (rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND]) {
                        rtp_session->flags[SWITCH_RTP_FLAG_SECURE_SEND_RESET] = 1;