[sr-dev] Re: [kamailio/kamailio] db_mysql: failed build on CentOS 7 (Issue #3809)

2024-04-10 Thread space88man via sr-dev
For 5.8 and future is Kamailio still supporting CentOS 7 ?

CentOS 7 will be EoL, 30 June 2024 - not just EoL in terms of no more package 
updates, but it will be physically removed from all the CentOS mirrors.

https://blog.centos.org/2023/04/end-dates-are-coming-for-centos-stream-8-and-centos-linux-7/





-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3809#issuecomment-2048971504
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] ndb_reids module in event_route[tcp:closed] route block error: "no redis context for server" (Issue #3768)

2024-04-10 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/3768#issuecomment-2048833958
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 ims_charging module Ro Interface User-Equipment-Info-Type AVP (Issue #3807)

2024-04-10 Thread svinson1121 via sr-dev
@mtryfoss 
HI Morten, 

 This was just an observation. I noticed the errors in Wireshark while looking 
over a few pcaps. 
it's not having any negative impact on my OCS as I'm not collecting data from 
that AVP. 
 just thought I should raise the issue, but I understand your point on not 
altering the current behavior without good reason.


 Thank you for the reply.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3807#issuecomment-2047728629
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] core/tcp_main: Match protocol when lookup tcp/tls connections (PR #3810)

2024-04-10 Thread Xenofon Karamanos via sr-dev
!-- 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, 
...)
- [ ] 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)
- [x] 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
- [x] Related to issue [reported in 
lists](https://lists.kamailio.org/mailman3/hyperkitty/list/sr-us...@lists.kamailio.org/thread/NJ3HM4UGBII2RN35PDD2SQSCUCZC2T3I/)

 Description
!-- Describe your changes in detail --
This PR aims to fix a bug/security issue where data that was supposed to be 
encrypted and transferred through TLS, were transferred instead with TCP 
protocol.

More information and how to replicate can be found in the above 
[issue](https://lists.kamailio.org/mailman3/hyperkitty/list/sr-us...@lists.kamailio.org/thread/NJ3HM4UGBII2RN35PDD2SQSCUCZC2T3I/)
 in list.

This PR suggests using also the protocol to match if a TCP connection exists, 
and when doing connection lookups, otherwise, it might return a wrong 
connection, ie a TCP one when we are asking for a TLS one (a case when source 
ip/port and dest IP are same but dest port is set 0 (wildcard) ).

`tcpconn_get` was left unchanged due to being used by some modules and not 
wanting to break them. Please advise whether it should be beneficial to also 
change it.

In some cases like, `tcpconn_add_alias` and `tcpconn_get`  we used the 
`PROTO_NONE` which preserves the original behavior. `tcpconn_add_alias` we do 
have the protocol available, should it be also used?
`tcpconn_get` does not have the protocol available unless we pass it as an 
argument.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * tcp_main: Add protocol argument for searching tcp/tls connections
  * tcp_main: Add proto argument to tcpconn_exists function
  * tcp_main: Update comment docs
  * core/forward: Match protocol when forwarding
  * tcp_main: Match wss protocol

-- File Changes --

M src/core/forward.h (3)
M src/core/tcp_conn.h (3)
M src/core/tcp_main.c (43)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3810
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] PKG Memory Leak with RTPEngine Module with WebSocket (Issue #3777)

2024-04-10 Thread vijaykumar-exotel via sr-dev
have verified with 5.7.4 , here also happening the same thing. @miconda 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3777#issuecomment-2047192580
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] topos: add enable_register_publish (PR #3766)

2024-04-10 Thread Harish S via sr-dev
@toharish pushed 1 commit.

86402aee2f1730922000902e15a095b54c5a6b4d  Update tps_msg.c

-- 
View it on GitHub:
https://github.com/kamailio/kamailio/pull/3766/files/9769806b96148a2ede4612605c6d4af047c137f7..86402aee2f1730922000902e15a095b54c5a6b4d
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] db_mysql: failed build on CentOS 7 (Issue #3809)

2024-04-10 Thread sergey-safarov via sr-dev
This is related to commit ea81e6cb8b2b2d896de7a07ce191876f9f182673
@space88man could you look.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3809#issuecomment-2047075397
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] db_mysql: failed build on CentOS 7 (Issue #3809)

2024-04-10 Thread sergey-safarov via sr-dev
### Description

I can see this error during db_mysql compilation on CentOS 7
```
CC (gcc) [M db_mysql.so] km_dbase.o
CC (gcc) [M db_mysql.so] km_val.o
CC (gcc) [M db_mysql.so] km_row.o
CC (gcc) [M db_mysql.so] km_my_con.o
km_my_con.c: In function 'db_mysql_new_connection':
km_my_con.c:183:15: error: 'MYSQL_OPT_SSL_CA' undeclared (first use in this 
function)
 ptr->con, MYSQL_OPT_SSL_CA, (const void *)db_mysql_opt_ssl_ca);
   ^
km_my_con.c:183:15: note: each undeclared identifier is reported only once for 
each function it appears in
make[2]: *** [km_my_con.o] Error 1
make[1]: *** [modules] Error 1
make[1]: Leaving directory `/root/rpmbuild/BUILD/kamailio-5.8.1/src'
make: *** [every-module] Error 2
```

This for 5.8.1 release.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3809
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] cfgutils lock (PR #3808)

2024-04-10 Thread Victor Seva 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
- [ ] 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
- [x] Tested changes locally

 Description

expose in config via cfgutils ``core_case_hash`` optional second string key for 
hashing

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

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

-- Commit Summary --

  * cfgutils: expose optional second string key for hashing at locks
  * cfgutils: document second optional string for hashing on lock functions 
family [skip ci]
  * app_lua_sr: support second str for cfgutils lock

-- File Changes --

M src/modules/app_lua_sr/app_lua_sr_exp.c (30)
M src/modules/cfgutils/api.h (4)
M src/modules/cfgutils/cfgutils.c (103)
M src/modules/cfgutils/doc/cfgutils_admin.xml (18)

-- Patch Links --

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

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3808
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 ims_charging module Ro Interface User-Equipment-Info-Type AVP (Issue #3807)

2024-04-10 Thread Morten Tryfoss via sr-dev
I'm not the author of this module, but this fall I made a lot of changes to it 
to make it compatible to a charging server from Nokia.

If I don't remember wrong, the charging expert I consulted with also mentioned 
something about the MAC - but it was not a blocker for us so we didn't do any 
change. Mostly to not alter current behaviour if anyone relies on that way.

Maybe some other may explain a use case for how it works currently.

Is this just an observation from your side, or do you have a specific use case 
not working as intended?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3807#issuecomment-2046605759
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:7fb51562: nghttp2: $nghttp2(url) replaced with $nghttp2(path)

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-10T07:31:18+02:00

nghttp2: $nghttp2(url) replaced with $nghttp2(path)

- match corresponding http2 header name

---

Modified: src/modules/nghttp2/nghttp2_mod.c
Modified: src/modules/nghttp2/nghttp2_server.c
Modified: src/modules/nghttp2/nghttp2_server.h

---

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

---

diff --git a/src/modules/nghttp2/nghttp2_mod.c 
b/src/modules/nghttp2/nghttp2_mod.c
index de7a13485bf..95918b1e6c8 100644
--- a/src/modules/nghttp2/nghttp2_mod.c
+++ b/src/modules/nghttp2/nghttp2_mod.c
@@ -186,15 +186,10 @@ int pv_parse_nghttp2_name(pv_spec_p sp, str *in)
if(sp == NULL || in == NULL || in->len <= 0)
return -1;
switch(in->len) {
-   case 3:
-   if(strncasecmp(in->s, "url", 3) == 0) {
-   sp->pvp.pvn.u.isname.name.n = 0;
-   } else {
-   goto error;
-   }
-   break;
case 4:
-   if(strncasecmp(in->s, "data", 4) == 0) {
+   if(strncasecmp(in->s, "path", 4) == 0) {
+   sp->pvp.pvn.u.isname.name.n = 0;
+   } else if(strncasecmp(in->s, "data", 4) == 0) {
sp->pvp.pvn.u.isname.name.n = 1;
} else if(strncasecmp(in->s, "size", 4) == 0) {
sp->pvp.pvn.u.isname.name.n = 2;
@@ -264,8 +259,8 @@ int pv_get_nghttp2(sip_msg_t *msg, pv_param_t *param, 
pv_value_t *res)
}
 
switch(param->pvn.u.isname.name.n) {
-   case 0: /* url */
-   return pv_get_strval(msg, param, res, 
&_ksr_nghttp2_ctx.url);
+   case 0: /* path */
+   return pv_get_strval(msg, param, res, 
&_ksr_nghttp2_ctx.path);
case 1: /* data */
return pv_get_strval(msg, param, res, 
&_ksr_nghttp2_ctx.data);
case 2: /* size */
diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index 46b4e003462..38ae3673d46 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -494,8 +494,8 @@ static int on_request_recv(nghttp2_session *session,
_ksr_nghttp2_ctx.session_data = session_data;
_ksr_nghttp2_ctx.stream_data = stream_data;
 
-   _ksr_nghttp2_ctx.url.s = stream_data->request_path;
-   _ksr_nghttp2_ctx.url.len = strlen(_ksr_nghttp2_ctx.url.s);
+   _ksr_nghttp2_ctx.path.s = stream_data->request_path;
+   _ksr_nghttp2_ctx.path.len = strlen(_ksr_nghttp2_ctx.path.s);
 
_ksr_nghttp2_ctx.srcip.s = session_data->client_addr;
_ksr_nghttp2_ctx.srcip.len = strlen(_ksr_nghttp2_ctx.srcip.s);
diff --git a/src/modules/nghttp2/nghttp2_server.h 
b/src/modules/nghttp2/nghttp2_server.h
index dc1f5f148c6..bb5e446631c 100644
--- a/src/modules/nghttp2/nghttp2_server.h
+++ b/src/modules/nghttp2/nghttp2_server.h
@@ -98,7 +98,7 @@ typedef struct ksr_nghttp2_ctx
nghttp2_nv rplhdrs_v[KSR_NGHTTP2_RPLHDRS_SIZE];
int rplhdrs_n;
str method;
-   str url;
+   str path;
str httpversion;
str data;
char srcipbuf[IP_ADDR_MAX_STR_SIZE];

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


[sr-dev] git:master:9a43631e: nghttp2: store method in stream data

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

Author: Daniel-Constantin Mierla 
Committer: Daniel-Constantin Mierla 
Date: 2024-04-10T08:07:30+02:00

nghttp2: store method in stream data

---

Modified: src/modules/nghttp2/nghttp2_server.c
Modified: src/modules/nghttp2/nghttp2_server.h

---

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

---

diff --git a/src/modules/nghttp2/nghttp2_server.c 
b/src/modules/nghttp2/nghttp2_server.c
index 38ae3673d46..dec339d7a15 100644
--- a/src/modules/nghttp2/nghttp2_server.c
+++ b/src/modules/nghttp2/nghttp2_server.c
@@ -179,6 +179,7 @@ static void delete_http2_stream_data(http2_stream_data 
*stream_data)
close(stream_data->fd);
}
free(stream_data->request_path);
+   free(stream_data->request_method);
free(stream_data);
 }
 
@@ -436,6 +437,7 @@ static int on_header_callback(nghttp2_session *session,
 {
http2_stream_data *stream_data;
const char PATH[] = ":path";
+   const char METHOD[] = ":method";
(void)flags;
(void)user_data;
 
@@ -446,15 +448,25 @@ static int on_header_callback(nghttp2_session *session,
}
stream_data = nghttp2_session_get_stream_user_data(
session, frame->hd.stream_id);
-   if(!stream_data || stream_data->request_path) {
+   if(!stream_data) {
break;
}
if(namelen == sizeof(PATH) - 1
&& memcmp(PATH, name, namelen) == 0) {
size_t j;
+   if(stream_data->request_path) {
+   break;
+   }
for(j = 0; j < valuelen && value[j] != '?'; ++j)
;
stream_data->request_path = 
percent_decode(value, j);
+   } else if(namelen == sizeof(METHOD) - 1
+ && memcmp(METHOD, name, namelen) == 
0) {
+   if(stream_data->request_method) {
+   break;
+   }
+   stream_data->request_method =
+   strndup((const char *)value, 
valuelen);
}
break;
}
@@ -497,8 +509,15 @@ static int on_request_recv(nghttp2_session *session,
_ksr_nghttp2_ctx.path.s = stream_data->request_path;
_ksr_nghttp2_ctx.path.len = strlen(_ksr_nghttp2_ctx.path.s);
 
-   _ksr_nghttp2_ctx.srcip.s = session_data->client_addr;
-   _ksr_nghttp2_ctx.srcip.len = strlen(_ksr_nghttp2_ctx.srcip.s);
+   if(stream_data->request_method) {
+   _ksr_nghttp2_ctx.method.s = stream_data->request_method;
+   _ksr_nghttp2_ctx.method.len = strlen(_ksr_nghttp2_ctx.method.s);
+   }
+
+   if(session_data->client_addr) {
+   _ksr_nghttp2_ctx.srcip.s = session_data->client_addr;
+   _ksr_nghttp2_ctx.srcip.len = strlen(_ksr_nghttp2_ctx.srcip.s);
+   }
 
ksr_event_route();
 
diff --git a/src/modules/nghttp2/nghttp2_server.h 
b/src/modules/nghttp2/nghttp2_server.h
index bb5e446631c..34e6155abfc 100644
--- a/src/modules/nghttp2/nghttp2_server.h
+++ b/src/modules/nghttp2/nghttp2_server.h
@@ -70,6 +70,7 @@ typedef struct http2_stream_data
 {
struct http2_stream_data *prev, *next;
char *request_path;
+   char *request_method;
int32_t stream_id;
int fd;
 } http2_stream_data;

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


[sr-dev] git:master:812ad6eb: ipops: Add brief comment for ptr_query

2024-04-10 Thread Xenofon Karamanos via sr-dev
Module: kamailio
Branch: master
Commit: 812ad6eb4e49426197e2860b89b255fffb018b5a
URL: 
https://github.com/kamailio/kamailio/commit/812ad6eb4e49426197e2860b89b255fffb018b5a

Author: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Committer: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Date: 2024-04-09T13:32:46+03:00

ipops: Add brief comment for ptr_query

---

Modified: src/modules/ipops/ipops_mod.c
Modified: src/modules/ipops/ipops_pv.c

---

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

---

diff --git a/src/modules/ipops/ipops_mod.c b/src/modules/ipops/ipops_mod.c
index ea2669d2a19..60fd514d4fb 100644
--- a/src/modules/ipops/ipops_mod.c
+++ b/src/modules/ipops/ipops_mod.c
@@ -1298,7 +1298,18 @@ static int ki_dns_query(sip_msg_t *msg, str *naptrname, 
str *pvid)
 }
 
 /**
+ *! \brief Return 1 (true) if the given `ip` IP address (string or pv)
+ * could successfully be resolved to a domain and saved into `pv_name` pv.
+ * Otherwise, return negative values depending on the error.
  *
+ * \param[in] msg SIP message structure.
+ * \param[in] ip IP address (string or pv) to resolve.
+ * \param[in] pv_name PV name to save the resolved domain.
+ * \returns 1 on success.
+ * \returns negative values depending on the error:
+ * \retval 1 success.
+ * \retval res -1 to -5 for bad input.
+ * \retval -6 for error in resolving the domain.
  */
 static int w_ptr_query(sip_msg_t *msg, char *ip, char *pv_name)
 {
diff --git a/src/modules/ipops/ipops_pv.c b/src/modules/ipops/ipops_pv.c
index 10447e84bcd..034ec696594 100644
--- a/src/modules/ipops/ipops_pv.c
+++ b/src/modules/ipops/ipops_pv.c
@@ -413,8 +413,16 @@ int dns_update_pv(str *hostname, str *name)
return 1;
 }
 
-/*
-*
+/**
+ * \brief Updates the pointer (PTR) record for a given IP address and saves it 
into pv.
+ *
+ * \details This function updates the PTR record for a specified IP address, 
and saves it
+ * into `name` AVP encapsulated in $ptrquery pv.
+ * It performs a reverse DNS lookup to obtain the hostname corresponding to 
the IP address.
+ *
+ * @param ip_address The IP address to update the PTR record for.
+ * @param name The name of AVP to hold the information in $ptrquery pv.
+ * @return 1 on success, or a negative value on failure.
 */
 int ptr_update_pv(str *ip_address, str *name)
 {

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


[sr-dev] git:master:9181ee56: ipops: Move structures to header

2024-04-10 Thread Xenofon Karamanos via sr-dev
Module: kamailio
Branch: master
Commit: 9181ee56e8e90845982a5d994b96917c1e03d059
URL: 
https://github.com/kamailio/kamailio/commit/9181ee56e8e90845982a5d994b96917c1e03d059

Author: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Committer: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Date: 2024-04-09T13:32:46+03:00

ipops: Move structures to header

---

Modified: src/modules/ipops/ipops_pv.c
Modified: src/modules/ipops/ipops_pv.h

---

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

---

diff --git a/src/modules/ipops/ipops_pv.c b/src/modules/ipops/ipops_pv.c
index c6374b6ab7c..6769d1863c7 100644
--- a/src/modules/ipops/ipops_pv.c
+++ b/src/modules/ipops/ipops_pv.c
@@ -35,38 +35,8 @@
 #include "../../core/resolve.h"
 #include "../../core/pvar.h"
 
+#include "ipops_pv.h"
 
-#define PV_DNS_ADDR 64
-#define PV_DNS_RECS 32
-
-typedef struct _sr_dns_record
-{
-   int type;
-   char addr[PV_DNS_ADDR];
-} sr_dns_record_t;
-
-typedef struct _sr_dns_item
-{
-   str name;
-   unsigned int hashid;
-   char hostname[256];
-   int count;
-   int ipv4;
-   int ipv6;
-   sr_dns_record_t r[PV_DNS_RECS];
-   struct _sr_dns_item *next;
-} sr_dns_item_t;
-
-#define SR_DNS_PVIDX 1
-
-typedef struct _dns_pv
-{
-   sr_dns_item_t *item;
-   int type;
-   int flags;
-   pv_spec_t *pidx;
-   int nidx;
-} dns_pv_t;
 
 static sr_dns_item_t *_sr_dns_list = NULL;
 
diff --git a/src/modules/ipops/ipops_pv.h b/src/modules/ipops/ipops_pv.h
index 8b6642ce3a8..f62e4e52e5e 100644
--- a/src/modules/ipops/ipops_pv.h
+++ b/src/modules/ipops/ipops_pv.h
@@ -24,6 +24,35 @@
 #define _IPOPS_PV_H_
 
 #include "../../core/pvar.h"
+#define PV_DNS_ADDR 64
+#define PV_DNS_RECS 32
+#define SR_DNS_PVIDX 1
+
+typedef struct _sr_dns_record
+{
+   int type;
+   char addr[PV_DNS_ADDR];
+} sr_dns_record_t;
+typedef struct _sr_dns_item
+{
+   str name;
+   unsigned int hashid;
+   char hostname[256];
+   int count;
+   int ipv4;
+   int ipv6;
+   sr_dns_record_t r[PV_DNS_RECS];
+   struct _sr_dns_item *next;
+} sr_dns_item_t;
+
+typedef struct _dns_pv
+{
+   sr_dns_item_t *item;
+   int type;
+   int flags;
+   pv_spec_t *pidx;
+   int nidx;
+} dns_pv_t;
 
 int pv_parse_dns_name(pv_spec_t *sp, str *in);
 int pv_get_dns(sip_msg_t *msg, pv_param_t *param, pv_value_t *res);

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


[sr-dev] git:master:a824e939: ipops: Add ptr_query docs

2024-04-10 Thread Xenofon Karamanos via sr-dev
Module: kamailio
Branch: master
Commit: a824e939b589ae595fc735de1337a8bf4470de20
URL: 
https://github.com/kamailio/kamailio/commit/a824e939b589ae595fc735de1337a8bf4470de20

Author: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Committer: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Date: 2024-04-09T13:32:46+03:00

ipops: Add ptr_query docs

---

Modified: src/modules/ipops/doc/ipops_admin.xml

---

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

---

diff --git a/src/modules/ipops/doc/ipops_admin.xml 
b/src/modules/ipops/doc/ipops_admin.xml
index 14dad9f5df6..912d953c9fe 100644
--- a/src/modules/ipops/doc/ipops_admin.xml
+++ b/src/modules/ipops/doc/ipops_admin.xml
@@ -883,6 +883,93 @@ if(dns_query("test.com", "xyz"))
 
 
 
+
+  
+ptr_query(ip, pvid)
+  
+
+  
+ Store the hostname that correspond to an IP address (IPv4 or 
IPv6)
+ in a pseudo-variable variable $ptrquery(pvid=>hostname).
+  
+
+  
+  Note: Results will be in in $ptrquery(pvid=>key).
+  key can be:
+  
+
+  
+addr - IP address
+  
+
+
+  
+type - type of IP address
+  
+
+
+  
+ipv4 - 1 if IPv4 address
+  
+
+
+  
+ipv6 - 1 if IPv6 address
+  
+
+
+  
+count - number of hostnames found
+  
+
+
+  
+hostname - hostname
+  
+
+  
+  
+
+  Parameters:
+
+  
+
+  
+ ip - string or pseudo-variable 
containing the ip.
+  
+
+
+  
+pvid - AVP id for script variable.
+  
+
+  
+
+  
+This function can be used from ANY_ROUTE.
+  
+
+  
+
+  ptr_query usage
+
+
+...
+if(ptr_query("8.8.8.8","ip4"))
+{
+   xlog(" number of names: $ptrquery(ip4=>count)\n");
+   $var(j) = 0;
+   while($var(j)$ptrquery(ip4=>count)) {
+   xlog(" #[$var(j)] name [ $ptrquery(ip4=>hostname) ]\n");
+   $var(j) = $var(j) + 1;
+   }
+}
+...
+
+  
+
+
+
 
   
 srv_query(srvcname, pvid)

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


[sr-dev] git:master:4c775edd: ipops: Add PTR query support

2024-04-10 Thread Xenofon Karamanos via sr-dev
Module: kamailio
Branch: master
Commit: 4c775eddaf76cbaf376bfb2d0e5efc78d0d60dc4
URL: 
https://github.com/kamailio/kamailio/commit/4c775eddaf76cbaf376bfb2d0e5efc78d0d60dc4

Author: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Committer: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Date: 2024-04-09T13:32:46+03:00

ipops: Add PTR query support

---

Modified: src/modules/ipops/ipops_mod.c
Modified: src/modules/ipops/ipops_pv.c
Modified: src/modules/ipops/ipops_pv.h

---

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

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


[sr-dev] git:master:5a5b96c8: ipops: Add KEMI wrapper for ptr_query function

2024-04-10 Thread Xenofon Karamanos via sr-dev
Module: kamailio
Branch: master
Commit: 5a5b96c8a1906b45873e50243f5946b8db5a068b
URL: 
https://github.com/kamailio/kamailio/commit/5a5b96c8a1906b45873e50243f5946b8db5a068b

Author: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Committer: Xenofon Karamanos <22965395+xkara...@users.noreply.github.com>
Date: 2024-04-09T13:32:46+03:00

ipops: Add KEMI wrapper for ptr_query function

---

Modified: src/modules/ipops/ipops_mod.c

---

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

---

diff --git a/src/modules/ipops/ipops_mod.c b/src/modules/ipops/ipops_mod.c
index 60fd514d4fb..ea82beb0867 100644
--- a/src/modules/ipops/ipops_mod.c
+++ b/src/modules/ipops/ipops_mod.c
@@ -1333,6 +1333,14 @@ static int w_ptr_query(sip_msg_t *msg, char *ip, char 
*pv_name)
return ptr_update_pv(_address, );
 }
 
+/**
+ * \brief KEMI wrapper for `ptr_query` function.
+ */
+static int ki_ptr_query(sip_msg_t *msg, str *ip, str *pvid)
+{
+   return ptr_update_pv(ip, pvid);
+}
+
 /**
  *
  */
@@ -1513,6 +1521,11 @@ static sr_kemi_t sr_kemi_ipops_exports[] = {
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
},
+   { str_init("ipops"), str_init("ptr_query"),
+   SR_KEMIP_INT, ki_ptr_query,
+   { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
+   SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE }
+   },
{ str_init("ipops"), str_init("srv_query"),
SR_KEMIP_INT, ki_srv_query,
{ SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,

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