[svn-commits] mmichelson: branch mmichelson/direct_media r382824 - in /team/mmichelson/dire...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 11 17:02:52 CDT 2013


Author: mmichelson
Date: Mon Mar 11 17:02:49 2013
New Revision: 382824

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382824
Log:
Add option to prevent direct media attempts if media NAT is detected.


Modified:
    team/mmichelson/direct_media/channels/chan_gulp.c
    team/mmichelson/direct_media/include/asterisk/res_sip.h
    team/mmichelson/direct_media/res/res_sip/sip_configuration.c

Modified: team/mmichelson/direct_media/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/direct_media/channels/chan_gulp.c?view=diff&rev=382824&r1=382823&r2=382824
==============================================================================
--- team/mmichelson/direct_media/channels/chan_gulp.c (original)
+++ team/mmichelson/direct_media/channels/chan_gulp.c Mon Mar 11 17:02:49 2013
@@ -190,6 +190,10 @@
 {
 	struct ast_sip_session *session = ast_channel_tech_pvt(chan);
 	int changed = 0;
+
+	if (nat_active && session->endpoint->disable_direct_media_on_nat) {
+		return 0;
+	}
 
 	if (rtp) {
 		struct ast_sip_session_media *audio = &session->media[AST_SIP_MEDIA_AUDIO];

Modified: team/mmichelson/direct_media/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/direct_media/include/asterisk/res_sip.h?view=diff&rev=382824&r1=382823&r2=382824
==============================================================================
--- team/mmichelson/direct_media/include/asterisk/res_sip.h (original)
+++ team/mmichelson/direct_media/include/asterisk/res_sip.h Mon Mar 11 17:02:49 2013
@@ -286,6 +286,8 @@
 	enum ast_sip_session_refresh_method direct_media_method;
 	/*! Take steps to mitigate glare for direct media */
 	enum ast_sip_direct_media_glare_mitigation direct_media_glare_mitigation;
+	/*! Do not attempt direct media session refreshes if a media NAT is detected */
+	unsigned int disable_direct_media_on_nat;
 };
 
 /*!

Modified: team/mmichelson/direct_media/res/res_sip/sip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/direct_media/res/res_sip/sip_configuration.c?view=diff&rev=382824&r1=382823&r2=382824
==============================================================================
--- team/mmichelson/direct_media/res/res_sip/sip_configuration.c (original)
+++ team/mmichelson/direct_media/res/res_sip/sip_configuration.c Mon Mar 11 17:02:49 2013
@@ -345,6 +345,7 @@
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "direct_media", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, direct_media));
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "direct_media_method", "invite", direct_media_method_handler, NULL, 0, 0);
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "direct_media_glare_mitigation", "none", direct_media_glare_mitigation_handler, NULL, 0, 0);
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "disable_direct_media_on_nat", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, disable_direct_media_on_nat));
 
 	if (ast_sip_initialize_sorcery_transport(sip_sorcery)) {
 		ast_log(LOG_ERROR, "Failed to register SIP transport support with sorcery\n");




More information about the svn-commits mailing list