[asterisk-commits] kharwell: trunk r426761 - in /trunk: ./ res/res_pjsip/pjsip_options.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Oct 30 12:18:51 CDT 2014
Author: kharwell
Date: Thu Oct 30 12:18:47 2014
New Revision: 426761
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=426761
Log:
res_pjsip: incorrect qualify statistics after disabling for contact
When removing the qualify_frequency from an AoR or a contact the statistics
shown when issuing "pjsip show aors" from the CLI are incorrect. This patch
deletes the contact's status object from sorcery, disassociating it from the
contact, if the qualify_freqency is removed from configuration.
ASTERISK-24462 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4116/
........
Merged revisions 426755 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 426757 from http://svn.asterisk.org/svn/asterisk/branches/13
Modified:
trunk/ (props changed)
trunk/res/res_pjsip/pjsip_options.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.
Modified: trunk/res/res_pjsip/pjsip_options.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip/pjsip_options.c?view=diff&rev=426761&r1=426760&r2=426761
==============================================================================
--- trunk/res/res_pjsip/pjsip_options.c (original)
+++ trunk/res/res_pjsip/pjsip_options.c Thu Oct 30 12:18:47 2014
@@ -85,6 +85,19 @@
return status;
}
+static void delete_contact_status(const struct ast_sip_contact *contact)
+{
+ struct ast_sip_contact_status *status = ast_sorcery_retrieve_by_id(
+ ast_sip_get_sorcery(), CONTACT_STATUS, ast_sorcery_object_get_id(contact));
+
+ if (!status) {
+ return;
+ }
+
+ ast_sorcery_delete(ast_sip_get_sorcery(), status);
+ ao2_ref(status, -1);
+}
+
/*!
* \internal
* \brief Update an ast_sip_contact_status's elements.
@@ -470,6 +483,8 @@
}
schedule_qualify(contact);
+ } else {
+ delete_contact_status(contact);
}
}
More information about the asterisk-commits
mailing list