[asterisk-commits] moy: branch moy/mfcr2-1.6-progress r299492 - /team/moy/mfcr2-1.6-progress/cha...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 23 00:51:07 UTC 2010


Author: moy
Date: Wed Dec 22 18:51:02 2010
New Revision: 299492

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=299492
Log:
enqueue AST_CONTROL_PROGRESS only after AST_CONTROL_RINGING

Modified:
    team/moy/mfcr2-1.6-progress/channels/chan_dahdi.c

Modified: team/moy/mfcr2-1.6-progress/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/moy/mfcr2-1.6-progress/channels/chan_dahdi.c?view=diff&rev=299492&r1=299491&r2=299492
==============================================================================
--- team/moy/mfcr2-1.6-progress/channels/chan_dahdi.c (original)
+++ team/moy/mfcr2-1.6-progress/channels/chan_dahdi.c Wed Dec 22 18:51:02 2010
@@ -1838,7 +1838,6 @@
 {
 	struct dahdi_pvt *p = NULL;
 	struct ast_channel *c = NULL;
-	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, };
 
 	p = openr2_chan_get_client_data(r2chan);
 
@@ -1875,12 +1874,8 @@
 	}
 	/* this is an outgoing call, no need to launch the PBX thread, most likely we're in one already */
 	ast_verbose("MFC/R2 call has been accepted on forward channel %d\n", p->channel);
-
-	/* no need to lock p since this function is called implicitly from dahdi_read which already has the chan and pvt locked in that order */
-	ast_queue_frame(p->owner, &f);
-	p->progress = 1;
+	p->subs[SUB_REAL].needringing = 1;
 	p->dialing = 0;
-
 	/* chan_dahdi will take care of reading from now on in the PBX thread, tell the library to forget about it */
 	openr2_chan_disable_read(r2chan);
 }
@@ -7073,6 +7068,18 @@
 #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
 




More information about the asterisk-commits mailing list