Module: kamailio
Branch: master
Commit: 5db8bec2fdfba911f7053e615cf156d76af5fa46
URL: https://github.com/kamailio/kamailio/commit/5db8bec2fdfba911f7053e615cf156d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-06-23T23:22:37+02:00
rtjson: more documentation about json routing document format
---
Modified: modules/rtjson/doc/rtjson_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/5db8bec2fdfba911f7053e615cf156d…
Patch: https://github.com/kamailio/kamailio/commit/5db8bec2fdfba911f7053e615cf156d…
---
diff --git a/modules/rtjson/doc/rtjson_admin.xml b/modules/rtjson/doc/rtjson_admin.xml
index 4218e73..fedd40c 100644
--- a/modules/rtjson/doc/rtjson_admin.xml
+++ b/modules/rtjson/doc/rtjson_admin.xml
@@ -148,6 +148,8 @@ rtjson_push_routes();
...
rtjson_init_routes("$var(json)");
rtjson_push_routes();
+t_on_failure("REROUTE");
+t_relay();
...
failure_route[REROUTE] {
rtjson_next_route();
@@ -174,6 +176,8 @@ failure_route[REROUTE] {
...
rtjson_init_routes("$var(json)");
rtjson_push_routes();
+t_on_branch("OUTGOING");
+t_relay();
...
branch_route[OUTGOING] {
rtjson_update_branch();
@@ -191,7 +195,85 @@ branch_route[OUTGOING] {
The format of the JSON document containing routing information.
</para>
<para>
- Description of the fields: TBA.
+ Description of the fields in the JSON routing document:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>version</emphasis> - intended to enforce versioning
+ checks (not enforced yet), recommended to be set to "1.0".
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>routing</emphasis> - can be "serial" or "parallel",
+ corresponding to desired routing type: serial or parallel forking.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>routes</emphasis> - an array with structures holding
+ the attributes for destinations. The attributes can be:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>uri</emphasis> - request URI
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>dst_uri</emphasis> - outbound proxy URI
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>path</emphasis> - Path URI vector
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>socket</emphasis> - local socket
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>headers</emphasis> - a structure with values for headers
+ From and To specified as display name and URI, plus extra
+ headers to be appended to SIP request. It requires uac module in
+ order to update From and To headers.
+ Set by rtjson_update_branch() only for serial routing.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>branch_flags</emphasis> - branch flags.
+ Set by rtjson_update_branch() only for serial routing.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>fr_timer</emphasis> - value for fr_timer parameter of
+ tm module.
+ Set by rtjson_update_branch() only for serial routing.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>fr_inv_timer</emphasis> - value for fr_inv_timer parameter
+ of tm module.
+ Set by rtjson_update_branch() only for serial routing.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Other fields can appear in the JSON routing document, being ignored
+ by rtjson functions. They can be processed directly in the configuration
+ files using json or jansson modules. For example, the document can include
+ the transaction identification tuple (index,label) that can be used
+ to resume the execution of a suspended transaction.
</para>
<example>
<title>JSON Routing Structure</title>
@@ -199,7 +281,7 @@ branch_route[OUTGOING] {
...
{
"version": "1.0",
- "routing": "parallel",
+ "routing": "serial",
"routes": [
{
"uri": "sip:127.0.0.1:5080",
Module: kamailio
Branch: master
Commit: 96225847ddfc2f879d63adbc0117748c9cf76f02
URL: https://github.com/kamailio/kamailio/commit/96225847ddfc2f879d63adbc0117748…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-06-23T14:07:37+02:00
evapi: more documentation for exported functions
---
Modified: modules/evapi/doc/evapi_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/96225847ddfc2f879d63adbc0117748…
Patch: https://github.com/kamailio/kamailio/commit/96225847ddfc2f879d63adbc0117748…
---
diff --git a/modules/evapi/doc/evapi_admin.xml b/modules/evapi/doc/evapi_admin.xml
index ef2e34a..574adef 100644
--- a/modules/evapi/doc/evapi_admin.xml
+++ b/modules/evapi/doc/evapi_admin.xml
@@ -131,8 +131,18 @@ modparam("evapi", "netstring_format", 0)
<function moreinfo="none">evapi_relay(evdata)</function>
</title>
<para>
- Relay the event data give as parameter to connected applications.
- The format on the network is netstring with evdata payload.
+ Relay the event data given as parameter to connected applications.
+ </para>
+ <para>
+ The format on the network is netstring with evdata payload if
+ netstring_format parameter is set to 1 or bare evdata if
+ netstring_format parameter is set to 0.
+ </para>
+ <para>
+ The function is passing the task to evapi dispatcher process, therefore
+ the SIP worker process is not blocked. Also, it doesn't wait for any
+ response, therefore the processing of the configuration continues
+ very fast when executing evapi_relay().
</para>
<para>
This function can be used from ANY_ROUTE.
@@ -166,10 +176,17 @@ evapi_relay("{ \"event\": \"test\",\n \"data\": { \"fU\": \"$fU\" }\n}");
<function moreinfo="none">evapi_async_relay(evdata)</function>
</title>
<para>
- Relay the event data give as parameter to connected applications.
- The format on the network is netstring with evdata payload. Before
+ Relay the event data given as parameter to connected applications. Before
evaluating the parameter, the request processing is suspended using
- tm module.
+ tm module (using the t_suspend()/t_continue() framework). The routing
+ of the SIP request can be continued once event_route[evapi:message-received]
+ is triggered. After evapi_async_relay() returns true, no relaying should
+ happen in request_route(), it should be followed by exit;.
+ </para>
+ <para>
+ The format on the network is netstring with evdata payload if
+ netstring_format parameter is set to 1 or bare evdata if
+ netstring_format parameter is set to 0.
</para>
<para>
This function can be used from REQUEST_ROUTE.
Module: kamailio
Branch: master
Commit: 239c54843897ec143c03693e44c994ee9cdde684
URL: https://github.com/kamailio/kamailio/commit/239c54843897ec143c03693e44c994e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-06-23T13:12:08+02:00
rtjson: error log level set to notice for importing uac api
- printed at module init, it is not preventing to start the server
---
Modified: modules/rtjson/rtjson_routing.c
---
Diff: https://github.com/kamailio/kamailio/commit/239c54843897ec143c03693e44c994e…
Patch: https://github.com/kamailio/kamailio/commit/239c54843897ec143c03693e44c994e…
---
diff --git a/modules/rtjson/rtjson_routing.c b/modules/rtjson/rtjson_routing.c
index 71ac2e6..7e088c9 100644
--- a/modules/rtjson/rtjson_routing.c
+++ b/modules/rtjson/rtjson_routing.c
@@ -58,7 +58,7 @@ int rtjson_init(void)
memset(&tmb, 0, sizeof(struct tm_binds));
}
if (load_uac_api(&uacb) < 0) {
- LM_ERR("cannot bind to UAC API - some features are diabled\n");
+ LM_NOTICE("cannot bind to UAC API - some features are diabled\n");
memset(&uacb, 0, sizeof(uac_api_t));
}
return 0;