[asterisk-commits] dlee: branch dlee/playback r388072 - in /team/dlee/playback/res: ./ stasis/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 8 16:26:23 CDT 2013


Author: dlee
Date: Wed May  8 16:26:21 2013
New Revision: 388072

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388072
Log:
Fixed borked merge

Modified:
    team/dlee/playback/res/res_stasis.c
    team/dlee/playback/res/stasis/app.c

Modified: team/dlee/playback/res/res_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback/res/res_stasis.c?view=diff&rev=388072&r1=388071&r2=388072
==============================================================================
--- team/dlee/playback/res/res_stasis.c (original)
+++ team/dlee/playback/res/res_stasis.c Wed May  8 16:26:21 2013
@@ -244,7 +244,7 @@
 			break;
 		}
 
-		control_dispatch_all(control, chan);
+		command_count = control_dispatch_all(control, chan);
 
 		if (command_count > 0 && ast_channel_fdno(chan) == -1) {
 			/* Command drained the channel; wait for next frame */

Modified: team/dlee/playback/res/stasis/app.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/playback/res/stasis/app.c?view=diff&rev=388072&r1=388071&r2=388072
==============================================================================
--- team/dlee/playback/res/stasis/app.c (original)
+++ team/dlee/playback/res/stasis/app.c Wed May  8 16:26:21 2013
@@ -153,19 +153,17 @@
 	app_send(app, msg);
 }
 
-static void blob_handler(struct app *app, struct ast_channel_blob *blob)
-{
-	/* To simplify events, we'll only generate on DTMF end */
-	if (strcmp(ast_channel_blob_json_type(blob), "dtmf_end") == 0) {
-		dtmf_handler(app, blob);
-	}
-}
-
 static void sub_handler(void *data, struct stasis_subscription *sub,
 			struct stasis_topic *topic,
 			struct stasis_message *message)
 {
 	struct app *app = data;
+
+	if (stasis_subscription_final_message(sub, message)) {
+		ao2_cleanup(data);
+		return;
+	}
+
 	if (ast_channel_snapshot_type() == stasis_message_type(message)) {
 		RAII_VAR(struct ast_json *, msg, NULL, ast_json_unref);
 		struct ast_channel_snapshot *snapshot =
@@ -176,12 +174,9 @@
 			return;
 		}
 		app_send(app, msg);
-	} else if (ast_channel_blob_type() == stasis_message_type(message)) {
+	} else if (ast_channel_dtmf_end_type() == stasis_message_type(message)) {
 		struct ast_channel_blob *blob = stasis_message_data(message);
-		blob_handler(app, blob);
-	}
-	if (stasis_subscription_final_message(sub, message)) {
-		ao2_cleanup(data);
+		dtmf_handler(app, blob);
 	}
 }
 




More information about the asterisk-commits mailing list