[SR-Users] is_method not matching message type KDMQ breaking DMQ bus. (master branch)

Charles Chance charles.chance at sipcentric.com
Thu Aug 2 17:11:46 CEST 2018


Hi,

This should fix:

https://github.com/kamailio/kamailio/pull/1611

Please confirm either way.

Cheers,

Charles

On Tue, 31 Jul 2018 at 18:25, Charles Chance <charles.chance at sipcentric.com>
wrote:

> Hello,
>
> I have checked and it is a problem with is_method() not matching "KDMQ"
> (there is no method definition to match when parsing the message first
> line). This is not a DMQ issue specifically, and 'if (method == "KDMQ")'
> works just fine. I'm sure it _used_ to work (in fact, it's documented!) -
> although I may be totally mistaken, since everywhere we use ‘method’.
>
> I will try to see later if something changed anywhere in textops or core,
> but in the meantime I suggest using ‘method’ for now.
>
> Cheers,
>
> Charles
>
>
> On 31 July 2018 at 18:08, Joel Serrano <joel at textplus.com> wrote:
>
>> Hi Asgaroth,
>>
>> I'm using dmq and I haven't seen a msg get passed this:
>>
>>     # Handles DMQ messages
>>     if (is_method("KDMQ")) {
>>         dmq_handle_message();
>>     }
>>
>> That said, just to make sure it's not some work-in-progress happening on
>> master branch, give it a try on latest stable release (v5.1.4) to see if
>> you find the same behavior. I haven't tried on master but on v5.1.4 I'm not
>> seeing that behavior.
>>
>> Are you manually replicating stuff using dmq functions or are you taking
>> advantage of auto-replication using modparam enable_dmq=1 on certain
>> modules?
>>
>> Joel.
>>
>>
>>
>>
>> On Tue, Jul 31, 2018 at 9:01 AM, Asgaroth <00asgaroth00 at gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> I've come across and oddity whereby my is_method("KDMQ") checks are not
>>> matching.
>>>
>>> I'm testing with kamailio master:
>>>
>>> version: kamailio 5.2.0-dev6 (x86_64/linux) a16272
>>> flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE,
>>> USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC,
>>> TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT,
>>> USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST,
>>> HAVE_RESOLV_RES
>>> ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024,
>>> BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
>>> poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
>>> id: a16272
>>> compiled on 15:27:21 Jul 31 2018 with gcc 7.3.1
>>>
>>> Sample routing logic:
>>>
>>> request_route {
>>>     route("InitialMessageChecks");
>>>     exit;
>>> }
>>>
>>>
>>> route[InitialMessageChecks] {
>>>     xlog("L_INFO", "Received message type $rm from $si:$sp on $Ri:$Rp");
>>>
>>>     if ( is_method("KDMQ") ) { xlog("L_INFO", "KDMQ check passed."); }
>>>     if ( is_method("OPTIONS") ) { xlog("L_INFO", "OPTIONS check
>>> passed."); }
>>>     if ( is_method("SUBSCRIBE") ) { xlog("L_INFO", "SUBSCRIBE check
>>> passed."); }
>>>
>>> }
>>>
>>> In the logs I am only receiving the 1st log line in the initial message
>>> checks route for message types of KDMQ, eg:
>>>
>>> INFO: <script>: Received message KDMQ from 1.1.1.1:5060 on 1.1.1.2:5060
>>> INFO: <script>: Received message KDMQ from 1.1.1.3:5060 on 1.1.1.2:5060
>>>
>>> I never seem to hit the is_method check log line when the method type is
>>> KDMQ.
>>>
>>> I do see the options/subscribe logs though:
>>>
>>> INFO: <script>: OPTIONS check passed.
>>> INFO: <script>: SUBSCRIBE check passed.
>>>
>>> nothing for KDMQ.
>>>
>>> Reason for asking is: this check never matches and breaks the dmq bus:
>>>
>>> if ( is_method("KDMQ") ) {
>>>     if ( dmq_is_from_node() ) {
>>>         dmq_handle_message();
>>>         exit;
>>>     } else {
>>>         exit;
>>>     }
>>> }
>>>
>>> Any thoughts, or am I going crazy :)
>>>
>>> Thanks
>>>
>>>
>>> _______________________________________________
>>> Kamailio (SER) - Users Mailing List
>>> sr-users at lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>
>
> --
> *Charles Chance*
> Managing Director
>
> t. 0330 120 1200    m. 07932 063 891
> --
> *Charles Chance*
> Managing Director
>
> t. 0330 120 1200    m. 07932 063 891
>
-- 
*Charles Chance*
Managing Director

t. 0330 120 1200    m. 07932 063 891

-- 
Sipcentric Ltd.
                Company registered in England & Wales no. 
7365592. Registered
                office: Faraday Wharf, Innovation 
Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180802/bbd2f23f/attachment.html>


More information about the sr-users mailing list