mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Allow transfer to work without a tech (bug #4199)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -49,18 +49,21 @@ static int transfer_exec(struct ast_channel *chan, void *data)
|
|||||||
int len;
|
int len;
|
||||||
struct localuser *u;
|
struct localuser *u;
|
||||||
char *slash;
|
char *slash;
|
||||||
|
char *dest = data;
|
||||||
if (!data || !strlen(data)) {
|
if (!data || !strlen(data)) {
|
||||||
ast_log(LOG_WARNING, "Transfer requires an argument ([Tech/]destination)\n");
|
ast_log(LOG_WARNING, "Transfer requires an argument ([Tech/]destination)\n");
|
||||||
res = 1;
|
res = 1;
|
||||||
}
|
}
|
||||||
if ((slash = strchr((char *)data, '/')) && (len = (slash - (char *)data))) {
|
if ((slash = strchr((char *)data, '/')) && (len = (slash - (char *)data))) {
|
||||||
|
dest = slash + 1;
|
||||||
/* Allow execution only if the Tech/destination agrees with the type of the channel */
|
/* Allow execution only if the Tech/destination agrees with the type of the channel */
|
||||||
if (strncasecmp(chan->type, (char *)data, len))
|
if (strncasecmp(chan->type, (char *)data, len))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
res = ast_transfer(chan, data + strlen(chan->type) + 1);
|
res = ast_transfer(chan, dest);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!res) {
|
if (!res) {
|
||||||
/* Look for a "busy" place */
|
/* Look for a "busy" place */
|
||||||
|
Reference in New Issue
Block a user