[asterisk-commits] kharwell: branch kharwell/pimp_sip_state r390343 - /team/kharwell/pimp_sip_st...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 31 15:44:31 CDT 2013


Author: kharwell
Date: Fri May 31 15:44:29 2013
New Revision: 390343

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390343
Log:
addressed review issues

Modified:
    team/kharwell/pimp_sip_state/res/res_sip_exten_state.c

Modified: team/kharwell/pimp_sip_state/res/res_sip_exten_state.c
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_state/res/res_sip_exten_state.c?view=diff&rev=390343&r1=390342&r2=390343
==============================================================================
--- team/kharwell/pimp_sip_state/res/res_sip_exten_state.c (original)
+++ team/kharwell/pimp_sip_state/res/res_sip_exten_state.c Fri May 31 15:44:29 2013
@@ -225,6 +225,7 @@
 	ast_copy_pj_str(remote, &dlg->remote.info_str, sizeof(remote));
 
 	if (provider->create_body(exten_state_data, local, remote, &body_text)) {
+		ast_log(LOG_ERROR, "Unable to create body on NOTIFY request\n");
 		return;
 	}
 
@@ -540,6 +541,8 @@
 	if (ast_sip_register_subscription_handler(handler)) {
 		ast_log(LOG_WARNING, "Unable to register subscription handler %s\n",
 			handler->event_name);
+		ao2_cleanup(handler);
+		return NULL;
 	}
 
 	return handler;
@@ -567,7 +570,11 @@
 		return -1;
 	}
 
-	obj->handler = create_and_register_handler(obj->event_name, obj->body_type);
+	if (!(obj->handler = create_and_register_handler(obj->event_name, obj->body_type))) {
+		ast_log(LOG_WARNING, "Handler could not be registered for provider event %s\n",
+		    obj->event_name);
+		return -1;
+	}
 
 	AST_RWLIST_INSERT_TAIL(&providers, obj, next);
 	ast_module_ref(ast_module_info->self);




More information about the asterisk-commits mailing list