[svn-commits] mmichelson: branch 12 r413358 - /branches/12/res/res_pjsip_registrar.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue May 6 12:46:48 CDT 2014


Author: mmichelson
Date: Tue May  6 12:46:44 2014
New Revision: 413358

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=413358
Log:
Check for an act on failures to update contacts during registration.

There was an underlying issue in a realtime backend where database updates
would fail. Since we were not checking for failure, we would end up in a
strange state where the old database entry was still present but Asterisk
thought that it had been updated. Now when an entry fails to update, we
print a warning and delete the old contact from sorcery so there is no
mismatch between foreground and backend state.

Patches:
	res_pjsip_registrar.patch by John Hardin (License #6512)


Modified:
    branches/12/res/res_pjsip_registrar.c

Modified: branches/12/res/res_pjsip_registrar.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/res/res_pjsip_registrar.c?view=diff&rev=413358&r1=413357&r2=413358
==============================================================================
--- branches/12/res/res_pjsip_registrar.c (original)
+++ branches/12/res/res_pjsip_registrar.c Tue May  6 12:46:44 2014
@@ -537,7 +537,12 @@
 				ast_string_field_set(contact_update, user_agent, user_agent);
 			}
 
-			ast_sip_location_update_contact(contact_update);
+			if (ast_sip_location_update_contact(contact_update)) {
+				ast_log(LOG_ERROR, "Failed to update contact '%s' expiration time to %d seconds.\n",
+					contact->uri, expiration);
+				ast_sorcery_delete(ast_sip_get_sorcery(), contact);
+				continue;
+			}
 			ast_debug(3, "Refreshed contact '%s' on AOR '%s' with new expiration of %d seconds\n",
 				contact_uri, aor_name, expiration);
 			ast_test_suite_event_notify("AOR_CONTACT_REFRESHED",




More information about the svn-commits mailing list