Module: kamailio
Branch: master
Commit: 2475dfa2564346b7c0790012e72cd17a5d9ca7f6
URL:
https://github.com/kamailio/kamailio/commit/2475dfa2564346b7c0790012e72cd17…
Author: Joel Centelles <joel_centellesmartin(a)baxter.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-08-12T13:39:24+02:00
rabbitmq: Enabling rabbitmq_publish for any route and disabling peer
verification
Enabling rabbitmq_publish function on any route so we can send events on reply
reception.
Also disabling peer verification on the TLS handshake if no CA file is
configured.
---
Modified: src/modules/rabbitmq/doc/rabbitmq_admin.xml
Modified: src/modules/rabbitmq/rabbitmq.c
---
Diff:
https://github.com/kamailio/kamailio/commit/2475dfa2564346b7c0790012e72cd17…
Patch:
https://github.com/kamailio/kamailio/commit/2475dfa2564346b7c0790012e72cd17…
---
diff --git a/src/modules/rabbitmq/doc/rabbitmq_admin.xml
b/src/modules/rabbitmq/doc/rabbitmq_admin.xml
index 18bd4676021..8ed436a6bfa 100644
--- a/src/modules/rabbitmq/doc/rabbitmq_admin.xml
+++ b/src/modules/rabbitmq/doc/rabbitmq_admin.xml
@@ -204,7 +204,7 @@ modparam("rabbitmq", "direct_reply_to", 1)
</itemizedlist>
<para>
- This function can be used from REQUEST_ROUTE.
+ This function can be used from any route.
</para>
<example>
diff --git a/src/modules/rabbitmq/rabbitmq.c b/src/modules/rabbitmq/rabbitmq.c
index 94341070508..50d143723e6 100644
--- a/src/modules/rabbitmq/rabbitmq.c
+++ b/src/modules/rabbitmq/rabbitmq.c
@@ -120,7 +120,7 @@ static int rbmq_fixup_free_params(void **param, int param_no)
/* module commands */
static cmd_export_t cmds[] = {
{"rabbitmq_publish", (cmd_function)rabbitmq_publish, 4, fixup_spve_all,
- fixup_free_spve_all, REQUEST_ROUTE},
+ fixup_free_spve_all, ANY_ROUTE},
{"rabbitmq_publish_consume", (cmd_function)rabbitmq_publish_consume, 5,
rbmq_fixup_params, rbmq_fixup_free_params, REQUEST_ROUTE},
{0, 0, 0, 0, 0, 0}};
@@ -597,10 +597,10 @@ static int rabbitmq_connect(amqp_connection_state_t *conn)
}
#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 8
- amqp_ssl_socket_set_verify(amqp_sock, 1);
+ amqp_ssl_socket_set_verify(amqp_sock, (rmq_amqps_ca_file) ? 1 : 0);
#else
- amqp_ssl_socket_set_verify_peer(amqp_sock, 1);
- amqp_ssl_socket_set_verify_hostname(amqp_sock, 1);
+ amqp_ssl_socket_set_verify_peer(amqp_sock, (rmq_amqps_ca_file) ? 1 : 0);
+ amqp_ssl_socket_set_verify_hostname(amqp_sock, (rmq_amqps_ca_file) ? 1 : 0);
#endif
ret = amqp_socket_open(amqp_sock, amqp_info.host, amqp_info.port);