[asterisk-commits] rmudgett: branch rmudgett/misdn_facility r184029 - in /team/rmudgett/misdn_fa...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 24 15:54:32 CDT 2009


Author: rmudgett
Date: Tue Mar 24 15:54:28 2009
New Revision: 184029

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=184029
Log:
Merged revisions 184025 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/team/group/issue8824

........
  r184025 | mmichelson | 2009-03-24 15:42:10 -0500 (Tue, 24 Mar 2009) | 3 lines
  
  Resolve automerge and reset conflict.
........

Modified:
    team/rmudgett/misdn_facility/   (props changed)
    team/rmudgett/misdn_facility/CHANGES
    team/rmudgett/misdn_facility/channels/chan_sip.c
    team/rmudgett/misdn_facility/configs/sip.conf.sample

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
--- misdn_facility (original)
+++ misdn_facility Tue Mar 24 15:54:28 2009
@@ -1,1 +1,1 @@
-/team/group/issue8824:1-184017
+/team/group/issue8824:1-184026

Propchange: team/rmudgett/misdn_facility/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Mar 24 15:54:28 2009
@@ -1,1 +1,1 @@
-/trunk:1-183920
+/trunk:1-184024

Modified: team/rmudgett/misdn_facility/CHANGES
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/CHANGES?view=diff&rev=184029&r1=184028&r2=184029
==============================================================================
--- team/rmudgett/misdn_facility/CHANGES (original)
+++ team/rmudgett/misdn_facility/CHANGES Tue Mar 24 15:54:28 2009
@@ -11,6 +11,11 @@
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 1.6.2 to Asterisk 1.6.3  -------------
 ------------------------------------------------------------------------------
+
+SIP Changes
+-----------
+ * Added preferred_codec_only option in sip.conf. This feature limits the joint
+   codecs sent in response to an INVITE to the single most preferred codec.
 
 Applications
 ------------

Modified: team/rmudgett/misdn_facility/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/channels/chan_sip.c?view=diff&rev=184029&r1=184028&r2=184029
==============================================================================
--- team/rmudgett/misdn_facility/channels/chan_sip.c (original)
+++ team/rmudgett/misdn_facility/channels/chan_sip.c Tue Mar 24 15:54:28 2009
@@ -1423,6 +1423,7 @@
 #define SIP_PAGE2_CONNECTLINEUPDATE_PEND		(1 << 10)
 #define SIP_PAGE2_RPID_IMMEDIATE			(1 << 11)
 
+#define SIP_PAGE2_PREFERRED_CODEC	(1 << 13)	/*!< GDP: Only respond with single most preferred joint codec */
 #define SIP_PAGE2_VIDEOSUPPORT		(1 << 14)	/*!< DP: Video supported if offered? */
 #define SIP_PAGE2_TEXTSUPPORT		(1 << 15)	/*!< GDP: Global text enable */
 #define SIP_PAGE2_ALLOWSUBSCRIBE	(1 << 16)	/*!< GP: Allow subscriptions from this peer? */
@@ -1452,7 +1453,8 @@
 	(SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_IGNORESDPVERSION | \
 	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_RPID_IMMEDIATE)
+	SIP_PAGE2_UDPTL_DESTINATION | SIP_PAGE2_VIDEOSUPPORT_ALWAYS | SIP_PAGE2_PREFERRED_CODEC | \
+	SIP_PAGE2_RPID_IMMEDIATE)
 
 /*@}*/ 
 
@@ -8129,11 +8131,15 @@
 	p->peercapability = newpeercapability;		        /* The other sides capability in latest offer */
 	p->jointnoncodeccapability = newnoncodeccapability;	/* DTMF capabilities */
 
+	if (ast_test_flag(&p->flags[1], SIP_PAGE2_PREFERRED_CODEC)) { /* respond with single most preferred joint codec, limiting the other side's choice */
+		p->jointcapability = ast_codec_choose(&p->prefs, p->jointcapability, 1);
+	}
+
 	if (p->jointcapability & AST_FORMAT_T140RED) {
-		p->red = 1; 
+		p->red = 1;
 		ast_rtp_red_init(p->trtp, 300, red_data_pt, 2);
 	} else {
-		p->red = 0; 
+		p->red = 0;
 	}
 
 	ast_rtp_pt_copy(p->rtp, newaudiortp);
@@ -23276,6 +23282,8 @@
 			int error =  ast_parse_allow_disallow(&peer->prefs, &peer->capability, v->value, FALSE);
 			if (error)
 				ast_log(LOG_WARNING, "Codec configuration errors found in line %d : %s = %s\n", v->lineno, v->name, v->value);
+		} else if (!strcasecmp(v->name, "preferred_codec_only")) {
+			ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_PREFERRED_CODEC);
 		} else if (!strcasecmp(v->name, "registertrying")) {
 			ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_REGISTERTRYING);
 		} else if (!strcasecmp(v->name, "autoframing")) {
@@ -24011,6 +24019,8 @@
 			int error =  ast_parse_allow_disallow(&default_prefs, &global_capability, v->value, FALSE);
 			if (error)
 				ast_log(LOG_WARNING, "Codec configuration errors found in line %d : %s = %s\n", v->lineno, v->name, v->value);
+		} else if (!strcasecmp(v->name, "preferred_codec_only")) {
+			ast_set2_flag(&global_flags[1], ast_true(v->value), SIP_PAGE2_PREFERRED_CODEC);
 		} else if (!strcasecmp(v->name, "autoframing")) {
 			global_autoframing = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "allowexternaldomains")) {

Modified: team/rmudgett/misdn_facility/configs/sip.conf.sample
URL: http://svn.digium.com/svn-view/asterisk/team/rmudgett/misdn_facility/configs/sip.conf.sample?view=diff&rev=184029&r1=184028&r2=184029
==============================================================================
--- team/rmudgett/misdn_facility/configs/sip.conf.sample (original)
+++ team/rmudgett/misdn_facility/configs/sip.conf.sample Tue Mar 24 15:54:28 2009
@@ -182,6 +182,11 @@
 ;vmexten=voicemail              ; dialplan extension to reach mailbox sets the 
                                 ; Message-Account in the MWI notify message 
                                 ; defaults to "asterisk"
+
+;preferred_codec_only=yes       ; Respond to a SIP invite with the single most preferred codec
+                                ; rather than advertising all joint codec capabilities. This
+                                ; limits the other side's codec choice to exactly what we prefer.
+
 ;disallow=all                   ; First disallow all codecs
 ;allow=ulaw                     ; Allow codecs in order of preference
 ;allow=ilbc                     ; see doc/rtp-packetization for framing options




More information about the asterisk-commits mailing list