[asterisk-commits] file: branch file/originate_dial r387103 - /team/file/originate_dial/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 1 08:43:25 CDT 2013


Author: file
Date: Wed May  1 08:43:22 2013
New Revision: 387103

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=387103
Log:
Make the locked_channel argument work.

Modified:
    team/file/originate_dial/main/pbx.c

Modified: team/file/originate_dial/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/file/originate_dial/main/pbx.c?view=diff&rev=387103&r1=387102&r2=387103
==============================================================================
--- team/file/originate_dial/main/pbx.c (original)
+++ team/file/originate_dial/main/pbx.c Wed May  1 08:43:22 2013
@@ -10051,6 +10051,10 @@
 		return -1;
 	}
 
+	if (channel) {
+		*channel = NULL;
+	}
+
 	if (!ast_strlen_zero(app)) {
 		ast_copy_string(outgoing->app, app, sizeof(outgoing->app));
 		outgoing->appdata = ast_strdup(appdata);
@@ -10102,6 +10106,11 @@
 		ast_dial_set_state_callback(outgoing->dial, &pbx_outgoing_state_callback);
 	}
 
+	if (channel) {
+		*channel = dialed;
+		ast_channel_lock(*channel);
+	}
+
 	ast_mutex_init(&outgoing->lock);
 	ast_cond_init(&outgoing->cond, NULL);
 
@@ -10109,6 +10118,9 @@
 
 	if (ast_pthread_create_detached(&thread, NULL, pbx_outgoing_exec, outgoing)) {
 		ast_log(LOG_WARNING, "Unable to spawn dialing thread for '%s/%s'\n", type, addr);
+		if (channel) {
+			ast_channel_unlock(*channel);
+		}
 		ao2_ref(outgoing, -1);
 		return -1;
 	}




More information about the asterisk-commits mailing list