[sr-dev] DMQ: seems broken logic

Charles Chance charles.chance at sipcentric.com
Wed Oct 15 20:36:16 CEST 2014


Hi Daniel,

On 15 October 2014 14:51, Daniel-Constantin Mierla <miconda at gmail.com>
wrote:

>  Hello,
>
> one thing I wanted to add -- it may be good to backup the old value of the
> sock and restore it later.
>
>
Thanks - I had that in mind already.


> I am not sure if this is used in a context of a request that is going to
> be forwarded as well to some other address. If yes, then perhaps is it
> safer to backup and restore initial socket value.
>
> Perhaps it needs to check if the transaction exists and if not, create it
> first via tm api, then set the new socket for message and call the
> t_replicate function, not to get the dmq server socket in tm.
>
>
Sorry, I don't fully understand the last part?


Best regards

Charles

Cheers,
> Daniel
>
>
> On 15/10/14 15:41, Charles Chance wrote:
>
> Hi Victor,
>
>  I have now tested with Kamailio/DMQ listening on separate IPs and the
> added forcing of send socket appears to address the broken logic you
> describe.
>
>  So I will commit the change shortly, unless you can see any problem with
> the proposed solution?
>
>  Best regards,
>
>  Charles
>
>
>
> On 13 October 2014 23:04, Charles Chance <charles.chance at sipcentric.com>
> wrote:
>
>> Hi Victor,
>>
>>  Have not had chance to test but can you try with the following small
>> patch (against master):
>>
>>  diff --git a/modules/dmq/dmq_funcs.c b/modules/dmq/dmq_funcs.c
>> index 3c9c8c3..331591f 100644
>> --- a/modules/dmq/dmq_funcs.c
>> +++ b/modules/dmq/dmq_funcs.c
>> @@ -370,6 +370,7 @@ error:
>>  int cfg_dmq_t_replicate(struct sip_msg* msg, char* s)
>>  {
>>         dmq_node_t* node;
>> +       struct socket_info* sock;
>>         int i = 0;
>>
>>          /* avoid loops - do not replicate if message has come from
>> another node
>> @@ -381,6 +382,11 @@ int cfg_dmq_t_replicate(struct sip_msg* msg, char* s)
>>                 return -1;
>>         }
>>
>>  +       sock = lookup_local_socket(&dmq_server_socket);
>> +       if (sock) {
>> +               set_force_socket(msg, sock);
>> +       }
>> +
>>         lock_get(&node_list->lock);
>>         node = node_list->nodes;
>>         while(node) {
>>
>>
>>
>>  Cheers,
>>
>>  Charles
>>
>>
>> On 13 October 2014 14:05, Victor V. Kustov <coyote at bks.tv> wrote:
>>
>>> Hi, Charles
>>>
>>> Main problem - usage t_replicate from TM module. All TM funcs operate
>>> with main kamailio interface and socket, but DMQ interfaces and sockets
>>> needed.
>>>
>>>
>>> --
>>>  WBR, Victor
>>>   JID: coyote at bks.tv
>>>   JID: coyote at bryansktel.ru
>>>
>>> _______________________________________________
>>> sr-dev mailing list
>>> sr-dev at lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>>
>>
>>
>>
>>
>
>
> www.sipcentric.com
>
> Follow us on twitter @sipcentric <http://twitter.com/sipcentric>
>
> Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered
> office: Faraday Wharf, Innovation Birmingham Campus, Holt Street,
> Birmingham Science Park, Birmingham B7 4BB.
>
> _______________________________________________
> sr-dev mailing listsr-dev at lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
>
> --
> Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
>

-- 
www.sipcentric.com

Follow us on twitter @sipcentric <http://twitter.com/sipcentric>

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.sip-router.org/pipermail/sr-dev/attachments/20141015/ab89f2c6/attachment.html>


More information about the sr-dev mailing list