Hi John. Thanks for your help.
Also there is a strange thing that when we receive ACK. Basically, we dispatch our ACK by doing a lookup location but the thing is, when we log the $du, destination is the Kamailio domain, should not be it the user's IP? But in Wireshark we can see PrivateFreeSwitchIP (Source) PrivateKamailioIP (Destination) SIP (Protocol) Request: ACK sip:usernameA@PrivateKamailioIP;transport=ws | (info) (edited)
Could you also explain please where exactly should be KSR.rr.record_route_preset? in our ksr_route_dispatch?
2024-05-02T14:35:52.878225+00:00 ip-private-ip /usr/local/kamailio-5.8/sbin/kamailio[136069]: ERROR: <core> [core/kemi.c:97]: sr_kemi_core_err(): WITHIN DLG 2024-05-02T14:35:52.878307+00:00 ip-private-ip /usr/local/kamailio-5.8/sbin/kamailio[136069]: ERROR: <core> [core/kemi.c:97]: sr_kemi_core_err(): HAS TO TAG 2024-05-02T14:35:52.878341+00:00 ip-private-ip /usr/local/kamailio-5.8/sbin/kamailio[136069]: ERROR: <core> [core/kemi.c:97]: sr_kemi_core_err(): ACK RECEIVED! 2024-05-02T14:35:52.878359+00:00 ip-private-ip /usr/local/kamailio-5.8/sbin/kamailio[136069]: ERROR: <core> [core/kemi.c:97]: sr_kemi_core_err(): ALERT: WITHIN KSR ROUTE DISPATCH FUNCTION 2024-05-02T14:35:52.878380+00:00 ip-private-ip /usr/local/kamailio-5.8/sbin/kamailio[136069]: INFO: <core> [core/kemi.c:153]: sr_kemi_core_log(): 
Debugging - Source IP: PUBLIC_FREESWITCH_IP, Source Port: 5080 2024-05-02T14:35:52.878403+00:00 ip-private-ip /usr/local/kamailio-5.8/sbin/kamailio[136069]: INFO: <core> [core/kemi.c:153]: sr_kemi_core_log(): 
Debugging - Destination IP: None, Destination Port: 443 2024-05-02T14:35:52.878423+00:00 ip-private-ip /usr/local/kamailio-5.8/sbin/kamailio[136069]: INFO: <core> [core/kemi.c:153]: sr_kemi_core_log(): Match found 2024-05-02T14:35:52.878468+00:00 ip-private-ip /usr/local/kamailio-5.8/sbin/kamailio[136069]: ERROR: <core> [core/kemi.c:97]: sr_kemi_core_err(): 
ALERT: Updated request domain $du to sip:kamailio.domain.com:443;transport=ws;r2=on;lr=on 2024-05-02T14:35:52.878488+00:00 ip-private-ip /usr/local/kamailio-5.8/sbin/kamailio[136069]: ERROR: <core> [core/kemi.c:97]: sr_kemi_core_err(): 
ALERT: Updated request domain $ru to sip:kamailio.domain.com:443;transport=ws;r2=on;lr=on
Best Regards,
Arseniy

On 2 May 2024, at 16:29, Who AmI <myfriendjohn1@gmail.com> wrote:

Hey Arseniy,

I had a similar thing so I tweaked the default config a little. Here is the kemi python bit I use. 

        if KSR.rr.loose_route() > 0:
            if KSR.is_method_in("B"):
                # do accounting ...
                KSR.setflag(FLT_ACC)
                # ... even if the transaction fails
                KSR.setflag(FLT_ACCFAILED)
            elif KSR.is_NOTIFY():
                # Add Record-Route for in-dialog NOTIFY as per RFC 6665.
                KSR.rr.record_route()

            self.ksr_route_relay(msg)
        else:
            if KSR.is_ACK():
                if KSR.tm.t_check_trans() > 0:
                    # no loose-route, but stateful ACK
                    # must be an ACK after a 487
                    # or e.g. 404 from upstream server
                    self.ksr_route_relay(msg)
                else:
                    self.ksr_route_dispatch(msg) # Goes to my dispatcher logic
                return -255

            KSR.sl.sl_send_reply(404, "No request here")
        return -255

I use dispatcher to route between destinations and use double rr params as I sit behind NAT and have private endpoints I route to. 


I also describe the rr params as well as depending on direction (to do NAT traversal.)

So from PBX to Customer - KSR.rr.record_route_preset("PUB_IP" + ";r2=on", "PRIV_IP" + ";r2=on")
And from Customer to PBX - KSR.rr.record_route_preset("PRIV_IP" + ";r2=on", "PUB_IP" + ";r2=on") 

Hope this helps you get it working. 

John. 


On Thu, 2 May 2024 at 12:48, Arseniy Moskvich via sr-users <sr-users@lists.kamailio.org> wrote:
Hi everyone. We are new to Kamailio and using Kamailio 5.8 with FreeSwitch.
We have the issue with the incoming call from our provider. They are dropping after 30 seconds. The client doesn't receive ACK from Kamailio. But FreeSwitch sends ACK to Kamailio. The outbound call is working fine. At the moment flow is our provider -> FreeSwitch -> Kamailio -> our web client. Could someone give us some directions please? Please find attached Kemi.py.
Thank you so much in advance
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe: