Hello,

one thing I wanted to add -- it may be good to backup the old value of the sock and restore it later.

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.

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@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@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@bks.tv
  JID: coyote@bryansktel.ru

_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev






www.sipcentric.com

Follow us on twitter @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 list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda