[svn-commits] dvossel: branch dvossel/fixtheworld_phase1_step3 r305127 - /team/dvossel/fixt...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jan 31 11:47:50 CST 2011


Author: dvossel
Date: Mon Jan 31 11:47:42 2011
New Revision: 305127

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=305127
Log:
addresses reviewboard comments

Modified:
    team/dvossel/fixtheworld_phase1_step3/channels/chan_iax2.c
    team/dvossel/fixtheworld_phase1_step3/channels/chan_jingle.c
    team/dvossel/fixtheworld_phase1_step3/channels/chan_local.c
    team/dvossel/fixtheworld_phase1_step3/channels/chan_mgcp.c
    team/dvossel/fixtheworld_phase1_step3/channels/chan_oss.c
    team/dvossel/fixtheworld_phase1_step3/channels/chan_phone.c
    team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c
    team/dvossel/fixtheworld_phase1_step3/channels/chan_skinny.c
    team/dvossel/fixtheworld_phase1_step3/channels/chan_unistim.c

Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_iax2.c?view=diff&rev=305127&r1=305126&r2=305127
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_iax2.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_iax2.c Mon Jan 31 11:47:42 2011
@@ -1704,10 +1704,9 @@
 	res = ast_parse_allow_disallow(pref, cap, list, allowing);
 	*formats = ast_format_cap_to_old_bitfield(cap);
 	cap = ast_format_cap_destroy(cap);
+
 	return res;
-
-}
-
+}
 
 static int iax2_data_add_codecs(struct ast_data *root, const char *node_name, iax2_format formats)
 {

Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_jingle.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_jingle.c?view=diff&rev=305127&r1=305126&r2=305127
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_jingle.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_jingle.c Mon Jan 31 11:47:42 2011
@@ -1215,7 +1215,7 @@
 		if (f->frametype == AST_FRAME_VOICE) {
 			if (!(ast_format_cap_iscompatible(p->owner->nativeformats, &f->subclass.format))) {
 				ast_debug(1, "Oooh, format changed to %s\n", ast_getformatname(&f->subclass.format));
-				ast_format_cap_remove_all(p->owner->nativeformats);
+				ast_format_cap_remove_bytype(p->owner->nativeformats, AST_FORMAT_TYPE_AUDIO);
 				ast_format_cap_add(p->owner->nativeformats, &f->subclass.format);
 				ast_set_read_format(p->owner, &p->owner->readformat);
 				ast_set_write_format(p->owner, &p->owner->writeformat);

Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_local.c?view=diff&rev=305127&r1=305126&r2=305127
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_local.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_local.c Mon Jan 31 11:47:42 2011
@@ -1052,8 +1052,8 @@
 
 	tmp2->tech = tmp->tech = &local_tech;
 
-	ast_format_cap_append(tmp->nativeformats, p->reqcap);
-	ast_format_cap_append(tmp2->nativeformats, p->reqcap);
+	ast_format_cap_copy(tmp->nativeformats, p->reqcap);
+	ast_format_cap_copy(tmp2->nativeformats, p->reqcap);
 
 	/* Determine our read/write format and set it on each channel */
 	ast_best_codec(p->reqcap, &fmt);

Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_mgcp.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_mgcp.c?view=diff&rev=305127&r1=305126&r2=305127
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_mgcp.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_mgcp.c Mon Jan 31 11:47:42 2011
@@ -2239,7 +2239,6 @@
 				strncat(a, costr, sizeof(a) - strlen(a) - 1);
 			}
 		}
-
 	}
 	ast_format_cap_iter_end(p->cap);
 

Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_oss.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_oss.c?view=diff&rev=305127&r1=305126&r2=305127
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_oss.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_oss.c Mon Jan 31 11:47:42 2011
@@ -799,8 +799,8 @@
 	ast_format_cap_add(c->nativeformats, &c->readformat);
 
 	/* if the console makes the call, add video to the offer */
-	//if (state == AST_STATE_RINGING) /* TODO XXX CONSOLE VIDEO IS DISABLED UNTIL IT GETS A MAINTAINER */
-	//	c->nativeformats |= console_video_formats;
+	/* if (state == AST_STATE_RINGING) TODO XXX CONSOLE VIDEO IS DISABLED UNTIL IT GETS A MAINTAINER
+		c->nativeformats |= console_video_formats; */
 
 	c->tech_pvt = o;
 

Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_phone.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_phone.c?view=diff&rev=305127&r1=305126&r2=305127
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_phone.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_phone.c Mon Jan 31 11:47:42 2011
@@ -209,9 +209,9 @@
 		ioctl(p->fd, IXJCTL_PSTN_SET_STATE, PSTN_ON_HOOK);
 		usleep(320000);
 		ioctl(p->fd, IXJCTL_PSTN_SET_STATE, PSTN_OFF_HOOK);
-			ast_format_clear(&p->lastformat);
-			res = 0;
-			break;
+		ast_format_clear(&p->lastformat);
+		res = 0;
+		break;
 	case AST_CONTROL_HOLD:
 		ast_moh_start(chan, data, NULL);
 		break;

Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c?view=diff&rev=305127&r1=305126&r2=305127
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c Mon Jan 31 11:47:42 2011
@@ -6031,10 +6031,10 @@
 /*! \brief Try setting codec suggested by the SIP_CODEC channel variable */
 static void try_suggested_sip_codec(struct sip_pvt *p)
 {
-	struct ast_format fmt = {
-		.id = 0,
-	};
+	struct ast_format fmt;
 	const char *codec;
+
+	ast_format_clear(&fmt);
 
 	if (p->outgoing_call) {
 		codec = pbx_builtin_getvar_helper(p->owner, "SIP_CODEC_OUTBOUND");
@@ -16848,7 +16848,7 @@
 				break;
 			}
 			astman_append(s, "%s", ast_getformatname(&codec));
-			if (x < 63 && ast_codec_pref_index(pref, x+1, &codec))
+			if ((x < (AST_CODEC_PREF_SIZE - 1)) && ast_codec_pref_index(pref, x+1, &codec))
 				astman_append(s, ",");
 		}
 

Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_skinny.c?view=diff&rev=305127&r1=305126&r2=305127
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_skinny.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_skinny.c Mon Jan 31 11:47:42 2011
@@ -4675,7 +4675,7 @@
 		tmp->tech = &skinny_tech;
 		tmp->tech_pvt = sub;
 		ast_format_cap_copy(tmp->nativeformats, l->cap);
-		if (!tmp->nativeformats) {
+		if (ast_format_cap_is_empty(tmp->nativeformats)) {
 			// Should throw an error
 			ast_format_cap_copy(tmp->nativeformats, default_cap);
 		}

Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_unistim.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_unistim.c?view=diff&rev=305127&r1=305126&r2=305127
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_unistim.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_unistim.c Mon Jan 31 11:47:42 2011
@@ -1483,11 +1483,12 @@
 	return 1;
 }
 
-static void unistim_line_copy(struct unistim_line *src, struct unistim_line *dst)
+static void unistim_line_copy(struct unistim_line *dst, struct unistim_line *src)
 {
 	struct ast_format_cap *tmp = src->cap;
-	memcpy(src, dst, sizeof(*src));
+	memcpy(src, dst, sizeof(*src)); /* this over writes the cap ptr, so we have to reset it */
 	src->cap = tmp;
+	ast_format_cap_copy(src->cap, dst->cap);
 }
 
 static struct unistim_line *unistim_line_destroy(struct unistim_line *l)
@@ -1591,7 +1592,7 @@
 							return;
 						}
 
-						unistim_line_copy(newl, d->lines);
+						unistim_line_copy(d->lines, newl);
 						if (!alloc_sub(newl, SUB_REAL)) {
 							ast_free(newd);
 							unistim_line_destroy(newl);
@@ -5717,6 +5718,8 @@
 io_failed:
 	ast_free(buff);
 	buff = NULL;
+	global_cap = ast_format_cap_destroy(global_cap);
+	unistim_tech.capabilities = ast_format_cap_destroy(unistim_tech.capabilities);
 buff_failed:
 	return AST_MODULE_LOAD_FAILURE;
 }




More information about the svn-commits mailing list