Module: kamailio Branch: master Commit: c65f63934b294f39becc383f0482354c00fd9806 URL: https://github.com/kamailio/kamailio/commit/c65f63934b294f39becc383f0482354c...
Author: lazedo luis.azedo@factorlusitano.com Committer: lazedo luis.azedo@factorlusitano.com Date: 2017-05-04T15:53:17+01:00
kazoo: split exchange/queue declarations
---
Modified: src/modules/kazoo/kz_amqp.c
---
Diff: https://github.com/kamailio/kamailio/commit/c65f63934b294f39becc383f0482354c... Patch: https://github.com/kamailio/kamailio/commit/c65f63934b294f39becc383f0482354c...
---
diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c index 4664c25..f7fc8c1 100644 --- a/src/modules/kazoo/kz_amqp.c +++ b/src/modules/kazoo/kz_amqp.c @@ -1848,8 +1848,17 @@ int kz_amqp_subscribe(struct sip_msg* msg, char* payload) routing = kz_amqp_routing_new(""); }
- exchange = kz_amqp_exchange_from_json(&exchange_s, json_obj); - queue = kz_amqp_queue_from_json(&queue_s, json_obj); + tmpObj = kz_json_get_object(json_obj, "exchange-def"); + if(tmpObj == NULL) { + tmpObj = json_obj; + } + exchange = kz_amqp_exchange_from_json(&exchange_s, tmpObj); + + tmpObj = kz_json_get_object(json_obj, "queue-def"); + if(tmpObj == NULL) { + tmpObj = json_obj; + } + queue = kz_amqp_queue_from_json(&queue_s, tmpObj);
kz_amqp_bind_ptr bind = kz_amqp_bind_alloc(exchange, exchange_binding, queue, routing, event_key, event_subkey); if(bind == NULL) {