THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#347 - avpops: avp_check() use xavp semantic on first parameter
User who did this - Víctor Seva (linuxmaniac)
Reason for closing: Implemented
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=347
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Module: sip-router
Branch: master
Commit: b6b5b7bf5d08ad20cc00cf89ef3d2f03e913c882
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b6b5b7b…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: Mon Sep 23 21:30:32 2013 +0200
avpops: refresh README
---
modules/avpops/README | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/modules/avpops/README b/modules/avpops/README
index df0bfe7..95d529b 100644
--- a/modules/avpops/README
+++ b/modules/avpops/README
@@ -544,11 +544,24 @@ avp_pushto("$br","$avp(i:680)");
...
avp_check("$avp(i:678)", "lt/i:345/g");
avp_check("$fd","eq/$td/I");
-avp_check("$avp(s:foo)","gt/$avp($bar)/g");
+avp_check("$avp(s:foo)","gt/$avp($var(bar))/g");
avp_check("$avp(s:foo)","re/sip:.*@bar.net/g");
avp_check("$avp(s:foo)","fm/$avp(fm_avp)/g");
...
+ NOTE: you can use a xavp variable ($xavp(key1[indx1]=>key2[indx2])) as
+ first or second parameter. If you want to check all the values of the
+ key2 you should use [*] at indx2. The [*] index is not allowed at
+ indx1.
+...
+avp_check("$xavp(op[0]=>lt[0])", "lt/i:345/g");
+avp_check("$xavp(op=>fd","eq/$td/I");
+avp_check("$xavp(op[1]=>foo[*])","gt/$avp($var(bar))/g");
+avp_check("$avp(s:foo)","re/$xavp(op[0]=>re[*]/g");
+$var(id)=2;
+avp_check("$xavp(op=>foo[*])","fm/$xavp(op=>fm[$var(id)])/g");
+...
+
5.8. avp_copy(old_name,new_name)
Copy / move an avp under a new name.
Module: sip-router
Branch: master
Commit: 3abb169001022567aa0be629677b9e445d1c3ca5
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3abb169…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: Sat Sep 21 11:26:45 2013 +0200
avpops: update avp_check documentation related to xavp vars as parameters
---
modules/avpops/doc/avpops_admin.xml | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/modules/avpops/doc/avpops_admin.xml b/modules/avpops/doc/avpops_admin.xml
index dc3ab0c..84434b7 100644
--- a/modules/avpops/doc/avpops_admin.xml
+++ b/modules/avpops/doc/avpops_admin.xml
@@ -760,11 +760,26 @@ avp_pushto("$br","$avp(i:680)");
...
avp_check("$avp(i:678)", "lt/i:345/g");
avp_check("$fd","eq/$td/I");
-avp_check("$avp(s:foo)","gt/$avp($bar)/g");
+avp_check("$avp(s:foo)","gt/$avp($var(bar))/g");
avp_check("$avp(s:foo)","re/sip:.*@bar.net/g");
avp_check("$avp(s:foo)","fm/$avp(fm_avp)/g");
...
</programlisting>
+ <para>NOTE: you can use a xavp variable ($xavp(key1[indx1]=>key2[indx2]))
+ as first or second parameter.
+ If you want to check all the values of the key2 you should
+ use [*] at indx2. The [*] index is not allowed at indx1.
+ </para>
+ <programlisting format="linespecific">
+...
+avp_check("$xavp(op[0]=>lt[0])", "lt/i:345/g");
+avp_check("$xavp(op=>fd","eq/$td/I");
+avp_check("$xavp(op[1]=>foo[*])","gt/$avp($var(bar))/g");
+avp_check("$avp(s:foo)","re/$xavp(op[0]=>re[*]/g");
+$var(id)=2;
+avp_check("$xavp(op=>foo[*])","fm/$xavp(op=>fm[$var(id)])/g");
+...
+ </programlisting>
</example>
</section>
<section>
Module: sip-router
Branch: master
Commit: 3c65fd74f2473e857996ae1abf2d8fb8dcfaaaab
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3c65fd7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Sep 23 18:50:14 2013 +0200
gzcompress: readme updated to reflect default encoding value to deflate
---
modules/gzcompress/README | 6 +++---
modules/gzcompress/doc/gzcompress_admin.xml | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules/gzcompress/README b/modules/gzcompress/README
index c1cc720..c3c8e6e 100644
--- a/modules/gzcompress/README
+++ b/modules/gzcompress/README
@@ -93,7 +93,7 @@ Chapter 1. Admin Guide
An use case can be when having peering traffic between two Kamailio
servers. Before relaying to the other Kamailio, use in config file:
- append_hf("Content-Encoding: gzip\r\n").
+ append_hf("Content-Encoding: deflate\r\n").
2. Dependencies
@@ -134,11 +134,11 @@ modparam("gzcompress", "header_name", "Encoded")
Name of the header that indicates compression or decompression has to
be done.
- Default value is "gzip".
+ Default value is "deflate".
Example 1.2. Set header_value parameter
...
-modparam("gzcompress", "header_value", "tgz")
+modparam("gzcompress", "header_value", "gzip")
...
3.3. sanity_checks (integer)
diff --git a/modules/gzcompress/doc/gzcompress_admin.xml b/modules/gzcompress/doc/gzcompress_admin.xml
index 61d3633..f7a91b0 100644
--- a/modules/gzcompress/doc/gzcompress_admin.xml
+++ b/modules/gzcompress/doc/gzcompress_admin.xml
@@ -54,7 +54,7 @@
<para>
An use case can be when having peering traffic between two Kamailio
servers. Before relaying to the other Kamailio, use
- in config file: append_hf("Content-Encoding: gzip\r\n").
+ in config file: append_hf("Content-Encoding: deflate\r\n").
</para>
</section>
<section>
@@ -117,14 +117,14 @@ modparam("gzcompress", "header_name", "Encoded")
</para>
<para>
<emphasis>
- Default value is "gzip".
+ Default value is "deflate".
</emphasis>
</para>
<example>
<title>Set <varname>header_value</varname> parameter</title>
<programlisting format="linespecific">
...
-modparam("gzcompress", "header_value", "tgz")
+modparam("gzcompress", "header_value", "gzip")
...
</programlisting>
</example>
Module: sip-router
Branch: master
Commit: 65783f24859f5da45678f2c8a005ca867cc02b86
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=65783f2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Sep 23 19:01:10 2013 +0200
gzcompress: added a small usage example in docs
---
modules/gzcompress/README | 68 ++++++++++++++++++++++++++-
modules/gzcompress/doc/gzcompress_admin.xml | 68 ++++++++++++++++++++++++++-
2 files changed, 134 insertions(+), 2 deletions(-)
diff --git a/modules/gzcompress/README b/modules/gzcompress/README
index c3c8e6e..f594c0c 100644
--- a/modules/gzcompress/README
+++ b/modules/gzcompress/README
@@ -33,11 +33,14 @@ Daniel-Constantin Mierla
4.1.
+ 5. Config File
+
List of Examples
1.1. Set header_name parameter
1.2. Set header_value parameter
1.3. Set sanity_checks parameter
+ 1.4. Enable body compression
Chapter 1. Admin Guide
@@ -59,11 +62,14 @@ Chapter 1. Admin Guide
4.1.
+ 5. Config File
+
1. Overview
This module is able to detect compressed body in received SIP message
and decompress it as well as compress the body for outgoing SIP
- message.
+ message. It works also for received HTTP request and replied HTTP
+ response (Kamailio cannot work in HTTP proxy mode).
The decision of whether to do compression or decompression is made by
detecting a special SIP header (default 'Content-Encoding') that
@@ -160,3 +166,63 @@ modparam("gzcompress", "sanity_checks", 1)
4.1.
None.
+
+5. Config File
+
+ Next example shows how to enable compression for forwarded requests, as
+ well as replying with compressed body for HTTP requests. For SIP, the
+ request is recevied and forwarded to itself once, just for the sake of
+ showing a simple example.
+
+ Example 1.4. Enable body compression
+...
+
+#!KAMAILIO
+
+debug=3
+memdbg=5
+memlog=5
+
+children=2
+
+log_stderror=yes
+listen=udp:127.0.0.1:5060
+listen=tcp:127.0.0.1:5060
+
+tcp_accept_no_cl=yes
+http_reply_parse=yes
+
+mpath="modules/"
+
+loadmodule "sl.so"
+loadmodule "pv.so"
+loadmodule "xlog.so"
+loadmodule "corex.so"
+loadmodule "textops.so"
+loadmodule "xhttp.so"
+loadmodule "gzcompress.so"
+
+modparam("gzcompress", "header_value", "deflate")
+
+request_route {
+ xlog("received sip request from $si:$sp\r\n");
+
+ if(src_port==5060) {
+ remove_hf("Content-Encoding");
+ $du = "sip:127.0.0.1:9";
+ } else {
+ append_hf("Content-Encoding: gzip\r\n");
+ $du = "sip:127.0.0.1:5060";
+ }
+ forward();
+ exit;
+}
+
+event_route[xhttp:request] {
+ xlog("received http request from $si:$sp\r\n");
+ append_to_reply("Content-Encoding: deflate\r\n");
+ xhttp_reply("200", "OK", "text/html",
+ "<html><body>OK - [$si:$sp]</body></html>");
+}
+
+...
diff --git a/modules/gzcompress/doc/gzcompress_admin.xml b/modules/gzcompress/doc/gzcompress_admin.xml
index f7a91b0..5917e7b 100644
--- a/modules/gzcompress/doc/gzcompress_admin.xml
+++ b/modules/gzcompress/doc/gzcompress_admin.xml
@@ -18,7 +18,8 @@
<para>
This module is able to detect compressed body in received SIP message
and decompress it as well as compress the body for outgoing SIP
- message.
+ message. It works also for received HTTP request and replied HTTP
+ response (&kamailio; cannot work in HTTP proxy mode).
</para>
<para>
The decision of whether to do compression or decompression is made
@@ -161,5 +162,70 @@ modparam("gzcompress", "sanity_checks", 1)
</para>
</section>
</section>
+ <section>
+ <title>Config File</title>
+ <para>
+ Next example shows how to enable compression for forwarded requests,
+ as well as replying with compressed body for HTTP requests. For SIP,
+ the request is recevied and forwarded to itself once, just for the
+ sake of showing a simple example.
+ </para>
+ <example>
+ <title>Enable body compression</title>
+ <programlisting format="linespecific">
+...
+<![CDATA[
+#!KAMAILIO
+
+debug=3
+memdbg=5
+memlog=5
+
+children=2
+
+log_stderror=yes
+listen=udp:127.0.0.1:5060
+listen=tcp:127.0.0.1:5060
+
+tcp_accept_no_cl=yes
+http_reply_parse=yes
+
+mpath="modules/"
+
+loadmodule "sl.so"
+loadmodule "pv.so"
+loadmodule "xlog.so"
+loadmodule "corex.so"
+loadmodule "textops.so"
+loadmodule "xhttp.so"
+loadmodule "gzcompress.so"
+
+modparam("gzcompress", "header_value", "deflate")
+
+request_route {
+ xlog("received sip request from $si:$sp\r\n");
+
+ if(src_port==5060) {
+ remove_hf("Content-Encoding");
+ $du = "sip:127.0.0.1:9";
+ } else {
+ append_hf("Content-Encoding: gzip\r\n");
+ $du = "sip:127.0.0.1:5060";
+ }
+ forward();
+ exit;
+}
+
+event_route[xhttp:request] {
+ xlog("received http request from $si:$sp\r\n");
+ append_to_reply("Content-Encoding: deflate\r\n");
+ xhttp_reply("200", "OK", "text/html",
+ "<html><body>OK - [$si:$sp]</body></html>");
+}
+]]>
+...
+</programlisting>
+ </example>
+ </section>
</chapter>