Skip to content

Commit

Permalink
modules: readme files regenerated - modules ... [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
kamailio-dev committed Jul 4, 2022
1 parent 3839eed commit 09e9fa8
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions src/modules/nats/README
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Emmanuel Schmidbauer
4.1. nats_url (str)
4.2. num_publish_workers (int)
4.3. subject_queue_group (str)
4.4. event_callback (str)

5. Functions

Expand All @@ -48,9 +49,10 @@ Emmanuel Schmidbauer
1.1. Set nats_url parameter
1.2. Set num_publish_workers parameter
1.3. Set subject_queue_group parameter
1.4. nats_publish usage
1.5. Example usage of $natsData pseudo variable
1.6. Define the event routes
1.4. Set event_callback parameter
1.5. nats_publish usage
1.6. Example usage of $natsData pseudo variable
1.7. Define the event routes

Chapter 1. Admin Guide

Expand All @@ -68,6 +70,7 @@ Chapter 1. Admin Guide
4.1. nats_url (str)
4.2. num_publish_workers (int)
4.3. subject_queue_group (str)
4.4. event_callback (str)

5. Functions

Expand Down Expand Up @@ -115,6 +118,7 @@ Chapter 1. Admin Guide
4.1. nats_url (str)
4.2. num_publish_workers (int)
4.3. subject_queue_group (str)
4.4. event_callback (str)

4.1. nats_url (str)

Expand Down Expand Up @@ -161,6 +165,24 @@ modparam("nats", "subject_queue_group", "MyQueue1:2021")
modparam("nats", "subject_queue_group", "MyQueue2:2021")
...

4.4. event_callback (str)

Name of the KEMI function to be executed instead of the event route.

Default value is not set.

Example 1.4. Set event_callback parameter
...
modparam("nats", "event_callback", "ksr_nats_event")

-- event callback function implemented in Lua
function ksr_nats_event(evname)
KSR.info("===== nats module received event: " .. evname ..
", data:" .. KSR.pv.gete('$natsData') .. "\n");
return 1;
end
...

5. Functions

5.1. nats_publish(subject, payload)
Expand All @@ -169,7 +191,7 @@ modparam("nats", "subject_queue_group", "MyQueue2:2021")

Publishes the payload to subject.

Example 1.4. nats_publish usage
Example 1.5. nats_publish usage
...
$var(my_info) = "$ci=" + $ci + " $fU=" + $fU;
nats_publish("mysubject", "$var(my_info)"); # publish $var(my_info) to "mysubjec
Expand All @@ -178,7 +200,7 @@ t"

6. Pseudo Variables

Example 1.5. Example usage of $natsData pseudo variable
Example 1.6. Example usage of $natsData pseudo variable
...
xlog("L_INFO", "received payload $natsData");
}
Expand All @@ -191,7 +213,7 @@ t"
received payload. The name of the event-route name must match the
subject of the message.

Example 1.6. Define the event routes
Example 1.7. Define the event routes
...
modparam("nats", "subject_queue_group", "Kamailio-World:2021")
modparam("nats", "subject_queue_group", "MyQueue1:2021")
Expand Down

0 comments on commit 09e9fa8

Please sign in to comment.