<div dir="ltr">Hi <span style="font-size:12.800000190734863px">Aleksandar,</span><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 July 2018 at 07:08, Aleksandar Sosic <span dir="ltr"><<a href="mailto:alex.sosic@evosip.cloud" target="_blank">alex.sosic@evosip.cloud</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi everyone,<br>
<br>
so adding some xlogs We've managed to find out what's happening.<br>
The request route was using:<br>
```<br>
  if(is_method("KDMQ")){<br>
```<br>
but this if was never triggered(!?)<br>
We changed that to<br>
```<br>
  if($rm == "KDMQ"){<br>
```<br>
And now it's working.<br>
<br>
So why is that? In the documentation there's an example with is_method:<br>
<a href="https://kamailio.org/docs/modules/5.2.x/modules/dmq.html#dmq.f.dmq_handle_message" rel="noreferrer" target="_blank">https://kamailio.org/docs/<wbr>modules/5.2.x/modules/dmq.<wbr>html#dmq.f.dmq_handle_message</a><br>
and I can recall it working a month ago.<br>
<br></blockquote><div><br></div><div>Either way should work - there should be no difference between them. We are using is_method everywhere and it works just fine.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
Everything is working except for this message:<br>
```25(42) ERROR: dmq [notification_peer.c:596]:<br>
<span class="gmail-">notification_resp_callback_f()<wbr>: deleting server sip:<a href="http://127.0.0.1:5060" rel="noreferrer" target="_blank">127.0.0.1:5060</a><br>
</span>because of failed request```<br>
And that's because of the notification address on the kamailio node we<br>
use as DMQ server<br>
<br></blockquote><div> </div><div>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.</div><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
This portion of DMQ documentation says that `Default value is "NULL".`<br>
for the notification_address:<br>
<a href="https://kamailio.org/docs/modules/5.2.x/modules/dmq.html#dmq.p.notification_address" rel="noreferrer" target="_blank">https://kamailio.org/docs/<wbr>modules/5.2.x/modules/dmq.<wbr>html#dmq.p.notification_<wbr>address</a><br>
But with NULL or NOT specifying a value kamailio does not start.<br>
Am I misunderstanding the documentation? Could this be a feature<br>
request or it's a bug?<br></blockquote><div><br></div><div>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.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
In a situation like our where kamailio nodes start and stop on demand<br>
without any prior defined topology or IP addresses defined it's hard<br>
to use DMQ module like that. That's why we introduced a DMQ server<br>
with a fixed IP address that it's handling only those packets (but<br>
it's a workaround).<br>
<br>
So my next question is:<br>
Do you guys have an idea on how could we handle DMQ on a very<br>
mutational infrastructure? </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
Example: I have 2 kamailio nodes in the begining (no fixed IPs - using<br>
DHCP), then when there's demand the infrastructure starts another 2<br>
nodes, now I have 4 of them, then 3, one of the nodes randomly is<br>
stopped.<br>
And I want to use DMQ on these node to propagate information without<br>
using a DB. How could we do that?<br></blockquote><div><br></div><div>Use multi_notify - <a href="https://www.kamailio.org/docs/modules/stable/modules/dmq.html#dmq.p.multi_notify">https://www.kamailio.org/docs/modules/stable/modules/dmq.html#dmq.p.multi_notify</a></div><div><br></div><div>If nodes are being added/removed dynamically then you'll probably also want to employ some kind of service discovery mechanism, e.g. consul.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<br>
Also another thing that we noticed is that the last node to be added<br>
is the one with no prior information regarding usrloc for example, it<br>
has only the changes happening from when it starts on. Could there be<br>
a method or modparam flag to force dmq sync of all the information<br>
upon the startup of another node (another possible feature request)?<br>
<br></blockquote><div><br></div><div>See sync parameter - <a href="https://www.kamailio.org/docs/modules/stable/modules/dmq_usrloc.html#usrloc_dmq.p.sync">https://www.kamailio.org/docs/modules/stable/modules/dmq_usrloc.html#usrloc_dmq.p.sync</a></div><div><br></div><div>Cheers,</div><div><br></div><div>Charles</div><div><br></div></div>
</div></div>

<br>
<div><font color="gray" style="font-size:10pt;font-family:Helvetica,Arial,sans-serif">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font><span style="font-size:10pt;font-family:Helvetica,Arial,sans-serif"> </span><font color="gray" style="font-size:10pt;font-family:Helvetica,Arial,sans-serif">Registered
                office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.</font></div>