summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2016-05-09 15:00:56 -0500
committerMark Michelson <mmichelson@digium.com>2016-05-31 11:43:24 -0500
commit205a31f86c4ceec4966492363fb9ac674c990235 (patch)
tree425d8f23f52900292cd7aad1e1f7f75bdd5a55d3 /apps
parent88d997913faabe81f8b9e7bdaa56742be0d669b9 (diff)
Expand the scope of Dial Events
Dial events up to this point have come in two flavors * A Dial event with no status to indicate that dialing has begun * A Dial event with a status to indicate that dialing has ended With this change, Dial events have been expanded to also give intermediate events, such as "RINGING", "PROCEEDING", and "PROGRESS". This is especially useful for ARI dialing, as it gives the application writer the opportunity to place a channel into an early bridge when early media is detected. AMI handles these in-progress dial events by sending a new event called "DialState" that simply indicates that dial state has changed but has not ended. ARI never distinguished between DialBegin and DialEnd, so no change was made to the event itself. Another change here relates to dial forwards. A forward-related event was previously only sent when a channel was successfully able to forward a call to a new channel. With this set of changes, if forwarding is blocked, we send a Dial event with a forwarding destination but no forwarding channel, since we were prevented from creating one. This is again useful for ARI since application writers can now handle call forward attempts from within their own application. ASTERISK-25925 #close Reported by Mark Michelson Change-Id: I42cbec7730d84640a434d143a0d172a740995543
Diffstat (limited to 'apps')
-rw-r--r--apps/app_dial.c5
-rw-r--r--apps/app_followme.c3
-rw-r--r--apps/app_queue.c4
3 files changed, 12 insertions, 0 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 11591bdfb..5e034d3eb 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -872,6 +872,8 @@ static void do_forward(struct chanlist *o, struct cause_args *num,
/* If we have been told to ignore forwards, just set this channel to null and continue processing extensions normally */
if (ast_test_flag64(peerflags, OPT_IGNORE_FORWARDING)) {
ast_verb(3, "Forwarding %s to '%s/%s' prevented.\n", ast_channel_name(in), tech, stuff);
+ ast_channel_publish_dial_forward(in, original, NULL, NULL, "CANCEL",
+ ast_channel_call_forward(original));
c = o->chan = NULL;
cause = AST_CAUSE_BUSY;
} else {
@@ -1385,6 +1387,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
pa->sentringing++;
}
}
+ ast_channel_publish_dial(in, c, NULL, "RINGING");
break;
case AST_CONTROL_PROGRESS:
ast_verb(3, "%s is making progress passing it to %s\n", ast_channel_name(c), ast_channel_name(in));
@@ -1404,6 +1407,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
dtmf_progress);
ast_dtmf_stream(c, in, dtmf_progress, 250, 0);
}
+ ast_channel_publish_dial(in, c, NULL, "PROGRESS");
break;
case AST_CONTROL_VIDUPDATE:
case AST_CONTROL_SRCUPDATE:
@@ -1476,6 +1480,7 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in,
}
if (!ast_test_flag64(outgoing, OPT_RINGBACK))
ast_indicate(in, AST_CONTROL_PROCEEDING);
+ ast_channel_publish_dial(in, c, NULL, "PROCEEDING");
break;
case AST_CONTROL_HOLD:
/* XXX this should be saved like AST_CONTROL_CONNECTED_LINE for !single || caller_entertained */
diff --git a/apps/app_followme.c b/apps/app_followme.c
index d2000fd13..668753417 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -822,9 +822,11 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
break;
case AST_CONTROL_RINGING:
ast_verb(3, "%s is ringing\n", ast_channel_name(winner));
+ ast_channel_publish_dial(caller, winner, NULL, "RINGING");
break;
case AST_CONTROL_PROGRESS:
ast_verb(3, "%s is making progress\n", ast_channel_name(winner));
+ ast_channel_publish_dial(caller, winner, NULL, "PROGRESS");
break;
case AST_CONTROL_VIDUPDATE:
ast_verb(3, "%s requested a video update\n", ast_channel_name(winner));
@@ -834,6 +836,7 @@ static struct ast_channel *wait_for_winner(struct findme_user_listptr *findme_us
break;
case AST_CONTROL_PROCEEDING:
ast_verb(3, "%s is proceeding\n", ast_channel_name(winner));
+ ast_channel_publish_dial(caller, winner, NULL, "PROCEEDING");
break;
case AST_CONTROL_HOLD:
ast_verb(3, "%s placed call on hold\n", ast_channel_name(winner));
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 8171d11cb..165924e0c 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -4846,6 +4846,8 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
/* Before processing channel, go ahead and check for forwarding */
if (!ast_strlen_zero(ast_channel_call_forward(o->chan)) && !forwardsallowed) {
ast_verb(3, "Forwarding %s to '%s' prevented.\n", inchan_name, ast_channel_call_forward(o->chan));
+ ast_channel_publish_dial_forward(qe->chan, o->chan, NULL, NULL,
+ "CANCEL", ast_channel_call_forward(o->chan));
numnochan++;
do_hang(o);
winner = NULL;
@@ -5052,6 +5054,8 @@ static struct callattempt *wait_for_answer(struct queue_ent *qe, struct callatte
case AST_CONTROL_RINGING:
ast_verb(3, "%s is ringing\n", ochan_name);
+ ast_channel_publish_dial(qe->chan, o->chan, on, "RINGING");
+
/* Start ring indication when the channel is ringing, if specified */
if (qe->ring_when_ringing) {
ast_moh_stop(qe->chan);