← Volver al índice de módulos

mqtt

The MQTT module allows bidirectional publish/subscribe communication by connecting Kamailio to a MQTT Broker. Messages can be published from any point in the routing script.
🛠️ Utilidades y Varios Kamailio 6.1 30 parámetros 6 funciones

Descripción general

The MQTT module allows bidirectional publish/subscribe communication by connecting Kamailio to a MQTT Broker. Messages can be published from any point in the routing script. Also the subscriptions can be fully controlled by scripting commands.

Documentación oficial: https://www.kamailio.org/docs/modules/stable/modules/mqtt.html
Código fuente: https://github.com/kamailio/kamailio/tree/master/src/modules/mqtt

Parámetros de configuración

ParámetroTipoDescripción
host str 3.2. port (int) 3.3. keepalive (int) 3.4. id (str) 3.5. username (str) 3.6. password (str) 3.7. will_topic (str) 3.8. will (str) 3.9. event_callback (str) 3.10. ca_file (str) 3.11. ca_path (str) 3.12.
port int 3.3. keepalive (int) 3.4. id (str) 3.5. username (str) 3.6. password (str) 3.7. will_topic (str) 3.8. will (str) 3.9. event_callback (str) 3.10. ca_file (str) 3.11. ca_path (str) 3.12. tls_method (str
keepalive int 3.4. id (str) 3.5. username (str) 3.6. password (str) 3.7. will_topic (str) 3.8. will (str) 3.9. event_callback (str) 3.10. ca_file (str) 3.11. ca_path (str) 3.12. tls_method (str) 3.13. tls_alpn (str
id str 3.5. username (str) 3.6. password (str) 3.7. will_topic (str) 3.8. will (str) 3.9. event_callback (str) 3.10. ca_file (str) 3.11. ca_path (str) 3.12. tls_method (str) 3.13. tls_alpn (str) 3.14. certif
username str 3.6. password (str) 3.7. will_topic (str) 3.8. will (str) 3.9. event_callback (str) 3.10. ca_file (str) 3.11. ca_path (str) 3.12. tls_method (str) 3.13. tls_alpn (str) 3.14. certificate (str) 3.15. pr
password str 3.7. will_topic (str) 3.8. will (str) 3.9. event_callback (str) 3.10. ca_file (str) 3.11. ca_path (str) 3.12. tls_method (str) 3.13. tls_alpn (str) 3.14. certificate (str) 3.15. private_key (str) 3.16
will_topic str 3.8. will (str) 3.9. event_callback (str) 3.10. ca_file (str) 3.11. ca_path (str) 3.12. tls_method (str) 3.13. tls_alpn (str) 3.14. certificate (str) 3.15. private_key (str) 3.16. cipher_list (str) 3.
will str 3.9. event_callback (str) 3.10. ca_file (str) 3.11. ca_path (str) 3.12. tls_method (str) 3.13. tls_alpn (str) 3.14. certificate (str) 3.15. private_key (str) 3.16. cipher_list (str) 3.17. verify_certi
event_callback str 3.10. ca_file (str) 3.11. ca_path (str) 3.12. tls_method (str) 3.13. tls_alpn (str) 3.14. certificate (str) 3.15. private_key (str) 3.16. cipher_list (str) 3.17. verify_certificate (str)
ca_file str 3.11. ca_path (str) 3.12. tls_method (str) 3.13. tls_alpn (str) 3.14. certificate (str) 3.15. private_key (str) 3.16. cipher_list (str) 3.17. verify_certificate (str)
ca_path str 3.12. tls_method (str) 3.13. tls_alpn (str) 3.14. certificate (str) 3.15. private_key (str) 3.16. cipher_list (str) 3.17. verify_certificate (str)
tls_method str 3.13. tls_alpn (str) 3.14. certificate (str) 3.15. private_key (str) 3.16. cipher_list (str) 3.17. verify_certificate (str)
tls_alpn str 3.14. certificate (str) 3.15. private_key (str) 3.16. cipher_list (str) 3.17. verify_certificate (str)
certificate str 3.15. private_key (str) 3.16. cipher_list (str) 3.17. verify_certificate (str)
private_key str 3.16. cipher_list (str) 3.17. verify_certificate (str)
cipher_list str 3.17. verify_certificate (str)
verify_certificate str 3.1. host (str)
host str MQTT Broker IP/Hostname.
port int MQTT Broker port number.
keepalive int The number of seconds after which the broker should send a PING message to the kamailio if no other messages have been exchanged in that time.
id str String to use as the mqtt client id. If NULL, a random client id will be generated.
username str The username to send as a string or NULL to disable authentication.
password str The password to send as a string or NULL to disable authentication.
will_topic str The topic on which to publish the mqtt will.
will str The mqtt will payload to be published.
event_callback str The name of the function in the kemi configuration file (embedded scripting language such as Lua, Python, ...) to be executed instead of event_route[...] blocks.
ca_file str Path to a file containing the PEM encoded trusted CA certificate files.
ca_path str Used to define a directory that contains PEM encoded CA certificates that are trusted. For ca_path to work correctly, the certificates files must have ".pem" as the file ending and you must run "opens
tls_method str The version of the SSL/TLS protocol to use as a string. If NULL, the default value is used. The default value and the available values depend on the version of openssl that libmosquitto was compiled a
tls_alpn str Used to set the TLS ALPN option for cases where one TLS port is used to share multiple services. Prominent example is AWS IoT, where you have to set the tls_alpn to "mqtt" to be able to connect via MQ

Funciones exportadas

mqtt_subscribe(topic, qos)

4.2. mqtt_unsubscribe(topic) 4.3. mqtt_publish(topic, message, qos)

mqtt_unsubscribe(topic)

4.3. mqtt_publish(topic, message, qos)

mqtt_publish(topic, message, qos)

4.1. mqtt_subscribe(topic, qos)

mqtt_subscribe(topic, qos)

Subscribe to the given topic. Mqtt qos levels 0, 1 and 2 can be used.

mqtt_unsubscribe(topic)

Unsubscribe to a previously subscribed topic. The mqtt broker will stop forwarding messages for this topic.

mqtt_publish(topic, message, qos)

Send out a message to a topic with a specified mqtt qos level (0, 1, 2). Again the actual sending is done in a mqtt dispatcher process and will not block the SIP worker.

Autores y contribuidores

Thomas Weber <thomas.weber@pascom.net>Thomas weber <thomas.weber@pascom.net>

Copyright © 2019 Thomas Weber

Módulos relacionados

auth_web3 auth_xkeys avp avpops benchmark blst call_control call_obj