[svn-commits] dlee: branch dlee/ari-url-shuffle r391671 - in /team/dlee/ari-url-shuffle: in...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 13 11:53:34 CDT 2013


Author: dlee
Date: Thu Jun 13 11:53:32 2013
New Revision: 391671

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=391671
Log:
ARI WebSocket API

Modified:
    team/dlee/ari-url-shuffle/include/asterisk/stasis_http.h
    team/dlee/ari-url-shuffle/res/res_stasis_http_asterisk.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_bridges.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_channels.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_endpoints.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_events.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_playback.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_recordings.c
    team/dlee/ari-url-shuffle/res/res_stasis_http_sounds.c
    team/dlee/ari-url-shuffle/res/stasis_http/resource_events.c
    team/dlee/ari-url-shuffle/res/stasis_http/resource_events.h
    team/dlee/ari-url-shuffle/rest-api-templates/res_stasis_http_resource.c.mustache
    team/dlee/ari-url-shuffle/rest-api-templates/stasis_http_resource.c.mustache
    team/dlee/ari-url-shuffle/rest-api-templates/stasis_http_resource.h.mustache

Modified: team/dlee/ari-url-shuffle/include/asterisk/stasis_http.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/include/asterisk/stasis_http.h?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/include/asterisk/stasis_http.h (original)
+++ team/dlee/ari-url-shuffle/include/asterisk/stasis_http.h Thu Jun 13 11:53:32 2013
@@ -135,6 +135,38 @@
  */
 void stasis_http_get_docs(const char *uri, struct ast_variable *headers, struct stasis_http_response *response);
 
+/*! \brief Abstraction for reading/writing JSON to a WebSocket */
+struct ari_websocket_session;
+
+/*!
+ * \brief Create an ARI WebSocket session.
+ *
+ * \param ws_session Underlying WebSocket session.
+ * \return New ARI WebSocket session.
+ * \return \c NULL on error.
+ */
+struct ari_websocket_session *ari_websocket_session_create(
+	struct ast_websocket *ws_session);
+
+/*!
+ * \brief Read a message from an ARI WebSocket.
+ *
+ * \param session Session to read from.
+ * \return Message received.
+ * \return \c NULL if WebSocket could not be read.
+ */
+struct ast_json *ari_websocket_session_read(
+	struct ari_websocket_session *session);
+
+/*!
+ * \brief Send a message to an ARI WebSocket.
+ *
+ * \param session Session to write to.
+ * \param message Message to send.
+ */
+void ari_websocket_session_write(struct ari_websocket_session *session,
+	struct ast_json *message);
+
 /*!
  * \internal
  * \brief Stasis WebSocket connection handler

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_asterisk.c?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_asterisk.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_asterisk.c Thu Jun 13 11:53:32 2013
@@ -56,6 +56,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_asterisk_info_args args = {};
 	struct ast_variable *i;
 

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_bridges.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_bridges.c?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_bridges.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_bridges.c Thu Jun 13 11:53:32 2013
@@ -56,6 +56,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_bridges_args args = {};
 	stasis_http_get_bridges(headers, &args, response);
 }
@@ -70,6 +71,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_new_bridge_args args = {};
 	struct ast_variable *i;
 
@@ -92,6 +94,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_bridge_args args = {};
 	struct ast_variable *i;
 
@@ -114,6 +117,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_delete_bridge_args args = {};
 	struct ast_variable *i;
 
@@ -136,6 +140,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_add_channel_to_bridge_args args = {};
 	struct ast_variable *i;
 
@@ -164,6 +169,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_remove_channel_from_bridge_args args = {};
 	struct ast_variable *i;
 
@@ -192,6 +198,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_record_bridge_args args = {};
 	struct ast_variable *i;
 

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_channels.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_channels.c?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_channels.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_channels.c Thu Jun 13 11:53:32 2013
@@ -56,6 +56,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_channels_args args = {};
 	stasis_http_get_channels(headers, &args, response);
 }
@@ -70,6 +71,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_originate_args args = {};
 	struct ast_variable *i;
 
@@ -110,6 +112,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_channel_args args = {};
 	struct ast_variable *i;
 
@@ -132,6 +135,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_delete_channel_args args = {};
 	struct ast_variable *i;
 
@@ -154,6 +158,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_dial_args args = {};
 	struct ast_variable *i;
 
@@ -188,6 +193,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_continue_in_dialplan_args args = {};
 	struct ast_variable *i;
 
@@ -210,6 +216,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_answer_channel_args args = {};
 	struct ast_variable *i;
 
@@ -232,6 +239,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_mute_channel_args args = {};
 	struct ast_variable *i;
 
@@ -260,6 +268,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_unmute_channel_args args = {};
 	struct ast_variable *i;
 
@@ -288,6 +297,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_hold_channel_args args = {};
 	struct ast_variable *i;
 
@@ -310,6 +320,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_unhold_channel_args args = {};
 	struct ast_variable *i;
 
@@ -332,6 +343,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_play_on_channel_args args = {};
 	struct ast_variable *i;
 
@@ -369,6 +381,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_record_channel_args args = {};
 	struct ast_variable *i;
 

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_endpoints.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_endpoints.c?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_endpoints.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_endpoints.c Thu Jun 13 11:53:32 2013
@@ -56,6 +56,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_endpoints_args args = {};
 	stasis_http_get_endpoints(headers, &args, response);
 }
@@ -70,6 +71,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_endpoints_by_tech_args args = {};
 	struct ast_variable *i;
 
@@ -92,6 +94,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_endpoint_args args = {};
 	struct ast_variable *i;
 

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_events.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_events.c?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_events.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_events.c Thu Jun 13 11:53:32 2013
@@ -46,8 +46,21 @@
 #include "stasis_http/resource_events.h"
 
 static void event_websocket_ws_cb(struct ast_websocket *ws_session,
-	struct ast_variable *parameters, struct ast_variable *headers)
+	struct ast_variable *get_params, struct ast_variable *headers)
 {
+	RAII_VAR(struct ari_websocket_session *, session, NULL, ao2_cleanup);
+
+	struct ast_event_websocket_args args = {};
+	struct ast_variable *i;
+
+	for (i = get_params; i; i = i->next) {
+		if (strcmp(i->name, "app") == 0) {
+			args.app = (i->value);
+		} else
+		{}
+	}
+	session = ari_websocket_session_create(ws_session);
+	ari_websocket_event_websocket(session, headers, &args);
 }
 
 /*! \brief REST handler for /api-docs/events.{format} */

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_playback.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_playback.c?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_playback.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_playback.c Thu Jun 13 11:53:32 2013
@@ -56,6 +56,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_playback_args args = {};
 	struct ast_variable *i;
 
@@ -78,6 +79,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_stop_playback_args args = {};
 	struct ast_variable *i;
 
@@ -100,6 +102,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_control_playback_args args = {};
 	struct ast_variable *i;
 

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_recordings.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_recordings.c?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_recordings.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_recordings.c Thu Jun 13 11:53:32 2013
@@ -56,6 +56,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_recordings_args args = {};
 	stasis_http_get_recordings(headers, &args, response);
 }
@@ -70,6 +71,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_stored_recordings_args args = {};
 	stasis_http_get_stored_recordings(headers, &args, response);
 }
@@ -84,6 +86,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_stored_recording_args args = {};
 	struct ast_variable *i;
 
@@ -106,6 +109,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_delete_stored_recording_args args = {};
 	struct ast_variable *i;
 
@@ -128,6 +132,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_live_recordings_args args = {};
 	stasis_http_get_live_recordings(headers, &args, response);
 }
@@ -142,6 +147,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_live_recording_args args = {};
 	struct ast_variable *i;
 
@@ -164,6 +170,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_cancel_recording_args args = {};
 	struct ast_variable *i;
 
@@ -186,6 +193,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_stop_recording_args args = {};
 	struct ast_variable *i;
 
@@ -208,6 +216,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_pause_recording_args args = {};
 	struct ast_variable *i;
 
@@ -230,6 +239,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_unpause_recording_args args = {};
 	struct ast_variable *i;
 
@@ -252,6 +262,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_mute_recording_args args = {};
 	struct ast_variable *i;
 
@@ -274,6 +285,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_unmute_recording_args args = {};
 	struct ast_variable *i;
 

Modified: team/dlee/ari-url-shuffle/res/res_stasis_http_sounds.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/res_stasis_http_sounds.c?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/res/res_stasis_http_sounds.c (original)
+++ team/dlee/ari-url-shuffle/res/res_stasis_http_sounds.c Thu Jun 13 11:53:32 2013
@@ -56,6 +56,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_sounds_args args = {};
 	struct ast_variable *i;
 
@@ -81,6 +82,7 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
+
 	struct ast_get_stored_sound_args args = {};
 	struct ast_variable *i;
 

Modified: team/dlee/ari-url-shuffle/res/stasis_http/resource_events.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/stasis_http/resource_events.c?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/res/stasis_http/resource_events.c (original)
+++ team/dlee/ari-url-shuffle/res/stasis_http/resource_events.c Thu Jun 13 11:53:32 2013
@@ -1,4 +1,4 @@
-/* -*- C -*-
+/*
  * Asterisk -- An open source telephony toolkit.
  *
  * Copyright (C) 2012 - 2013, Digium, Inc.
@@ -18,14 +18,10 @@
 
 /*! \file
  *
- * \brief Implementation for stasis-http stubs.
+ * \brief /api-docs/events.{format} implementation- WebSocket resource
  *
  * \author David M. Lee, II <dlee at digium.com>
  */
-
-/*** MODULEINFO
-	<support_level>core</support_level>
- ***/
 
 #include "asterisk.h"
 
@@ -33,8 +29,9 @@
 
 #include "resource_events.h"
 
-void stasis_http_event_websocket(struct ast_variable *headers, struct ast_event_websocket_args *args, struct stasis_http_response *response)
+void ari_websocket_event_websocket(struct ari_websocket_session *session,
+	struct ast_variable *headers,
+	struct ast_event_websocket_args *args)
 {
-	/* TODO: This should promote this socket to a websocket connection */
-	ast_log(LOG_ERROR, "TODO: stasis_http_event_websocket\n");
+	ast_log(LOG_ERROR, "TODO: ari_websocket_event_websocket\n");
 }

Modified: team/dlee/ari-url-shuffle/res/stasis_http/resource_events.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/res/stasis_http/resource_events.h?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/res/stasis_http/resource_events.h (original)
+++ team/dlee/ari-url-shuffle/res/stasis_http/resource_events.h Thu Jun 13 11:53:32 2013
@@ -49,8 +49,7 @@
  *
  * \param headers HTTP headers
  * \param args Swagger parameters
- * \param[out] response HTTP response
  */
-void stasis_http_event_websocket(struct ast_variable *headers, struct ast_event_websocket_args *args, struct stasis_http_response *response);
+void ari_websocket_event_websocket(struct ari_websocket_session *session, struct ast_variable *headers, struct ast_event_websocket_args *args);
 
 #endif /* _ASTERISK_RESOURCE_EVENTS_H */

Modified: team/dlee/ari-url-shuffle/rest-api-templates/res_stasis_http_resource.c.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/rest-api-templates/res_stasis_http_resource.c.mustache?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/rest-api-templates/res_stasis_http_resource.c.mustache (original)
+++ team/dlee/ari-url-shuffle/rest-api-templates/res_stasis_http_resource.c.mustache Thu Jun 13 11:53:32 2013
@@ -64,38 +64,24 @@
     struct ast_variable *get_params, struct ast_variable *path_vars,
     struct ast_variable *headers, struct stasis_http_response *response)
 {
-	struct ast_{{c_nickname}}_args args = {};
-{{#has_parameters}}
-	struct ast_variable *i;
-
-{{#has_query_parameters}}
-	for (i = get_params; i; i = i->next) {
-{{#query_parameters}}
-		if (strcmp(i->name, "{{name}}") == 0) {
-			args.{{c_name}} = {{c_convert}}(i->value);
-		} else
-{{/query_parameters}}
-		{}
-	}
-{{/has_query_parameters}}
-{{#has_path_parameters}}
-	for (i = path_vars; i; i = i->next) {
-{{#path_parameters}}
-		if (strcmp(i->name, "{{name}}") == 0) {
-			args.{{c_name}} = {{c_convert}}(i->value);
-		} else
-{{/path_parameters}}
-		{}
-	}
-{{/has_path_parameters}}
-{{/has_parameters}}
+{{> param_parsing}}
 	stasis_http_{{c_nickname}}(headers, &args, response);
 }
 {{/is_req}}
 {{#is_websocket}}
 static void {{c_nickname}}_ws_cb(struct ast_websocket *ws_session,
-	struct ast_variable *parameters, struct ast_variable *headers)
+	struct ast_variable *get_params, struct ast_variable *headers)
 {
+	RAII_VAR(struct ari_websocket_session *, session, NULL, ao2_cleanup);
+{{#has_path_parameters}}
+	/* TODO: It's not immediately obvious how to pass path params through
+	 * the websocket code to this callback. Not needed right now, so we'll
+	 * just punt for now. */
+	struct ast_variable *path_vars = NULL;
+{{/has_path_parameters}}
+{{> param_parsing}}
+	session = ari_websocket_session_create(ws_session);
+	ari_websocket_{{c_nickname}}(session, headers, &args);
 }
 {{/is_websocket}}
 {{/operations}}

Modified: team/dlee/ari-url-shuffle/rest-api-templates/stasis_http_resource.c.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/rest-api-templates/stasis_http_resource.c.mustache?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/rest-api-templates/stasis_http_resource.c.mustache (original)
+++ team/dlee/ari-url-shuffle/rest-api-templates/stasis_http_resource.c.mustache Thu Jun 13 11:53:32 2013
@@ -32,10 +32,22 @@
 
 {{#apis}}
 {{#operations}}
-void stasis_http_{{c_nickname}}(struct ast_variable *headers, struct ast_{{c_nickname}}_args *args, struct stasis_http_response *response)
+{{#is_req}}
+void stasis_http_{{c_nickname}}(struct ast_variable *headers,
+	struct ast_{{c_nickname}}_args *args,
+	struct stasis_http_response *response)
 {
 	ast_log(LOG_ERROR, "TODO: stasis_http_{{c_nickname}}\n");
 }
+{{/is_req}}
+{{#is_websocket}}
+void ari_websocket_{{c_nickname}}(struct ari_websocket_session *session,
+	struct ast_variable *headers,
+	struct ast_{{c_nickname}}_args *args)
+{
+	ast_log(LOG_ERROR, "TODO: ari_websocket_{{c_nickname}}\n");
+}
+{{/is_websocket}}
 {{/operations}}
 {{/apis}}
 {{/api_declaration}}

Modified: team/dlee/ari-url-shuffle/rest-api-templates/stasis_http_resource.h.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-url-shuffle/rest-api-templates/stasis_http_resource.h.mustache?view=diff&rev=391671&r1=391670&r2=391671
==============================================================================
--- team/dlee/ari-url-shuffle/rest-api-templates/stasis_http_resource.h.mustache (original)
+++ team/dlee/ari-url-shuffle/rest-api-templates/stasis_http_resource.h.mustache Thu Jun 13 11:53:32 2013
@@ -49,6 +49,7 @@
 	{{c_data_type}}{{c_space}}{{c_name}};
 {{/parameters}}
 };
+{{#is_req}}
 /*!
  * \brief {{summary}}
 {{#notes}}
@@ -61,6 +62,20 @@
  * \param[out] response HTTP response
  */
 void stasis_http_{{c_nickname}}(struct ast_variable *headers, struct ast_{{c_nickname}}_args *args, struct stasis_http_response *response);
+{{/is_req}}
+{{#is_websocket}}
+/*!
+ * \brief {{summary}}
+{{#notes}}
+ *
+ * {{{notes}}}
+{{/notes}}
+ *
+ * \param headers HTTP headers
+ * \param args Swagger parameters
+ */
+void ari_websocket_{{c_nickname}}(struct ari_websocket_session *session, struct ast_variable *headers, struct ast_{{c_nickname}}_args *args);
+{{/is_websocket}}
 {{/operations}}
 {{/apis}}
 




More information about the svn-commits mailing list