Module: kamailio
Branch: master
Commit: 3e1c3500b78593c3e0e376e872e3aa3028c2be65
URL:
https://github.com/kamailio/kamailio/commit/3e1c3500b78593c3e0e376e872e3aa3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2017-01-13T17:47:24+01:00
Merge pull request #928 from lbalaceanu/savefunc_retval
registrar: save() returns separate code on 503 generation
---
Modified: src/modules/registrar/README
Modified: src/modules/registrar/doc/registrar_admin.xml
Modified: src/modules/registrar/save.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3e1c3500b78593c3e0e376e872e3aa3…
Patch:
https://github.com/kamailio/kamailio/commit/3e1c3500b78593c3e0e376e872e3aa3…
---
diff --git a/src/modules/registrar/README b/src/modules/registrar/README
index 18ef6d7..220e2a8 100644
--- a/src/modules/registrar/README
+++ b/src/modules/registrar/README
@@ -856,7 +856,8 @@ modparam("registrar", "contact_max_size", 500)
be a dynamic string with pseudo-variables.
Return codes:
- * -1 - error.
+ * -2 - error, too many contacts for AOR.
+ -1 - error.
1 - contacts inserted.
2 - contacts updated.
3 - contacts deleted.
diff --git a/src/modules/registrar/doc/registrar_admin.xml
b/src/modules/registrar/doc/registrar_admin.xml
index 79aa2cd..0a81b8b 100644
--- a/src/modules/registrar/doc/registrar_admin.xml
+++ b/src/modules/registrar/doc/registrar_admin.xml
@@ -1030,6 +1030,9 @@ modparam("registrar", "contact_max_size", 500)
<itemizedlist>
<listitem>
<para>
+ <emphasis>-2</emphasis> - error, too many contacts for AOR.
+ </para>
+ <para>
<emphasis>-1</emphasis> - error.
</para>
<para>
diff --git a/src/modules/registrar/save.c b/src/modules/registrar/save.c
index 11d576f..4ed6e75 100644
--- a/src/modules/registrar/save.c
+++ b/src/modules/registrar/save.c
@@ -1007,7 +1007,9 @@ int save(struct sip_msg* _m, udomain_t* _d, int _cflags, str *_uri)
update_stat(rejected_registrations, 1);
if (is_route_type(REQUEST_ROUTE) && !is_cflag_set(REG_SAVE_NORPL_FL) )
reg_send_reply(_m);
-
+ if (R_TOO_MANY == rerrno)
+ return -2;
+ /* for all other */
return 0;
}