<p>This is based on OpenSIPS 1.8.0, so this may already be fixed, but glancing at the source code I don't think it has been.</p>

<p>With the <code>include_file</code> functionality, parsing errors at startup include the file name and line number of the bad syntax.</p>

<p>However, at runtime, the error messages don't include this informations, for example:</p>

<pre><code>WARNING:core:do_action: error in expression (l=183)
</code></pre>

<p>This makes it very hard to debug runtime errors if you have a dozen include files.</p>

<p>Suggestion for implementing, from a distant perspective:</p>

<ol class="task-list">
<li>Add a <code>const char*</code> to <code>struct action</code>, which currently holds the line number.</li>
<li>Fill in value during the script parsing, since it is known then</li>
<li>To be memory efficient, there should probably be one array of strings for the filenames, and the pointer value in <code>struct action</code> would simply point to the correct entry in this array.</li>
</ol>

<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/299">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMzUwNzQ5MiwiZGF0YSI6eyJpZCI6Mzk1MTQ0ODF9fQ==--8630785da3e233f480883101fe49cad9510725e5.gif" width="1" /></p>