[Asterisk-cvs] asterisk pbx.c,1.282,1.283

markster markster
Tue Oct 4 13:45:41 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv32246

Modified Files:
	pbx.c 
Log Message:
If you're hanging up channels, be sure we clean it up...


Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.282
retrieving revision 1.283
diff -u -d -r1.282 -r1.283
--- pbx.c	29 Sep 2005 04:39:14 -0000	1.282
+++ pbx.c	4 Oct 2005 17:41:30 -0000	1.283
@@ -4999,12 +4999,16 @@
 						ast_mutex_unlock(&chan->lock);
 					if (ast_pbx_run(chan)) {
 						ast_log(LOG_ERROR, "Unable to run PBX on %s\n", chan->name);
+						if (channel)
+							*channel = NULL;
 						ast_hangup(chan);
 						res = -1;
 					}
 				} else {
 					if (ast_pbx_start(chan)) {
 						ast_log(LOG_ERROR, "Unable to start PBX on %s\n", chan->name);
+						if (channel)
+							*channel = NULL;
 						ast_hangup(chan);
 						res = -1;
 					} 
@@ -5020,6 +5024,8 @@
 						ast_cdr_failed(chan->cdr);
 				}
 			
+				if (channel)
+					*channel = NULL;
 				ast_hangup(chan);
 			}
 		}
@@ -5079,6 +5085,8 @@
 		if (ast_pthread_create(&as->p, &attr, async_wait, as)) {
 			ast_log(LOG_WARNING, "Failed to start async wait\n");
 			free(as);
+			if (channel)
+				*channel = NULL;
 			ast_hangup(chan);
 			res = -1;
 			goto outgoing_exten_cleanup;




More information about the svn-commits mailing list