[sr-dev] Re: [kamailio/kamailio] Crash in dns_cache.c with dns_cache_init=off (Issue #3350)

2024-04-23 Thread github-actions[bot] via sr-dev
This issue is stale because it has been open 6 weeks with no activity. Remove 
stale label or comment or this will be closed in 2 weeks.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3350#issuecomment-2073892276
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] [kamailio/kamailio] ERROR cfgtrace:dbg_cfg_trace() (Issue #3821)

2024-04-23 Thread happytulubi via sr-dev
May I ask what the problem is? It prompts an error but does not affect the 
program's operation. Is it that the configuration file and the deployed version 
are inconsistent?

13(682) ERROR: *** cfgtrace:dbg_cfg_trace(): branch_route=[MANAGE_BRANCH] 
c=[/usr/local/etc/kamailio/kamailio.cfg] l=706 a=16 n=if
13(682) ERROR: *** cfgtrace:dbg_cfg_trace(): branch_route=[MANAGE_BRANCH] 
c=[/usr/local/etc/kamailio/kamailio.cfg] l=695 a=16 n=if
13(682) ERROR: *** cfgtrace:dbg_cfg_trace(): branch_route=[MANAGE_BRANCH] 
c=[/usr/local/etc/kamailio/kamailio.cfg] l=695 a=16 n=if
13(682) INFO: 

[sr-dev] [kamailio/kamailio] phonenum: add national number (PR #3820)

2024-04-23 Thread Daniel Donoghue via sr-dev
- add natnum property, containing the nationally formatted number, to pv

!-- 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 youre unsure about any of these, dont 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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] 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 # (replace  with an open issue number)

 Description
!-- Describe your changes in detail --

You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3820

-- Commit Summary --

  * phonenum: add national number

-- File Changes --

M src/modules/phonenum/cphonenumber.cpp (12)
M src/modules/phonenum/cphonenumber.h (1)
M src/modules/phonenum/doc/phonenum_admin.xml (5)
M src/modules/phonenum/phonenum_pv.c (6)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/3820.patch
https://github.com/kamailio/kamailio/pull/3820.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3820
You are receiving this because you are subscribed to this thread.

Message ID: kamailio/kamailio/pull/3...@github.com
___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] [kamailio/kamailio] modules/statsd: ensure statsd failures do not stop execution (PR #3819)

2024-04-23 Thread Ostap via sr-dev
 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 youre unsure about any of these, dont 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 --
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue # (replace  with an open issue number)

 Description
!-- Describe your changes in detail --

2 issues:

**Issue 1:**
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.


**Issue 2:**
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_statsd.c#L76,
so its 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/0186246fce8f0e4bb46b30c05174983cd957a3ba
was introduced (which could be considered a breaking change even if it
seemingly fixes a bug in conversion).

You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/3819

-- Commit Summary --

  * modules/statsd: avoid stopping flow when sending statsd metric fails
  * modules/statsd: do not fail module initilization when statsd init fails

-- File Changes --

M src/modules/statsd/statsd.c (51)

-- Patch Links --

https://github.com/kamailio/kamailio/pull/3819.patch
https://github.com/kamailio/kamailio/pull/3819.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3819
You are receiving this because you are subscribed to this thread.

Message ID: kamailio/kamailio/pull/3...@github.com
___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Kamailio 5.8 core dumps with regex module (Issue #3812)

2024-04-23 Thread Victor Seva via sr-dev
Yes, I have this issue in my TODO list. Hopefully I will get to it this week.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3812#issuecomment-2071941995
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Kamailio 5.8 core dumps with regex module (Issue #3812)

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
Looked a bot over it and the `pcres` global was not allocated, by an assign to 
`*pcres` was done.

On the other hand, I am not sure if it is enough, I guess the compiled regex 
has to be stored in shared memory and I cannot say it is done. Maybe 
@linuxmaniac can have more insights on it.

With pcre3 library, there was a function from the lib that returned a 
contiguous block for the compiled regex that was then copied to shm.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3812#issuecomment-2071938830
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:84517c14: regex: init globals for safer shutdown on failure

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 84517c14ca38a8371c67b858077a42019c2217a8
URL: 
https://github.com/kamailio/kamailio/commit/84517c14ca38a8371c67b858077a42019c2217a8

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-23T11:49:23+02:00

regex: init globals for safer shutdown on failure

---

Modified: src/modules/regex/regex_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/84517c14ca38a8371c67b858077a42019c2217a8.diff
Patch: 
https://github.com/kamailio/kamailio/commit/84517c14ca38a8371c67b858077a42019c2217a8.patch

---

diff --git a/src/modules/regex/regex_mod.c b/src/modules/regex/regex_mod.c
index e7aaada852d..8e8c1645f0e 100644
--- a/src/modules/regex/regex_mod.c
+++ b/src/modules/regex/regex_mod.c
@@ -68,7 +68,7 @@ gen_lock_t *reload_lock;
 /*
  * Module exported parameter variables
  */
-static char *file;
+static char *file = NULL;
 static int max_groups = MAX_GROUPS;
 static int group_max_size = GROUP_MAX_SIZE;
 static int pcre_caseless = 0;
@@ -83,9 +83,9 @@ static int pcre_extended = 0;
 static pcre2_general_context *pcres_gctx = NULL;
 static pcre2_match_context *pcres_mctx = NULL;
 static pcre2_compile_context *pcres_ctx = NULL;
-static pcre2_code **pcres;
-static pcre2_code ***pcres_addr;
-static int *num_pcres;
+static pcre2_code **pcres = NULL;
+static pcre2_code ***pcres_addr = NULL;
+static int *num_pcres = NULL;
 static int pcre_options = 0x;
 
 

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:2cc62133: regex: allocate pcres array

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 2cc62133db4f6875f55e73e044f37dafbb2274c2
URL: 
https://github.com/kamailio/kamailio/commit/2cc62133db4f6875f55e73e044f37dafbb2274c2

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-23T12:08:30+02:00

regex: allocate pcres array

- GH #3812

---

Modified: src/modules/regex/regex_mod.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/2cc62133db4f6875f55e73e044f37dafbb2274c2.diff
Patch: 
https://github.com/kamailio/kamailio/commit/2cc62133db4f6875f55e73e044f37dafbb2274c2.patch

---

diff --git a/src/modules/regex/regex_mod.c b/src/modules/regex/regex_mod.c
index 8e8c1645f0e..4bb4d7cdcee 100644
--- a/src/modules/regex/regex_mod.c
+++ b/src/modules/regex/regex_mod.c
@@ -462,6 +462,15 @@ static int load_pcres(int action)
}
shm_free(pcres);
}
+
+   if(pcres == NULL) {
+   if((pcres = shm_malloc(sizeof(pcre2_code *) * num_pcres_tmp)) 
== 0) {
+   LM_ERR("no more memory for pcres\n");
+   goto err;
+   }
+   memset(pcres, 0, sizeof(pcre2_code *) * num_pcres_tmp);
+   }
+
*num_pcres = num_pcres_tmp;
*pcres = *pcres_tmp;
*pcres_addr = pcres;

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] free_fixup functions in cmd_export_t are not called (Issue #3814)

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
I am not sure if they are executed at shut down, it was one of the purposes for 
fixup-free function, cleaning up at shut down, but this one was not pursued and 
it is rather tricky because it can be done mainly only for the main process, 
which is not doing anything at runtime. Also, it can slow the restarts ...

Anyhow, one place where they should be used is when using the `modf(...)` from 
KEMI, which should be avoided. Another one, which would be the most important, 
iirc, is when having expressions in the parameters of config functions, like:

```
func1($var(x) + $var(y));
```

instead of:

```
func1("$var(x)$var(y)");
```

Anyhow, you should test to validate the above, I was not the one developing the 
config interpreter when they were added.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3814#issuecomment-2071859533
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] TSILO: ts_append_to(): transaction 11743:1310842517: error updating dset (-1) (Issue #3782)

2024-04-23 Thread vteliatnykov via sr-dev
Closed #3782 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3782#event-12572515048
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] TSILO: ts_append_to(): transaction 11743:1310842517: error updating dset (-1) (Issue #3782)

2024-04-23 Thread vteliatnykov via sr-dev
Hello
The issue was related to that fact that ts_append(), ts_append_to() and 
ts_append_by_contact() are trying to locate user in location table always. It 
is trying to find contact address anyway. In my scenario, address and R-URI do 
not match.

For example, I m dialing to sip:1000@IP (specific SIP extension at specific 
PBX), but when this mobile device awoke, it registers with dynamic AOR (UUID). 
I m using separate hash table (+mysql) for mapping UUID user and specific SIP 
extension address. To fix the issue with appending branch, I had to fix that 
part.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3782#issuecomment-2071854121
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Misleading source IP of 1.0.0.127 in event routes (Issue #3817)

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
Closed #3817 as completed.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3817#event-12572365377
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Misleading source IP of 1.0.0.127 in event routes (Issue #3817)

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
This should be fixed by parsing the loopback ip instead of direct filling of ip 
addr fields. It will be backported. Reopen if still an issue.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3817#issuecomment-2071833806
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:66b3c04a: core: fmsg - parse loopback ip when initializing faked msg structure

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 66b3c04a9653425b1602c82dd2456a7eb7cf59d1
URL: 
https://github.com/kamailio/kamailio/commit/66b3c04a9653425b1602c82dd2456a7eb7cf59d1

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-23T11:19:30+02:00

core: fmsg - parse loopback ip when initializing faked msg structure

- GH #3817

---

Modified: src/core/fmsg.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/66b3c04a9653425b1602c82dd2456a7eb7cf59d1.diff
Patch: 
https://github.com/kamailio/kamailio/commit/66b3c04a9653425b1602c82dd2456a7eb7cf59d1.patch

---

diff --git a/src/core/fmsg.c b/src/core/fmsg.c
index 7a4f9ba87e5..b30ca9f69cf 100644
--- a/src/core/fmsg.c
+++ b/src/core/fmsg.c
@@ -25,6 +25,7 @@
 #include "dprint.h"
 #include "globals.h"
 #include "dset.h"
+#include "resolve.h"
 
 #include "fmsg.h"
 
@@ -57,6 +58,8 @@ static void faked_msg_buf_init(void)
 
 static int faked_msg_init_new(sip_msg_t *fmsg)
 {
+   str loip = str_init("127.0.0.1");
+
faked_msg_buf_init();
 
/* init faked sip msg */
@@ -75,13 +78,9 @@ static int faked_msg_init_new(sip_msg_t *fmsg)
 
fmsg->rcv.proto = PROTO_UDP;
fmsg->rcv.src_port = 5060;
-   fmsg->rcv.src_ip.u.addr32[0] = 0x7f01;
-   fmsg->rcv.src_ip.af = AF_INET;
-   fmsg->rcv.src_ip.len = 4;
+   str2ipbuf(, >rcv.src_ip);
fmsg->rcv.dst_port = 5060;
-   fmsg->rcv.dst_ip.u.addr32[0] = 0x7f01;
-   fmsg->rcv.dst_ip.af = AF_INET;
-   fmsg->rcv.dst_ip.len = 4;
+   str2ipbuf(, >rcv.dst_ip);
 
return 0;
 }

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] tcpops module event_route[tcp:closed] route block $conid is null (Issue #3767)

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
@liangbaolin: I pushed a few commits to address this one, last being 
f5c05a68ae72881ab0691bb8488112356fc67c79 Can you try with git master branch and 
see if ok? If yes, patches will be backported.



-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3767#issuecomment-2071757318
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:27e3b7f3: tcpops: reworked some debug messages

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 27e3b7f3f82957c6dc80f2ff89c40bdd87cecb81
URL: 
https://github.com/kamailio/kamailio/commit/27e3b7f3f82957c6dc80f2ff89c40bdd87cecb81

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-23T10:21:20+02:00

tcpops: reworked some debug messages

---

Modified: src/modules/tcpops/tcpops.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/27e3b7f3f82957c6dc80f2ff89c40bdd87cecb81.diff
Patch: 
https://github.com/kamailio/kamailio/commit/27e3b7f3f82957c6dc80f2ff89c40bdd87cecb81.patch

---

diff --git a/src/modules/tcpops/tcpops.c b/src/modules/tcpops/tcpops.c
index 2b767a9470e..97068c627bb 100644
--- a/src/modules/tcpops/tcpops.c
+++ b/src/modules/tcpops/tcpops.c
@@ -249,6 +249,7 @@ static void 
tcpops_tcp_closed_run_route(tcp_closed_event_info_t *tev)
sr_kemi_eng_t *keng = NULL;
str *evname;
 
+   LM_DBG("event reason id: %d\n", tev->reason);
if(tcpops_event_callback.len > 0) {
rt = -1;
keng = sr_kemi_eng_get();
@@ -258,9 +259,10 @@ static void 
tcpops_tcp_closed_run_route(tcp_closed_event_info_t *tev)
}
} else {
rt = tcp_closed_routes[tev->reason];
-   LM_DBG("event reason id: %d rt: %d\n", tev->reason, rt);
-   if(rt == -1)
+   if(rt == -1) {
+   LM_DBG("event reason id: %d - event route not set\n", 
tev->reason);
return;
+   }
}
 
if(faked_msg_init() < 0) {

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:f5c05a68: pv: use global tcp connection callback for event route on $conid

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: f5c05a68ae72881ab0691bb8488112356fc67c79
URL: 
https://github.com/kamailio/kamailio/commit/f5c05a68ae72881ab0691bb8488112356fc67c79

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-23T10:42:02+02:00

pv: use global tcp connection callback for event route on $conid

---

Modified: src/modules/pv/pv_core.c
Modified: src/modules/tcpops/tcpops.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/f5c05a68ae72881ab0691bb8488112356fc67c79.diff
Patch: 
https://github.com/kamailio/kamailio/commit/f5c05a68ae72881ab0691bb8488112356fc67c79.patch

---

diff --git a/src/modules/pv/pv_core.c b/src/modules/pv/pv_core.c
index 40557ba4628..b10b7513a6f 100644
--- a/src/modules/pv/pv_core.c
+++ b/src/modules/pv/pv_core.c
@@ -2927,6 +2927,13 @@ int pv_get_tcpconn_id(struct sip_msg *msg, pv_param_t 
*param, pv_value_t *res)
if(msg == NULL)
return -1;
 
+   /* use first the connection set for event_route[tcp:...] */
+   con = ksr_tcpcon_evcb_get();
+   if(con != NULL) {
+   return pv_get_sintval(msg, param, res, con->id);
+   }
+
+   /* find connection from sip message structure */
if((con = tcpconn_get(msg->rcv.proto_reserved1, 0, 0, 0, 0)) == NULL)
return pv_get_null(msg, param, res);
 
diff --git a/src/modules/tcpops/tcpops.c b/src/modules/tcpops/tcpops.c
index 97068c627bb..9c648c1f2a3 100644
--- a/src/modules/tcpops/tcpops.c
+++ b/src/modules/tcpops/tcpops.c
@@ -248,6 +248,7 @@ static void 
tcpops_tcp_closed_run_route(tcp_closed_event_info_t *tev)
sip_msg_t *fmsg;
sr_kemi_eng_t *keng = NULL;
str *evname;
+   int bkconid = -1;
 
LM_DBG("event reason id: %d\n", tev->reason);
if(tcpops_event_callback.len > 0) {

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:d114d117: core: tcp - set a global shortcut to tcp connection for event route

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: d114d11724dc4157e7e5809504531d26da6bcc57
URL: 
https://github.com/kamailio/kamailio/commit/d114d11724dc4157e7e5809504531d26da6bcc57

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-23T10:36:35+02:00

core: tcp - set a global shortcut to tcp connection for event route

---

Modified: src/core/tcp_conn.h
Modified: src/core/tcp_main.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/d114d11724dc4157e7e5809504531d26da6bcc57.diff
Patch: 
https://github.com/kamailio/kamailio/commit/d114d11724dc4157e7e5809504531d26da6bcc57.patch

---

diff --git a/src/core/tcp_conn.h b/src/core/tcp_conn.h
index 5b579b2ffb9..57dff5a291b 100644
--- a/src/core/tcp_conn.h
+++ b/src/core/tcp_conn.h
@@ -434,4 +434,6 @@ typedef struct ws_event_info
int id;
 } ws_event_info_t;
 
+tcp_connection_t *ksr_tcpcon_evcb_get(void);
+
 #endif
diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c
index 957a9b97c0f..2456459cfa2 100644
--- a/src/core/tcp_main.c
+++ b/src/core/tcp_main.c
@@ -3670,6 +3670,12 @@ int _tcpconn_write_nb(
return n;
 }
 
+static tcp_connection_t *_ksr_tcpcon_evcb = NULL;
+
+tcp_connection_t *ksr_tcpcon_evcb_get(void)
+{
+   return _ksr_tcpcon_evcb;
+}
 
 static int tcp_emit_closed_event(struct tcp_connection *con)
 {
@@ -3692,7 +3698,9 @@ static int tcp_emit_closed_event(struct tcp_connection 
*con)
tev.id = con->id;
tev.con = con;
evp.data = (void *)();
+   _ksr_tcpcon_evcb = con;
ret = sr_event_exec(SREV_TCP_CLOSED, );
+   _ksr_tcpcon_evcb = NULL;
} else {
LM_DBG("no callback registering for handling TCP closed 
event\n");
}

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] git:master:11e7d71e: core: tcp - keep connection id on event route cb structure

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
Module: kamailio
Branch: master
Commit: 11e7d71e5c2ee9428298658ed3b9a0f625d40f00
URL: 
https://github.com/kamailio/kamailio/commit/11e7d71e5c2ee9428298658ed3b9a0f625d40f00

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-23T10:19:29+02:00

core: tcp - keep connection id on event route cb structure

---

Modified: src/core/tcp_conn.h
Modified: src/core/tcp_main.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/11e7d71e5c2ee9428298658ed3b9a0f625d40f00.diff
Patch: 
https://github.com/kamailio/kamailio/commit/11e7d71e5c2ee9428298658ed3b9a0f625d40f00.patch

---

diff --git a/src/core/tcp_conn.h b/src/core/tcp_conn.h
index 13301563945..5b579b2ffb9 100644
--- a/src/core/tcp_conn.h
+++ b/src/core/tcp_conn.h
@@ -422,6 +422,7 @@ typedef struct tcp_event_info
 typedef struct tcp_closed_event_info
 {
enum tcp_closed_reason reason;
+   int id;
struct tcp_connection *con;
 } tcp_closed_event_info_t;
 
diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c
index b71e7ad37f2..957a9b97c0f 100644
--- a/src/core/tcp_main.c
+++ b/src/core/tcp_main.c
@@ -3689,6 +3689,7 @@ static int tcp_emit_closed_event(struct tcp_connection 
*con)
if(likely(sr_event_enabled(SREV_TCP_CLOSED))) {
memset(, 0, sizeof(tcp_closed_event_info_t));
tev.reason = reason;
+   tev.id = con->id;
tev.con = con;
evp.data = (void *)();
ret = sr_event_exec(SREV_TCP_CLOSED, );

___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] tcpops module event_route[tcp:closed] route block $conid is null (Issue #3767)

2024-04-23 Thread Henning Westerholt via sr-dev
Reopened #3767.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3767#event-12571408485
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org


[sr-dev] Re: [kamailio/kamailio] Kamailio 5.6 (and 5.7) core dumps with uac_req_send() from uac module (Issue #3725)

2024-04-23 Thread Daniel-Constantin Mierla via sr-dev
Reopened #3725.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3725#event-12570750057
You are receiving this because you are subscribed to this thread.

Message ID: ___
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org