summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-02-27 16:50:19 +0000
committerKinsey Moore <kmoore@digium.com>2012-02-27 16:50:19 +0000
commit1fac2fba4b8f3decd83d738e974280aa92b50bcc (patch)
tree114ec337f0210035993f29b81d1c704ff1ad7242 /apps
parent3cf09f40f749c8889de7d2b1aadf05d122ccba4f (diff)
Deprecated macro usage for connected line, redirecting, and CCSS
This commit adds GoSub alternatives to connected line, redirecting, and CCSS macro hooks so that macro can finally be deprecated. This also adds deprecation warnings for those features when used and in documentation. Review: https://reviewboard.asterisk.org/r/1760/ (closes issue SWP-4256) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c21
-rw-r--r--apps/app_followme.c6
-rw-r--r--apps/app_queue.c16
3 files changed, 28 insertions, 15 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 03eae32ea..20747c0f6 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -956,7 +956,8 @@ static void do_forward(struct chanlist *o,
ast_party_redirecting_init(&redirecting);
ast_party_redirecting_copy(&redirecting, &c->redirecting);
ast_channel_unlock(c);
- if (ast_channel_redirecting_macro(c, in, &redirecting, 1, 0)) {
+ if (ast_channel_redirecting_sub(c, in, &redirecting, 0) &&
+ ast_channel_redirecting_macro(c, in, &redirecting, 1, 0)) {
ast_channel_update_redirecting(in, &redirecting, NULL);
}
ast_party_redirecting_free(&redirecting);
@@ -1105,7 +1106,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
ast_verb(3, "%s answered %s\n", ast_channel_name(c), ast_channel_name(in));
if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
if (o->pending_connected_update) {
- if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
+ if (ast_channel_connected_line_sub(c, in, &o->connected, 0) &&
+ ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
ast_channel_update_connected_line(in, &o->connected, NULL);
}
} else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
@@ -1175,7 +1177,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
ast_verb(3, "%s answered %s\n", ast_channel_name(c), ast_channel_name(in));
if (!single && !ast_test_flag64(peerflags, OPT_IGNORE_CONNECTEDLINE)) {
if (o->pending_connected_update) {
- if (ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
+ if (ast_channel_connected_line_sub(c, in, &o->connected, 0) &&
+ ast_channel_connected_line_macro(c, in, &o->connected, 1, 0)) {
ast_channel_update_connected_line(in, &o->connected, NULL);
}
} else if (!ast_test_flag64(o, DIAL_CALLERID_ABSENT)) {
@@ -1308,7 +1311,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
ast_party_connected_line_free(&connected);
o->pending_connected_update = 1;
} else {
- if (ast_channel_connected_line_macro(c, in, f, 1, 1)) {
+ if (ast_channel_connected_line_sub(c, in, f, 1) &&
+ ast_channel_connected_line_macro(c, in, f, 1, 1)) {
ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
}
}
@@ -1329,7 +1333,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
ast_verb(3, "Redirecting update to %s prevented.\n", ast_channel_name(in));
} else if (single) {
ast_verb(3, "%s redirecting info has changed, passing it to %s\n", ast_channel_name(c), ast_channel_name(in));
- if (ast_channel_redirecting_macro(c, in, f, 1, 1)) {
+ if (ast_channel_redirecting_sub(c, in, f, 1) &&
+ ast_channel_redirecting_macro(c, in, f, 1, 1)) {
ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
}
pa->sentringing = 0;
@@ -1488,12 +1493,14 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);
break;
case AST_CONTROL_CONNECTED_LINE:
- if (ast_channel_connected_line_macro(in, o->chan, f, 0, 1)) {
+ if (ast_channel_connected_line_sub(in, o->chan, f, 1) &&
+ ast_channel_connected_line_macro(in, o->chan, f, 0, 1)) {
ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);
}
break;
case AST_CONTROL_REDIRECTING:
- if (ast_channel_redirecting_macro(in, o->chan, f, 0, 1)) {
+ if (ast_channel_redirecting_sub(in, o->chan, f, 1) &&
+ ast_channel_redirecting_macro(in, o->chan, f, 0, 1)) {
ast_indicate_data(o->chan, f->subclass.integer, f->data.ptr, f->datalen);
}
break;
diff --git a/apps/app_followme.c b/apps/app_followme.c
index 1bf9547a9..dc824f573 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -1304,7 +1304,8 @@ static int app_exec(struct ast_channel *chan, const char *data)
/* Update connected line to caller if available. */
if (targs.pending_out_connected_update) {
- if (ast_channel_connected_line_macro(outbound, caller, &targs.connected_out, 1, 0)) {
+ if (ast_channel_connected_line_sub(outbound, caller, &targs.connected_out, 0) &&
+ ast_channel_connected_line_macro(outbound, caller, &targs.connected_out, 1, 0)) {
ast_channel_update_connected_line(caller, &targs.connected_out, NULL);
}
}
@@ -1329,7 +1330,8 @@ static int app_exec(struct ast_channel *chan, const char *data)
/* Update connected line to winner if changed. */
if (targs.pending_in_connected_update) {
- if (ast_channel_connected_line_macro(caller, outbound, &targs.connected_in, 0, 0)) {
+ if (ast_channel_connected_line_sub(caller, outbound, &targs.connected_in, 0) &&
+ ast_channel_connected_line_macro(caller, outbound, &targs.connected_in, 0, 0)) {
ast_channel_update_connected_line(outbound, &targs.connected_in, NULL);
}
}
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 0add6c209..834e09082 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -3645,7 +3645,8 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
ast_verb(3, "%s answered %s\n", ochan_name, inchan_name);
if (update_connectedline) {
if (o->pending_connected_update) {
- if (ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
+ if (ast_channel_connected_line_sub(o->chan, in, &o->connected, 0) &&
+ ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
ast_channel_update_connected_line(in, &o->connected, NULL);
}
} else if (!o->dial_callerid_absent) {
@@ -3744,8 +3745,8 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
ast_party_redirecting_init(&redirecting);
ast_party_redirecting_copy(&redirecting, &o->chan->redirecting);
ast_channel_unlock(o->chan);
- res = ast_channel_redirecting_macro(o->chan, in, &redirecting, 1, 0);
- if (res) {
+ if ((res = ast_channel_redirecting_sub(o->chan, in, &redirecting, 0)) &&
+ (res = ast_channel_redirecting_macro(o->chan, in, &redirecting, 1, 0))) {
ast_channel_update_redirecting(in, &redirecting, NULL);
}
ast_party_redirecting_free(&redirecting);
@@ -3774,7 +3775,8 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
ast_verb(3, "%s answered %s\n", ochan_name, inchan_name);
if (update_connectedline) {
if (o->pending_connected_update) {
- if (ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
+ if (ast_channel_connected_line_sub(o->chan, in, &o->connected, 0) &&
+ ast_channel_connected_line_macro(o->chan, in, &o->connected, 1, 0)) {
ast_channel_update_connected_line(in, &o->connected, NULL);
}
} else if (!o->dial_callerid_absent) {
@@ -3858,7 +3860,8 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
ast_party_connected_line_free(&connected);
o->pending_connected_update = 1;
} else {
- if (ast_channel_connected_line_macro(o->chan, in, f, 1, 1)) {
+ if (ast_channel_connected_line_sub(o->chan, in, f, 1) &&
+ ast_channel_connected_line_macro(o->chan, in, f, 1, 1)) {
ast_indicate_data(in, AST_CONTROL_CONNECTED_LINE, f->data.ptr, f->datalen);
}
}
@@ -3879,7 +3882,8 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
ast_verb(3, "Redirecting update to %s prevented\n", inchan_name);
} else if (qe->parent->strategy != QUEUE_STRATEGY_RINGALL) {
ast_verb(3, "%s redirecting info has changed, passing it to %s\n", ochan_name, inchan_name);
- if (ast_channel_redirecting_macro(o->chan, in, f, 1, 1)) {
+ if (ast_channel_redirecting_sub(o->chan, in, f, 1) &&
+ ast_channel_redirecting_macro(o->chan, in, f, 1, 1)) {
ast_indicate_data(in, AST_CONTROL_REDIRECTING, f->data.ptr, f->datalen);
}
}