]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7060 add configuration of the amqp command binding key
authorWilliam King <william.king@quentustech.com>
Wed, 8 Apr 2015 23:04:00 +0000 (16:04 -0700)
committerWilliam King <william.king@quentustech.com>
Wed, 8 Apr 2015 23:04:00 +0000 (16:04 -0700)
conf/vanilla/autoload_configs/amqp.conf.xml
src/mod/event_handlers/mod_amqp/mod_amqp_command.c

index 06bbb0d39529b07bc554f2ca318dbe04cadab9ba..ccc81f51fd576c89c247ea14094044107b29fd33 100644 (file)
@@ -49,6 +49,7 @@
       </connections>
       <params>
        <param name="exchange" value="TAP.Commands"/>
+       <param name="binding_key" value="commandBindingKey"/>
        <param name="reconnect_interval_ms" value="1000"/>
       </params>
     </profile>
index 48eec1da1e157b064b113cf8f75fec8c00e36134..6299b7a656f69b70113d843924738244ef961158 100644 (file)
@@ -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) {