[OpenSIPS-Users] Clustering Presence opensips 3.2/3.3 in K8s environment

Bogdan-Andrei Iancu bogdan at opensips.org
Mon May 2 14:25:12 UTC 2022


Hi Jonathan,

If you set log level to 4 (DBG), do you see any logs when the pinging 
should be attempted ?

Best Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS eBootcamp 23rd May - 3rd June 2022
   https://opensips.org/training/OpenSIPS_eBootcamp_2022/

On 4/27/22 12:30 AM, Jonathan Hunter wrote:
>
> Hi Bogdan.
>
> Just to follow up I have been trying to make openSIPS send SIP options 
> in the same environment to websocket registered users, and I just cant 
> get it to send even though the branch flags are set.
>
> I now have these settings defined for NAThelper;
>
> loadmodule "nathelper.so"
>
> modparam("nathelper", "natping_interval", 10)
>
> modparam("nathelper", "ping_nated_only", 0)
>
> modparam("nathelper", "sipping_method", "OPTIONS")
>
> modparam("nathelper", "sipping_bflag", "SIPPING_ENABLE")
>
> modparam("nathelper", "sipping_from", "sip:pinger@<domain>")
>
> modparam("nathelper", "received_avp", "$avp(rcv)")
>
> modparam("nathelper", "ping_threshold", 5)
>
> modparam("nathelper", "max_pings_lost", 3)
>
> modparam("nathelper", "natping_partitions", 4)
>
> modparam("nathelper", "remove_on_timeout_bflag", "SIPPING_RTO")
>
> modparam("nathelper", "natping_tcp", 1)
>
> modparam("nathelper", "cluster_id", 1)
>
> modparam("nathelper", "cluster_sharing_tag", "node/2=active")
>
> Also have pinging_mode set for usrloc, and this is in a 
> federation-cachedb-cluster with 2 opensips containers running 
> active/active.
>
> If I use t_new_request I can send a SIP OPTIONS message out, so I 
> assume I am missing a parameter or its mis configuration? Or could it 
> be environment, this is a k8s setup.
>
> Any advice/tips would be great.
>
> Thank you .
>
> Jon
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for 
> Windows
>
> *From: *Jonathan Hunter <mailto:hunterj91 at hotmail.com>
> *Sent: *25 April 2022 15:28
> *To: *Bogdan-Andrei Iancu <mailto:bogdan at opensips.org>; OpenSIPS users 
> mailling list <mailto:users at lists.opensips.org>
> *Subject: *Re: [OpenSIPS-Users] Clustering Presence opensips 3.2/3.3 
> in K8s environment
>
> Hi Bogdan,
>
> Thank you for the reply I can see there are tcp connections but I 
> don’t seem to get anything. I assume it may well be k8s related?.
>
> I also cant seem to get NAT ping working, I assume this should work 
> out to websocket connections as long as flags are set?
>
> The outputs are;
>
>   "ID": 1317975555,
>
>             "Type": "ws",
>
>             "State": 0,
>
>             "Remote": "10.10.51.228:35462",
>
>             "Local": "10.10.2.91:8081",
>
>             "Lifetime": "2022-04-25 14:11:31",
>
>             "Alias port": 35462
>
>         }
>
>     ]
>
> And location shows;
>
> "AORs": [
>
>                 {
>
>                     "AOR": "61067470a372a031a7495a1a@<DOMAIN>",
>
>                     "Contacts": [
>
>                         {
>
>                             "Contact": 
> "sip:c0r0d0i7 at b0ek39eabrvf.invalid;transport=wss",
>
>                             "ContactID": "4544061655272656153",
>
>                             "Expires": 519,
>
>                             "Q": "",
>
>                             "Callid": "jbbvtjp2l7bujcom73s3",
>
>                             "Cseq": 2,
>
>                             "User-agent": "SIP.js/0.20.0",
>
>                             "Received": 
> "sip:10.10.51.228:35462;transport=ws",
>
>                             "State": "CS_NEW",
>
>                             "Flags": 0,
>
>                             "Cflags": "WS_DEVICE SIPPING_RTO 
> SIPPING_ENABLE",
>
>                             "Socket": "ws:<PUBLIC_IP>:8081",
>
>                             "Methods": 5439
>
>                         }
>
>                     ]
>
>                 }
>
>             ]
>
> However I cant seem to also get opensips to send SIP keepalive with 
> these settings;
>
> #### NAThelper module
>
> loadmodule "nathelper.so"
>
> modparam("nathelper", "received_avp", "$avp(rcv)")
>
> modparam("nathelper", "natping_tcp",1)
>
> modparam("nathelper", "natping_interval", 5)
>
> modparam("nathelper", "sipping_bflag", "SIPPING_ENABLE")
>
> modparam("nathelper", "remove_on_timeout_bflag", "SIPPING_RTO")
>
> modparam("nathelper", "sipping_from", "sip:pinger at DOMAIN")
>
> modparam("nathelper", "max_pings_lost", 2)
>
> modparam("nathelper", "cluster_id", 9)
>
> modparam("nathelper", "cluster_sharing_tag", "node/2=active")
>
> Am I missing something here?
>
> Many thanks
>
> Jon
>
> Sent from Mail 
> <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=05%7C01%7C%7C5f60e807488b4d6ea4d808da26c7ce66%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637864936873242045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YMJHNUhsr8ZgxUJ4o5gqoqgQ7iibcDmc5tDsnUISgzk%3D&reserved=0> 
> for Windows
>
> *From: *Bogdan-Andrei Iancu <mailto:bogdan at opensips.org>
> *Sent: *18 April 2022 13:59
> *To: *OpenSIPS users mailling list <mailto:users at lists.opensips.org>; 
> Jonathan Hunter <mailto:hunterj91 at hotmail.com>
> *Subject: *Re: [OpenSIPS-Users] Clustering Presence opensips 3.2/3.3 
> in K8s environment
>
> Hi Jonathan,
>
> Maybe the k8s layer (the ingress ??) sticks its tails in there - could 
> you check at opensips level if the TCP conn is still seen as up ? Use 
> the mi list_tcp_conns MI function
> https://www.opensips.org/Documentation/Interface-CoreMI-3-2#toc4 
> <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.opensips.org%2FDocumentation%2FInterface-CoreMI-3-2%23toc4&data=05%7C01%7C%7C5f60e807488b4d6ea4d808da26c7ce66%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637864936873242045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DaErQEB7DGSLVwpPR3HwQVrHx1g7RUR9r%2Bc6AV6A%2BFU%3D&reserved=0>
>
>
> Best regard,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
>    https://www.opensips-solutions.com  <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.opensips-solutions.com%2F&data=05%7C01%7C%7C5f60e807488b4d6ea4d808da26c7ce66%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637864936873242045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=d5VsC%2FRMENJY5m57ENjK2sKxvRdkF9JoH%2FLOfwiEes8%3D&reserved=0>
> OpenSIPS eBootcamp 23rd May - 3rd June 2022
>    https://opensips.org/training/OpenSIPS_eBootcamp_2022/  <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fopensips.org%2Ftraining%2FOpenSIPS_eBootcamp_2022%2F&data=05%7C01%7C%7C5f60e807488b4d6ea4d808da26c7ce66%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637864936873242045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=%2FGY1N1i45n0icTFg2%2BlUufXx8BtfR%2F0C73ZO72GfW60%3D&reserved=0>
>
> On 4/13/22 6:08 PM, Jonathan Hunter wrote:
>
>     Hi All,
>
>     Has anyone managed to get presence working when using an
>     active/active opensips setup with k8s ?
>
>     Everything works apart from presence, In particular when a
>     websocket user disconnects due to a client crash.
>
>     I ideally would want to use event_route[E_CORE_TCP_DISCONNECT] to
>     then grab the disconnect when it comes in via websockets/tcp,
>     however I cant seem to get it to trigger. Could this be due to the
>     underlying hooks OpenSIPS uses to interact with with OS with TCP
>     or something else?
>
>     As I would use the event route, to then remove the registration
>     from the location table, as otherwise I have duplicate entries in
>     both location and the presentity list.
>
>     Is this something anyone else has encountered?
>
>     I have tried using clustering with both presence and pua and have
>     same issues, whereby after an unwanted disconnect subsequent
>     NOTIFY messages contain more than one id per entity;
>
>     <presence xmlns="urn:ietf:params:xml:ns:pidf"
>     entity="sip:61067470a372a031a7495a1a at domain"
>     <sip:61067470a372a031a7495a1a at domain>>
>
>     <tuple xmlns="urn:ietf:params:xml:ns:pidf"
>     id="0x7ffe75896760"><status><basic>open</basic></status></tuple><tuple
>     xmlns="urn:ietf:params:xml:ns:pidf"
>     id="0x7ffd0716b390"><status><basic>open</basic></status></tuple></presence>
>
>     I need to stop this occurring ideally, any help much appreciated.
>
>     Many thanks
>
>     Jon
>
>     Sent from Mail
>     <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D550986&data=05%7C01%7C%7C5f60e807488b4d6ea4d808da26c7ce66%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637864936873242045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=YMJHNUhsr8ZgxUJ4o5gqoqgQ7iibcDmc5tDsnUISgzk%3D&reserved=0>
>     for Windows
>
>     _______________________________________________
>
>     Users mailing list
>
>     Users at lists.opensips.org  <mailto:Users at lists.opensips.org>
>
>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users  <https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.opensips.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fusers&data=05%7C01%7C%7C5f60e807488b4d6ea4d808da26c7ce66%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637864936873242045%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jJQnvSjbFbr78OBer49%2FNGpMxRqMOR7IG1Fknau5u6o%3D&reserved=0>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20220502/2911f908/attachment-0001.html>


More information about the Users mailing list