diff options
author | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-28 03:48:53 +0000 |
---|---|---|
committer | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-06-28 03:48:53 +0000 |
commit | 000fdda5cab78a8a69674eb40d80a3f31d541c12 (patch) | |
tree | b2b73e29c90c3b59dba6fbb68b7d08711679fc4f | |
parent | aeae23af4804896b50b766990b7ae06eaa5c9ad1 (diff) |
Add new built-in app 'SetAMAFlags'
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3328 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-x | cdr.c | 12 | ||||
-rwxr-xr-x | pbx.c | 18 |
2 files changed, 29 insertions, 1 deletions
@@ -377,6 +377,18 @@ int ast_cdr_setaccount(struct ast_channel *chan, char *account) return 0; } +int ast_cdr_setamaflags(struct ast_channel *chan, char *flag) +{ + struct ast_cdr *cdr = chan->cdr; + int newflag; + + newflag = ast_cdr_amaflags2int(flag); + if (newflag) { + cdr->amaflags = newflag; + } + return 0; +} + int ast_cdr_setuserfield(struct ast_channel *chan, char *userfield) { struct ast_cdr *cdr = chan->cdr; @@ -166,6 +166,7 @@ static int pbx_builtin_waitexten(struct ast_channel *, void *); static int pbx_builtin_setlanguage(struct ast_channel *, void *); static int pbx_builtin_resetcdr(struct ast_channel *, void *); static int pbx_builtin_setaccount(struct ast_channel *, void *); +static int pbx_builtin_setamaflags(struct ast_channel *, void *); static int pbx_builtin_ringing(struct ast_channel *, void *); static int pbx_builtin_progress(struct ast_channel *, void *); static int pbx_builtin_congestion(struct ast_channel *, void *); @@ -320,6 +321,11 @@ static struct pbx_builtin { " SetAccount([account]): Set the channel account code for billing\n" "purposes. Always returns 0.\n" }, + { "SetAMAFlags", pbx_builtin_setamaflags, +"Sets AMA Flags", +" SetAMAFlags([flag]): Set the channel AMA Flags for billing\n" +"purposes. Always returns 0.\n" }, + { "SetGlobalVar", pbx_builtin_setglobalvar, "Set variable to value", " SetGlobalVar(#n=value): Sets global variable n to value" }, @@ -4267,7 +4273,7 @@ static int pbx_builtin_resetcdr(struct ast_channel *chan, void *data) static int pbx_builtin_setaccount(struct ast_channel *chan, void *data) { - /* Copy the language as specified */ + /* Copy the account code as specified */ if (data) ast_cdr_setaccount(chan, (char *)data); else @@ -4275,6 +4281,16 @@ static int pbx_builtin_setaccount(struct ast_channel *chan, void *data) return 0; } +static int pbx_builtin_setamaflags(struct ast_channel *chan, void *data) +{ + /* Copy the AMA Flags as specified */ + if (data) + ast_cdr_setamaflags(chan, (char *)data); + else + ast_cdr_setamaflags(chan, ""); + return 0; +} + static int pbx_builtin_hangup(struct ast_channel *chan, void *data) { /* Just return non-zero and it will hang up */ |