[asterisk-commits] russell: branch russell/events r81156 - in /team/russell/events: apps/ config...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Aug 27 16:57:34 CDT 2007
Author: russell
Date: Mon Aug 27 16:57:33 2007
New Revision: 81156
URL: http://svn.digium.com/view/asterisk?view=rev&rev=81156
Log:
Merge most of the stuff from the ais branch into this one ... no need for 2 branches
Added:
team/russell/events/configs/ais.conf.sample
- copied unchanged from r81137, team/russell/ais/configs/ais.conf.sample
team/russell/events/include/asterisk/dundi.h
- copied unchanged from r81133, team/russell/ais/include/asterisk/dundi.h
team/russell/events/include/asterisk/event.h
- copied unchanged from r81130, team/russell/ais/include/asterisk/event.h
team/russell/events/include/asterisk/event_defs.h
- copied unchanged from r81130, team/russell/ais/include/asterisk/event_defs.h
team/russell/events/include/asterisk/netsock.h
- copied unchanged from r81142, team/russell/ais/include/asterisk/netsock.h
team/russell/events/include/asterisk/utils.h
- copied unchanged from r81145, team/russell/ais/include/asterisk/utils.h
team/russell/events/main/event.c
- copied unchanged from r81128, team/russell/ais/main/event.c
team/russell/events/main/netsock.c
- copied unchanged from r81141, team/russell/ais/main/netsock.c
team/russell/events/pbx/dundi-parser.c
- copied unchanged from r81132, team/russell/ais/pbx/dundi-parser.c
team/russell/events/pbx/pbx_dundi.c
- copied unchanged from r81127, team/russell/ais/pbx/pbx_dundi.c
team/russell/events/res/res_ais.c
- copied unchanged from r81138, team/russell/ais/res/res_ais.c
Modified:
team/russell/events/apps/app_queue.c
team/russell/events/apps/app_userevent.c
team/russell/events/main/devicestate.c
team/russell/events/main/pbx.c
Modified: team/russell/events/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_queue.c?view=diff&rev=81156&r1=81155&r2=81156
==============================================================================
--- team/russell/events/apps/app_queue.c (original)
+++ team/russell/events/apps/app_queue.c Mon Aug 27 16:57:33 2007
@@ -680,7 +680,7 @@
const char *device;
state = ast_event_get_ie_uint(event, AST_EVENT_IE_STATE);
- device = ast_event_get_ie_str(event, AST_EVENT_IE_NAME);
+ device = ast_event_get_ie_str(event, AST_EVENT_IE_DEVICE);
if (ast_strlen_zero(device)) {
ast_log(LOG_ERROR, "Received invalid event that had no device IE\n");
Modified: team/russell/events/apps/app_userevent.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/apps/app_userevent.c?view=diff&rev=81156&r1=81155&r2=81156
==============================================================================
--- team/russell/events/apps/app_userevent.c (original)
+++ team/russell/events/apps/app_userevent.c Mon Aug 27 16:57:33 2007
@@ -38,7 +38,6 @@
#include "asterisk/module.h"
#include "asterisk/manager.h"
#include "asterisk/app.h"
-#include "asterisk/event.h"
static char *app = "UserEvent";
@@ -58,13 +57,12 @@
static int userevent_exec(struct ast_channel *chan, void *data)
{
- char *parse;
- int x;
+ char *parse, buf[2048] = "";
+ int x, buflen = 0;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(eventname);
AST_APP_ARG(extra)[100];
);
- struct ast_event *event;
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "UserEvent requires an argument (eventname,optional event body)\n");
@@ -75,16 +73,14 @@
AST_STANDARD_APP_ARGS(args, parse);
- event = ast_event_new(AST_EVENT_USER_EVENT,
- AST_EVENT_IE_NAME, AST_EVENT_IE_PLTYPE_STR, args.eventname,
- AST_EVENT_IE_END);
- if (!event)
- return -1;
+ for (x = 0; x < args.argc - 1; x++) {
+ ast_copy_string(buf + buflen, args.extra[x], sizeof(buf) - buflen - 2);
+ buflen += strlen(args.extra[x]);
+ ast_copy_string(buf + buflen, "\r\n", 3);
+ buflen += 2;
+ }
- for (x = 0; x < args.argc - 1; x++)
- ast_event_append_ie_str(&event, AST_EVENT_IE_CUSTOM, args.extra[x]);
-
- ast_event_queue(event);
+ manager_event(EVENT_FLAG_USER, "UserEvent", "UserEvent: %s\r\n%s", args.eventname, buf);
return 0;
}
Modified: team/russell/events/main/devicestate.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/devicestate.c?view=diff&rev=81156&r1=81155&r2=81156
==============================================================================
--- team/russell/events/main/devicestate.c (original)
+++ team/russell/events/main/devicestate.c Mon Aug 27 16:57:33 2007
@@ -279,7 +279,7 @@
struct ast_event *event;
event = ast_event_get_cached(AST_EVENT_DEVICE_STATE,
- AST_EVENT_IE_NAME, AST_EVENT_IE_PLTYPE_STR, device,
+ AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, device,
AST_EVENT_IE_END);
if (!event)
@@ -409,7 +409,7 @@
struct ast_event *event;
if (!(event = ast_event_new(AST_EVENT_DEVICE_STATE,
- AST_EVENT_IE_NAME, AST_EVENT_IE_PLTYPE_STR, device,
+ AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR, device,
AST_EVENT_IE_STATE, AST_EVENT_IE_PLTYPE_UINT, state,
AST_EVENT_IE_END))) {
return;
@@ -419,7 +419,7 @@
/* Cache this event, replacing an event in the cache with the same
* device name if it exists. */
ast_event_queue_and_cache(event,
- AST_EVENT_IE_NAME, AST_EVENT_IE_PLTYPE_STR,
+ AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR,
AST_EVENT_IE_END);
} else {
ast_event_queue(event);
Modified: team/russell/events/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/russell/events/main/pbx.c?view=diff&rev=81156&r1=81155&r2=81156
==============================================================================
--- team/russell/events/main/pbx.c (original)
+++ team/russell/events/main/pbx.c Mon Aug 27 16:57:33 2007
@@ -6013,7 +6013,7 @@
{
const char *device;
- device = ast_event_get_ie_str(event, AST_EVENT_IE_NAME);
+ device = ast_event_get_ie_str(event, AST_EVENT_IE_DEVICE);
if (ast_strlen_zero(device)) {
ast_log(LOG_ERROR, "Received invalid event that had no device IE\n");
return;
More information about the asterisk-commits
mailing list