[asterisk-commits] kharwell: branch 12 r426755 - /branches/12/res/res_pjsip/pjsip_options.c

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


Author: kharwell
Date: Thu Oct 30 12:16:28 2014
New Revision: 426755

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

Modified:
    branches/12/res/res_pjsip/pjsip_options.c

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