Hi Daniel,<div><br></div><div>Thank you for this module! It answers several of the questions I've been pondering.</div><div><br></div><div>Regards,</div><div>Matthew Williams</div><div>FlowRoute LLC<br><br><div class="gmail_quote">
On Sun, Jun 26, 2011 at 5:52 AM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Module: sip-router<br>
Branch: master<br>
Commit: 31b97e44437d66aef098f553417c647025f323cc<br>
URL: <a href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=31b97e44437d66aef098f553417c647025f323cc" target="_blank">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=31b97e44437d66aef098f553417c647025f323cc</a><br>
<br>
Author: Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>><br>
Committer: Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>><br>
Date: Sun Jun 26 11:42:01 2011 +0200<br>
<br>
async: documented async_route() function<br>
<br>
---<br>
<br>
modules/async/README | 43 ++++++++++++++++++++++++++++++++----<br>
modules/async/doc/async_admin.xml | 42 +++++++++++++++++++++++++++++++++++-<br>
2 files changed, 79 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/modules/async/README b/modules/async/README<br>
index c10a562..e01da48 100644<br>
--- a/modules/async/README<br>
+++ b/modules/async/README<br>
@@ -29,12 +29,14 @@ Daniel-Constantin Mierla<br>
<br>
4. Exported Functions<br>
<br>
- 4.1. async_sleep(seconds)<br>
+ 4.1. async_route(routename, seconds)<br>
+ 4.2. async_sleep(seconds)<br>
<br>
List of Examples<br>
<br>
1.1. Set workers parameter<br>
1.2. async_sleep usage<br>
+ 1.3. async_sleep usage<br>
<br>
Chapter 1. Admin Guide<br>
<br>
@@ -52,7 +54,8 @@ Chapter 1. Admin Guide<br>
<br>
4. Exported Functions<br>
<br>
- 4.1. async_sleep(seconds)<br>
+ 4.1. async_route(routename, seconds)<br>
+ 4.2. async_sleep(seconds)<br>
<br>
1. Overview<br>
<br>
@@ -101,9 +104,39 @@ modparam("async", "workers", 2)<br>
<br>
4. Exported Functions<br>
<br>
- 4.1. async_sleep(seconds)<br>
+ 4.1. async_route(routename, seconds)<br>
+ 4.2. async_sleep(seconds)<br>
<br>
-4.1. async_sleep(seconds)<br>
+4.1. async_route(routename, seconds)<br>
+<br>
+ Simulate a sleep of 'seconds' and then continue the processing of SIP<br>
+ request with the route[routename]. In case of internal errors, the<br>
+ function returns false, otherwise the function exits the execution of<br>
+ config at that moment (return 0 behaviour).<br>
+<br>
+ The routename parameter can be a static string or a dynamic string<br>
+ value with config variables.<br>
+<br>
+ The sleep parameter represent the number of seconds to suppend the<br>
+ processing of SIP request. Maximum value is 100. The parameter can be a<br>
+ static integer or a varaible holding an integer.<br>
+<br>
+ Since the SIP request handling is resumed in another process,<br>
+ practically the config file execution state is lost. Therefore beware<br>
+ that the execution of config after resume will end once the<br>
+ route[routename] is finished.<br>
+<br>
+ Example 1.2. async_sleep usage<br>
+...<br>
+async_route("RESUME", "4");<br>
+...<br>
+route[RESUME] {<br>
+ send_reply("404", "Not found");<br>
+ exit;<br>
+}<br>
+...<br>
+<br>
+4.2. async_sleep(seconds)<br>
<br>
Simulate a sleep of 'seconds' and then continue the processing of SIP<br>
request with the next action. In case of internal errors, the function<br>
@@ -119,7 +152,7 @@ modparam("async", "workers", 2)<br>
that the execution of config after resume will end once the route block<br>
where async_sleep() is called is finished.<br>
<br>
- Example 1.2. async_sleep usage<br>
+ Example 1.3. async_sleep usage<br>
...<br>
async_sleep("4");<br>
send_reply("404", "Not found");<br>
diff --git a/modules/async/doc/async_admin.xml b/modules/async/doc/async_admin.xml<br>
index 2506f06..3fbaeab 100644<br>
--- a/modules/async/doc/async_admin.xml<br>
+++ b/modules/async/doc/async_admin.xml<br>
@@ -87,7 +87,47 @@ modparam("async", "workers", 2)<br>
<br>
<section><br>
<title>Exported Functions</title><br>
- <section><br>
+ <section><br>
+ <title><br>
+ <function moreinfo="none">async_route(routename, seconds)</function><br>
+ </title><br>
+ <para><br>
+ Simulate a sleep of 'seconds' and then continue the processing of SIP<br>
+ request with the route[routename]. In case of internal errors, the<br>
+ function returns false, otherwise the function exits the execution of<br>
+ config at that moment (return 0 behaviour).<br>
+ </para><br>
+ <para><br>
+ The routename parameter can be a static string or a dynamic string<br>
+ value with config variables.<br>
+ </para><br>
+ <para><br>
+ The sleep parameter represent the number of seconds to suppend the<br>
+ processing of SIP request. Maximum value is 100. The parameter can be<br>
+ a static integer or a varaible holding an integer.<br>
+ </para><br>
+ <para><br>
+ Since the SIP request handling is resumed in another process,<br>
+ practically the config file execution state is lost. Therefore beware<br>
+ that the execution of config after resume will end once the<br>
+ route[routename] is finished.<br>
+ </para><br>
+ <example><br>
+ <title><function>async_sleep</function> usage</title><br>
+ <programlisting format="linespecific"><br>
+...<br>
+async_route("RESUME", "4");<br>
+...<br>
+route[RESUME] {<br>
+ send_reply("404", "Not found");<br>
+ exit;<br>
+}<br>
+...<br>
+</programlisting><br>
+ </example><br>
+ </section><br>
+<br>
+ <section><br>
<title><br>
<function moreinfo="none">async_sleep(seconds)</function><br>
</title><br>
<br>
<br>
_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
</blockquote></div><br></div>