[svn-commits] dlee: branch dlee/ari-event-remodel r391769 - in /team/dlee/ari-event-remodel...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 14 09:10:31 CDT 2013


Author: dlee
Date: Fri Jun 14 09:10:29 2013
New Revision: 391769

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=391769
Log:
Updated events model

Modified:
    team/dlee/ari-event-remodel/res/stasis_json/resource_events.h
    team/dlee/ari-event-remodel/rest-api-templates/asterisk_processor.py
    team/dlee/ari-event-remodel/rest-api-templates/stasis_json_resource.h.mustache
    team/dlee/ari-event-remodel/rest-api/api-docs/events.json

Modified: team/dlee/ari-event-remodel/res/stasis_json/resource_events.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel/res/stasis_json/resource_events.h?view=diff&rev=391769&r1=391768&r2=391769
==============================================================================
--- team/dlee/ari-event-remodel/res/stasis_json/resource_events.h (original)
+++ team/dlee/ari-event-remodel/res/stasis_json/resource_events.h Fri Jun 14 09:10:29 2013
@@ -151,6 +151,8 @@
 
 /*!
  * \brief Notification that another WebSocket has taken over for an application.
+ * 
+ * An application may only be subscribed to by a single WebSocket at a time. If multiple WebSockets attempt to subscribe to the same application, the newer WebSocket wins, and the older one receives this event.
  *
  * \param blob JSON blob containing the following parameters:
  * - application: string  (required)
@@ -294,6 +296,8 @@
 
 /*!
  * \brief DTMF received on a channel.
+ * 
+ * This event is sent when the DTMF ends. There is no notification about the start of DTMF
  *
  * \param channel The channel on which DTMF was received
  * \param blob JSON blob containing the following parameters:
@@ -359,27 +363,9 @@
  * ChannelDtmfReceived
  * - digit: string (required)
  * Event
- * - channel_varset: ChannelVarset
- * - channel_created: ChannelCreated
- * - channel_destroyed: ChannelDestroyed
- * - channel_entered_bridge: ChannelEnteredBridge
- * - channel_left_bridge: ChannelLeftBridge
- * - bridge_merged: BridgeMerged
- * - channel_dialplan: ChannelDialplan
- * - application_replaced: ApplicationReplaced
- * - channel_state_change: ChannelStateChange
- * - bridge_created: BridgeCreated
  * - application: string (required)
- * - channel_hangup_request: ChannelHangupRequest
- * - channel_userevent: ChannelUserevent
- * - stasis_start: StasisStart
- * - channel_snapshot: ChannelSnapshot
- * - channel_dtmf_received: ChannelDtmfReceived
- * - channel_caller_id: ChannelCallerId
- * - bridge_destroyed: BridgeDestroyed
- * - playback_started: PlaybackStarted
- * - playback_finished: PlaybackFinished
- * - stasis_end: StasisEnd
+ * - type: DISCRIMINATOR
+ * - timestamp: Date
  * StasisEnd
  */
 

Modified: team/dlee/ari-event-remodel/rest-api-templates/asterisk_processor.py
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel/rest-api-templates/asterisk_processor.py?view=diff&rev=391769&r1=391768&r2=391769
==============================================================================
--- team/dlee/ari-event-remodel/rest-api-templates/asterisk_processor.py (original)
+++ team/dlee/ari-event-remodel/rest-api-templates/asterisk_processor.py Fri Jun 14 09:10:29 2013
@@ -178,7 +178,7 @@
     def process_parameter(self, parameter, context):
         if not parameter.data_type in self.type_mapping:
             raise SwaggerError(
-                "Invalid parameter type %s" % paramter.data_type, context)
+                "Invalid parameter type %s" % parameter.data_type, context)
         # Parameter names are camelcase, Asterisk convention is snake case
         parameter.c_name = snakify(parameter.name)
         parameter.c_data_type = self.type_mapping[parameter.data_type]
@@ -190,6 +190,7 @@
             parameter.c_space = ' '
 
     def process_model(self, model, context):
+        model.description_dox = model.description.replace('\n', '\n * ')
         model.c_id = snakify(model.id)
         model.channel = False
         model.channel_desc = ""

Modified: team/dlee/ari-event-remodel/rest-api-templates/stasis_json_resource.h.mustache
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel/rest-api-templates/stasis_json_resource.h.mustache?view=diff&rev=391769&r1=391768&r2=391769
==============================================================================
--- team/dlee/ari-event-remodel/rest-api-templates/stasis_json_resource.h.mustache (original)
+++ team/dlee/ari-event-remodel/rest-api-templates/stasis_json_resource.h.mustache Fri Jun 14 09:10:29 2013
@@ -42,11 +42,7 @@
 
 {{#events}}
 /*!
- * \brief {{description}}
-{{#notes}}
- *
- * {{{notes}}}
-{{/notes}}
+ * \brief {{{description_dox}}}
  *
 {{#channel}}
  * \param channel {{#channel_desc}}{{channel_desc}}{{/channel_desc}}{{^channel_desc}}The channel to be used to generate this event{{/channel_desc}}

Modified: team/dlee/ari-event-remodel/rest-api/api-docs/events.json
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ari-event-remodel/rest-api/api-docs/events.json?view=diff&rev=391769&r1=391768&r2=391769
==============================================================================
--- team/dlee/ari-event-remodel/rest-api/api-docs/events.json (original)
+++ team/dlee/ari-event-remodel/rest-api/api-docs/events.json Fri Jun 14 09:10:29 2013
@@ -46,37 +46,27 @@
 	"models": {
 		"Event": {
 			"id": "Event",
-			"description": "Asynchronous events from Asterisk. The non-required fields of this object are mutually exclusive.",
-			"properties": {
+			"description": "Base type for asynchronous events from Asterisk.",
+			"properties": {
+				"type": {
+					"type": "DISCRIMINATOR",
+					"description": "Indicates the type of this event."
+				},
 				"application": {
 					"type": "string",
 					"description": "Name of the application receiving the event.",
 					"required": true
 				},
-				"application_replaced": { "type": "ApplicationReplaced" },
-				"bridge_created": { "type": "BridgeCreated" },
-				"bridge_destroyed": { "type": "BridgeDestroyed" },
-				"bridge_merged": { "type": "BridgeMerged" },
-				"channel_created": { "type": "ChannelCreated" },
-				"channel_destroyed": { "type": "ChannelDestroyed" },
-				"channel_snapshot": { "type": "ChannelSnapshot" },
-				"channel_entered_bridge": { "type": "ChannelEnteredBridge" },
-				"channel_left_bridge": { "type": "ChannelLeftBridge" },
-				"channel_state_change": { "type": "ChannelStateChange" },
-				"channel_dtmf_received": { "type": "ChannelDtmfReceived" },
-				"channel_dialplan": { "type": "ChannelDialplan" },
-				"channel_caller_id": { "type": "ChannelCallerId" },
-				"channel_userevent": { "type": "ChannelUserevent" },
-				"channel_hangup_request": { "type": "ChannelHangupRequest" },
-				"channel_varset": { "type": "ChannelVarset" },
-				"stasis_end": { "type": "StasisEnd" },
-				"stasis_start": { "type": "StasisStart" },
-				"playback_started": { "type": "PlaybackStarted" },
-				"playback_finished": { "type": "PlaybackFinished" }
+				"timestamp": {
+					"type": "Date",
+					"description": "Time at which this event was created.",
+					"required": false
+				}
 			}
 		},
 		"PlaybackStarted": {
 			"id": "PlaybackStarted",
+			"extends": "Event",
 			"description": "Event showing the start of a media playback operation.",
 			"properties": {
 				"playback": {
@@ -88,6 +78,7 @@
 		},
 		"PlaybackFinished": {
 			"id": "PlaybackFinished",
+			"extends": "Event",
 			"description": "Event showing the completion of a media playback operation.",
 			"properties": {
 				"playback": {
@@ -99,8 +90,8 @@
 		},
 		"ApplicationReplaced": {
 			"id": "ApplicationReplaced",
-			"description": "Notification that another WebSocket has taken over for an application.",
-			"notes": "An application may only be subscribed to by a single WebSocket at a time. If multiple WebSockets attempt to subscribe to the same application, the newer WebSocket wins, and the older one receives this event.",
+			"extends": "Event",
+			"description": "Notification that another WebSocket has taken over for an application.\n\nAn application may only be subscribed to by a single WebSocket at a time. If multiple WebSockets attempt to subscribe to the same application, the newer WebSocket wins, and the older one receives this event.",
 			"properties": {
 				"application": {
 					"required": true,
@@ -110,6 +101,7 @@
 		},
 		"BridgeCreated": {
 			"id": "BridgeCreated",
+			"extends": "Event",
 			"description": "Notification that a bridge has been created.",
 			"properties": {
 				"bridge": {
@@ -120,6 +112,7 @@
 		},
 		"BridgeDestroyed": {
 			"id": "BridgeDestroyed",
+			"extends": "Event",
 			"description": "Notification that a bridge has been destroyed.",
 			"properties": {
 				"bridge": {
@@ -130,6 +123,7 @@
 		},
 		"BridgeMerged": {
 			"id": "BridgeMerged",
+			"extends": "Event",
 			"description": "Notification that one bridge has merged into another.",
 			"properties": {
 				"bridge": {
@@ -144,6 +138,7 @@
 		},
 		"ChannelCreated": {
 			"id": "ChannelCreated",
+			"extends": "Event",
 			"description": "Notification that a channel has been created.",
 			"properties": {
 				"channel": {
@@ -154,6 +149,7 @@
 		},
 		"ChannelSnapshot": {
 			"id": "ChannelSnapshot",
+			"extends": "Event",
 			"description": "Some part of channel state changed.",
 			"properties": {
 				"channel": {
@@ -164,6 +160,7 @@
 		},
 		"ChannelDestroyed": {
 			"id": "ChannelDestroyed",
+			"extends": "Event",
 			"description": "Notification that a channel has been destroyed.",
 			"properties": {
 				"cause": {
@@ -184,6 +181,7 @@
 		},
 		"ChannelEnteredBridge": {
 			"id": "ChannelEnteredBridge",
+			"extends": "Event",
 			"description": "Notification that a channel has entered a bridge.",
 			"properties": {
 				"bridge": {
@@ -197,6 +195,7 @@
 		},
 		"ChannelLeftBridge": {
 			"id": "ChannelLeftBridge",
+			"extends": "Event",
 			"description": "Notification that a channel has left a bridge.",
 			"properties": {
 				"bridge": {
@@ -211,6 +210,7 @@
 		},
 		"ChannelStateChange": {
 			"id": "ChannelStateChange",
+			"extends": "Event",
 			"description": "Notification of a channel's state change.",
 			"properties": {
 				"channel": {
@@ -221,8 +221,8 @@
 		},
 		"ChannelDtmfReceived": {
 			"id": "ChannelDtmfReceived",
-			"description": "DTMF received on a channel.",
-			"notes": "This event is sent when the DTMF ends. There is no notification about the start of DTMF",
+			"extends": "Event",
+			"description": "DTMF received on a channel.\n\nThis event is sent when the DTMF ends. There is no notification about the start of DTMF",
 			"properties": {
 				"digit": {
 					"required": true,
@@ -238,6 +238,7 @@
 		},
 		"ChannelDialplan": {
 			"id": "ChannelDialplan",
+			"extends": "Event",
 			"description": "Channel changed location in the dialplan.",
 			"properties": {
 				"application": {
@@ -259,6 +260,7 @@
 		},
 		"ChannelCallerId": {
 			"id": "ChannelCallerId",
+			"extends": "Event",
 			"description": "Channel changed Caller ID.",
 			"properties": {
 				"caller_presentation": {
@@ -280,6 +282,7 @@
 		},
 		"ChannelUserevent": {
 			"id": "ChannelUserevent",
+			"extends": "Event",
 			"description": "User-generated event with additional user-defined fields in the object.",
 			"properties": {
 				"eventname": {
@@ -296,6 +299,7 @@
 		},
 		"ChannelHangupRequest": {
 			"id": "ChannelHangupRequest",
+			"extends": "Event",
 			"description": "A hangup was requested on the channel.",
 			"properties": {
 				"cause": {
@@ -315,6 +319,7 @@
 		},
 		"ChannelVarset": {
 			"id": "ChannelVarset",
+			"extends": "Event",
 			"description": "Channel variable changed.",
 			"properties": {
 				"variable": {
@@ -336,6 +341,7 @@
 		},
 		"StasisEnd": {
 			"id": "StasisEnd",
+			"extends": "Event",
 			"description": "Notification that a channel has left a Stasis appliction.",
 			"properties": {
 				"channel": {
@@ -346,6 +352,7 @@
 		},
 		"StasisStart": {
 			"id": "StasisStart",
+			"extends": "Event",
 			"description": "Notification that a channel has entered a Stasis appliction.",
 			"properties": {
 				"args": {




More information about the svn-commits mailing list