Skip to content

Commit

Permalink
modules: readme files regenerated - dispatcher ...
Browse files Browse the repository at this point in the history
  • Loading branch information
kamailio-dev committed Jan 17, 2017
1 parent 3e5def3 commit 124b6d1
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 20 deletions.
2 changes: 1 addition & 1 deletion modules/dispatcher/README
Expand Up @@ -959,7 +959,7 @@ ds_select_dst("1", "4", "3");
* "p" and "P" - this has to be used in addition to one of the
previous flags - the last destination will be set to probing. This
mean the destination will be pinged with SIP OPTIONS requests from
time to time to detect if it is up running or down.
time to time to detect if it is up or down.

This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.

Expand Down
75 changes: 60 additions & 15 deletions modules/jsonrpc-s/README
Expand Up @@ -41,10 +41,11 @@ Daniel-Constantin Mierla
4.1. jsonrpc_dispatch()
4.2. jsonrpc_exec(cmd)

5. JSONRPC Transports
5. JSONRPC Commands
6. JSONRPC Transports

5.1. JSONRPC Over HTTP
5.2. JSONRPC Over FIFO
6.1. JSONRPC Over HTTP
6.2. JSONRPC Over FIFO

List of Examples

Expand All @@ -57,8 +58,9 @@ Daniel-Constantin Mierla
1.7. Set fifo_reply_dir parameter
1.8. jsonrpc_dispatch usage
1.9. jsonrpc_exec usage
1.10. JSONRPC Over Fifo Command
1.11. JSONRPC Over Fifo Command From Termina
1.10. JSONRPC Commands - Examples
1.11. JSONRPC Over Fifo Command
1.12. JSONRPC Over Fifo Command From Termina

Chapter 1. Admin Guide

Expand Down Expand Up @@ -88,10 +90,11 @@ Chapter 1. Admin Guide
4.1. jsonrpc_dispatch()
4.2. jsonrpc_exec(cmd)

5. JSONRPC Transports
5. JSONRPC Commands
6. JSONRPC Transports

5.1. JSONRPC Over HTTP
5.2. JSONRPC Over FIFO
6.1. JSONRPC Over HTTP
6.2. JSONRPC Over FIFO

1. Overview

Expand Down Expand Up @@ -293,17 +296,59 @@ event_route[xhttp:request] {
jsonrpc_exec({"jsonrpc": "2.0", "method": "dispatcher.reload", "id": 1}');
...

5. JSONRPC Transports
5. JSONRPC Commands

5.1. JSONRPC Over HTTP
5.2. JSONRPC Over FIFO
Here are some examples of RPC commands with the equivalent of running
them with kamcmd and the corresponding JSON document for them. It is
important to be aware that the name of the parameters doesn't matter,
only the order of the values must be the one expected by Kamailio RPC
command.

Example 1.10. JSONRPC Commands - Examples
...
# kamcmd core.psx

{
"jsonrpc": "2.0",
"method": "core.psx",
"id": 1
}
...
## - prototype: kamcmd dispatcher.set_state _state_ _group_ _address_
# kamcmd dispatcher.set_state ip 2 sip:127.0.0.1:5080

{
"jsonrpc": "2.0",
"method": "dispatcher.set_state",
"params": ["ip", 2, "sip:127.0.0.1:5080"],
"id": 1
}

## - or:

{
"jsonrpc": "2.0",
"method": "dispatcher.set_state",
"params": {
"state": "ip",
"grpup": 2,
"address": "sip:127.0.0.1:5080"
},
"id": 1
}
...

6. JSONRPC Transports

6.1. JSONRPC Over HTTP
6.2. JSONRPC Over FIFO

JSONRPC specifications do not enforce a specific transport to carry the
JSON documents. Very common is JSONRPC over HTTP or HTTPS, and they are
supported by Kamailio. In addition, Kamailio supports receiving JSON
documents via a local FIFO file.

5.1. JSONRPC Over HTTP
6.1. JSONRPC Over HTTP

It requires that XHTTP module is loaded. HTTPS can be used if you
enable TLS for Kamailio. The JSONRPC requests have to be sent to the
Expand All @@ -313,7 +358,7 @@ jsonrpc_exec({"jsonrpc": "2.0", "method": "dispatcher.reload", "id": 1}');

The format of the JSON document must follow the JSONRPC specifications.

5.2. JSONRPC Over FIFO
6.2. JSONRPC Over FIFO

This module can retrive JSONRPC requests via a local FIFO file. To
enable this feature, 'fifo_name' parameter must be set and 'transport'
Expand All @@ -326,7 +371,7 @@ jsonrpc_exec({"jsonrpc": "2.0", "method": "dispatcher.reload", "id": 1}');
'fifo_reply_dir'. Next is an example showing a JSONRPC command to be
sent via FIFO transport.

Example 1.10. JSONRPC Over Fifo Command
Example 1.11. JSONRPC Over Fifo Command
...
{
"jsonrpc": "2.0",
Expand All @@ -339,7 +384,7 @@ jsonrpc_exec({"jsonrpc": "2.0", "method": "dispatcher.reload", "id": 1}');
Next is an example of how to test it from a terminal, assuming that the
parameter 'fifo_name' is set to '/tmp/kamailio_jsonrpc_fifo'.

Example 1.11. JSONRPC Over Fifo Command From Termina
Example 1.12. JSONRPC Over Fifo Command From Termina
...
mkfifo /tmp/kamailio_jsonrpc_reply_fifo
cat /tmp/kamailio_jsonrpc_reply_fifo &
Expand Down
8 changes: 6 additions & 2 deletions modules/rtpengine/README
Expand Up @@ -965,8 +965,12 @@ rtpengine_delete();
with internal flag FL_SDP_BODY to know that the 1xx and 2xx are for
rtpengine_answer()
* If ACK with SDP, then do rtpengine_answer()
* If BYE or CANCEL, or called within a FAILURE_ROUTE[], then do
rtpengine_delete()
* If BYE or CANCEL, or called within a FAILURE_ROUTE[], then call
rtpengine_delete(). Be careful with calling this function after
resuming a suspended transaction (e.g., after t_continue()),
because the context of executed route is FAILURE ROUTE (in other
words, rtpengine_manage() in the route block of t_continue() does
the same as in failure_route).
* If reply to INVITE with code >= 300 do rtpengine_delete()
* If reply with SDP to INVITE having code 1xx and 2xx, then do
rtpengine_answer() if the request had SDP or tm is not loaded,
Expand Down
8 changes: 6 additions & 2 deletions modules/rtpproxy/README
Expand Up @@ -640,8 +640,12 @@ rtpproxy_destroy();
with internal flag FL_SDP_BODY to know that the 1xx and 2xx are for
rtpproxy_answer()
* If ACK with SDP, then do rtpproxy_answer()
* If BYE or CANCEL, or called within a FAILURE_ROUTE[], then do
unforce_rtpproxy()
* If BYE or CANCEL, or called within a FAILURE_ROUTE[], then call
unforce_rtpproxy(). Be careful with calling this function after
resuming a suspended transaction (e.g., after t_continue()),
because the context of executed route is FAILURE ROUTE (in other
words, rtpproxy_manage() in the route block of t_continue() does
the same as in failure_route).
* If reply to INVITE with code >= 300 do unforce_rtpproxy()
* If reply with SDP to INVITE having code 1xx and 2xx, then do
rtpproxy_answer() if the request had SDP or tm is not loaded,
Expand Down
9 changes: 9 additions & 0 deletions modules/tmx/README
Expand Up @@ -381,12 +381,21 @@ if(t_suspend())
* rtname - the name of the route block to execute. Can be a static
string value or a dynamic string with pseudo-variables.

Important note: the route[rtname] is executed in the context of a
failure (same behaviour for functions as they were used in a
failure_route block).

This function can be used in ANY_ROUTE.

Example 1.11. t_continue usage
...
t_continue('123', '456', 'MYROUTE');
...
route[MYROUTE] {
xlog("executed by t continue\n");
...
}
...

4.11. t_reuse_branch()

Expand Down

0 comments on commit 124b6d1

Please sign in to comment.