[sr-dev] git:master: jsonrpc-s: documentation for jsonrpc_exec(cmd)

Daniel-Constantin Mierla miconda at gmail.com
Tue Sep 9 12:19:29 CEST 2014


Module: sip-router
Branch: master
Commit: 74a2f193bcf2c9be893cf72b2cede750a72eea5d
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=74a2f193bcf2c9be893cf72b2cede750a72eea5d

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Sep  9 12:13:33 2014 +0200

jsonrpc-s: documentation for jsonrpc_exec(cmd)

---

 modules/jsonrpc-s/README                  |   17 +++++++++++++++++
 modules/jsonrpc-s/doc/jsonrpc-s_admin.xml |   24 +++++++++++++++++++++++-
 2 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/modules/jsonrpc-s/README b/modules/jsonrpc-s/README
index cfdd78b..c06769b 100644
--- a/modules/jsonrpc-s/README
+++ b/modules/jsonrpc-s/README
@@ -33,11 +33,13 @@ Daniel-Constantin Mierla
         4. Functions
 
               4.1. jsonrpc_dispatch()
+              4.2. jsonrpc_exec(cmd)
 
    List of Examples
 
    1.1. Set pretty_format parameter
    1.2. jsonrpc_dispatch usage
+   1.3. jsonrpc_exec usage
 
 Chapter 1. Admin Guide
 
@@ -59,6 +61,7 @@ Chapter 1. Admin Guide
    4. Functions
 
         4.1. jsonrpc_dispatch()
+        4.2. jsonrpc_exec(cmd)
 
 1. Overview
 
@@ -113,6 +116,7 @@ modparam("jsonrpc-s", "pretty_format", 1)
 4. Functions
 
    4.1. jsonrpc_dispatch()
+   4.2. jsonrpc_exec(cmd)
 
 4.1. jsonrpc_dispatch()
 
@@ -160,3 +164,16 @@ event_route[xhttp:request] {
     return;
 }
 ...
+
+4.2. jsonrpc_exec(cmd)
+
+   Execute JSONRPC command given as parameter.
+
+   The parameter has to be a full valid JSONRPC document. It can be a
+   dynamic string with variables. The result of the command can be
+   accessed via $jsonrpl(key) variables.
+
+   Example 1.3. jsonrpc_exec usage
+...
+jsonrpc_exec({"jsonrpc": "2.0", "method": "dispatcher.reload", "id": 1}');
+...
diff --git a/modules/jsonrpc-s/doc/jsonrpc-s_admin.xml b/modules/jsonrpc-s/doc/jsonrpc-s_admin.xml
index 9b178b0..77a0e3a 100644
--- a/modules/jsonrpc-s/doc/jsonrpc-s_admin.xml
+++ b/modules/jsonrpc-s/doc/jsonrpc-s_admin.xml
@@ -100,7 +100,7 @@ modparam("jsonrpc-s", "pretty_format", 1)
 
 	<section>
 	<title>Functions</title>
- 	<section>
+ 	<section id="jsonrpc-s.f.jsonrpc_dispatch">
 	    <title>
 		<function moreinfo="none">jsonrpc_dispatch()</function>
 	    </title>
@@ -154,6 +154,28 @@ event_route[xhttp:request] {
 </programlisting>
 	    </example>
 	</section>
+ 	<section id="jsonrpc-s.f.jsonrpc_exec">
+	    <title>
+		<function moreinfo="none">jsonrpc_exec(cmd)</function>
+	    </title>
+	    <para>
+			Execute JSONRPC command given as parameter.
+		</para>
+		<para>
+			The parameter has to be a full valid JSONRPC document. It can
+			be a dynamic string with variables. The result of the command
+			can be accessed via $jsonrpl(key) variables.
+	    </para>
+		<example>
+		<title><function>jsonrpc_exec</function> usage</title>
+		<programlisting format="linespecific">
+...
+jsonrpc_exec({"jsonrpc": "2.0", "method": "dispatcher.reload", "id": 1}');
+...
+</programlisting>
+	    </example>
+	</section>
+
 	</section>
 </chapter>
 




More information about the sr-dev mailing list