Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv22309
Modified Files:
cdr.c pbx.c
Log Message:
expose function execution routines and warn about trying to set a read-only cdr
var
Index: cdr.c
===================================================================
RCS file: /usr/cvsroot/asterisk/cdr.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- cdr.c 22 Apr 2005 13:11:34 -0000 1.35
+++ cdr.c 5 May 2005 15:07:48 -0000 1.36
@@ -209,7 +209,19 @@
{
struct ast_var_t *newvariable;
struct varshead *headp;
+ const char *read_only[] = { "clid", "src", "dst", "dcontext",
"channel", "dstchannel",
+ "lastapp",
"lastdata", "start", "answer", "end", "duration",
+ "billsec",
"disposition", "amaflags", "accountcode", "uniqueid",
+ "userfield",
NULL };
+ int x;
+ for(x = 0; read_only[x]; x++) {
+ if (!strcasecmp(name, read_only[x])) {
+ ast_log(LOG_ERROR, "Attempt to set a read-only
variable!.\n");
+ return -1;
+ }
+ }
+
if (!cdr) {
ast_log(LOG_ERROR, "Attempt to set a variable on a nonexistent
CDR record.\n");
return -1;
Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.238
retrieving revision 1.239
diff -u -d -r1.238 -r1.239
--- pbx.c 5 May 2005 05:39:33 -0000 1.238
+++ pbx.c 5 May 2005 15:07:48 -0000 1.239
@@ -207,8 +207,6 @@
static int pbx_builtin_sayphonetic(struct ast_channel *, void *);
int pbx_builtin_setvar(struct ast_channel *, void *);
static int pbx_builtin_importvar(struct ast_channel *, void *);
-static char *ast_func_read(struct ast_channel *chan, const char *in, char
*workspace, size_t len);
-static void ast_func_write(struct ast_channel *chan, const char *in, const
char *value);
static struct varshead globals;
@@ -1313,7 +1311,7 @@
return ret;
}
-static void ast_func_write(struct ast_channel *chan, const char *in, const
char *value)
+void ast_func_write(struct ast_channel *chan, const char *in, const char
*value)
{
char *args = NULL, *function, *p;
struct ast_custom_function *acfptr;
_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs