[asterisk-commits] jpeeler: branch jpeeler/feature14882 r282234 - /team/jpeeler/feature14882/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 13 13:32:17 CDT 2010


Author: jpeeler
Date: Fri Aug 13 13:32:13 2010
New Revision: 282234

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=282234
Log:
add ability to park to specific parkinglot via manager

Modified:
    team/jpeeler/feature14882/main/features.c

Modified: team/jpeeler/feature14882/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/jpeeler/feature14882/main/features.c?view=diff&rev=282234&r1=282233&r2=282234
==============================================================================
--- team/jpeeler/feature14882/main/features.c (original)
+++ team/jpeeler/feature14882/main/features.c Fri Aug 13 13:32:13 2010
@@ -5145,11 +5145,11 @@
 	const char *channel = astman_get_header(m, "Channel");
 	const char *channel2 = astman_get_header(m, "Channel2");
 	const char *timeout = astman_get_header(m, "Timeout");
+	const char *parkinglotname = astman_get_header(m, "Parkinglot");
 	char buf[BUFSIZ];
-	int to = 0;
 	int res = 0;
-	int parkExt = 0;
 	struct ast_channel *ch1, *ch2;
+	struct ast_park_call_args args = {0,};
 
 	if (ast_strlen_zero(channel)) {
 		astman_send_error(s, m, "Channel not specified");
@@ -5174,16 +5174,19 @@
 		return 0;
 	}
 
+	if (!ast_strlen_zero(timeout)) {
+		sscanf(timeout, "%30d", &args.timeout);
+	}
+	if (!ast_strlen_zero(parkinglotname)) {
+		args.parkinglot = find_parkinglot(parkinglotname);
+	}
+
 	ast_channel_lock(ch1);
 	while (ast_channel_trylock(ch2)) {
 		CHANNEL_DEADLOCK_AVOIDANCE(ch1);
 	}
 
-	if (!ast_strlen_zero(timeout)) {
-		sscanf(timeout, "%30d", &to);
-	}
-
-	res = ast_masq_park_call(ch1, ch2, to, &parkExt);
+	res = masq_park_call(ch1, ch2, 0, NULL, 0, &args);
 	if (!res) {
 		ast_softhangup(ch2, AST_SOFTHANGUP_EXPLICIT);
 		astman_send_ack(s, m, "Park successful");




More information about the asterisk-commits mailing list