From hw@gilawa.com Tue Nov 21 13:34:29 2023 From: Henning Westerholt To: sr-users@lists.kamailio.org Subject: [SR-Users] Re: sips to sip Date: Tue, 21 Nov 2023 13:34:14 +0000 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1004957899==" --===============1004957899== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi David, at least from the logs the dialog is matched: DEBUG: dialog [dlg_hash.c:885]: internal_get_dlg(): dialog callid=3D'aa157c08= df1109c4655ca64d0ed67' found on entry 1431, dir=3D2 to-tag=3D'ZDDN09pNH37XB' DEBUG: dialog [dlg_profile.c:541]: set_current_dialog(): setting current dial= og [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 chan= ged 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 ex= ample 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,;trans= port=3DTLS,}{s.replace,;transport=3Dtls,}); $var(hdrs) =3D $(var(hdrs){s.replace,sips,sip}); #{s.replace,;transpo= rt=3DTLS,}{s.replace,;transport=3Dtls,}); $var(body) =3D $(var(body){s.replace,sips,sip}); #{s.replace,;transpo= rt=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, RE= FER, 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 s= cripts... ERROR: