[asterisk-commits] tilghman: branch 1.6.2 r192942 - in /branches/1.6.2: ./ channels/chan_unistim.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 7 12:15:44 CDT 2009


Author: tilghman
Date: Thu May  7 12:15:40 2009
New Revision: 192942

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=192942
Log:
Merged revisions 192938 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r192938 | tilghman | 2009-05-07 12:13:36 -0500 (Thu, 07 May 2009) | 6 lines
  
  Send DTMF frame before playing back audio.
  (closes issue #14858)
   Reported by: barryf
   Patches: 
         20090507__bug14858.diff.txt uploaded by tilghman (license 14)
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/channels/chan_unistim.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/channels/chan_unistim.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.2/channels/chan_unistim.c?view=diff&rev=192942&r1=192941&r2=192942
==============================================================================
--- branches/1.6.2/channels/chan_unistim.c (original)
+++ branches/1.6.2/channels/chan_unistim.c Thu May  7 12:15:40 2009
@@ -2470,14 +2470,17 @@
 
 static int unistim_do_senddigit(struct unistimsession *pte, char digit)
 {
-
-	struct ast_frame f = { 0, };
+	struct ast_frame f = { .frametype = AST_FRAME_DTMF, .subclass = digit, .src = "unistim" };
 	struct unistim_subchannel *sub;
 	sub = pte->device->lines->subs[SUB_REAL];
 	if (!sub->owner || sub->alreadygone) {
 		ast_log(LOG_WARNING, "Unable to find subchannel in dtmf senddigit\n");
 		return -1;
 	}
+
+	/* Send DTMF indication _before_ playing sounds */
+	ast_queue_frame(sub->owner, &f);
+
 	if (unistimdebug)
 		ast_verb(0, "Send Digit %c\n", digit);
 	switch (digit) {
@@ -2534,10 +2537,6 @@
 	}
 	usleep(150000);			 /* XXX Less than perfect, blocking an important thread is not a good idea */
 	send_tone(pte, 0, 0);
-	f.frametype = AST_FRAME_DTMF;
-	f.subclass = digit;
-	f.src = "unistim";
-	ast_queue_frame(sub->owner, &f);
 	return 0;
 }
 




More information about the asterisk-commits mailing list