summaryrefslogtreecommitdiff
path: root/cdr.c
diff options
context:
space:
mode:
authorAnthony Minessale II <anthmct@yahoo.com>2005-05-05 15:07:49 +0000
committerAnthony Minessale II <anthmct@yahoo.com>2005-05-05 15:07:49 +0000
commit6b7677e842d5ba5646b3f8b1c30254161479d977 (patch)
tree900b49271b8197254a3641049785b9e956048843 /cdr.c
parentb0685838db99296e4d86aa57d2eb313a1ed59243 (diff)
expose function execution routines and warn about trying to set a read-only cdr var
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cdr.c')
-rwxr-xr-xcdr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/cdr.c b/cdr.c
index 51c40dbb9..938533565 100755
--- a/cdr.c
+++ b/cdr.c
@@ -209,7 +209,19 @@ int ast_cdr_setvar(struct ast_cdr *cdr, const char *name, const char *value, int
{
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;