[asterisk-commits] file: branch file/issue8855 r190860 - in /team/file/issue8855: channels/ conf...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 28 08:28:17 CDT 2009


Author: file
Date: Tue Apr 28 08:28:09 2009
New Revision: 190860

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=190860
Log:
Add support for enabling or disabling symmetric RTP support separately from signaling.

This commit adds a configuration option (symmetric_rtp) which allows symmetric RTP
support to be explicitly enabled or disabled regardless of the nat setting.

(issue #8855)

Modified:
    team/file/issue8855/channels/chan_sip.c
    team/file/issue8855/configs/sip.conf.sample

Modified: team/file/issue8855/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/team/file/issue8855/channels/chan_sip.c?view=diff&rev=190860&r1=190859&r2=190860
==============================================================================
--- team/file/issue8855/channels/chan_sip.c (original)
+++ team/file/issue8855/channels/chan_sip.c Tue Apr 28 08:28:09 2009
@@ -1424,6 +1424,7 @@
 #define SIP_PAGE2_RTCACHEFRIENDS	(1 << 0)	/*!< GP: Should we keep RT objects in memory for extended time? */
 #define SIP_PAGE2_RTAUTOCLEAR		(1 << 2)	/*!< GP: Should we clean memory from peers after expiry? */
 /* Space for addition of other realtime flags in the future */
+#define SIP_PAGE2_SYMMETRICRTP          (1 << 8)        /*!< GDP: Whether symmetric RTP is enabled or not */
 #define SIP_PAGE2_STATECHANGEQUEUE	(1 << 9)	/*!< D: Unsent state pending change exists */
 
 #define SIP_PAGE2_CONNECTLINEUPDATE_PEND		(1 << 10)
@@ -1460,7 +1461,7 @@
 	SIP_PAGE2_VIDEOSUPPORT | SIP_PAGE2_T38SUPPORT | SIP_PAGE2_RFC2833_COMPENSATE | \
 	SIP_PAGE2_BUGGY_MWI | SIP_PAGE2_TEXTSUPPORT | SIP_PAGE2_FAX_DETECT | \
 	SIP_PAGE2_UDPTL_DESTINATION | SIP_PAGE2_VIDEOSUPPORT_ALWAYS | SIP_PAGE2_PREFERRED_CODEC | \
-	SIP_PAGE2_RPID_IMMEDIATE)
+	SIP_PAGE2_RPID_IMMEDIATE | SIP_PAGE2_SYMMETRICRTP)
 
 /*@}*/ 
 
@@ -4667,7 +4668,10 @@
 /*! \brief Set nat mode on the various data sockets */
 static void do_setnat(struct sip_pvt *p, int natflags)
 {
-	const char *mode = natflags ? "On" : "Off";
+	const char *mode;
+
+	natflags |= ast_test_flag(&p->flags[1], SIP_PAGE2_SYMMETRICRTP);
+	mode = natflags ? "On" : "Off";
 
 	if (p->rtp) {
 		ast_debug(1, "Setting NAT on RTP to %s\n", mode);
@@ -15515,6 +15519,7 @@
 	ast_cli(a->fd, "\n");
 	ast_cli(a->fd, "  Relax DTMF:             %s\n", cli_yesno(global_relaxdtmf));
 	ast_cli(a->fd, "  RFC2833 Compensation:   %s\n", cli_yesno(ast_test_flag(&global_flags[1], SIP_PAGE2_RFC2833_COMPENSATE)));
+	ast_cli(a->fd, "  Symmetric RTP:          %s\n", cli_yesno(ast_test_flag(&global_flags[1], SIP_PAGE2_SYMMETRICRTP)));
 	ast_cli(a->fd, "  Compact SIP headers:    %s\n", cli_yesno(sip_cfg.compactheaders));
 	ast_cli(a->fd, "  RTP Keepalive:          %d %s\n", global_rtpkeepalive, global_rtpkeepalive ? "" : "(Disabled)" );
 	ast_cli(a->fd, "  RTP Timeout:            %d %s\n", global_rtptimeout, global_rtptimeout ? "" : "(Disabled)" );
@@ -22917,6 +22922,9 @@
 	} else if (!strcasecmp(v->name, "t38pt_usertpsource")) {
 		ast_set_flag(&mask[1], SIP_PAGE2_UDPTL_DESTINATION);
 		ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_UDPTL_DESTINATION);
+	} else if (!strcasecmp(v->name, "symmetricrtp")) {
+		ast_set_flag(&mask[1], SIP_PAGE2_SYMMETRICRTP);
+		ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_SYMMETRICRTP);
 	} else
 		res = 0;
 

Modified: team/file/issue8855/configs/sip.conf.sample
URL: http://svn.digium.com/svn-view/asterisk/team/file/issue8855/configs/sip.conf.sample?view=diff&rev=190860&r1=190859&r2=190860
==============================================================================
--- team/file/issue8855/configs/sip.conf.sample (original)
+++ team/file/issue8855/configs/sip.conf.sample Tue Apr 28 08:28:09 2009
@@ -626,6 +626,15 @@
 ;        nat = never             ; Never attempt NAT mode or RFC3581 support
 ;        nat = route             ; route = Assume NAT, don't send rport 
 ;                                ; (work around more UNIDEN bugs)
+;
+; It is additionally possible to enable support for symmetric RTP without enabling NAT
+; support for signaling. This is accomplished using the symmetric_rtp configuration
+; option.
+;
+;         symmetric_rtp = no    ; default. Do not explicitly enable symmetric RTP support.
+;                               ; Some nat options will enable it regardless.
+;         symmetric_rtp = yes   ; Explicitly enable symmetric RTP support.
+;
 
 ;----------------------------------- MEDIA HANDLING --------------------------------
 ; By default, Asterisk tries to re-invite the audio to an optimal path. If there's




More information about the asterisk-commits mailing list