<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Guys,</p>
<p><br>
</p>
<p>Looks like return code = -1 does the trick for me?!</p>
<p><br>
</p>
<p>Sorry for noise please comment if there is a better way.</p>
<p><br>
</p>
<p>thanks</p>
<p><br>
</p>
<p>Jon</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Jonathan Hunter <hunterj91@hotmail.com><br>
<b>Sent:</b> 17 November 2017 14:56<br>
<b>To:</b> Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> [SR-Users] kamailio 4.4 - jansson_get_field parse error actions</font>
<div> </div>
</div>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p></p>
<div>Hi Guys,</div>
<div><br>
</div>
<div>I am looking to send calls to a default route should we have issues when connecting to our API which provides routing instructions.</div>
<div><br>
</div>
<div>On scenario is handling an invalid JSON response , which would result in a parse error.</div>
<div><br>
</div>
<div>Is it possible to capture when there is a failed to parse error when dealing with JSON responses to an http query in kamailio? </div>
<div><br>
</div>
<div>In particular when using the jansson_get_field, I am looking to default to a route should their be a parse error, so I am forcing an erro, I get this in the logs, but can I grab to act on it?</div>
<div><br>
</div>
<div>Nov 17 14:37:25 ip-172-31-34-165 /usr/local/kamailio-4.4/sbin/kamailio[9735]: ERROR: jansson [jansson_funcs.c:59]: janssonmod_get(): failed to parse: 200 OK</div>
<div>Nov 17 14:37:25 ip-172-31-34-165 /usr/local/kamailio-4.4/sbin/kamailio[9735]: ERROR: jansson [jansson_funcs.c:61]: janssonmod_get(): json error at line 1: '[' or '{' expected near '200'</div>
<div>Nov 17 14:37:25 ip-172-31-34-165 /usr/local/kamailio-4.4/sbin/kamailio[9735]: ERROR: jansson [jansson_funcs.c:59]: janssonmod_get(): failed to parse: 200 OK</div>
<div>Nov 17 14:37:25 ip-172-31-34-165 /usr/local/kamailio-4.4/sbin/kamailio[9735]: ERROR: jansson [jansson_funcs.c:61]: janssonmod_get(): json error at line 1: '[' or '{' expected near '200'</div>
<br>
<p></p>
<p>On receipt of this I would then like to hit a default route.</p>
<p><br>
</p>
<p>Many thanks</p>
<p><br>
</p>
<p>Jon</p>
</div>
</div>
</div>
</div>
</body>
</html>