[svn-commits] dlee: branch dlee/ari-event-remodel2 r393152 - in /team/dlee/ari-event-remode...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 28 11:53:23 CDT 2013


Author: dlee
Date: Fri Jun 28 11:53:03 2013
New Revision: 393152

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

* Removed unnecessary template
* Cleaned up some JSON generation
* Fixed model validation for undocumented subtypes
* Fixed typos

Removed:
    team/dlee/ari-event-remodel2/rest-api-templates/event_function_decl.mustache
Modified:
    team/dlee/ari-event-remodel2/main/stasis_channels.c
    team/dlee/ari-event-remodel2/res/res_stasis_http_channels.c
    team/dlee/ari-event-remodel2/res/stasis_http/ari_model.c
    team/dlee/ari-event-remodel2/rest-api-templates/ari_model.c.mustache
    team/dlee/ari-event-remodel2/rest-api/api-docs/channels.json

Modified: team/dlee/ari-event-remodel2/main/stasis_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/main/stasis_channels.c?view=diff&rev=393152&r1=393151&r2=393152
==============================================================================
--- team/dlee/ari-event-remodel2/main/stasis_channels.c (original)
+++ team/dlee/ari-event-remodel2/main/stasis_channels.c Fri Jun 28 11:53:03 2013
@@ -728,11 +728,11 @@
 		return NULL;
 	}
 
-	return ast_json_pack("{s: s, s: o, s: o, s: o, s: o}",
+	return ast_json_pack("{s: s, s: o, s: O, s: O, s: o}",
 		"type", "ChannelDtmfReceived",
 		"timestamp", ast_json_timeval(*tv, NULL),
-		"digit", ast_json_ref(ast_json_object_get(blob, "digit")),
-		"duration_ms", ast_json_ref(ast_json_object_get(blob, "duration_ms")),
+		"digit", ast_json_object_get(blob, "digit"),
+		"duration_ms", ast_json_object_get(blob, "duration_ms"),
 		"channel", ast_channel_snapshot_to_json(snapshot));
 }
 
@@ -743,11 +743,11 @@
 	struct ast_channel_snapshot *snapshot = channel_blob->snapshot;
 	const struct timeval *tv = stasis_message_timestamp(message);
 
-	return ast_json_pack("{s: s, s: o, s: o, s: o, s: o}",
+	return ast_json_pack("{s: s, s: o, s: O, s: O, s: o}",
 		"type", "ChannelUserevent",
 		"timestamp", ast_json_timeval(*tv, NULL),
-		"eventname", ast_json_ref(ast_json_object_get(blob, "eventname")),
-		"userevent", ast_json_ref(blob),
+		"eventname", ast_json_object_get(blob, "eventname"),
+		"userevent", blob,
 		"channel", ast_channel_snapshot_to_json(snapshot));
 }
 

Modified: team/dlee/ari-event-remodel2/res/res_stasis_http_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/res/res_stasis_http_channels.c?view=diff&rev=393152&r1=393151&r2=393152
==============================================================================
--- team/dlee/ari-event-remodel2/res/res_stasis_http_channels.c (original)
+++ team/dlee/ari-event-remodel2/res/res_stasis_http_channels.c Fri Jun 28 11:53:03 2013
@@ -783,7 +783,7 @@
 	switch (code) {
 	case 500: /* Internal server error */
 	case 404: /* Channel not found */
-	case 409: /* Channel is not in a Stasis application, or The channel is currently bridged with other channels. */
+	case 409: /* Channel is not in a Stasis application, or the channel is currently bridged with other channels. */
 		is_valid = 1;
 		break;
 	default:

Modified: team/dlee/ari-event-remodel2/res/stasis_http/ari_model.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/res/stasis_http/ari_model.c?view=diff&rev=393152&r1=393151&r2=393152
==============================================================================
--- team/dlee/ari-event-remodel2/res/stasis_http/ari_model.c (original)
+++ team/dlee/ari-event-remodel2/res/stasis_http/ari_model.c Fri Jun 28 11:53:03 2013
@@ -2199,6 +2199,7 @@
 	{
 		ast_log(LOG_ERROR, "ARI Event has undocumented subtype %s\n",
 			discriminator);
+		res = 0;
 	}
 
 	for (iter = ast_json_object_iter(json); iter; iter = ast_json_object_iter_next(json, iter)) {

Modified: team/dlee/ari-event-remodel2/rest-api-templates/ari_model.c.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/rest-api-templates/ari_model.c.mustache?view=diff&rev=393152&r1=393151&r2=393152
==============================================================================
--- team/dlee/ari-event-remodel2/rest-api-templates/ari_model.c.mustache (original)
+++ team/dlee/ari-event-remodel2/rest-api-templates/ari_model.c.mustache Fri Jun 28 11:53:03 2013
@@ -65,6 +65,7 @@
 	{
 		ast_log(LOG_ERROR, "ARI {{id}} has undocumented subtype %s\n",
 			discriminator);
+		res = 0;
 	}
 {{/has_subtypes}}
 

Modified: team/dlee/ari-event-remodel2/rest-api/api-docs/channels.json
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/rest-api/api-docs/channels.json?view=diff&rev=393152&r1=393151&r2=393152
==============================================================================
--- team/dlee/ari-event-remodel2/rest-api/api-docs/channels.json (original)
+++ team/dlee/ari-event-remodel2/rest-api/api-docs/channels.json Fri Jun 28 11:53:03 2013
@@ -603,7 +603,7 @@
 						},
 						{
 							"code": 409,
-							"reason": "Channel is not in a Stasis application, or The channel is currently bridged with other channels."
+							"reason": "Channel is not in a Stasis application, or the channel is currently bridged with other channels."
 						}
 					]
 				}




More information about the svn-commits mailing list