[asterisk-commits] branch jcollie/bug6082 r27386 - /team/jcollie/bug6082/channel.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue May 16 08:20:49 MST 2006


Author: jcollie
Date: Tue May 16 10:20:49 2006
New Revision: 27386

URL: http://svn.digium.com/view/asterisk?rev=27386&view=rev
Log:
Change to one DTMF event with variables per OEJ's suggestion.

Modified:
    team/jcollie/bug6082/channel.c

Modified: team/jcollie/bug6082/channel.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/channel.c?rev=27386&r1=27385&r2=27386&view=diff
==============================================================================
--- team/jcollie/bug6082/channel.c (original)
+++ team/jcollie/bug6082/channel.c Tue May 16 10:20:49 2006
@@ -1821,15 +1821,18 @@
 	return 0; /* Time is up */
 }
 
-static void send_dtmf_event(const struct ast_channel *chan, const char *event_name, const char digit)
-{
-	manager_event(EVENT_FLAG_DTMF, event_name,
-			"Channel: %s\r\n"
-			"Uniqueid: %s\r\n"
-			"Digit: %c\r\n",
-			chan->name, chan->uniqueid, digit
-			);
-}	
+static void send_dtmf_event(const struct ast_channel *chan, const char *direction, const char digit, const char *begin, const char *end)
+{
+	manager_event(EVENT_FLAG_DTMF,
+		      "DTMF",
+		      "Channel: %s\r\n"
+		      "Uniqueid: %s\r\n"
+		      "Digit: %c\r\n"
+		      "Direction: %s\r\n"
+		      "Begin: %s\r\n"
+		      "End: %s\r\n",
+		      chan->name, chan->uniqueid, digit, direction, begin, end);
+}
 
 static struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
 {
@@ -1978,7 +1981,7 @@
 			break;
 		case AST_FRAME_DTMF:
 			ast_log(LOG_DTMF, "DTMF '%c' received on %s\n", f->subclass, chan->name);
-			send_dtmf_event(chan, "DTMFReceived", f->subclass);		
+			send_dtmf_event(chan, "Received", f->subclass, "Yes", "Yes");
 			if (ast_test_flag(chan, AST_FLAG_DEFER_DTMF)) {
 				if (strlen(chan->dtmfq) < sizeof(chan->dtmfq) - 2)
 					chan->dtmfq[strlen(chan->dtmfq)] = f->subclass;
@@ -1989,11 +1992,11 @@
 			break;
 		case AST_FRAME_DTMF_BEGIN:
 			ast_log(LOG_DTMF, "DTMF begin '%c' received on %s\n", f->subclass, chan->name);
-			send_dtmf_event(chan, "DTMFBeginReceived", f->subclass);		
+			send_dtmf_event(chan, "Received", f->subclass, "Yes", "No");		
 			break;
 		case AST_FRAME_DTMF_END:
 			ast_log(LOG_DTMF, "DTMF end '%c' received on %s\n", f->subclass, chan->name);
-			send_dtmf_event(chan, "DTMFEndReceived", f->subclass);		
+			send_dtmf_event(chan, "Received", f->subclass, "No", "Yes");		
 			break;
 		case AST_FRAME_VOICE:
 			if (dropaudio) {
@@ -2333,17 +2336,17 @@
 		ast_log(LOG_WARNING, "Don't know how to handle control frames yet\n");
 		break;
 	case AST_FRAME_DTMF_BEGIN:
-		send_dtmf_event(chan, "DTMFBeginSent", fr->subclass);		
+		send_dtmf_event(chan, "Sent", fr->subclass, "Yes", "No");
 		res = (chan->tech->send_digit_begin == NULL) ? 0 :
 			chan->tech->send_digit_begin(chan, fr->subclass);
 		break;
 	case AST_FRAME_DTMF_END:
-		send_dtmf_event(chan, "DTMFEndSent", fr->subclass);		
+		send_dtmf_event(chan, "Sent", fr->subclass, "No", "Yes");
 		res = (chan->tech->send_digit_end == NULL) ? 0 :
 			chan->tech->send_digit_end(chan);
 		break;
 	case AST_FRAME_DTMF:
-		send_dtmf_event(chan, "DTMFSent", fr->subclass);		
+		send_dtmf_event(chan, "Sent", fr->subclass, "Yes", "Yes");
 		ast_clear_flag(chan, AST_FLAG_BLOCKING);
 		ast_channel_unlock(chan);
 		res = do_senddigit(chan,fr->subclass);



More information about the asterisk-commits mailing list