From 20706e20a1615c4cd7bd9fad2e8d458fac0ba86f Mon Sep 17 00:00:00 2001 From: Sebastian Damm Date: Fri, 12 May 2017 16:13:23 +0200 Subject: [PATCH] rabbitmq: create reply-to queue w/ exclusive param RabbitMQ docs say, temporary reply-to queues should be created with an "exclusive" parameter. This allows only the current connection to access the queue, and when the connection ends, the queue will automatically be deleted. --- src/modules/rabbitmq/rabbitmq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/rabbitmq/rabbitmq.c b/src/modules/rabbitmq/rabbitmq.c index 7f9fc12ce07..806dfc9fd42 100644 --- a/src/modules/rabbitmq/rabbitmq.c +++ b/src/modules/rabbitmq/rabbitmq.c @@ -350,7 +350,7 @@ static int rabbitmq_publish_consume(struct sip_msg* msg, char* in_exchange, char // alloc reply_to queue if (direct_reply_to == 1) { - reply_to = amqp_queue_declare(conn, 1, amqp_cstring_bytes("amq.rabbitmq.reply-to"), 0, 0, 0, 1, amqp_empty_table); + reply_to = amqp_queue_declare(conn, 1, amqp_cstring_bytes("amq.rabbitmq.reply-to"), 0, 0, 1, 1, amqp_empty_table); } else { uuid_generate_random(uuid); uuid_unparse(uuid, uuid_buffer); @@ -358,7 +358,7 @@ static int rabbitmq_publish_consume(struct sip_msg* msg, char* in_exchange, char strcpy(reply_to_buffer, "kamailio-"); strcat(reply_to_buffer, uuid_buffer); - reply_to = amqp_queue_declare(conn, 1, amqp_cstring_bytes(reply_to_buffer), 0, 0, 0, 1, amqp_empty_table); + reply_to = amqp_queue_declare(conn, 1, amqp_cstring_bytes(reply_to_buffer), 0, 0, 1, 1, amqp_empty_table); } if (log_on_amqp_error(amqp_get_rpc_reply(conn), "amqp_queue_declare()") != AMQP_RESPONSE_NORMAL) {