diff options
author | anthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-05 15:07:49 +0000 |
---|---|---|
committer | anthm <anthm@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-05-05 15:07:49 +0000 |
commit | d4dd060a57c6b29d509f5a921617abf28858c510 (patch) | |
tree | 900b49271b8197254a3641049785b9e956048843 /cdr.c | |
parent | 69bfd8b964aff8f4c7a298cb47b658d00d5f3b36 (diff) |
expose function execution routines and warn about trying to set a read-only cdr var
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5589 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cdr.c')
-rwxr-xr-x | cdr.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; |