[Asterisk-cvs] asterisk pbx.c,1.46,1.47

markster at lists.digium.com markster at lists.digium.com
Mon Sep 8 16:51:36 CDT 2003


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv32729

Modified Files:
	pbx.c 
Log Message:
Add ResetCDR application (with mods) (bug #235)


Index: pbx.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** pbx.c	8 Sep 2003 16:08:07 -0000	1.46
--- pbx.c	8 Sep 2003 21:52:45 -0000	1.47
***************
*** 21,24 ****
--- 21,25 ----
  #include <asterisk/callerid.h>
  #include <asterisk/cdr.h>
+ #include <asterisk/config.h>
  #include <asterisk/term.h>
  #include <asterisk/manager.h>
***************
*** 157,160 ****
--- 158,162 ----
  static int pbx_builtin_wait(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_ringing(struct ast_channel *, void *);
***************
*** 264,267 ****
--- 266,275 ----
  "invalid extension.\n" },
  
+ 	{ "ResetCDR", pbx_builtin_resetcdr,
+ "Resets the Call Data Record",
+ "  ResetCDR([options]):  Causes the Call Data Record to be reset, optionally\n"
+ "storing the current CDR  before zeroing it out (if 'w' option is specifed).\n"
+ "record WILL be stored.  Always returns 0.\n"  },
+ 
  	{ "ResponseTimeout", pbx_builtin_rtimeout,
  "Set maximum timeout awaiting response",
***************
*** 4064,4067 ****
--- 4072,4085 ----
  	/* Copy the language as specified */
  	strncpy(chan->language, (char *)data, sizeof(chan->language)-1);
+ 	return 0;
+ }
+ 
+ static int pbx_builtin_resetcdr(struct ast_channel *chan, void *data)
+ {
+ 	/* Reset the CDR as specified */
+ 	if (data)
+ 		ast_cdr_reset(chan->cdr, strchr((char *)data, 'w') ? 1 : 0);
+ 	else
+ 		ast_cdr_reset(chan->cdr, 0);
  	return 0;
  }




More information about the svn-commits mailing list