From david.villasmil.work@gmail.com Wed Nov 22 00:53:39 2023 From: David Villasmil To: sr-users@lists.kamailio.org Subject: [SR-Users] Re: sips to sip Date: Wed, 22 Nov 2023 01:53:13 +0100 Message-ID: In-Reply-To: =?utf-8?q?=3CDB7PR07MB38826A880BE0EDDDA5D6413EBFBBA=40DB7PR07MB?= =?utf-8?q?3882=2Eeurprd07=2Eprod=2Eoutlook=2Ecom=3E?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1045403058==" --===============1045403058== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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.work(a)gmail.com phone: +34669448337 On Tue, Nov 21, 2023 at 2:34=E2=80=AFPM 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=3D'aa157c08df1109c4655ca64d0ed67' found on entry 1431, dir=3D2 > to-tag=3D'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) =3D $msg(fline); > $var(hdrs) =3D $msg(hdrs); > $var(body) =3D $msg(body); > > $var(fline) =3D $(var(fline){s.replace,sips,sip}); > #{s.replace,;transport=3DTLS,}{s.replace,;transport=3Dtls,}); > $var(hdrs) =3D $(var(hdrs){s.replace,sips,sip}); > #{s.replace,;transport=3DTLS,}{s.replace,;transport=3Dtls,}); > $var(body) =3D $(var(body){s.replace,sips,sip}); > #{s.replace,;transport=3DTLS,}{s.replace,;transport=3Dtls,}); > > 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(a)CLIENT-IP;transport=3DTLS SIP/2.0 > Via: SIP/2.0/UDP FREESWITCH-IP:5080;rport;branch=3Dz9hG4bK34FNtg4e31B8K > Route: > Route: > Max-Forwards: 70 > From: ;tag=3D133B764ZS9QvD > To: ;tag=3Ddf6b235d > 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=3D16;text=3D"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: