[svn-commits] oej: branch oej/pinedanish-copybridgeflags-1.8 r363317 - /team/oej/pinedanish...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Apr 24 03:25:13 CDT 2012


Author: oej
Date: Tue Apr 24 03:25:08 2012
New Revision: 363317

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=363317
Log:
The automerge failed in some files that this patch hasn't touched.
This happens more frequently nowadays. Hmm.

Modified:
    team/oej/pinedanish-copybridgeflags-1.8/main/devicestate.c
    team/oej/pinedanish-copybridgeflags-1.8/main/features.c
    team/oej/pinedanish-copybridgeflags-1.8/main/rtp_engine.c

Modified: team/oej/pinedanish-copybridgeflags-1.8/main/devicestate.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/main/devicestate.c?view=diff&rev=363317&r1=363316&r2=363317
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/main/devicestate.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/main/devicestate.c Tue Apr 24 03:25:08 2012
@@ -732,91 +732,39 @@
 void ast_devstate_aggregate_init(struct ast_devstate_aggregate *agg)
 {
 	memset(agg, 0, sizeof(*agg));
-
-	agg->all_unknown = 1;
-	agg->all_unavail = 1;
-	agg->all_busy = 1;
-	agg->all_free = 1;
+	agg->state = AST_DEVICE_INVALID;
 }
 
 void ast_devstate_aggregate_add(struct ast_devstate_aggregate *agg, enum ast_device_state state)
 {
-	switch (state) {
-	case AST_DEVICE_NOT_INUSE:
-		agg->all_unknown = 0;
-		agg->all_unavail = 0;
-		agg->all_busy = 0;
-		break;
-	case AST_DEVICE_INUSE:
-		agg->in_use = 1;
-		agg->all_unavail = 0;
-		agg->all_free = 0;
-		agg->all_unknown = 0;
-		break;
-	case AST_DEVICE_RINGING:
-		agg->ring = 1;
-		agg->all_unavail = 0;
-		agg->all_free = 0;
-		agg->all_unknown = 0;
-		break;
-	case AST_DEVICE_RINGINUSE:
-		agg->in_use = 1;
-		agg->ring = 1;
-		agg->all_unavail = 0;
-		agg->all_free = 0;
-		agg->all_unknown = 0;
-		break;
-	case AST_DEVICE_ONHOLD:
-		agg->all_unknown = 0;
-		agg->all_unavail = 0;
-		agg->all_free = 0;
-		agg->on_hold = 1;
-		break;
-	case AST_DEVICE_BUSY:
-		agg->all_unknown = 0;
-		agg->all_unavail = 0;
-		agg->all_free = 0;
-		agg->busy = 1;
-		agg->in_use = 1;
-		break;
-	case AST_DEVICE_UNAVAILABLE:
-		agg->all_unknown = 0;
-	case AST_DEVICE_INVALID:
-		agg->all_busy = 0;
-		agg->all_free = 0;
-		break;
-	case AST_DEVICE_UNKNOWN:
-		agg->all_busy = 0;
-		agg->all_free = 0;
-		break;
-	case AST_DEVICE_TOTAL: /* not a device state, included for completeness. */
-		break;
-	}
-}
-
+	static enum ast_device_state state_order[] = {
+		1, /* AST_DEVICE_UNKNOWN */
+		3, /* AST_DEVICE_NOT_INUSE */
+		6, /* AST_DEVICE_INUSE */
+		7, /* AST_DEVICE_BUSY */
+		0, /* AST_DEVICE_INVALID */
+		2, /* AST_DEVICE_UNAVAILABLE */
+		5, /* AST_DEVICE_RINGING */
+		8, /* AST_DEVICE_RINGINUSE */
+		4, /* AST_DEVICE_ONHOLD */
+	};
+
+	if (state == AST_DEVICE_RINGING) {
+		agg->ringing = 1;
+	} else if (state == AST_DEVICE_INUSE || state == AST_DEVICE_ONHOLD || state == AST_DEVICE_BUSY) {
+		agg->inuse = 1;
+	}
+
+	if (agg->ringing && agg->inuse) {
+		agg->state = AST_DEVICE_RINGINUSE;
+	} else if (state_order[state] > state_order[agg->state]) {
+		agg->state = state;
+	}
+}
 
 enum ast_device_state ast_devstate_aggregate_result(struct ast_devstate_aggregate *agg)
 {
-	if (agg->all_free)
-		return AST_DEVICE_NOT_INUSE;
-	if ((agg->in_use || agg->on_hold) && agg->ring)
-		return AST_DEVICE_RINGINUSE;
-	if (agg->ring)
-		return AST_DEVICE_RINGING;
-	if (agg->busy)
-		return AST_DEVICE_BUSY;
-	if (agg->in_use)
-		return AST_DEVICE_INUSE;
-	if (agg->on_hold)
-		return AST_DEVICE_ONHOLD;
-	if (agg->all_busy)
-		return AST_DEVICE_BUSY;
-	if (agg->all_unknown)
-		return AST_DEVICE_UNKNOWN;
-	if (agg->all_unavail)
-		return AST_DEVICE_UNAVAILABLE;
-
-	return AST_DEVICE_NOT_INUSE;
+	return agg->state;
 }
 
 int ast_enable_distributed_devstate(void)

Modified: team/oej/pinedanish-copybridgeflags-1.8/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/main/features.c?view=diff&rev=363317&r1=363316&r2=363317
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/main/features.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/main/features.c Tue Apr 24 03:25:08 2012
@@ -1383,7 +1383,6 @@
 	struct parkeduser *pu = args->pu;
 	const char *event_from;		/*!< Channel name that is parking the call. */
 	char app_data[AST_MAX_EXTENSION + AST_MAX_CONTEXT];
-	char app_data[AST_MAX_EXTENSION + AST_MAX_CONTEXT];
 
 	if (pu == NULL) {
 		args->pu = pu = park_space_reserve(chan, peer, args);
@@ -4960,10 +4959,6 @@
 {
 	struct ast_park_call_args args = { 0, };
 	struct ast_flags flags = { 0 };
-	struct ast_park_call_args args = {
-		.orig_chan_name = orig_chan_name,
-	};
-	struct ast_flags flags = { 0 };
 	char orig_exten[AST_MAX_EXTENSION];
 	int orig_priority;
 	int res;

Modified: team/oej/pinedanish-copybridgeflags-1.8/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/main/rtp_engine.c?view=diff&rev=363317&r1=363316&r2=363317
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/main/rtp_engine.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/main/rtp_engine.c Tue Apr 24 03:25:08 2012
@@ -100,6 +100,7 @@
 	{{1, AST_FORMAT_ADPCM}, "audio", "DVI4", 8000},
 	{{1, AST_FORMAT_SLINEAR}, "audio", "L16", 8000},
 	{{1, AST_FORMAT_SLINEAR16}, "audio", "L16", 16000},
+	{{1, AST_FORMAT_SLINEAR16}, "audio", "L16-256", 16000},
 	{{1, AST_FORMAT_LPC10}, "audio", "LPC", 8000},
 	{{1, AST_FORMAT_G729A}, "audio", "G729", 8000},
 	{{1, AST_FORMAT_G729A}, "audio", "G729A", 8000},
@@ -889,7 +890,8 @@
 			    (fr->subclass.integer == AST_CONTROL_UNHOLD) ||
 			    (fr->subclass.integer == AST_CONTROL_VIDUPDATE) ||
 			    (fr->subclass.integer == AST_CONTROL_SRCUPDATE) ||
-			    (fr->subclass.integer == AST_CONTROL_T38_PARAMETERS)) {
+			    (fr->subclass.integer == AST_CONTROL_T38_PARAMETERS) ||
+			    (fr->subclass.integer == AST_CONTROL_UPDATE_RTP_PEER)) {
 				/* If we are going on hold, then break callback mode and P2P bridging */
 				if (fr->subclass.integer == AST_CONTROL_HOLD) {
 					if (instance0->engine->local_bridge) {
@@ -910,7 +912,10 @@
 					instance0->bridged = instance1;
 					instance1->bridged = instance0;
 				}
-				ast_indicate_data(other, fr->subclass.integer, fr->data.ptr, fr->datalen);
+				/* Since UPDATE_BRIDGE_PEER is only used by the bridging code, don't forward it */
+				if (fr->subclass.integer != AST_CONTROL_UPDATE_RTP_PEER) {
+					ast_indicate_data(other, fr->subclass.integer, fr->data.ptr, fr->datalen);
+				}
 				ast_frfree(fr);
 			} else if (fr->subclass.integer == AST_CONTROL_CONNECTED_LINE) {
 				if (ast_channel_connected_line_macro(who, other, fr, other == c0, 1)) {
@@ -1443,6 +1448,10 @@
 		ast_rtp_codecs_payloads_copy(&tinstance0->codecs, &tinstance1->codecs, tinstance1);
 	}
 
+        if (glue0->update_peer(c0, instance1, vinstance1, tinstance1, codec1, 0)) {
+                ast_log(LOG_WARNING, "Channel '%s' failed to setup early bridge to '%s'\n", c0->name, c1 ? c1->name : "<unspecified>");
+        }
+
 	res = 0;
 
 done:
@@ -1777,17 +1786,24 @@
 	return res_srtp && res_srtp_policy;
 }
 
-int ast_rtp_instance_add_srtp_policy(struct ast_rtp_instance *instance, struct ast_srtp_policy *policy)
-{
+int ast_rtp_instance_add_srtp_policy(struct ast_rtp_instance *instance, struct ast_srtp_policy *remote_policy, struct ast_srtp_policy *local_policy)
+{
+	int res = 0;
+
 	if (!res_srtp) {
 		return -1;
 	}
 
 	if (!instance->srtp) {
-		return res_srtp->create(&instance->srtp, instance, policy);
+		res = res_srtp->create(&instance->srtp, instance, remote_policy);
 	} else {
-		return res_srtp->add_stream(instance->srtp, policy);
-	}
+		res = res_srtp->replace(&instance->srtp, instance, remote_policy);
+	}
+	if (!res) {
+		res = res_srtp->add_stream(instance->srtp, local_policy);
+	}
+
+	return res;
 }
 
 struct ast_srtp *ast_rtp_instance_get_srtp(struct ast_rtp_instance *instance)




More information about the svn-commits mailing list