Module: kamailio
Branch: master
Commit: f644356742e5967b442b5efb99f695566c99396a
URL:
https://github.com/kamailio/kamailio/commit/f644356742e5967b442b5efb99f6955…
Author: Lucian Balaceanu <lucian.balaceanu(a)1and1.ro>
Committer: Lucian Balaceanu <lucian.balaceanu(a)1and1.ro>
Date: 2017-01-13T17:21:19+02:00
registrar: save() returns new err code
- return err code on too many entries for AOR
---
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/f644356742e5967b442b5efb99f6955…
Patch:
https://github.com/kamailio/kamailio/commit/f644356742e5967b442b5efb99f6955…
---
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;
}