[sr-dev] [kamailio/kamailio] registrar: save() returns separate code on 503 generation (#928)

Daniel-Constantin Mierla notifications at github.com
Fri Jan 13 11:48:08 CET 2017


Thanks, it can be merged, but it needs also a note in the docs about the new return code.

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.

```
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;
```

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:

```
     if (!save("location")) {
          sl_reply_error();
      }
      exit;
```

Probably more different return codes can be used in order to differentiate between various error cases.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/928#issuecomment-272414699
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20170113/0b92ee92/attachment.html>


More information about the sr-dev mailing list