[Asterisk-cvs] asterisk/apps app_queue.c,1.119,1.120

markster at lists.digium.com markster at lists.digium.com
Mon Jan 31 21:48:13 CST 2005


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

Modified Files:
	app_queue.c 
Log Message:
Make monitoring accept args from both sides (bug #3449, with mods)


Index: app_queue.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_queue.c,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- app_queue.c	29 Jan 2005 22:42:40 -0000	1.119
+++ app_queue.c	1 Feb 2005 03:49:35 -0000	1.120
@@ -1380,6 +1380,7 @@
 	char *newnum;
 	char *monitorfilename;
 	struct ast_channel *peer;
+	struct ast_channel *which;
 	struct localuser *lpeer;
 	struct member *member;
 	int res = 0, bridge = 0;
@@ -1584,14 +1585,18 @@
 		}
 		/* Begin Monitoring */
 		if (qe->parent->monfmt && *qe->parent->monfmt) {
-			monitorfilename = pbx_builtin_getvar_helper( qe->chan, "MONITOR_FILENAME");
+			monitorfilename = pbx_builtin_getvar_helper(qe->chan, "MONITOR_FILENAME");
+			if(pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC") || pbx_builtin_getvar_helper( qe->chan, "MONITOR_EXEC_ARGS"))
+				which = qe->chan;
+			else
+				which = peer;
 			if(monitorfilename) {
-				ast_monitor_start( peer, qe->parent->monfmt, monitorfilename, 1 );
+				ast_monitor_start(which, qe->parent->monfmt, monitorfilename, 1 );
 			} else {
-				ast_monitor_start( peer, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1 );
+				ast_monitor_start(which, qe->parent->monfmt, qe->chan->cdr->uniqueid, 1 );
 			}
 			if(ast_test_flag(qe->parent, QUEUE_FLAG_MONJOIN)) {
-				ast_monitor_setjoinfiles( peer, 1);
+				ast_monitor_setjoinfiles(which, 1);
 			}
 		}
 		/* Drop out of the queue at this point, to prepare for next caller */




More information about the svn-commits mailing list