Hi Daniel,<div><br></div><div>Thank you for this module! It answers several of the questions I&#39;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">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</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 &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;<br>
Committer: Daniel-Constantin Mierla &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;<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(&quot;async&quot;, &quot;workers&quot;, 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 &#39;seconds&#39; 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(&quot;RESUME&quot;, &quot;4&quot;);<br>
+...<br>
+route[RESUME] {<br>
+   send_reply(&quot;404&quot;, &quot;Not found&quot;);<br>
+   exit;<br>
+}<br>
+...<br>
+<br>
+4.2. async_sleep(seconds)<br>
<br>
    Simulate a sleep of &#39;seconds&#39; 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(&quot;async&quot;, &quot;workers&quot;, 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(&quot;4&quot;);<br>
 send_reply(&quot;404&quot;, &quot;Not found&quot;);<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(&quot;async&quot;, &quot;workers&quot;, 2)<br>
<br>
        &lt;section&gt;<br>
        &lt;title&gt;Exported Functions&lt;/title&gt;<br>
-       &lt;section&gt;<br>
+       &lt;section&gt;<br>
+           &lt;title&gt;<br>
+               &lt;function moreinfo=&quot;none&quot;&gt;async_route(routename, seconds)&lt;/function&gt;<br>
+           &lt;/title&gt;<br>
+           &lt;para&gt;<br>
+               Simulate a sleep of &#39;seconds&#39; 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>
+               &lt;/para&gt;<br>
+               &lt;para&gt;<br>
+               The routename parameter can be a static string or a dynamic string<br>
+               value with config variables.<br>
+               &lt;/para&gt;<br>
+               &lt;para&gt;<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>
+               &lt;/para&gt;<br>
+               &lt;para&gt;<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>
+               &lt;/para&gt;<br>
+               &lt;example&gt;<br>
+               &lt;title&gt;&lt;function&gt;async_sleep&lt;/function&gt; usage&lt;/title&gt;<br>
+               &lt;programlisting format=&quot;linespecific&quot;&gt;<br>
+...<br>
+async_route(&quot;RESUME&quot;, &quot;4&quot;);<br>
+...<br>
+route[RESUME] {<br>
+   send_reply(&quot;404&quot;, &quot;Not found&quot;);<br>
+   exit;<br>
+}<br>
+...<br>
+&lt;/programlisting&gt;<br>
+           &lt;/example&gt;<br>
+       &lt;/section&gt;<br>
+<br>
+       &lt;section&gt;<br>
            &lt;title&gt;<br>
                &lt;function moreinfo=&quot;none&quot;&gt;async_sleep(seconds)&lt;/function&gt;<br>
            &lt;/title&gt;<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>