<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello!<div>Version 5.1.3 works well in non-transactional mode ( $http_req(suspend) = 0; )</div><div><br></div><div><div>[root@10-10-10-10 ~]# kamailio -v</div><div>version: kamailio 5.1.3 (x86_64/linux)</div><div>flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES</div><div>ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB</div><div>poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.</div><div>id: unknown</div><div>compiled on 14:15:42 Aug 10 2018 with gcc 4.8.5</div></div><div><br></div><div><br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">пт, 28 сент. 2018 г. в 12:32, Federico Cabiddu <<a href="mailto:federico.cabiddu@gmail.com">federico.cabiddu@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div>as far as I can see that part has not substantially changed.</div><div>Can you try with latest stable release in 5.1?</div><div><br></div><div>Best regards,</div><div><br></div><div>Federico </div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 27, 2018 at 5:03 PM Denys Pozniak <<a href="mailto:denys.pozniak@gmail.com" target="_blank">denys.pozniak@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This example does not work. I do not see log message.<div><br><div>
<p class="m_-1109194770501015822m_4513212419940989859gmail-title" style="font-family:Helvetica,Arial,sans-serif;text-align:justify;color:rgb(0,0,0);font-size:15px;text-decoration-style:initial;text-decoration-color:initial"><strong>Example 1.13. <code class="m_-1109194770501015822m_4513212419940989859gmail-function">http_async_suspend()</code><span> </span>usage</strong></p><div class="m_-1109194770501015822m_4513212419940989859example-contents" style="color:rgb(0,0,0);font-family:Helvetica,Arial,sans-serif;font-size:15px;text-decoration-style:initial;text-decoration-color:initial"><pre class="m_-1109194770501015822m_4513212419940989859gmail-programlisting" style="font-family:monospace;white-space:pre-wrap;background-color:rgb(252,255,252);border:1px solid rgb(153,204,204);color:rgb(0,0,0);padding-left:15pt;overflow:auto;border-radius:2.5px">...
t_newtran();
http_async_suspend(0);
# the transaction won't be suspended for the next query
http_async_query("<a href="http://example.com/test.php" target="_blank">http://example.com/test.php</a>", "HTTP_REPLY");
xlog("L_INFO", "query sent\n");
t_reply("200", "Ok");
...</pre></div>
<br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-09-27 17:54 GMT+03:00 Federico Cabiddu <span dir="ltr"><<a href="mailto:federico.cabiddu@gmail.com" target="_blank">federico.cabiddu@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">What do you mean with "does not work well "?<div>I don't remember any change in that part but anyway you should switch to 5.0 or 5.1 releases, since those are the maintained ones.</div><div><br></div><div>Best regards,</div><div><br></div><div>Federico</div></div><div class="m_-1109194770501015822m_4513212419940989859HOEnZb"><div class="m_-1109194770501015822m_4513212419940989859h5"><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 27, 2018 at 4:50 PM Denys Pozniak <<a href="mailto:denys.pozniak@gmail.com" target="_blank">denys.pozniak@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Looks like http_async_suspend(0); does not work well in v4.4.2.<br><br><a href="https://www.kamailio.org/docs/modules/4.4.x/modules/http_async_client.html#http_async_client.f.http_async_suspend" target="_blank">https://www.kamailio.org/docs/modules/4.4.x/modules/http_async_client.html#http_async_client.f.http_async_suspend</a></div><div class="gmail_extra"><br><div class="gmail_quote">2018-09-27 17:40 GMT+03:00 Denys Pozniak <span dir="ltr"><<a href="mailto:denys.pozniak@gmail.com" target="_blank">denys.pozniak@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">So my config is ok and I need to add all next logic with call routing to <span style="font-size:12.8px">route[HTTP_REPLY] ,correct ?</span><div><span style="font-size:12.8px"><br></span></div><div><br>
</div></div><div class="gmail_extra"><div><div class="m_-1109194770501015822m_4513212419940989859m_-3298100102280762364m_8846477933762454996h5"><br><div class="gmail_quote">2018-09-27 16:42 GMT+03:00 Federico Cabiddu <span dir="ltr"><<a href="mailto:federico.cabiddu@gmail.com" target="_blank">federico.cabiddu@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi,<br><div>if you are in a transactional contest (as you are since you are calling t_newtran()), the script execution is suspended, upon calling http_async_query and resumed in the callback route passed as parameter.</div><div>The instructions after the call to http_async_query are never executed. If you are not in a transactional contest or you explicitly instruct to not suspend the transaction ($http(suspend) = 0, <a href="http://www.kamailio.org/docs/modules/devel/modules/http_async_client.html#idm1053320700" target="_blank">http://www.kamailio.org/docs/modules/devel/modules/http_async_client.html#idm1053320700</a>) they will be executed, and the callback route will be run when the http reply comes. If you want to use http uqeries to retrieve parameters you want to use for your routing logic, you need to suspend the transaction and resume it in the callback.</div><div>Hope this clarify.</div><div><br></div><div>Best regards,</div><div><br></div><div>Federico</div></div></div><br><div class="gmail_quote"><div><div class="m_-1109194770501015822m_4513212419940989859m_-3298100102280762364m_8846477933762454996m_-552783405992849335h5"><div dir="ltr">On Thu, Sep 27, 2018 at 3:36 PM Denys Pozniak <<a href="mailto:denys.pozniak@gmail.com" target="_blank">denys.pozniak@gmail.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-1109194770501015822m_4513212419940989859m_-3298100102280762364m_8846477933762454996m_-552783405992849335h5"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello!<br clear="all"><div><br></div><div>Please help me to understand how http_async_client module behaves. I am going to use it for call routing according to the http response.</div><div><br></div><div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255)">if (is_method("INVITE")) {</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255)"> t_newtran();</div><div style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"> xlog("L_ERR", "ASYNC0-$fU-$rU-$rm---- \n");<br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255)"><div> http_set_timeout(1000);</div><div> http_set_method("POST");</div><div> http_append_header("Content-Type: application/json");</div><div> http_async_query("<a href="http://10.10.10.10:8080/RPC" target="_blank">http://10.10.10.10:8080/RPC</a>", "{\"jsonrpc\": \"2.0\", \"method\": \"ul.lookup\", \"params\": [\"location\",\"user\"], \"id\": 1}", "HTTP_REPLY");<br></div></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255)"> xlog("L_ERR", "ASYNC1-$fU-$rU-$rm---- \n");</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;background-color:rgb(255,255,255)">}</div><br class="m_-1109194770501015822m_4513212419940989859m_-3298100102280762364m_8846477933762454996m_-552783405992849335m_-1077479480485895933m_-2980682632941155638gmail-Apple-interchange-newline"></div><div><div>route[HTTP_REPLY] {</div><div> xlog("L_ERR", "HTTP_REPLY: ok $http_ok \n");<br></div><div> xlog("L_ERR", "HTTP_REPLY: status $http_rs\n");</div><div> xlog("L_ERR", "HTTP_REPLY: body $http_rb\n");</div><div> xlog("L_ERR", "HTTP_REPLY: error $http_err)\n");</div><div>}<br></div><div><br></div></div><div><br></div><div>In syslog I see HTTP_REPLY log strings with correct response, but do not see <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">ASYNC1 string and script execution stops.</span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">What's wrong with this?</span></div><div><br></div><div><br></div><div><br></div><div><div># kamailio -v</div><div>version: kamailio 4.4.2 (x86_64/linux) 892ad6</div><div>flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES</div><div>ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB</div><div>poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.</div><div>id: 892ad6</div><div>compiled on 12:58:38 Aug 28 2017 with gcc 4.8.5</div></div><div><br></div><div><br></div><div><br></div><div><br></div>-- <br><div class="m_-1109194770501015822m_4513212419940989859m_-3298100102280762364m_8846477933762454996m_-552783405992849335m_-1077479480485895933m_-2980682632941155638gmail_signature"><div dir="ltr"><br><div><div>BR,</div><div>Denys Pozniak<br></div><div><br></div><div><br></div></div></div></div>
</div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>
<br>_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="m_-1109194770501015822m_4513212419940989859m_-3298100102280762364m_8846477933762454996HOEnZb"><font color="#888888">-- <br><div class="m_-1109194770501015822m_4513212419940989859m_-3298100102280762364m_8846477933762454996m_-552783405992849335gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br><div><div>BR,</div><div>Denys Pozniak<br></div><div><br></div><div><br></div></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-1109194770501015822m_4513212419940989859m_-3298100102280762364m_8846477933762454996gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br><div><div>BR,</div><div>Denys Pozniak<br></div><div><br></div><div><br></div></div></div></div>
</div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>
</div></div><br>_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-1109194770501015822m_4513212419940989859gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br><div><div>BR,</div><div>Denys Pozniak<br></div><div><br></div><div><br></div></div></div></div>
</div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br><div><div>BR,</div><div>Denys Pozniak<br></div><div><br></div><div><br></div></div></div></div>