mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-18 01:28:42 +00:00
FS-7060 add configuration of the amqp command binding key
This commit is contained in:
parent
0d6c3a1d73
commit
b51c054474
@ -49,6 +49,7 @@
|
|||||||
</connections>
|
</connections>
|
||||||
<params>
|
<params>
|
||||||
<param name="exchange" value="TAP.Commands"/>
|
<param name="exchange" value="TAP.Commands"/>
|
||||||
|
<param name="binding_key" value="commandBindingKey"/>
|
||||||
<param name="reconnect_interval_ms" value="1000"/>
|
<param name="reconnect_interval_ms" value="1000"/>
|
||||||
</params>
|
</params>
|
||||||
</profile>
|
</profile>
|
||||||
|
@ -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_xml_t params, param, connections, connection;
|
||||||
switch_threadattr_t *thd_attr = NULL;
|
switch_threadattr_t *thd_attr = NULL;
|
||||||
switch_memory_pool_t *pool;
|
switch_memory_pool_t *pool;
|
||||||
char *exchange = NULL;
|
char *exchange = NULL, *binding_key = NULL;
|
||||||
|
|
||||||
if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
|
if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
|
||||||
goto err;
|
goto err;
|
||||||
@ -120,13 +120,16 @@ switch_status_t mod_amqp_command_create(char *name, switch_xml_t cfg)
|
|||||||
profile->reconnect_interval_ms = interval;
|
profile->reconnect_interval_ms = interval;
|
||||||
}
|
}
|
||||||
} else if (!strncmp(var, "exchange", 8)) {
|
} 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 */
|
/* Handle defaults of string types */
|
||||||
profile->exchange = exchange ? exchange : switch_core_strdup(profile->pool, "TAP.Commands");
|
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) {
|
if ((connections = switch_xml_child(cfg, "connections")) != NULL) {
|
||||||
for (connection = switch_xml_child(connections, "connection"); connection; connection = connection->next) {
|
for (connection = switch_xml_child(connections, "connection"); connection; connection = connection->next) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user