[SR-Users] Re: Active/Active Registrar Design

2024-09-20 Thread Juha Heinanen via sr-users
Alex Balashov via sr-users writes:

> SIP Outbound (RFC 5626) is, I think, the officially sanctioned remedy,
> but, while Kamailio supports it, most customer equipment in the field
> to date, as far as I know, does not.

Yes, that is the best solution.  SIP UA registers via two outbound
proxies and is thus able to receive INVITEs from both.  There are SIP
UAs that support it.

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] db_mysql startup warnings

2024-06-17 Thread Juha Heinanen via sr-users
Juha Heinanen via sr-users writes:

> 2024-06-17T14:48:27.702827+03:00 siika /usr/bin/sip-proxy[297246]: WARNING: 
> db_mysql [km_my_con.c:187]: db_mysql_new_connection(): opt_ssl_ca option not 
> supported by mysql version (value (null)) - ignoring

Just to clarify, I have not defined opt_ssl_ca in Kamailio config file.

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] db_mysql startup warnings

2024-06-17 Thread Juha Heinanen via sr-users
When I start Kamailio master version that has been build on Debian 12
with default-libmysqlclient-dev depending on libmariadb-dev-compat, I
get several warnings like this:

2024-06-17T14:48:27.702827+03:00 siika /usr/bin/sip-proxy[297246]: WARNING: 
db_mysql [km_my_con.c:187]: db_mysql_new_connection(): opt_ssl_ca option not 
supported by mysql version (value (null)) - ignoring

How can I prevent them?

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Is there any funtion to route based on source phone number

2024-05-21 Thread Juha Heinanen via sr-users
If you want to select something based on phone number (longest) prefix,
then mtree module could be useful.

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] tm.t_uac_wait ACK does not have Max-Forwards header

2024-05-20 Thread Juha Heinanen via sr-users
OK, this is the fix:

diff --git a/src/modules/tm/t_msgbuilder.c b/src/modules/tm/t_msgbuilder.c
index 362ff6c5eb..187be7871d 100644
--- a/src/modules/tm/t_msgbuilder.c
+++ b/src/modules/tm/t_msgbuilder.c
@@ -1246,7 +1246,8 @@ char *build_dlg_ack(struct sip_msg *rpl, struct cell 
*Trans,
 
/* headers */
*len += Trans->from_hdr.len + Trans->callid_hdr.len + to->len
-   + Trans->cseq_hdr_n.len + 1 + ACK_LEN + CRLF_LEN;
+   + Trans->cseq_hdr_n.len + 1 + ACK_LEN +
+   + MAXFWD_HEADER_LEN + CRLF_LEN;
 
/* copy'n'paste Route headers */
 
@@ -1291,6 +1292,8 @@ char *build_dlg_ack(struct sip_msg *rpl, struct cell 
*Trans,
append_str(p, Trans->callid_hdr.s, Trans->callid_hdr.len);
append_str(p, to->s, to->len);
 
+   append_str(p, MAXFWD_HEADER, MAXFWD_HEADER_LEN);
+
append_str(p, Trans->cseq_hdr_n.s, Trans->cseq_hdr_n.len);
append_str(p, " ", 1);
append_str(p, ACK, ACK_LEN);

Can I push it to master and 5.8?

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] tm.t_uac_wait ACK does not have Max-Forwards header

2024-05-20 Thread Juha Heinanen via sr-users
I added some debug to t_msgbuilder.c and found out that
function build_uac_req() where missing Max-Forwards is added, is not
executed when request is ACK.  It is executed when request is INVITE or
BYE.

So where should Max-Forwards check for ACK be done?

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] tm.t_uac_wait ACK does not have Max-Forwards header

2024-05-19 Thread Juha Heinanen via sr-users
t_msgbuilder.c build_uac_req() has:

if(headers == NULL || headers->len < 15
|| _strnstr(headers->s, "Max-Forwards:", headers->len) 
== NULL) {
maxfwd_len = MAXFWD_HEADER_LEN;
} else {
maxfwd_len = 0;
}

It should add Max-Forwards if it missing, but for some reason it does not
happen with ACK.

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] tm.t_uac_wait ACK does not have Max-Forwards header

2024-05-19 Thread Juha Heinanen via sr-users
Kamailio sends INVITE by tm.t_uac_wait RPC command:

INVITE sip:test-0x55e7f1f78e70@192.168.187.215:5022 SIP/2.0
Via: SIP/2.0/UDP 
192.168.187.215;branch=z9hG4bK6cf1.f1d087d6.0
To: 
From: 
;tag=2dd3d4389fe3d66c5cb97dc370ab7d7b-9c5a2a58
CSeq: 1 INVITE
Call-ID: 6649e78355...@test.tutpro.com
Content-Length: 131
User-Agent: OpenSIPg SIP Proxy (5.9.0-0b01 (x86_64/linux))
Max-Forwards: 10
Contact: 
Content-Type: application/sdp

.. sdp omitted

UAS accepts the INVITE:

SIP/2.0 200 Answering
Via: SIP/2.0/UDP 
192.168.187.215;branch=z9hG4bK6cf1.f1d087d6.0
To: ;tag=a3302e2a0898de3e
From: 
;tag=2dd3d4389fe3d66c5cb97dc370ab7d7b-9c5a2a58
CSeq: 1 INVITE
Call-ID: 6649e78355...@test.tutpro.com
Server: baresip v3.12.0 (x86_64/Linux)
Contact: 
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,NOTIFY,SUBSCRIBE,INFO,MESSAGE,UPDATE,REFER
Supported: gruu,replaces,norefersub
Content-Type: application/sdp
Content-Length: 239

.. sdp omitted

After receiving the response, Kamailio automatically sends ACK:

ACK sip:test-0x55e7f1f78e70@192.168.187.215:5022 SIP/2.0
Via: SIP/2.0/UDP 
192.168.187.215;branch=z9hG4bK6cf1.f1d087d6.0
From: 
;tag=2dd3d4389fe3d66c5cb97dc370ab7d7b-9c5a2a58
Call-ID: 6649e78355...@test.tutpro.com
To: ;tag=a3302e2a0898de3e
CSeq: 1 ACK
User-Agent: OpenSIPg SIP Proxy (5.9.0-0b01 (x86_64/linux))
Content-Length: 0

The problem is that Max-Forwards header is missing from the ACK.

Should I have something in config file to add it or is this a bug?

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Assistance Needed to Resolve Duplicate Contact Headers in 200 OK Response

2024-05-17 Thread Juha Heinanen via sr-users
satyaprakash ch via sr-users writes:

> We are receiving 2 to 3 contact headers in the 200 OK response of the
> registration request. It appears that the `user_location` is updating
> multiple contact headers for the same extension due to network
> disconnections. Please suggest a solution to avoid duplicates in the
> `user_location` module, or how to ensure that only the latest single
> contact header is included in the 200 OK response.
> 
> Your suggestion would be appreciated.

Use proper SIP UAs that support instance id.  See
https://www.rfc-editor.org/rfc/rfc5626.

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: dynamic selection of authentication algorithm

2024-05-14 Thread Juha Heinanen via sr-users
Daniel-Constantin Mierla writes:

> I actually replied on you initial email at that time, saying that is
> interesting to add it. My previous email was a follow up of that email.

OK, looks like I missed it.  Will prepare PR.

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: dynamic selection of authentication algorithm

2024-05-14 Thread Juha Heinanen via sr-users
Daniel-Constantin Mierla writes:

> are you still planning to add this patch to the repo?

Based on non-existing comments, looks like I'm the only one interested.
So it is not worth to create a PR. 

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] sql_query fails from event_route

2024-05-07 Thread Juha Heinanen via sr-users
Juha Heinanen via sr-users writes:

> I noticed that sql_query does not (anymore)  work when called from
> event route:

I created bug issue https://github.com/kamailio/kamailio/issues/3843
about this to GitHub, since it really looks like a bug, because the same
code has worked fine in some earlier K release.

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] sql_query fails from event_route

2024-05-07 Thread Juha Heinanen via sr-users
I noticed that sql_query does not (anymore)  work when called from 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.

Any ideas why the query fails from event_route?

-- Juha



__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] dynamic selection of authentication algorithm

2024-04-20 Thread Juha Heinanen via sr-users
How about this new function that sets the algorithm?

-- Juha

iff --git a/src/modules/auth/auth_mod.c b/src/modules/auth/auth_mod.c
index 534ad9e20f..4e3a584d22 100644
--- a/src/modules/auth/auth_mod.c
+++ b/src/modules/auth/auth_mod.c
@@ -74,6 +74,10 @@ int w_consume_credentials(struct sip_msg *msg, char *s1, 
char *s2);
  * Check for credentials with given realm
  */
 int w_has_credentials(struct sip_msg *msg, char *s1, char *s2);
+/*
+ * Set authentication algorithm
+ */
+int w_auth_algorithm(struct sip_msg *msg, char *alg, char* s2);
 
 static int pv_proxy_authenticate(
struct sip_msg *msg, char *realm, char *passwd, char *flags);
@@ -170,6 +174,8 @@ static cmd_export_t cmds[] = {
REQUEST_ROUTE},
{"pv_auth_check", (cmd_function)w_pv_auth_check, 4, fixup_pv_auth_check,
0, REQUEST_ROUTE},
+   {"auth_algorithm", w_auth_algorithm, 1, fixup_spve_null, 0,
+   REQUEST_ROUTE},
{"bind_auth_s", (cmd_function)bind_auth_s, 0, 0, 0},
 
{0, 0, 0, 0, 0, 0}
@@ -475,6 +481,35 @@ int w_has_credentials(sip_msg_t *msg, char *realm, char 
*s2)
return -1;
}
return ki_has_credentials(msg, &srealm);
+
+}
+/**
+ *
+ */
+int w_auth_algorithm(sip_msg_t *msg, char* alg, char* s2)
+{
+   if (fixup_get_svalue(msg, (gparam_t*)alg, &auth_algorithm) < 0) {
+   LM_ERR("failed to get algorithm value\n");
+   return -1;
+   }
+
+   if (strcmp(auth_algorithm.s, "MD5") == 0) {
+   hash_hex_len = HASHHEXLEN;
+   calc_HA1 = calc_HA1_md5;
+   calc_response = calc_response_md5;
+   }
+   else if (strcmp(auth_algorithm.s, "SHA-256") == 0) {
+   hash_hex_len = HASHHEXLEN_SHA256;
+   calc_HA1 = calc_HA1_sha256;
+   calc_response = calc_response_sha256;
+   }
+   else {
+   LM_ERR("Invalid algorithm provided."
+   " Possible values are \"\", \"MD5\" or \"SHA-256\"\n");
+   return -1;
+   }
+
+   return 1;
 }
 
 #ifdef USE_NC
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] dynamic selection of authentication algorithm

2024-04-20 Thread Juha Heinanen via sr-users
Juha Heinanen via sr-users writes:

> Currently digest authentication hash algorithm (MD5 or SHA-256) is
> selected when auth module is loaded.  How about allowing to select it
> also dynamically using the function flags?

Can't be done, since auth_db functions don't have flags parameter.  Too
bad since some SIP UAs support SHA-256 and some don't.

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] dynamic selection of authentication algorithm

2024-04-20 Thread Juha Heinanen via sr-users
Currently digest authentication hash algorithm (MD5 or SHA-256) is
selected when auth module is loaded.  How about allowing to select it
also dynamically using the function flags?

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: 5.8 acc module failed_filter error

2024-03-11 Thread Juha Heinanen via sr-users
Daniel-Constantin Mierla writes:

> It might be a regression by commit 675f6c02248, can you try with latest
> master or with the patch of the commit:
> 
>   -
> https://github.com/kamailio/kamailio/commit/4dc37aee853bbcf9d7fdb96245b76aaa8dfa2930

I tried with latest master and it started OK.  Pretty serious stuff.
Perhaps a new tag 5.8.1 is needed.

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: 5.8 acc module failed_filter error

2024-03-11 Thread Juha Heinanen via sr-users
Daniel-Constantin Mierla writes:

> what are the operating system and the compiler used?

Sorry, Debian 12 using gcc version 12.2.0.

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] 5.8 acc module failed_filter error

2024-03-11 Thread Juha Heinanen via sr-users
My SIP proxy didn't start with Kamailio 5.8 using the same config that
starts OK with 5.7.  The error is:

2024-03-11T06:56:06.457107+02:00 lohi /usr/bin/sip-proxy[2358954]: DEBUG: acc 
[acc_mod.c:362]: parse_failed_filter(): failed_filter 0 = 407
2024-03-11T06:56:06.457265+02:00 lohi /usr/bin/sip-proxy[2358954]: ERROR: acc 
[acc_mod.c:369]: parse_failed_filter(): response code is not followed by comma 
or end of string
2024-03-11T06:56:06.457436+02:00 lohi /usr/bin/sip-proxy[2358954]: ERROR: acc 
[acc_mod.c:439]: mod_init(): failed to parse failed_filter param

The relevant params are:

modparam("acc", "failed_transaction_flag", 8)
modparam("acc", "failed_filter", "407")

I didn't find any difference in acc_mod.c source code between 5.7 and
5.8 and parse_failed_filter function looked OK.

Then I added a debug statement in the beginning of parse_failed_filter
function:

LM_DBG("parsing failed_filter %s\n", s);

and got to syslog:

cc_mod.c:341]: parse_failed_filter(): parsing failed_filter 
407rmissions|pua|rtpengine)$

That explains the parse_failed_filter error, but where does that bogus
param value come from?

Before acc params I have:

modparam("auth_db|dialplan|domain|htable|lcr|msilo|mtree|permissions|pua|rtpengine",
 "db_url", "mysql:///sip_proxy")
modparam("registrar|nathelper", "received_avp", "$avp(received_uri)")

So it from there, but why?  Is there a bug somewhere or is my SIP proxy
running out of memory or something?  Before the above error messages,
there are no other error messages.

-- Juha


__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] 5.8 compiler warning

2024-03-10 Thread Juha Heinanen via sr-users
Kamailio 5.8 build generates on my Debian 12 the following warning:

core/mem/q_malloc.c:996:14: warning: 'qm_strnstr' defined but not used 
[-Wunused-function]
  996 | static void *qm_strnstr(const void *b1, int l1, const void *b2, int l2)
  |  ^~

Perhaps the definition of the function should be #ifdef'ed by
DBG_QM_MALLOC.

-- Juha

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] LCR logic

2024-01-26 Thread Juha Heinanen via sr-users
Social Boh via sr-users writes:

> so I have 3 lcr_rule_target use the same 
> lcr_rule entry but 3 different Gateways and priority. So the order of 
> rules would be longest Request-URI (same) and the priority but the 
> result is:
> 
> added matched_gws[0]=[3, 5, 200, 2193562]
> added matched_gws[1]=[1, 5, 2, 6888519]
> added matched_gws[2]=[2, 5, 50, 2159388]
> 
> same prefix but first rule target with priority 200 and then 2 and then 
> 50. I think the result would be priority 2,50 and 100.
> 
> ¿Or not?

matched_gws are sorted after those debug messages.
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Connect to a remote ENUM(E.164 Number Mapping) server

2023-12-25 Thread Juha Heinanen via sr-users
elhar.mohamed--- via sr-users writes:

> Can you please give more explanation ? I'm not sure I understand what
> you want to tell !

Read, for example, this article:

https://nickvsnetworking.com/enum-dns-based-call-routing/

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Connect to a remote ENUM(E.164 Number Mapping) server

2023-12-25 Thread Juha Heinanen via sr-users
elhar.mohamed--- via sr-users writes:

> I'm using the Kamailio version 5.7.x, I didn't find in the module
> "enum.so" any option that allow to connect to a remote ENUM server.

ENUM lookup is normal DNS lookup.

-- Juha
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe: