[asterisk-commits] oej: branch oej/roibos-cng-support-1.8 r374791 - in /team/oej/roibos-cng-supp...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 10 04:53:06 CDT 2012


Author: oej
Date: Wed Oct 10 04:52:55 2012
New Revision: 374791

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=374791
Log:
Leave the idea of a "codec" behind. Add option to sip.conf. actually got Asterisk
to accept CN in the SDP, answering

a=rtpmap:13 CN/8000

on the invite with SDP.

Does not mean that we have CN at all. Just that we can pretend.

Modified:
    team/oej/roibos-cng-support-1.8/channels/chan_sip.c
    team/oej/roibos-cng-support-1.8/channels/sip/include/sip.h
    team/oej/roibos-cng-support-1.8/configs/sip.conf.sample
    team/oej/roibos-cng-support-1.8/main/rtp_engine.c

Modified: team/oej/roibos-cng-support-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/channels/chan_sip.c?view=diff&rev=374791&r1=374790&r2=374791
==============================================================================
--- team/oej/roibos-cng-support-1.8/channels/chan_sip.c (original)
+++ team/oej/roibos-cng-support-1.8/channels/chan_sip.c Wed Oct 10 04:52:55 2012
@@ -11230,7 +11230,7 @@
 	}
 }
 
-/*! \brief Add RFC 2833 DTMF offer to SDP */
+/*! \brief Add CN and RFC 2833 DTMF offer to SDP */
 static void add_noncodec_to_sdp(const struct sip_pvt *p, int format,
 				struct ast_str **m_buf, struct ast_str **a_buf,
 				int debug)
@@ -16260,6 +16260,9 @@
 			p->noncodeccapability |= AST_RTP_DTMF;
 		else
 			p->noncodeccapability &= ~AST_RTP_DTMF;
+		if (ast_test_flag(&p->flags[1], SIP_PAGE2_ALLOW_CN)) {
+			p->noncodeccapability |= AST_RTP_CN;
+		}
 		p->jointnoncodeccapability = p->noncodeccapability;
 		p->rtptimeout = peer->rtptimeout;
 		p->rtpholdtimeout = peer->rtpholdtimeout;
@@ -17708,6 +17711,7 @@
 		ast_cli(fd, "  User=Phone   : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[0], SIP_USEREQPHONE)));
 		ast_cli(fd, "  Video Support: %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[1], SIP_PAGE2_VIDEOSUPPORT) || ast_test_flag(&peer->flags[1], SIP_PAGE2_VIDEOSUPPORT_ALWAYS)));
 		ast_cli(fd, "  Text Support : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[1], SIP_PAGE2_TEXTSUPPORT)));
+		ast_cli(fd, "  Comfort Noise: %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[1], SIP_PAGE2_ALLOW_CN)));
 		ast_cli(fd, "  Ign SDP ver  : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[1], SIP_PAGE2_IGNORESDPVERSION)));
 		ast_cli(fd, "  Trust RPID   : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[0], SIP_TRUSTRPID)));
 		ast_cli(fd, "  Send RPID    : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[0], SIP_SENDRPID)));
@@ -17820,6 +17824,7 @@
 		astman_append(s, "SIP-T.38Support: %s\r\n", (ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT)?"Y":"N"));
 		astman_append(s, "SIP-T.38EC: %s\r\n", faxec2str(ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT)));
 		astman_append(s, "SIP-T.38MaxDtgrm: %d\r\n", peer->t38_maxdatagram);
+		astman_append(s, "SIP-ComfortNoise: %s\r\n", (ast_test_flag(&peer->flags[1], SIP_PAGE2_ALLOW_CN)?"Y":"N"));
 		astman_append(s, "SIP-Sess-Timers: %s\r\n", stmode2str(peer->stimer.st_mode_oper));
 		astman_append(s, "SIP-Sess-Refresh: %s\r\n", strefresherparam2str(peer->stimer.st_ref));
 		astman_append(s, "SIP-Sess-Expires: %d\r\n", peer->stimer.st_max_se);
@@ -18273,6 +18278,7 @@
 				"Disabled");
 	ast_cli(a->fd, "  Videosupport:           %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_PAGE2_VIDEOSUPPORT)));
 	ast_cli(a->fd, "  Textsupport:            %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_PAGE2_TEXTSUPPORT)));
+	ast_cli(a->fd, "  Comfort Noise:          %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_PAGE2_ALLOW_CN)));
 	ast_cli(a->fd, "  Ignore SDP sess. ver.:  %s\n", AST_CLI_YESNO(ast_test_flag(&global_flags[1], SIP_PAGE2_IGNORESDPVERSION)));
 	ast_cli(a->fd, "  AutoCreate Peer:        %s\n", AST_CLI_YESNO(sip_cfg.autocreatepeer));
 	ast_cli(a->fd, "  Match Auth Username:    %s\n", AST_CLI_YESNO(global_match_auth_username));
@@ -27151,6 +27157,8 @@
 	} else if (!strcasecmp(v->name, "buggymwi")) {
 		ast_set_flag(&mask[1], SIP_PAGE2_BUGGY_MWI);
 		ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_BUGGY_MWI);
+	} else if (!strcasecmp(v->name, "comfort-noise")) {
+		ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_ALLOW_CN);
 	} else
 		res = 0;
 

Modified: team/oej/roibos-cng-support-1.8/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/channels/sip/include/sip.h?view=diff&rev=374791&r1=374790&r2=374791
==============================================================================
--- team/oej/roibos-cng-support-1.8/channels/sip/include/sip.h (original)
+++ team/oej/roibos-cng-support-1.8/channels/sip/include/sip.h Wed Oct 10 04:52:55 2012
@@ -346,6 +346,7 @@
 #define SIP_PAGE2_VIDEOSUPPORT_ALWAYS       (1 << 27)   /*!< DP: Always set up video, even if endpoints don't support it */
 #define SIP_PAGE2_HAVEPEERCONTEXT           (1 << 28)   /*< Are we associated with a configured peer context? */
 #define SIP_PAGE2_USE_SRTP                  (1 << 29)   /*!< DP: Whether we should offer (only)  SRTP */
+#define SIP_PAGE2_ALLOW_CN                  (1 << 30)   /*!< DP: If we allow Comfort Noise generation */
 
 #define SIP_PAGE2_FLAGS_TO_COPY \
 	(SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_IGNORESDPVERSION | \
@@ -353,7 +354,8 @@
 	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_UPDATE | SIP_PAGE2_SYMMETRICRTP |\
-	SIP_PAGE2_Q850_REASON | SIP_PAGE2_HAVEPEERCONTEXT | SIP_PAGE2_USE_SRTP)
+	SIP_PAGE2_Q850_REASON | SIP_PAGE2_HAVEPEERCONTEXT | SIP_PAGE2_USE_SRTP |\
+	SIP_PAGE2_ALLOW_CN )
 
 
 #define SIP_PAGE3_SNOM_AOC               (1 << 0)  /*!< DPG: Allow snom aoc messages */

Modified: team/oej/roibos-cng-support-1.8/configs/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/configs/sip.conf.sample?view=diff&rev=374791&r1=374790&r2=374791
==============================================================================
--- team/oej/roibos-cng-support-1.8/configs/sip.conf.sample (original)
+++ team/oej/roibos-cng-support-1.8/configs/sip.conf.sample Wed Oct 10 04:52:55 2012
@@ -300,6 +300,9 @@
 ;allow=ulaw                     ; Allow codecs in order of preference
 ;allow=ilbc                     ; see https://wiki.asterisk.org/wiki/display/AST/RTP+Packetization
 				; for framing options
+
+;comfort-noise=yes		; Enable Comfort Noise generation on RTP streams
+;				; Available per device too
 ;
 ; This option specifies a preference for which music on hold class this channel
 ; should listen to when put on hold if the music class has not been set on the

Modified: team/oej/roibos-cng-support-1.8/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/roibos-cng-support-1.8/main/rtp_engine.c?view=diff&rev=374791&r1=374790&r2=374791
==============================================================================
--- team/oej/roibos-cng-support-1.8/main/rtp_engine.c (original)
+++ team/oej/roibos-cng-support-1.8/main/rtp_engine.c Wed Oct 10 04:52:55 2012
@@ -119,7 +119,7 @@
 	{{1, AST_FORMAT_G726_AAL2}, "audio", "AAL2-G726-32", 8000},
 	{{0, AST_RTP_DTMF}, "audio", "telephone-event", 8000},
 	{{0, AST_RTP_CISCO_DTMF}, "audio", "cisco-telephone-event", 8000},
-	{{1, AST_FORMAT_CN}, "audio", "CN", 8000},
+	{{0, AST_RTP_CN}, "audio", "CN", 8000},
 	{{1, AST_FORMAT_JPEG}, "video", "JPEG", 90000},
 	{{1, AST_FORMAT_PNG}, "video", "PNG", 90000},
 	{{1, AST_FORMAT_H261}, "video", "H261", 90000},




More information about the asterisk-commits mailing list