From b51c054474f4976eb1f901fb9cb1d0e93eb1319f Mon Sep 17 00:00:00 2001 From: William King Date: Wed, 8 Apr 2015 16:04:00 -0700 Subject: [PATCH] FS-7060 add configuration of the amqp command binding key --- conf/vanilla/autoload_configs/amqp.conf.xml | 1 + src/mod/event_handlers/mod_amqp/mod_amqp_command.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/conf/vanilla/autoload_configs/amqp.conf.xml b/conf/vanilla/autoload_configs/amqp.conf.xml index 06bbb0d395..ccc81f51fd 100644 --- a/conf/vanilla/autoload_configs/amqp.conf.xml +++ b/conf/vanilla/autoload_configs/amqp.conf.xml @@ -49,6 +49,7 @@ + diff --git a/src/mod/event_handlers/mod_amqp/mod_amqp_command.c b/src/mod/event_handlers/mod_amqp/mod_amqp_command.c index 48eec1da1e..6299b7a656 100644 --- a/src/mod/event_handlers/mod_amqp/mod_amqp_command.c +++ b/src/mod/event_handlers/mod_amqp/mod_amqp_command.c @@ -86,7 +86,7 @@ switch_status_t mod_amqp_command_create(char *name, switch_xml_t cfg) switch_xml_t params, param, connections, connection; switch_threadattr_t *thd_attr = NULL; switch_memory_pool_t *pool; - char *exchange = NULL; + char *exchange = NULL, *binding_key = NULL; if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { goto err; @@ -120,13 +120,16 @@ switch_status_t mod_amqp_command_create(char *name, switch_xml_t cfg) profile->reconnect_interval_ms = interval; } } else if (!strncmp(var, "exchange", 8)) { - exchange = switch_core_strdup(profile->pool, "TAP.Commands"); + exchange = switch_core_strdup(profile->pool, val); + } else if (!strncmp(var, "binding_key", 11)) { + binding_key = switch_core_strdup(profile->pool, val); } } } /* Handle defaults of string types */ profile->exchange = exchange ? exchange : switch_core_strdup(profile->pool, "TAP.Commands"); + profile->binding_key = binding_key ? binding_key : switch_core_strdup(profile->pool, "commandBindingKey"); if ((connections = switch_xml_child(cfg, "connections")) != NULL) { for (connection = switch_xml_child(connections, "connection"); connection; connection = connection->next) {