Author: bebuild
Date: Fri Dec 19 14:34:34 2014
New Revision: 429857

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=429857
Log:
chan_sip: Allow T.38 switch-over when SRTP is in use.

Previously when SRTP was enabled on a channel it was not possible
to switch to T.38 as no crypto attributes would be present.

This change makes it so it is now possible. If a T.38 re-invite
comes in SRTP is terminated since in practice you can't encrypt
a UDPTL stream. Now... if we were doing T.38 over RTP (which
does exist) then we'd have a chance but almost nobody does that so
here we are.

ASTERISK-24449 #close
Reported by: Andreas Steinmetz
patches:
 udptl-ignore-srtp-v2.patch submitted by Andreas Steinmetz (license 6523)
........

Merged revisions 429632 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    certified/branches/11.6/   (props changed)
    certified/branches/11.6/channels/chan_sip.c

Propchange: certified/branches/11.6/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: certified/branches/11.6/channels/chan_sip.c
URL: 
http://svnview.digium.com/svn/asterisk/certified/branches/11.6/channels/chan_sip.c?view=diff&rev=429857&r1=429856&r2=429857
==============================================================================
--- certified/branches/11.6/channels/chan_sip.c (original)
+++ certified/branches/11.6/channels/chan_sip.c Fri Dec 19 14:34:34 2014
@@ -10356,6 +10356,12 @@
                goto process_sdp_cleanup;
        }
 
+       if (p->srtp && p->udptl && udptlportno != -1) {
+               ast_debug(1, "Terminating SRTP due to T.38 UDPTL\n");
+               sip_srtp_destroy(p->srtp);
+               p->srtp = NULL;
+        }
+
        if (secure_audio && !(p->srtp && (ast_test_flag(p->srtp, 
SRTP_CRYPTO_OFFER_OK)))) {
                ast_log(LOG_WARNING, "Can't provide secure audio requested in 
SDP offer\n");
                res = -1;
@@ -10380,7 +10386,7 @@
                goto process_sdp_cleanup;
        }
 
-       if (!(secure_audio || secure_video) && ast_test_flag(&p->flags[1], 
SIP_PAGE2_USE_SRTP)) {
+       if (!(secure_audio || secure_video || (p->udptl && udptlportno != -1)) 
&& ast_test_flag(&p->flags[1], SIP_PAGE2_USE_SRTP)) {
                ast_log(LOG_WARNING, "Matched device setup to use SRTP, but 
request was not!\n");
                res = -1;
                goto process_sdp_cleanup;


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to