[OpenSIPS-Devel] [opensips] Async http replies randomly missed (#493)

Dan Christian Bogos notifications at github.com
Sat May 2 22:28:22 CEST 2015


Sorry for formatting, re-attaching script snippet:

```
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)");
}
```

And results:
```
root at 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 -> 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 -> 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: <null>

#
T 2015/05/02 22:22:05.261449 127.0.0.1:38528 -> 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 -> 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}
```


---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/493#issuecomment-98396300
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20150502/056086ab/attachment.htm>


More information about the Devel mailing list