Module: kamailio
Branch: 5.2
Commit: 6da8a5b4cb1f9b97aa2f92bc5d97786443712099
URL: https://github.com/kamailio/kamailio/commit/6da8a5b4cb1f9b97aa2f92bc5d97786…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-11-27T20:03:55+01:00
textops: docs - notes that msg_apply_changes() may be required for multi-part operations
- GH #1719
(cherry picked from commit 5460db2e59341f143d607de744faa8413216afd5)
---
Modified: src/modules/textops/doc/textops_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/6da8a5b4cb1f9b97aa2f92bc5d97786…
Patch: https://github.com/kamailio/kamailio/commit/6da8a5b4cb1f9b97aa2f92bc5d97786…
---
diff --git a/src/modules/textops/doc/textops_admin.xml b/src/modules/textops/doc/textops_admin.xml
index 8e0f350056..d348ccf6be 100644
--- a/src/modules/textops/doc/textops_admin.xml
+++ b/src/modules/textops/doc/textops_admin.xml
@@ -1638,6 +1638,7 @@ if (starts_with("$rU", "+358"))
set_body_multipart("test", "text/plain", "delimiter");
msg_apply_changes();
append_body_part(...);
+msg_apply_changes();
...
@@ -1690,12 +1691,17 @@ text
The core will take care of the last boundary ending "--". Detecting wich one is
the last and fixing the others if needed.
</para>
+ <para>
+ Note: it may be required that msg_apply_changes() from textopsx module
+ has to be executed if there are other operations over the new body.
+ </para>
<example>
<title><function>append_body_part</function> usage</title>
<programlisting format="linespecific">
...
$var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c";
append_body_part("$var(b)", "application/vnd.cirpack.isdn-ext", "signal;handling=required");
+msg_apply_changes();
...
# Will append this to the body:
@@ -1721,6 +1727,7 @@ Content-Disposition: signal;handling=required
...
$var(b) = "<info>active</info>";
append_body_part("$var(b)", "application/xml\r\nX-Header: xyz");
+msg_apply_changes();
...
# Will append this to the body:
@@ -1773,12 +1780,17 @@ Content-Disposition: signal;handling=required
The core will take care of the last boundary ending "--". Detecting wich one is
the last and fixing the others if needed.
</para>
+ <para>
+ Note: it may be required that msg_apply_changes() from textopsx module
+ has to be executed if there are other operations over the new body.
+ </para>
<example>
<title><function>append_body_part_hex</function> usage</title>
<programlisting format="linespecific">
...
$var(b) = "6b 61 6d 61 69 6c 69 6f";
append_body_part_hex("$var(b)", "application/my-custom-ext");
+msg_apply_changes();
...
# Will append this to the body:
@@ -1894,11 +1906,16 @@ get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)");
The core will take care of the last boundary ending "--". Detecting wich one is
the last and fixing the others if needed.
</para>
+ <para>
+ Note: it may be required that msg_apply_changes() from textopsx module
+ has to be executed if there are other operations over the new body.
+ </para>
<example>
<title><function>remove_body_part</function> usage</title>
<programlisting format="linespecific">
...
remove_body_part("application/vnd.cirpack.isdn-ext");
+msg_apply_changes();
...
</programlisting>
</example>
Module: kamailio
Branch: 5.2
Commit: 0387df55d08c435e8ee4d8dde41c260f2ddb839b
URL: https://github.com/kamailio/kamailio/commit/0387df55d08c435e8ee4d8dde41c260…
Author: Surendra Tiwari <surendratiwari3(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-11-27T20:03:34+01:00
xmlrpc: docs for event_callback parameter
- GH #1736
(cherry picked from commit d74d67976905c9d0c49f00485046117bc2581e65)
---
Modified: src/modules/xmlrpc/doc/xmlrpc_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/0387df55d08c435e8ee4d8dde41c260…
Patch: https://github.com/kamailio/kamailio/commit/0387df55d08c435e8ee4d8dde41c260…
---
diff --git a/src/modules/xmlrpc/doc/xmlrpc_admin.xml b/src/modules/xmlrpc/doc/xmlrpc_admin.xml
index 381a1feff7..a61d63e6db 100644
--- a/src/modules/xmlrpc/doc/xmlrpc_admin.xml
+++ b/src/modules/xmlrpc/doc/xmlrpc_admin.xml
@@ -60,7 +60,7 @@ modparam("xmlrpc", "route", "route_for_xmlrpcs")
<section id="autoconversion">
<title><varname>autoconversion</varname> (string)</title>
<para>
- Enable or disable automatic parameter type conversion globally,
+ Enable or disable automatic parameter type conversion globally,
for all the methods parameters.
If on, a type mismatch in a method parameter
will not cause a fault if it is possible to automatically
@@ -192,6 +192,45 @@ modparam("xmlrpc", "url_match", "^/RPC2")
</programlisting>
</example>
</section>
+ <section id="event_callback">
+ <title><varname>event_callback</varname> (string)</title>
+ <para>
+ The name of the function in the kemi configuration file (embedded
+ scripting language such as Lua, Python, ...) to be executed instead
+ of route blocks defined by route parameter for xmlrpc request.
+ </para>
+ <para>
+ This route will be called only for HTTP messages whose method is
+ either GET or POST. The message visible inside the route
+ will be a HTTP request converted to SIP (the uri will be fixed and
+ a fake via will be added).
+ </para>
+ <para>
+ The route should perform additional security checks to
+ ensure the client is authorized to execute management/RPC functions
+ and then it should call the <function>dispatch_rpc()</function>.
+ </para>
+ <example>
+ <title>Set <varname>event_callback</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("xmlrpc", "event_callback", "ksr_xmlrpc_event")
+...
+-- event callback function implemented in Lua
+function ksr_xmlrpc_event(evname)
+ KSR.info("===== xmlrpc triggered event: " .. evname .. "\n");
+ local rpc_method = KSR.pv.get("$rm") or ""
+ if ((rpc_method == "POST" or rpc_method == "GET")) then
+ if (KSR.xmlrpc.dispatch_rpc() < 0) then
+ KSR.err("error while executing xmlrpc event")
+ end
+ end
+ return 1;
+end
+...
+</programlisting>
+ </example>
+ </section>
</section>
<section>
Module: kamailio
Branch: master
Commit: 5460db2e59341f143d607de744faa8413216afd5
URL: https://github.com/kamailio/kamailio/commit/5460db2e59341f143d607de744faa84…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-11-27T17:53:30+01:00
textops: docs - notes that msg_apply_changes() may be required for multi-part operations
- GH #1719
---
Modified: src/modules/textops/doc/textops_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/5460db2e59341f143d607de744faa84…
Patch: https://github.com/kamailio/kamailio/commit/5460db2e59341f143d607de744faa84…
---
diff --git a/src/modules/textops/doc/textops_admin.xml b/src/modules/textops/doc/textops_admin.xml
index 8e0f350056..d348ccf6be 100644
--- a/src/modules/textops/doc/textops_admin.xml
+++ b/src/modules/textops/doc/textops_admin.xml
@@ -1638,6 +1638,7 @@ if (starts_with("$rU", "+358"))
set_body_multipart("test", "text/plain", "delimiter");
msg_apply_changes();
append_body_part(...);
+msg_apply_changes();
...
@@ -1690,12 +1691,17 @@ text
The core will take care of the last boundary ending "--". Detecting wich one is
the last and fixing the others if needed.
</para>
+ <para>
+ Note: it may be required that msg_apply_changes() from textopsx module
+ has to be executed if there are other operations over the new body.
+ </para>
<example>
<title><function>append_body_part</function> usage</title>
<programlisting format="linespecific">
...
$var(b) = "7e Od 04 55 75 69 20 4d 61 6b 65 43 61 6c 6c";
append_body_part("$var(b)", "application/vnd.cirpack.isdn-ext", "signal;handling=required");
+msg_apply_changes();
...
# Will append this to the body:
@@ -1721,6 +1727,7 @@ Content-Disposition: signal;handling=required
...
$var(b) = "<info>active</info>";
append_body_part("$var(b)", "application/xml\r\nX-Header: xyz");
+msg_apply_changes();
...
# Will append this to the body:
@@ -1773,12 +1780,17 @@ Content-Disposition: signal;handling=required
The core will take care of the last boundary ending "--". Detecting wich one is
the last and fixing the others if needed.
</para>
+ <para>
+ Note: it may be required that msg_apply_changes() from textopsx module
+ has to be executed if there are other operations over the new body.
+ </para>
<example>
<title><function>append_body_part_hex</function> usage</title>
<programlisting format="linespecific">
...
$var(b) = "6b 61 6d 61 69 6c 69 6f";
append_body_part_hex("$var(b)", "application/my-custom-ext");
+msg_apply_changes();
...
# Will append this to the body:
@@ -1894,11 +1906,16 @@ get_body_part("application/vnd.cirpack.isdn-ext", "$var(hbody)");
The core will take care of the last boundary ending "--". Detecting wich one is
the last and fixing the others if needed.
</para>
+ <para>
+ Note: it may be required that msg_apply_changes() from textopsx module
+ has to be executed if there are other operations over the new body.
+ </para>
<example>
<title><function>remove_body_part</function> usage</title>
<programlisting format="linespecific">
...
remove_body_part("application/vnd.cirpack.isdn-ext");
+msg_apply_changes();
...
</programlisting>
</example>
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1736
-- Commit Summary --
* Merge pull request #1 from kamailio/master
* Modules:XMLRPC event_route callback added for ksr
-- File Changes --
M src/modules/xmlrpc/xmlrpc.c (56)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1736.patchhttps://github.com/kamailio/kamailio/pull/1736.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1736
Module: kamailio
Branch: master
Commit: d74d67976905c9d0c49f00485046117bc2581e65
URL: https://github.com/kamailio/kamailio/commit/d74d67976905c9d0c49f00485046117…
Author: Surendra Tiwari <surendratiwari3(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-11-27T12:47:40+01:00
xmlrpc: docs for event_callback parameter
- GH #1736
---
Modified: src/modules/xmlrpc/doc/xmlrpc_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/d74d67976905c9d0c49f00485046117…
Patch: https://github.com/kamailio/kamailio/commit/d74d67976905c9d0c49f00485046117…
---
diff --git a/src/modules/xmlrpc/doc/xmlrpc_admin.xml b/src/modules/xmlrpc/doc/xmlrpc_admin.xml
index 381a1feff7..a61d63e6db 100644
--- a/src/modules/xmlrpc/doc/xmlrpc_admin.xml
+++ b/src/modules/xmlrpc/doc/xmlrpc_admin.xml
@@ -60,7 +60,7 @@ modparam("xmlrpc", "route", "route_for_xmlrpcs")
<section id="autoconversion">
<title><varname>autoconversion</varname> (string)</title>
<para>
- Enable or disable automatic parameter type conversion globally,
+ Enable or disable automatic parameter type conversion globally,
for all the methods parameters.
If on, a type mismatch in a method parameter
will not cause a fault if it is possible to automatically
@@ -192,6 +192,45 @@ modparam("xmlrpc", "url_match", "^/RPC2")
</programlisting>
</example>
</section>
+ <section id="event_callback">
+ <title><varname>event_callback</varname> (string)</title>
+ <para>
+ The name of the function in the kemi configuration file (embedded
+ scripting language such as Lua, Python, ...) to be executed instead
+ of route blocks defined by route parameter for xmlrpc request.
+ </para>
+ <para>
+ This route will be called only for HTTP messages whose method is
+ either GET or POST. The message visible inside the route
+ will be a HTTP request converted to SIP (the uri will be fixed and
+ a fake via will be added).
+ </para>
+ <para>
+ The route should perform additional security checks to
+ ensure the client is authorized to execute management/RPC functions
+ and then it should call the <function>dispatch_rpc()</function>.
+ </para>
+ <example>
+ <title>Set <varname>event_callback</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("xmlrpc", "event_callback", "ksr_xmlrpc_event")
+...
+-- event callback function implemented in Lua
+function ksr_xmlrpc_event(evname)
+ KSR.info("===== xmlrpc triggered event: " .. evname .. "\n");
+ local rpc_method = KSR.pv.get("$rm") or ""
+ if ((rpc_method == "POST" or rpc_method == "GET")) then
+ if (KSR.xmlrpc.dispatch_rpc() < 0) then
+ KSR.err("error while executing xmlrpc event")
+ end
+ end
+ return 1;
+end
+...
+</programlisting>
+ </example>
+ </section>
</section>
<section>