app_cdr.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Asterisk -- An open source telephony toolkit.
  3. *
  4. * Copyright (C) 1999 - 2005, Digium, Inc.
  5. *
  6. * Martin Pycko <martinp@digium.com>
  7. *
  8. * See http://www.asterisk.org for more information about
  9. * the Asterisk project. Please do not directly contact
  10. * any of the maintainers of this project for assistance;
  11. * the project provides a web site, mailing lists and IRC
  12. * channels for your use.
  13. *
  14. * This program is free software, distributed under the terms of
  15. * the GNU General Public License Version 2. See the LICENSE file
  16. * at the top of the source tree.
  17. */
  18. /*! \file
  19. *
  20. * \brief Applications connected with CDR engine
  21. *
  22. * \author Martin Pycko <martinp@digium.com>
  23. *
  24. * \ingroup applications
  25. */
  26. /*** MODULEINFO
  27. <support_level>core</support_level>
  28. ***/
  29. #include "asterisk.h"
  30. ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
  31. #include "asterisk/channel.h"
  32. #include "asterisk/module.h"
  33. /*** DOCUMENTATION
  34. <application name="NoCDR" language="en_US">
  35. <synopsis>
  36. Tell Asterisk to not maintain a CDR for the current call
  37. </synopsis>
  38. <syntax />
  39. <description>
  40. <para>This application will tell Asterisk not to maintain a CDR for the current call.</para>
  41. </description>
  42. </application>
  43. ***/
  44. static const char nocdr_app[] = "NoCDR";
  45. static int nocdr_exec(struct ast_channel *chan, const char *data)
  46. {
  47. if (chan->cdr)
  48. ast_set_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED);
  49. return 0;
  50. }
  51. static int unload_module(void)
  52. {
  53. return ast_unregister_application(nocdr_app);
  54. }
  55. static int load_module(void)
  56. {
  57. if (ast_register_application_xml(nocdr_app, nocdr_exec))
  58. return AST_MODULE_LOAD_FAILURE;
  59. return AST_MODULE_LOAD_SUCCESS;
  60. }
  61. AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Tell Asterisk to not maintain a CDR for the current call");