<div dir="ltr">Hi this should be better documented. I'll update the documentation accordingly.<div>On the other hand I see that you are using in the config <span style="font-size:12.8px">http_set* and </span><span style="font-size:12.8px">http_append_header functions.</span></div><div><span style="font-size:12.8px">I'd suggest to use the $http_req pseudovariable for the same purpouse (<a href="http://www.kamailio.org/docs/modules/4.4.x/modules/http_async_client.html#idp32731036">http://www.kamailio.org/docs/modules/4.4.x/modules/http_async_client.html#idp32731036</a>), since those functions will be removed in master branch (so in future 5.0).</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Cheers,</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Federico</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 15, 2016 at 10:16 PM, Jonathan Hunter <span dir="ltr"><<a href="mailto:hunterj91@hotmail.com" target="_blank">hunterj91@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr">Hi Federico,<div><br></div><div>Hope you are well?</div><div><br></div><div>Thanks for the reply, <span style="font-size:12pt">t_newtran()</span><span style="font-size:12pt">  before </span><span style="font-size:12pt">http_async_query works perfectly!</span></div><div><span style="font-size:12pt"><br></span></div><div><span style="font-size:12pt">Many thanks</span></div><div><span style="font-size:12pt"><br></span></div><div><span style="font-size:12pt">Jon</span></div><div><br><br><div><hr>From: <a href="mailto:federico.cabiddu@gmail.com" target="_blank">federico.cabiddu@gmail.com</a><br>Date: Thu, 15 Sep 2016 19:47:31 +0200<br>To: <a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>Subject: Re: [SR-Users] http_async_query - How to Allow SIP transaction to continue<div><div class="h5"><br><br><div dir="ltr">Hi,<div>did you create the transaction before calling http_async_query?</div><div>If not, the function switch to non-transactional context, the script execution is not stopped (you should notice it in your logs if the log line after the function call is printed) and the callback function creates a fake message to be processed in the callback route. <br></div><div>You should call t_newtran() before calling http_async_query.</div><div><br></div><div>Cheers,</div><div><br></div><div>Federico</div></div><div><br><div>On Thu, Sep 15, 2016 at 5:44 PM, Jonathan Hunter <span dir="ltr"><<a href="mailto:hunterj91@hotmail.com" target="_blank">hunterj91@hotmail.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr"><div>Hi Guys,</div><div><br></div><div>I am just testing with jansson and http_async_query.</div><div><br></div><div>Essentially I sent an INVITE into kamailio ,it hits CALL_START_REQUEST (see below) and the query allows the http site I send to, to provide routing details for kamailio.</div><div><br></div><div>Logging the $rm that hits CALL_START_ REQUEST, it shows as INVITE, however when CALL_START_REQUEST_REPLY is hit, the message type is OPTIONS, is this expected behaviour?</div><div><br></div><div>Essentially I want it to continue in the script with the same $ci,$rm so I can onwards route it for termination, but all I get are options messages being sent, any hints please?</div><div><br></div><div>As Ideally I want the transaction to continue to a route where I can forward on modified request for termination.</div><div><br></div><div>Thanks</div><div><br></div><div>Jon</div><div><br></div><div><br></div><div><br></div><div>Routes;</div><div><br></div><div><br></div><div># Send to FreeSWITCH</div><div>route[CALL_START_REQUEST]{</div><div>xlog("L_INFO","route[CALL_STAR<wbr>T_REQUEST] Call received $ci,$rm,$ru,$du\n");</div><div><br></div><div>###Build JSON request to send to MAP</div><div>$var(params) = $null;</div><div>jansson_set("string", "username", "xxx", "$var(params)");</div><div>jansson_set("string", "password", "xxx", "$var(params)");</div><div>jansson_set("string", "source", "$fU", "$var(params)");</div><div>jansson_set("string", "route", "$var(carriername)", "$var(params)");</div><div>jansson_set("string", "destination", "$rU", "$var(params)");</div><div>/// other fields set here</div><div>http_set_timeout(5000);</div><div>http_set_method("POST");</div><div>http_append_header("Content-Ty<wbr>pe: application/json");</div><div>http_async_query("<a href="http://test.com" target="_blank">http://test.<wbr>com</a>", "$var(params)", "CALL_START_REQUEST_REPLY");</div><div>xlog("L_INFO", "Checking here we have status=$var(status)\n");</div><div>xlog("L_INFO", "Current Destination is $du\n");</div><div>#return;</div><div>#exit;</div><div>}</div><div>#########################</div><div>route[CALL_START_REQUEST_REPLY<wbr>]{</div><div>xlog("L_INFO", "route[CALL_START_REQUEST_REPL<wbr>Y]: $ci,$rm,$ru,$du\n");</div><div><br></div><div><br></div><div>Logs show;</div><div><br></div><div> route[CALL_START_REQUEST] Call received b087fa53-f5fc-1234-94ac-f68eb8<wbr>da94f7,INVITE,sip:<a href="http://8.8.8.8:5060" target="_blank">441624891676<wbr>@8.8.8.8:5060</a>;user=phone,<<wbr>null></div><div><br></div><div> route[CALL_START_REQUEST_REPL<wbr>Y]: 123,OPTIONS,<a href="mailto:sip%3AG711A-282951200@kamailio.org" target="_blank">sip:G711A-28295120<wbr>0@kamailio.org</a>,<a href="http://8.8.8.8:5080" target="_blank">sip:G711A-<wbr>282951200@8.8.8.8:5080</a></div><div><br></div>                                     </div></div>
<br>______________________________<wbr>_________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cg<wbr>i-bin/mailman/listinfo/sr-user<wbr>s</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a></div></div></div></div>                                           </div></div>
<br>______________________________<wbr>_________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div><br></div>