Hi, 

as Dilyan mention start small and test and then grow if needed in your config. 

The loop over is for example not needed if you switch on parallel forking. Then you have new issues with correct branch settings to rtpengine. 

And a good idea for webrtc is havfos example 

https://github.com/havfo/WEBRTC-to-SIP

Kind Regards 
Karsten Horsmann 

Дилян Палаузов <dpa-kamailio@bapha.be> schrieb am Di., 9. Mai 2023, 22:41:

Hello,

I suggest to call from WebRTC a non-WebRTC client, talk and then the non-WebRTC client hangs up.  Check if the WebRTC client gets the BYE.

Once this simple scenario works, you can try the more complicated scenario explained by you.

In my experiments the BYE was not received with topoh.  Without topoh it works.


Greetings
  Dilyan
-----Original Message-----
From: shwetank singh <shwetank.singh1@gmail.com>
Reply-To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
To: sr-users@lists.kamailio.org
Subject: [SR-Users] using kamailio to send invite to webrtc clients (with freeswitch)
Date: 05/09/2023 07:22:40 PM

Hello experts

I have a setup where webrtc client registrations (from behind a NAT / VPN) are on kamailio and the INVITE to begin a call is sent by freeswitch to
kamailio which is then expected to relay it to the subscribed webrtc client.

i understand, from documentation and general thinking, that kamailio cannot open a new connection to such a client and should reuse an open connection
(a websocket in my case).

i have setup kamailio as generic as it may sound and expect t_relay() to do the magic of forwarding the invite, however, from logs i don't see
anything indicating kamailio is using any existing connection and hence my outgoing invite requests are stuck showing pointed towards a vpn gateway
which was the registered "location" of client (which is the public ip of VPN gateway)

please advise what relevant information can i produce here to make the query more readable and clear.

headed here after trying just about all the resources available on the topic.

e.g. if my location record looks like

          AoR: 1004@mydomain.com
          Contacts:
          - Contact:
              Address: sip:1004@11.22.33.44:49179
              CFlags: 64
              CSeq: 3087
              Call-ID: 189jss21e24ntve1ggsuli
              Expires: 593
              Flags: 0
              Instance: <urn:uuid:8a936bbc-514f-4755-bed0-edc644dd4453>
              KA-Roundtrip: 0
              Keepalive: 1
              Last-Keepalive: 1683652755
              Last-Modified: 1683652755
              Methods: 7071
              Path: <sip:10.10.6.196:3040;received=sip:mydomain.com;lr;nat=yes>
              Q: -1
              Received: sip:11.22.33.44:49179;transport=ws
              Reg-Id: 1
              Ruid: uloc-645601c4-131220-3764
              Server-Id: 0
              Socket: tls:1.2.3.4:4443
              State: CS_SYNC
              Tcpconn-Id: 3916
              User-Agent: JsSIP 3.9.0

i try to lookup the location and find the address, and then route to that address by setting $ru
in sngrep it does show that kamailio is trying to send INVITE to 11.22.33.44:port (which is the VPN gateway) but it isn't exactly clear from logs if
this is being done over an existing connection.

how does kamailio identify if a connection exists for a user (for each contact in AOR, if multiple contacts exist for a user -- i.e. different browser
sessions?)


 if(reg_fetch_contacts("location", "$ru", "caller")) {
    $var(i) = 0;
    while($var(i) < $(ulc(caller=>count)))
    {
        $ru = $(ulc(caller=>addr)[$var(i)]);
        $var(i) = $var(i) + 1;
        setflag(FLT_DLGINFO);
        dlg_manage();
        t_relay();
    }
  }

--
Shwetank
__________________________________________________________
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:

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