[asterisk-commits] mmichelson: branch mmichelson/pool_shark r380292 - /team/mmichelson/pool_shar...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 28 18:02:11 CST 2013


Author: mmichelson
Date: Mon Jan 28 18:02:08 2013
New Revision: 380292

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380292
Log:
gulp_fixup uses the synchronous task pushing.


Modified:
    team/mmichelson/pool_shark/channels/chan_gulp.c

Modified: team/mmichelson/pool_shark/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/pool_shark/channels/chan_gulp.c?view=diff&rev=380292&r1=380291&r2=380292
==============================================================================
--- team/mmichelson/pool_shark/channels/chan_gulp.c (original)
+++ team/mmichelson/pool_shark/channels/chan_gulp.c Mon Jan 28 18:02:08 2013
@@ -263,16 +263,33 @@
 	return res;
 }
 
+struct fixup_data {
+	struct ast_sip_session *session;
+	struct ast_channel *chan;
+};
+
+static int fixup(void *data)
+{
+	struct fixup_data *fix_data = data;
+	fix_data->session->channel = fix_data->chan;
+	return 0;
+}
+
 /*! \brief Function called by core to change the underlying owner channel */
 static int gulp_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
 	struct ast_sip_session *session = ast_channel_tech_pvt(newchan);
+	struct fixup_data fix_data;
+	fix_data.session = session;
+	fix_data.chan = newchan;
 
 	if (session->channel != oldchan) {
 		return -1;
 	}
 
-	session->channel = newchan;
+	if (ast_sip_push_task_synchronous(session->work, fixup, &fix_data)) {
+		return -1;
+	}
 
 	return 0;
 }




More information about the asterisk-commits mailing list