summaryrefslogtreecommitdiff
path: root/channels/chan_oss.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2013-08-02 14:05:07 +0000
committerMark Michelson <mmichelson@digium.com>2013-08-02 14:05:07 +0000
commitf8622e7c5cbdda91a5efad230a9e3af593378c7c (patch)
treeac2c4b5f2256fb55c84fb8915d82298d23c0e188 /channels/chan_oss.c
parent57a8148ccd704f02f33c65d902b199f4205e5480 (diff)
Get rid of ast_bridged_channel() and the bridged_channel field on ast_channels.
This commit is smaller than the initial review placed on review board. This is because a change to allow for channel drivers to access parking functionality externally was committed and invalidated quite a few of the changes initially made. (closes issue ASTERISK-22039) reported by Matt Jordan Review: https://reviewboard.asterisk.org/r/2717 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_oss.c')
-rw-r--r--channels/chan_oss.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 2545138b1..f8e67e59e 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -68,6 +68,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/causes.h"
#include "asterisk/musiconhold.h"
#include "asterisk/app.h"
+#include "asterisk/bridge.h"
#include "console_video.h"
@@ -1173,7 +1174,7 @@ static char *console_mute(struct ast_cli_entry *e, int cmd, struct ast_cli_args
static char *console_transfer(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct chan_oss_pvt *o = find_desc(oss_active);
- struct ast_channel *b = NULL;
+ RAII_VAR(struct ast_channel *, b, NULL, ast_channel_cleanup);
char *tmp, *ext, *ctx;
switch (cmd) {
@@ -1192,24 +1193,19 @@ static char *console_transfer(struct ast_cli_entry *e, int cmd, struct ast_cli_a
return CLI_SHOWUSAGE;
if (o == NULL)
return CLI_FAILURE;
- if (o->owner == NULL || (b = ast_bridged_channel(o->owner)) == NULL) {
+ if (o->owner == NULL || !ast_channel_is_bridged(o->owner)) {
ast_cli(a->fd, "There is no call to transfer\n");
return CLI_SUCCESS;
}
tmp = ast_ext_ctx(a->argv[2], &ext, &ctx);
- if (ctx == NULL) /* supply default context if needed */
+ if (ctx == NULL) { /* supply default context if needed */
ctx = ast_strdupa(ast_channel_context(o->owner));
- if (!ast_exists_extension(b, ctx, ext, 1,
- S_COR(ast_channel_caller(b)->id.number.valid, ast_channel_caller(b)->id.number.str, NULL))) {
- ast_cli(a->fd, "No such extension exists\n");
- } else {
- ast_cli(a->fd, "Whee, transferring %s to %s@%s.\n", ast_channel_name(b), ext, ctx);
- if (ast_async_goto(b, ctx, ext, 1))
- ast_cli(a->fd, "Failed to transfer :(\n");
}
- if (tmp)
- ast_free(tmp);
+ if (ast_bridge_transfer_blind(1, o->owner, ext, ctx, NULL, NULL) != AST_BRIDGE_TRANSFER_SUCCESS) {
+ ast_log(LOG_WARNING, "Unable to transfer call from channel %s\n", ast_channel_name(o->owner));
+ }
+ ast_free(tmp);
return CLI_SUCCESS;
}