Module: kamailio
Branch: master
Commit: c9f2aa71b2e0d4a4f71b3da92f97306e86f93eea
URL: https://github.com/kamailio/kamailio/commit/c9f2aa71b2e0d4a4f71b3da92f97306…
Author: Andreas Granig <agranig(a)sipwise.com>
Committer: Andreas Granig <agranig(a)sipwise.com>
Date: 2018-03-08T15:54:24+01:00
db_redis: Align schema with usrloc expires_type default
Since expires_type is DATETIME by default, use "time" type in
upstream schema for location table.
---
Modified: src/modules/db_redis/doc/db_redis_admin.xml
Modified: utils/kamctl/db_redis/kamailio/location
---
Diff: https://github.com/kamailio/kamailio/commit/c9f2aa71b2e0d4a4f71b3da92f97306…
Patch: https://github.com/kamailio/kamailio/commit/c9f2aa71b2e0d4a4f71b3da92f97306…
---
diff --git a/src/modules/db_redis/doc/db_redis_admin.xml b/src/modules/db_redis/doc/db_redis_admin.xml
index 168bd500d4..f57fa8064e 100644
--- a/src/modules/db_redis/doc/db_redis_admin.xml
+++ b/src/modules/db_redis/doc/db_redis_admin.xml
@@ -189,4 +189,17 @@ modparam("auth_db", "db_url", DBURL_AUTH)
</programlisting>
</example>
</section>
+
+ <section>
+ <title>Module specific considerations</title>
+ <section>
+ <title>usrloc</title>
+ <para>
+ If you set "expires_type" to "1" in order to use BIGINT instead of DATETIME,
+ make sure to update your location schema file and change the type of "expires"
+ and "last_modified" from "time" to "int".
+ </para>
+ </section>
+ </section>
+
</chapter>
diff --git a/utils/kamctl/db_redis/kamailio/location b/utils/kamctl/db_redis/kamailio/location
index 9ca18f2fb0..7c0ea2ab81 100644
--- a/utils/kamctl/db_redis/kamailio/location
+++ b/utils/kamctl/db_redis/kamailio/location
@@ -1,2 +1,2 @@
-id/int,ruid/string,username/string,domain/string,contact/string,received/string,path/string,expires/int,q/double,callid/string,cseq/int,last_modified/int,flags/int,cflags/int,user_agent/string,socket/string,methods/int,instance/string,reg_id/int,server_id/int,connection_id/int,keepalive/int,partition/int,
+id/int,ruid/string,username/string,domain/string,contact/string,received/string,path/string,expires/time,q/double,callid/string,cseq/int,last_modified/time,flags/int,cflags/int,user_agent/string,socket/string,methods/int,instance/string,reg_id/int,server_id/int,connection_id/int,keepalive/int,partition/int,
9
### Description
KEMI onsend_route is not called unless there is a placeholder/dummy routing block.
```
## without this block, core will never call KEMI->onsend_route
onsend_route {
## do nothing
}
```
### Troubleshooting
#### Reproduction
1. In KEMI create ksr_onsend_route(). Observe that this function is never invoked.
2. Add a route block:
```
onsend_route {
## do nothing
}
```
Now observe, that KEMI ksr_onsend_route() is called.
#### Debugging Data
#### Log Messages
#### SIP Traffic
### Possible Solutions
Not really a problem, just a surprise to the KEMI user. Possibly, document that in order for the KEMI function to be called, the configuration file needs a dummy routing block for onsend_route.
### Additional Information
The reason is the following logic:
onsend.h:
`ret=keng->froute(orig_msg, ONSEND_ROUTE, NULL, NULL);`
This line is called only if `onsend_rt.rlist[DEFAULT_RT]` is non-NULL, but this array is initialized only if the `onsend_route` block exists.
* **Kamailio Version** - 5.1, master
* **Operating System**:
Linux CentOS 7.4
--
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/1474
Module: kamailio
Branch: master
Commit: 1b831f8dab3fb9f7c0c4562fee6d192face16e56
URL: https://github.com/kamailio/kamailio/commit/1b831f8dab3fb9f7c0c4562fee6d192…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2018-03-08T13:16:28+01:00
modules: readme files regenerated - app_jsdt ... [skip ci]
---
Modified: src/modules/app_jsdt/README
---
Diff: https://github.com/kamailio/kamailio/commit/1b831f8dab3fb9f7c0c4562fee6d192…
Patch: https://github.com/kamailio/kamailio/commit/1b831f8dab3fb9f7c0c4562fee6d192…
---
diff --git a/src/modules/app_jsdt/README b/src/modules/app_jsdt/README
index 8679cb1bd6..4186cced58 100644
--- a/src/modules/app_jsdt/README
+++ b/src/modules/app_jsdt/README
@@ -79,14 +79,15 @@ Chapter 1. Admin Guide
1. Overview
- This module allows executing JavaScript scripts from config file. It
- exports all KEMI functions to JavaScript in order to access the current
- processed SIP message. These functions are within JavaScript object
- 'KSR'.
+ This module allows executing JavaScript scripts from the Kamailio
+ configuration file. It exports all KEMI functions to JavaScript in
+ order to access the currently processed SIP message. These functions
+ are named within the JavaScript object 'KSR'.
- It includes the Duktape JavaScript engine (http://www.duktape.org),
- which is a fast and easy to embed JavaScript interpreter. Exported API
- from SIP router to JavaScript is documented in the dokuwiki.
+ The module is based on the Duktape JavaScript engine
+ (http://www.duktape.org), which is a fast and easy to embed JavaScript
+ interpreter. The exported API from Kamailio to JavaScript is documented
+ in the wiki.
The module has two JavaScript contexts:
* first is used for functions jsdt_dofile() and jsdt_dostring().
@@ -94,7 +95,7 @@ Chapter 1. Admin Guide
Therefore jsdt_run() cannot execute functions from scripts loaded
via jsdt_dofile() in config. This is kind of caching mode, avoiding
reading file every time, but you must be sure you do not have
- something that is executed by default and requires access to SIP
+ someting that is executed by default and requires access to SIP
message. This environment is also used by KEMI framework for the
config SIP routing functions.
@@ -113,7 +114,7 @@ Chapter 1. Admin Guide
The following libraries or applications must be installed before
running Kamailio with this module loaded:
* libm - the math library (part of standard system libraries - it is
- needed to compile embedded Duktape JS interpreter).
+ needed to complile embedded Duktape JS interpreter).
3. Parameters
@@ -142,8 +143,8 @@ modparam("app_jsdt", "load", "/usr/local/etc/kamailio/js/myscript.js")
4.1. jsdt_dofile(path)
- Execute the JS script stored in 'path'. The parameter can be a string
- with pseudo-variables evaluated at runtime.
+ Execute the JavaScript script stored in 'path'. The parameter can be a
+ string with pseudo-variables evaluated at runtime.
Example 1.2. jsdt_dofile usage
...
@@ -152,8 +153,8 @@ jsdt_dofile("/usr/local/etc/kamailio/js/myscript.js");
4.2. jsdt_dostring(script)
- Execute the Lua script stored in parameter. The parameter can be a
- string with pseudo-variables.
+ Execute the JavaScript script stored in parameter. The parameter can be
+ a string with pseudo-variables.
Example 1.3. jsdt_dostring usage
...
@@ -229,7 +230,7 @@ kamcmd app_jsdt.api_list
6. Example of usage
- Create your JS script and stored on file system, say:
+ Create your JS script and store it on the file system, say:
'/usr/local/etc/kamailio/js/myscript.js'.
...
function sr_append_fu_to_reply()
Module: kamailio
Branch: master
Commit: 7b0ad6b1a11687d035d4be92202ae1379f07fb20
URL: https://github.com/kamailio/kamailio/commit/7b0ad6b1a11687d035d4be92202ae13…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)edvina.net>
Date: 2018-03-08T13:08:08+01:00
app_jsdt Minor update to documentation
---
Modified: src/modules/app_jsdt/doc/app_jsdt_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/7b0ad6b1a11687d035d4be92202ae13…
Patch: https://github.com/kamailio/kamailio/commit/7b0ad6b1a11687d035d4be92202ae13…
---
diff --git a/src/modules/app_jsdt/doc/app_jsdt_admin.xml b/src/modules/app_jsdt/doc/app_jsdt_admin.xml
index b0926256d4..d4fd89d377 100644
--- a/src/modules/app_jsdt/doc/app_jsdt_admin.xml
+++ b/src/modules/app_jsdt/doc/app_jsdt_admin.xml
@@ -17,15 +17,16 @@
<section>
<title>Overview</title>
<para>
- This module allows executing JavaScript scripts from config file.
+ This module allows executing JavaScript scripts from the Kamailio
+ configuration file.
It exports all KEMI functions to JavaScript in order to access the
- current processed SIP message. These functions are within JavaScript
- object 'KSR'.
+ currently processed SIP message. These functions are named within
+ the JavaScript object 'KSR'.
</para>
<para>
- It includes the Duktape JavaScript engine (http://www.duktape.org),
- which is a fast and easy to embed JavaScript interpreter. Exported API
- from SIP router to JavaScript is documented in the dokuwiki.
+ The module is based on the Duktape JavaScript engine (http://www.duktape.org),
+ which is a fast and easy to embed JavaScript interpreter. The exported API
+ from Kamailio to JavaScript is documented in the wiki.
</para>
<para>
The module has two JavaScript contexts:
@@ -42,7 +43,7 @@
and parameter 'load'. Therefore jsdt_run() cannot execute functions
from scripts loaded via jsdt_dofile() in config. This is kind of
caching mode, avoiding reading file every time, but you must be sure
- you do not have something that is executed by default and requires
+ you do not have someting that is executed by default and requires
access to SIP message. This environment is also used by KEMI
framework for the config SIP routing functions.
</para>
@@ -74,7 +75,7 @@
<listitem>
<para>
<emphasis>libm</emphasis> - the math library (part of standard
- system libraries - it is needed to compile embedded Duktape JS
+ system libraries - it is needed to complile embedded Duktape JS
interpreter).
</para>
</listitem>
@@ -116,7 +117,7 @@ modparam("app_jsdt", "load", "/usr/local/etc/kamailio/js/myscript.js")
<function moreinfo="none">jsdt_dofile(path)</function>
</title>
<para>
- Execute the JS script stored in 'path'. The parameter can be
+ Execute the JavaScript script stored in 'path'. The parameter can be
a string with pseudo-variables evaluated at runtime.
</para>
<example>
@@ -134,7 +135,7 @@ jsdt_dofile("/usr/local/etc/kamailio/js/myscript.js");
<function moreinfo="none">jsdt_dostring(script)</function>
</title>
<para>
- Execute the Lua script stored in parameter. The parameter can be
+ Execute the JavaScript script stored in parameter. The parameter can be
a string with pseudo-variables.
</para>
<example>
@@ -248,7 +249,7 @@ if(!jsdt_runstring('KSR.dbg("Hello World from $fU\n")'))
<section>
<title>Example of usage</title>
<para>
- Create your JS script and stored on file system,
+ Create your JS script and store it on the file system,
say: '/usr/local/etc/kamailio/js/myscript.js'.
</para>
<programlisting format="linespecific">
<!-- 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 -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] 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
- [ ] 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 -->
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Currently we need a onsend_route{} (empty is ok) block in config before KEMI ksr_onsend_route() is invoked. The latter will override the route block.
This PR will unconditonally invoke KEMI ksr_onsend_route() so we do not need a placeholder in config.
For discussion: this will unconditionally invoke ksr_onsend_route() so it might break scripts that don't have an implementation. Should be document that ksr_onsend_route should be implemented (just return 1 is ok).
I'm not too clear about the error handling in run_onsend(): it's possible that if KEMI ksr_onsend_route throws error (not implemented rather than real error) then the message might be dropped.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1475
-- Commit Summary --
* core: invoke KEMI ksr_onsend_route()
-- File Changes --
M src/core/onsend.h (7)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1475.patchhttps://github.com/kamailio/kamailio/pull/1475.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/1475