[asterisk-commits] dlee: branch dlee/ari-monitor2 r395925 - in /team/dlee/ari-monitor2/res: ./ ari/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 31 21:57:15 CDT 2013


Author: dlee
Date: Wed Jul 31 21:57:13 2013
New Revision: 395925

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=395925
Log:
Error checking

Modified:
    team/dlee/ari-monitor2/res/ari/resource_channels.c
    team/dlee/ari-monitor2/res/res_stasis_recording.c

Modified: team/dlee/ari-monitor2/res/ari/resource_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-monitor2/res/ari/resource_channels.c?view=diff&rev=395925&r1=395924&r2=395925
==============================================================================
--- team/dlee/ari-monitor2/res/ari/resource_channels.c (original)
+++ team/dlee/ari-monitor2/res/ari/resource_channels.c Wed Jul 31 21:57:13 2013
@@ -335,7 +335,7 @@
 	RAII_VAR(char *, recording_url, NULL, ast_free);
 	RAII_VAR(char *, uri_encoded_name, NULL, ast_free);
 	RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
-	const char *name = stasis_app_recording_get_name(recording);
+	const char *name;
 	size_t uri_name_maxlen;
 
 	if (recording == NULL) {
@@ -350,8 +350,7 @@
 			break;
 		case EEXIST:
 			ast_ari_response_error(response, 409, "Conflict",
-				"Recording '%s' already in progress",
-				name);
+				"Recording already in progress");
 			break;
 		case ENOMEM:
 			ast_ari_response_error(
@@ -375,6 +374,7 @@
 		return;
 	}
 
+	name = stasis_app_recording_get_name(recording);
 	uri_name_maxlen = strlen(name) * 3;
 	uri_encoded_name = ast_malloc(uri_name_maxlen);
 	if (!uri_encoded_name) {

Modified: team/dlee/ari-monitor2/res/res_stasis_recording.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-monitor2/res/res_stasis_recording.c?view=diff&rev=395925&r1=395924&r2=395925
==============================================================================
--- team/dlee/ari-monitor2/res/res_stasis_recording.c (original)
+++ team/dlee/ari-monitor2/res/res_stasis_recording.c Wed Jul 31 21:57:13 2013
@@ -374,12 +374,16 @@
 enum stasis_app_recording_state stasis_app_recording_get_state(
 	struct stasis_app_recording *recording)
 {
+	ast_assert(recording != NULL);
 	return recording->state;
 }
 
 const char *stasis_app_recording_get_name(
 	struct stasis_app_recording *recording)
 {
+	if (!recording || !recording->options) {
+		return NULL;
+	}
 	return recording->options->name;
 }
 




More information about the asterisk-commits mailing list