diff options
author | Mark Michelson <mmichelson@digium.com> | 2014-05-06 17:47:20 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2014-05-06 17:47:20 +0000 |
commit | 9eae6c3f5bad40f3c23f34be9c8d33f67da49c72 (patch) | |
tree | 4f7bf168c7ab9c00bf45a63e9b832a89be1f4909 /res/res_pjsip_registrar.c | |
parent | 3f5d4516bdc63d398e850fd419b1b75bb2c1f212 (diff) |
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)
........
Merged revisions 413358 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_registrar.c')
-rw-r--r-- | res/res_pjsip_registrar.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/res/res_pjsip_registrar.c b/res/res_pjsip_registrar.c index 58f4b3214..adfa40844 100644 --- a/res/res_pjsip_registrar.c +++ b/res/res_pjsip_registrar.c @@ -537,7 +537,12 @@ static int rx_task(void *data) 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", |