Module: kamailio
Branch: 5.8
Commit: c3f424bd6c0f8b9a2557cd58a3e3f5ac586d8c99
URL: https://github.com/kamailio/kamailio/commit/c3f424bd6c0f8b9a2557cd58a3e3f5a…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2024-05-07T19:46:19+02:00
modules: readme files regenerated - modules ... [skip ci]
---
Modified: src/modules/tcpops/README
---
Diff: https://github.com/kamailio/kamailio/commit/c3f424bd6c0f8b9a2557cd58a3e3f5a…
Patch: https://github.com/kamailio/kamailio/commit/c3f424bd6c0f8b9a2557cd58a3e3f5a…
---
diff --git a/src/modules/tcpops/README b/src/modules/tcpops/README
index bbebe20ffb3..1897be96e1b 100644
--- a/src/modules/tcpops/README
+++ b/src/modules/tcpops/README
@@ -437,6 +437,14 @@ event_route[tcp:closed] {
Whether these routes are always called, never, or on a per socket basis
is controlled by the closed_event parameter.
+ Note that the event routes can be executed by TCP main process, which
+ manages the TCP connections but does not hande the SIP traffic over
+ them. It is very important not do do any time consuming operations
+ inside the event routes. Also, many resources might not be available in
+ the TCP main process (e.g., database connections), consider using async
+ module with async_task_data(...) or async_task_group_data() functions
+ for delegating task execution to async workers.
+
4.1. tcp:closed
Called for each "normal" TCP socket closure by the other side
Module: kamailio
Branch: master
Commit: 29910ecc8f27cf70aa4490f8ed5188199ad8e612
URL: https://github.com/kamailio/kamailio/commit/29910ecc8f27cf70aa4490f8ed51881…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2024-05-07T19:46:10+02:00
modules: readme files regenerated - tcpops ... [skip ci]
---
Modified: src/modules/tcpops/README
---
Diff: https://github.com/kamailio/kamailio/commit/29910ecc8f27cf70aa4490f8ed51881…
Patch: https://github.com/kamailio/kamailio/commit/29910ecc8f27cf70aa4490f8ed51881…
---
diff --git a/src/modules/tcpops/README b/src/modules/tcpops/README
index bbebe20ffb3..1897be96e1b 100644
--- a/src/modules/tcpops/README
+++ b/src/modules/tcpops/README
@@ -437,6 +437,14 @@ event_route[tcp:closed] {
Whether these routes are always called, never, or on a per socket basis
is controlled by the closed_event parameter.
+ Note that the event routes can be executed by TCP main process, which
+ manages the TCP connections but does not hande the SIP traffic over
+ them. It is very important not do do any time consuming operations
+ inside the event routes. Also, many resources might not be available in
+ the TCP main process (e.g., database connections), consider using async
+ module with async_task_data(...) or async_task_group_data() functions
+ for delegating task execution to async workers.
+
4.1. tcp:closed
Called for each "normal" TCP socket closure by the other side
Module: kamailio
Branch: 5.8
Commit: 383a81bb9d81e06ab9da99cdaa3def3b63028040
URL: https://github.com/kamailio/kamailio/commit/383a81bb9d81e06ab9da99cdaa3def3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T19:34:35+02:00
tcpops: note about execution of event routes by TCP main process
(cherry picked from commit be9af338e3afdab1045cdd7c30a72a9ecddcb680)
---
Modified: src/modules/tcpops/doc/eventroutes.xml
---
Diff: https://github.com/kamailio/kamailio/commit/383a81bb9d81e06ab9da99cdaa3def3…
Patch: https://github.com/kamailio/kamailio/commit/383a81bb9d81e06ab9da99cdaa3def3…
---
diff --git a/src/modules/tcpops/doc/eventroutes.xml b/src/modules/tcpops/doc/eventroutes.xml
index ff05df24cdc..1166d366f0c 100644
--- a/src/modules/tcpops/doc/eventroutes.xml
+++ b/src/modules/tcpops/doc/eventroutes.xml
@@ -31,6 +31,16 @@
<emphasis>closed_event</emphasis>
parameter.
</para>
+ <para>
+ Note that the event routes can be executed by TCP main process,
+ which manages the TCP connections but does not hande the SIP traffic
+ over them. It is very important not do do any time consuming
+ operations inside the event routes. Also, many resources might not
+ be available in the TCP main process (e.g., database connections),
+ consider using async module with async_task_data(...) or
+ async_task_group_data() functions for delegating task execution
+ to async workers.
+ </para>
<section>
<title>
<function moreinfo="none">tcp:closed</function>
@@ -77,4 +87,4 @@ event_route[tcp:reset] {
</programlisting>
</para>
</section>
-</section>
\ No newline at end of file
+</section>
Module: kamailio
Branch: master
Commit: be9af338e3afdab1045cdd7c30a72a9ecddcb680
URL: https://github.com/kamailio/kamailio/commit/be9af338e3afdab1045cdd7c30a72a9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T19:32:39+02:00
tcpops: note about execution of event routes by TCP main process
---
Modified: src/modules/tcpops/doc/eventroutes.xml
---
Diff: https://github.com/kamailio/kamailio/commit/be9af338e3afdab1045cdd7c30a72a9…
Patch: https://github.com/kamailio/kamailio/commit/be9af338e3afdab1045cdd7c30a72a9…
---
diff --git a/src/modules/tcpops/doc/eventroutes.xml b/src/modules/tcpops/doc/eventroutes.xml
index ff05df24cdc..1166d366f0c 100644
--- a/src/modules/tcpops/doc/eventroutes.xml
+++ b/src/modules/tcpops/doc/eventroutes.xml
@@ -31,6 +31,16 @@
<emphasis>closed_event</emphasis>
parameter.
</para>
+ <para>
+ Note that the event routes can be executed by TCP main process,
+ which manages the TCP connections but does not hande the SIP traffic
+ over them. It is very important not do do any time consuming
+ operations inside the event routes. Also, many resources might not
+ be available in the TCP main process (e.g., database connections),
+ consider using async module with async_task_data(...) or
+ async_task_group_data() functions for delegating task execution
+ to async workers.
+ </para>
<section>
<title>
<function moreinfo="none">tcp:closed</function>
@@ -77,4 +87,4 @@ event_route[tcp:reset] {
</programlisting>
</para>
</section>
-</section>
\ No newline at end of file
+</section>
### Description
I noticed that sql_query does not work (using latest 5.8 on Debian 12) when called from `tcp:closed` event_route:
```
event_route [tcp:closed] { # Handle TCP connection close
# Delete possible leftover registration
if ($conid)
sql_query("sip_proxy_cache", "DELETE FROM location WHERE server_id=0 AND connection_id=$conid", "result");
}
```
The query produces errors:
```
2024-05-07T11:30:14.785915+03:00 siika /usr/bin/sip-proxy[2848078]: CRITICAL: sqlops
[sqlops.c:213]: sql_check_connection(): no database handle with reconnect disabled
2024-05-07T11:30:14.785978+03:00 siika /usr/bin/sip-proxy[2848078]: ERROR: sqlops
[sqlops.c:232]: sql_query(): invalid connection to database
2024-05-07T11:30:14.786013+03:00 siika /usr/bin/sip-proxy[2848078]: ERROR: sqlops
[sqlops.c:237]: sql_query(): with query [DELETE FROM location WHERE server_id=0 AND
connection_id=7]
```
I added the last debug message in order to find out where the error comes from.
The same query works fine when executed from regular route and earlier (but don't remember when), the same query worked fine also from `tcp:closed` event_route.
This may be related to https://github.com/kamailio/kamailio/issues/3768.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3843
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3843(a)github.com>
Module: kamailio
Branch: 5.7
Commit: ac56db7fab9d1157e89a6daf81915e3058f7178c
URL: https://github.com/kamailio/kamailio/commit/ac56db7fab9d1157e89a6daf81915e3…
Author: Henning Westerholt <hw(a)gilawa.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:30:16+02:00
uid_auth_db: spelling fix in documentation
(cherry picked from commit 9f28450312749dfbc021a8cbc23472c8a39d3fef)
(cherry picked from commit b2352bc1c6f3eff3aba85a087107f4ca29cedc22)
---
Modified: src/modules/uid_auth_db/auth_db.xml
---
Diff: https://github.com/kamailio/kamailio/commit/ac56db7fab9d1157e89a6daf81915e3…
Patch: https://github.com/kamailio/kamailio/commit/ac56db7fab9d1157e89a6daf81915e3…
---
diff --git a/src/modules/uid_auth_db/auth_db.xml b/src/modules/uid_auth_db/auth_db.xml
index 25849663c54..99e5eb7c594 100644
--- a/src/modules/uid_auth_db/auth_db.xml
+++ b/src/modules/uid_auth_db/auth_db.xml
@@ -66,7 +66,7 @@
the <serdoc:module>textops</serdoc:module> module.
</para>
<para>
- The reason for the failure can be determined from the interger
+ The reason for the failure can be determined from the integer
return value stored in the <varname>$?</varname> attribute.
A value of <literal>-3</literal> indicates that it was impossible
to retrieve credentials from the request. A 400 (Bad Request)
- URL: https://github.com/kamailio/kamailio/commit/0bf03aa1987b9cff2fc0d776605620e…
Author: Henning Westerholt <hw(a)gilawa.com>
Date: 2024-05-07T17:05:58+02:00
core: spelling fix in comment and log message
(cherry picked from commit db176a4918c0b500f5f051cad16fd8d442450ab7)
- URL: https://github.com/kamailio/kamailio/commit/b2352bc1c6f3eff3aba85a087107f4c…
Author: Henning Westerholt <hw(a)gilawa.com>
Date: 2024-05-07T17:06:04+02:00
uid_auth_db: spelling fix in documentation
(cherry picked from commit 9f28450312749dfbc021a8cbc23472c8a39d3fef)
- URL: https://github.com/kamailio/kamailio/commit/1dd7c4038eb9a0c7eec506994a58a56…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:06:14+02:00
ims_usrloc_scscf: reformat exported structures
(cherry picked from commit 15d859e1e96552fca2708cf56047021beae29711)
- URL: https://github.com/kamailio/kamailio/commit/620aa3f2a0faf3a4d54908bac0aa3ff…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:06:20+02:00
ims_usrloc_scscf: enclose examples in dotted lines for better visibility
(cherry picked from commit 8506a6fe781e6e0b0b1418f4087db50480db6b57)
- URL: https://github.com/kamailio/kamailio/commit/89343b6031f186c59ecd6707109bd02…
Author: Ostap <ostap_mal(a)hotmail.com>
Date: 2024-05-07T17:06:39+02:00
modules/statsd: ensure statsd failures do not stop execution (#3819)
* modules/statsd: avoid stopping flow when sending statsd metric fails
Currently statsd functions return bool: `true` or `false` depending when
the function succeeds or fails respectively.
This value gets implicitly converted to `int`: `true` -> `1`, `false` ->
`0`.
For Kamailio `1` means succesfull execution, but `0` means to stop
processing messages, which is not what we want as statsd should not impact
flow execution. Instead we want to return `-1` which signifies error,
but the flow continues.
* modules/statsd: do not fail module initilization when statsd init fails
statsd_init executes `statsd_connect` which tries to connect to statd
server.
If connection fails then kamailio fails to start.
This is not the desired behaviour as:
1. Kamailio should continue working even if statsd server is down,
metrics should not impact runtime.
2. `statsd_connect` is also re-executed each time we try to send the metric https://github.com/salemove/kamailio/blame/master/src/modules/statsd/lib_st…,
so it's initial result is not essential.
Note, that before 5.8 the result of init was already ignored due to
implicit conversion of `false` to `0`
until after
https://github.com/kamailio/kamailio/commit/0186246fce8f0e4bb46b30c05174983…
was introduced (which could be considered a breaking change even if it
seemingly fixes a bug in conversion).
(cherry picked from commit 5e66ba23851f115bcb88d7e3f71f78ab33fc1e30)
- URL: https://github.com/kamailio/kamailio/commit/8af0605ade36566597ff691a2adc1e5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:06:49+02:00
ims_registrar_scscf: init variable to fix analyzer warning
(cherry picked from commit 8558947034f16b162c15eda39d18f5f5df4ef562)
- URL: https://github.com/kamailio/kamailio/commit/1387c32dfa601496c38f9c10d554c49…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:07:01+02:00
ims_ipsec_pcscf: decouple IPSEC_FORWARD_USEVIA and IPSEC_TCPPORT_UEC for requests
- both flags should be avaible for use at the same time in
ipsec_forward()
- for request IPSEC_FORWARD_USEVIA gets the protocol from the next hop
address
(cherry picked from commit ab261540d656ed456bac8876f77f940457a9baf6)
- URL: https://github.com/kamailio/kamailio/commit/7e202ec38593462559e81db7b0f97e4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:07:11+02:00
ims_ipsec_pcscf: docs updated for ipsec_forward() flags
(cherry picked from commit 575b17d23cd5fa060f775bc56b42c735048bc849)
- URL: https://github.com/kamailio/kamailio/commit/9493dc0c895d1dde50239c903fd976c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:07:18+02:00
ims_ipsec_pcscf: updated comments for ipsec_forward() flags
(cherry picked from commit f7f93828993b5975dfe5f26ad63ba6c489aa69f7)
- URL: https://github.com/kamailio/kamailio/commit/00f51e28875c209cbf25a47c96e60c9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:07:24+02:00
ims_ipsec_pcscf: handle tls for replies
(cherry picked from commit 48dab490965fa7f2f7200d95edd7dbb1407b2536)
- URL: https://github.com/kamailio/kamailio/commit/4aa0920b2e573661959d5c9149ee041…
Author: Alexander Couzens <lynxis(a)fe80.eu>
Date: 2024-05-07T17:07:38+02:00
ims_registrar_scscf: fix uninitialized arguments in save()
The script "save" command can be used with different arguments:
2, 3 and 4.
But internally for all save() calls the exact same function is use, w_save().
When calling save("PRE_REG_SAR_REPLY","location"); as given by the examples,
kamailio will call w_save().
Because the command code will cast the function pointer, the w_save() function
is called with 2 uninitialized arguments *mode, *c_flags.
mode is unused, seems a legacy argument. c_flags is referenced resulting in a crash
if not null.
Use separate wrapper functions to handle different argument number.
Fixes: a627c9a04a74 ("ims_registrar_scscf: Extend save() with optional flag")
(cherry picked from commit 20a75004d53a06da0f22b11804a4d83496ad8919)
- URL: https://github.com/kamailio/kamailio/commit/8bb9f0601eb94597f3bfab4ede97971…
Author: Alexander Couzens <lynxis(a)fe80.eu>
Date: 2024-05-07T17:08:03+02:00
ims_registrar_scscf: refactor save_fixup4
Rename function to match argument number.
Use assign_save_fixup3_async instead of the code copy
(cherry picked from commit 82a6d7ea6edbaca60879a38c5e74e40920e89342)
- URL: https://github.com/kamailio/kamailio/commit/569662043b656063be97d0ea0e22dd8…
Author: Alexander Couzens <lynxis(a)fe80.eu>
Date: 2024-05-07T17:08:11+02:00
ims_registrar_scscf: fix typo in function name uint_fixup
(cherry picked from commit 6f908f05d4691abcb1b3a745048d3cc2a9996676)
- URL: https://github.com/kamailio/kamailio/commit/4b3620d0f0d7d636bf1d9e4c2b19bf5…
Author: Alexander Couzens <lynxis(a)fe80.eu>
Date: 2024-05-07T17:08:22+02:00
ims_registrar_scscf: free_uint_fixup: fix memleak/freeing the wrong parameter
The free_uint_fixup() freed the wrong parameter in the past.
(cherry picked from commit c3e6c1edc7531406208efe2965243e6e81506127)
- URL: https://github.com/kamailio/kamailio/commit/4e98a4ae06ec0bbff408af211680c97…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:08:32+02:00
ims_ipsec_pcscf: cascade on options to get the uri for fill_contact()
(cherry picked from commit 60d2ab6464657abf38136a771c297c6f5536e27a)
- URL: https://github.com/kamailio/kamailio/commit/3aac0c7379577480fb09902bfb31b9a…
Author: Jannik <40364587+volkland(a)users.noreply.github.com>
Date: 2024-05-07T17:08:41+02:00
sipcapture: docs - fix default value for parameter
(cherry picked from commit 265c948286f2df5136179c95fbb1d7f1255e4c71)
- URL: https://github.com/kamailio/kamailio/commit/fc54fdcd67e244ad075c54b5f24bb64…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:08:52+02:00
tm: free new buffer on drop for local requests
- GH #3403
(cherry picked from commit ee06666c43d96029315dae7618e10d381265a85a)
- URL: https://github.com/kamailio/kamailio/commit/f9ca6854d88e4fcc161e1083a953f47…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:08:58+02:00
tm: cb flag to mark local uac on request drop
(cherry picked from commit f5da773c5fa29edbf9d0e65a83a62f495928ddec)
- URL: https://github.com/kamailio/kamailio/commit/a86d7d2bad119fc4cccf5c19719b445…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:09:06+02:00
tm: cb_flags made unsigned for uac_req
(cherry picked from commit ebd1c6c75a1b832ce85d576aad134b99d47b5738)
- URL: https://github.com/kamailio/kamailio/commit/e54b03fc41bc55486430b09d9a4839b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:09:15+02:00
pv_headers: print also the new TMCB_LOCAL_REQUEST_DROP in debug function
(cherry picked from commit 68624c2da093ab789d4e8d35df65ef1bce024bca)
- URL: https://github.com/kamailio/kamailio/commit/965a02ba4aca9283e4f43f8153ebeb8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:09:25+02:00
presence: check if the local notify was dropped in event route
- free tm cb parameter on drop
- related to GH #3403
(cherry picked from commit d12fc31056cb37aac347ec05f9ada7bafa5f52de)
- URL: https://github.com/kamailio/kamailio/commit/46c8e1a5b0e11162eee2c0b201bb535…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:09:39+02:00
uac: check if local requests are dropped and free the param
(cherry picked from commit 00aac8d48370fac356eecff535835d918c631cc5)
- URL: https://github.com/kamailio/kamailio/commit/244319c67a191cf1f093b2220fa1a85…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:09:49+02:00
pua: check if local requests are dropped and free the param
(cherry picked from commit 53e1a29c265df1489c9bd91deddc0719f8ca2092)
- URL: https://github.com/kamailio/kamailio/commit/5b97d29f1bbac2656eba506c7fd94b4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:10:17+02:00
core: parser/contact - add limit for max number of contacts
- defined to 256
(cherry picked from commit d6b0beb5a219ae57a62e9e7201a6ec1fe66e5a96)
- URL: https://github.com/kamailio/kamailio/commit/d75dba611808322356fc8d1ebc9f8c3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:10:25+02:00
core: parser/contact - basic validation tests for contact uri
(cherry picked from commit fc52a54370c085d6fa951da876eee99580677922)
- URL: https://github.com/kamailio/kamailio/commit/11f0cfec4d2fc6043d282cdb2258520…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:11:19+02:00
core: parse/contact: jump to error on too many contacts
(cherry picked from commit f69b22d44cb5abc803c2b58790dd33f2310c1c59)
- URL: https://github.com/kamailio/kamailio/commit/24e43d27544bdfa1acfce7ebb8b6e3b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:11:35+02:00
ctl: removed level and function names from log messages
(cherry picked from commit 65bafaffd6bcfebc508b774cfbb78120e68bb3f0)
- URL: https://github.com/kamailio/kamailio/commit/b5eb4f5ca037239f2ec1d99a16a71af…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-05-07T17:11:46+02:00
ctl: info log on ECONNRESET (connection reset by peer)
- not a type of error that can be controlled by kamailio
(cherry picked from commit 446c75e0e2194b6e42d768d2e3c79b5f0222905f)