Browse code

dmq: force to send replicated messages from configured server address - as reported on list by Victor Kustov

Charles Chance authored on 13/11/2014 18:30:34
Showing 1 changed files
... ...
@@ -383,6 +383,7 @@ error:
383 383
 int cfg_dmq_t_replicate(struct sip_msg* msg, char* s)
384 384
 {
385 385
 	dmq_node_t* node;
386
+	struct socket_info* sock;
386 387
 	int i = 0;
387 388
 
388 389
 	/* avoid loops - do not replicate if message has come from another node
... ...
@@ -394,6 +395,12 @@ int cfg_dmq_t_replicate(struct sip_msg* msg, char* s)
394 395
 		return -1;
395 396
 	}
396 397
 
398
+	/* TODO - backup/restore original send socket */
399
+	sock = lookup_local_socket(&dmq_server_socket);
400
+	if (sock) {
401
+		set_force_socket(msg, sock);
402
+	}
403
+
397 404
 	lock_get(&node_list->lock);
398 405
 	node = node_list->nodes;
399 406
 	while(node) {