mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-15 14:28:24 +00:00
app_dial.c: Make 'A' option pass COLP updates.
While the 'A' option is playing the announcement file allow the caller and peer to exchange COLP update frames. ASTERISK-25423 Reported by: John Hardin Change-Id: Iac6cf89b56d26452c6bb88e9363622bbf23895f9
This commit is contained in:
@@ -2748,13 +2748,15 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
|
|||||||
|
|
||||||
active_chan = ast_waitfor_n(chans, 2, &ms);
|
active_chan = ast_waitfor_n(chans, 2, &ms);
|
||||||
if (active_chan) {
|
if (active_chan) {
|
||||||
|
struct ast_channel *other_chan;
|
||||||
struct ast_frame *fr = ast_read(active_chan);
|
struct ast_frame *fr = ast_read(active_chan);
|
||||||
|
|
||||||
if (!fr) {
|
if (!fr) {
|
||||||
ast_autoservice_chan_hangup_peer(chan, peer);
|
ast_autoservice_chan_hangup_peer(chan, peer);
|
||||||
res = -1;
|
res = -1;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
switch(fr->frametype) {
|
switch (fr->frametype) {
|
||||||
case AST_FRAME_DTMF_END:
|
case AST_FRAME_DTMF_END:
|
||||||
digit = fr->subclass.integer;
|
digit = fr->subclass.integer;
|
||||||
if (active_chan == peer && strchr(AST_DIGIT_ANY, res)) {
|
if (active_chan == peer && strchr(AST_DIGIT_ANY, res)) {
|
||||||
@@ -2769,6 +2771,20 @@ static int dial_exec_full(struct ast_channel *chan, const char *data, struct ast
|
|||||||
ast_autoservice_chan_hangup_peer(chan, peer);
|
ast_autoservice_chan_hangup_peer(chan, peer);
|
||||||
res = -1;
|
res = -1;
|
||||||
goto done;
|
goto done;
|
||||||
|
case AST_CONTROL_CONNECTED_LINE:
|
||||||
|
/* Pass COLP update to the other channel. */
|
||||||
|
if (active_chan == chan) {
|
||||||
|
other_chan = peer;
|
||||||
|
} else {
|
||||||
|
other_chan = chan;
|
||||||
|
}
|
||||||
|
if (ast_channel_connected_line_sub(active_chan, other_chan, fr, 1)
|
||||||
|
&& ast_channel_connected_line_macro(active_chan,
|
||||||
|
other_chan, fr, other_chan == chan, 1)) {
|
||||||
|
ast_indicate_data(other_chan, fr->subclass.integer,
|
||||||
|
fr->data.ptr, fr->datalen);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user