<p>Sorry for formatting, re-attaching script snippet:</p>

<pre><code>route[CGR_AUTH] {
...
async(rest_post("http://127.0.0.1:2080/jsonrpc", "$json(cgr_auth)", "application/json", "$json(cgr_auth_reply)", "$var(ct)", "$var(rcode)"), CGR_AUTH_REPLY);
}
route[CGR_AUTH_REPLY] {
xlog("In CGR_AUTH_REPLY, reply received: $json(cgr_auth_reply), result: $json(cgr_auth_reply/result)");
}
</code></pre>

<p>And results:</p>

<pre><code>root@OsipsDev1:~/cgrates# May  2 22:21:32 OsipsDev1 /usr/sbin/opensips[27197]: { "id": "1", "method": "ApierV1.GetMaxSessionTime", "params": [ { "Account": "1002", "Destination": "1002" } ] }
####
T 2015/05/02 22:21:32.881899 127.0.0.1:38528 -&gt; 127.0.0.1:2080 [AP]
POST /jsonrpc HTTP/1.1.
Host: 127.0.0.1:2080.
Accept: */*.
Content-Type: application/json.
Content-Length: 112.
.
{ "id": "1", "method": "ApierV1.GetMaxSessionTime", "params": [ { "Account": "1002", "Destination": "1002" } ] }
##
T 2015/05/02 22:21:32.882474 127.0.0.1:2080 -&gt; 127.0.0.1:38528 [AP]
HTTP/1.1 200 OK.
Content-Type: application/json.
Date: Sat, 02 May 2015 20:21:32 GMT.
Content-Length: 36.
.
{"id":"1","result":-1,"error":null}

#May  2 22:21:54 OsipsDev1 /usr/sbin/opensips[27197]: ERROR:rest_client:start_async_http_req: timeout while connecting to 'http://127.0.0.1:2080/jsonrpc' (20 sec)
May  2 22:21:54 OsipsDev1 /usr/sbin/opensips[27197]: In CGR_AUTH_REPLY, reply received: &lt;null&gt;

#
T 2015/05/02 22:22:05.261449 127.0.0.1:38528 -&gt; 127.0.0.1:2080 [AP]
POST /jsonrpc HTTP/1.1.
Host: 127.0.0.1:2080.
Accept: */*.
Content-Type: application/json.
Content-Length: 112.
.
{ "id": "1", "method": "ApierV1.GetMaxSessionTime", "params": [ { "Account": "1002", "Destination": "1002" } ] }
May  2 22:22:05 OsipsDev1 /usr/sbin/opensips[27197]: { "id": "1", "method": "ApierV1.GetMaxSessionTime", "params": [ { "Account": "1002", "Destination": "1002" } ] }
#
T 2015/05/02 22:22:05.262231 127.0.0.1:2080 -&gt; 127.0.0.1:38528 [AP]
HTTP/1.1 200 OK.
Content-Type: application/json.
Date: Sat, 02 May 2015 20:22:05 GMT.
Content-Length: 36.
.
{"id":"1","result":-1,"error":null}

#May  2 22:22:05 OsipsDev1 /usr/sbin/opensips[27197]: In CGR_AUTH_REPLY, reply received: {"id":"1","result":-1,"error":null}
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/493#issuecomment-98396300">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciewZgWbMNynWzfbYOGUpU5owgapyks5oFSrmgaJpZM4EOTy5.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/OpenSIPS/opensips/issues/493#issuecomment-98396300"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>