[OpenSIPS-Users] need some help using opensips 3.0 cluster module .

Sasmita Panda spanda at 3clogic.com
Wed Jul 17 08:16:53 EDT 2019


I am trying to follow the above link for clustering .  But no success . I
must be doing something wrong .

I have 2 opensips node and using mongo db as cache_db and the cluster
module .  there is a single mongo db in which both the nodes save data .
clusterer table looks like below .
mysql> select * from clusterer;
+----+------------+---------+-----------------------+-------+-----------------+----------+--------------+-------+-------------+
| id | cluster_id | node_id | url                   | state |
no_ping_retries | priority | sip_addr     | flags | description |
+----+------------+---------+-----------------------+-------+-----------------+----------+--------------+-------+-------------+
|  1 |          1 |       1 | bin:172.21.5.95:5555  |     1 |
3 |       50 | 172.21.5.95  | seed  | Node A      |
|  2 |          1 |       2 | bin:172.21.13.73:5555 |     1 |
3 |       50 | 172.21.13.73 | seed  | Node B      |
+----+------------+---------+-----------------------+-------+-----------------+----------+--------------+-------+-------------+

> db.userlocation.find()
{ "_id" : "454545 at opensips.3c.com172.21.x.y", "home_ip" : "172.21.x.y",
"aor" : "454545 at opensips.3c.com" }
{ "_id" : "3344 at opensips.3c.com172.21.x.y", "home_ip" : "172.21.x.y", "aor"
: "3344 at opensips.3c.com" }
call work fine .. both phone are registered through same server .

> db.userlocation.find()
{ "_id" : "454545 at opensips.3c.com172.21.x.y", "home_ip" : "172.21.x.y",
"aor" : "454545 at opensips.3c.com" }
{ "_id" : "3344 at opensips.3c.com172.21.x.x", "home_ip" : "172.21.x.x", "aor"
: "3344 at opensips.3c.com" }
not working . both registered through different server .

   12 3.602658267 219.65.44.210 → 172.21.x.x  SIP/SDP 1064 Request: INVITE
sip:454545 at opensips.3c.com:5508 |
   13 3.603565974  172.21.x.x → 219.65.44.210 SIP 446 Status: 100 Giving a
try |
   14 3.603633107  172.21.x.x → 172.21.x.y SIP/SDP 1231 Request: INVITE
sip:454545 at opensips.3c.com |
   18 4.074865764  172.21.x.x → 172.21.x.y SIP/SDP 1231 Request: INVITE
sip:454545 at opensips.3c.com |
   22 5.018386440  172.21.x.x → 172.21.x.y SIP/SDP 1231 Request: INVITE
sip:454545 at opensips.3c.com |
   29 7.025502596  172.21.x.x → 172.21.x.y SIP/SDP 1231 Request: INVITE
sip:454545 at opensips.3c.com |
   36 8.831041991  172.21.x.x → 172.21.x.y SIP 478 Request: CANCEL
sip:454545 at opensips.3c.com |
   37 9.332232752  172.21.x.x → 172.21.x.y SIP 478 Request: CANCEL
sip:454545 at opensips.3c.com |
   41 10.264532825  172.21.x.x → 172.21.x.y SIP 478 Request: CANCEL
sip:454545 at opensips.3c.com |
   49 12.271423465  172.21.x.x → 172.21.x.y SIP 478 Request: CANCEL
sip:454545 at opensips.3c.com |

I am not getting any error in the logs . How will I solve this ? Please do
help me .

*Thanks & Regards*
*Sasmita Panda*
*Senior Network Testing and Software Engineer*
*3CLogic , ph:07827611765*


On Tue, Jul 9, 2019 at 5:37 PM Vlad Patrascu <vladp at opensips.org> wrote:

> Hi,
>
> I would advise to directly rely on the usrloc module for configuring
> distributed user location, instead of manually scripting this using the
> clusterer script functions.
>
> You can read more about this here:
>
> - usrloc module documentation [1]
>
> - federated user location tutorial [2] - this is for 2.4 but aside from
> syntax changes, the config should be quite similar.
>
> [1]
> https://opensips.org/html/docs/modules/3.0.x/usrloc.html#distributed-sip-user-location
>
> [2]
> https://opensips.org/Documentation/Tutorials-Distributed-User-Location-Federation
>
> Vlad Patrascu
> OpenSIPS Developerhttp://www.opensips-solutions.com
>
> On 07/09/2019 02:08 PM, Sasmita Panda wrote:
>
> Hi ,
>
>
> I have followed the below link while configuring opensips 2.4
>
>
> https://saevolgo.blogspot.com/2018/01/opensips-geo-distributed-clustering.html
>
>
> Is there any document which I can follow for opensips 3.0 also . Please
> let me know or provide any sample config file if possible .
>
> *Thanks & Regards*
> *Sasmita Panda*
> *Senior Network Testing and Software Engineer*
> *3CLogic , ph:07827611765*
>
>
> On Tue, Jul 9, 2019 at 4:27 PM Sasmita Panda <spanda at 3clogic.com> wrote:
>
>> Hi Vlad ,
>>
>> I got that and modified . Thanks for your reply .
>>
>> But I am facing some other problem now . Wherever I have written  xlog to
>> print some user defined logs these logs are not getting printed .  I think
>> I am doing some other mistakes in the config also .
>>
>> Can I get a sample config with cluster module enable for opensips 3.0 ?
>> Earlier I have tested with 2.4 and it was working fine . But lots of things
>> changed in 3.0 and so I am stuck .
>>
>>
>> *Thanks & Regards*
>> *Sasmita Panda*
>> *Senior Network Testing and Software Engineer*
>> *3CLogic , ph:07827611765*
>>
>>
>> On Tue, Jul 9, 2019 at 4:05 PM Vlad Patrascu <vladp at opensips.org> wrote:
>>
>>> Hi Sasmita,
>>>
>>> The actual name of the parameter, as stated in the docs for
>>> E_CLUSTERER_REQ_RECEIVED, is "msg". So you should access it by
>>> *$param(msg)*.
>>>
>>> Regards,
>>>
>>> Vlad Patrascu
>>> OpenSIPS Developerhttp://www.opensips-solutions.com
>>>
>>> On 07/08/2019 02:29 PM, Sasmita Panda wrote:
>>>
>>> event_route[E_CLUSTERER_REQ_RECEIVED]{
>>>         $avp(state) = $(param(rcv_msg){s.select,0,:});
>>>         $avp(user) = $(param(rcv_msg){s.select,1,:});
>>>         $avp(proxy) = $(param(rcv_msg){s.select,2,:});
>>> xlog("L_INFO","[CLUSTER-TALK] {MSG:$avp(rcv_msg)} Sender
>>> Proxy:$avp(proxy) SRC_ID:$avp(source_id) User: $avp(user) State:
>>> $avp(state) ClusterId: $param(cluster_id)\n")
>>>         if($avp(state) =~ "REGOFFLINE") {
>>>                 cache_raw_query("redis:group1","HDEL REGONLINE
>>> $avp(user)");
>>>         }else if($avp(state) =~ "REGONLINE") {
>>>                 cache_raw_query("redis:group1","HSET $avp(state)
>>> $avp(user) $avp(proxy)");
>>>         }else if($avp(state) =~ "WHEREIS") {
>>>                 route(QUERY_LOCAL_CACHE);
>>>         }else if($avp(state) =~ "HACKER"){
>>>                 $avp(useragent) = $avp(user);
>>>                 $avp(hacker_ip) = $avp(proxy);
>>>                 xlog("L_INFO","[CLUSTER-TALK] HACKER IP DETECTED BY
>>> CLUSTER ADDING $avp(hacker_ip) & User-Agent: $(avp(useragent){s.b64decode})
>>> Into Watch-List\n");
>>>
>>>                 cache_raw_query("redis:group1","HSET
>>> HACKER_USERAGENT_LIST $avp(useragent) $avp(hacker_ip)");
>>>                 cache_raw_query("redis:group1","HSET HACKER_IP_LIST
>>> $avp(hacker_ip) $avp(useragent)");
>>>         }
>>>
>>>         exit;
>>> }
>>>
>>> This is giving warning in opensips 3.0  as below .
>>> *WARNING:event_route:event_route_param_get: Parameter <rcv_msg> not
>>> found for event <E_CLUSTERER_REQ_RECEIVED>*
>>>
>>> *             Due to this the data is not getting saved in the
>>> subsequent node in the cluster .  How I will fix this ? *
>>>
>>> *Thanks & Regards*
>>> *Sasmita Panda*
>>> *Senior Network Testing and Software Engineer*
>>> *3CLogic , ph:07827611765*
>>>
>>>
>>> On Thu, Jul 4, 2019 at 5:35 PM Sasmita Panda <spanda at 3clogic.com> wrote:
>>>
>>>> Thank you for your quick response . I resolved it .
>>>>
>>>>
>>>> *Thanks & Regards*
>>>> *Sasmita Panda*
>>>> *Senior Network Testing and Software Engineer*
>>>> *3CLogic , ph:07827611765*
>>>>
>>>>
>>>> On Thu, Jul 4, 2019 at 5:12 PM Liviu Chircu <liviu at opensips.org> wrote:
>>>>
>>>>> Hey Sasmita,
>>>>>
>>>>> I had a similar problem yesterday.  In 3.0, fetch_event_params() was
>>>>> removed, and you are
>>>>> simply supposed to access your params via:
>>>>>
>>>>>   $param(cluster_id), $param(src_id), $param(rcv_msg) and
>>>>> $param(rcv_tag)
>>>>>
>>>>> Liviu Chircu
>>>>> OpenSIPS Developerhttp://www.opensips-solutions.com
>>>>>
>>>>> On 04.07.2019 14:22, Sasmita Panda wrote:
>>>>>
>>>>> Hi All ,
>>>>>
>>>>> Previously I have used cluster module with opensips 2.4 and that was
>>>>> working fine . Now I want to upgrade to opensips 3.0 . And there are lots
>>>>> of parameter get changed in opensips 3.0 .
>>>>>
>>>>> Is there any documentation for cluster module in 3.0 . I need an
>>>>> example for config file which I can use with opensips 3.0 .
>>>>>
>>>>> Now I am facing problem in bellow lines .
>>>>>
>>>>> event_route[E_CLUSTERER_RPL_RECEIVED]{
>>>>>
>>>>> fetch_event_params("$avp(cluster_id);$avp(src_id);$avp(rcv_msg);$avp(rcv_tag)");
>>>>>         $avp(state) = $(avp(rcv_msg){s.select,0,:});
>>>>>         $avp(user) = $(avp(rcv_msg){s.select,1,:});
>>>>>         $avp(proxy) = $(avp(rcv_msg){s.select,2,:});
>>>>>         xlog("L_INFO","[CLUSTER-TALK] Replying Proxy:$avp(proxy) User:
>>>>> $avp(user) State: $avp(state) ClusterId: $avp(cluster_id) TAG:
>>>>> $avp(rcv_tag) \n");
>>>>> }
>>>>>
>>>>> fetch_event_params  this is not present in opensips 3.0 . How I will
>>>>> convert this so that it will support in opensips 3.0. Please do help me .
>>>>>
>>>>>
>>>>> *Thanks & Regards*
>>>>> *Sasmita Panda*
>>>>> *Senior Network Testing and Software Engineer*
>>>>> *3CLogic , ph:07827611765*
>>>>>
>>>>> _______________________________________________
>>>>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>
>>>>> _______________________________________________
>>>>> Users mailing list
>>>>> Users at lists.opensips.org
>>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>>
>>>>
>>>
>>> _______________________________________________
>>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>
>
> _______________________________________________
> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20190717/f97e3e03/attachment-0001.html>


More information about the Users mailing list