Module: kamailio
Branch: master
Commit: afc678e9db29f3cf83aff0f24d7affdae5be6cba
URL: https://github.com/kamailio/kamailio/commit/afc678e9db29f3cf83aff0f24d7affd…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-08-17T07:28:07+02:00
dialog: documentation for dlg_set_ruri()
---
Modified: src/modules/dialog/doc/dialog_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/afc678e9db29f3cf83aff0f24d7affd…
Patch: https://github.com/kamailio/kamailio/commit/afc678e9db29f3cf83aff0f24d7affd…
---
diff --git a/src/modules/dialog/doc/dialog_admin.xml b/src/modules/dialog/doc/dialog_admin.xml
index 45ce5cc690..e451ce4b9d 100644
--- a/src/modules/dialog/doc/dialog_admin.xml
+++ b/src/modules/dialog/doc/dialog_admin.xml
@@ -32,7 +32,7 @@
The dialog module provides dialog awareness for the &kamailio; proxy. It's
functionality is to keep track of the current dialogs, to offer information
about them (e.g. how many dialogs are active), and to manage various
- characteristics of dialogs. The module exports several functions that can be
+ characteristics of dialogs. The module exports several functions that can be
used directly from the configuration route script as well as functions for
the RPC interface.
</para>
@@ -1955,24 +1955,24 @@ if(dlg_get("abcdef", "123", "456"))
</programlisting>
</example>
</section>
-
+
<section id="dialog.f.is_known_dlg">
<title>
<function moreinfo="none">is_known_dlg()</function>
</title>
<para>
This function checks if the current SIP message being processed
- belongs to any transaction within an active dialog that the
- dialog module is currently tracking. This is a check for
+ belongs to any transaction within an active dialog that the
+ dialog module is currently tracking. This is a check for
tracking of any kind, without regard to profiles.
</para>
<para>
This function has numerous potential applications, among which
- is that it can be used to strengthen security for
+ is that it can be used to strengthen security for
loose-routing sequential (in-dialog) requests or responses
to them, as by providing a preventative check against
spoofing on the proxy level instead of leaving the issue
- purely to the receiving UA.
+ purely to the receiving UA.
</para>
<para>
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
@@ -2041,7 +2041,7 @@ if(dlg_set_timeout("180", "123", "456"))
<function moreinfo="none">dlg_set_timeout_by_profile(profile, [value], timeout)</function>
</title>
<para>
- Like <emphasis>dlg_set_timeout()</emphasis>, but
+ Like <emphasis>dlg_set_timeout()</emphasis>, but
simultaneously sets the timeout of all dialogs in
a given profile. Can be constrained by profile value.
</para>
@@ -2064,7 +2064,7 @@ if(dlg_set_timeout("180", "123", "456"))
<title><function>dlg_set_timeout_by_profile</function> usage</title>
<programlisting format="linespecific">
...
-# All dialogs belonging to user abc123 (tracked via set_dlg_profile())
+# All dialogs belonging to user abc123 (tracked via set_dlg_profile())
# will be timed out in 3 seconds.
dlg_set_timeout_by_profile("users", "abc123", "3");
@@ -2178,6 +2178,30 @@ dlg_remote_profile("add", "caller", "test", "$sruid", "$var(exp)");
</programlisting>
</example>
</section>
+ <section id="dialog.f.dlg_set_ruri">
+ <title>
+ <function moreinfo="none">dlg_set_ruri()</function>
+ </title>
+ <para>
+ This function sets the R-URI with the corresponding endpoint address
+ stored in dialog structure (i.e., its Contact field).
+ </para>
+ <para>
+ This function can be used from ANY_ROUTE.
+ </para>
+ <example>
+ <title><function>dlg_set_ruri()</function> usage</title>
+ <programlisting format="linespecific">
+...
+if(has_totag() and is_present_hf("Route") and uri==myself ) {
+ if(dlg_set_ruri()) {
+ xlog("Request URI changed from [$ou] to dlg value: [$ru]\n");
+ }
+}
+...
+</programlisting>
+ </example>
+ </section>
</section>
The ims_auth module reads the value from the Content-Length header
of a REGISTER request, before decoding the message body.
Due to a missing null pointer check, reading this value leads
to core dump in case the Content-Length header is missing.
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [ x] Commit message has the format required by CONTRIBUTING guide
- [ x] Commits are split per component (core, individual modules, libs, utils, ...)
- [ x] Each component has a single commit (if not, squash them into one commit)
- [ x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ x] PR should be backported to stable branches
- [ x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Added a null pointer check in function ims_get_body() - file utils.c of
module ims_auth - to check whether Content-Length Header was present
in REGISTER message.
If Content-Length Header is not present, a Default value of 0 will be assumed.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1213
-- Commit Summary --
* ims_auth: fixed rare core dump, due to null ptr check
-- File Changes --
M src/modules/ims_auth/utils.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1213.patchhttps://github.com/kamailio/kamailio/pull/1213.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1213
I would like the URI transformations to be more generic so one can pick up the URI scheme, like HTTP: or TEL:
Just an idea
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/592
Module: kamailio
Branch: master
Commit: f3f3ed2b343fc2f33f14e903f927a138e3c3adb4
URL: https://github.com/kamailio/kamailio/commit/f3f3ed2b343fc2f33f14e903f927a13…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2017-08-15T15:16:24+02:00
modules: readme files regenerated - tls ... [skip ci]
---
Modified: src/modules/tls/README
---
Diff: https://github.com/kamailio/kamailio/commit/f3f3ed2b343fc2f33f14e903f927a13…
Patch: https://github.com/kamailio/kamailio/commit/f3f3ed2b343fc2f33f14e903f927a13…
---
diff --git a/src/modules/tls/README b/src/modules/tls/README
index f0d36b2758..dcdbfed6de 100644
--- a/src/modules/tls/README
+++ b/src/modules/tls/README
@@ -63,6 +63,7 @@ Olle E. Johansson
9.30. renegotiation (boolean)
9.31. config (string)
9.32. xavp_cfg (string)
+ 9.33. event_callback (str)
10. Functions
@@ -80,6 +81,10 @@ Olle E. Johansson
12.1. License
12.2. History
+ 13. Event Routes
+
+ 13.1. event_route[tls:connection-out]
+
List of Examples
1.1. Quick start config
@@ -125,7 +130,9 @@ Olle E. Johansson
1.41. Set config parameter
1.42. Change and reload the TLS configuration at runtime
1.43. Set xavp_cfg parameter
- 1.44. is_peer_verified usage
+ 1.44. Set event_callback parameter
+ 1.45. is_peer_verified usage
+ 1.46. Use of event_route[tls:connection-out]
Chapter 1. Admin Guide
@@ -173,6 +180,7 @@ Chapter 1. Admin Guide
9.30. renegotiation (boolean)
9.31. config (string)
9.32. xavp_cfg (string)
+ 9.33. event_callback (str)
10. Functions
@@ -190,6 +198,10 @@ Chapter 1. Admin Guide
12.1. License
12.2. History
+ 13. Event Routes
+
+ 13.1. event_route[tls:connection-out]
+
1. Overview
This module implements the TLS transport for Kamailio using the OpenSSL
@@ -520,6 +532,7 @@ Revoking a certificate and using a CRL
9.30. renegotiation (boolean)
9.31. config (string)
9.32. xavp_cfg (string)
+ 9.33. event_callback (str)
9.1. tls_method (string)
@@ -1267,6 +1280,28 @@ modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")
route(RELAY);
...
+9.33. event_callback (str)
+
+ The name of the function in the kemi configuration file (embedded
+ scripting language such as Lua, Python, ...) to be executed instead of
+ event_route[...] blocks specific for tls module.
+
+ The function has one string parameter, the value is the name of the
+ event_route block, respectively "tls:connection-out".
+
+ Default value is 'empty' (no function is executed for events).
+
+ Example 1.44. Set event_callback parameter
+...
+modparam("tls", "event_callback", "ksr_tls_event")
+...
+-- event callback function implemented in Lua
+function ksr_tls_event(evname)
+ KSR.info("===== tls module triggered event: " .. evname .. "\n");
+ return 1;
+end
+...
+
10. Functions
10.1. is_peer_verified()
@@ -1277,7 +1312,7 @@ modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")
, the peer presented an X509 certificate and the certificate chain
verified ok. It can be used only in a request route.
- Example 1.44. is_peer_verified usage
+ Example 1.45. is_peer_verified usage
if (proto==TLS && !is_peer_verified()){
sl_send_reply("400", "No certificate or verification failed");
drop;
@@ -1343,3 +1378,22 @@ modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")
Install does not generate self-signed certificates by default anymore.
In order to generate them now you should do "make install-tls-cert"
+
+13. Event Routes
+
+ 13.1. event_route[tls:connection-out]
+
+13.1. event_route[tls:connection-out]
+
+ Event route to be executed when a TLS connection is opened by Kamailio.
+ If drop() is executed in the event route, then the data is no longer
+ sent over the connection.
+
+ Example 1.46. Use of event_route[tls:connection-out]
+...
+event_route[tls:connection-out] {
+ if($sndto(ip)=="1.2.3.4") {
+ drop;
+ }
+}
+...
Module: kamailio
Branch: master
Commit: cb7810c939da9c8f4385b530539487528ac8705d
URL: https://github.com/kamailio/kamailio/commit/cb7810c939da9c8f4385b5305394875…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-08-15T15:09:37+02:00
tls: docs for event_route[tls:connection-out] and event_callback param
---
Modified: src/modules/tls/doc/params.xml
Modified: src/modules/tls/doc/rpc.xml
Modified: src/modules/tls/doc/tls.xml
---
Diff: https://github.com/kamailio/kamailio/commit/cb7810c939da9c8f4385b5305394875…
Patch: https://github.com/kamailio/kamailio/commit/cb7810c939da9c8f4385b5305394875…
---
diff --git a/src/modules/tls/doc/params.xml b/src/modules/tls/doc/params.xml
index 5ab2426e7b..e3d236dea4 100644
--- a/src/modules/tls/doc/params.xml
+++ b/src/modules/tls/doc/params.xml
@@ -1164,5 +1164,36 @@ modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")
</programlisting>
</example>
</section>
+ <section id="tls.p.event_callback">
+ <title><varname>event_callback</varname> (str)</title>
+ <para>
+ The name of the function in the kemi configuration file (embedded
+ scripting language such as Lua, Python, ...) to be executed instead
+ of event_route[...] blocks specific for tls module.
+ </para>
+ <para>
+ The function has one string parameter, the value is the name of
+ the event_route block, respectively "tls:connection-out".
+ </para>
+ <para>
+ <emphasis>
+ Default value is 'empty' (no function is executed for events).
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>event_callback</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("tls", "event_callback", "ksr_tls_event")
+...
+-- event callback function implemented in Lua
+function ksr_tls_event(evname)
+ KSR.info("===== tls module triggered event: " .. evname .. "\n");
+ return 1;
+end
+...
+</programlisting>
+ </example>
+ </section>
</section>
diff --git a/src/modules/tls/doc/rpc.xml b/src/modules/tls/doc/rpc.xml
index cd432d85d9..8f3070648b 100644
--- a/src/modules/tls/doc/rpc.xml
+++ b/src/modules/tls/doc/rpc.xml
@@ -15,8 +15,8 @@
<section id="tls.r.tls.info">
<title><function>tls.info</function></title>
<para>
- List internal information related to the TLS module in
- a short list - max connections, open connections and the
+ List internal information related to the TLS module in
+ a short list - max connections, open connections and the
write queue size.
</para>
<para>Parameters: </para>
@@ -53,7 +53,7 @@
<section id="tls.r.tls.reload">
<title><function>tls.reload</function></title>
<para>
- Reload the external TLS configuration file (aka tls.cfg). It does not reload
+ Reload the external TLS configuration file (aka tls.cfg). It does not reload
modparam() parameters. Note that existing active TLS connections are not
terminated and they continue to use the old certificates. The new configuration
will be used for new connections.
diff --git a/src/modules/tls/doc/tls.xml b/src/modules/tls/doc/tls.xml
index 11c4aa7318..0c8fce400f 100644
--- a/src/modules/tls/doc/tls.xml
+++ b/src/modules/tls/doc/tls.xml
@@ -275,6 +275,31 @@ make -C modules/tls extra_defs="-DTLS_WR_DEBUG -DTLS_RD_DEBUG"
<xi:include href="functions.xml"/>
<xi:include href="rpc.xml"/>
<xi:include href="history.xml"/>
+
+ <section id="tls.event_routes">
+ <title>Event Routes</title>
+ <section id="tls.evrt.connection_out">
+ <title>event_route[tls:connection-out]</title>
+ <para>
+ Event route to be executed when a TLS connection is opened by
+ &kamailio;. If drop() is executed in the event route, then the
+ data is no longer sent over the connection.
+ </para>
+ <example>
+ <title>Use of <varname>event_route[tls:connection-out]</varname></title>
+ <programlisting>
+...
+event_route[tls:connection-out] {
+ if($sndto(ip)=="1.2.3.4") {
+ drop;
+ }
+}
+...
+ </programlisting>
+ </example>
+
+ </section>
+ </section>
</chapter>
</book>