Module: kamailio
Branch: master
Commit: 16c2fcb34d315963c153e9a5f2961563567d19f0
URL: https://github.com/kamailio/kamailio/commit/16c2fcb34d315963c153e9a5f296156…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2015-10-05T15:26:38+02:00
acc: add acc_prepare_always parameter
This will force the preparation of the request no matter
if the acc_prepare_flag is set at the moment of the transaction
creation
---
Modified: modules/acc/acc_logic.c
Modified: modules/acc/acc_mod.c
Modified: modules/acc/acc_mod.h
Modified: modules/acc/doc/acc_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/16c2fcb34d315963c153e9a5f296156…
Patch: https://github.com/kamailio/kamailio/commit/16c2fcb34d315963c153e9a5f296156…
---
diff --git a/modules/acc/acc_logic.c b/modules/acc/acc_logic.c
index 16a97e5..0d453a7 100644
--- a/modules/acc/acc_logic.c
+++ b/modules/acc/acc_logic.c
@@ -102,7 +102,7 @@ struct acc_enviroment acc_env;
(((_rq)->REQ_METHOD==METHOD_CANCEL) && report_cancels==0)
#define is_acc_prepare_on(_rq) \
- (is_acc_flag_set(_rq,acc_prepare_flag))
+ (acc_prepare_always || is_acc_flag_set(_rq,acc_prepare_flag))
static void tmcb_func( struct cell* t, int type, struct tmcb_params *ps );
diff --git a/modules/acc/acc_mod.c b/modules/acc/acc_mod.c
index 91b47d0..d412dbf 100644
--- a/modules/acc/acc_mod.c
+++ b/modules/acc/acc_mod.c
@@ -108,6 +108,7 @@ static char *failed_filter_str = 0; /* by default, do not filter logging of
unsigned short failed_filter[MAX_FAILED_FILTER_COUNT + 1];
static char* leg_info_str = 0; /*!< multi call-leg support */
struct acc_extra *leg_info = 0;
+int acc_prepare_always = 0; /* prepare the request always for later acc */
int acc_prepare_flag = -1; /*!< should the request be prepared for later acc */
char *acc_time_format = "%Y-%m-%d %H:%M:%S";
int reason_from_hf = 0; /*!< assign reason from reason hf if present */
@@ -262,6 +263,7 @@ static param_export_t params[] = {
{"multi_leg_info", PARAM_STRING, &leg_info_str },
{"detect_direction", INT_PARAM, &detect_direction },
{"acc_prepare_flag", INT_PARAM, &acc_prepare_flag },
+ {"acc_prepare_always", INT_PARAM, &acc_prepare_always },
{"reason_from_hf", INT_PARAM, &reason_from_hf },
/* syslog specific */
{"log_flag", INT_PARAM, &log_flag },
diff --git a/modules/acc/acc_mod.h b/modules/acc/acc_mod.h
index c746ffb..055ac61 100644
--- a/modules/acc/acc_mod.h
+++ b/modules/acc/acc_mod.h
@@ -103,5 +103,6 @@ extern int acc_time_mode;
extern str acc_time_attr;
extern str acc_time_exten;
+extern int acc_prepare_always;
#endif
diff --git a/modules/acc/doc/acc_admin.xml b/modules/acc/doc/acc_admin.xml
index fbe7dc3..c047873 100644
--- a/modules/acc/doc/acc_admin.xml
+++ b/modules/acc/doc/acc_admin.xml
@@ -624,7 +624,7 @@ modparam("acc", "detect_direction", 1)
later, with flags set in TM module specific routes (e.g., like
failure_route). If this flag is not set and acc or missed_call flag
are not set either in request route block, there is no way to mark the
- request for transaction later. If either acc or missed_call flags are
+ request for transaction later unless you set acc_prepare_always. If either acc or missed_call flags are
set in request route block, there is no need to set this flag.
</para>
<para>
@@ -639,6 +639,23 @@ modparam("acc", "acc_prepare_flag", 5)
</programlisting>
</example>
</section>
+ <section id="acc.p.acc_prepare_always">
+ <title><varname>acc_prepare_always</varname> (integer)</title>
+ <para>
+ Prepare all request even if acc_prepare_flag is not set to mark the request for transaction later.
+ </para>
+ <para>
+ Default value is not-set (previous behaviour).
+ </para>
+ <example>
+ <title>acc_prepare_flag example</title>
+ <programlisting format="linespecific">
+...
+modparam("acc", "acc_prepare_always", 1)
+...
+</programlisting>
+ </example>
+ </section>
<section id="acc.p.multi_leg_info">
<title><varname>multi_leg_info</varname> (string)</title>
<para>
Module: kamailio
Branch: master
Commit: be18e641c409d9a23dae7fd1c5bae2e0ad057ed7
URL: https://github.com/kamailio/kamailio/commit/be18e641c409d9a23dae7fd1c5bae2e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-10-05T07:42:10+02:00
textopsx: update the readme for keep_hf()
---
Modified: modules/textopsx/README
Modified: modules/textopsx/doc/functions.xml
---
Diff: https://github.com/kamailio/kamailio/commit/be18e641c409d9a23dae7fd1c5bae2e…
Patch: https://github.com/kamailio/kamailio/commit/be18e641c409d9a23dae7fd1c5bae2e…
---
diff --git a/modules/textopsx/README b/modules/textopsx/README
index 5239885..bbc859b 100644
--- a/modules/textopsx/README
+++ b/modules/textopsx/README
@@ -22,7 +22,7 @@ Daniel-Constantin Mierla
2.1. msg_apply_changes()
2.2. change_reply_status(code, reason)
2.3. remove_body()
- 2.4. keep_hf(regexp)
+ 2.4. keep_hf([regexp])
2.5. fnmatch(value, expr [, flags])
2.6. append_hf_value(hf, hvalue)
2.7. insert_hf_value(hf, hvalue)
@@ -68,7 +68,7 @@ Chapter 1. Admin Guide
2.1. msg_apply_changes()
2.2. change_reply_status(code, reason)
2.3. remove_body()
- 2.4. keep_hf(regexp)
+ 2.4. keep_hf([regexp])
2.5. fnmatch(value, expr [, flags])
2.6. append_hf_value(hf, hvalue)
2.7. insert_hf_value(hf, hvalue)
@@ -97,7 +97,7 @@ Chapter 1. Admin Guide
2.1. msg_apply_changes()
2.2. change_reply_status(code, reason)
2.3. remove_body()
- 2.4. keep_hf(regexp)
+ 2.4. keep_hf([regexp])
2.5. fnmatch(value, expr [, flags])
2.6. append_hf_value(hf, hvalue)
2.7. insert_hf_value(hf, hvalue)
@@ -170,12 +170,14 @@ onreply_route {
remove_body();
...
-2.4. keep_hf(regexp)
+2.4. keep_hf([regexp])
Remove headers that don't match the regular expression regexp. Several
header are ignored always (thus not removed): Via, From, To, Call-ID,
CSeq, Content-Length, Content-Type, Max-Forwards, Contact, Route,
- Record-Route -- these can be removed one by one with remove_hf().
+ Record-Route -- these can be removed one by one with remove_hf(). If
+ regexp is missing, then only the headers listed above are kept, the
+ rest are removed.
This function can be used from ANY_ROUTE.
diff --git a/modules/textopsx/doc/functions.xml b/modules/textopsx/doc/functions.xml
index 204c227..280b730 100644
--- a/modules/textopsx/doc/functions.xml
+++ b/modules/textopsx/doc/functions.xml
@@ -103,14 +103,15 @@ remove_body();
<section id="textopsx.f.keep_hf">
<title>
- <function moreinfo="none">keep_hf(regexp)</function>
+ <function moreinfo="none">keep_hf([regexp])</function>
</title>
<para>
Remove headers that don't match the regular expression regexp.
Several header are ignored always (thus not removed): Via, From,
To, Call-ID, CSeq, Content-Length, Content-Type, Max-Forwards,
Contact, Route, Record-Route -- these can be removed one by one
- with remove_hf().
+ with remove_hf(). If regexp is missing, then only the headers
+ listed above are kept, the rest are removed.
</para>
<para>
This function can be used from ANY_ROUTE.