<p>Thanks, it can be merged, but it needs also a note in the docs about the new return code.</p>
<p>More about the return code of the save() -- returning 0 seems to be a bug right now, because there is a flag to control if the reply should be sent or not from the code -- REG_SAVE_NORPL_FL.</p>
<pre><code>error:
        update_stat(rejected_registrations, 1);
        if (is_route_type(REQUEST_ROUTE) && !is_cflag_set(REG_SAVE_NORPL_FL) )
                reg_send_reply(_m);

        return 0;
</code></pre>
<p>It should be a negative value and let the config writer to write a log, etc. and do exit. The default config file is expecting this in:</p>
<pre><code>     if (!save("location")) {
          sl_reply_error();
      }
      exit;
</code></pre>
<p>Probably more different return codes can be used in order to differentiate between various error cases.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/928#issuecomment-272414699">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZRD8sT7BM-VSl0qf98DwBezfZhQgks5rR1ZogaJpZM4LivSB">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZejIOAevdrIYbOKujksFm-dpYlAaks5rR1ZogaJpZM4LivSB.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/pull/928#issuecomment-272414699"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #928: Thanks, it can be merged, but it needs also a note in the docs about the new return code.\r\n\r\nMore about the return code of the save() -- returning 0 seems to be a bug right now, because there is a flag to control if the reply should be sent or not from the code -- REG_SAVE_NORPL_FL.\r\n\r\n```\r\nerror:\r\n\tupdate_stat(rejected_registrations, 1);\r\n\tif (is_route_type(REQUEST_ROUTE) \u0026\u0026 !is_cflag_set(REG_SAVE_NORPL_FL) )\r\n\t\treg_send_reply(_m);\r\n\r\n\treturn 0;\r\n```\r\n\r\nIt should be a negative value and let the config writer to write a log, etc. and do exit. The default config file is expecting this in:\r\n\r\n```\r\n     if (!save(\"location\")) {\r\n          sl_reply_error();\r\n      }\r\n      exit;\r\n```\r\n\r\nProbably more different return codes can be used in order to differentiate between various error cases."}],"action":{"name":"View Pull Request","url":"https://github.com/kamailio/kamailio/pull/928#issuecomment-272414699"}}}</script>