[SR-Users] Error when using http_async_client $http_query_id var

jenus at cyberchaos.nl jenus at cyberchaos.nl
Mon Jul 23 13:37:30 CEST 2018


Hello,

I'm trying to build a async http call to a external server and was 
trying to use the $http_query_id var to identity the http call in the 
response route.

But when i try the following:

$http_req(suspend) = 0;
$http_req(hdr) = "Content-Type: application/json";
$http_req(body) = "{'r_uri':'" + $rU + "', 'f_uri':'" + $fU + "'}";
http_async_query("http://10.10.10.1/", "ACC_HTTP_REPLY");
xlog("L_WARN", "ACC Query id: $http_query_id");


route[ACC_HTTP_REPLY] {
     xlog("L_WARN", "route[ACC_HTTP_REPLY]: received reply for query 
$http_query_id\n");
}

I get errors in the kamailio log file :

Jul 23 11:34:14 sip03 /usr/sbin/kamailio[24645]: ERROR: <core> 
[core/pvapi.c:903]: pv_parse_spec2(): error searching pvar 
"http_query_id"
Jul 23 11:34:14 sip03 /usr/sbin/kamailio[24645]: ERROR: <core> 
[core/pvapi.c:1107]: pv_parse_spec2(): wrong char [d/100] in 
[$http_query_id] at [13 (0)]
Jul 23 11:34:14 sip03 /usr/sbin/kamailio[24645]: ERROR: xlog 
[xlog.c:513]: xdbg_fixup_helper(): wrong format[route[ACC_HTTP_REPLY]: 
received reply for query $http_query_id#012]
Jul 23 11:34:14 sip03 /usr/sbin/kamailio[24645]: ERROR: <core> 
[core/route.c:1154]: fix_actions(): fixing failed (code=-1) at 
cfg://etc/kamailio/kamailio.cfg:5308
Jul 23 11:36:07 sip03 /usr/sbin/kamailio[24906]: ERROR: <core> 
[core/pvapi.c:903]: pv_parse_spec2(): error searching pvar 
"http_query_id"
Jul 23 11:36:07 sip03 /usr/sbin/kamailio[24906]: ERROR: <core> 
[core/pvapi.c:1107]: pv_parse_spec2(): wrong char [)/41] in 
[$(http_query_id)] at [15 (1)]
Jul 23 11:36:07 sip03 /usr/sbin/kamailio[24906]: ERROR: xlog 
[xlog.c:513]: xdbg_fixup_helper(): wrong format[route[ACC_HTTP_REPLY]: 
received reply for query $(http_query_id)#012]
Jul 23 11:36:07 sip03 /usr/sbin/kamailio[24906]: ERROR: <core> 
[core/route.c:1154]: fix_actions(): fixing failed (code=-1) at 
cfg://etc/kamailio/kamailio.cfg:5308


Should i escape the var $http_query_id in some way?

I'm running kamailio 5.1.3.


Thanks,

Jan



More information about the sr-users mailing list