<div dir="auto">it would have been better if you have showed how you are calling it in your script, especially in which route block, but anyways,<div><br></div><div>1. In transaction-less scenario, after calling this function the script execution will continue, so you have to send some provisional reply, such as "100 Trying" and then exit. Upon receiving http response, named-route will be executed in failure route context and you can send the actual / final sip response e.g. 302.<div><br></div><div>2. If you have created transaction, then you send provisional reply "100 Trying" BEFORE calling this function, since script execution will be paused upon function call. When a http response is received you will be in named-route but still be in old context (main or branch but with async related limitations) and can send final sip response e.g. 302.<br><div><br></div><div>Also note that things will dramatically change if you fork the sip call before calling this function, in which case it is best to call this function in branch route instead of main or failure route.</div><div><br></div><div>Hope this helps.</div></div></div><div><br></div><div>--</div><div>Muhammad Shahzad Shafi</div><div>Tel: +49 176 99 83 10 85</div></div><div style="line-height:1.5"><br><br>-------- Original message --------<br>From: Brooks Bridges <bbridges@call48.com><br>Date: Fri, 15 Oct 2021, 17:03<br>To: sr-users@lists.kamailio.org<br>Subject: [SR-Users] http_async_client "route_name" is considered a failure route?<br><blockquote>So I've been working on this for a while, and I cannot seem to find a way around this.  When using the http_async_client to request data from an external API, the returned data in the "route_name" target is being treated as a failure route, so most of the subsequent processing and messaging that I want to do is not working, either because the function can't be used in a failure route, or because I have to create a transaction prior to doing the request, which then throws an error by immediately triggering a 500 after I return the response I want (via 302 to the requesting client).<br><br>Am I using http_async_client incorrectly somehow that's causing this behavior or is it expected that the response route is treated as a failure route?<br><br>Confidentiality Notice: This e-mail, and any attachment to it, contains privileged and confidential information intended only for the use of the individual(s) or entity named on the e-mail. If the reader of this e-mail is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that reading this e-mail is strictly prohibited. If you have received this e-mail in error, please immediately return it to the sender and delete it from your system.<br><br>__________________________________________________________<br>Kamailio - Users Mailing List - Non Commercial Discussions<br>  * sr-users@lists.kamailio.org<br>Important: keep the mailing list in the recipients, do not reply only to the sender!<br>Edit mailing list options or unsubscribe:<br>  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users<br></blockquote></div>