[Asterisk-cvs] asterisk pbx.c,1.132,1.133 cdr.c,1.18,1.19
jeremy at lists.digium.com
jeremy at lists.digium.com
Mon Jun 28 00:03:00 CDT 2004
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv6858
Modified Files:
pbx.c cdr.c
Log Message:
Add new built-in app 'SetAMAFlags'
Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -d -r1.132 -r1.133
--- pbx.c 25 Jun 2004 19:33:27 -0000 1.132
+++ pbx.c 28 Jun 2004 03:48:53 -0000 1.133
@@ -166,6 +166,7 @@
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 @@
" 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_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 @@
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 */
Index: cdr.c
===================================================================
RCS file: /usr/cvsroot/asterisk/cdr.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cdr.c 22 Jun 2004 20:11:15 -0000 1.18
+++ cdr.c 28 Jun 2004 03:48:53 -0000 1.19
@@ -377,6 +377,18 @@
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;
More information about the svn-commits
mailing list