[asterisk-commits] branch jcollie/bug6082 r26883 - in
/team/jcollie/bug6082: ./ configs/ include...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu May 11 06:53:32 MST 2006
Author: jcollie
Date: Thu May 11 08:53:31 2006
New Revision: 26883
URL: http://svn.digium.com/view/asterisk?rev=26883&view=rev
Log:
Apply latest patch from bug 6082.
Modified:
team/jcollie/bug6082/channel.c
team/jcollie/bug6082/configs/manager.conf.sample
team/jcollie/bug6082/include/asterisk/manager.h
team/jcollie/bug6082/manager.c
Modified: team/jcollie/bug6082/channel.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/channel.c?rev=26883&r1=26882&r2=26883&view=diff
==============================================================================
--- team/jcollie/bug6082/channel.c (original)
+++ team/jcollie/bug6082/channel.c Thu May 11 08:53:31 2006
@@ -1821,6 +1821,16 @@
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 struct ast_frame *__ast_read(struct ast_channel *chan, int dropaudio)
{
struct ast_frame *f = NULL; /* the return value */
@@ -1968,6 +1978,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);
if (ast_test_flag(chan, AST_FLAG_DEFER_DTMF)) {
if (strlen(chan->dtmfq) < sizeof(chan->dtmfq) - 2)
chan->dtmfq[strlen(chan->dtmfq)] = f->subclass;
@@ -1978,9 +1989,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);
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);
break;
case AST_FRAME_VOICE:
if (dropaudio) {
@@ -2320,14 +2333,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);
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);
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);
ast_clear_flag(chan, AST_FLAG_BLOCKING);
ast_channel_unlock(chan);
res = do_senddigit(chan,fr->subclass);
Modified: team/jcollie/bug6082/configs/manager.conf.sample
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/configs/manager.conf.sample?rev=26883&r1=26882&r2=26883&view=diff
==============================================================================
--- team/jcollie/bug6082/configs/manager.conf.sample (original)
+++ team/jcollie/bug6082/configs/manager.conf.sample Thu May 11 08:53:31 2006
@@ -44,5 +44,5 @@
; writetimeout = 100
;
; Authorization for various classes
-;read = system,call,log,verbose,command,agent,user
-;write = system,call,log,verbose,command,agent,user
+;read = system,call,log,verbose,command,agent,user,dtmf
+;write = system,call,log,verbose,command,agent,user,dtmf
Modified: team/jcollie/bug6082/include/asterisk/manager.h
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/include/asterisk/manager.h?rev=26883&r1=26882&r2=26883&view=diff
==============================================================================
--- team/jcollie/bug6082/include/asterisk/manager.h (original)
+++ team/jcollie/bug6082/include/asterisk/manager.h Thu May 11 08:53:31 2006
@@ -47,13 +47,14 @@
#define DEFAULT_MANAGER_PORT 5038 /* Default port for Asterisk management via TCP */
-#define EVENT_FLAG_SYSTEM (1 << 0) /* System events such as module load/unload */
-#define EVENT_FLAG_CALL (1 << 1) /* Call event, such as state change, etc */
-#define EVENT_FLAG_LOG (1 << 2) /* Log events */
-#define EVENT_FLAG_VERBOSE (1 << 3) /* Verbose messages */
-#define EVENT_FLAG_COMMAND (1 << 4) /* Ability to read/set commands */
-#define EVENT_FLAG_AGENT (1 << 5) /* Ability to read/set agent info */
-#define EVENT_FLAG_USER (1 << 6) /* Ability to read/set user info */
+#define EVENT_FLAG_SYSTEM (1 << 0) /* System events such as module load/unload */
+#define EVENT_FLAG_CALL (1 << 1) /* Call event, such as state change, etc */
+#define EVENT_FLAG_LOG (1 << 2) /* Log events */
+#define EVENT_FLAG_VERBOSE (1 << 3) /* Verbose messages */
+#define EVENT_FLAG_COMMAND (1 << 4) /* Ability to read/set commands */
+#define EVENT_FLAG_AGENT (1 << 5) /* Ability to read/set agent info */
+#define EVENT_FLAG_USER (1 << 6) /* Ability to read/set user info */
+#define EVENT_FLAG_DTMF (1 << 7) /* Receive DTMF events */
/* Export manager structures */
#define AST_MAX_MANHEADERS 80
Modified: team/jcollie/bug6082/manager.c
URL: http://svn.digium.com/view/asterisk/team/jcollie/bug6082/manager.c?rev=26883&r1=26882&r2=26883&view=diff
==============================================================================
--- team/jcollie/bug6082/manager.c (original)
+++ team/jcollie/bug6082/manager.c Thu May 11 08:53:31 2006
@@ -115,6 +115,7 @@
{ EVENT_FLAG_COMMAND, "command" },
{ EVENT_FLAG_AGENT, "agent" },
{ EVENT_FLAG_USER, "user" },
+ { EVENT_FLAG_DTMF, "dtmf" },
{ -1, "all" },
{ 0, "none" },
};
More information about the asterisk-commits
mailing list