Module: kamailio Branch: master Commit: 2a636f593597fae4082923a9aee78b9963eccbc1 URL: https://github.com/kamailio/kamailio/commit/2a636f593597fae4082923a9aee78b99...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2018-08-30T08:06:12+02:00
sipjson: docs - added sample of output content
---
Modified: src/modules/sipjson/doc/sipjson_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/2a636f593597fae4082923a9aee78b99... Patch: https://github.com/kamailio/kamailio/commit/2a636f593597fae4082923a9aee78b99...
---
diff --git a/src/modules/sipjson/doc/sipjson_admin.xml b/src/modules/sipjson/doc/sipjson_admin.xml index 5624678033..ccfa868073 100644 --- a/src/modules/sipjson/doc/sipjson_admin.xml +++ b/src/modules/sipjson/doc/sipjson_admin.xml @@ -20,7 +20,8 @@ </para> <para> It can facilitate getting the SIP attributes in a structure inside one - of the embedded interpreters (e.g., KEMI interpreters). + of the embedded interpreters (e.g., KEMI interpreters, Lua can parse + JSON in an internal hash table). </para> </section>
@@ -116,5 +117,54 @@ sj_serialize("0B", "$var(json)");
</section>
+ <section> + <title>Output Samples</title> + <para> + The content of the output variable is a JSON. Next are some samples. + </para> + <example> + <title><function>sj_serialize</function> output</title> + <programlisting format="linespecific"> +... +# the content of $var(json) after sj_serialize("0B", "$var(json)") +# - the content is compacted, next it has been pretty-formatted for better viewing +... +{ + "mt":2, + "rm":"OPTIONS", + "pr":"udp", + "si":"127.0.0.1", + "sp":36747, + "Ri":"127.0.0.1", + "Rp":5060, + "ru":"sip:alice@127.0.0.1", + "rU":"alice", + "rd":"127.0.0.1", + "rp":0, + "fU":"sipsak", + "fd":"172.17.0.2", + "ua":"sipsak 0.9.7pre", + "ci":"482215126@172.17.0.2", + "rb":"" +} +... +# the sip message sent to &kamailio;: +... +OPTIONS sip:alice@127.0.0.1 SIP/2.0 +Via: SIP/2.0/UDP 127.0.0.1:65502;branch=z9hG4bK.79e78613;rport;alias +From: sip:sipsak@172.17.0.2;tag=74806173 +To: sip:alice@127.0.0.1 +Call-ID: 482215126@172.17.0.2 +CSeq: 1 OPTIONS +Contact: sip:sipsak@127.0.0.1:65502 +Content-Length: 0 +Max-Forwards: 70 +User-Agent: sipsak 0.9.7pre +Accept: text/plain + +... +</programlisting> + </example> + </section> </chapter>