[sr-dev] git:master: usrloc: more verbose log messages in case of failure to update db records

Daniel-Constantin Mierla miconda at gmail.com
Tue Aug 13 09:19:57 CEST 2013


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Aug 13 09:19:02 2013 +0200

usrloc: more verbose log messages in case of failure to update db records

---

 modules/usrloc/urecord.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/usrloc/urecord.c b/modules/usrloc/urecord.c
index 89defe0..93c8446 100644
--- a/modules/usrloc/urecord.c
+++ b/modules/usrloc/urecord.c
@@ -333,7 +333,9 @@ static inline void wb_timer(urecord_t* _r)
 			/* Should we remove the contact from the database ? */
 			if (st_expired_ucontact(t) == 1) {
 				if (db_delete_ucontact(t) < 0) {
-					LM_ERR("failed to delete contact from the database\n");
+					LM_ERR("failed to delete contact from the database"
+							" (aor: %.*s)\n",
+							ptr->aor->len, ZSW(ptr->aor->s));
 				}
 			}
 
@@ -349,7 +351,9 @@ static inline void wb_timer(urecord_t* _r)
 
 			case 1: /* insert */
 				if (db_insert_ucontact(ptr) < 0) {
-					LM_ERR("inserting contact into database failed\n");
+					LM_ERR("inserting contact into database failed"
+							" (aor: %.*s)\n",
+							ptr->aor->len, ZSW(ptr->aor->s));
 					ptr->state = old_state;
 				}
 				break;
@@ -360,7 +364,8 @@ static inline void wb_timer(urecord_t* _r)
 				else
 					res = db_update_ucontact(ptr);
 				if (res < 0) {
-					LM_ERR("updating contact in db failed\n");
+					LM_ERR("updating contact in db failed (aor: %.*s)\n",
+							ptr->aor->len, ZSW(ptr->aor->s));
 					ptr->state = old_state;
 				}
 				break;




More information about the sr-dev mailing list