[asterisk-commits] file: branch file/res_sip_registrar_expire r390828 - /team/file/res_sip_regis...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 7 07:42:46 CDT 2013


Author: file
Date: Fri Jun  7 07:42:38 2013
New Revision: 390828

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390828
Log:
Incorporate review feedback.

Modified:
    team/file/res_sip_registrar_expire/res/res_sip_registrar_expire.c

Modified: team/file/res_sip_registrar_expire/res/res_sip_registrar_expire.c
URL: http://svnview.digium.com/svn/asterisk/team/file/res_sip_registrar_expire/res/res_sip_registrar_expire.c?view=diff&rev=390828&r1=390827&r2=390828
==============================================================================
--- team/file/res_sip_registrar_expire/res/res_sip_registrar_expire.c (original)
+++ team/file/res_sip_registrar_expire/res/res_sip_registrar_expire.c Fri Jun  7 07:42:38 2013
@@ -93,6 +93,10 @@
 	RAII_VAR(struct contact_expiration *, expiration, NULL, ao2_cleanup);
 	int expires = MAX(0, ast_tvdiff_ms(contact->expiration_time, ast_tvnow()));
 
+	if (ast_tvzero(contact->expiration_time)) {
+		return;
+	}
+
 	if (!(expiration = ao2_alloc_options(sizeof(*expiration), contact_expiration_destroy, AO2_ALLOC_OPT_LOCK_NOLOCK))) {
 		return;
 	}
@@ -103,6 +107,9 @@
 	ao2_ref(expiration, +1);
 	if ((expiration->sched = ast_sched_add(sched, expires, contact_expiration_expire, expiration)) < 0) {
 		ao2_cleanup(expiration);
+		ast_log(LOG_ERROR, "Scheduled expiration for contact '%s' could not be performed, contact may persist past life\n",
+			ast_sorcery_object_get_id(contact));
+		return;
 	}
 
 	ao2_link(contact_autoexpire, expiration);




More information about the asterisk-commits mailing list