2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									"_copyright" :  "Copyright (C) 2012 - 2013, Digium, Inc." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									"_author" :  "David M. Lee, II <dlee@digium.com>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									"_svn_revision" :  "$Revision$" , 
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 09:46:48 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									"apiVersion" :  "2.0.0" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									"swaggerVersion" :  "1.1" , 
							 
						 
					
						
							
								
									
										
										
										
											2014-09-20 23:41:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									"basePath" :  "http://localhost:8088/ari" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									"resourcePath" :  "/api-docs/recordings.{format}" , 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-18 10:01:26 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									"requiresModules" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										"res_stasis_recording" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									] , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
									"apis" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"path" :  "/recordings/stored" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"description" :  "Recordings" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"operations" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"httpMethod" :  "GET" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"summary" :  "List recordings that are complete." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"nickname" :  "listStored" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "List[StoredRecording]" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											"path" :  "/recordings/stored/{recordingName}" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											"description" :  "Individual recording" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"operations" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"httpMethod" :  "GET" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"summary" :  "Get a stored recording's details." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"nickname" :  "getStored" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "StoredRecording" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"parameters" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"name" :  "recordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The name of the recording" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
															"paramType" :  "path" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-30 13:28:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"errorResponses" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  404 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"httpMethod" :  "DELETE" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"summary" :  "Delete a stored recording." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"nickname" :  "deleteStored" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "void" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"parameters" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"name" :  "recordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The name of the recording" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
															"paramType" :  "path" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-30 13:28:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"errorResponses" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  404 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} , 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-18 06:19:58 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"path" :  "/recordings/stored/{recordingName}/file" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"description" :  "The actual file associated with the stored recording" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"operations" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"httpMethod" :  "GET" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"summary" :  "Get the file associated with the stored recording." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"nickname" :  "getStoredFile" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "binary" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"parameters" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"name" :  "recordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The name of the recording" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"paramType" :  "path" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"errorResponses" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  403 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "The recording file could not be opened" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  404 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} , 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-18 21:48:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"path" :  "/recordings/stored/{recordingName}/copy" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"description" :  "Copy an individual recording" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"operations" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"httpMethod" :  "POST" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"summary" :  "Copy a stored recording." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"nickname" :  "copyStored" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "StoredRecording" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"parameters" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"name" :  "recordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The name of the recording to copy" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"paramType" :  "path" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"name" :  "destinationRecordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The destination name of the recording" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"paramType" :  "query" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"errorResponses" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  404 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  409 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "A recording with the same name already exists on the system" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
										{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											"path" :  "/recordings/live/{recordingName}" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											"description" :  "A recording that is in progress" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"operations" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"httpMethod" :  "GET" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"summary" :  "List live recordings." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"nickname" :  "getLive" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "LiveRecording" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"parameters" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"name" :  "recordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The name of the recording" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
															"paramType" :  "path" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 14:44:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"errorResponses" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  404 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"httpMethod" :  "DELETE" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"summary" :  "Stop a live recording and discard it." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"nickname" :  "cancel" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "void" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"parameters" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"name" :  "recordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The name of the recording" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
															"paramType" :  "path" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 14:44:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"errorResponses" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  404 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											"path" :  "/recordings/live/{recordingName}/stop" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											"operations" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"httpMethod" :  "POST" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"summary" :  "Stop a live recording and store it." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"nickname" :  "stop" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "void" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"parameters" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"name" :  "recordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The name of the recording" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
															"paramType" :  "path" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 14:44:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"errorResponses" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  404 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											"path" :  "/recordings/live/{recordingName}/pause" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											"operations" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"httpMethod" :  "POST" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"summary" :  "Pause a live recording." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 14:44:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"notes" :  "Pausing a recording suspends silence detection, which will be restarted when the recording is unpaused. Paused time is not included in the accounting for maxDurationSeconds." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"nickname" :  "pause" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "void" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"parameters" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"name" :  "recordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The name of the recording" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
															"paramType" :  "path" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 14:44:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"errorResponses" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  404 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  409 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not in session" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													] 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"httpMethod" :  "DELETE" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"summary" :  "Unpause a live recording." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"nickname" :  "unpause" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "void" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"parameters" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"name" :  "recordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The name of the recording" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
															"paramType" :  "path" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 14:44:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"errorResponses" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  404 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  409 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not in session" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											"path" :  "/recordings/live/{recordingName}/mute" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											"operations" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"httpMethod" :  "POST" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"summary" :  "Mute a live recording." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"notes" :  "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"nickname" :  "mute" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "void" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"parameters" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"name" :  "recordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The name of the recording" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
															"paramType" :  "path" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 14:44:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"errorResponses" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  404 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  409 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not in session" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													] 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
												{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"httpMethod" :  "DELETE" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"summary" :  "Unmute a live recording." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-07 21:10:31 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"nickname" :  "unmute" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"responseClass" :  "void" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"parameters" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-03 17:58:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"name" :  "recordingName" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"description" :  "The name of the recording" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
															"paramType" :  "path" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"allowMultiple" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"dataType" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-06 14:44:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"errorResponses" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  404 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not found" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"code" :  409 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"reason" :  "Recording not in session" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									"models" :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										"StoredRecording" :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"id" :  "StoredRecording" , 
							 
						 
					
						
							
								
									
										
											 
										
											
												Update events to use Swagger 1.3 subtyping, and related aftermath
This patch started with the simple idea of changing the /events data
model to be more sane. The original model would send out events like:
    { "stasis_start": { "args": [], "channel": { ... } } }
The event discriminator was the field name instead of being a value in
the object, due to limitations in how Swagger 1.1 could model objects.
While technically sufficient in communicating event information, it was
really difficult to deal with in terms of client side JSON handling.
This patch takes advantage of a proposed extension[1] to Swagger which
allows type variance through the use of a discriminator field. This had
a domino effect that made this a surprisingly large patch.
 [1]: https://groups.google.com/d/msg/wordnik-api/EC3rGajE0os/ey_5dBI_jWcJ
In changing the models, I also had to change the swagger_model.py
processor so it can handle the type discriminator and subtyping. I took
that a big step forward, and using that information to generate an
ari_model module, which can validate a JSON object against the Swagger
model.
The REST and WebSocket generators were changed to take advantage of the
validators. If compiled with AST_DEVMODE enabled, JSON objects that
don't match their corresponding models will not be sent out. For REST
API calls, a 500 Internal Server response is sent. For WebSockets, the
invalid JSON message is replaced with an error message.
Since this took over about half of the job of the existing JSON
generators, and the .to_json virtual function on messages took over the
other half, I reluctantly removed the generators.
The validators turned up all sorts of errors and inconsistencies in our
data models, and the code. These were cleaned up, with checks in the
code generator avoid some of the consistency problems in the future.
 * The model for a channel snapshot was trimmed down to match the
   information sent via AMI. Many of the field being sent were not
   useful in the general case.
 * The model for a bridge snapshot was updated to be more consistent
   with the other ARI models.
Another impact of introducing subtyping was that the swagger-codegen
documentation generator was insufficient (at least until it catches up
with Swagger 1.2). I wanted it to be easier to generate docs for the API
anyways, so I ported the wiki pages to use the Asterisk Swagger
generator. In the process, I was able to clean up many of the model
links, which would occasionally give inconsistent results on the wiki. I
also added error responses to the wiki docs, making the wiki
documentation more complete.
Finally, since Stasis-HTTP will now be named Asterisk REST Interface
(ARI), any new functions and files I created carry the ari_ prefix. I
changed a few stasis_http references to ari where it was non-intrusive
and made sense.
(closes issue ASTERISK-21885)
Review: https://reviewboard.asterisk.org/r/2639/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
											 
										 
										
											2013-07-03 16:32:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											"description" :  "A past recording that may be played back." , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											"properties" :  { 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-30 13:28:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												"name" :  { 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"type" :  "string" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-30 13:28:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												"format" :  { 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
													"required" :  true , 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-30 13:28:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"type" :  "string" 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										"LiveRecording" :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											"id" :  "LiveRecording" , 
							 
						 
					
						
							
								
									
										
											 
										
											
												Update events to use Swagger 1.3 subtyping, and related aftermath
This patch started with the simple idea of changing the /events data
model to be more sane. The original model would send out events like:
    { "stasis_start": { "args": [], "channel": { ... } } }
The event discriminator was the field name instead of being a value in
the object, due to limitations in how Swagger 1.1 could model objects.
While technically sufficient in communicating event information, it was
really difficult to deal with in terms of client side JSON handling.
This patch takes advantage of a proposed extension[1] to Swagger which
allows type variance through the use of a discriminator field. This had
a domino effect that made this a surprisingly large patch.
 [1]: https://groups.google.com/d/msg/wordnik-api/EC3rGajE0os/ey_5dBI_jWcJ
In changing the models, I also had to change the swagger_model.py
processor so it can handle the type discriminator and subtyping. I took
that a big step forward, and using that information to generate an
ari_model module, which can validate a JSON object against the Swagger
model.
The REST and WebSocket generators were changed to take advantage of the
validators. If compiled with AST_DEVMODE enabled, JSON objects that
don't match their corresponding models will not be sent out. For REST
API calls, a 500 Internal Server response is sent. For WebSockets, the
invalid JSON message is replaced with an error message.
Since this took over about half of the job of the existing JSON
generators, and the .to_json virtual function on messages took over the
other half, I reluctantly removed the generators.
The validators turned up all sorts of errors and inconsistencies in our
data models, and the code. These were cleaned up, with checks in the
code generator avoid some of the consistency problems in the future.
 * The model for a channel snapshot was trimmed down to match the
   information sent via AMI. Many of the field being sent were not
   useful in the general case.
 * The model for a bridge snapshot was updated to be more consistent
   with the other ARI models.
Another impact of introducing subtyping was that the swagger-codegen
documentation generator was insufficient (at least until it catches up
with Swagger 1.2). I wanted it to be easier to generate docs for the API
anyways, so I ported the wiki pages to use the Asterisk Swagger
generator. In the process, I was able to clean up many of the model
links, which would occasionally give inconsistent results on the wiki. I
also added error responses to the wiki docs, making the wiki
documentation more complete.
Finally, since Stasis-HTTP will now be named Asterisk REST Interface
(ARI), any new functions and files I created carry the ari_ prefix. I
changed a few stasis_http references to ari where it was non-intrusive
and made sense.
(closes issue ASTERISK-21885)
Review: https://reviewboard.asterisk.org/r/2639/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
											 
										 
										
											2013-07-03 16:32:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											"description" :  "A recording that is in progress" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
											"properties" :  { 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-19 19:35:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												"name" :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"required" :  true , 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-30 13:28:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"type" :  "string" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"description" :  "Base name for the recording" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												"format" :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"type" :  "string" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"description" :  "Recording format (wav, gsm, etc.)" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
									
										
										
										
											2014-03-06 18:20:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												"target_uri" :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"required" :  true , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"type" :  "string" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"description" :  "URI for the channel or bridge being recorded" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-30 13:28:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												"state" :  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-25 14:47:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"required" :  true , 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-30 13:28:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													"type" :  "string" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"allowableValues" :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														"valueType" :  "LIST" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														"values" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"queued" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-25 21:28:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"recording" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-30 13:28:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"paused" , 
							 
						 
					
						
							
								
									
										
										
										
											2013-10-25 21:28:32 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
															"done" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"failed" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
															"canceled" 
							 
						 
					
						
							
								
									
										
										
										
											2013-08-30 13:28:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
														] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2013-07-19 19:35:21 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
									
										
										
										
											2014-07-25 14:47:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												"duration" :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"required" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"type" :  "int" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"description" :  "Duration in seconds of the recording" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												"talking_duration" :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"required" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"type" :  "int" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"description" :  "Duration of talking, in seconds, detected in the recording. This is only available if the recording was initiated with a non-zero maxSilenceSeconds." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												"silence_duration" :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"required" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"type" :  "int" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"description" :  "Duration of silence, in seconds, detected in the recording. This is only available if the recording was initiated with a non-zero maxSilenceSeconds." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} , 
							 
						 
					
						
							
								
									
										
										
										
											2013-11-23 12:52:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												"cause" :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"required" :  false , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"type" :  "string" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													"description" :  "Cause for recording failure if failed" 
							 
						 
					
						
							
								
									
										
										
										
											2013-04-22 14:58:53 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}