aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormoy <moy@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-23 02:28:37 +0000
committermoy <moy@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-23 02:28:37 +0000
commit5082e386ab539e1ae66c2c2c3e3928f0322f69d5 (patch)
tree01b9a67430ea72dae7909afca1565dda2d92862f
parent4b9179c2d7a46527fe97f1124e3135bf2afc9306 (diff)
Enqueue AST_CONTROL_PROGRESS after AST_CONTROL_RINGING when MFC-R2 calls are accepted
(closes issue #18438) Reported by: mariner7 Tested by: moy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@299530 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_dahdi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index b6be64820..9e8b65820 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -3618,6 +3618,7 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
ast_log(LOG_ERROR, "unable to make new MFC/R2 call!\n");
return -1;
}
+ p->mfcr2_call_accepted = 0;
ast_setstate(ast, AST_STATE_DIALING);
}
#endif /* HAVE_OPENR2 */
@@ -7064,6 +7065,18 @@ static struct ast_frame *dahdi_read(struct ast_channel *ast)
#ifdef HAVE_OPENR2
if (p->mfcr2) {
openr2_chan_process_event(p->r2chan);
+ if (OR2_DIR_FORWARD == openr2_chan_get_direction(p->r2chan)) {
+ struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, };
+ /* if the call is already accepted and we already delivered AST_CONTROL_RINGING
+ * now enqueue a progress frame to bridge the media up */
+ if (p->mfcr2_call_accepted &&
+ !p->progress &&
+ ast->_state == AST_STATE_RINGING) {
+ ast_log(LOG_DEBUG, "Enqueuing progress frame after R2 accept in chan %d\n", p->channel);
+ ast_queue_frame(p->owner, &f);
+ p->progress = 1;
+ }
+ }
}
#endif