Hi Aleksandar,


On 1 July 2018 at 07:08, Aleksandar Sosic <alex.sosic@evosip.cloud> wrote:
Hi everyone,

so adding some xlogs We've managed to find out what's happening.
The request route was using:
```
  if(is_method("KDMQ")){
```
but this if was never triggered(!?)
We changed that to
```
  if($rm == "KDMQ"){
```
And now it's working.

So why is that? In the documentation there's an example with is_method:
https://kamailio.org/docs/modules/5.2.x/modules/dmq.html#dmq.f.dmq_handle_message
and I can recall it working a month ago.


Either way should work - there should be no difference between them. We are using is_method everywhere and it works just fine.

Everything is working except for this message:
```25(42) ERROR: dmq [notification_peer.c:596]:
notification_resp_callback_f(): deleting server sip:127.0.0.1:5060
because of failed request```
And that's because of the notification address on the kamailio node we
use as DMQ server

 
I suspect setting localhost as the notification address is causing you some problems - it's certainly not supported and although I've not tested it, it wouldn't surprise me if this has something to do with your earlier issue.

You do not, in fact, need to maintain a dedicated node who's only role is "DMQ server" as you have described it. I would recommend removing it completely and allowing your other nodes to discover/communicate between themselves.
 
This portion of DMQ documentation says that `Default value is "NULL".`
for the notification_address:
https://kamailio.org/docs/modules/5.2.x/modules/dmq.html#dmq.p.notification_address
But with NULL or NOT specifying a value kamailio does not start.
Am I misunderstanding the documentation? Could this be a feature
request or it's a bug?

Omitting the notification address should not cause an issue - what error do you see in your log when it fails to start? If you get rid of the "DMQ server' node as suggested above, though, this should be a none-issue.


In a situation like our where kamailio nodes start and stop on demand
without any prior defined topology or IP addresses defined it's hard
to use DMQ module like that. That's why we introduced a DMQ server
with a fixed IP address that it's handling only those packets (but
it's a workaround).

So my next question is:
Do you guys have an idea on how could we handle DMQ on a very
mutational infrastructure? 

Example: I have 2 kamailio nodes in the begining (no fixed IPs - using
DHCP), then when there's demand the infrastructure starts another 2
nodes, now I have 4 of them, then 3, one of the nodes randomly is
stopped.
And I want to use DMQ on these node to propagate information without
using a DB. How could we do that?

Use multi_notify - https://www.kamailio.org/docs/modules/stable/modules/dmq.html#dmq.p.multi_notify

If nodes are being added/removed dynamically then you'll probably also want to employ some kind of service discovery mechanism, e.g. consul.


Also another thing that we noticed is that the last node to be added
is the one with no prior information regarding usrloc for example, it
has only the changes happening from when it starts on. Could there be
a method or modparam flag to force dmq sync of all the information
upon the startup of another node (another possible feature request)?


See sync parameter - https://www.kamailio.org/docs/modules/stable/modules/dmq_usrloc.html#usrloc_dmq.p.sync

Cheers,

Charles


Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.