[SR-Users] Re: sips to sip

2023-11-21 Thread David Villasmil via sr-users
thanks all, i figured it out with help from Alfonso who found
https://github.com/fredposner/scripts/blob/master/kamailio/kamailio-tls_srtp-bridge.cfg
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337


On Tue, Nov 21, 2023 at 2:34 PM Henning Westerholt  wrote:

> Hi David,
>
>
>
> at least from the logs the dialog is matched:
>
>
>
> DEBUG: dialog [dlg_hash.c:885]: internal_get_dlg(): dialog
> callid='aa157c08df1109c4655ca64d0ed67' found on entry 1431, dir=2
> to-tag='ZDDN09pNH37XB'
> DEBUG: dialog [dlg_profile.c:541]: set_current_dialog(): setting current
> dialog [1431:511]
> DEBUG: dialog [dlg_handlers.c:343]: dlg_iuid_sfree(): freeing dlg iuid
> [3314:1253] (0x7f6d9b2afe20)
> DEBUG: dialog [dlg_hash.c:1293]: next_state_dlg(): dialog 0x7f6d9b2f8240
> changed from state 5 to state 5, due event 7 (ref 2)
>
>
>
> The dialog is already deleted at this point, not sure why.
>
>
>
> Please note that your rewrite method can cause problems in dialogs, as for
> example the From/To header will be not matching to the expectations of the
> UAs. Consider using the methods I mentioned earlier to prevent this.
>
>
>
> Cheers,
>
>
>
> Henning
>
>
>
> *From:* David Villasmil 
> *Sent:* Dienstag, 21. November 2023 13:58
> *To:* Henning Westerholt 
> *Cc:* Kamailio (SER) - Users Mailing List 
> *Subject:* Re: [SR-Users] sips to sip
>
>
>
> thanks Henning,
>
>
>
> Already tried that with:
>
>
>
>
> if (is_method("INVITE")) {
> $var(fline) = $msg(fline);
> $var(hdrs) = $msg(hdrs);
> $var(body) = $msg(body);
>
> $var(fline) = $(var(fline){s.replace,sips,sip});
> #{s.replace,;transport=TLS,}{s.replace,;transport=tls,});
> $var(hdrs) = $(var(hdrs){s.replace,sips,sip});
> #{s.replace,;transport=TLS,}{s.replace,;transport=tls,});
> $var(body) = $(var(body){s.replace,sips,sip});
> #{s.replace,;transport=TLS,}{s.replace,;transport=tls,});
>
> msg_set_buffer("$var(fline)\r\n$var(hdrs)\r\n\r\n$var(body)");
> msg_apply_changes();
> }
>
>
>
> but then the BYE doesn't work, kamailio can't match it to a dialog
>
>
>
> 2023/11/21 12:48:41.962062 FREESWITCH-IP:5080 -> 10.0.3.141:5060
> BYE sip:+FROM-NUMBER@CLIENT-IP;transport=TLS SIP/2.0
> Via: SIP/2.0/UDP FREESWITCH-IP:5080;rport;branch=z9hG4bK34FNtg4e31B8K
> Route: 
> Route: 
> Max-Forwards: 70
> From: ;tag=133B764ZS9QvD
> To: ;tag=df6b235d
> Call-ID: 75fc6fcaaa32bcd7655ca72452eac
> CSeq: 75731668 BYE
> User-Agent: C3S-v1.1
> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER,
> REFER, NOTIFY
> Supported: timer, path, replaces
> Reason: Q.850;cause=16;text="NORMAL_CLEARING"
> Content-Length: 0
>
>
>
> DEBUG:  [core/receive.c:392]: receive_msg(): --- received sip
> message - request - call-id: [aa157c08df1109c4655ca64d0ed67] - cseq:
> [75731561 BYE]
> DEBUG:  [core/receive.c:263]: ksr_evrt_pre_routing(): event route
> core:pre-routing not defined
> DEBUG:  [core/receive.c:474]: receive_msg(): preparing to run
> routing scripts...
> ERROR: 

[SR-Users] Crash on core/mem/q_malloc.c

2023-11-21 Thread Igor Potjevlesch via sr-users
Hello!



I'm facing an issue 2/3 times a day with the following errors in the logs:

Nov 22 00:09:02 /usr/local/sbin/kamailio[3720]: CRITICAL: 
[core/mem/q_malloc.c:150]: qm_debug_check_frag(): BUG: qm: prev. fragm. tail
overwritten(c0c0c000, abcdefed)[0x7f9600b754f8:0x7f9600b75530]! Memory
allocator was called from core: core/re.c:430. Fragment marked by core:
db_res.c:139. Exec from core/mem/q_malloc.c:391.

Nov 22 00:09:02 /usr/local/sbin/kamailio[3720]: CRITICAL: 
[core/mem/q_malloc.c:155]: qm_debug_check_frag(): BUG: qm: prev. fragm. tail
overwritten [0x7f9600b75460:0x7f9600b75498] - fragment marked by tm:
t_fwd.c:230

Nov 22 00:09:02 abrt-hook-ccpp: Process 3720 (kamailio) of user 0 killed by
SIGABRT - ignoring (repeated crash)



Do you have any idea where it could come from? I'm running Kamailio 5.6.4.



Regards,



Igor.



--
Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
www.avast.com__
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: kamailio t_on_failure tcp timeout

2023-11-21 Thread Julien Chavanton via sr-users
Sorry for the incomplete email.

My problem is that the failure route does not trigger on TCP timeout.

...
t_on_reply("ON_REPLY_MESSAGE");
t_on_failure("FAILURE_MESSAGE");
if (!t_relay())
sl_reply_error();


I did play with some settings like

tcp_send_timeout=3
t_set_max_lifetime(3000, 3000);

I also waited a lot more than 32 seconds.

Maybe I need to run in debug mode to find out what is going on.


On Tue, Nov 21, 2023 at 1:46 PM Julien Chavanton 
wrote:

> Hi,
>
> I would like to catch TCP timeouts when I use a socket that was not closed.
> In this example I am sending SIP MESSAGE
>
> ...
> t_on_reply("ON_REPLY_MESSAGE");
> t_on_failure("FAILURE_MESSAGE");
> if (!t_relay())
> sl_reply_error();
>
__
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] kamailio t_on_failure tcp timeout

2023-11-21 Thread Julien Chavanton via sr-users
Hi,

I would like to catch TCP timeouts when I use a socket that was not closed.
In this example I am sending SIP MESSAGE

...
t_on_reply("ON_REPLY_MESSAGE");
t_on_failure("FAILURE_MESSAGE");
if (!t_relay())
sl_reply_error();
__
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: sips to sip

2023-11-21 Thread Henning Westerholt via sr-users
Hi David,

at least from the logs the dialog is matched:

DEBUG: dialog [dlg_hash.c:885]: internal_get_dlg(): dialog 
callid='aa157c08df1109c4655ca64d0ed67' found on entry 1431, dir=2 
to-tag='ZDDN09pNH37XB'
DEBUG: dialog [dlg_profile.c:541]: set_current_dialog(): setting current dialog 
[1431:511]
DEBUG: dialog [dlg_handlers.c:343]: dlg_iuid_sfree(): freeing dlg iuid 
[3314:1253] (0x7f6d9b2afe20)
DEBUG: dialog [dlg_hash.c:1293]: next_state_dlg(): dialog 0x7f6d9b2f8240 
changed from state 5 to state 5, due event 7 (ref 2)

The dialog is already deleted at this point, not sure why.

Please note that your rewrite method can cause problems in dialogs, as for 
example the From/To header will be not matching to the expectations of the UAs. 
Consider using the methods I mentioned earlier to prevent this.

Cheers,

Henning

From: David Villasmil 
Sent: Dienstag, 21. November 2023 13:58
To: Henning Westerholt 
Cc: Kamailio (SER) - Users Mailing List 
Subject: Re: [SR-Users] sips to sip

thanks Henning,

Already tried that with:


if (is_method("INVITE")) {
$var(fline) = $msg(fline);
$var(hdrs) = $msg(hdrs);
$var(body) = $msg(body);

$var(fline) = $(var(fline){s.replace,sips,sip}); 
#{s.replace,;transport=TLS,}{s.replace,;transport=tls,});
$var(hdrs) = $(var(hdrs){s.replace,sips,sip}); 
#{s.replace,;transport=TLS,}{s.replace,;transport=tls,});
$var(body) = $(var(body){s.replace,sips,sip}); 
#{s.replace,;transport=TLS,}{s.replace,;transport=tls,});
msg_set_buffer("$var(fline)\r\n$var(hdrs)\r\n\r\n$var(body)");
msg_apply_changes();
}

but then the BYE doesn't work, kamailio can't match it to a dialog

2023/11/21 12:48:41.962062 FREESWITCH-IP:5080 -> 
10.0.3.141:5060
BYE sip:+FROM-NUMBER@CLIENT-IP;transport=TLS SIP/2.0
Via: SIP/2.0/UDP FREESWITCH-IP:5080;rport;branch=z9hG4bK34FNtg4e31B8K
Route: 
Route: 
Max-Forwards: 70
From: ;tag=133B764ZS9QvD
To: ;tag=df6b235d
Call-ID: 75fc6fcaaa32bcd7655ca72452eac
CSeq: 75731668 BYE
User-Agent: C3S-v1.1
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, 
REFER, NOTIFY
Supported: timer, path, replaces
Reason: Q.850;cause=16;text="NORMAL_CLEARING"
Content-Length: 0



DEBUG:  [core/receive.c:392]: receive_msg(): --- received sip message - 
request - call-id: [aa157c08df1109c4655ca64d0ed67] - cseq: [75731561 BYE]
DEBUG:  [core/receive.c:263]: ksr_evrt_pre_routing(): event route 
core:pre-routing not defined
DEBUG:  [core/receive.c:474]: receive_msg(): preparing to run routing 
scripts...
ERROR: 

[SR-Users] Re: sips to sip

2023-11-21 Thread David Villasmil via sr-users
thanks Henning,

Already tried that with:


if (is_method("INVITE")) {
$var(fline) = $msg(fline);
$var(hdrs) = $msg(hdrs);
$var(body) = $msg(body);

$var(fline) = $(var(fline){s.replace,sips,sip});
#{s.replace,;transport=TLS,}{s.replace,;transport=tls,});
$var(hdrs) = $(var(hdrs){s.replace,sips,sip});
#{s.replace,;transport=TLS,}{s.replace,;transport=tls,});
$var(body) = $(var(body){s.replace,sips,sip});
#{s.replace,;transport=TLS,}{s.replace,;transport=tls,});

msg_set_buffer("$var(fline)\r\n$var(hdrs)\r\n\r\n$var(body)");
msg_apply_changes();
}

but then the BYE doesn't work, kamailio can't match it to a dialog

2023/11/21 12:48:41.962062 FREESWITCH-IP:5080 -> 10.0.3.141:5060
BYE sip:+FROM-NUMBER@CLIENT-IP;transport=TLS SIP/2.0
Via: SIP/2.0/UDP FREESWITCH-IP:5080;rport;branch=z9hG4bK34FNtg4e31B8K
Route: 
Route: 
Max-Forwards: 70
From: ;tag=133B764ZS9QvD
To: ;tag=df6b235d
Call-ID: 75fc6fcaaa32bcd7655ca72452eac
CSeq: 75731668 BYE
User-Agent: C3S-v1.1
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER,
REFER, NOTIFY
Supported: timer, path, replaces
Reason: Q.850;cause=16;text="NORMAL_CLEARING"
Content-Length: 0



DEBUG:  [core/receive.c:392]: receive_msg(): --- received sip message
- request - call-id: [aa157c08df1109c4655ca64d0ed67] - cseq: [75731561 BYE]
DEBUG:  [core/receive.c:263]: ksr_evrt_pre_routing(): event route
core:pre-routing not defined
DEBUG:  [core/receive.c:474]: receive_msg(): preparing to run routing
scripts...
ERROR: 

[SR-Users] Re: Dialog + DMQ: dlg_ontimeout() triggered on wrong node!

2023-11-21 Thread Benoît Panizzon via sr-users
Hi

Some more testing...

It looks like, in REPLY_ROUTE

if (is_known_dlg()) {
dlg_set_timeout("3");
xlog("L_INFO", "$cfg(route): DEBUG DLG Lifetime 
$dlg(lifetime)\n");
}

indeed does set the lifetime to 3 seconds.

Unfortunately this is replicated on the other DMQ node which then again has
a 50% chance of wrongfully triggering timeout after 3 seconds instead
of what the default is. So no luck in setting a generous default lifetime and 
then
shortening the lifetime on the node handling the case to make sure it is
the one triggering the timeout.

I had a quick glimpse into the source. As an n00b coder, I think I
understand that the dmq message is parsed and then timer inserted or
updated on all dmq nodes when a DQM dialog message is received. I fear,
this causes this behaviour of the timer expiring on the wrong node.

So is this a bug? Shall I report an issue on github?

-- 
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
-- 
I m p r o W a r e   A G-Leiter Commerce Kunden
__

Zurlindenstrasse 29 Tel  +41 61 826 93 00
CH-4133 PrattelnFax  +41 61 826 93 01
Schweiz Web  http://www.imp.ch
__
__
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] Releasing v5.6.5

2023-11-21 Thread Daniel-Constantin Mierla via sr-users
Hello,

I am considering to release Kamailio v5.6.5 (out of branch 5.6) later
this week (likely on Thursday or Friday, Nov 23/24, 2023). If anyone is
aware of
issues not yet on the bug tracker, report them there asap in order to
have a better chance to be fixed.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy and Development Services
Kamailio Advanced Training -- asipto.com

__
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: sips to sip

2023-11-21 Thread Henning Westerholt via sr-users
Hello,

if you like you can rewrite the respective headers to use only sip uri scheme 
of course.


  *   Record-Route: ignore_sips in rr
  *   From/To: uac_replace_from/_to
  *   Contacts: textops etc..

Cheers,

Henning

From: David Villasmil via sr-users 
Sent: Montag, 20. November 2023 19:44
To: Kamailio (SER) - Users Mailing List 
Cc: David Villasmil 
Subject: [SR-Users] sips to sip

Hello guys,

I have this setup where one side is TLS and the other UDP. Normally this works 
fine, but we have this provider sending sips as the schema everywhere (from, 
to, rr, contacts), kamailio sends the same sips to the upstream usp freeswitch.

My problem is when FS sends back a 200OK and kamailio forwards it back to the 
provider, the provider sends an ACK and kamailio can't match it with the dialog 
and doesn't know where to forward it.

i think this is happening because FS when is sees SIPS is setting the contact 
port as 5081 instead of the usual 5080...


Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337

__
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: