[asterisk-commits] dlee: branch dlee/ari-event-remodel2 r392398 - in /team/dlee/ari-event-remode...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 20 23:57:59 CDT 2013


Author: dlee
Date: Thu Jun 20 23:57:57 2013
New Revision: 392398

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=392398
Log:
Fix non-dev mode build

Modified:
    team/dlee/ari-event-remodel2/include/asterisk/stasis_http.h
    team/dlee/ari-event-remodel2/res/res_stasis_http_events.c
    team/dlee/ari-event-remodel2/res/stasis_http/ari_websockets.c
    team/dlee/ari-event-remodel2/rest-api-templates/res_stasis_http_resource.c.mustache

Modified: team/dlee/ari-event-remodel2/include/asterisk/stasis_http.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/include/asterisk/stasis_http.h?view=diff&rev=392398&r1=392397&r2=392398
==============================================================================
--- team/dlee/ari-event-remodel2/include/asterisk/stasis_http.h (original)
+++ team/dlee/ari-event-remodel2/include/asterisk/stasis_http.h Thu Jun 20 23:57:57 2013
@@ -147,6 +147,9 @@
 /*!
  * \brief Create an ARI WebSocket session.
  *
+ * If \c NULL is given for the validator function, no validation will be
+ * performed.
+ *
  * \param ws_session Underlying WebSocket session.
  * \param validator Function to validate outgoing messages.
  * \return New ARI WebSocket session.

Modified: team/dlee/ari-event-remodel2/res/res_stasis_http_events.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/res/res_stasis_http_events.c?view=diff&rev=392398&r1=392397&r2=392398
==============================================================================
--- team/dlee/ari-event-remodel2/res/res_stasis_http_events.c (original)
+++ team/dlee/ari-event-remodel2/res/res_stasis_http_events.c Thu Jun 20 23:57:57 2013
@@ -62,8 +62,12 @@
 		} else
 		{}
 	}
+#if defined(AST_DEVMODE)
 	session = ari_websocket_session_create(ws_session,
 		ari_validate_event);
+#else
+	session = ari_websocket_session_create(ws_session, NULL);
+#endif
 	if (!session) {
 		ast_log(LOG_ERROR, "Failed to create ARI session\n");
 		return;

Modified: team/dlee/ari-event-remodel2/res/stasis_http/ari_websockets.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/res/stasis_http/ari_websockets.c?view=diff&rev=392398&r1=392397&r2=392398
==============================================================================
--- team/dlee/ari-event-remodel2/res/stasis_http/ari_websockets.c (original)
+++ team/dlee/ari-event-remodel2/res/stasis_http/ari_websockets.c Thu Jun 20 23:57:57 2013
@@ -42,6 +42,14 @@
 	session->ws_session = NULL;
 }
 
+/*!
+ * \brief Validator that always succeeds.
+ */
+static int null_validator(struct ast_json *json)
+{
+	return 1;
+}
+
 struct ari_websocket_session *ari_websocket_session_create(
 	struct ast_websocket *ws_session, int (*validator)(struct ast_json *))
 {
@@ -49,6 +57,10 @@
 
 	if (ws_session == NULL) {
 		return NULL;
+	}
+
+	if (validator == NULL) {
+		validator = null_validator;
 	}
 
 	if (ast_websocket_set_nonblock(ws_session) != 0) {

Modified: team/dlee/ari-event-remodel2/rest-api-templates/res_stasis_http_resource.c.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel2/rest-api-templates/res_stasis_http_resource.c.mustache?view=diff&rev=392398&r1=392397&r2=392398
==============================================================================
--- team/dlee/ari-event-remodel2/rest-api-templates/res_stasis_http_resource.c.mustache (original)
+++ team/dlee/ari-event-remodel2/rest-api-templates/res_stasis_http_resource.c.mustache Thu Jun 20 23:57:57 2013
@@ -123,8 +123,12 @@
 	struct ast_variable *path_vars = NULL;
 {{/has_path_parameters}}
 {{> param_parsing}}
+#if defined(AST_DEVMODE)
 	session = ari_websocket_session_create(ws_session,
 		ari_validate_{{response_class.c_name}});
+#else
+	session = ari_websocket_session_create(ws_session, NULL);
+#endif
 	if (!session) {
 		ast_log(LOG_ERROR, "Failed to create ARI session\n");
 		return;




More information about the asterisk-commits mailing list