<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><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_START_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-Type: application/json");</div><div>http_async_query("http://test.com", "$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]{</div><div>xlog("L_INFO", "route[CALL_START_REQUEST_REPLY]: $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-f68eb8da94f7,INVITE,sip:441624891676@8.8.8.8:5060;user=phone,<null></div><div><br></div><div> route[CALL_START_REQUEST_REPLY]: 123,OPTIONS,sip:G711A-282951200@kamailio.org,sip:G711A-282951200@8.8.8.8:5080</div><div><br></div>                                       </div></body>
</html>