Index: main/manager.c
===================================================================
--- main/manager.c (revision 216996)
+++ main/manager.c (working copy)
@@ -354,12 +354,21 @@
Extension to transfer to.
+
+ Extension to transfer extrachannel to (optional).
+
Context to transfer to.
+
+ Context to transfer extrachannel to (optional).
+
Priority to transfer to.
+
+ Priority to transfer extrachannel to (optional).
+
Redirect (transfer) a call.
@@ -2963,10 +2972,13 @@
const char *name = astman_get_header(m, "Channel");
const char *name2 = astman_get_header(m, "ExtraChannel");
const char *exten = astman_get_header(m, "Exten");
+ const char *exten2 = astman_get_header(m, "ExtraExten");
const char *context = astman_get_header(m, "Context");
+ const char *context2 = astman_get_header(m, "ExtraContext");
const char *priority = astman_get_header(m, "Priority");
+ const char *priority2 = astman_get_header(m, "ExtraPriority");
struct ast_channel *chan, *chan2 = NULL;
- int pi = 0;
+ int pi, pi2 = 0;
int res;
if (ast_strlen_zero(name)) {
@@ -2981,6 +2993,13 @@
}
}
+ if (!ast_strlen_zero(priority2) && (sscanf(priority2, "%30d", &pi2) != 1)) {
+ if ((pi2 = ast_findlabel_extension(NULL, context2, exten2, priority2, NULL)) < 1) {
+ astman_send_error(s, m, "Invalid ExtraPriority");
+ return 0;
+ }
+ }
+
if (!(chan = ast_channel_get_by_name(name))) {
char buf[256];
snprintf(buf, sizeof(buf), "Channel does not exist: %s", name);
@@ -3020,7 +3039,11 @@
ast_set_flag(chan2, AST_FLAG_BRIDGE_HANGUP_DONT); /* don't let the after-bridge code run the h-exten */
ast_channel_unlock(chan2);
}
- res = ast_async_goto(chan2, context, exten, pi);
+ if (context2) {
+ res = ast_async_goto(chan2, context2, exten2, pi2);
+ } else {
+ res = ast_async_goto(chan2, context, exten, pi);
+ }
} else {
res = -1;
}