From 142981bde5697e01382f8f1ab28d1083dd8fd6fa Mon Sep 17 00:00:00 2001 From: martinp Date: Thu, 18 Sep 2003 21:17:14 +0000 Subject: Add NoCDR application; when called there won't be generated CDR record for that call git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1528 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 apps/app_cdr.c (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c new file mode 100755 index 000000000..a053fae9e --- /dev/null +++ b/apps/app_cdr.c @@ -0,0 +1,65 @@ +/* + * Asterisk -- A telephony toolkit for Linux. + * + * Applictions connected with CDR engine + * + * Copyright (C) 2003, Digium + * + * Martin Pycko +#include +#include +#include + + +static char *tdesc = "Make sure asterisk doesn't save CDR for a certain call"; + +static char *nocdr_descrip = "NoCDR(): makes sure there won't be any CDR written for a certain call"; +static char *nocdr_app = "NoCDR"; +static char *nocdr_synopsis = "Make sure asterisk doesn't save CDR for a certain call"; + +STANDARD_LOCAL_USER; + +LOCAL_USER_DECL; + +static int nocdr_exec(struct ast_channel *chan, void *data) +{ + if (chan->cdr) { + free(chan->cdr); + chan->cdr = NULL; + } + return 0; +} + +int unload_module(void) +{ + STANDARD_HANGUP_LOCALUSERS; + return ast_unregister_application(nocdr_app); +} + +int load_module(void) +{ + return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip); +} + +char *description(void) +{ + return tdesc; +} + +int usecount(void) +{ + int res; + STANDARD_USECOUNT(res); + return res; +} + +char *key() +{ + return ASTERISK_GPL_KEY; +} -- cgit v1.2.3 From 6ef4e21ab40420080e72b7c9b0851e2b1731ad46 Mon Sep 17 00:00:00 2001 From: martinp Date: Thu, 18 Sep 2003 21:52:01 +0000 Subject: Add closing bracket git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1529 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index a053fae9e..dafbdd57c 100755 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -5,7 +5,7 @@ * * Copyright (C) 2003, Digium * - * Martin Pycko * * This program is free software, distributed under the terms of * the GNU General Public License -- cgit v1.2.3 From 977162929930e61ce11b75ce6c7c89a383170f3e Mon Sep 17 00:00:00 2001 From: markster Date: Mon, 29 Sep 2003 20:13:54 +0000 Subject: Change strdupa's to ast_strupda's git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1579 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index dafbdd57c..1720261a8 100755 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -11,6 +11,7 @@ * the GNU General Public License */ +#include #include #include #include -- cgit v1.2.3 From b6878d0ef5f3c67d4533467de0d953a7b2a3874b Mon Sep 17 00:00:00 2001 From: markster Date: Wed, 22 Oct 2003 02:53:39 +0000 Subject: Fix compile warnings (bug #389) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1644 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 1720261a8..ce04f72f6 100755 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -31,7 +31,7 @@ LOCAL_USER_DECL; static int nocdr_exec(struct ast_channel *chan, void *data) { if (chan->cdr) { - free(chan->cdr); + ast_cdr_free(chan->cdr); chan->cdr = NULL; } return 0; -- cgit v1.2.3 From 31e8dcf4fe91466bf35a3f6d4de2bd714c43b288 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Thu, 21 Apr 2005 06:02:45 +0000 Subject: use double-quotes instead of angle-brackets for non-system include files (bug #4058) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5490 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index ce04f72f6..8e6752ac6 100755 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -12,9 +12,9 @@ */ #include -#include -#include -#include +#include "asterisk/channel.h" +#include "asterisk/module.h" +#include "asterisk/pbx.h" #include -- cgit v1.2.3 From 8dc28b2439f7568ee72de7a85d5e3275ddd0e3d8 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Mon, 6 Jun 2005 22:39:32 +0000 Subject: the last round of file version tags git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5867 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 8e6752ac6..9d9bfdef8 100755 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -12,10 +12,15 @@ */ #include +#include + +#include "asterisk.h" + +ASTERISK_FILE_VERSION(__FILE__, "$Revision$") + #include "asterisk/channel.h" #include "asterisk/module.h" #include "asterisk/pbx.h" -#include static char *tdesc = "Make sure asterisk doesn't save CDR for a certain call"; -- cgit v1.2.3 From 95fe2b8fd4f3d52c2a4b86931266af889e748e84 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Wed, 14 Sep 2005 20:46:50 +0000 Subject: update MANY more files with proper copyright/license info (thanks Ian!) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6596 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 9d9bfdef8..49fa39961 100755 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -1,14 +1,25 @@ /* - * Asterisk -- A telephony toolkit for Linux. + * Asterisk -- An open source telephony toolkit. * - * Applictions connected with CDR engine - * - * Copyright (C) 2003, Digium + * Copyright (C) 1999 - 2005, Digium, Inc. * * Martin Pycko * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * * This program is free software, distributed under the terms of - * the GNU General Public License + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +/* + * + * Applictions connected with CDR engine + * */ #include -- cgit v1.2.3 From 2c83f05ebb3060c268c396b5c5fe6a6f7f20a638 Mon Sep 17 00:00:00 2001 From: russell Date: Tue, 18 Oct 2005 22:52:21 +0000 Subject: it's a good idea to unregister everything before calling STANDARD_HANGUP_LOCALUSERS git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6828 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 49fa39961..e5d18faad 100755 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -55,8 +55,13 @@ static int nocdr_exec(struct ast_channel *chan, void *data) int unload_module(void) { + int res; + + res = ast_unregister_application(nocdr_app); + STANDARD_HANGUP_LOCALUSERS; - return ast_unregister_application(nocdr_app); + + return res; } int load_module(void) -- cgit v1.2.3 From 58818426d60d583c4becc6a99b398cbac1b7b12f Mon Sep 17 00:00:00 2001 From: russell Date: Wed, 19 Oct 2005 18:19:02 +0000 Subject: Massive cleanups to applications for LOCAL_USER handling and some other things. In general, LOCAL_USER_ADD/REMOVE should be the first/last thing called in an application. An exception is if there is some *fast* setup code that might halt the execution of the application, such as checking to see if an argument exists. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6832 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index e5d18faad..80d136c35 100755 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -46,10 +46,17 @@ LOCAL_USER_DECL; static int nocdr_exec(struct ast_channel *chan, void *data) { + struct localuser *u; + + LOCAL_USER_ADD(u); + if (chan->cdr) { ast_cdr_free(chan->cdr); chan->cdr = NULL; } + + LOCAL_USER_REMOVE(u); + return 0; } -- cgit v1.2.3 From 2c3b3edc86c6999c3053c131972a3e29e7621bac Mon Sep 17 00:00:00 2001 From: russell Date: Mon, 24 Oct 2005 20:12:06 +0000 Subject: Doxygen documentation update from oej (issue #5505) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6847 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 80d136c35..d8e8ecb58 100755 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -16,9 +16,8 @@ * at the top of the source tree. */ -/* - * - * Applictions connected with CDR engine +/*! \file + * \brief Applications connected with CDR engine * */ -- cgit v1.2.3 From d3ddc001a22ebbbea8ff3601fe8698edff8e7f05 Mon Sep 17 00:00:00 2001 From: russell Date: Sun, 6 Nov 2005 15:09:47 +0000 Subject: issue #5605 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6979 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 1 + 1 file changed, 1 insertion(+) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index d8e8ecb58..4f87898d1 100755 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -19,6 +19,7 @@ /*! \file * \brief Applications connected with CDR engine * + * \ingroup applications */ #include -- cgit v1.2.3 From 44abf0bbac9c9e29b548bf5850e39153f3647f9d Mon Sep 17 00:00:00 2001 From: russell Date: Thu, 10 Nov 2005 20:56:45 +0000 Subject: clean up some application descriptions to use more gooder English git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7047 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 4f87898d1..501bfc79b 100755 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -34,11 +34,14 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/pbx.h" -static char *tdesc = "Make sure asterisk doesn't save CDR for a certain call"; +static char *tdesc = "Tell Asterisk to not maintain a CDR for the current call"; + +static char *nocdr_descrip = +" NoCDR(): This application will tell Asterisk not to maintain a CDR for the\n" +"current call.\n"; -static char *nocdr_descrip = "NoCDR(): makes sure there won't be any CDR written for a certain call"; static char *nocdr_app = "NoCDR"; -static char *nocdr_synopsis = "Make sure asterisk doesn't save CDR for a certain call"; +static char *nocdr_synopsis = "Tell Asterisk to not maintain a CDR for the current call"; STANDARD_LOCAL_USER; -- cgit v1.2.3 From 24c1e3c22259fee9f8a08911d5e5c6e2604ead18 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Tue, 29 Nov 2005 18:24:39 +0000 Subject: git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7221 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 apps/app_cdr.c (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c old mode 100755 new mode 100644 -- cgit v1.2.3 From ab6566173e89a7a2dfe6a1e38d496ac0304ecd4a Mon Sep 17 00:00:00 2001 From: russell Date: Fri, 30 Dec 2005 21:18:06 +0000 Subject: update doxygen docs to specify authors git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7682 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 501bfc79b..3a457e60b 100644 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -17,8 +17,11 @@ */ /*! \file + * * \brief Applications connected with CDR engine * + * Martin Pycko + * * \ingroup applications */ -- cgit v1.2.3 From c72e5e1b38c62e6aeb7a557aa336532926ade8b4 Mon Sep 17 00:00:00 2001 From: russell Date: Wed, 15 Feb 2006 20:11:56 +0000 Subject: remove the uses of the deprecated STANDARD_LOCAL_USER git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10241 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 3a457e60b..663a1722e 100644 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -46,8 +46,6 @@ static char *nocdr_descrip = static char *nocdr_app = "NoCDR"; static char *nocdr_synopsis = "Tell Asterisk to not maintain a CDR for the current call"; -STANDARD_LOCAL_USER; - LOCAL_USER_DECL; static int nocdr_exec(struct ast_channel *chan, void *data) -- cgit v1.2.3 From 25108e6dfbe08fe0b1deb1668f5fcb6eadcbbecc Mon Sep 17 00:00:00 2001 From: rizzo Date: Thu, 6 Apr 2006 15:48:06 +0000 Subject: convert one more file... git-svn-id: http://svn.digium.com/svn/asterisk/trunk@17866 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 663a1722e..d1b767406 100644 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -28,6 +28,8 @@ #include #include +#define STATIC_MODULE + #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision$") @@ -36,9 +38,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/module.h" #include "asterisk/pbx.h" - -static char *tdesc = "Tell Asterisk to not maintain a CDR for the current call"; - static char *nocdr_descrip = " NoCDR(): This application will tell Asterisk not to maintain a CDR for the\n" "current call.\n"; @@ -64,7 +63,7 @@ static int nocdr_exec(struct ast_channel *chan, void *data) return 0; } -int unload_module(void) +STATIC_MODULE int unload_module(void) { int res; @@ -75,24 +74,26 @@ int unload_module(void) return res; } -int load_module(void) +STATIC_MODULE int load_module(void) { return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip); } -char *description(void) +STATIC_MODULE char *description(void) { - return tdesc; + return "Tell Asterisk to not maintain a CDR for the current call"; } -int usecount(void) +STATIC_MODULE int usecount(void) { int res; STANDARD_USECOUNT(res); return res; } -char *key() +STATIC_MODULE char *key(void) { return ASTERISK_GPL_KEY; } + +STD_MOD(MOD_1, NULL, NULL, NULL); -- cgit v1.2.3 From e4880150b1746ede7bd3c9e0f8fb88901a8c562b Mon Sep 17 00:00:00 2001 From: kpfleming Date: Sat, 8 Apr 2006 22:01:19 +0000 Subject: since the module API is changing, it's a good time to const-ify the description() and key() return values git-svn-id: http://svn.digium.com/svn/asterisk/trunk@18552 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index d1b767406..0364bb4d9 100644 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -79,7 +79,7 @@ STATIC_MODULE int load_module(void) return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip); } -STATIC_MODULE char *description(void) +STATIC_MODULE const char *description(void) { return "Tell Asterisk to not maintain a CDR for the current call"; } @@ -91,7 +91,7 @@ STATIC_MODULE int usecount(void) return res; } -STATIC_MODULE char *key(void) +STATIC_MODULE const char *key(void) { return ASTERISK_GPL_KEY; } -- cgit v1.2.3 From 3664249356aa4768fcb0b3b8e6cf9365fcbd0c8d Mon Sep 17 00:00:00 2001 From: rizzo Date: Fri, 14 Apr 2006 14:08:19 +0000 Subject: This rather large commit changes the way modules are loaded. As partly documented in loader.c and include/asterisk/module.h, modules are now expected to return all of their methods and flags into a structure 'mod_data', and are normally loaded with RTLD_NOW | RTLD_LOCAL, so symbols are resolved immediately and conflicts should be less likely. Only in a small number of cases (res_*, typically) modules are loaded RTLD_GLOBAL, so they can export symbols. The core of the change is only the two files loader.c and include/asterisk/module.h, all the rest is simply adaptation of the existing modules to the new API, a rather mechanical (but believe me, time and finger-consuming!) process whose detail you can figure out by svn diff'ing any single module. Expect some minor compilation issue after this change, please report it on mantis http://bugs.digium.com/view.php?id=6968 so we collect all the feedback in one place. I am just sorry that this change missed SVN version number 20000! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20003 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 0364bb4d9..ebf44bfe5 100644 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -28,8 +28,6 @@ #include #include -#define STATIC_MODULE - #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision$") @@ -63,7 +61,7 @@ static int nocdr_exec(struct ast_channel *chan, void *data) return 0; } -STATIC_MODULE int unload_module(void) +static int unload_module(void *mod) { int res; @@ -74,24 +72,17 @@ STATIC_MODULE int unload_module(void) return res; } -STATIC_MODULE int load_module(void) +static int load_module(void *mod) { return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip); } -STATIC_MODULE const char *description(void) +static const char *description(void) { return "Tell Asterisk to not maintain a CDR for the current call"; } -STATIC_MODULE int usecount(void) -{ - int res; - STANDARD_USECOUNT(res); - return res; -} - -STATIC_MODULE const char *key(void) +static const char *key(void) { return ASTERISK_GPL_KEY; } -- cgit v1.2.3 From 73c525e6e2dbcf452c2e78e44a63678f2b2068ea Mon Sep 17 00:00:00 2001 From: kpfleming Date: Wed, 7 Jun 2006 18:54:56 +0000 Subject: simplify autoconfig include mechanism (make tholo happy he can use lint again :-) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32846 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index ebf44bfe5..8d20fb012 100644 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -25,13 +25,13 @@ * \ingroup applications */ -#include -#include - #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision$") +#include +#include + #include "asterisk/channel.h" #include "asterisk/module.h" #include "asterisk/pbx.h" -- cgit v1.2.3 From 8b0c007ad990aa27d9868da49215fd1076ac77cc Mon Sep 17 00:00:00 2001 From: kpfleming Date: Mon, 21 Aug 2006 02:11:39 +0000 Subject: merge new_loader_completion branch, including (at least): - restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index 8d20fb012..e8f76a602 100644 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -43,48 +43,37 @@ static char *nocdr_descrip = static char *nocdr_app = "NoCDR"; static char *nocdr_synopsis = "Tell Asterisk to not maintain a CDR for the current call"; -LOCAL_USER_DECL; static int nocdr_exec(struct ast_channel *chan, void *data) { - struct localuser *u; + struct ast_module_user *u; - LOCAL_USER_ADD(u); + u = ast_module_user_add(chan); if (chan->cdr) { ast_cdr_free(chan->cdr); chan->cdr = NULL; } - LOCAL_USER_REMOVE(u); + ast_module_user_remove(u); return 0; } -static int unload_module(void *mod) +static int unload_module(void) { int res; res = ast_unregister_application(nocdr_app); - STANDARD_HANGUP_LOCALUSERS; + ast_module_user_hangup_all(); return res; } -static int load_module(void *mod) +static int load_module(void) { return ast_register_application(nocdr_app, nocdr_exec, nocdr_synopsis, nocdr_descrip); } -static const char *description(void) -{ - return "Tell Asterisk to not maintain a CDR for the current call"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD(MOD_1, NULL, NULL, NULL); +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Tell Asterisk to not maintain a CDR for the current call"); -- cgit v1.2.3 From a6c0a8e6eac6cb7b63c57b08c8cfc5c943722df3 Mon Sep 17 00:00:00 2001 From: murf Date: Tue, 10 Apr 2007 05:18:26 +0000 Subject: Finished up a previous fix to overcome a compiler warning; the app NoCDR() has been updated to mark the channel CDR as POST_DISABLED instead of destroying the CDR; this way its flags are propagated thru a bridge and the CDR is actually dropped. The cases where only one channel in a bridge has a CDR was cleaned up. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@61136 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_cdr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'apps/app_cdr.c') diff --git a/apps/app_cdr.c b/apps/app_cdr.c index e8f76a602..a70d9d2f5 100644 --- a/apps/app_cdr.c +++ b/apps/app_cdr.c @@ -51,8 +51,7 @@ static int nocdr_exec(struct ast_channel *chan, void *data) u = ast_module_user_add(chan); if (chan->cdr) { - ast_cdr_free(chan->cdr); - chan->cdr = NULL; + ast_set_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED); } ast_module_user_remove(u); -- cgit v1.2.3