-
Notifications
You must be signed in to change notification settings - Fork 577
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dde20c1
commit 105d7ce
Showing
14 changed files
with
584 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,14 @@ event_rabbitmq Module | |
1.5.2. connect_timeout (integer) | ||
1.5.3. use_tls (integer) | ||
1.5.4. timeout (integer) | ||
1.5.5. server_id (string) | ||
|
||
1.6. Exported Functions | ||
|
||
1.6.1. rabbitmq_publish(server_id, routing_key, | ||
message [, [content_type [, headers, | ||
headers_vals]]]) | ||
|
||
1.7. Example | ||
1.8. Installation and Running | ||
|
||
|
@@ -49,9 +55,11 @@ event_rabbitmq Module | |
1.2. Setting the connect_timeout parameter | ||
1.3. Set the use_tls parameter | ||
1.4. Set the timeout parameter | ||
1.5. E_PIKE_BLOCKED event | ||
1.6. RabbitMQ socket | ||
1.7. OpenSIPS config script - sample event_rabbitmq usage | ||
1.5. Set server_id parameter | ||
1.6. rabbitmq_publish() function usage | ||
1.7. E_PIKE_BLOCKED event | ||
1.8. RabbitMQ socket | ||
1.9. OpenSIPS config script - sample event_rabbitmq usage | ||
2.1. Event subscription | ||
2.2. Event subscription | ||
|
||
|
@@ -64,13 +72,14 @@ Chapter 1. Admin Guide | |
taking advantage of the flexible AMQP protocol. | ||
|
||
This module provides the implementation of a RabbitMQ client | ||
for the Event Interface. It is used to send AMQP messages to a | ||
RabbitMQ server each time the Event Interface triggers an event | ||
subscribed for. | ||
|
||
The AMQP protocol is only used as the transport layer for | ||
notifications. The content of a message is presented in the | ||
next section. | ||
that supports two primary functionalities: | ||
* Event-Driven Messaging: It is used to send AMQP messages to | ||
a RabbitMQ server each time the Event Interface triggers an | ||
event subscribed for. | ||
* General Message Publishing: This module also enables | ||
sending AMQP messages directly to a RabbitMQ server. | ||
Messages can be easily customized according to the AMQP | ||
specifications, as well the RabbitMQ extensions. | ||
|
||
1.2. RabbitMQ events syntax | ||
|
||
|
@@ -193,16 +202,113 @@ modparam("event_rabbitmq", "use_tls", 1) | |
modparam("event_rabbitmq", "timeout", 1000) # timeout after 1s | ||
... | ||
|
||
1.5.5. server_id (string) | ||
|
||
Specify configuration for a RabbitMQ server. It contains a set | ||
of parameters used to customize the connection to the server, | ||
as well as to the messages sent. The format of the parameter is | ||
[id_name] param1=value1; param2=value2;. The uri parameter is | ||
mandatory. | ||
|
||
This parameter can be set multiple times, for each RabbitMQ | ||
server. | ||
|
||
The following parameters can be used: | ||
* uri - Mandatory parameter - a full amqp URI as described | ||
here. Missing fields in the URI will receive default | ||
values, such as: user: guest, password: guest, host: | ||
localhost, vhost: /, port: 5672. TLS connections are | ||
specified using an amqps URI. | ||
* frames - the maximum size of an AMQP frame. Optional | ||
parameter, default size is 131072. | ||
* retries - the number of retries in case a connection is | ||
down. Optional parameter, default is disabled (do not | ||
retry). | ||
* exchange - exchange used to send AMQP messages to. Optional | ||
parameter, default is "". | ||
* heartbeat - interval in seconds used to send heartbeat | ||
messages. Optional parameter, default is disabled. | ||
* immediate - indicate to the broker that the message MUST be | ||
delivered to a consumer immediately. Optional parameter, | ||
default is not immediate. | ||
* mandatory - indicate to the broker that the message MUST be | ||
routed to a queue. Optional parameter, default is not | ||
mandatory. | ||
* non-persistent - indicates that the message should not be | ||
persistent in case the RabbitMQ server restarts. Optional | ||
parameter, default is persistent. | ||
* tls_domain - indicates which TLS domain (as defined using | ||
the tls_mgm module) to use for this connection. This must | ||
be an amqps URI and the use_tls module parameter must be | ||
enabled. | ||
|
||
Example 1.5. Set server_id parameter | ||
... | ||
# connection to a RabbitMQ server on localhost, default port | ||
modparam("event_rabbitmq", "server_id","[ID1] uri = amqp://127.0.0.1") | ||
... | ||
# connection with a 5 seconds interval for heartbeat messages | ||
modparam("event_rabbitmq", "server_id","[ID2] uri = amqp://127.0.0.1; | ||
heartbeat = 5") | ||
... | ||
# TLS connection | ||
modparam("event_rabbitmq", "server_id","[ID3] uri = amqps://127.0.0.1; t | ||
ls_domain=rmq") | ||
... | ||
|
||
1.6. Exported Functions | ||
|
||
No function exported to be used from configuration file. | ||
1.6.1. rabbitmq_publish(server_id, routing_key, message [, | ||
[content_type [, headers, headers_vals]]]) | ||
|
||
Sends a publish message to a RabbitMQ server. | ||
|
||
This function also allows you to attach AMQP headers and values | ||
in the AMQP message. This is done by specifying a set of | ||
headers names (in the headers parameter) and the corresponding | ||
values (in the headers_vals parameter). The number of AVP | ||
values in the headers must be the same as the one in the | ||
headers_vals. | ||
|
||
This function can be used from any route. | ||
|
||
The function has the following parameters: | ||
* server_id (string) - the id of the RabbitMQ server. Must be | ||
one of the parameters defined in the server_id modparam. | ||
* routing_key (string) - routing key used to deliver the AMQP | ||
message. | ||
* message (string) - the body of the message. | ||
* content_type (string, optional) - content type of the | ||
message sent. By default it is none. | ||
* headers (string, optional) - an AVP containing the names of | ||
the headers within the AMQP message. If set, headers_vals | ||
parameter must also be specified. | ||
* headers_vals (string, optional) - an AVP containing the | ||
corresponding values of the AMQP headers. If set, headers | ||
parameter must also be specified. | ||
|
||
Example 1.6. rabbitmq_publish() function usage | ||
... | ||
rabbitmq_publish("ID1", "call", "$fU called $rU"); | ||
... | ||
rabbitmq_publish("ID1", "call", "{ \'caller\': \'$fU\', | ||
\'callee\; \'$rU\'", "applicatio | ||
n/json"); | ||
... | ||
$avp(hdr_name) = "caller"; | ||
$avp(hdr_value) = $fU; | ||
$avp(hdr_name) = "callee"; | ||
$avp(hdr_value) = $rU; | ||
rabbitmq_publish("ID2", "call", $rb, , $avp(hdr_name), $avp(hdr_ | ||
value)); | ||
... | ||
|
||
1.7. Example | ||
|
||
This is an example of an event raised by the pike module when | ||
it decides an ip should be blocked: | ||
|
||
Example 1.5. E_PIKE_BLOCKED event | ||
Example 1.7. E_PIKE_BLOCKED event | ||
|
||
{ | ||
"jsonrpc": "2.0", | ||
|
@@ -213,7 +319,7 @@ modparam("event_rabbitmq", "timeout", 1000) # timeout after 1s | |
} | ||
|
||
|
||
Example 1.6. RabbitMQ socket | ||
Example 1.8. RabbitMQ socket | ||
|
||
rabbitmq:guest:[email protected]:5672/pike | ||
|
||
|
@@ -233,7 +339,7 @@ modparam("event_rabbitmq", "timeout", 1000) # timeout after 1s | |
The parameters passed to the server are the R-URI username and | ||
the message body. | ||
|
||
Example 1.7. OpenSIPS config script - sample event_rabbitmq | ||
Example 1.9. OpenSIPS config script - sample event_rabbitmq | ||
usage | ||
... | ||
loadmodule "signaling.so" | ||
|
@@ -476,19 +582,20 @@ Chapter 3. Contributors | |
Table 3.1. Top contributors by DevScore^(1), authored | ||
commits^(2) and lines added/removed^(3) | ||
Name DevScore Commits Lines ++ Lines -- | ||
1. Razvan Crainea (@razvancrainea) 62 39 1995 310 | ||
2. Vlad Patrascu (@rvlad-patrascu) 22 12 504 266 | ||
3. Liviu Chircu (@liviuchircu) 9 7 23 40 | ||
4. Ovidiu Sas (@ovidiusas) 5 3 35 7 | ||
5. Bogdan-Andrei Iancu (@bogdan-iancu) 5 3 8 9 | ||
6. Maksym Sobolyev (@sobomax) 5 3 7 7 | ||
7. Peter Lemenkov (@lemenkov) 5 3 2 3 | ||
8. Ionut Ionita (@ionutrazvanionita) 4 2 52 25 | ||
9. franklyfox 4 2 44 5 | ||
10. Jarrod Baumann (@jarrodb) 4 2 2 2 | ||
|
||
All remaining contributors: Eric Tamme (@etamme), Julián Moreno | ||
Patiño, Vlad Paiu (@vladpaiu). | ||
1. Razvan Crainea (@razvancrainea) 112 73 3590 438 | ||
2. Vlad Patrascu (@rvlad-patrascu) 36 20 1044 412 | ||
3. Alexandra Titoc 26 2 499 1135 | ||
4. Liviu Chircu (@liviuchircu) 16 13 41 76 | ||
5. Maksym Sobolyev (@sobomax) 10 8 21 21 | ||
6. Bogdan-Andrei Iancu (@bogdan-iancu) 6 4 10 10 | ||
7. Ovidiu Sas (@ovidiusas) 5 3 35 7 | ||
8. Peter Lemenkov (@lemenkov) 5 3 2 3 | ||
9. Ionut Ionita (@ionutrazvanionita) 4 2 52 25 | ||
10. franklyfox 4 2 44 5 | ||
|
||
All remaining contributors: Jarrod Baumann (@jarrodb), Eric | ||
Tamme (@etamme), Julián Moreno Patiño, Walter Doekes | ||
(@wdoekes), Vlad Paiu (@vladpaiu). | ||
|
||
(1) DevScore = author_commits + author_lines_added / | ||
(project_lines_added / project_commits) + author_lines_deleted | ||
|
@@ -510,19 +617,20 @@ Chapter 3. Contributors | |
|
||
Table 3.2. Most recently active contributors^(1) to this module | ||
Name Commit Activity | ||
1. Razvan Crainea (@razvancrainea) Sep 2011 - Mar 2024 | ||
2. Vlad Patrascu (@rvlad-patrascu) Jul 2015 - Jun 2023 | ||
3. Liviu Chircu (@liviuchircu) Mar 2014 - May 2023 | ||
4. Maksym Sobolyev (@sobomax) Feb 2023 - Feb 2023 | ||
5. Peter Lemenkov (@lemenkov) Jun 2018 - Aug 2020 | ||
6. Bogdan-Andrei Iancu (@bogdan-iancu) Oct 2014 - Apr 2019 | ||
7. Jarrod Baumann (@jarrodb) Apr 2015 - Mar 2016 | ||
8. Julián Moreno Patiño Feb 2016 - Feb 2016 | ||
9. Ovidiu Sas (@ovidiusas) Jun 2015 - Jun 2015 | ||
10. Eric Tamme (@etamme) May 2015 - May 2015 | ||
|
||
All remaining contributors: Ionut Ionita (@ionutrazvanionita), | ||
Vlad Paiu (@vladpaiu), franklyfox. | ||
1. Alexandra Titoc Sep 2024 - Sep 2024 | ||
2. Razvan Crainea (@razvancrainea) Jan 2017 - Mar 2024 | ||
3. Vlad Patrascu (@rvlad-patrascu) May 2017 - Jun 2023 | ||
4. Liviu Chircu (@liviuchircu) Apr 2018 - May 2023 | ||
5. Maksym Sobolyev (@sobomax) Jul 2017 - Feb 2023 | ||
6. Peter Lemenkov (@lemenkov) Jun 2018 - Aug 2020 | ||
7. Walter Doekes (@wdoekes) Apr 2019 - Apr 2019 | ||
8. Bogdan-Andrei Iancu (@bogdan-iancu) Apr 2019 - Apr 2019 | ||
9. Jarrod Baumann (@jarrodb) Apr 2015 - Mar 2016 | ||
10. Julián Moreno Patiño Feb 2016 - Feb 2016 | ||
|
||
All remaining contributors: Ovidiu Sas (@ovidiusas), Eric Tamme | ||
(@etamme), Ionut Ionita (@ionutrazvanionita), Vlad Paiu | ||
(@vladpaiu), franklyfox. | ||
|
||
(1) including any documentation-related commits, excluding | ||
merge commits | ||
|
@@ -531,9 +639,10 @@ Chapter 4. Documentation | |
|
||
4.1. Contributors | ||
|
||
Last edited by: Razvan Crainea (@razvancrainea), Liviu Chircu | ||
(@liviuchircu), Vlad Patrascu (@rvlad-patrascu), Peter Lemenkov | ||
(@lemenkov), Ionut Ionita (@ionutrazvanionita). | ||
Last edited by: Alexandra Titoc, Razvan Crainea | ||
(@razvancrainea), Liviu Chircu (@liviuchircu), Vlad Patrascu | ||
(@rvlad-patrascu), Peter Lemenkov (@lemenkov), Ionut Ionita | ||
(@ionutrazvanionita). | ||
|
||
Documentation Copyrights: | ||
|
||
|
Oops, something went wrong.