<div dir="ltr">Dear Users,<div>I am trying to break the while loop in opensips.cfg when a particular condition meet. For that I am using &#39;break&#39; statement inside a while loop. But when I type break it gives me sytax error :<br><br><div>Jun 14 06:56:00 s81519 opensips: CRITICAL:core:yyerror: parse error in config file /usr/local/etc/opensips/opensips.cfg, line 697, column 5-10: syntax error</div><div>Jun 14 06:56:00 s81519 opensips: CRITICAL:core:yyerror: parse error in config file /usr/local/etc/opensips/opensips.cfg, line 697, column 5-10: bad command!)</div><div>Jun 14 06:56:00 s81519 opensips: CRITICAL:core:yyerror: parse error in config file /usr/local/etc/opensips/opensips.cfg, line 697, column 5-10: bad command!)</div><div>Jun 14 06:56:00 s81519 opensips: ERROR:core:main: bad config file (3 errors)</div><div>Jun 14 06:56:00 s81519 opensips: NOTICE:core:main: Exiting....</div></div><div><br></div><div>If I will use return instead of break it will return from the current route which is also not my requirement. Below is the code snippet.</div><div><br>                           <font face="monospace, monospace"> $var(i) = 0</font>;<br><div><font face="monospace, monospace">                while($var(i) &lt; 10) {</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">                        </span>usleep(&quot;20000&quot;);</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">                        </span>cache_raw_query(&quot;redis:group2&quot;,&quot;HGETALL $avp(dialed)&quot;,&quot;$avp(result)&quot;);</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">                        </span>if ($avp(result) != NULL) {</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">                                </span>$avp(CALLER) = $(avp(result)[1]);</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">                                </span>$avp(LRN) = $(avp(result)[3]);</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">                                </span>xlog(&quot;L_NOTICE&quot;,&quot;[$Ts:$avp(cid)]: LRN Returned &#39;$avp(LRN)&#39;&quot;);</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">                                break</span>; #Line number 697</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">                        </span>}</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">                        </span>$var(i) = $var(i) + 1;</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">                </span>}</font></div></div><div><font face="monospace, monospace"><br></font></div><div>Please guide.</div><div><br></div><div>Regards,</div><div>Husnain Taseer</div><div>VoIP Developer</div></div>