[OpenSIPS-Devel] Full Sharing N Contact Pings problem

John Quick john.quick at smartvox.co.uk
Fri Jan 11 13:08:08 EST 2019


I am almost certain I have found a bug in the mechanism that should
distribute the pinging of NAT'd devices around cluster members.
I tested this extensively several months ago and it worked fine. That was
using v2.4.0
Now, when using 2.4.4 I noticed it was pinging from every node in the
cluster to the same NAT'd device.

I am using Docker so it was very easy for me to revert to earlier versions
of OpenSIPS with complete certainty that nothing else is different, although
I only have Docker images for v2.4.0, 2.4.3 and 2.4.4. The results of my
testing, with just one NAT'd device registered, are:

v2.4.0   Pings only coming from one node
v2.4.3   Pings from every node
v2.4.4   Pings from every node

So either there was a bug introduced between 2.4.0 and 2.4.3 OR something
was changed in the clustering configuration requirements. I could not see
anything relevant in the documentation so I assume this is a bug.

John Quick
Smartvox Limited


The topology/architecture I am using is an edge proxy in front of a 3-node
cluster to handle registrations, NAT pings and call routing, using path
headers. For reference, here are some code snippets from the opensips.cfg
file on one of the nodes:

listen=udp:0.0.0.0:5060
listen=bin:0.0.0.0:5678
advertised_address=10.2.69.152

modparam("usrloc", "working_mode_preset", "full-sharing-cluster")
modparam("usrloc", "location_cluster", 1)
modparam("usrloc", "use_domain", 0)
modparam("usrloc", "nat_bflag", "NATTED_CLIENT")
modparam("usrloc", "timer_interval", 61)
modparam("usrloc", "max_contact_delete", 40)

modparam("nathelper", "received_avp", "$avp(rcvip)")
modparam("nathelper", "natping_interval", 38)
modparam("nathelper", "ping_nated_only", 0)
modparam("nathelper", "sipping_bflag", "NAT_SIP_PINGS")
modparam("nathelper", "sipping_from", "sip:pinger at 10.2.69.152")

modparam("clusterer", "db_url",
"mysql://myuser:mypasswd@localhost/opensips")
modparam("clusterer", "current_id", 1)
modparam("clusterer", "node_timeout", 180)


        if (isflagset(NATTED_SRC) || isflagset(NATTED_UA)) {
            # For calls to this user, INVITEs will have branch flag
NATTED_CLIENT set after lookup("location")
            setbflag(NATTED_CLIENT);
            # Enables OPTIONS natpings
            setbflag(NAT_SIP_PINGS);
        };

        consume_credentials();

        if (!save("location","p1")) {
            xlog("L_NOTICE", "***--REGISTER: location save failed for
$ct.fields(uri)\n");
            sl_reply_error();
        }

# opensipsctl ul show
Domain:: location hash_size=512
        AOR:: 221223
                Contact:: sip:221223 at 192.168.0.60:6050;line=9lixrwuy Q=1
                        ContactID:: 4002222325104642950
                        Expires:: 1452
                        Callid:: 3c2692a7dce1-xakltdxtx1vq
                        Cseq:: 22
                        User-agent:: snom360/7.3.30
                        Path::
<sip:mysbc at 10.2.69.151;lr;received=sip:82.0.128.109:16238>
                        State:: CS_NEW
                        Flags:: 0
                        Cflags:: NAT_SIP_PINGS NATTED_CLIENT
                        Socket:: udp:0.0.0.0:5060
                        Methods:: 7999

insert into
opensips.clusterer(`cluster_id`,`node_id`,`url`,`no_ping_retries`,`priority`
,`flags`,`description`) values
(1,1,'bin:10.2.69.152:5678',3,50,'seed','reg1');
insert into
opensips.clusterer(`cluster_id`,`node_id`,`url`,`no_ping_retries`,`priority`
,`description`) values (1,2,'bin:10.2.69.153:5678',3,50,'reg2');
insert into
opensips.clusterer(`cluster_id`,`node_id`,`url`,`no_ping_retries`,`priority`
,`description`) values (1,3,'bin:10.2.69.154:5678',3,50,'reg3');





More information about the Devel mailing list