[asterisk-commits] twilson: branch group/srtp_reboot r250289 - in /team/group/srtp_reboot: chann...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 2 19:05:16 CST 2010


Author: twilson
Date: Tue Mar  2 19:05:10 2010
New Revision: 250289

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=250289
Log:
Fix forcing encryption off via sip.conf w/o dialplan force

Modified:
    team/group/srtp_reboot/channels/chan_sip.c
    team/group/srtp_reboot/channels/sip/include/sip.h
    team/group/srtp_reboot/main/channel.c

Modified: team/group/srtp_reboot/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/srtp_reboot/channels/chan_sip.c?view=diff&rev=250289&r1=250288&r2=250289
==============================================================================
--- team/group/srtp_reboot/channels/chan_sip.c (original)
+++ team/group/srtp_reboot/channels/chan_sip.c Tue Mar  2 19:05:10 2010
@@ -3120,7 +3120,7 @@
 		res = 0;
 		break;
 	case AST_OPTION_SECURE_MEDIA:
-		p->req_secure_media = *(unsigned int *) data;
+		ast_set2_flag(&p->flags[1], *(unsigned int *) data, SIP_PAGE2_USE_SRTP);
 		res = 0;
 		break;
 	default:
@@ -3180,7 +3180,7 @@
 		res = 0;
 		break;
 	case AST_OPTION_SECURE_MEDIA:
-		*((unsigned int *) data) = p->req_secure_media;
+		*((unsigned int *) data) = ast_test_flag(&p->flags[1], SIP_PAGE2_USE_SRTP) ? 1 : 0;
 		res = 0;
 		break;
 	default:
@@ -4192,12 +4192,6 @@
 	   ast_log(LOG_WARNING, "Encrypted signaling is required\n");
 	   ast->hangupcause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
 	   return -1;
-	}
-	if (p->req_secure_media) {
-		/* Allow the dialplan to override whether we offer SRTP */
-		ast_set_flag(&p->flags[1], SIP_PAGE2_USE_SRTP);
-	} else {
-		ast_clear_flag(&p->flags[1], SIP_PAGE2_USE_SRTP);
 	}
 
 	if (ast_test_flag(&p->flags[1], SIP_PAGE2_USE_SRTP)) {

Modified: team/group/srtp_reboot/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/group/srtp_reboot/channels/sip/include/sip.h?view=diff&rev=250289&r1=250288&r2=250289
==============================================================================
--- team/group/srtp_reboot/channels/sip/include/sip.h (original)
+++ team/group/srtp_reboot/channels/sip/include/sip.h Tue Mar  2 19:05:10 2010
@@ -953,7 +953,6 @@
 	                                       *   for incoming calls
 	                                       */
 	unsigned short req_secure_signaling:1;/*!< Whether we are required to have secure signaling or not */
-	unsigned short req_secure_media:1;/*!< Whetehr we are required to have secure media or not */
 	char tag[11];                     /*!< Our tag for this session */
 	int timer_t1;                     /*!< SIP timer T1, ms rtt */
 	int timer_b;                      /*!< SIP timer B, ms */

Modified: team/group/srtp_reboot/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/group/srtp_reboot/main/channel.c?view=diff&rev=250289&r1=250288&r2=250289
==============================================================================
--- team/group/srtp_reboot/main/channel.c (original)
+++ team/group/srtp_reboot/main/channel.c Tue Mar  2 19:05:10 2010
@@ -4546,6 +4546,8 @@
 		struct ast_secure_call_store *encrypt = ds->data;
 		ops[0][1] = encrypt->signaling;
 		ops[1][1] = encrypt->media; 
+	} else {
+		return 0;
 	}
 
 	for (i = 0; i < 2; i++) {




More information about the asterisk-commits mailing list