Skip to content

Commit

Permalink
[acc]change cancel_accounting() name to drop_accounting()
Browse files Browse the repository at this point in the history
  • Loading branch information
ionutrazvanionita committed Mar 25, 2016
1 parent b452f8a commit 4802253
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
24 changes: 12 additions & 12 deletions modules/acc/README
Expand Up @@ -91,7 +91,7 @@ Irina-Maria Stanescu
1.7. Exported Functions

1.7.1. do_accounting(type, flags, table)
1.7.2. cancel_accounting([type], [flags])
1.7.2. drop_accounting([type], [flags])
1.7.3. acc_log_request(comment)
1.7.4. acc_db_request(comment, table)
1.7.5. acc_aaa_request(comment)
Expand Down Expand Up @@ -140,7 +140,7 @@ Irina-Maria Stanescu
1.30. evi_extra_bye example
1.31. acc_created_avp_name example
1.32. do_accounting usage
1.33. cancel_accounting usage
1.33. drop_accounting usage
1.34. acc_log_request usage
1.35. acc_db_request usage
1.36. acc_aaa_request usage
Expand Down Expand Up @@ -829,13 +829,13 @@ y_acc");
}
...

1.7.2. cancel_accounting([type], [flags])
1.7.2. drop_accounting([type], [flags])

cancel_accounting() resets flags and types of accounting set
with do_accounting(). If called with no arguments all
accounting will be stopped. If called with only one argument
all accounting for that type will be stopped. If called with
two arguments normal accounting will still be enabled.
drop_accounting() resets flags and types of accounting set with
do_accounting(). If called with no arguments all accounting
will be stopped. If called with only one argument all
accounting for that type will be stopped. If called with two
arguments normal accounting will still be enabled.

Meaning of the parameters is as follows:
* type - the type of accounting you want to stop. All the
Expand All @@ -856,7 +856,7 @@ y_acc");
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE and LOCAL_ROUTE.

Example 1.33. cancel_accounting usage
Example 1.33. drop_accounting usage
...
acc_log_request("403 Destination not allowed");
if (!has_totag()) {
Expand All @@ -873,13 +873,13 @@ y_acc");
/* later in your script */
if (...) { /* you don't want accounting anymore */
/* stop all syslog accounting */
cancel_accounting("log");
drop_accounting("log");
/* or stop missed calls and cdr accounting for s
yslog;
* normal accounting will still be enabled */
cancel_accounting("log","missed|cdr");
drop_accounting("log","missed|cdr");
/* or stop all types of accounting */
cancel_accounting();
drop_accounting();
}
...

Expand Down
10 changes: 5 additions & 5 deletions modules/acc/acc_logic.c
Expand Up @@ -1058,16 +1058,16 @@ int w_do_acc_3(struct sip_msg* msg, char* type_p, char* flags_p, char* table_p)
}

/* reset all flags */
int w_cancel_acc_0(struct sip_msg* msg) {
return w_cancel_acc_2(msg, NULL, NULL);
int w_drop_acc_0(struct sip_msg* msg) {
return w_drop_acc_2(msg, NULL, NULL);
}

int w_cancel_acc_1(struct sip_msg* msg, char* type)
int w_drop_acc_1(struct sip_msg* msg, char* type)
{
return w_cancel_acc_2(msg, type, NULL);
return w_drop_acc_2(msg, type, NULL);
}

int w_cancel_acc_2(struct sip_msg* msg, char* type_p, char* flags_p)
int w_drop_acc_2(struct sip_msg* msg, char* type_p, char* flags_p)
{
unsigned long long type=0;
/* if not set, we reset all flags for the type of accounting requested */
Expand Down
6 changes: 3 additions & 3 deletions modules/acc/acc_logic.h
Expand Up @@ -123,8 +123,8 @@ int w_do_acc_1(struct sip_msg* msg, char* type);
int w_do_acc_2(struct sip_msg* msg, char* type, char* flags);
int w_do_acc_3(struct sip_msg* msg, char* type_p, char* flags_p, char* table_p);

int w_cancel_acc_0(struct sip_msg* msg);
int w_cancel_acc_1(struct sip_msg* msg, char* type);
int w_cancel_acc_2(struct sip_msg* msg, char* type, char* flags);
int w_drop_acc_0(struct sip_msg* msg);
int w_drop_acc_1(struct sip_msg* msg, char* type);
int w_drop_acc_2(struct sip_msg* msg, char* type, char* flags);

#endif
6 changes: 3 additions & 3 deletions modules/acc/acc_mod.c
Expand Up @@ -210,16 +210,16 @@ static cmd_export_t cmds[] = {
do_acc_fixup, NULL,
REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE},

{"cancel_accounting", (cmd_function)w_cancel_acc_0, 0, 0, NULL,
{"drop_accounting", (cmd_function)w_drop_acc_0, 0, 0, NULL,
REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE},

/* we use the same fixup function since the parameters
* have the same meanining as for do_accounting */
{"cancel_accounting", (cmd_function)w_cancel_acc_1, 1,
{"drop_accounting", (cmd_function)w_drop_acc_1, 1,
do_acc_fixup, NULL,
REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE},

{"cancel_accounting", (cmd_function)w_cancel_acc_2, 2,
{"drop_accounting", (cmd_function)w_drop_acc_2, 2,
do_acc_fixup, NULL,
REQUEST_ROUTE|FAILURE_ROUTE|BRANCH_ROUTE|LOCAL_ROUTE},

Expand Down
12 changes: 6 additions & 6 deletions modules/acc/doc/acc_admin.xml
Expand Up @@ -1058,10 +1058,10 @@ modparam("acc", "acc_created_avp_name", "call_created_avp")

<section id="cancel_accouting">
<title>
<function moreinfo="none">cancel_accounting([type], [flags])</function>
<function moreinfo="none">drop_accounting([type], [flags])</function>
</title>
<para>
<function moreinfo="none">cancel_accounting()</function> resets flags
<function moreinfo="none">drop_accounting()</function> resets flags
and types of accounting set with do_accounting(). If called with no
arguments all accounting will be stopped. If called with only one argument
all accounting for that type will be stopped. If called with two arguments
Expand Down Expand Up @@ -1116,7 +1116,7 @@ modparam("acc", "acc_created_avp_name", "call_created_avp")
</para>

<example>
<title>cancel_accounting usage</title>
<title>drop_accounting usage</title>
<programlisting format="linespecific">
...
acc_log_request("403 Destination not allowed");
Expand All @@ -1131,12 +1131,12 @@ modparam("acc", "acc_created_avp_name", "call_created_avp")
/* later in your script */
if (...) { /* you don't want accounting anymore */
/* stop all syslog accounting */
cancel_accounting("log");
drop_accounting("log");
/* or stop missed calls and cdr accounting for syslog;
* normal accounting will still be enabled */
cancel_accounting("log","missed|cdr");
drop_accounting("log","missed|cdr");
/* or stop all types of accounting */
cancel_accounting();
drop_accounting();
}
...
</programlisting>
Expand Down

0 comments on commit 4802253

Please sign in to comment.