[sr-dev] git:master: registrar: relax usage of save() for failure route

Daniel-Constantin Mierla miconda at gmail.com
Fri Sep 20 11:10:07 CEST 2013


Module: sip-router
Branch: master
Commit: e2376e34fbabd929d0736bddb8e82ceb25cc3738
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e2376e34fbabd929d0736bddb8e82ceb25cc3738

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Fri Sep 20 11:07:31 2013 +0200

registrar: relax usage of save() for failure route

---

 modules/registrar/reg_mod.c |    6 +++---
 modules/registrar/save.c    |    3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/registrar/reg_mod.c b/modules/registrar/reg_mod.c
index 1538421..4539f67 100644
--- a/modules/registrar/reg_mod.c
+++ b/modules/registrar/reg_mod.c
@@ -171,11 +171,11 @@ static pv_export_t mod_pvs[] = {
  */
 static cmd_export_t cmds[] = {
 	{"save",         (cmd_function)w_save2,       1,  save_fixup, 0,
-			REQUEST_ROUTE | ONREPLY_ROUTE },
+			REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE },
 	{"save",         (cmd_function)w_save2,       2,  save_fixup, 0,
-			REQUEST_ROUTE | ONREPLY_ROUTE },
+			REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE },
 	{"save",         (cmd_function)w_save3,       3,  save_fixup, 0,
-			REQUEST_ROUTE | ONREPLY_ROUTE },
+			REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE },
 	{"lookup",       (cmd_function)w_lookup,      1,  domain_uri_fixup, 0,
 			REQUEST_ROUTE | FAILURE_ROUTE },
 	{"lookup",       (cmd_function)w_lookup,      2,  domain_uri_fixup, 0,
diff --git a/modules/registrar/save.c b/modules/registrar/save.c
index b2aa58a..fc4a60a 100644
--- a/modules/registrar/save.c
+++ b/modules/registrar/save.c
@@ -960,7 +960,8 @@ int save(struct sip_msg* _m, udomain_t* _d, int _cflags, str *_uri)
 	update_stat(accepted_registrations, 1);
 
 	/* Only send reply upon request, not upon reply */
-	if ((is_route_type(REQUEST_ROUTE)) && !is_cflag_set(REG_SAVE_NORPL_FL) && (reg_send_reply(_m) < 0))
+	if ((is_route_type(REQUEST_ROUTE) || is_route_type(FAILURE_ROUTE))
+			&& !is_cflag_set(REG_SAVE_NORPL_FL) && (reg_send_reply(_m) < 0))
 		return -1;
 
 	return ret;




More information about the sr-dev mailing list