[asterisk-commits] kharwell: branch 13 r426757 - in /branches/13: ./ res/res_pjsip/pjsip_options.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 30 12:17:30 CDT 2014


Author: kharwell
Date: Thu Oct 30 12:17:27 2014
New Revision: 426757

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=426757
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

Modified:
    branches/13/   (props changed)
    branches/13/res/res_pjsip/pjsip_options.c

Propchange: branches/13/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: branches/13/res/res_pjsip/pjsip_options.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip/pjsip_options.c?view=diff&rev=426757&r1=426756&r2=426757
==============================================================================
--- branches/13/res/res_pjsip/pjsip_options.c (original)
+++ branches/13/res/res_pjsip/pjsip_options.c Thu Oct 30 12:17:27 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