diff --git a/.gitignore b/.gitignore index b6f70359..01386964 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,10 @@ build.xml # macbook .DS_Store +# netbeans +.nb-gradle/ + +#codegen3 +codegen3/gen-java/ + + diff --git a/README.md b/README.md index 17352bab..0a39a5b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ ari4java ======== +(branch codegen3) + The Asterisk REST Interface (ARI) bindings for Java. [ ![Download](https://api.bintray.com/packages/lenz/maven/ari4java/images/download.png) ](https://bintray.com/lenz/maven/ari4java/_latestVersion) diff --git a/codegen3/.gitignore b/codegen3/.gitignore new file mode 100644 index 00000000..e5e83a5c --- /dev/null +++ b/codegen3/.gitignore @@ -0,0 +1,10 @@ +/target +/classes +/checkouts +pom.xml +pom.xml.asc +*.jar +*.class +/.lein-* +/.nrepl-port +.idea/ diff --git a/codegen3/README.md b/codegen3/README.md new file mode 100644 index 00000000..51fdd6cd --- /dev/null +++ b/codegen3/README.md @@ -0,0 +1,82 @@ +# codegen3 + +This is the module that generates Java classes out of Swagger +defintions for *ari4java*. + +It is meant to be run through a Clojure REPL, though I'm sure +you could make it a simple executable if you want/need to. + +## Running + +Start up a REPL: + + +Run a build of ari4java to make sure everything still works: + + +It expects to find the current set of bindings +under *resources* and will generate +Java code under + + +## Description + +## Todo + +* Actions + + public List list() throws RestException; + + public void unsubscribe(String applicationName, String eventSource, AriCallback callback); + public void unsubscribe(String applicationName, String eventSource); + +* Action parameters: + + * Must read them from oldest to newest version + * Optional parameters + * Use enums for multi-value items + * Permutations: single/multiple parameters (allowMultiple=true) + * Permutations: sync/async methoods + + + + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + + + { + "name": "reason", + "description": "Reason for hanging up the channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defalutValue": "normal", + "allowableValues": { + "valueType": "LIST", + "values": [ + "normal", + "busy", + "congestion" + ] + } + } + + + +* Create equals() and hashCode() and toString() for generated models +* Build script +* Which classes are tagged as "extends EventSource"? shouldnt it be "implements"? + + +# License + +LGPL diff --git a/codegen3/doc/intro.md b/codegen3/doc/intro.md new file mode 100644 index 00000000..38c10687 --- /dev/null +++ b/codegen3/doc/intro.md @@ -0,0 +1,3 @@ +# Introduction to codegen3 + +TODO: write [great documentation](http://jacobian.org/writing/what-to-write/) diff --git a/codegen3/project.clj b/codegen3/project.clj new file mode 100644 index 00000000..6b91de30 --- /dev/null +++ b/codegen3/project.clj @@ -0,0 +1,16 @@ +(defproject codegen3 "0.1.0-SNAPSHOT" + :description "FIXME: write description" + :url "http://example.com/FIXME" + :license {:name "LGPL"} + :dependencies [ + [org.clojure/clojure "1.9.0"] + [org.clojure/spec.alpha "0.1.143"] + [org.clojure/test.check "0.9.0"] ; should be in DEV + [orchestra "2017.11.12-1"] + [org.clojure/data.json "0.2.6"] + [com.rpl/specter "1.0.5"]] + :main ^:skip-aot codegen3.core + :plugins [[lein-codox "0.9.5"] + [lein-kibit "0.1.2"]] + :target-path "target/%s" + :profiles {:uberjar {:aot :all}}) diff --git a/codegen3/resources/COPYING.asterisk b/codegen3/resources/COPYING.asterisk new file mode 100644 index 00000000..aa2ebac6 --- /dev/null +++ b/codegen3/resources/COPYING.asterisk @@ -0,0 +1,341 @@ + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/codegen3/resources/LICENSE.asterisk b/codegen3/resources/LICENSE.asterisk new file mode 100644 index 00000000..d530d18c --- /dev/null +++ b/codegen3/resources/LICENSE.asterisk @@ -0,0 +1,62 @@ +Asterisk is distributed under the GNU General Public License version 2 +and is also available under alternative licenses negotiated directly +with Digium, Inc. If you obtained Asterisk under the GPL, then the GPL +applies to all loadable Asterisk modules used on your system as well, +except as defined below. The GPL (version 2) is included in this +source tree in the file COPYING. + +This package also includes various components that are not part of +Asterisk itself; these components are in the 'contrib' directory +and its subdirectories. These components are also distributed under the +GPL version 2 as well. + +Digium, Inc. (formerly Linux Support Services) holds copyright +and/or sufficient licenses to all components of the Asterisk +package, and therefore can grant, at its sole discretion, the ability +for companies, individuals, or organizations to create proprietary or +Open Source (even if not GPL) modules which may be dynamically linked at +runtime with the portions of Asterisk which fall under our +copyright/license umbrella, or are distributed under more flexible +licenses than GPL. + +If you wish to use our code in other GPL programs, don't worry -- +there is no requirement that you provide the same exception in your +GPL'd products (although if you've written a module for Asterisk we +would strongly encourage you to make the same exception that we do). + +Specific permission is also granted to link Asterisk with OpenSSL, OpenH323 +and/or the UW IMAP Toolkit and distribute the resulting binary files. + +In addition, Asterisk implements two management/control protocols: the +Asterisk Manager Interface (AMI) and the Asterisk Gateway Interface +(AGI). It is our belief that applications using these protocols to +manage or control an Asterisk instance do not have to be licensed +under the GPL or a compatible license, as we believe these protocols +do not create a 'derivative work' as referred to in the GPL. However, +should any court or other judiciary body find that these protocols do +fall under the terms of the GPL, then we hereby grant you a license to +use these protocols in combination with Asterisk in external +applications licensed under any license you wish. + +The 'Asterisk' name and logos are trademarks owned by Digium, Inc., +and use of them is subject to our trademark licensing policies. If you +wish to use these trademarks for purposes other than simple +redistribution of Asterisk source code obtained from Digium, you +should contact our licensing department to determine the necessary +steps you must take. For more information on this policy, please read: + +http://www.digium.com/en/company/profile/trademarkpolicy.php + +If you have any questions regarding our licensing policy, please +contact us: + ++1.877.344.4861 (via telephone in the USA) ++1.256.428.6000 (via telephone outside the USA) ++1.256.864.0464 (via FAX inside or outside the USA) +IAX2/pbx.digium.com (via IAX2) +licensing@digium.com (via email) + +Digium, Inc. +445 Jan Davis Drive +Huntsville, AL 35806 +USA diff --git a/codegen3/resources/ari_0_0_1/README.md b/codegen3/resources/ari_0_0_1/README.md new file mode 100644 index 00000000..bf909c7e --- /dev/null +++ b/codegen3/resources/ari_0_0_1/README.md @@ -0,0 +1 @@ +Snapshot taken from Asterisk 12 beta 2 - November 25, 2013 diff --git a/codegen3/resources/ari_0_0_1/applications.json b/codegen3/resources/ari_0_0_1/applications.json new file mode 100644 index 00000000..4eaec41a --- /dev/null +++ b/codegen3/resources/ari_0_0_1/applications.json @@ -0,0 +1,172 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 403134 $", + "apiVersion": "0.0.1", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/applications.{format}", + "apis": [ + { + "path": "/applications", + "description": "Stasis applications", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all applications.", + "nickname": "list", + "responseClass": "List[Application]" + } + ] + }, + { + "path": "/applications/{applicationName}", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get details of an application.", + "nickname": "get", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + } + ] + } + ] + }, + { + "path": "/applications/{applicationName}/subscription", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "POST", + "summary": "Subscribe an application to a event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "subscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unsubscribe an application from an event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "unsubscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, device_state:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter; event source scheme not recognized." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 409, + "reason": "Application not subscribed to event source." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + } + ] + } + ], + "models": { + "Application": { + "id": "Application", + "description": "Details of a Stasis application", + "properties": { + "name": { + "type": "string", + "description": "Name of this application", + "required": true + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's for channels subscribed to.", + "required": true + }, + "bridge_ids": { + "type": "List[string]", + "description": "Id's for bridges subscribed to.", + "required": true + }, + "endpoint_ids": { + "type": "List[string]", + "description": "{tech}/{resource} for endpoints subscribed to.", + "required": true + }, + "device_names": { + "type": "List[string]", + "description": "Names of the devices subscribed to.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_0_0_1/asterisk.json b/codegen3/resources/ari_0_0_1/asterisk.json new file mode 100644 index 00000000..59e9ad76 --- /dev/null +++ b/codegen3/resources/ari_0_0_1/asterisk.json @@ -0,0 +1,259 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 402528 $", + "apiVersion": "0.0.1", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/asterisk.{format}", + "apis": [ + { + "path": "/asterisk/info", + "description": "Asterisk system information (similar to core show settings)", + "operations": [ + { + "httpMethod": "GET", + "summary": "Gets Asterisk system information.", + "nickname": "getInfo", + "responseClass": "AsteriskInfo", + "parameters": [ + { + "name": "only", + "description": "Filter information returned", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "build", + "system", + "config", + "status" + ] + } + } + ] + } + ] + }, + { + "path": "/asterisk/variable", + "description": "Global variables", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a global variable.", + "nickname": "getGlobalVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "variable", + "description": "The variable to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a global variable.", + "nickname": "setGlobalVar", + "responseClass": "void", + "parameters": [ + { + "name": "variable", + "description": "The variable to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + } + ] + } + ], + "models": { + "BuildInfo": { + "id": "BuildInfo", + "description": "Info about how Asterisk was built", + "properties": { + "os": { + "required": true, + "type": "string", + "description": "OS Asterisk was built on." + }, + "kernel": { + "required": true, + "type": "string", + "description": "Kernel version Asterisk was built on." + }, + "options": { + "required": true, + "type": "string", + "description": "Compile time options, or empty string if default." + }, + "machine": { + "required": true, + "type": "string", + "description": "Machine architecture (x86_64, i686, ppc, etc.)" + }, + "date": { + "required": true, + "type": "string", + "description": "Date and time when Asterisk was built." + }, + "user": { + "required": true, + "type": "string", + "description": "Username that build Asterisk" + } + } + }, + "SystemInfo": { + "id": "SystemInfo", + "description": "Info about Asterisk", + "properties": { + "version": { + "required": true, + "type": "string", + "description": "Asterisk version." + }, + "entity_id": { + "required": true, + "type": "string", + "description": "" + } + } + }, + "SetId": { + "id": "SetId", + "description": "Effective user/group id", + "properties": { + "user": { + "required": true, + "type": "string", + "description": "Effective user id." + }, + "group": { + "required": true, + "type": "string", + "description": "Effective group id." + } + } + }, + "ConfigInfo": { + "id": "ConfigInfo", + "description": "Info about Asterisk configuration", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Asterisk system name." + }, + "default_language": { + "required": true, + "type": "string", + "description": "Default language for media playback." + }, + "max_channels": { + "required": false, + "type": "int", + "description": "Maximum number of simultaneous channels." + }, + "max_open_files": { + "required": false, + "type": "int", + "description": "Maximum number of open file handles (files, sockets)." + }, + "max_load": { + "required": false, + "type": "double", + "description": "Maximum load avg on system." + }, + "setid": { + "required": true, + "type": "SetId", + "description": "Effective user/group id for running Asterisk." + } + } + }, + "StatusInfo": { + "id": "StatusInfo", + "description": "Info about Asterisk status", + "properties": { + "startup_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was started." + }, + "last_reload_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was last reloaded." + } + } + }, + "AsteriskInfo": { + "id": "AsteriskInfo", + "description": "Asterisk system information", + "properties": { + "build": { + "required": false, + "type": "BuildInfo", + "description": "Info about how Asterisk was built" + }, + "system": { + "required": false, + "type": "SystemInfo", + "description": "Info about the system running Asterisk" + }, + "config": { + "required": false, + "type": "ConfigInfo", + "description": "Info about Asterisk configuration" + }, + "status": { + "required": false, + "type": "StatusInfo", + "description": "Info about Asterisk status" + } + } + }, + "Variable": { + "id": "Variable", + "description": "The value of a channel variable", + "properties": { + "value": { + "required": true, + "type": "string", + "description": "The value of the variable requested" + } + } + } + } +} diff --git a/codegen3/resources/ari_0_0_1/bridges.json b/codegen3/resources/ari_0_0_1/bridges.json new file mode 100644 index 00000000..6636aa93 --- /dev/null +++ b/codegen3/resources/ari_0_0_1/bridges.json @@ -0,0 +1,513 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 402528 $", + "apiVersion": "0.0.1", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/bridges.{format}", + "apis": [ + { + "path": "/bridges", + "description": "Active bridges", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active bridges in Asterisk.", + "nickname": "list", + "responseClass": "List[Bridge]" + }, + { + "httpMethod": "POST", + "summary": "Create a new bridge.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "create", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Type of bridge to create.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "mixing", + "holding" + ] + } + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}", + "description": "Individual bridge", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get bridge details.", + "nickname": "get", + "responseClass": "Bridge", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Shut down a bridge.", + "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", + "nickname": "destroy", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/addChannel", + "description": "Add a channel to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Add a channel to a bridge.", + "nickname": "addChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to add to bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "role", + "description": "Channel's role in the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/removeChannel", + "description": "Remove a channel from a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Remove a channel from a bridge.", + "nickname": "removeChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to remove from bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in this bridge" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/moh", + "description": "Play music on hold to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a bridge or change the MOH class that is playing.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Channel's id", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a bridge.", + "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play", + "description": "Play media to the participants of a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/record", + "description": "Record audio on a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "This records the mixed audio from all channels participating in this bridge.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + } + ], + "models": { + "Bridge": { + "id": "Bridge", + "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for this bridge", + "required": true + }, + "technology": { + "type": "string", + "description": "Name of the current bridging technology", + "required": true + }, + "bridge_type": { + "type": "string", + "description": "Type of bridge technology", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "mixing", + "holding" + ] + } + }, + "bridge_class": { + "type": "string", + "description": "Bridging class", + "required": true + }, + "channels": { + "type": "List[string]", + "description": "Ids of channels participating in this bridge", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_0_0_1/channels.json b/codegen3/resources/ari_0_0_1/channels.json new file mode 100644 index 00000000..97e6b103 --- /dev/null +++ b/codegen3/resources/ari_0_0_1/channels.json @@ -0,0 +1,1144 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 403117 $", + "apiVersion": "0.0.1", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/channels.{format}", + "apis": [ + { + "path": "/channels", + "description": "Active channels", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active channels in Asterisk.", + "nickname": "list", + "responseClass": "List[Channel]" + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originate", + "responseClass": "Channel", + "parameters": [ + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel, and passed to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + } + ] + }, + { + "path": "/channels/{channelId}", + "description": "Active channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Channel details.", + "nickname": "get", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete (i.e. hangup) a channel.", + "nickname": "hangup", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "reason", + "description": "Reason for hanging up the channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defalutValue": "normal", + "allowableValues": { + "valueType": "LIST", + "values": [ + "normal", + "busy", + "congestion" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid reason for hangup provided" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/continue", + "description": "Exit application; continue execution in the dialplan", + "operations": [ + { + "httpMethod": "POST", + "summary": "Exit application; continue execution in the dialplan.", + "nickname": "continueInDialplan", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/answer", + "description": "Answer a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Answer a channel.", + "nickname": "answer", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/ring", + "description": "Send a ringing indication to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Indicate ringing to a channel.", + "nickname": "ring", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop ringing indication on a channel if locally generated.", + "nickname": "ringStop", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/dtmf", + "description": "Send DTMF to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Send provided DTMF to a given channel.", + "nickname": "sendDTMF", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "dtmf", + "description": "DTMF To send.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "before", + "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + }, + { + "name": "between", + "description": "Amount of time in between DTMF digits (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "duration", + "description": "Length of each DTMF digit (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "after", + "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "DTMF is required" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/mute", + "description": "Mute a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a channel.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to mute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a channel.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to unmute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/hold", + "description": "Put a channel on hold", + "operations": [ + { + "httpMethod": "POST", + "summary": "Hold a channel.", + "nickname": "hold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Remove a channel from hold.", + "nickname": "unhold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/moh", + "description": "Play music on hold to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a channel.", + "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Music on hold class to use", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a channel.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/silence", + "description": "Play silence to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play silence to a channel.", + "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", + "nickname": "startSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing silence to a channel.", + "nickname": "stopSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media.", + "notes": "The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/record", + "description": "Record audio from a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/variable", + "description": "Variables on a channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a channel variable or function.", + "nickname": "getChannelVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a channel variable or function.", + "nickname": "setChannelVar", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannel", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + } + ], + "models": { + "Dialed": { + "id": "Dialed", + "description": "Dialed channel information.", + "properties": {} + }, + "DialplanCEP": { + "id": "DialplanCEP", + "description": "Dialplan location (context/extension/priority)", + "properties": { + "context": { + "required": true, + "type": "string", + "description": "Context in the dialplan" + }, + "exten": { + "required": true, + "type": "string", + "description": "Extension in the dialplan" + }, + "priority": { + "required": true, + "type": "long", + "description": "Priority in the dialplan" + } + } + }, + "CallerID": { + "id": "CallerID", + "description": "Caller identification", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "number": { + "required": true, + "type": "string" + } + } + }, + "Channel": { + "id": "Channel", + "description": "A specific communication connection between Asterisk and an Endpoint.", + "properties": { + "id": { + "required": true, + "type": "string", + "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI." + }, + "name": { + "required": true, + "type": "string", + "description": "Name of the channel (i.e. SIP/foo-0000a7e3)" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "Down", + "Rsrved", + "OffHook", + "Dialing", + "Ring", + "Ringing", + "Up", + "Busy", + "Dialing Offhook", + "Pre-ring", + "Unknown" + ] + } + }, + "caller": { + "required": true, + "type": "CallerID" + }, + "connected": { + "required": true, + "type": "CallerID" + }, + "accountcode": { + "required": true, + "type": "string" + }, + "dialplan": { + "required": true, + "type": "DialplanCEP", + "description": "Current location in the dialplan" + }, + "creationtime": { + "required": true, + "type": "Date", + "description": "Timestamp when channel was created" + } + } + } + } +} diff --git a/codegen3/resources/ari_0_0_1/deviceStates.json b/codegen3/resources/ari_0_0_1/deviceStates.json new file mode 100644 index 00000000..5d88ebf2 --- /dev/null +++ b/codegen3/resources/ari_0_0_1/deviceStates.json @@ -0,0 +1,151 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "Kevin Harwell ", + "_svn_revision": "$Revision: 403134 $", + "apiVersion": "0.0.1", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/deviceStates.{format}", + "apis": [ + { + "path": "/deviceStates", + "description": "Device states", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all ARI controlled device states.", + "nickname": "list", + "responseClass": "List[DeviceState]" + } + ] + }, + { + "path": "/deviceStates/{deviceName}", + "description": "Device state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a device.", + "nickname": "get", + "responseClass": "DeviceState", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "deviceState", + "description": "Device state value", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a device-state controlled by ARI.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + } + ] + } + ], + "models": { + "DeviceState": { + "id": "DeviceState", + "description": "Represents the state of a device.", + "properties": { + "name": { + "type": "string", + "description": "Name of the device.", + "required": true + }, + "state": { + "type": "string", + "description": "Device's state", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "UNKNOWN", + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_0_0_1/endpoints.json b/codegen3/resources/ari_0_0_1/endpoints.json new file mode 100644 index 00000000..a5385276 --- /dev/null +++ b/codegen3/resources/ari_0_0_1/endpoints.json @@ -0,0 +1,117 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 402787 $", + "apiVersion": "0.0.1", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/endpoints.{format}", + "apis": [ + { + "path": "/endpoints", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all endpoints.", + "nickname": "list", + "responseClass": "List[Endpoint]" + } + ] + }, + { + "path": "/endpoints/{tech}", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List available endoints for a given endpoint technology.", + "nickname": "listByTech", + "responseClass": "List[Endpoint]", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoints (sip,iax2,...)", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}", + "description": "Single endpoint", + "operations": [ + { + "httpMethod": "GET", + "summary": "Details for an endpoint.", + "nickname": "get", + "responseClass": "Endpoint", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + } + ], + "models": { + "Endpoint": { + "id": "Endpoint", + "description": "An external device that may offer/accept calls to/from Asterisk.\n\nUnlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.", + "properties": { + "technology": { + "type": "string", + "description": "Technology of the endpoint", + "required": true + }, + "resource": { + "type": "string", + "description": "Identifier of the endpoint, specific to the given technology.", + "required": true + }, + "state": { + "type": "string", + "description": "Endpoint's state", + "required": false, + "allowableValues": { + "valueType": "LIST", + "values": [ + "unknown", + "offline", + "online" + ] + } + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's of channels associated with this endpoint", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_0_0_1/events.json b/codegen3/resources/ari_0_0_1/events.json new file mode 100644 index 00000000..d92209d8 --- /dev/null +++ b/codegen3/resources/ari_0_0_1/events.json @@ -0,0 +1,437 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 403134 $", + "apiVersion": "0.0.1", + "swaggerVersion": "1.2", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/events.{format}", + "apis": [ + { + "path": "/events", + "description": "Events from Asterisk to applications", + "operations": [ + { + "httpMethod": "GET", + "upgrade": "websocket", + "websocketProtocol": "ari", + "summary": "WebSocket connection for events.", + "nickname": "eventWebsocket", + "responseClass": "Message", + "parameters": [ + { + "name": "app", + "description": "Applications to subscribe to.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ] + } + ] + } + ], + "models": { + "Message": { + "id": "Message", + "description": "Base type for errors and events", + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "required": true, + "description": "Indicates the type of this message." + } + }, + "subTypes": [ + "MissingParams", + "Event" + ] + }, + "MissingParams": { + "id": "MissingParams", + "description": "Error event sent when required params are missing.", + "properties": { + "params": { + "required": true, + "type": "List[string]", + "description": "A list of the missing parameters" + } + } + }, + "Event": { + "id": "Event", + "description": "Base type for asynchronous events from Asterisk.", + "properties": { + "application": { + "type": "string", + "description": "Name of the application receiving the event.", + "required": true + }, + "timestamp": { + "type": "Date", + "description": "Time at which this event was created.", + "required": false + } + }, + "subTypes": [ + "DeviceStateChanged", + "PlaybackStarted", + "PlaybackFinished", + "ApplicationReplaced", + "BridgeCreated", + "BridgeDestroyed", + "BridgeMerged", + "ChannelCreated", + "ChannelDestroyed", + "ChannelEnteredBridge", + "ChannelLeftBridge", + "ChannelStateChange", + "ChannelDtmfReceived", + "ChannelDialplan", + "ChannelCallerId", + "ChannelUserevent", + "ChannelHangupRequest", + "ChannelVarset", + "EndpointStateChange", + "StasisEnd", + "StasisStart" + ] + }, + "DeviceStateChanged": { + "id": "DeviceStateChanged", + "description": "Notification that a device state has changed.", + "properties": { + "device_state": { + "type": "DeviceState", + "description": "Device state object", + "required": true + } + } + }, + "PlaybackStarted": { + "id": "PlaybackStarted", + "description": "Event showing the start of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "PlaybackFinished": { + "id": "PlaybackFinished", + "description": "Event showing the completion of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "RecordingStarted": { + "id": "RecordingStarted", + "extends": "Event", + "description": "Event showing the start of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFinished": { + "id": "RecordingFinished", + "extends": "Event", + "description": "Event showing the completion of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFailed": { + "id": "RecordingFailed", + "extends": "Event", + "description": "Event showing failure of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "ApplicationReplaced": { + "id": "ApplicationReplaced", + "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": {} + }, + "BridgeCreated": { + "id": "BridgeCreated", + "description": "Notification that a bridge has been created.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeDestroyed": { + "id": "BridgeDestroyed", + "description": "Notification that a bridge has been destroyed.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeMerged": { + "id": "BridgeMerged", + "description": "Notification that one bridge has merged into another.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "bridge_from": { + "required": true, + "type": "Bridge" + } + } + }, + "ChannelCreated": { + "id": "ChannelCreated", + "description": "Notification that a channel has been created.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDestroyed": { + "id": "ChannelDestroyed", + "description": "Notification that a channel has been destroyed.", + "properties": { + "cause": { + "required": true, + "description": "Integer representation of the cause of the hangup", + "type": "int" + }, + "cause_txt": { + "required": true, + "description": "Text representation of the cause of the hangup", + "type": "string" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelEnteredBridge": { + "id": "ChannelEnteredBridge", + "description": "Notification that a channel has entered a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "type": "Channel" + } + } + }, + "ChannelLeftBridge": { + "id": "ChannelLeftBridge", + "description": "Notification that a channel has left a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelStateChange": { + "id": "ChannelStateChange", + "description": "Notification of a channel's state change.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDtmfReceived": { + "id": "ChannelDtmfReceived", + "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, + "type": "string", + "description": "DTMF digit received (0-9, A-E, # or *)" + }, + "duration_ms": { + "required": true, + "type": "int", + "description": "Number of milliseconds DTMF was received" + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which DTMF was received" + } + } + }, + "ChannelDialplan": { + "id": "ChannelDialplan", + "description": "Channel changed location in the dialplan.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed dialplan location." + }, + "dialplan_app": { + "required": true, + "type": "string", + "description": "The application about to be executed." + }, + "dialplan_app_data": { + "required": true, + "type": "string", + "description": "The data to be passed to the application." + } + } + }, + "ChannelCallerId": { + "id": "ChannelCallerId", + "description": "Channel changed Caller ID.", + "properties": { + "caller_presentation": { + "required": true, + "type": "int", + "description": "The integer representation of the Caller Presentation value." + }, + "caller_presentation_txt": { + "required": true, + "type": "string", + "description": "The text representation of the Caller Presentation value." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed Caller ID." + } + } + }, + "ChannelUserevent": { + "id": "ChannelUserevent", + "description": "User-generated event with additional user-defined fields in the object.", + "properties": { + "eventname": { + "required": true, + "type": "string", + "description": "The name of the user event." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that signaled the user event." + }, + "userevent": { + "required": true, + "type": "object", + "description": "Custom Userevent data" + } + } + }, + "ChannelHangupRequest": { + "id": "ChannelHangupRequest", + "description": "A hangup was requested on the channel.", + "properties": { + "cause": { + "type": "int", + "description": "Integer representation of the cause of the hangup." + }, + "soft": { + "type": "boolean", + "description": "Whether the hangup request was a soft hangup request." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the hangup was requested." + } + } + }, + "ChannelVarset": { + "id": "ChannelVarset", + "description": "Channel variable changed.", + "properties": { + "variable": { + "required": true, + "type": "string", + "description": "The variable that changed." + }, + "value": { + "required": true, + "type": "string", + "description": "The new value of the variable." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable." + } + } + }, + "EndpointStateChange": { + "id": "EndpointStateChange", + "description": "Endpoint state changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + } + } + }, + "StasisEnd": { + "id": "StasisEnd", + "description": "Notification that a channel has left a Stasis application.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "StasisStart": { + "id": "StasisStart", + "description": "Notification that a channel has entered a Stasis application.", + "properties": { + "args": { + "required": true, + "type": "List[string]", + "description": "Arguments to the application" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + } + } +} diff --git a/codegen3/resources/ari_0_0_1/playbacks.json b/codegen3/resources/ari_0_0_1/playbacks.json new file mode 100644 index 00000000..d5650943 --- /dev/null +++ b/codegen3/resources/ari_0_0_1/playbacks.json @@ -0,0 +1,155 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 402560 $", + "apiVersion": "0.0.1", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/playbacks.{format}", + "apis": [ + { + "path": "/playbacks/{playbackId}", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a playback's details.", + "nickname": "get", + "responseClass": "Playback", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a playback.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + } + ] + }, + { + "path": "/playbacks/{playbackId}/control", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Control a playback.", + "nickname": "control", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "operation", + "description": "Operation to perform on the playback.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "restart", + "pause", + "unpause", + "reverse", + "forward" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "The provided operation parameter was invalid" + }, + { + "code": 404, + "reason": "The playback cannot be found" + }, + { + "code": 409, + "reason": "The operation cannot be performed in the playback's current state" + } +] + } + ] + } + ], + "models": { + "Playback": { + "id": "Playback", + "description": "Object representing the playback of media to a channel", + "properties": { + "id": { + "type": "string", + "description": "ID for this playback operation", + "required": true + }, + "media_uri": { + "type": "string", + "description": "URI for the media to play back.", + "required": true + }, + "target_uri": { + "type": "string", + "description": "URI for the channel or bridge to play the media on", + "required": true + }, + "language": { + "type": "string", + "description": "For media types that support multiple languages, the language requested for playback." + }, + "state": { + "type": "string", + "description": "Current state of the playback operation.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "playing", + "complete" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_0_0_1/recordings.json b/codegen3/resources/ari_0_0_1/recordings.json new file mode 100644 index 00000000..8e7c8df8 --- /dev/null +++ b/codegen3/resources/ari_0_0_1/recordings.json @@ -0,0 +1,326 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 403119 $", + "apiVersion": "0.0.1", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/recordings.{format}", + "apis": [ + { + "path": "/recordings/stored", + "description": "Recordings", + "operations": [ + { + "httpMethod": "GET", + "summary": "List recordings that are complete.", + "nickname": "listStored", + "responseClass": "List[StoredRecording]" + } + ] + }, + { + "path": "/recordings/stored/{recordingName}", + "description": "Individual recording", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a stored recording's details.", + "nickname": "getStored", + "responseClass": "StoredRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete a stored recording.", + "nickname": "deleteStored", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}", + "description": "A recording that is in progress", + "operations": [ + { + "httpMethod": "GET", + "summary": "List live recordings.", + "nickname": "getLive", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a live recording and discard it.", + "nickname": "cancel", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/stop", + "operations": [ + { + "httpMethod": "POST", + "summary": "Stop a live recording and store it.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/pause", + "operations": [ + { + "httpMethod": "POST", + "summary": "Pause a live recording.", + "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.", + "nickname": "pause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unpause a live recording.", + "nickname": "unpause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/mute", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a live recording.", + "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a live recording.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + } + ], + "models": { + "StoredRecording": { + "id": "StoredRecording", + "description": "A past recording that may be played back.", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "LiveRecording": { + "id": "LiveRecording", + "description": "A recording that is in progress", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Base name for the recording" + }, + "format": { + "required": true, + "type": "string", + "description": "Recording format (wav, gsm, etc.)" + }, + "state": { + "required": false, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "recording", + "paused", + "done", + "failed", + "canceled" + ] + } + }, + "cause": { + "required": false, + "type": "string", + "description": "Cause for recording failure if failed" + }, + "state": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + } + } +} diff --git a/codegen3/resources/ari_0_0_1/sounds.json b/codegen3/resources/ari_0_0_1/sounds.json new file mode 100644 index 00000000..1a92ee02 --- /dev/null +++ b/codegen3/resources/ari_0_0_1/sounds.json @@ -0,0 +1,99 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 402528 $", + "apiVersion": "0.0.1", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/sounds.{format}", + "apis": [ + { + "path": "/sounds", + "description": "Sounds", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all sounds.", + "nickname": "list", + "responseClass": "List[Sound]", + "parameters": [ + { + "name": "lang", + "description": "Lookup sound for a specific language.", + "paramType": "query", + "dataType": "string", + "required": false + }, + { + "name": "format", + "description": "Lookup sound in a specific format.", + "paramType": "query", + "dataType": "string", + "required": false, + "__note": "core show translation can show translation paths between formats, along with relative costs. so this could be just installed format, or we could follow that for transcoded formats." + } + ] + } + ] + }, + { + "path": "/sounds/{soundId}", + "description": "Individual sound", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a sound's details.", + "nickname": "get", + "responseClass": "Sound", + "parameters": [ + { + "name": "soundId", + "description": "Sound's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + } + ], + "models": { + "FormatLangPair": { + "id": "FormatLangPair", + "description": "Identifies the format and language of a sound file", + "properties": { + "language": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "Sound": { + "id": "Sound", + "description": "A media file that may be played back.", + "properties": { + "id": { + "required": true, + "description": "Sound's identifier.", + "type": "string" + }, + "text": { + "required": false, + "description": "Text description of the sound, usually the words spoken.", + "type": "string" + }, + "formats": { + "required": true, + "description": "The formats and languages in which this sound is available.", + "type": "List[FormatLangPair]" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_0_0/applications.json b/codegen3/resources/ari_1_0_0/applications.json new file mode 100644 index 00000000..0ef07406 --- /dev/null +++ b/codegen3/resources/ari_1_0_0/applications.json @@ -0,0 +1,172 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 404509 $", + "apiVersion": "1.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/applications.{format}", + "apis": [ + { + "path": "/applications", + "description": "Stasis applications", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all applications.", + "nickname": "list", + "responseClass": "List[Application]" + } + ] + }, + { + "path": "/applications/{applicationName}", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get details of an application.", + "nickname": "get", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + } + ] + } + ] + }, + { + "path": "/applications/{applicationName}/subscription", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "POST", + "summary": "Subscribe an application to a event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "subscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unsubscribe an application from an event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "unsubscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter; event source scheme not recognized." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 409, + "reason": "Application not subscribed to event source." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + } + ] + } + ], + "models": { + "Application": { + "id": "Application", + "description": "Details of a Stasis application", + "properties": { + "name": { + "type": "string", + "description": "Name of this application", + "required": true + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's for channels subscribed to.", + "required": true + }, + "bridge_ids": { + "type": "List[string]", + "description": "Id's for bridges subscribed to.", + "required": true + }, + "endpoint_ids": { + "type": "List[string]", + "description": "{tech}/{resource} for endpoints subscribed to.", + "required": true + }, + "device_names": { + "type": "List[string]", + "description": "Names of the devices subscribed to.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_0_0/asterisk.json b/codegen3/resources/ari_1_0_0/asterisk.json new file mode 100644 index 00000000..4c7da96e --- /dev/null +++ b/codegen3/resources/ari_1_0_0/asterisk.json @@ -0,0 +1,259 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 404184 $", + "apiVersion": "1.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/asterisk.{format}", + "apis": [ + { + "path": "/asterisk/info", + "description": "Asterisk system information (similar to core show settings)", + "operations": [ + { + "httpMethod": "GET", + "summary": "Gets Asterisk system information.", + "nickname": "getInfo", + "responseClass": "AsteriskInfo", + "parameters": [ + { + "name": "only", + "description": "Filter information returned", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "build", + "system", + "config", + "status" + ] + } + } + ] + } + ] + }, + { + "path": "/asterisk/variable", + "description": "Global variables", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a global variable.", + "nickname": "getGlobalVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "variable", + "description": "The variable to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a global variable.", + "nickname": "setGlobalVar", + "responseClass": "void", + "parameters": [ + { + "name": "variable", + "description": "The variable to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + } + ] + } + ], + "models": { + "BuildInfo": { + "id": "BuildInfo", + "description": "Info about how Asterisk was built", + "properties": { + "os": { + "required": true, + "type": "string", + "description": "OS Asterisk was built on." + }, + "kernel": { + "required": true, + "type": "string", + "description": "Kernel version Asterisk was built on." + }, + "options": { + "required": true, + "type": "string", + "description": "Compile time options, or empty string if default." + }, + "machine": { + "required": true, + "type": "string", + "description": "Machine architecture (x86_64, i686, ppc, etc.)" + }, + "date": { + "required": true, + "type": "string", + "description": "Date and time when Asterisk was built." + }, + "user": { + "required": true, + "type": "string", + "description": "Username that build Asterisk" + } + } + }, + "SystemInfo": { + "id": "SystemInfo", + "description": "Info about Asterisk", + "properties": { + "version": { + "required": true, + "type": "string", + "description": "Asterisk version." + }, + "entity_id": { + "required": true, + "type": "string", + "description": "" + } + } + }, + "SetId": { + "id": "SetId", + "description": "Effective user/group id", + "properties": { + "user": { + "required": true, + "type": "string", + "description": "Effective user id." + }, + "group": { + "required": true, + "type": "string", + "description": "Effective group id." + } + } + }, + "ConfigInfo": { + "id": "ConfigInfo", + "description": "Info about Asterisk configuration", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Asterisk system name." + }, + "default_language": { + "required": true, + "type": "string", + "description": "Default language for media playback." + }, + "max_channels": { + "required": false, + "type": "int", + "description": "Maximum number of simultaneous channels." + }, + "max_open_files": { + "required": false, + "type": "int", + "description": "Maximum number of open file handles (files, sockets)." + }, + "max_load": { + "required": false, + "type": "double", + "description": "Maximum load avg on system." + }, + "setid": { + "required": true, + "type": "SetId", + "description": "Effective user/group id for running Asterisk." + } + } + }, + "StatusInfo": { + "id": "StatusInfo", + "description": "Info about Asterisk status", + "properties": { + "startup_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was started." + }, + "last_reload_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was last reloaded." + } + } + }, + "AsteriskInfo": { + "id": "AsteriskInfo", + "description": "Asterisk system information", + "properties": { + "build": { + "required": false, + "type": "BuildInfo", + "description": "Info about how Asterisk was built" + }, + "system": { + "required": false, + "type": "SystemInfo", + "description": "Info about the system running Asterisk" + }, + "config": { + "required": false, + "type": "ConfigInfo", + "description": "Info about Asterisk configuration" + }, + "status": { + "required": false, + "type": "StatusInfo", + "description": "Info about Asterisk status" + } + } + }, + "Variable": { + "id": "Variable", + "description": "The value of a channel variable", + "properties": { + "value": { + "required": true, + "type": "string", + "description": "The value of the variable requested" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_0_0/bridges.json b/codegen3/resources/ari_1_0_0/bridges.json new file mode 100644 index 00000000..8c8007a4 --- /dev/null +++ b/codegen3/resources/ari_1_0_0/bridges.json @@ -0,0 +1,531 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 404184 $", + "apiVersion": "1.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/bridges.{format}", + "apis": [ + { + "path": "/bridges", + "description": "Active bridges", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active bridges in Asterisk.", + "nickname": "list", + "responseClass": "List[Bridge]" + }, + { + "httpMethod": "POST", + "summary": "Create a new bridge.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "create", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Type of bridge to create.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "mixing", + "holding" + ] + } + }, + { + "name": "name", + "description": "Name to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}", + "description": "Individual bridge", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get bridge details.", + "nickname": "get", + "responseClass": "Bridge", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Shut down a bridge.", + "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", + "nickname": "destroy", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/addChannel", + "description": "Add a channel to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Add a channel to a bridge.", + "nickname": "addChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to add to bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "role", + "description": "Channel's role in the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application; Channel currently recording" + }, + { + "code": 422, + "reason": "Channel not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/removeChannel", + "description": "Remove a channel from a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Remove a channel from a bridge.", + "nickname": "removeChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to remove from bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in this bridge" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/moh", + "description": "Play music on hold to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a bridge or change the MOH class that is playing.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Channel's id", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a bridge.", + "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play", + "description": "Play media to the participants of a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/record", + "description": "Record audio on a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "This records the mixed audio from all channels participating in this bridge.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + } + ], + "models": { + "Bridge": { + "id": "Bridge", + "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for this bridge", + "required": true + }, + "technology": { + "type": "string", + "description": "Name of the current bridging technology", + "required": true + }, + "bridge_type": { + "type": "string", + "description": "Type of bridge technology", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "mixing", + "holding" + ] + } + }, + "bridge_class": { + "type": "string", + "description": "Bridging class", + "required": true + }, + "creator": { + "type": "string", + "description": "Entity that created the bridge", + "required": true + }, + "name": { + "type": "string", + "description": "Name the creator gave the bridge", + "required": true + }, + "channels": { + "type": "List[string]", + "description": "Ids of channels participating in this bridge", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_0_0/channels.json b/codegen3/resources/ari_1_0_0/channels.json new file mode 100644 index 00000000..6122f6d9 --- /dev/null +++ b/codegen3/resources/ari_1_0_0/channels.json @@ -0,0 +1,1144 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 404509 $", + "apiVersion": "1.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/channels.{format}", + "apis": [ + { + "path": "/channels", + "description": "Active channels", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active channels in Asterisk.", + "nickname": "list", + "responseClass": "List[Channel]" + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originate", + "responseClass": "Channel", + "parameters": [ + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel, and passed to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + } + ] + }, + { + "path": "/channels/{channelId}", + "description": "Active channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Channel details.", + "nickname": "get", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete (i.e. hangup) a channel.", + "nickname": "hangup", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "reason", + "description": "Reason for hanging up the channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defalutValue": "normal", + "allowableValues": { + "valueType": "LIST", + "values": [ + "normal", + "busy", + "congestion" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid reason for hangup provided" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/continue", + "description": "Exit application; continue execution in the dialplan", + "operations": [ + { + "httpMethod": "POST", + "summary": "Exit application; continue execution in the dialplan.", + "nickname": "continueInDialplan", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/answer", + "description": "Answer a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Answer a channel.", + "nickname": "answer", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/ring", + "description": "Send a ringing indication to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Indicate ringing to a channel.", + "nickname": "ring", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop ringing indication on a channel if locally generated.", + "nickname": "ringStop", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/dtmf", + "description": "Send DTMF to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Send provided DTMF to a given channel.", + "nickname": "sendDTMF", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "dtmf", + "description": "DTMF To send.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "before", + "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + }, + { + "name": "between", + "description": "Amount of time in between DTMF digits (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "duration", + "description": "Length of each DTMF digit (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "after", + "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "DTMF is required" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/mute", + "description": "Mute a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a channel.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to mute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a channel.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to unmute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/hold", + "description": "Put a channel on hold", + "operations": [ + { + "httpMethod": "POST", + "summary": "Hold a channel.", + "nickname": "hold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Remove a channel from hold.", + "nickname": "unhold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/moh", + "description": "Play music on hold to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a channel.", + "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Music on hold class to use", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a channel.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/silence", + "description": "Play silence to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play silence to a channel.", + "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", + "nickname": "startSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing silence to a channel.", + "nickname": "stopSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media.", + "notes": "The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/record", + "description": "Record audio from a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/variable", + "description": "Variables on a channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a channel variable or function.", + "nickname": "getChannelVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a channel variable or function.", + "nickname": "setChannelVar", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannel", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + } + ], + "models": { + "Dialed": { + "id": "Dialed", + "description": "Dialed channel information.", + "properties": {} + }, + "DialplanCEP": { + "id": "DialplanCEP", + "description": "Dialplan location (context/extension/priority)", + "properties": { + "context": { + "required": true, + "type": "string", + "description": "Context in the dialplan" + }, + "exten": { + "required": true, + "type": "string", + "description": "Extension in the dialplan" + }, + "priority": { + "required": true, + "type": "long", + "description": "Priority in the dialplan" + } + } + }, + "CallerID": { + "id": "CallerID", + "description": "Caller identification", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "number": { + "required": true, + "type": "string" + } + } + }, + "Channel": { + "id": "Channel", + "description": "A specific communication connection between Asterisk and an Endpoint.", + "properties": { + "id": { + "required": true, + "type": "string", + "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI." + }, + "name": { + "required": true, + "type": "string", + "description": "Name of the channel (i.e. SIP/foo-0000a7e3)" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "Down", + "Rsrved", + "OffHook", + "Dialing", + "Ring", + "Ringing", + "Up", + "Busy", + "Dialing Offhook", + "Pre-ring", + "Unknown" + ] + } + }, + "caller": { + "required": true, + "type": "CallerID" + }, + "connected": { + "required": true, + "type": "CallerID" + }, + "accountcode": { + "required": true, + "type": "string" + }, + "dialplan": { + "required": true, + "type": "DialplanCEP", + "description": "Current location in the dialplan" + }, + "creationtime": { + "required": true, + "type": "Date", + "description": "Timestamp when channel was created" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_0_0/deviceStates.json b/codegen3/resources/ari_1_0_0/deviceStates.json new file mode 100644 index 00000000..9eedf7aa --- /dev/null +++ b/codegen3/resources/ari_1_0_0/deviceStates.json @@ -0,0 +1,151 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "Kevin Harwell ", + "_svn_revision": "$Revision: 404184 $", + "apiVersion": "1.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/deviceStates.{format}", + "apis": [ + { + "path": "/deviceStates", + "description": "Device states", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all ARI controlled device states.", + "nickname": "list", + "responseClass": "List[DeviceState]" + } + ] + }, + { + "path": "/deviceStates/{deviceName}", + "description": "Device state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a device.", + "nickname": "get", + "responseClass": "DeviceState", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "deviceState", + "description": "Device state value", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a device-state controlled by ARI.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + } + ] + } + ], + "models": { + "DeviceState": { + "id": "DeviceState", + "description": "Represents the state of a device.", + "properties": { + "name": { + "type": "string", + "description": "Name of the device.", + "required": true + }, + "state": { + "type": "string", + "description": "Device's state", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "UNKNOWN", + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_0_0/endpoints.json b/codegen3/resources/ari_1_0_0/endpoints.json new file mode 100644 index 00000000..d744d40b --- /dev/null +++ b/codegen3/resources/ari_1_0_0/endpoints.json @@ -0,0 +1,117 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 404184 $", + "apiVersion": "1.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/endpoints.{format}", + "apis": [ + { + "path": "/endpoints", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all endpoints.", + "nickname": "list", + "responseClass": "List[Endpoint]" + } + ] + }, + { + "path": "/endpoints/{tech}", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List available endoints for a given endpoint technology.", + "nickname": "listByTech", + "responseClass": "List[Endpoint]", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoints (sip,iax2,...)", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}", + "description": "Single endpoint", + "operations": [ + { + "httpMethod": "GET", + "summary": "Details for an endpoint.", + "nickname": "get", + "responseClass": "Endpoint", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + } + ], + "models": { + "Endpoint": { + "id": "Endpoint", + "description": "An external device that may offer/accept calls to/from Asterisk.\n\nUnlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.", + "properties": { + "technology": { + "type": "string", + "description": "Technology of the endpoint", + "required": true + }, + "resource": { + "type": "string", + "description": "Identifier of the endpoint, specific to the given technology.", + "required": true + }, + "state": { + "type": "string", + "description": "Endpoint's state", + "required": false, + "allowableValues": { + "valueType": "LIST", + "values": [ + "unknown", + "offline", + "online" + ] + } + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's of channels associated with this endpoint", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_0_0/events.json b/codegen3/resources/ari_1_0_0/events.json new file mode 100644 index 00000000..8584ec22 --- /dev/null +++ b/codegen3/resources/ari_1_0_0/events.json @@ -0,0 +1,477 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 404184 $", + "apiVersion": "1.0.0", + "swaggerVersion": "1.2", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/events.{format}", + "apis": [ + { + "path": "/events", + "description": "Events from Asterisk to applications", + "operations": [ + { + "httpMethod": "GET", + "upgrade": "websocket", + "websocketProtocol": "ari", + "summary": "WebSocket connection for events.", + "nickname": "eventWebsocket", + "responseClass": "Message", + "parameters": [ + { + "name": "app", + "description": "Applications to subscribe to.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ] + } + ] + } + ], + "models": { + "Message": { + "id": "Message", + "description": "Base type for errors and events", + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "required": true, + "description": "Indicates the type of this message." + } + }, + "subTypes": [ + "MissingParams", + "Event" + ] + }, + "MissingParams": { + "id": "MissingParams", + "description": "Error event sent when required params are missing.", + "properties": { + "params": { + "required": true, + "type": "List[string]", + "description": "A list of the missing parameters" + } + } + }, + "Event": { + "id": "Event", + "description": "Base type for asynchronous events from Asterisk.", + "properties": { + "application": { + "type": "string", + "description": "Name of the application receiving the event.", + "required": true + }, + "timestamp": { + "type": "Date", + "description": "Time at which this event was created.", + "required": false + } + }, + "subTypes": [ + "DeviceStateChanged", + "PlaybackStarted", + "PlaybackFinished", + "RecordingStarted", + "RecordingFinished", + "RecordingFailed", + "ApplicationReplaced", + "BridgeCreated", + "BridgeDestroyed", + "BridgeMerged", + "ChannelCreated", + "ChannelDestroyed", + "ChannelEnteredBridge", + "ChannelLeftBridge", + "ChannelStateChange", + "ChannelDtmfReceived", + "ChannelDialplan", + "ChannelCallerId", + "ChannelUserevent", + "ChannelHangupRequest", + "ChannelVarset", + "EndpointStateChange", + "Dial", + "StasisEnd", + "StasisStart" + ] + }, + "DeviceStateChanged": { + "id": "DeviceStateChanged", + "description": "Notification that a device state has changed.", + "properties": { + "device_state": { + "type": "DeviceState", + "description": "Device state object", + "required": true + } + } + }, + "PlaybackStarted": { + "id": "PlaybackStarted", + "description": "Event showing the start of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "PlaybackFinished": { + "id": "PlaybackFinished", + "description": "Event showing the completion of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "RecordingStarted": { + "id": "RecordingStarted", + "extends": "Event", + "description": "Event showing the start of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFinished": { + "id": "RecordingFinished", + "extends": "Event", + "description": "Event showing the completion of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFailed": { + "id": "RecordingFailed", + "extends": "Event", + "description": "Event showing failure of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "ApplicationReplaced": { + "id": "ApplicationReplaced", + "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": {} + }, + "BridgeCreated": { + "id": "BridgeCreated", + "description": "Notification that a bridge has been created.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeDestroyed": { + "id": "BridgeDestroyed", + "description": "Notification that a bridge has been destroyed.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeMerged": { + "id": "BridgeMerged", + "description": "Notification that one bridge has merged into another.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "bridge_from": { + "required": true, + "type": "Bridge" + } + } + }, + "ChannelCreated": { + "id": "ChannelCreated", + "description": "Notification that a channel has been created.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDestroyed": { + "id": "ChannelDestroyed", + "description": "Notification that a channel has been destroyed.", + "properties": { + "cause": { + "required": true, + "description": "Integer representation of the cause of the hangup", + "type": "int" + }, + "cause_txt": { + "required": true, + "description": "Text representation of the cause of the hangup", + "type": "string" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelEnteredBridge": { + "id": "ChannelEnteredBridge", + "description": "Notification that a channel has entered a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "type": "Channel" + } + } + }, + "ChannelLeftBridge": { + "id": "ChannelLeftBridge", + "description": "Notification that a channel has left a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelStateChange": { + "id": "ChannelStateChange", + "description": "Notification of a channel's state change.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDtmfReceived": { + "id": "ChannelDtmfReceived", + "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, + "type": "string", + "description": "DTMF digit received (0-9, A-E, # or *)" + }, + "duration_ms": { + "required": true, + "type": "int", + "description": "Number of milliseconds DTMF was received" + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which DTMF was received" + } + } + }, + "ChannelDialplan": { + "id": "ChannelDialplan", + "description": "Channel changed location in the dialplan.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed dialplan location." + }, + "dialplan_app": { + "required": true, + "type": "string", + "description": "The application about to be executed." + }, + "dialplan_app_data": { + "required": true, + "type": "string", + "description": "The data to be passed to the application." + } + } + }, + "ChannelCallerId": { + "id": "ChannelCallerId", + "description": "Channel changed Caller ID.", + "properties": { + "caller_presentation": { + "required": true, + "type": "int", + "description": "The integer representation of the Caller Presentation value." + }, + "caller_presentation_txt": { + "required": true, + "type": "string", + "description": "The text representation of the Caller Presentation value." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed Caller ID." + } + } + }, + "ChannelUserevent": { + "id": "ChannelUserevent", + "description": "User-generated event with additional user-defined fields in the object.", + "properties": { + "eventname": { + "required": true, + "type": "string", + "description": "The name of the user event." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that signaled the user event." + }, + "userevent": { + "required": true, + "type": "object", + "description": "Custom Userevent data" + } + } + }, + "ChannelHangupRequest": { + "id": "ChannelHangupRequest", + "description": "A hangup was requested on the channel.", + "properties": { + "cause": { + "type": "int", + "description": "Integer representation of the cause of the hangup." + }, + "soft": { + "type": "boolean", + "description": "Whether the hangup request was a soft hangup request." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the hangup was requested." + } + } + }, + "ChannelVarset": { + "id": "ChannelVarset", + "description": "Channel variable changed.", + "properties": { + "variable": { + "required": true, + "type": "string", + "description": "The variable that changed." + }, + "value": { + "required": true, + "type": "string", + "description": "The new value of the variable." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable." + } + } + }, + "EndpointStateChange": { + "id": "EndpointStateChange", + "description": "Endpoint state changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + } + } + }, + "Dial": { + "id": "Dial", + "description": "Dialing state has changed.", + "properties": { + "caller": { + "required": false, + "type": "Channel", + "description": "The calling channel." + }, + "peer": { + "required": true, + "type": "Channel", + "description": "The dialed channel." + }, + "forward": { + "required": false, + "type": "string", + "description": "Forwarding target requested by the original dialed channel." + }, + "forwarded": { + "required": false, + "type": "Channel", + "description": "Channel that the caller has been forwarded to." + }, + "dialstring": { + "required": false, + "type": "string", + "description": "The dial string for calling the peer channel." + }, + "dialstatus": { + "required": true, + "type": "string", + "description": "Current status of the dialing attempt to the peer." + } + } + }, + "StasisEnd": { + "id": "StasisEnd", + "description": "Notification that a channel has left a Stasis application.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "StasisStart": { + "id": "StasisStart", + "description": "Notification that a channel has entered a Stasis application.", + "properties": { + "args": { + "required": true, + "type": "List[string]", + "description": "Arguments to the application" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_0_0/playbacks.json b/codegen3/resources/ari_1_0_0/playbacks.json new file mode 100644 index 00000000..1f7ea587 --- /dev/null +++ b/codegen3/resources/ari_1_0_0/playbacks.json @@ -0,0 +1,155 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 404184 $", + "apiVersion": "1.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/playbacks.{format}", + "apis": [ + { + "path": "/playbacks/{playbackId}", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a playback's details.", + "nickname": "get", + "responseClass": "Playback", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a playback.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + } + ] + }, + { + "path": "/playbacks/{playbackId}/control", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Control a playback.", + "nickname": "control", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "operation", + "description": "Operation to perform on the playback.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "restart", + "pause", + "unpause", + "reverse", + "forward" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "The provided operation parameter was invalid" + }, + { + "code": 404, + "reason": "The playback cannot be found" + }, + { + "code": 409, + "reason": "The operation cannot be performed in the playback's current state" + } +] + } + ] + } + ], + "models": { + "Playback": { + "id": "Playback", + "description": "Object representing the playback of media to a channel", + "properties": { + "id": { + "type": "string", + "description": "ID for this playback operation", + "required": true + }, + "media_uri": { + "type": "string", + "description": "URI for the media to play back.", + "required": true + }, + "target_uri": { + "type": "string", + "description": "URI for the channel or bridge to play the media on", + "required": true + }, + "language": { + "type": "string", + "description": "For media types that support multiple languages, the language requested for playback." + }, + "state": { + "type": "string", + "description": "Current state of the playback operation.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "playing", + "complete" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_0_0/recordings.json b/codegen3/resources/ari_1_0_0/recordings.json new file mode 100644 index 00000000..5fd266e5 --- /dev/null +++ b/codegen3/resources/ari_1_0_0/recordings.json @@ -0,0 +1,326 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 404184 $", + "apiVersion": "1.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/recordings.{format}", + "apis": [ + { + "path": "/recordings/stored", + "description": "Recordings", + "operations": [ + { + "httpMethod": "GET", + "summary": "List recordings that are complete.", + "nickname": "listStored", + "responseClass": "List[StoredRecording]" + } + ] + }, + { + "path": "/recordings/stored/{recordingName}", + "description": "Individual recording", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a stored recording's details.", + "nickname": "getStored", + "responseClass": "StoredRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete a stored recording.", + "nickname": "deleteStored", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}", + "description": "A recording that is in progress", + "operations": [ + { + "httpMethod": "GET", + "summary": "List live recordings.", + "nickname": "getLive", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a live recording and discard it.", + "nickname": "cancel", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/stop", + "operations": [ + { + "httpMethod": "POST", + "summary": "Stop a live recording and store it.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/pause", + "operations": [ + { + "httpMethod": "POST", + "summary": "Pause a live recording.", + "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.", + "nickname": "pause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unpause a live recording.", + "nickname": "unpause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/mute", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a live recording.", + "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a live recording.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + } + ], + "models": { + "StoredRecording": { + "id": "StoredRecording", + "description": "A past recording that may be played back.", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "LiveRecording": { + "id": "LiveRecording", + "description": "A recording that is in progress", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Base name for the recording" + }, + "format": { + "required": true, + "type": "string", + "description": "Recording format (wav, gsm, etc.)" + }, + "state": { + "required": false, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "recording", + "paused", + "done", + "failed", + "canceled" + ] + } + }, + "cause": { + "required": false, + "type": "string", + "description": "Cause for recording failure if failed" + }, + "state": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_0_0/sounds.json b/codegen3/resources/ari_1_0_0/sounds.json new file mode 100644 index 00000000..0825909d --- /dev/null +++ b/codegen3/resources/ari_1_0_0/sounds.json @@ -0,0 +1,99 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 404184 $", + "apiVersion": "1.0.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/stasis", + "resourcePath": "/api-docs/sounds.{format}", + "apis": [ + { + "path": "/sounds", + "description": "Sounds", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all sounds.", + "nickname": "list", + "responseClass": "List[Sound]", + "parameters": [ + { + "name": "lang", + "description": "Lookup sound for a specific language.", + "paramType": "query", + "dataType": "string", + "required": false + }, + { + "name": "format", + "description": "Lookup sound in a specific format.", + "paramType": "query", + "dataType": "string", + "required": false, + "__note": "core show translation can show translation paths between formats, along with relative costs. so this could be just installed format, or we could follow that for transcoded formats." + } + ] + } + ] + }, + { + "path": "/sounds/{soundId}", + "description": "Individual sound", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a sound's details.", + "nickname": "get", + "responseClass": "Sound", + "parameters": [ + { + "name": "soundId", + "description": "Sound's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + } + ], + "models": { + "FormatLangPair": { + "id": "FormatLangPair", + "description": "Identifies the format and language of a sound file", + "properties": { + "language": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "Sound": { + "id": "Sound", + "description": "A media file that may be played back.", + "properties": { + "id": { + "required": true, + "description": "Sound's identifier.", + "type": "string" + }, + "text": { + "required": false, + "description": "Text description of the sound, usually the words spoken.", + "type": "string" + }, + "formats": { + "required": true, + "description": "The formats and languages in which this sound is available.", + "type": "List[FormatLangPair]" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_5_0/applications.json b/codegen3/resources/ari_1_5_0/applications.json new file mode 100644 index 00000000..62f863b8 --- /dev/null +++ b/codegen3/resources/ari_1_5_0/applications.json @@ -0,0 +1,172 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 423618 $", + "apiVersion": "1.5.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/applications.{format}", + "apis": [ + { + "path": "/applications", + "description": "Stasis applications", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all applications.", + "nickname": "list", + "responseClass": "List[Application]" + } + ] + }, + { + "path": "/applications/{applicationName}", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get details of an application.", + "nickname": "get", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + } + ] + } + ] + }, + { + "path": "/applications/{applicationName}/subscription", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "POST", + "summary": "Subscribe an application to a event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "subscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unsubscribe an application from an event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "unsubscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter; event source scheme not recognized." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 409, + "reason": "Application not subscribed to event source." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + } + ] + } + ], + "models": { + "Application": { + "id": "Application", + "description": "Details of a Stasis application", + "properties": { + "name": { + "type": "string", + "description": "Name of this application", + "required": true + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's for channels subscribed to.", + "required": true + }, + "bridge_ids": { + "type": "List[string]", + "description": "Id's for bridges subscribed to.", + "required": true + }, + "endpoint_ids": { + "type": "List[string]", + "description": "{tech}/{resource} for endpoints subscribed to.", + "required": true + }, + "device_names": { + "type": "List[string]", + "description": "Names of the devices subscribed to.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_5_0/asterisk.json b/codegen3/resources/ari_1_5_0/asterisk.json new file mode 100644 index 00000000..18ba2c6f --- /dev/null +++ b/codegen3/resources/ari_1_5_0/asterisk.json @@ -0,0 +1,259 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 423618 $", + "apiVersion": "1.5.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/asterisk.{format}", + "apis": [ + { + "path": "/asterisk/info", + "description": "Asterisk system information (similar to core show settings)", + "operations": [ + { + "httpMethod": "GET", + "summary": "Gets Asterisk system information.", + "nickname": "getInfo", + "responseClass": "AsteriskInfo", + "parameters": [ + { + "name": "only", + "description": "Filter information returned", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "build", + "system", + "config", + "status" + ] + } + } + ] + } + ] + }, + { + "path": "/asterisk/variable", + "description": "Global variables", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a global variable.", + "nickname": "getGlobalVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "variable", + "description": "The variable to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a global variable.", + "nickname": "setGlobalVar", + "responseClass": "void", + "parameters": [ + { + "name": "variable", + "description": "The variable to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + } + ] + } + ], + "models": { + "BuildInfo": { + "id": "BuildInfo", + "description": "Info about how Asterisk was built", + "properties": { + "os": { + "required": true, + "type": "string", + "description": "OS Asterisk was built on." + }, + "kernel": { + "required": true, + "type": "string", + "description": "Kernel version Asterisk was built on." + }, + "options": { + "required": true, + "type": "string", + "description": "Compile time options, or empty string if default." + }, + "machine": { + "required": true, + "type": "string", + "description": "Machine architecture (x86_64, i686, ppc, etc.)" + }, + "date": { + "required": true, + "type": "string", + "description": "Date and time when Asterisk was built." + }, + "user": { + "required": true, + "type": "string", + "description": "Username that build Asterisk" + } + } + }, + "SystemInfo": { + "id": "SystemInfo", + "description": "Info about Asterisk", + "properties": { + "version": { + "required": true, + "type": "string", + "description": "Asterisk version." + }, + "entity_id": { + "required": true, + "type": "string", + "description": "" + } + } + }, + "SetId": { + "id": "SetId", + "description": "Effective user/group id", + "properties": { + "user": { + "required": true, + "type": "string", + "description": "Effective user id." + }, + "group": { + "required": true, + "type": "string", + "description": "Effective group id." + } + } + }, + "ConfigInfo": { + "id": "ConfigInfo", + "description": "Info about Asterisk configuration", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Asterisk system name." + }, + "default_language": { + "required": true, + "type": "string", + "description": "Default language for media playback." + }, + "max_channels": { + "required": false, + "type": "int", + "description": "Maximum number of simultaneous channels." + }, + "max_open_files": { + "required": false, + "type": "int", + "description": "Maximum number of open file handles (files, sockets)." + }, + "max_load": { + "required": false, + "type": "double", + "description": "Maximum load avg on system." + }, + "setid": { + "required": true, + "type": "SetId", + "description": "Effective user/group id for running Asterisk." + } + } + }, + "StatusInfo": { + "id": "StatusInfo", + "description": "Info about Asterisk status", + "properties": { + "startup_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was started." + }, + "last_reload_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was last reloaded." + } + } + }, + "AsteriskInfo": { + "id": "AsteriskInfo", + "description": "Asterisk system information", + "properties": { + "build": { + "required": false, + "type": "BuildInfo", + "description": "Info about how Asterisk was built" + }, + "system": { + "required": false, + "type": "SystemInfo", + "description": "Info about the system running Asterisk" + }, + "config": { + "required": false, + "type": "ConfigInfo", + "description": "Info about Asterisk configuration" + }, + "status": { + "required": false, + "type": "StatusInfo", + "description": "Info about Asterisk status" + } + } + }, + "Variable": { + "id": "Variable", + "description": "The value of a channel variable", + "properties": { + "value": { + "required": true, + "type": "string", + "description": "The value of the variable requested" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_5_0/bridges.json b/codegen3/resources/ari_1_5_0/bridges.json new file mode 100644 index 00000000..57dad40a --- /dev/null +++ b/codegen3/resources/ari_1_5_0/bridges.json @@ -0,0 +1,656 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 423618 $", + "apiVersion": "1.5.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/bridges.{format}", + "apis": [ + { + "path": "/bridges", + "description": "Active bridges", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active bridges in Asterisk.", + "nickname": "list", + "responseClass": "List[Bridge]" + }, + { + "httpMethod": "POST", + "summary": "Create a new bridge.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "create", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Name to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}", + "description": "Individual bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Create a new bridge or updates an existing one.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "create_or_update_with_id", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Set the name of the bridge.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "GET", + "summary": "Get bridge details.", + "nickname": "get", + "responseClass": "Bridge", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Shut down a bridge.", + "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", + "nickname": "destroy", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/addChannel", + "description": "Add a channel to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Add a channel to a bridge.", + "nickname": "addChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to add to bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "role", + "description": "Channel's role in the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application; Channel currently recording" + }, + { + "code": 422, + "reason": "Channel not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/removeChannel", + "description": "Remove a channel from a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Remove a channel from a bridge.", + "nickname": "removeChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to remove from bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in this bridge" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/moh", + "description": "Play music on hold to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a bridge or change the MOH class that is playing.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Channel's id", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a bridge.", + "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play", + "description": "Play media to the participants of a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "playbackId", + "description": "Playback Id.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play/{playbackId}", + "description": "Play media to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + + } + ] + }, + { + "path": "/bridges/{bridgeId}/record", + "description": "Record audio on a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "This records the mixed audio from all channels participating in this bridge.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + } + ], + "models": { + "Bridge": { + "id": "Bridge", + "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for this bridge", + "required": true + }, + "technology": { + "type": "string", + "description": "Name of the current bridging technology", + "required": true + }, + "bridge_type": { + "type": "string", + "description": "Type of bridge technology", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "mixing", + "holding" + ] + } + }, + "bridge_class": { + "type": "string", + "description": "Bridging class", + "required": true + }, + "creator": { + "type": "string", + "description": "Entity that created the bridge", + "required": true + }, + "name": { + "type": "string", + "description": "Name the creator gave the bridge", + "required": true + }, + "channels": { + "type": "List[string]", + "description": "Ids of channels participating in this bridge", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_5_0/channels.json b/codegen3/resources/ari_1_5_0/channels.json new file mode 100644 index 00000000..1cc28e79 --- /dev/null +++ b/codegen3/resources/ari_1_5_0/channels.json @@ -0,0 +1,1456 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 423618 $", + "apiVersion": "1.5.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/channels.{format}", + "apis": [ + { + "path": "/channels", + "description": "Active channels", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active channels in Asterisk.", + "nickname": "list", + "responseClass": "List[Channel]" + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originate", + "responseClass": "Channel", + "parameters": [ + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel, and passed to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + } + ] + }, + { + "path": "/channels/{channelId}", + "description": "Active channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Channel details.", + "nickname": "get", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate with id).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originateWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel, and passed to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + + }, + { + "httpMethod": "DELETE", + "summary": "Delete (i.e. hangup) a channel.", + "nickname": "hangup", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "reason", + "description": "Reason for hanging up the channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defalutValue": "normal", + "allowableValues": { + "valueType": "LIST", + "values": [ + "normal", + "busy", + "congestion" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid reason for hangup provided" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/continue", + "description": "Exit application; continue execution in the dialplan", + "operations": [ + { + "httpMethod": "POST", + "summary": "Exit application; continue execution in the dialplan.", + "nickname": "continueInDialplan", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/answer", + "description": "Answer a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Answer a channel.", + "nickname": "answer", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/ring", + "description": "Send a ringing indication to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Indicate ringing to a channel.", + "nickname": "ring", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop ringing indication on a channel if locally generated.", + "nickname": "ringStop", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/dtmf", + "description": "Send DTMF to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Send provided DTMF to a given channel.", + "nickname": "sendDTMF", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "dtmf", + "description": "DTMF To send.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "before", + "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + }, + { + "name": "between", + "description": "Amount of time in between DTMF digits (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "duration", + "description": "Length of each DTMF digit (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "after", + "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "DTMF is required" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/mute", + "description": "Mute a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a channel.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to mute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a channel.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to unmute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/hold", + "description": "Put a channel on hold", + "operations": [ + { + "httpMethod": "POST", + "summary": "Hold a channel.", + "nickname": "hold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Remove a channel from hold.", + "nickname": "unhold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/moh", + "description": "Play music on hold to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a channel.", + "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Music on hold class to use", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a channel.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/silence", + "description": "Play silence to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play silence to a channel.", + "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", + "nickname": "startSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing silence to a channel.", + "nickname": "stopSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play/{playbackId}", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media and specify the playbackId.", + "notes": "The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/record", + "description": "Record audio from a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/variable", + "description": "Variables on a channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a channel variable or function.", + "nickname": "getChannelVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a channel variable or function.", + "nickname": "setChannelVar", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannel", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop/{snoopId}", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannelWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + } + ], + "models": { + "Dialed": { + "id": "Dialed", + "description": "Dialed channel information.", + "properties": {} + }, + "DialplanCEP": { + "id": "DialplanCEP", + "description": "Dialplan location (context/extension/priority)", + "properties": { + "context": { + "required": true, + "type": "string", + "description": "Context in the dialplan" + }, + "exten": { + "required": true, + "type": "string", + "description": "Extension in the dialplan" + }, + "priority": { + "required": true, + "type": "long", + "description": "Priority in the dialplan" + } + } + }, + "CallerID": { + "id": "CallerID", + "description": "Caller identification", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "number": { + "required": true, + "type": "string" + } + } + }, + "Channel": { + "id": "Channel", + "description": "A specific communication connection between Asterisk and an Endpoint.", + "properties": { + "id": { + "required": true, + "type": "string", + "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI." + }, + "name": { + "required": true, + "type": "string", + "description": "Name of the channel (i.e. SIP/foo-0000a7e3)" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "Down", + "Rsrved", + "OffHook", + "Dialing", + "Ring", + "Ringing", + "Up", + "Busy", + "Dialing Offhook", + "Pre-ring", + "Unknown" + ] + } + }, + "caller": { + "required": true, + "type": "CallerID" + }, + "connected": { + "required": true, + "type": "CallerID" + }, + "accountcode": { + "required": true, + "type": "string" + }, + "dialplan": { + "required": true, + "type": "DialplanCEP", + "description": "Current location in the dialplan" + }, + "creationtime": { + "required": true, + "type": "Date", + "description": "Timestamp when channel was created" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_5_0/deviceStates.json b/codegen3/resources/ari_1_5_0/deviceStates.json new file mode 100644 index 00000000..6fec33f4 --- /dev/null +++ b/codegen3/resources/ari_1_5_0/deviceStates.json @@ -0,0 +1,151 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "Kevin Harwell ", + "_svn_revision": "$Revision: 423618 $", + "apiVersion": "1.5.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/deviceStates.{format}", + "apis": [ + { + "path": "/deviceStates", + "description": "Device states", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all ARI controlled device states.", + "nickname": "list", + "responseClass": "List[DeviceState]" + } + ] + }, + { + "path": "/deviceStates/{deviceName}", + "description": "Device state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a device.", + "nickname": "get", + "responseClass": "DeviceState", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "deviceState", + "description": "Device state value", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a device-state controlled by ARI.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + } + ] + } + ], + "models": { + "DeviceState": { + "id": "DeviceState", + "description": "Represents the state of a device.", + "properties": { + "name": { + "type": "string", + "description": "Name of the device.", + "required": true + }, + "state": { + "type": "string", + "description": "Device's state", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "UNKNOWN", + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_5_0/endpoints.json b/codegen3/resources/ari_1_5_0/endpoints.json new file mode 100644 index 00000000..8c59db0b --- /dev/null +++ b/codegen3/resources/ari_1_5_0/endpoints.json @@ -0,0 +1,275 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 423618 $", + "apiVersion": "1.5.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/endpoints.{format}", + "apis": [ + { + "path": "/endpoints", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all endpoints.", + "nickname": "list", + "responseClass": "List[Endpoint]" + } + ] + }, + { + "path": "/endpoints/sendMessage", + "description": "Send a message to some technology URI or endpoint.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some technology URI or endpoint.", + "nickname": "sendMessage", + "responseClass": "void", + "parameters": [ + { + "name": "to", + "description": "The endpoint resource or technology specific URI to send the message to. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List available endoints for a given endpoint technology.", + "nickname": "listByTech", + "responseClass": "List[Endpoint]", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoints (sip,iax2,...)", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}", + "description": "Single endpoint", + "operations": [ + { + "httpMethod": "GET", + "summary": "Details for an endpoint.", + "nickname": "get", + "responseClass": "Endpoint", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}/sendMessage", + "description": "Send a message to some endpoint in a technology.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some endpoint in a technology.", + "nickname": "sendMessageToEndpoint", + "responseClass": "void", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + } + ], + "models": { + "Endpoint": { + "id": "Endpoint", + "description": "An external device that may offer/accept calls to/from Asterisk.\n\nUnlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.", + "properties": { + "technology": { + "type": "string", + "description": "Technology of the endpoint", + "required": true + }, + "resource": { + "type": "string", + "description": "Identifier of the endpoint, specific to the given technology.", + "required": true + }, + "state": { + "type": "string", + "description": "Endpoint's state", + "required": false, + "allowableValues": { + "valueType": "LIST", + "values": [ + "unknown", + "offline", + "online" + ] + } + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's of channels associated with this endpoint", + "required": true + } + } + }, + "TextMessageVariable": { + "id": "TextMessageVariable", + "description": "A key/value pair variable in a text message.", + "properties": { + "key": { + "type": "string", + "description": "A unique key identifying the variable.", + "required": true + }, + "value": { + "type": "string", + "description": "The value of the variable.", + "required": true + } + } + }, + "TextMessage": { + "id": "TextMessage", + "description": "A text message.", + "properties": { + "from": { + "type": "string", + "description": "A technology specific URI specifying the source of the message. For sip and pjsip technologies, any SIP URI can be specified. For xmpp, the URI must correspond to the client connection being used to send the message.", + "required": true + }, + "to": { + "type": "string", + "description": "A technology specific URI specifying the destination of the message. Valid technologies include sip, pjsip, and xmp. The destination of a message should be an endpoint.", + "required": true + }, + "body": { + "type": "string", + "description": "The text of the message.", + "required": true + }, + "variables": { + "type": "List[TextMessageVariable]", + "description": "Technology specific key/value pairs associated with the message.", + "required": false + } + } + } + } +} diff --git a/codegen3/resources/ari_1_5_0/events.json b/codegen3/resources/ari_1_5_0/events.json new file mode 100644 index 00000000..9dd73874 --- /dev/null +++ b/codegen3/resources/ari_1_5_0/events.json @@ -0,0 +1,717 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 423621 $", + "apiVersion": "1.5.0", + "swaggerVersion": "1.2", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/events.{format}", + "apis": [ + { + "path": "/events", + "description": "Events from Asterisk to applications", + "operations": [ + { + "httpMethod": "GET", + "upgrade": "websocket", + "websocketProtocol": "ari", + "summary": "WebSocket connection for events.", + "nickname": "eventWebsocket", + "responseClass": "Message", + "parameters": [ + { + "name": "app", + "description": "Applications to subscribe to.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ] + } + ] + }, + { + "path": "/events/user/{eventName}", + "description": "Stasis application user events", + "operations": [ + { + "httpMethod": "POST", + "summary": "Generate a user event.", + "nickname": "userEvent", + "responseClass": "void", + "parameters": [ + { + "name": "eventName", + "description": "Event name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "application", + "description": "The name of the application that will receive this event", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "source", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds custom key/value pairs to add to the user event. Ex. { \"variables\": { \"key\": \"value\" } }", + "paramType": "body", + "required": false, + "allowMultiple": false, + "dataType": "containers" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source not found." + }, + { + "code": 400, + "reason": "Invalid even tsource URI or userevent data." + } + ] + } + ] + } + ], + "models": { + "Message": { + "id": "Message", + "description": "Base type for errors and events", + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "required": true, + "description": "Indicates the type of this message." + } + }, + "subTypes": [ + "MissingParams", + "Event" + ] + }, + "MissingParams": { + "id": "MissingParams", + "description": "Error event sent when required params are missing.", + "properties": { + "params": { + "required": true, + "type": "List[string]", + "description": "A list of the missing parameters" + } + } + }, + "Event": { + "id": "Event", + "description": "Base type for asynchronous events from Asterisk.", + "properties": { + "application": { + "type": "string", + "description": "Name of the application receiving the event.", + "required": true + }, + "timestamp": { + "type": "Date", + "description": "Time at which this event was created.", + "required": false + } + }, + "subTypes": [ + "DeviceStateChanged", + "PlaybackStarted", + "PlaybackFinished", + "RecordingStarted", + "RecordingFinished", + "RecordingFailed", + "ApplicationReplaced", + "BridgeCreated", + "BridgeDestroyed", + "BridgeMerged", + "BridgeBlindTransfer", + "BridgeAttendedTransfer", + "ChannelCreated", + "ChannelDestroyed", + "ChannelEnteredBridge", + "ChannelLeftBridge", + "ChannelStateChange", + "ChannelDtmfReceived", + "ChannelDialplan", + "ChannelCallerId", + "ChannelUserevent", + "ChannelHangupRequest", + "ChannelVarset", + "ChannelTalkingStarted", + "ChannelTalkingFinished", + "EndpointStateChange", + "Dial", + "StasisEnd", + "StasisStart", + "TextMessageReceived" + ] + }, + "DeviceStateChanged": { + "id": "DeviceStateChanged", + "description": "Notification that a device state has changed.", + "properties": { + "device_state": { + "type": "DeviceState", + "description": "Device state object", + "required": true + } + } + }, + "PlaybackStarted": { + "id": "PlaybackStarted", + "description": "Event showing the start of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "PlaybackFinished": { + "id": "PlaybackFinished", + "description": "Event showing the completion of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "RecordingStarted": { + "id": "RecordingStarted", + "description": "Event showing the start of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFinished": { + "id": "RecordingFinished", + "description": "Event showing the completion of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFailed": { + "id": "RecordingFailed", + "description": "Event showing failure of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "ApplicationReplaced": { + "id": "ApplicationReplaced", + "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": {} + }, + "BridgeCreated": { + "id": "BridgeCreated", + "description": "Notification that a bridge has been created.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeDestroyed": { + "id": "BridgeDestroyed", + "description": "Notification that a bridge has been destroyed.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeMerged": { + "id": "BridgeMerged", + "description": "Notification that one bridge has merged into another.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "bridge_from": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeBlindTransfer": { + "id": "BridgeBlindTransfer", + "description": "Notification that a blind transfer has occurred.", + "properties": { + "channel": { + "description": "The channel performing the blind transfer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer when the transferee(s) can not be transferred directly", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "exten": { + "description": "The extension transferred to", + "required": true, + "type": "string" + }, + "context": { + "description": "The context transferred to", + "required": true, + "type": "string" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "bridge": { + "description": "The bridge being transferred", + "type": "Bridge" + } + } + }, + "BridgeAttendedTransfer": { + "id": "BridgeAttendedTransfer", + "description": "Notification that an attended transfer has occurred.", + "properties": { + "transferer_first_leg": { + "description": "First leg of the transferer", + "required": true, + "type": "Channel" + }, + "transferer_second_leg": { + "description": "Second leg of the transferer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer_first_leg in the swap", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "transfer_target": { + "description": "The channel that is being transferred to", + "required": false, + "type": "Channel" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "transferer_first_leg_bridge": { + "description": "Bridge the transferer first leg is in", + "type": "Bridge" + }, + "transferer_second_leg_bridge": { + "description": "Bridge the transferer second leg is in", + "type": "Bridge" + }, + "destination_type": { + "description": "How the transfer was accomplished", + "required": true, + "type": "string" + }, + "destination_bridge": { + "description": "Bridge that survived the merge result", + "type": "string" + }, + "destination_application": { + "description": "Application that has been transferred into", + "type": "string" + }, + "destination_link_first_leg": { + "description": "First leg of a link transfer result", + "type": "Channel" + }, + "destination_link_second_leg": { + "description": "Second leg of a link transfer result", + "type": "Channel" + }, + "destination_threeway_channel": { + "description": "Transferer channel that survived the threeway result", + "type": "Channel" + }, + "destination_threeway_bridge": { + "description": "Bridge that survived the threeway result", + "type": "Bridge" + } + } + }, + "ChannelCreated": { + "id": "ChannelCreated", + "description": "Notification that a channel has been created.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDestroyed": { + "id": "ChannelDestroyed", + "description": "Notification that a channel has been destroyed.", + "properties": { + "cause": { + "required": true, + "description": "Integer representation of the cause of the hangup", + "type": "int" + }, + "cause_txt": { + "required": true, + "description": "Text representation of the cause of the hangup", + "type": "string" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelEnteredBridge": { + "id": "ChannelEnteredBridge", + "description": "Notification that a channel has entered a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "type": "Channel" + } + } + }, + "ChannelLeftBridge": { + "id": "ChannelLeftBridge", + "description": "Notification that a channel has left a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelStateChange": { + "id": "ChannelStateChange", + "description": "Notification of a channel's state change.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDtmfReceived": { + "id": "ChannelDtmfReceived", + "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, + "type": "string", + "description": "DTMF digit received (0-9, A-E, # or *)" + }, + "duration_ms": { + "required": true, + "type": "int", + "description": "Number of milliseconds DTMF was received" + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which DTMF was received" + } + } + }, + "ChannelDialplan": { + "id": "ChannelDialplan", + "description": "Channel changed location in the dialplan.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed dialplan location." + }, + "dialplan_app": { + "required": true, + "type": "string", + "description": "The application about to be executed." + }, + "dialplan_app_data": { + "required": true, + "type": "string", + "description": "The data to be passed to the application." + } + } + }, + "ChannelCallerId": { + "id": "ChannelCallerId", + "description": "Channel changed Caller ID.", + "properties": { + "caller_presentation": { + "required": true, + "type": "int", + "description": "The integer representation of the Caller Presentation value." + }, + "caller_presentation_txt": { + "required": true, + "type": "string", + "description": "The text representation of the Caller Presentation value." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed Caller ID." + } + } + }, + "ChannelUserevent": { + "id": "ChannelUserevent", + "description": "User-generated event with additional user-defined fields in the object.", + "properties": { + "eventname": { + "required": true, + "type": "string", + "description": "The name of the user event." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "A channel that is signaled with the user event." + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "A bridge that is signaled with the user event." + }, + "endpoint": { + "required": false, + "type": "Endpoint", + "description": "A endpoint that is signaled with the user event." + }, + "userevent": { + "required": true, + "type": "object", + "description": "Custom Userevent data" + } + } + }, + "ChannelHangupRequest": { + "id": "ChannelHangupRequest", + "description": "A hangup was requested on the channel.", + "properties": { + "cause": { + "type": "int", + "description": "Integer representation of the cause of the hangup." + }, + "soft": { + "type": "boolean", + "description": "Whether the hangup request was a soft hangup request." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the hangup was requested." + } + } + }, + "ChannelVarset": { + "id": "ChannelVarset", + "description": "Channel variable changed.", + "properties": { + "variable": { + "required": true, + "type": "string", + "description": "The variable that changed." + }, + "value": { + "required": true, + "type": "string", + "description": "The new value of the variable." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable." + } + } + }, + "ChannelTalkingStarted": { + "id": "ChannelTalkingStarted", + "description": "Talking was detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking started." + } + } + }, + "ChannelTalkingFinished": { + "id": "ChannelTalkingFinished", + "description": "Talking is no longer detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking completed." + }, + "duration": { + "required": true, + "type": "int", + "description": "The length of time, in milliseconds, that talking was detected on the channel" + } + } + }, + "EndpointStateChange": { + "id": "EndpointStateChange", + "description": "Endpoint state changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + } + } + }, + "Dial": { + "id": "Dial", + "description": "Dialing state has changed.", + "properties": { + "caller": { + "required": false, + "type": "Channel", + "description": "The calling channel." + }, + "peer": { + "required": true, + "type": "Channel", + "description": "The dialed channel." + }, + "forward": { + "required": false, + "type": "string", + "description": "Forwarding target requested by the original dialed channel." + }, + "forwarded": { + "required": false, + "type": "Channel", + "description": "Channel that the caller has been forwarded to." + }, + "dialstring": { + "required": false, + "type": "string", + "description": "The dial string for calling the peer channel." + }, + "dialstatus": { + "required": true, + "type": "string", + "description": "Current status of the dialing attempt to the peer." + } + } + }, + "StasisEnd": { + "id": "StasisEnd", + "description": "Notification that a channel has left a Stasis application.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "StasisStart": { + "id": "StasisStart", + "description": "Notification that a channel has entered a Stasis application.", + "properties": { + "args": { + "required": true, + "type": "List[string]", + "description": "Arguments to the application" + }, + "channel": { + "required": true, + "type": "Channel" + }, + "replace_channel": { + "required": false, + "type": "Channel" + } + } + }, + "TextMessageReceived": { + "id": "TextMessageReceived", + "description": "A text message was received from an endpoint.", + "properties": { + "message": { + "required": true, + "type": "TextMessage" + }, + "endpoint": { + "required": false, + "type": "Endpoint" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_5_0/mailboxes.json b/codegen3/resources/ari_1_5_0/mailboxes.json new file mode 100644 index 00000000..1254d53e --- /dev/null +++ b/codegen3/resources/ari_1_5_0/mailboxes.json @@ -0,0 +1,134 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "Jonathan Rose ", + "_svn_revision": "$Revision: 423618 $", + "apiVersion": "1.5.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/mailboxes.{format}", + "apis": [ + { + "path": "/mailboxes", + "description": "Mailboxes", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all mailboxes.", + "nickname": "list", + "responseClass": "List[Mailbox]" + } + ] + }, + { + "path": "/mailboxes/{mailboxName}", + "description": "Mailbox state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a mailbox.", + "nickname": "get", + "responseClass": "Mailbox", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a mailbox. (Note - implicitly creates the mailbox).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "oldMessages", + "description": "Count of old messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "newMessages", + "description": "Count of new messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a mailbox.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + } + ] + } + ], + "models": { + "Mailbox": { + "id": "Mailbox", + "description": "Represents the state of a mailbox.", + "properties": { + "name": { + "type": "string", + "description": "Name of the mailbox.", + "required": true + }, + "old_messages": { + "type": "int", + "description": "Count of old messages in the mailbox.", + "required": true + }, + "new_messages": { + "type": "int", + "description": "Count of new messages in the mailbox.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_5_0/playbacks.json b/codegen3/resources/ari_1_5_0/playbacks.json new file mode 100644 index 00000000..3c4290b5 --- /dev/null +++ b/codegen3/resources/ari_1_5_0/playbacks.json @@ -0,0 +1,155 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 423618 $", + "apiVersion": "1.5.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/playbacks.{format}", + "apis": [ + { + "path": "/playbacks/{playbackId}", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a playback's details.", + "nickname": "get", + "responseClass": "Playback", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a playback.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + } + ] + }, + { + "path": "/playbacks/{playbackId}/control", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Control a playback.", + "nickname": "control", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "operation", + "description": "Operation to perform on the playback.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "restart", + "pause", + "unpause", + "reverse", + "forward" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "The provided operation parameter was invalid" + }, + { + "code": 404, + "reason": "The playback cannot be found" + }, + { + "code": 409, + "reason": "The operation cannot be performed in the playback's current state" + } +] + } + ] + } + ], + "models": { + "Playback": { + "id": "Playback", + "description": "Object representing the playback of media to a channel", + "properties": { + "id": { + "type": "string", + "description": "ID for this playback operation", + "required": true + }, + "media_uri": { + "type": "string", + "description": "URI for the media to play back.", + "required": true + }, + "target_uri": { + "type": "string", + "description": "URI for the channel or bridge to play the media on", + "required": true + }, + "language": { + "type": "string", + "description": "For media types that support multiple languages, the language requested for playback." + }, + "state": { + "type": "string", + "description": "Current state of the playback operation.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "playing", + "complete" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_5_0/recordings.json b/codegen3/resources/ari_1_5_0/recordings.json new file mode 100644 index 00000000..26bb2800 --- /dev/null +++ b/codegen3/resources/ari_1_5_0/recordings.json @@ -0,0 +1,378 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 423618 $", + "apiVersion": "1.5.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/recordings.{format}", + "apis": [ + { + "path": "/recordings/stored", + "description": "Recordings", + "operations": [ + { + "httpMethod": "GET", + "summary": "List recordings that are complete.", + "nickname": "listStored", + "responseClass": "List[StoredRecording]" + } + ] + }, + { + "path": "/recordings/stored/{recordingName}", + "description": "Individual recording", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a stored recording's details.", + "nickname": "getStored", + "responseClass": "StoredRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete a stored recording.", + "nickname": "deleteStored", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "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" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}", + "description": "A recording that is in progress", + "operations": [ + { + "httpMethod": "GET", + "summary": "List live recordings.", + "nickname": "getLive", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a live recording and discard it.", + "nickname": "cancel", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/stop", + "operations": [ + { + "httpMethod": "POST", + "summary": "Stop a live recording and store it.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/pause", + "operations": [ + { + "httpMethod": "POST", + "summary": "Pause a live recording.", + "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.", + "nickname": "pause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unpause a live recording.", + "nickname": "unpause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/mute", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a live recording.", + "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a live recording.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + } + ], + "models": { + "StoredRecording": { + "id": "StoredRecording", + "description": "A past recording that may be played back.", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "LiveRecording": { + "id": "LiveRecording", + "description": "A recording that is in progress", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Base name for the recording" + }, + "format": { + "required": true, + "type": "string", + "description": "Recording format (wav, gsm, etc.)" + }, + "target_uri": { + "required": true, + "type": "string", + "description": "URI for the channel or bridge being recorded" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "recording", + "paused", + "done", + "failed", + "canceled" + ] + } + }, + "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." + }, + "cause": { + "required": false, + "type": "string", + "description": "Cause for recording failure if failed" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_5_0/sounds.json b/codegen3/resources/ari_1_5_0/sounds.json new file mode 100644 index 00000000..c46340c0 --- /dev/null +++ b/codegen3/resources/ari_1_5_0/sounds.json @@ -0,0 +1,99 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 423618 $", + "apiVersion": "1.5.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/sounds.{format}", + "apis": [ + { + "path": "/sounds", + "description": "Sounds", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all sounds.", + "nickname": "list", + "responseClass": "List[Sound]", + "parameters": [ + { + "name": "lang", + "description": "Lookup sound for a specific language.", + "paramType": "query", + "dataType": "string", + "required": false + }, + { + "name": "format", + "description": "Lookup sound in a specific format.", + "paramType": "query", + "dataType": "string", + "required": false, + "__note": "core show translation can show translation paths between formats, along with relative costs. so this could be just installed format, or we could follow that for transcoded formats." + } + ] + } + ] + }, + { + "path": "/sounds/{soundId}", + "description": "Individual sound", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a sound's details.", + "nickname": "get", + "responseClass": "Sound", + "parameters": [ + { + "name": "soundId", + "description": "Sound's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + } + ], + "models": { + "FormatLangPair": { + "id": "FormatLangPair", + "description": "Identifies the format and language of a sound file", + "properties": { + "language": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "Sound": { + "id": "Sound", + "description": "A media file that may be played back.", + "properties": { + "id": { + "required": true, + "description": "Sound's identifier.", + "type": "string" + }, + "text": { + "required": false, + "description": "Text description of the sound, usually the words spoken.", + "type": "string" + }, + "formats": { + "required": true, + "description": "The formats and languages in which this sound is available.", + "type": "List[FormatLangPair]" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_6_0/applications.json b/codegen3/resources/ari_1_6_0/applications.json new file mode 100644 index 00000000..db5a9ee0 --- /dev/null +++ b/codegen3/resources/ari_1_6_0/applications.json @@ -0,0 +1,172 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/applications.{format}", + "apis": [ + { + "path": "/applications", + "description": "Stasis applications", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all applications.", + "nickname": "list", + "responseClass": "List[Application]" + } + ] + }, + { + "path": "/applications/{applicationName}", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get details of an application.", + "nickname": "get", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + } + ] + } + ] + }, + { + "path": "/applications/{applicationName}/subscription", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "POST", + "summary": "Subscribe an application to a event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "subscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unsubscribe an application from an event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "unsubscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter; event source scheme not recognized." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 409, + "reason": "Application not subscribed to event source." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + } + ] + } + ], + "models": { + "Application": { + "id": "Application", + "description": "Details of a Stasis application", + "properties": { + "name": { + "type": "string", + "description": "Name of this application", + "required": true + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's for channels subscribed to.", + "required": true + }, + "bridge_ids": { + "type": "List[string]", + "description": "Id's for bridges subscribed to.", + "required": true + }, + "endpoint_ids": { + "type": "List[string]", + "description": "{tech}/{resource} for endpoints subscribed to.", + "required": true + }, + "device_names": { + "type": "List[string]", + "description": "Names of the devices subscribed to.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_6_0/asterisk.json b/codegen3/resources/ari_1_6_0/asterisk.json new file mode 100644 index 00000000..69cef054 --- /dev/null +++ b/codegen3/resources/ari_1_6_0/asterisk.json @@ -0,0 +1,259 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/asterisk.{format}", + "apis": [ + { + "path": "/asterisk/info", + "description": "Asterisk system information (similar to core show settings)", + "operations": [ + { + "httpMethod": "GET", + "summary": "Gets Asterisk system information.", + "nickname": "getInfo", + "responseClass": "AsteriskInfo", + "parameters": [ + { + "name": "only", + "description": "Filter information returned", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "build", + "system", + "config", + "status" + ] + } + } + ] + } + ] + }, + { + "path": "/asterisk/variable", + "description": "Global variables", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a global variable.", + "nickname": "getGlobalVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "variable", + "description": "The variable to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a global variable.", + "nickname": "setGlobalVar", + "responseClass": "void", + "parameters": [ + { + "name": "variable", + "description": "The variable to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + } + ] + } + ], + "models": { + "BuildInfo": { + "id": "BuildInfo", + "description": "Info about how Asterisk was built", + "properties": { + "os": { + "required": true, + "type": "string", + "description": "OS Asterisk was built on." + }, + "kernel": { + "required": true, + "type": "string", + "description": "Kernel version Asterisk was built on." + }, + "options": { + "required": true, + "type": "string", + "description": "Compile time options, or empty string if default." + }, + "machine": { + "required": true, + "type": "string", + "description": "Machine architecture (x86_64, i686, ppc, etc.)" + }, + "date": { + "required": true, + "type": "string", + "description": "Date and time when Asterisk was built." + }, + "user": { + "required": true, + "type": "string", + "description": "Username that build Asterisk" + } + } + }, + "SystemInfo": { + "id": "SystemInfo", + "description": "Info about Asterisk", + "properties": { + "version": { + "required": true, + "type": "string", + "description": "Asterisk version." + }, + "entity_id": { + "required": true, + "type": "string", + "description": "" + } + } + }, + "SetId": { + "id": "SetId", + "description": "Effective user/group id", + "properties": { + "user": { + "required": true, + "type": "string", + "description": "Effective user id." + }, + "group": { + "required": true, + "type": "string", + "description": "Effective group id." + } + } + }, + "ConfigInfo": { + "id": "ConfigInfo", + "description": "Info about Asterisk configuration", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Asterisk system name." + }, + "default_language": { + "required": true, + "type": "string", + "description": "Default language for media playback." + }, + "max_channels": { + "required": false, + "type": "int", + "description": "Maximum number of simultaneous channels." + }, + "max_open_files": { + "required": false, + "type": "int", + "description": "Maximum number of open file handles (files, sockets)." + }, + "max_load": { + "required": false, + "type": "double", + "description": "Maximum load avg on system." + }, + "setid": { + "required": true, + "type": "SetId", + "description": "Effective user/group id for running Asterisk." + } + } + }, + "StatusInfo": { + "id": "StatusInfo", + "description": "Info about Asterisk status", + "properties": { + "startup_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was started." + }, + "last_reload_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was last reloaded." + } + } + }, + "AsteriskInfo": { + "id": "AsteriskInfo", + "description": "Asterisk system information", + "properties": { + "build": { + "required": false, + "type": "BuildInfo", + "description": "Info about how Asterisk was built" + }, + "system": { + "required": false, + "type": "SystemInfo", + "description": "Info about the system running Asterisk" + }, + "config": { + "required": false, + "type": "ConfigInfo", + "description": "Info about Asterisk configuration" + }, + "status": { + "required": false, + "type": "StatusInfo", + "description": "Info about Asterisk status" + } + } + }, + "Variable": { + "id": "Variable", + "description": "The value of a channel variable", + "properties": { + "value": { + "required": true, + "type": "string", + "description": "The value of the variable requested" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_6_0/bridges.json b/codegen3/resources/ari_1_6_0/bridges.json new file mode 100644 index 00000000..9545416d --- /dev/null +++ b/codegen3/resources/ari_1_6_0/bridges.json @@ -0,0 +1,656 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/bridges.{format}", + "apis": [ + { + "path": "/bridges", + "description": "Active bridges", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active bridges in Asterisk.", + "nickname": "list", + "responseClass": "List[Bridge]" + }, + { + "httpMethod": "POST", + "summary": "Create a new bridge.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "create", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Name to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}", + "description": "Individual bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Create a new bridge or updates an existing one.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "create_or_update_with_id", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Set the name of the bridge.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "GET", + "summary": "Get bridge details.", + "nickname": "get", + "responseClass": "Bridge", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Shut down a bridge.", + "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", + "nickname": "destroy", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/addChannel", + "description": "Add a channel to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Add a channel to a bridge.", + "nickname": "addChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to add to bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "role", + "description": "Channel's role in the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application; Channel currently recording" + }, + { + "code": 422, + "reason": "Channel not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/removeChannel", + "description": "Remove a channel from a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Remove a channel from a bridge.", + "nickname": "removeChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to remove from bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in this bridge" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/moh", + "description": "Play music on hold to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a bridge or change the MOH class that is playing.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Channel's id", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a bridge.", + "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play", + "description": "Play media to the participants of a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "playbackId", + "description": "Playback Id.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play/{playbackId}", + "description": "Play media to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + + } + ] + }, + { + "path": "/bridges/{bridgeId}/record", + "description": "Record audio on a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "This records the mixed audio from all channels participating in this bridge.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + } + ], + "models": { + "Bridge": { + "id": "Bridge", + "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for this bridge", + "required": true + }, + "technology": { + "type": "string", + "description": "Name of the current bridging technology", + "required": true + }, + "bridge_type": { + "type": "string", + "description": "Type of bridge technology", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "mixing", + "holding" + ] + } + }, + "bridge_class": { + "type": "string", + "description": "Bridging class", + "required": true + }, + "creator": { + "type": "string", + "description": "Entity that created the bridge", + "required": true + }, + "name": { + "type": "string", + "description": "Name the creator gave the bridge", + "required": true + }, + "channels": { + "type": "List[string]", + "description": "Ids of channels participating in this bridge", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_6_0/channels.json b/codegen3/resources/ari_1_6_0/channels.json new file mode 100644 index 00000000..ac497e9e --- /dev/null +++ b/codegen3/resources/ari_1_6_0/channels.json @@ -0,0 +1,1456 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/channels.{format}", + "apis": [ + { + "path": "/channels", + "description": "Active channels", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active channels in Asterisk.", + "nickname": "list", + "responseClass": "List[Channel]" + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originate", + "responseClass": "Channel", + "parameters": [ + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel, and passed to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + } + ] + }, + { + "path": "/channels/{channelId}", + "description": "Active channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Channel details.", + "nickname": "get", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate with id).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originateWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel, and passed to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + + }, + { + "httpMethod": "DELETE", + "summary": "Delete (i.e. hangup) a channel.", + "nickname": "hangup", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "reason", + "description": "Reason for hanging up the channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defalutValue": "normal", + "allowableValues": { + "valueType": "LIST", + "values": [ + "normal", + "busy", + "congestion" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid reason for hangup provided" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/continue", + "description": "Exit application; continue execution in the dialplan", + "operations": [ + { + "httpMethod": "POST", + "summary": "Exit application; continue execution in the dialplan.", + "nickname": "continueInDialplan", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/answer", + "description": "Answer a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Answer a channel.", + "nickname": "answer", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/ring", + "description": "Send a ringing indication to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Indicate ringing to a channel.", + "nickname": "ring", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop ringing indication on a channel if locally generated.", + "nickname": "ringStop", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/dtmf", + "description": "Send DTMF to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Send provided DTMF to a given channel.", + "nickname": "sendDTMF", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "dtmf", + "description": "DTMF To send.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "before", + "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + }, + { + "name": "between", + "description": "Amount of time in between DTMF digits (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "duration", + "description": "Length of each DTMF digit (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "after", + "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "DTMF is required" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/mute", + "description": "Mute a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a channel.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to mute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a channel.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to unmute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/hold", + "description": "Put a channel on hold", + "operations": [ + { + "httpMethod": "POST", + "summary": "Hold a channel.", + "nickname": "hold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Remove a channel from hold.", + "nickname": "unhold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/moh", + "description": "Play music on hold to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a channel.", + "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Music on hold class to use", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a channel.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/silence", + "description": "Play silence to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play silence to a channel.", + "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", + "nickname": "startSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing silence to a channel.", + "nickname": "stopSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play/{playbackId}", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media and specify the playbackId.", + "notes": "The media URI may be any of a number of URI's. Currently sound: and recording: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/record", + "description": "Record audio from a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/variable", + "description": "Variables on a channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a channel variable or function.", + "nickname": "getChannelVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a channel variable or function.", + "nickname": "setChannelVar", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannel", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop/{snoopId}", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannelWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + } + ], + "models": { + "Dialed": { + "id": "Dialed", + "description": "Dialed channel information.", + "properties": {} + }, + "DialplanCEP": { + "id": "DialplanCEP", + "description": "Dialplan location (context/extension/priority)", + "properties": { + "context": { + "required": true, + "type": "string", + "description": "Context in the dialplan" + }, + "exten": { + "required": true, + "type": "string", + "description": "Extension in the dialplan" + }, + "priority": { + "required": true, + "type": "long", + "description": "Priority in the dialplan" + } + } + }, + "CallerID": { + "id": "CallerID", + "description": "Caller identification", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "number": { + "required": true, + "type": "string" + } + } + }, + "Channel": { + "id": "Channel", + "description": "A specific communication connection between Asterisk and an Endpoint.", + "properties": { + "id": { + "required": true, + "type": "string", + "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI." + }, + "name": { + "required": true, + "type": "string", + "description": "Name of the channel (i.e. SIP/foo-0000a7e3)" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "Down", + "Rsrved", + "OffHook", + "Dialing", + "Ring", + "Ringing", + "Up", + "Busy", + "Dialing Offhook", + "Pre-ring", + "Unknown" + ] + } + }, + "caller": { + "required": true, + "type": "CallerID" + }, + "connected": { + "required": true, + "type": "CallerID" + }, + "accountcode": { + "required": true, + "type": "string" + }, + "dialplan": { + "required": true, + "type": "DialplanCEP", + "description": "Current location in the dialplan" + }, + "creationtime": { + "required": true, + "type": "Date", + "description": "Timestamp when channel was created" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_6_0/deviceStates.json b/codegen3/resources/ari_1_6_0/deviceStates.json new file mode 100644 index 00000000..62ecb135 --- /dev/null +++ b/codegen3/resources/ari_1_6_0/deviceStates.json @@ -0,0 +1,151 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "Kevin Harwell ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/deviceStates.{format}", + "apis": [ + { + "path": "/deviceStates", + "description": "Device states", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all ARI controlled device states.", + "nickname": "list", + "responseClass": "List[DeviceState]" + } + ] + }, + { + "path": "/deviceStates/{deviceName}", + "description": "Device state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a device.", + "nickname": "get", + "responseClass": "DeviceState", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "deviceState", + "description": "Device state value", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a device-state controlled by ARI.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + } + ] + } + ], + "models": { + "DeviceState": { + "id": "DeviceState", + "description": "Represents the state of a device.", + "properties": { + "name": { + "type": "string", + "description": "Name of the device.", + "required": true + }, + "state": { + "type": "string", + "description": "Device's state", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "UNKNOWN", + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_6_0/endpoints.json b/codegen3/resources/ari_1_6_0/endpoints.json new file mode 100644 index 00000000..8440d8b0 --- /dev/null +++ b/codegen3/resources/ari_1_6_0/endpoints.json @@ -0,0 +1,275 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/endpoints.{format}", + "apis": [ + { + "path": "/endpoints", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all endpoints.", + "nickname": "list", + "responseClass": "List[Endpoint]" + } + ] + }, + { + "path": "/endpoints/sendMessage", + "description": "Send a message to some technology URI or endpoint.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some technology URI or endpoint.", + "nickname": "sendMessage", + "responseClass": "void", + "parameters": [ + { + "name": "to", + "description": "The endpoint resource or technology specific URI to send the message to. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List available endoints for a given endpoint technology.", + "nickname": "listByTech", + "responseClass": "List[Endpoint]", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoints (sip,iax2,...)", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}", + "description": "Single endpoint", + "operations": [ + { + "httpMethod": "GET", + "summary": "Details for an endpoint.", + "nickname": "get", + "responseClass": "Endpoint", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}/sendMessage", + "description": "Send a message to some endpoint in a technology.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some endpoint in a technology.", + "nickname": "sendMessageToEndpoint", + "responseClass": "void", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + } + ], + "models": { + "Endpoint": { + "id": "Endpoint", + "description": "An external device that may offer/accept calls to/from Asterisk.\n\nUnlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.", + "properties": { + "technology": { + "type": "string", + "description": "Technology of the endpoint", + "required": true + }, + "resource": { + "type": "string", + "description": "Identifier of the endpoint, specific to the given technology.", + "required": true + }, + "state": { + "type": "string", + "description": "Endpoint's state", + "required": false, + "allowableValues": { + "valueType": "LIST", + "values": [ + "unknown", + "offline", + "online" + ] + } + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's of channels associated with this endpoint", + "required": true + } + } + }, + "TextMessageVariable": { + "id": "TextMessageVariable", + "description": "A key/value pair variable in a text message.", + "properties": { + "key": { + "type": "string", + "description": "A unique key identifying the variable.", + "required": true + }, + "value": { + "type": "string", + "description": "The value of the variable.", + "required": true + } + } + }, + "TextMessage": { + "id": "TextMessage", + "description": "A text message.", + "properties": { + "from": { + "type": "string", + "description": "A technology specific URI specifying the source of the message. For sip and pjsip technologies, any SIP URI can be specified. For xmpp, the URI must correspond to the client connection being used to send the message.", + "required": true + }, + "to": { + "type": "string", + "description": "A technology specific URI specifying the destination of the message. Valid technologies include sip, pjsip, and xmp. The destination of a message should be an endpoint.", + "required": true + }, + "body": { + "type": "string", + "description": "The text of the message.", + "required": true + }, + "variables": { + "type": "List[TextMessageVariable]", + "description": "Technology specific key/value pairs associated with the message.", + "required": false + } + } + } + } +} diff --git a/codegen3/resources/ari_1_6_0/events.json b/codegen3/resources/ari_1_6_0/events.json new file mode 100644 index 00000000..9c24dbdc --- /dev/null +++ b/codegen3/resources/ari_1_6_0/events.json @@ -0,0 +1,729 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.2", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/events.{format}", + "apis": [ + { + "path": "/events", + "description": "Events from Asterisk to applications", + "operations": [ + { + "httpMethod": "GET", + "upgrade": "websocket", + "websocketProtocol": "ari", + "summary": "WebSocket connection for events.", + "nickname": "eventWebsocket", + "responseClass": "Message", + "parameters": [ + { + "name": "app", + "description": "Applications to subscribe to.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ] + } + ] + }, + { + "path": "/events/user/{eventName}", + "description": "Stasis application user events", + "operations": [ + { + "httpMethod": "POST", + "summary": "Generate a user event.", + "nickname": "userEvent", + "responseClass": "void", + "parameters": [ + { + "name": "eventName", + "description": "Event name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "application", + "description": "The name of the application that will receive this event", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "source", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds custom key/value pairs to add to the user event. Ex. { \"variables\": { \"key\": \"value\" } }", + "paramType": "body", + "required": false, + "allowMultiple": false, + "dataType": "containers" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source not found." + }, + { + "code": 400, + "reason": "Invalid even tsource URI or userevent data." + } + ] + } + ] + } + ], + "models": { + "Message": { + "id": "Message", + "description": "Base type for errors and events", + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "required": true, + "description": "Indicates the type of this message." + } + }, + "subTypes": [ + "MissingParams", + "Event" + ] + }, + "MissingParams": { + "id": "MissingParams", + "description": "Error event sent when required params are missing.", + "properties": { + "params": { + "required": true, + "type": "List[string]", + "description": "A list of the missing parameters" + } + } + }, + "Event": { + "id": "Event", + "description": "Base type for asynchronous events from Asterisk.", + "properties": { + "application": { + "type": "string", + "description": "Name of the application receiving the event.", + "required": true + }, + "timestamp": { + "type": "Date", + "description": "Time at which this event was created.", + "required": false + } + }, + "subTypes": [ + "DeviceStateChanged", + "PlaybackStarted", + "PlaybackFinished", + "RecordingStarted", + "RecordingFinished", + "RecordingFailed", + "ApplicationReplaced", + "BridgeCreated", + "BridgeDestroyed", + "BridgeMerged", + "BridgeBlindTransfer", + "BridgeAttendedTransfer", + "ChannelCreated", + "ChannelDestroyed", + "ChannelEnteredBridge", + "ChannelLeftBridge", + "ChannelStateChange", + "ChannelDtmfReceived", + "ChannelDialplan", + "ChannelCallerId", + "ChannelUserevent", + "ChannelHangupRequest", + "ChannelVarset", + "ChannelTalkingStarted", + "ChannelTalkingFinished", + "EndpointStateChange", + "Dial", + "StasisEnd", + "StasisStart", + "TextMessageReceived", + "ChannelConnectedLine" + ] + }, + "DeviceStateChanged": { + "id": "DeviceStateChanged", + "description": "Notification that a device state has changed.", + "properties": { + "device_state": { + "type": "DeviceState", + "description": "Device state object", + "required": true + } + } + }, + "PlaybackStarted": { + "id": "PlaybackStarted", + "description": "Event showing the start of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "PlaybackFinished": { + "id": "PlaybackFinished", + "description": "Event showing the completion of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "RecordingStarted": { + "id": "RecordingStarted", + "description": "Event showing the start of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFinished": { + "id": "RecordingFinished", + "description": "Event showing the completion of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFailed": { + "id": "RecordingFailed", + "description": "Event showing failure of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "ApplicationReplaced": { + "id": "ApplicationReplaced", + "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": {} + }, + "BridgeCreated": { + "id": "BridgeCreated", + "description": "Notification that a bridge has been created.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeDestroyed": { + "id": "BridgeDestroyed", + "description": "Notification that a bridge has been destroyed.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeMerged": { + "id": "BridgeMerged", + "description": "Notification that one bridge has merged into another.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "bridge_from": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeBlindTransfer": { + "id": "BridgeBlindTransfer", + "description": "Notification that a blind transfer has occurred.", + "properties": { + "channel": { + "description": "The channel performing the blind transfer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer when the transferee(s) can not be transferred directly", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "exten": { + "description": "The extension transferred to", + "required": true, + "type": "string" + }, + "context": { + "description": "The context transferred to", + "required": true, + "type": "string" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "bridge": { + "description": "The bridge being transferred", + "type": "Bridge" + } + } + }, + "BridgeAttendedTransfer": { + "id": "BridgeAttendedTransfer", + "description": "Notification that an attended transfer has occurred.", + "properties": { + "transferer_first_leg": { + "description": "First leg of the transferer", + "required": true, + "type": "Channel" + }, + "transferer_second_leg": { + "description": "Second leg of the transferer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer_first_leg in the swap", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "transfer_target": { + "description": "The channel that is being transferred to", + "required": false, + "type": "Channel" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "transferer_first_leg_bridge": { + "description": "Bridge the transferer first leg is in", + "type": "Bridge" + }, + "transferer_second_leg_bridge": { + "description": "Bridge the transferer second leg is in", + "type": "Bridge" + }, + "destination_type": { + "description": "How the transfer was accomplished", + "required": true, + "type": "string" + }, + "destination_bridge": { + "description": "Bridge that survived the merge result", + "type": "string" + }, + "destination_application": { + "description": "Application that has been transferred into", + "type": "string" + }, + "destination_link_first_leg": { + "description": "First leg of a link transfer result", + "type": "Channel" + }, + "destination_link_second_leg": { + "description": "Second leg of a link transfer result", + "type": "Channel" + }, + "destination_threeway_channel": { + "description": "Transferer channel that survived the threeway result", + "type": "Channel" + }, + "destination_threeway_bridge": { + "description": "Bridge that survived the threeway result", + "type": "Bridge" + } + } + }, + "ChannelCreated": { + "id": "ChannelCreated", + "description": "Notification that a channel has been created.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDestroyed": { + "id": "ChannelDestroyed", + "description": "Notification that a channel has been destroyed.", + "properties": { + "cause": { + "required": true, + "description": "Integer representation of the cause of the hangup", + "type": "int" + }, + "cause_txt": { + "required": true, + "description": "Text representation of the cause of the hangup", + "type": "string" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelEnteredBridge": { + "id": "ChannelEnteredBridge", + "description": "Notification that a channel has entered a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "type": "Channel" + } + } + }, + "ChannelLeftBridge": { + "id": "ChannelLeftBridge", + "description": "Notification that a channel has left a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelStateChange": { + "id": "ChannelStateChange", + "description": "Notification of a channel's state change.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDtmfReceived": { + "id": "ChannelDtmfReceived", + "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, + "type": "string", + "description": "DTMF digit received (0-9, A-E, # or *)" + }, + "duration_ms": { + "required": true, + "type": "int", + "description": "Number of milliseconds DTMF was received" + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which DTMF was received" + } + } + }, + "ChannelDialplan": { + "id": "ChannelDialplan", + "description": "Channel changed location in the dialplan.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed dialplan location." + }, + "dialplan_app": { + "required": true, + "type": "string", + "description": "The application about to be executed." + }, + "dialplan_app_data": { + "required": true, + "type": "string", + "description": "The data to be passed to the application." + } + } + }, + "ChannelCallerId": { + "id": "ChannelCallerId", + "description": "Channel changed Caller ID.", + "properties": { + "caller_presentation": { + "required": true, + "type": "int", + "description": "The integer representation of the Caller Presentation value." + }, + "caller_presentation_txt": { + "required": true, + "type": "string", + "description": "The text representation of the Caller Presentation value." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed Caller ID." + } + } + }, + "ChannelUserevent": { + "id": "ChannelUserevent", + "description": "User-generated event with additional user-defined fields in the object.", + "properties": { + "eventname": { + "required": true, + "type": "string", + "description": "The name of the user event." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "A channel that is signaled with the user event." + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "A bridge that is signaled with the user event." + }, + "endpoint": { + "required": false, + "type": "Endpoint", + "description": "A endpoint that is signaled with the user event." + }, + "userevent": { + "required": true, + "type": "object", + "description": "Custom Userevent data" + } + } + }, + "ChannelHangupRequest": { + "id": "ChannelHangupRequest", + "description": "A hangup was requested on the channel.", + "properties": { + "cause": { + "type": "int", + "description": "Integer representation of the cause of the hangup." + }, + "soft": { + "type": "boolean", + "description": "Whether the hangup request was a soft hangup request." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the hangup was requested." + } + } + }, + "ChannelVarset": { + "id": "ChannelVarset", + "description": "Channel variable changed.", + "properties": { + "variable": { + "required": true, + "type": "string", + "description": "The variable that changed." + }, + "value": { + "required": true, + "type": "string", + "description": "The new value of the variable." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable." + } + } + }, + "ChannelTalkingStarted": { + "id": "ChannelTalkingStarted", + "description": "Talking was detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking started." + } + } + }, + "ChannelTalkingFinished": { + "id": "ChannelTalkingFinished", + "description": "Talking is no longer detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking completed." + }, + "duration": { + "required": true, + "type": "int", + "description": "The length of time, in milliseconds, that talking was detected on the channel" + } + } + }, + "EndpointStateChange": { + "id": "EndpointStateChange", + "description": "Endpoint state changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + } + } + }, + "Dial": { + "id": "Dial", + "description": "Dialing state has changed.", + "properties": { + "caller": { + "required": false, + "type": "Channel", + "description": "The calling channel." + }, + "peer": { + "required": true, + "type": "Channel", + "description": "The dialed channel." + }, + "forward": { + "required": false, + "type": "string", + "description": "Forwarding target requested by the original dialed channel." + }, + "forwarded": { + "required": false, + "type": "Channel", + "description": "Channel that the caller has been forwarded to." + }, + "dialstring": { + "required": false, + "type": "string", + "description": "The dial string for calling the peer channel." + }, + "dialstatus": { + "required": true, + "type": "string", + "description": "Current status of the dialing attempt to the peer." + } + } + }, + "StasisEnd": { + "id": "StasisEnd", + "description": "Notification that a channel has left a Stasis application.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "StasisStart": { + "id": "StasisStart", + "description": "Notification that a channel has entered a Stasis application.", + "properties": { + "args": { + "required": true, + "type": "List[string]", + "description": "Arguments to the application" + }, + "channel": { + "required": true, + "type": "Channel" + }, + "replace_channel": { + "required": false, + "type": "Channel" + } + } + }, + "TextMessageReceived": { + "id": "TextMessageReceived", + "description": "A text message was received from an endpoint.", + "properties": { + "message": { + "required": true, + "type": "TextMessage" + }, + "endpoint": { + "required": false, + "type": "Endpoint" + } + } + }, + "ChannelConnectedLine": { + "id": "ChannelConnectedLine", + "description": "Channel changed Connected Line.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel whose connected line has changed." + } + } + } + } +} diff --git a/codegen3/resources/ari_1_6_0/mailboxes.json b/codegen3/resources/ari_1_6_0/mailboxes.json new file mode 100644 index 00000000..b348106e --- /dev/null +++ b/codegen3/resources/ari_1_6_0/mailboxes.json @@ -0,0 +1,134 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "Jonathan Rose ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/mailboxes.{format}", + "apis": [ + { + "path": "/mailboxes", + "description": "Mailboxes", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all mailboxes.", + "nickname": "list", + "responseClass": "List[Mailbox]" + } + ] + }, + { + "path": "/mailboxes/{mailboxName}", + "description": "Mailbox state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a mailbox.", + "nickname": "get", + "responseClass": "Mailbox", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a mailbox. (Note - implicitly creates the mailbox).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "oldMessages", + "description": "Count of old messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "newMessages", + "description": "Count of new messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a mailbox.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + } + ] + } + ], + "models": { + "Mailbox": { + "id": "Mailbox", + "description": "Represents the state of a mailbox.", + "properties": { + "name": { + "type": "string", + "description": "Name of the mailbox.", + "required": true + }, + "old_messages": { + "type": "int", + "description": "Count of old messages in the mailbox.", + "required": true + }, + "new_messages": { + "type": "int", + "description": "Count of new messages in the mailbox.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_6_0/playbacks.json b/codegen3/resources/ari_1_6_0/playbacks.json new file mode 100644 index 00000000..98b511a0 --- /dev/null +++ b/codegen3/resources/ari_1_6_0/playbacks.json @@ -0,0 +1,155 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/playbacks.{format}", + "apis": [ + { + "path": "/playbacks/{playbackId}", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a playback's details.", + "nickname": "get", + "responseClass": "Playback", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a playback.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + } + ] + }, + { + "path": "/playbacks/{playbackId}/control", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Control a playback.", + "nickname": "control", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "operation", + "description": "Operation to perform on the playback.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "restart", + "pause", + "unpause", + "reverse", + "forward" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "The provided operation parameter was invalid" + }, + { + "code": 404, + "reason": "The playback cannot be found" + }, + { + "code": 409, + "reason": "The operation cannot be performed in the playback's current state" + } +] + } + ] + } + ], + "models": { + "Playback": { + "id": "Playback", + "description": "Object representing the playback of media to a channel", + "properties": { + "id": { + "type": "string", + "description": "ID for this playback operation", + "required": true + }, + "media_uri": { + "type": "string", + "description": "URI for the media to play back.", + "required": true + }, + "target_uri": { + "type": "string", + "description": "URI for the channel or bridge to play the media on", + "required": true + }, + "language": { + "type": "string", + "description": "For media types that support multiple languages, the language requested for playback." + }, + "state": { + "type": "string", + "description": "Current state of the playback operation.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "playing", + "complete" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_6_0/recordings.json b/codegen3/resources/ari_1_6_0/recordings.json new file mode 100644 index 00000000..a4a096f1 --- /dev/null +++ b/codegen3/resources/ari_1_6_0/recordings.json @@ -0,0 +1,378 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/recordings.{format}", + "apis": [ + { + "path": "/recordings/stored", + "description": "Recordings", + "operations": [ + { + "httpMethod": "GET", + "summary": "List recordings that are complete.", + "nickname": "listStored", + "responseClass": "List[StoredRecording]" + } + ] + }, + { + "path": "/recordings/stored/{recordingName}", + "description": "Individual recording", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a stored recording's details.", + "nickname": "getStored", + "responseClass": "StoredRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete a stored recording.", + "nickname": "deleteStored", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "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" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}", + "description": "A recording that is in progress", + "operations": [ + { + "httpMethod": "GET", + "summary": "List live recordings.", + "nickname": "getLive", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a live recording and discard it.", + "nickname": "cancel", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/stop", + "operations": [ + { + "httpMethod": "POST", + "summary": "Stop a live recording and store it.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/pause", + "operations": [ + { + "httpMethod": "POST", + "summary": "Pause a live recording.", + "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.", + "nickname": "pause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unpause a live recording.", + "nickname": "unpause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/mute", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a live recording.", + "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a live recording.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + } + ], + "models": { + "StoredRecording": { + "id": "StoredRecording", + "description": "A past recording that may be played back.", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "LiveRecording": { + "id": "LiveRecording", + "description": "A recording that is in progress", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Base name for the recording" + }, + "format": { + "required": true, + "type": "string", + "description": "Recording format (wav, gsm, etc.)" + }, + "target_uri": { + "required": true, + "type": "string", + "description": "URI for the channel or bridge being recorded" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "recording", + "paused", + "done", + "failed", + "canceled" + ] + } + }, + "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." + }, + "cause": { + "required": false, + "type": "string", + "description": "Cause for recording failure if failed" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_6_0/sounds.json b/codegen3/resources/ari_1_6_0/sounds.json new file mode 100644 index 00000000..5ed6de7a --- /dev/null +++ b/codegen3/resources/ari_1_6_0/sounds.json @@ -0,0 +1,99 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/sounds.{format}", + "apis": [ + { + "path": "/sounds", + "description": "Sounds", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all sounds.", + "nickname": "list", + "responseClass": "List[Sound]", + "parameters": [ + { + "name": "lang", + "description": "Lookup sound for a specific language.", + "paramType": "query", + "dataType": "string", + "required": false + }, + { + "name": "format", + "description": "Lookup sound in a specific format.", + "paramType": "query", + "dataType": "string", + "required": false, + "__note": "core show translation can show translation paths between formats, along with relative costs. so this could be just installed format, or we could follow that for transcoded formats." + } + ] + } + ] + }, + { + "path": "/sounds/{soundId}", + "description": "Individual sound", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a sound's details.", + "nickname": "get", + "responseClass": "Sound", + "parameters": [ + { + "name": "soundId", + "description": "Sound's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + } + ], + "models": { + "FormatLangPair": { + "id": "FormatLangPair", + "description": "Identifies the format and language of a sound file", + "properties": { + "language": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "Sound": { + "id": "Sound", + "description": "A media file that may be played back.", + "properties": { + "id": { + "required": true, + "description": "Sound's identifier.", + "type": "string" + }, + "text": { + "required": false, + "description": "Text description of the sound, usually the words spoken.", + "type": "string" + }, + "formats": { + "required": true, + "description": "The formats and languages in which this sound is available.", + "type": "List[FormatLangPair]" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_7_0/applications.json b/codegen3/resources/ari_1_7_0/applications.json new file mode 100644 index 00000000..db5a9ee0 --- /dev/null +++ b/codegen3/resources/ari_1_7_0/applications.json @@ -0,0 +1,172 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/applications.{format}", + "apis": [ + { + "path": "/applications", + "description": "Stasis applications", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all applications.", + "nickname": "list", + "responseClass": "List[Application]" + } + ] + }, + { + "path": "/applications/{applicationName}", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get details of an application.", + "nickname": "get", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + } + ] + } + ] + }, + { + "path": "/applications/{applicationName}/subscription", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "POST", + "summary": "Subscribe an application to a event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "subscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unsubscribe an application from an event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "unsubscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter; event source scheme not recognized." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 409, + "reason": "Application not subscribed to event source." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + } + ] + } + ], + "models": { + "Application": { + "id": "Application", + "description": "Details of a Stasis application", + "properties": { + "name": { + "type": "string", + "description": "Name of this application", + "required": true + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's for channels subscribed to.", + "required": true + }, + "bridge_ids": { + "type": "List[string]", + "description": "Id's for bridges subscribed to.", + "required": true + }, + "endpoint_ids": { + "type": "List[string]", + "description": "{tech}/{resource} for endpoints subscribed to.", + "required": true + }, + "device_names": { + "type": "List[string]", + "description": "Names of the devices subscribed to.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_7_0/asterisk.json b/codegen3/resources/ari_1_7_0/asterisk.json new file mode 100644 index 00000000..69cef054 --- /dev/null +++ b/codegen3/resources/ari_1_7_0/asterisk.json @@ -0,0 +1,259 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/asterisk.{format}", + "apis": [ + { + "path": "/asterisk/info", + "description": "Asterisk system information (similar to core show settings)", + "operations": [ + { + "httpMethod": "GET", + "summary": "Gets Asterisk system information.", + "nickname": "getInfo", + "responseClass": "AsteriskInfo", + "parameters": [ + { + "name": "only", + "description": "Filter information returned", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "build", + "system", + "config", + "status" + ] + } + } + ] + } + ] + }, + { + "path": "/asterisk/variable", + "description": "Global variables", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a global variable.", + "nickname": "getGlobalVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "variable", + "description": "The variable to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a global variable.", + "nickname": "setGlobalVar", + "responseClass": "void", + "parameters": [ + { + "name": "variable", + "description": "The variable to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + } + ] + } + ], + "models": { + "BuildInfo": { + "id": "BuildInfo", + "description": "Info about how Asterisk was built", + "properties": { + "os": { + "required": true, + "type": "string", + "description": "OS Asterisk was built on." + }, + "kernel": { + "required": true, + "type": "string", + "description": "Kernel version Asterisk was built on." + }, + "options": { + "required": true, + "type": "string", + "description": "Compile time options, or empty string if default." + }, + "machine": { + "required": true, + "type": "string", + "description": "Machine architecture (x86_64, i686, ppc, etc.)" + }, + "date": { + "required": true, + "type": "string", + "description": "Date and time when Asterisk was built." + }, + "user": { + "required": true, + "type": "string", + "description": "Username that build Asterisk" + } + } + }, + "SystemInfo": { + "id": "SystemInfo", + "description": "Info about Asterisk", + "properties": { + "version": { + "required": true, + "type": "string", + "description": "Asterisk version." + }, + "entity_id": { + "required": true, + "type": "string", + "description": "" + } + } + }, + "SetId": { + "id": "SetId", + "description": "Effective user/group id", + "properties": { + "user": { + "required": true, + "type": "string", + "description": "Effective user id." + }, + "group": { + "required": true, + "type": "string", + "description": "Effective group id." + } + } + }, + "ConfigInfo": { + "id": "ConfigInfo", + "description": "Info about Asterisk configuration", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Asterisk system name." + }, + "default_language": { + "required": true, + "type": "string", + "description": "Default language for media playback." + }, + "max_channels": { + "required": false, + "type": "int", + "description": "Maximum number of simultaneous channels." + }, + "max_open_files": { + "required": false, + "type": "int", + "description": "Maximum number of open file handles (files, sockets)." + }, + "max_load": { + "required": false, + "type": "double", + "description": "Maximum load avg on system." + }, + "setid": { + "required": true, + "type": "SetId", + "description": "Effective user/group id for running Asterisk." + } + } + }, + "StatusInfo": { + "id": "StatusInfo", + "description": "Info about Asterisk status", + "properties": { + "startup_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was started." + }, + "last_reload_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was last reloaded." + } + } + }, + "AsteriskInfo": { + "id": "AsteriskInfo", + "description": "Asterisk system information", + "properties": { + "build": { + "required": false, + "type": "BuildInfo", + "description": "Info about how Asterisk was built" + }, + "system": { + "required": false, + "type": "SystemInfo", + "description": "Info about the system running Asterisk" + }, + "config": { + "required": false, + "type": "ConfigInfo", + "description": "Info about Asterisk configuration" + }, + "status": { + "required": false, + "type": "StatusInfo", + "description": "Info about Asterisk status" + } + } + }, + "Variable": { + "id": "Variable", + "description": "The value of a channel variable", + "properties": { + "value": { + "required": true, + "type": "string", + "description": "The value of the variable requested" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_7_0/bridges.json b/codegen3/resources/ari_1_7_0/bridges.json new file mode 100644 index 00000000..9ff8ed3c --- /dev/null +++ b/codegen3/resources/ari_1_7_0/bridges.json @@ -0,0 +1,656 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 431145 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/bridges.{format}", + "apis": [ + { + "path": "/bridges", + "description": "Active bridges", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active bridges in Asterisk.", + "nickname": "list", + "responseClass": "List[Bridge]" + }, + { + "httpMethod": "POST", + "summary": "Create a new bridge.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "create", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Name to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}", + "description": "Individual bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Create a new bridge or updates an existing one.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "createWithId", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Set the name of the bridge.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "GET", + "summary": "Get bridge details.", + "nickname": "get", + "responseClass": "Bridge", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Shut down a bridge.", + "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", + "nickname": "destroy", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/addChannel", + "description": "Add a channel to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Add a channel to a bridge.", + "nickname": "addChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to add to bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "role", + "description": "Channel's role in the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application; Channel currently recording" + }, + { + "code": 422, + "reason": "Channel not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/removeChannel", + "description": "Remove a channel from a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Remove a channel from a bridge.", + "nickname": "removeChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to remove from bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in this bridge" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/moh", + "description": "Play music on hold to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a bridge or change the MOH class that is playing.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Channel's id", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a bridge.", + "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play", + "description": "Play media to the participants of a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "playbackId", + "description": "Playback Id.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play/{playbackId}", + "description": "Play media to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + + } + ] + }, + { + "path": "/bridges/{bridgeId}/record", + "description": "Record audio on a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "This records the mixed audio from all channels participating in this bridge.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + } + ], + "models": { + "Bridge": { + "id": "Bridge", + "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for this bridge", + "required": true + }, + "technology": { + "type": "string", + "description": "Name of the current bridging technology", + "required": true + }, + "bridge_type": { + "type": "string", + "description": "Type of bridge technology", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "mixing", + "holding" + ] + } + }, + "bridge_class": { + "type": "string", + "description": "Bridging class", + "required": true + }, + "creator": { + "type": "string", + "description": "Entity that created the bridge", + "required": true + }, + "name": { + "type": "string", + "description": "Name the creator gave the bridge", + "required": true + }, + "channels": { + "type": "List[string]", + "description": "Ids of channels participating in this bridge", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_7_0/channels.json b/codegen3/resources/ari_1_7_0/channels.json new file mode 100644 index 00000000..dd81a23e --- /dev/null +++ b/codegen3/resources/ari_1_7_0/channels.json @@ -0,0 +1,1501 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 431145 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/channels.{format}", + "apis": [ + { + "path": "/channels", + "description": "Active channels", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active channels in Asterisk.", + "nickname": "list", + "responseClass": "List[Channel]" + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originate", + "responseClass": "Channel", + "parameters": [ + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "label", + "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "The unique id of the channel which is originating this one.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + } + ] + }, + { + "path": "/channels/{channelId}", + "description": "Active channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Channel details.", + "nickname": "get", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate with id).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originateWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "label", + "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "The unique id of the channel which is originating this one.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + + }, + { + "httpMethod": "DELETE", + "summary": "Delete (i.e. hangup) a channel.", + "nickname": "hangup", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "reason", + "description": "Reason for hanging up the channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defalutValue": "normal", + "allowableValues": { + "valueType": "LIST", + "values": [ + "normal", + "busy", + "congestion" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid reason for hangup provided" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/continue", + "description": "Exit application; continue execution in the dialplan", + "operations": [ + { + "httpMethod": "POST", + "summary": "Exit application; continue execution in the dialplan.", + "nickname": "continueInDialplan", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "label", + "description": "The label to continue to - will supersede 'priority' if both are provided.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/answer", + "description": "Answer a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Answer a channel.", + "nickname": "answer", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/ring", + "description": "Send a ringing indication to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Indicate ringing to a channel.", + "nickname": "ring", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop ringing indication on a channel if locally generated.", + "nickname": "ringStop", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/dtmf", + "description": "Send DTMF to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Send provided DTMF to a given channel.", + "nickname": "sendDTMF", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "dtmf", + "description": "DTMF To send.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "before", + "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + }, + { + "name": "between", + "description": "Amount of time in between DTMF digits (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "duration", + "description": "Length of each DTMF digit (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "after", + "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "DTMF is required" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/mute", + "description": "Mute a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a channel.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to mute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a channel.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to unmute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/hold", + "description": "Put a channel on hold", + "operations": [ + { + "httpMethod": "POST", + "summary": "Hold a channel.", + "nickname": "hold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Remove a channel from hold.", + "nickname": "unhold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/moh", + "description": "Play music on hold to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a channel.", + "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Music on hold class to use", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a channel.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/silence", + "description": "Play silence to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play silence to a channel.", + "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", + "nickname": "startSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing silence to a channel.", + "nickname": "stopSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play/{playbackId}", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media and specify the playbackId.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/record", + "description": "Record audio from a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/variable", + "description": "Variables on a channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a channel variable or function.", + "nickname": "getChannelVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a channel variable or function.", + "nickname": "setChannelVar", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannel", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop/{snoopId}", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannelWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + } + ], + "models": { + "Dialed": { + "id": "Dialed", + "description": "Dialed channel information.", + "properties": {} + }, + "DialplanCEP": { + "id": "DialplanCEP", + "description": "Dialplan location (context/extension/priority)", + "properties": { + "context": { + "required": true, + "type": "string", + "description": "Context in the dialplan" + }, + "exten": { + "required": true, + "type": "string", + "description": "Extension in the dialplan" + }, + "priority": { + "required": true, + "type": "long", + "description": "Priority in the dialplan" + } + } + }, + "CallerID": { + "id": "CallerID", + "description": "Caller identification", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "number": { + "required": true, + "type": "string" + } + } + }, + "Channel": { + "id": "Channel", + "description": "A specific communication connection between Asterisk and an Endpoint.", + "properties": { + "id": { + "required": true, + "type": "string", + "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI." + }, + "name": { + "required": true, + "type": "string", + "description": "Name of the channel (i.e. SIP/foo-0000a7e3)" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "Down", + "Rsrved", + "OffHook", + "Dialing", + "Ring", + "Ringing", + "Up", + "Busy", + "Dialing Offhook", + "Pre-ring", + "Unknown" + ] + } + }, + "caller": { + "required": true, + "type": "CallerID" + }, + "connected": { + "required": true, + "type": "CallerID" + }, + "accountcode": { + "required": true, + "type": "string" + }, + "dialplan": { + "required": true, + "type": "DialplanCEP", + "description": "Current location in the dialplan" + }, + "creationtime": { + "required": true, + "type": "Date", + "description": "Timestamp when channel was created" + }, + "language": { + "required": true, + "type": "string", + "description": "The default spoken language" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_7_0/deviceStates.json b/codegen3/resources/ari_1_7_0/deviceStates.json new file mode 100644 index 00000000..62ecb135 --- /dev/null +++ b/codegen3/resources/ari_1_7_0/deviceStates.json @@ -0,0 +1,151 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "Kevin Harwell ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/deviceStates.{format}", + "apis": [ + { + "path": "/deviceStates", + "description": "Device states", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all ARI controlled device states.", + "nickname": "list", + "responseClass": "List[DeviceState]" + } + ] + }, + { + "path": "/deviceStates/{deviceName}", + "description": "Device state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a device.", + "nickname": "get", + "responseClass": "DeviceState", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "deviceState", + "description": "Device state value", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a device-state controlled by ARI.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + } + ] + } + ], + "models": { + "DeviceState": { + "id": "DeviceState", + "description": "Represents the state of a device.", + "properties": { + "name": { + "type": "string", + "description": "Name of the device.", + "required": true + }, + "state": { + "type": "string", + "description": "Device's state", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "UNKNOWN", + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_7_0/endpoints.json b/codegen3/resources/ari_1_7_0/endpoints.json new file mode 100644 index 00000000..8440d8b0 --- /dev/null +++ b/codegen3/resources/ari_1_7_0/endpoints.json @@ -0,0 +1,275 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/endpoints.{format}", + "apis": [ + { + "path": "/endpoints", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all endpoints.", + "nickname": "list", + "responseClass": "List[Endpoint]" + } + ] + }, + { + "path": "/endpoints/sendMessage", + "description": "Send a message to some technology URI or endpoint.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some technology URI or endpoint.", + "nickname": "sendMessage", + "responseClass": "void", + "parameters": [ + { + "name": "to", + "description": "The endpoint resource or technology specific URI to send the message to. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List available endoints for a given endpoint technology.", + "nickname": "listByTech", + "responseClass": "List[Endpoint]", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoints (sip,iax2,...)", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}", + "description": "Single endpoint", + "operations": [ + { + "httpMethod": "GET", + "summary": "Details for an endpoint.", + "nickname": "get", + "responseClass": "Endpoint", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}/sendMessage", + "description": "Send a message to some endpoint in a technology.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some endpoint in a technology.", + "nickname": "sendMessageToEndpoint", + "responseClass": "void", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + } + ], + "models": { + "Endpoint": { + "id": "Endpoint", + "description": "An external device that may offer/accept calls to/from Asterisk.\n\nUnlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.", + "properties": { + "technology": { + "type": "string", + "description": "Technology of the endpoint", + "required": true + }, + "resource": { + "type": "string", + "description": "Identifier of the endpoint, specific to the given technology.", + "required": true + }, + "state": { + "type": "string", + "description": "Endpoint's state", + "required": false, + "allowableValues": { + "valueType": "LIST", + "values": [ + "unknown", + "offline", + "online" + ] + } + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's of channels associated with this endpoint", + "required": true + } + } + }, + "TextMessageVariable": { + "id": "TextMessageVariable", + "description": "A key/value pair variable in a text message.", + "properties": { + "key": { + "type": "string", + "description": "A unique key identifying the variable.", + "required": true + }, + "value": { + "type": "string", + "description": "The value of the variable.", + "required": true + } + } + }, + "TextMessage": { + "id": "TextMessage", + "description": "A text message.", + "properties": { + "from": { + "type": "string", + "description": "A technology specific URI specifying the source of the message. For sip and pjsip technologies, any SIP URI can be specified. For xmpp, the URI must correspond to the client connection being used to send the message.", + "required": true + }, + "to": { + "type": "string", + "description": "A technology specific URI specifying the destination of the message. Valid technologies include sip, pjsip, and xmp. The destination of a message should be an endpoint.", + "required": true + }, + "body": { + "type": "string", + "description": "The text of the message.", + "required": true + }, + "variables": { + "type": "List[TextMessageVariable]", + "description": "Technology specific key/value pairs associated with the message.", + "required": false + } + } + } + } +} diff --git a/codegen3/resources/ari_1_7_0/events.json b/codegen3/resources/ari_1_7_0/events.json new file mode 100644 index 00000000..9c24dbdc --- /dev/null +++ b/codegen3/resources/ari_1_7_0/events.json @@ -0,0 +1,729 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.2", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/events.{format}", + "apis": [ + { + "path": "/events", + "description": "Events from Asterisk to applications", + "operations": [ + { + "httpMethod": "GET", + "upgrade": "websocket", + "websocketProtocol": "ari", + "summary": "WebSocket connection for events.", + "nickname": "eventWebsocket", + "responseClass": "Message", + "parameters": [ + { + "name": "app", + "description": "Applications to subscribe to.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ] + } + ] + }, + { + "path": "/events/user/{eventName}", + "description": "Stasis application user events", + "operations": [ + { + "httpMethod": "POST", + "summary": "Generate a user event.", + "nickname": "userEvent", + "responseClass": "void", + "parameters": [ + { + "name": "eventName", + "description": "Event name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "application", + "description": "The name of the application that will receive this event", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "source", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds custom key/value pairs to add to the user event. Ex. { \"variables\": { \"key\": \"value\" } }", + "paramType": "body", + "required": false, + "allowMultiple": false, + "dataType": "containers" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source not found." + }, + { + "code": 400, + "reason": "Invalid even tsource URI or userevent data." + } + ] + } + ] + } + ], + "models": { + "Message": { + "id": "Message", + "description": "Base type for errors and events", + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "required": true, + "description": "Indicates the type of this message." + } + }, + "subTypes": [ + "MissingParams", + "Event" + ] + }, + "MissingParams": { + "id": "MissingParams", + "description": "Error event sent when required params are missing.", + "properties": { + "params": { + "required": true, + "type": "List[string]", + "description": "A list of the missing parameters" + } + } + }, + "Event": { + "id": "Event", + "description": "Base type for asynchronous events from Asterisk.", + "properties": { + "application": { + "type": "string", + "description": "Name of the application receiving the event.", + "required": true + }, + "timestamp": { + "type": "Date", + "description": "Time at which this event was created.", + "required": false + } + }, + "subTypes": [ + "DeviceStateChanged", + "PlaybackStarted", + "PlaybackFinished", + "RecordingStarted", + "RecordingFinished", + "RecordingFailed", + "ApplicationReplaced", + "BridgeCreated", + "BridgeDestroyed", + "BridgeMerged", + "BridgeBlindTransfer", + "BridgeAttendedTransfer", + "ChannelCreated", + "ChannelDestroyed", + "ChannelEnteredBridge", + "ChannelLeftBridge", + "ChannelStateChange", + "ChannelDtmfReceived", + "ChannelDialplan", + "ChannelCallerId", + "ChannelUserevent", + "ChannelHangupRequest", + "ChannelVarset", + "ChannelTalkingStarted", + "ChannelTalkingFinished", + "EndpointStateChange", + "Dial", + "StasisEnd", + "StasisStart", + "TextMessageReceived", + "ChannelConnectedLine" + ] + }, + "DeviceStateChanged": { + "id": "DeviceStateChanged", + "description": "Notification that a device state has changed.", + "properties": { + "device_state": { + "type": "DeviceState", + "description": "Device state object", + "required": true + } + } + }, + "PlaybackStarted": { + "id": "PlaybackStarted", + "description": "Event showing the start of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "PlaybackFinished": { + "id": "PlaybackFinished", + "description": "Event showing the completion of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "RecordingStarted": { + "id": "RecordingStarted", + "description": "Event showing the start of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFinished": { + "id": "RecordingFinished", + "description": "Event showing the completion of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFailed": { + "id": "RecordingFailed", + "description": "Event showing failure of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "ApplicationReplaced": { + "id": "ApplicationReplaced", + "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": {} + }, + "BridgeCreated": { + "id": "BridgeCreated", + "description": "Notification that a bridge has been created.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeDestroyed": { + "id": "BridgeDestroyed", + "description": "Notification that a bridge has been destroyed.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeMerged": { + "id": "BridgeMerged", + "description": "Notification that one bridge has merged into another.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "bridge_from": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeBlindTransfer": { + "id": "BridgeBlindTransfer", + "description": "Notification that a blind transfer has occurred.", + "properties": { + "channel": { + "description": "The channel performing the blind transfer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer when the transferee(s) can not be transferred directly", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "exten": { + "description": "The extension transferred to", + "required": true, + "type": "string" + }, + "context": { + "description": "The context transferred to", + "required": true, + "type": "string" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "bridge": { + "description": "The bridge being transferred", + "type": "Bridge" + } + } + }, + "BridgeAttendedTransfer": { + "id": "BridgeAttendedTransfer", + "description": "Notification that an attended transfer has occurred.", + "properties": { + "transferer_first_leg": { + "description": "First leg of the transferer", + "required": true, + "type": "Channel" + }, + "transferer_second_leg": { + "description": "Second leg of the transferer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer_first_leg in the swap", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "transfer_target": { + "description": "The channel that is being transferred to", + "required": false, + "type": "Channel" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "transferer_first_leg_bridge": { + "description": "Bridge the transferer first leg is in", + "type": "Bridge" + }, + "transferer_second_leg_bridge": { + "description": "Bridge the transferer second leg is in", + "type": "Bridge" + }, + "destination_type": { + "description": "How the transfer was accomplished", + "required": true, + "type": "string" + }, + "destination_bridge": { + "description": "Bridge that survived the merge result", + "type": "string" + }, + "destination_application": { + "description": "Application that has been transferred into", + "type": "string" + }, + "destination_link_first_leg": { + "description": "First leg of a link transfer result", + "type": "Channel" + }, + "destination_link_second_leg": { + "description": "Second leg of a link transfer result", + "type": "Channel" + }, + "destination_threeway_channel": { + "description": "Transferer channel that survived the threeway result", + "type": "Channel" + }, + "destination_threeway_bridge": { + "description": "Bridge that survived the threeway result", + "type": "Bridge" + } + } + }, + "ChannelCreated": { + "id": "ChannelCreated", + "description": "Notification that a channel has been created.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDestroyed": { + "id": "ChannelDestroyed", + "description": "Notification that a channel has been destroyed.", + "properties": { + "cause": { + "required": true, + "description": "Integer representation of the cause of the hangup", + "type": "int" + }, + "cause_txt": { + "required": true, + "description": "Text representation of the cause of the hangup", + "type": "string" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelEnteredBridge": { + "id": "ChannelEnteredBridge", + "description": "Notification that a channel has entered a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "type": "Channel" + } + } + }, + "ChannelLeftBridge": { + "id": "ChannelLeftBridge", + "description": "Notification that a channel has left a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelStateChange": { + "id": "ChannelStateChange", + "description": "Notification of a channel's state change.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDtmfReceived": { + "id": "ChannelDtmfReceived", + "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, + "type": "string", + "description": "DTMF digit received (0-9, A-E, # or *)" + }, + "duration_ms": { + "required": true, + "type": "int", + "description": "Number of milliseconds DTMF was received" + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which DTMF was received" + } + } + }, + "ChannelDialplan": { + "id": "ChannelDialplan", + "description": "Channel changed location in the dialplan.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed dialplan location." + }, + "dialplan_app": { + "required": true, + "type": "string", + "description": "The application about to be executed." + }, + "dialplan_app_data": { + "required": true, + "type": "string", + "description": "The data to be passed to the application." + } + } + }, + "ChannelCallerId": { + "id": "ChannelCallerId", + "description": "Channel changed Caller ID.", + "properties": { + "caller_presentation": { + "required": true, + "type": "int", + "description": "The integer representation of the Caller Presentation value." + }, + "caller_presentation_txt": { + "required": true, + "type": "string", + "description": "The text representation of the Caller Presentation value." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed Caller ID." + } + } + }, + "ChannelUserevent": { + "id": "ChannelUserevent", + "description": "User-generated event with additional user-defined fields in the object.", + "properties": { + "eventname": { + "required": true, + "type": "string", + "description": "The name of the user event." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "A channel that is signaled with the user event." + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "A bridge that is signaled with the user event." + }, + "endpoint": { + "required": false, + "type": "Endpoint", + "description": "A endpoint that is signaled with the user event." + }, + "userevent": { + "required": true, + "type": "object", + "description": "Custom Userevent data" + } + } + }, + "ChannelHangupRequest": { + "id": "ChannelHangupRequest", + "description": "A hangup was requested on the channel.", + "properties": { + "cause": { + "type": "int", + "description": "Integer representation of the cause of the hangup." + }, + "soft": { + "type": "boolean", + "description": "Whether the hangup request was a soft hangup request." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the hangup was requested." + } + } + }, + "ChannelVarset": { + "id": "ChannelVarset", + "description": "Channel variable changed.", + "properties": { + "variable": { + "required": true, + "type": "string", + "description": "The variable that changed." + }, + "value": { + "required": true, + "type": "string", + "description": "The new value of the variable." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable." + } + } + }, + "ChannelTalkingStarted": { + "id": "ChannelTalkingStarted", + "description": "Talking was detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking started." + } + } + }, + "ChannelTalkingFinished": { + "id": "ChannelTalkingFinished", + "description": "Talking is no longer detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking completed." + }, + "duration": { + "required": true, + "type": "int", + "description": "The length of time, in milliseconds, that talking was detected on the channel" + } + } + }, + "EndpointStateChange": { + "id": "EndpointStateChange", + "description": "Endpoint state changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + } + } + }, + "Dial": { + "id": "Dial", + "description": "Dialing state has changed.", + "properties": { + "caller": { + "required": false, + "type": "Channel", + "description": "The calling channel." + }, + "peer": { + "required": true, + "type": "Channel", + "description": "The dialed channel." + }, + "forward": { + "required": false, + "type": "string", + "description": "Forwarding target requested by the original dialed channel." + }, + "forwarded": { + "required": false, + "type": "Channel", + "description": "Channel that the caller has been forwarded to." + }, + "dialstring": { + "required": false, + "type": "string", + "description": "The dial string for calling the peer channel." + }, + "dialstatus": { + "required": true, + "type": "string", + "description": "Current status of the dialing attempt to the peer." + } + } + }, + "StasisEnd": { + "id": "StasisEnd", + "description": "Notification that a channel has left a Stasis application.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "StasisStart": { + "id": "StasisStart", + "description": "Notification that a channel has entered a Stasis application.", + "properties": { + "args": { + "required": true, + "type": "List[string]", + "description": "Arguments to the application" + }, + "channel": { + "required": true, + "type": "Channel" + }, + "replace_channel": { + "required": false, + "type": "Channel" + } + } + }, + "TextMessageReceived": { + "id": "TextMessageReceived", + "description": "A text message was received from an endpoint.", + "properties": { + "message": { + "required": true, + "type": "TextMessage" + }, + "endpoint": { + "required": false, + "type": "Endpoint" + } + } + }, + "ChannelConnectedLine": { + "id": "ChannelConnectedLine", + "description": "Channel changed Connected Line.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel whose connected line has changed." + } + } + } + } +} diff --git a/codegen3/resources/ari_1_7_0/mailboxes.json b/codegen3/resources/ari_1_7_0/mailboxes.json new file mode 100644 index 00000000..b348106e --- /dev/null +++ b/codegen3/resources/ari_1_7_0/mailboxes.json @@ -0,0 +1,134 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "Jonathan Rose ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/mailboxes.{format}", + "apis": [ + { + "path": "/mailboxes", + "description": "Mailboxes", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all mailboxes.", + "nickname": "list", + "responseClass": "List[Mailbox]" + } + ] + }, + { + "path": "/mailboxes/{mailboxName}", + "description": "Mailbox state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a mailbox.", + "nickname": "get", + "responseClass": "Mailbox", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a mailbox. (Note - implicitly creates the mailbox).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "oldMessages", + "description": "Count of old messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "newMessages", + "description": "Count of new messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a mailbox.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + } + ] + } + ], + "models": { + "Mailbox": { + "id": "Mailbox", + "description": "Represents the state of a mailbox.", + "properties": { + "name": { + "type": "string", + "description": "Name of the mailbox.", + "required": true + }, + "old_messages": { + "type": "int", + "description": "Count of old messages in the mailbox.", + "required": true + }, + "new_messages": { + "type": "int", + "description": "Count of new messages in the mailbox.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_7_0/playbacks.json b/codegen3/resources/ari_1_7_0/playbacks.json new file mode 100644 index 00000000..98b511a0 --- /dev/null +++ b/codegen3/resources/ari_1_7_0/playbacks.json @@ -0,0 +1,155 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/playbacks.{format}", + "apis": [ + { + "path": "/playbacks/{playbackId}", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a playback's details.", + "nickname": "get", + "responseClass": "Playback", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a playback.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + } + ] + }, + { + "path": "/playbacks/{playbackId}/control", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Control a playback.", + "nickname": "control", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "operation", + "description": "Operation to perform on the playback.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "restart", + "pause", + "unpause", + "reverse", + "forward" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "The provided operation parameter was invalid" + }, + { + "code": 404, + "reason": "The playback cannot be found" + }, + { + "code": 409, + "reason": "The operation cannot be performed in the playback's current state" + } +] + } + ] + } + ], + "models": { + "Playback": { + "id": "Playback", + "description": "Object representing the playback of media to a channel", + "properties": { + "id": { + "type": "string", + "description": "ID for this playback operation", + "required": true + }, + "media_uri": { + "type": "string", + "description": "URI for the media to play back.", + "required": true + }, + "target_uri": { + "type": "string", + "description": "URI for the channel or bridge to play the media on", + "required": true + }, + "language": { + "type": "string", + "description": "For media types that support multiple languages, the language requested for playback." + }, + "state": { + "type": "string", + "description": "Current state of the playback operation.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "playing", + "complete" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_7_0/recordings.json b/codegen3/resources/ari_1_7_0/recordings.json new file mode 100644 index 00000000..a4a096f1 --- /dev/null +++ b/codegen3/resources/ari_1_7_0/recordings.json @@ -0,0 +1,378 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/recordings.{format}", + "apis": [ + { + "path": "/recordings/stored", + "description": "Recordings", + "operations": [ + { + "httpMethod": "GET", + "summary": "List recordings that are complete.", + "nickname": "listStored", + "responseClass": "List[StoredRecording]" + } + ] + }, + { + "path": "/recordings/stored/{recordingName}", + "description": "Individual recording", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a stored recording's details.", + "nickname": "getStored", + "responseClass": "StoredRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete a stored recording.", + "nickname": "deleteStored", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "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" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}", + "description": "A recording that is in progress", + "operations": [ + { + "httpMethod": "GET", + "summary": "List live recordings.", + "nickname": "getLive", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a live recording and discard it.", + "nickname": "cancel", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/stop", + "operations": [ + { + "httpMethod": "POST", + "summary": "Stop a live recording and store it.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/pause", + "operations": [ + { + "httpMethod": "POST", + "summary": "Pause a live recording.", + "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.", + "nickname": "pause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unpause a live recording.", + "nickname": "unpause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/mute", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a live recording.", + "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a live recording.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + } + ], + "models": { + "StoredRecording": { + "id": "StoredRecording", + "description": "A past recording that may be played back.", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "LiveRecording": { + "id": "LiveRecording", + "description": "A recording that is in progress", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Base name for the recording" + }, + "format": { + "required": true, + "type": "string", + "description": "Recording format (wav, gsm, etc.)" + }, + "target_uri": { + "required": true, + "type": "string", + "description": "URI for the channel or bridge being recorded" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "recording", + "paused", + "done", + "failed", + "canceled" + ] + } + }, + "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." + }, + "cause": { + "required": false, + "type": "string", + "description": "Cause for recording failure if failed" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_7_0/sounds.json b/codegen3/resources/ari_1_7_0/sounds.json new file mode 100644 index 00000000..5ed6de7a --- /dev/null +++ b/codegen3/resources/ari_1_7_0/sounds.json @@ -0,0 +1,99 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision: 429091 $", + "apiVersion": "1.6.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/sounds.{format}", + "apis": [ + { + "path": "/sounds", + "description": "Sounds", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all sounds.", + "nickname": "list", + "responseClass": "List[Sound]", + "parameters": [ + { + "name": "lang", + "description": "Lookup sound for a specific language.", + "paramType": "query", + "dataType": "string", + "required": false + }, + { + "name": "format", + "description": "Lookup sound in a specific format.", + "paramType": "query", + "dataType": "string", + "required": false, + "__note": "core show translation can show translation paths between formats, along with relative costs. so this could be just installed format, or we could follow that for transcoded formats." + } + ] + } + ] + }, + { + "path": "/sounds/{soundId}", + "description": "Individual sound", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a sound's details.", + "nickname": "get", + "responseClass": "Sound", + "parameters": [ + { + "name": "soundId", + "description": "Sound's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + } + ], + "models": { + "FormatLangPair": { + "id": "FormatLangPair", + "description": "Identifies the format and language of a sound file", + "properties": { + "language": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "Sound": { + "id": "Sound", + "description": "A media file that may be played back.", + "properties": { + "id": { + "required": true, + "description": "Sound's identifier.", + "type": "string" + }, + "text": { + "required": false, + "description": "Text description of the sound, usually the words spoken.", + "type": "string" + }, + "formats": { + "required": true, + "description": "The formats and languages in which this sound is available.", + "type": "List[FormatLangPair]" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_8_0/applications.json b/codegen3/resources/ari_1_8_0/applications.json new file mode 100644 index 00000000..446dfddc --- /dev/null +++ b/codegen3/resources/ari_1_8_0/applications.json @@ -0,0 +1,172 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.8.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/applications.{format}", + "apis": [ + { + "path": "/applications", + "description": "Stasis applications", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all applications.", + "nickname": "list", + "responseClass": "List[Application]" + } + ] + }, + { + "path": "/applications/{applicationName}", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get details of an application.", + "nickname": "get", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + } + ] + } + ] + }, + { + "path": "/applications/{applicationName}/subscription", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "POST", + "summary": "Subscribe an application to a event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "subscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unsubscribe an application from an event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "unsubscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter; event source scheme not recognized." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 409, + "reason": "Application not subscribed to event source." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + } + ] + } + ], + "models": { + "Application": { + "id": "Application", + "description": "Details of a Stasis application", + "properties": { + "name": { + "type": "string", + "description": "Name of this application", + "required": true + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's for channels subscribed to.", + "required": true + }, + "bridge_ids": { + "type": "List[string]", + "description": "Id's for bridges subscribed to.", + "required": true + }, + "endpoint_ids": { + "type": "List[string]", + "description": "{tech}/{resource} for endpoints subscribed to.", + "required": true + }, + "device_names": { + "type": "List[string]", + "description": "Names of the devices subscribed to.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_8_0/asterisk.json b/codegen3/resources/ari_1_8_0/asterisk.json new file mode 100644 index 00000000..cc1e3b82 --- /dev/null +++ b/codegen3/resources/ari_1_8_0/asterisk.json @@ -0,0 +1,564 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.8.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/asterisk.{format}", + "apis": [ + { + "path": "/asterisk/config/dynamic/{configClass}/{objectType}/{id}", + "description": "Asterisk dynamic configuration", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve a dynamic configuration object.", + "nickname": "getObject", + "responseClass": "List[ConfigTuple]", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to retrieve.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to retrieve.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "{configClass|objectType|id} not found" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Create or update a dynamic configuration object.", + "nickname": "updateObject", + "responseClass": "List[ConfigTuple]", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to create or update.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to create or update.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "fields", + "description": "The body object should have a value that is a list of ConfigTuples, which provide the fields to update. Ex. [ { \"attribute\": \"directmedia\", \"value\": \"false\" } ]", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Bad request body" + }, + { + "code": 403, + "reason": "Could not create or update object" + }, + { + "code": 404, + "reason": "{configClass|objectType} not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete a dynamic configuration object.", + "nickname": "deleteObject", + "responseClass": "void", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to delete.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to delete.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 403, + "reason": "Could not delete object" + }, + { + "code": 404, + "reason": "{configClass|objectType|id} not found" + } + ] + } + ] + }, + { + "path": "/asterisk/info", + "description": "Asterisk system information (similar to core show settings)", + "operations": [ + { + "httpMethod": "GET", + "summary": "Gets Asterisk system information.", + "nickname": "getInfo", + "responseClass": "AsteriskInfo", + "parameters": [ + { + "name": "only", + "description": "Filter information returned", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "build", + "system", + "config", + "status" + ] + } + } + ] + } + ] + }, + { + "path": "/asterisk/modules", + "description": "Asterisk modules", + "operations": [ + { + "httpMethod": "GET", + "summary": "List Asterisk modules.", + "nickname": "listModules", + "responseClass": "List[Module]" + } + ] + }, + { + "path": "/asterisk/modules/{moduleName}", + "description": "Asterisk module", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get Asterisk module information.", + "nickname": "getModule", + "responseClass": "Module", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module could not be found in running modules." + }, + { + "code": 409, + "reason": "Module information could not be retrieved." + } + ] + }, + { + "httpMethod": "POST", + "summary": "Load an Asterisk module.", + "nickname": "loadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Module could not be loaded." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unload an Asterisk module.", + "nickname": "unloadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module not found in running modules." + }, + { + "code": 409, + "reason": "Module could not be unloaded." + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Reload an Asterisk module.", + "nickname": "reloadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module not found in running modules." + }, + { + "code": 409, + "reason": "Module could not be reloaded." + } + ] + } + ] + }, + { + "path": "/asterisk/variable", + "description": "Global variables", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a global variable.", + "nickname": "getGlobalVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "variable", + "description": "The variable to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a global variable.", + "nickname": "setGlobalVar", + "responseClass": "void", + "parameters": [ + { + "name": "variable", + "description": "The variable to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + } + ] + } + ], + "models": { + "BuildInfo": { + "id": "BuildInfo", + "description": "Info about how Asterisk was built", + "properties": { + "os": { + "required": true, + "type": "string", + "description": "OS Asterisk was built on." + }, + "kernel": { + "required": true, + "type": "string", + "description": "Kernel version Asterisk was built on." + }, + "options": { + "required": true, + "type": "string", + "description": "Compile time options, or empty string if default." + }, + "machine": { + "required": true, + "type": "string", + "description": "Machine architecture (x86_64, i686, ppc, etc.)" + }, + "date": { + "required": true, + "type": "string", + "description": "Date and time when Asterisk was built." + }, + "user": { + "required": true, + "type": "string", + "description": "Username that build Asterisk" + } + } + }, + "SystemInfo": { + "id": "SystemInfo", + "description": "Info about Asterisk", + "properties": { + "version": { + "required": true, + "type": "string", + "description": "Asterisk version." + }, + "entity_id": { + "required": true, + "type": "string", + "description": "" + } + } + }, + "SetId": { + "id": "SetId", + "description": "Effective user/group id", + "properties": { + "user": { + "required": true, + "type": "string", + "description": "Effective user id." + }, + "group": { + "required": true, + "type": "string", + "description": "Effective group id." + } + } + }, + "ConfigInfo": { + "id": "ConfigInfo", + "description": "Info about Asterisk configuration", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Asterisk system name." + }, + "default_language": { + "required": true, + "type": "string", + "description": "Default language for media playback." + }, + "max_channels": { + "required": false, + "type": "int", + "description": "Maximum number of simultaneous channels." + }, + "max_open_files": { + "required": false, + "type": "int", + "description": "Maximum number of open file handles (files, sockets)." + }, + "max_load": { + "required": false, + "type": "double", + "description": "Maximum load avg on system." + }, + "setid": { + "required": true, + "type": "SetId", + "description": "Effective user/group id for running Asterisk." + } + } + }, + "StatusInfo": { + "id": "StatusInfo", + "description": "Info about Asterisk status", + "properties": { + "startup_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was started." + }, + "last_reload_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was last reloaded." + } + } + }, + "AsteriskInfo": { + "id": "AsteriskInfo", + "description": "Asterisk system information", + "properties": { + "build": { + "required": false, + "type": "BuildInfo", + "description": "Info about how Asterisk was built" + }, + "system": { + "required": false, + "type": "SystemInfo", + "description": "Info about the system running Asterisk" + }, + "config": { + "required": false, + "type": "ConfigInfo", + "description": "Info about Asterisk configuration" + }, + "status": { + "required": false, + "type": "StatusInfo", + "description": "Info about Asterisk status" + } + } + }, + "Module": { + "id": "Module", + "description": "Details of an Asterisk module", + "properties": { + "name": { + "type": "string", + "description": "The name of this module", + "required": true + }, + "description": { + "type": "string", + "description": "The description of this module", + "required": true + }, + "use_count": { + "type": "int", + "description": "The number of times this module is being used", + "required": true + }, + "status": { + "type": "string", + "description": "The running status of this module", + "required": true + }, + "support_level": { + "type": "string", + "description": "The support state of this module", + "required": true + } + } + }, + "Variable": { + "id": "Variable", + "description": "The value of a channel variable", + "properties": { + "value": { + "required": true, + "type": "string", + "description": "The value of the variable requested" + } + } + }, + "ConfigTuple": { + "id": "ConfigTuple", + "description": "A key/value pair that makes up part of a configuration object.", + "properties": { + "attribute": { + "required": true, + "type": "string", + "description": "A configuration object attribute." + }, + "value": { + "required": true, + "type": "string", + "description": "The value for the attribute." + } + } + } + } +} diff --git a/codegen3/resources/ari_1_8_0/bridges.json b/codegen3/resources/ari_1_8_0/bridges.json new file mode 100644 index 00000000..4bbbe100 --- /dev/null +++ b/codegen3/resources/ari_1_8_0/bridges.json @@ -0,0 +1,656 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.8.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/bridges.{format}", + "apis": [ + { + "path": "/bridges", + "description": "Active bridges", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active bridges in Asterisk.", + "nickname": "list", + "responseClass": "List[Bridge]" + }, + { + "httpMethod": "POST", + "summary": "Create a new bridge.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "create", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Name to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}", + "description": "Individual bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Create a new bridge or updates an existing one.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "createWithId", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Set the name of the bridge.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "GET", + "summary": "Get bridge details.", + "nickname": "get", + "responseClass": "Bridge", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Shut down a bridge.", + "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", + "nickname": "destroy", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/addChannel", + "description": "Add a channel to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Add a channel to a bridge.", + "nickname": "addChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to add to bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "role", + "description": "Channel's role in the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application; Channel currently recording" + }, + { + "code": 422, + "reason": "Channel not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/removeChannel", + "description": "Remove a channel from a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Remove a channel from a bridge.", + "nickname": "removeChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to remove from bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in this bridge" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/moh", + "description": "Play music on hold to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a bridge or change the MOH class that is playing.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Channel's id", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a bridge.", + "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play", + "description": "Play media to the participants of a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "playbackId", + "description": "Playback Id.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play/{playbackId}", + "description": "Play media to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + + } + ] + }, + { + "path": "/bridges/{bridgeId}/record", + "description": "Record audio on a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "This records the mixed audio from all channels participating in this bridge.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + } + ], + "models": { + "Bridge": { + "id": "Bridge", + "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for this bridge", + "required": true + }, + "technology": { + "type": "string", + "description": "Name of the current bridging technology", + "required": true + }, + "bridge_type": { + "type": "string", + "description": "Type of bridge technology", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "mixing", + "holding" + ] + } + }, + "bridge_class": { + "type": "string", + "description": "Bridging class", + "required": true + }, + "creator": { + "type": "string", + "description": "Entity that created the bridge", + "required": true + }, + "name": { + "type": "string", + "description": "Name the creator gave the bridge", + "required": true + }, + "channels": { + "type": "List[string]", + "description": "Ids of channels participating in this bridge", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_8_0/channels.json b/codegen3/resources/ari_1_8_0/channels.json new file mode 100644 index 00000000..1b7faf75 --- /dev/null +++ b/codegen3/resources/ari_1_8_0/channels.json @@ -0,0 +1,1550 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.8.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/channels.{format}", + "apis": [ + { + "path": "/channels", + "description": "Active channels", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active channels in Asterisk.", + "nickname": "list", + "responseClass": "List[Channel]" + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originate", + "responseClass": "Channel", + "parameters": [ + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "label", + "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "The unique id of the channel which is originating this one.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + } + ] + }, + { + "path": "/channels/{channelId}", + "description": "Active channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Channel details.", + "nickname": "get", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate with id).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originateWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "label", + "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "The unique id of the channel which is originating this one.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + + }, + { + "httpMethod": "DELETE", + "summary": "Delete (i.e. hangup) a channel.", + "nickname": "hangup", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "reason", + "description": "Reason for hanging up the channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defalutValue": "normal", + "allowableValues": { + "valueType": "LIST", + "values": [ + "normal", + "busy", + "congestion", + "no_answer" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid reason for hangup provided" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/continue", + "description": "Exit application; continue execution in the dialplan", + "operations": [ + { + "httpMethod": "POST", + "summary": "Exit application; continue execution in the dialplan.", + "nickname": "continueInDialplan", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "label", + "description": "The label to continue to - will supersede 'priority' if both are provided.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/redirect", + "description": "Inform the channel that it should redirect itself to a different location. Note that this will almost certainly cause the channel to exit the application.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Redirect the channel to a different location.", + "nickname": "redirect", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "endpoint", + "description": "The endpoint to redirect the channel to", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Endpoint parameter not provided" + }, + { + "code": 404, + "reason": "Channel or endpoint not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 422, + "reason": "Endpoint is not the same type as the channel" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/answer", + "description": "Answer a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Answer a channel.", + "nickname": "answer", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/ring", + "description": "Send a ringing indication to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Indicate ringing to a channel.", + "nickname": "ring", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop ringing indication on a channel if locally generated.", + "nickname": "ringStop", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/dtmf", + "description": "Send DTMF to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Send provided DTMF to a given channel.", + "nickname": "sendDTMF", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "dtmf", + "description": "DTMF To send.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "before", + "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + }, + { + "name": "between", + "description": "Amount of time in between DTMF digits (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "duration", + "description": "Length of each DTMF digit (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "after", + "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "DTMF is required" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/mute", + "description": "Mute a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a channel.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to mute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a channel.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to unmute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/hold", + "description": "Put a channel on hold", + "operations": [ + { + "httpMethod": "POST", + "summary": "Hold a channel.", + "nickname": "hold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Remove a channel from hold.", + "nickname": "unhold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/moh", + "description": "Play music on hold to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a channel.", + "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Music on hold class to use", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a channel.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/silence", + "description": "Play silence to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play silence to a channel.", + "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", + "nickname": "startSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing silence to a channel.", + "nickname": "stopSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play/{playbackId}", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media and specify the playbackId.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/record", + "description": "Record audio from a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/variable", + "description": "Variables on a channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a channel variable or function.", + "nickname": "getChannelVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel or variable not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a channel variable or function.", + "nickname": "setChannelVar", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannel", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop/{snoopId}", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannelWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + } + ], + "models": { + "Dialed": { + "id": "Dialed", + "description": "Dialed channel information.", + "properties": {} + }, + "DialplanCEP": { + "id": "DialplanCEP", + "description": "Dialplan location (context/extension/priority)", + "properties": { + "context": { + "required": true, + "type": "string", + "description": "Context in the dialplan" + }, + "exten": { + "required": true, + "type": "string", + "description": "Extension in the dialplan" + }, + "priority": { + "required": true, + "type": "long", + "description": "Priority in the dialplan" + } + } + }, + "CallerID": { + "id": "CallerID", + "description": "Caller identification", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "number": { + "required": true, + "type": "string" + } + } + }, + "Channel": { + "id": "Channel", + "description": "A specific communication connection between Asterisk and an Endpoint.", + "properties": { + "id": { + "required": true, + "type": "string", + "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI." + }, + "name": { + "required": true, + "type": "string", + "description": "Name of the channel (i.e. SIP/foo-0000a7e3)" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "Down", + "Rsrved", + "OffHook", + "Dialing", + "Ring", + "Ringing", + "Up", + "Busy", + "Dialing Offhook", + "Pre-ring", + "Unknown" + ] + } + }, + "caller": { + "required": true, + "type": "CallerID" + }, + "connected": { + "required": true, + "type": "CallerID" + }, + "accountcode": { + "required": true, + "type": "string" + }, + "dialplan": { + "required": true, + "type": "DialplanCEP", + "description": "Current location in the dialplan" + }, + "creationtime": { + "required": true, + "type": "Date", + "description": "Timestamp when channel was created" + }, + "language": { + "required": true, + "type": "string", + "description": "The default spoken language" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_8_0/deviceStates.json b/codegen3/resources/ari_1_8_0/deviceStates.json new file mode 100644 index 00000000..fa68dcf2 --- /dev/null +++ b/codegen3/resources/ari_1_8_0/deviceStates.json @@ -0,0 +1,151 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "Kevin Harwell ", + "_svn_revision": "$Revision$", + "apiVersion": "1.8.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/deviceStates.{format}", + "apis": [ + { + "path": "/deviceStates", + "description": "Device states", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all ARI controlled device states.", + "nickname": "list", + "responseClass": "List[DeviceState]" + } + ] + }, + { + "path": "/deviceStates/{deviceName}", + "description": "Device state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a device.", + "nickname": "get", + "responseClass": "DeviceState", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "deviceState", + "description": "Device state value", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a device-state controlled by ARI.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + } + ] + } + ], + "models": { + "DeviceState": { + "id": "DeviceState", + "description": "Represents the state of a device.", + "properties": { + "name": { + "type": "string", + "description": "Name of the device.", + "required": true + }, + "state": { + "type": "string", + "description": "Device's state", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "UNKNOWN", + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_8_0/endpoints.json b/codegen3/resources/ari_1_8_0/endpoints.json new file mode 100644 index 00000000..73467731 --- /dev/null +++ b/codegen3/resources/ari_1_8_0/endpoints.json @@ -0,0 +1,279 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.8.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/endpoints.{format}", + "apis": [ + { + "path": "/endpoints", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all endpoints.", + "nickname": "list", + "responseClass": "List[Endpoint]" + } + ] + }, + { + "path": "/endpoints/sendMessage", + "description": "Send a message to some technology URI or endpoint.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some technology URI or endpoint.", + "nickname": "sendMessage", + "responseClass": "void", + "parameters": [ + { + "name": "to", + "description": "The endpoint resource or technology specific URI to send the message to. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List available endoints for a given endpoint technology.", + "nickname": "listByTech", + "responseClass": "List[Endpoint]", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoints (sip,iax2,...)", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}", + "description": "Single endpoint", + "operations": [ + { + "httpMethod": "GET", + "summary": "Details for an endpoint.", + "nickname": "get", + "responseClass": "Endpoint", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}/sendMessage", + "description": "Send a message to some endpoint in a technology.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some endpoint in a technology.", + "nickname": "sendMessageToEndpoint", + "responseClass": "void", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + } + ], + "models": { + "Endpoint": { + "id": "Endpoint", + "description": "An external device that may offer/accept calls to/from Asterisk.\n\nUnlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.", + "properties": { + "technology": { + "type": "string", + "description": "Technology of the endpoint", + "required": true + }, + "resource": { + "type": "string", + "description": "Identifier of the endpoint, specific to the given technology.", + "required": true + }, + "state": { + "type": "string", + "description": "Endpoint's state", + "required": false, + "allowableValues": { + "valueType": "LIST", + "values": [ + "unknown", + "offline", + "online" + ] + } + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's of channels associated with this endpoint", + "required": true + } + } + }, + "TextMessageVariable": { + "id": "TextMessageVariable", + "description": "A key/value pair variable in a text message.", + "properties": { + "key": { + "type": "string", + "description": "A unique key identifying the variable.", + "required": true + }, + "value": { + "type": "string", + "description": "The value of the variable.", + "required": true + } + } + }, + "TextMessage": { + "id": "TextMessage", + "description": "A text message.", + "properties": { + "from": { + "type": "string", + "description": "A technology specific URI specifying the source of the message. For sip and pjsip technologies, any SIP URI can be specified. For xmpp, the URI must correspond to the client connection being used to send the message.", + "required": true + }, + "to": { + "type": "string", + "description": "A technology specific URI specifying the destination of the message. Valid technologies include sip, pjsip, and xmp. The destination of a message should be an endpoint.", + "required": true + }, + "body": { + "type": "string", + "description": "The text of the message.", + "required": true + }, + "variables": { + "type": "List[TextMessageVariable]", + "description": "Technology specific key/value pairs associated with the message.", + "required": false + } + } + } + } +} diff --git a/codegen3/resources/ari_1_8_0/events.json b/codegen3/resources/ari_1_8_0/events.json new file mode 100644 index 00000000..8d74900f --- /dev/null +++ b/codegen3/resources/ari_1_8_0/events.json @@ -0,0 +1,758 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.8.0", + "swaggerVersion": "1.2", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/events.{format}", + "apis": [ + { + "path": "/events", + "description": "Events from Asterisk to applications", + "operations": [ + { + "httpMethod": "GET", + "upgrade": "websocket", + "websocketProtocol": "ari", + "summary": "WebSocket connection for events.", + "nickname": "eventWebsocket", + "responseClass": "Message", + "parameters": [ + { + "name": "app", + "description": "Applications to subscribe to.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ] + } + ] + }, + { + "path": "/events/user/{eventName}", + "description": "Stasis application user events", + "operations": [ + { + "httpMethod": "POST", + "summary": "Generate a user event.", + "nickname": "userEvent", + "responseClass": "void", + "parameters": [ + { + "name": "eventName", + "description": "Event name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "application", + "description": "The name of the application that will receive this event", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "source", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds custom key/value pairs to add to the user event. Ex. { \"variables\": { \"key\": \"value\" } }", + "paramType": "body", + "required": false, + "allowMultiple": false, + "dataType": "containers" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source not found." + }, + { + "code": 400, + "reason": "Invalid even tsource URI or userevent data." + } + ] + } + ] + } + ], + "models": { + "Message": { + "id": "Message", + "description": "Base type for errors and events", + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "required": true, + "description": "Indicates the type of this message." + } + }, + "subTypes": [ + "MissingParams", + "Event" + ] + }, + "MissingParams": { + "id": "MissingParams", + "description": "Error event sent when required params are missing.", + "properties": { + "params": { + "required": true, + "type": "List[string]", + "description": "A list of the missing parameters" + } + } + }, + "Event": { + "id": "Event", + "description": "Base type for asynchronous events from Asterisk.", + "properties": { + "application": { + "type": "string", + "description": "Name of the application receiving the event.", + "required": true + }, + "timestamp": { + "type": "Date", + "description": "Time at which this event was created.", + "required": false + } + }, + "subTypes": [ + "DeviceStateChanged", + "PlaybackStarted", + "PlaybackFinished", + "RecordingStarted", + "RecordingFinished", + "RecordingFailed", + "ApplicationReplaced", + "BridgeCreated", + "BridgeDestroyed", + "BridgeMerged", + "BridgeBlindTransfer", + "BridgeAttendedTransfer", + "ChannelCreated", + "ChannelDestroyed", + "ChannelEnteredBridge", + "ChannelLeftBridge", + "ChannelStateChange", + "ChannelDtmfReceived", + "ChannelDialplan", + "ChannelCallerId", + "ChannelUserevent", + "ChannelHangupRequest", + "ChannelVarset", + "ChannelTalkingStarted", + "ChannelTalkingFinished", + "ChannelHold", + "ChannelUnhold", + "EndpointStateChange", + "Dial", + "StasisEnd", + "StasisStart", + "TextMessageReceived", + "ChannelConnectedLine" + ] + }, + "DeviceStateChanged": { + "id": "DeviceStateChanged", + "description": "Notification that a device state has changed.", + "properties": { + "device_state": { + "type": "DeviceState", + "description": "Device state object", + "required": true + } + } + }, + "PlaybackStarted": { + "id": "PlaybackStarted", + "description": "Event showing the start of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "PlaybackFinished": { + "id": "PlaybackFinished", + "description": "Event showing the completion of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "RecordingStarted": { + "id": "RecordingStarted", + "description": "Event showing the start of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFinished": { + "id": "RecordingFinished", + "description": "Event showing the completion of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFailed": { + "id": "RecordingFailed", + "description": "Event showing failure of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "ApplicationReplaced": { + "id": "ApplicationReplaced", + "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": {} + }, + "BridgeCreated": { + "id": "BridgeCreated", + "description": "Notification that a bridge has been created.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeDestroyed": { + "id": "BridgeDestroyed", + "description": "Notification that a bridge has been destroyed.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeMerged": { + "id": "BridgeMerged", + "description": "Notification that one bridge has merged into another.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "bridge_from": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeBlindTransfer": { + "id": "BridgeBlindTransfer", + "description": "Notification that a blind transfer has occurred.", + "properties": { + "channel": { + "description": "The channel performing the blind transfer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer when the transferee(s) can not be transferred directly", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "exten": { + "description": "The extension transferred to", + "required": true, + "type": "string" + }, + "context": { + "description": "The context transferred to", + "required": true, + "type": "string" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "bridge": { + "description": "The bridge being transferred", + "type": "Bridge" + } + } + }, + "BridgeAttendedTransfer": { + "id": "BridgeAttendedTransfer", + "description": "Notification that an attended transfer has occurred.", + "properties": { + "transferer_first_leg": { + "description": "First leg of the transferer", + "required": true, + "type": "Channel" + }, + "transferer_second_leg": { + "description": "Second leg of the transferer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer_first_leg in the swap", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "transfer_target": { + "description": "The channel that is being transferred to", + "required": false, + "type": "Channel" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "transferer_first_leg_bridge": { + "description": "Bridge the transferer first leg is in", + "type": "Bridge" + }, + "transferer_second_leg_bridge": { + "description": "Bridge the transferer second leg is in", + "type": "Bridge" + }, + "destination_type": { + "description": "How the transfer was accomplished", + "required": true, + "type": "string" + }, + "destination_bridge": { + "description": "Bridge that survived the merge result", + "type": "string" + }, + "destination_application": { + "description": "Application that has been transferred into", + "type": "string" + }, + "destination_link_first_leg": { + "description": "First leg of a link transfer result", + "type": "Channel" + }, + "destination_link_second_leg": { + "description": "Second leg of a link transfer result", + "type": "Channel" + }, + "destination_threeway_channel": { + "description": "Transferer channel that survived the threeway result", + "type": "Channel" + }, + "destination_threeway_bridge": { + "description": "Bridge that survived the threeway result", + "type": "Bridge" + } + } + }, + "ChannelCreated": { + "id": "ChannelCreated", + "description": "Notification that a channel has been created.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDestroyed": { + "id": "ChannelDestroyed", + "description": "Notification that a channel has been destroyed.", + "properties": { + "cause": { + "required": true, + "description": "Integer representation of the cause of the hangup", + "type": "int" + }, + "cause_txt": { + "required": true, + "description": "Text representation of the cause of the hangup", + "type": "string" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelEnteredBridge": { + "id": "ChannelEnteredBridge", + "description": "Notification that a channel has entered a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "type": "Channel" + } + } + }, + "ChannelLeftBridge": { + "id": "ChannelLeftBridge", + "description": "Notification that a channel has left a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelStateChange": { + "id": "ChannelStateChange", + "description": "Notification of a channel's state change.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDtmfReceived": { + "id": "ChannelDtmfReceived", + "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, + "type": "string", + "description": "DTMF digit received (0-9, A-E, # or *)" + }, + "duration_ms": { + "required": true, + "type": "int", + "description": "Number of milliseconds DTMF was received" + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which DTMF was received" + } + } + }, + "ChannelDialplan": { + "id": "ChannelDialplan", + "description": "Channel changed location in the dialplan.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed dialplan location." + }, + "dialplan_app": { + "required": true, + "type": "string", + "description": "The application about to be executed." + }, + "dialplan_app_data": { + "required": true, + "type": "string", + "description": "The data to be passed to the application." + } + } + }, + "ChannelCallerId": { + "id": "ChannelCallerId", + "description": "Channel changed Caller ID.", + "properties": { + "caller_presentation": { + "required": true, + "type": "int", + "description": "The integer representation of the Caller Presentation value." + }, + "caller_presentation_txt": { + "required": true, + "type": "string", + "description": "The text representation of the Caller Presentation value." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed Caller ID." + } + } + }, + "ChannelUserevent": { + "id": "ChannelUserevent", + "description": "User-generated event with additional user-defined fields in the object.", + "properties": { + "eventname": { + "required": true, + "type": "string", + "description": "The name of the user event." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "A channel that is signaled with the user event." + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "A bridge that is signaled with the user event." + }, + "endpoint": { + "required": false, + "type": "Endpoint", + "description": "A endpoint that is signaled with the user event." + }, + "userevent": { + "required": true, + "type": "object", + "description": "Custom Userevent data" + } + } + }, + "ChannelHangupRequest": { + "id": "ChannelHangupRequest", + "description": "A hangup was requested on the channel.", + "properties": { + "cause": { + "type": "int", + "description": "Integer representation of the cause of the hangup." + }, + "soft": { + "type": "boolean", + "description": "Whether the hangup request was a soft hangup request." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the hangup was requested." + } + } + }, + "ChannelVarset": { + "id": "ChannelVarset", + "description": "Channel variable changed.", + "properties": { + "variable": { + "required": true, + "type": "string", + "description": "The variable that changed." + }, + "value": { + "required": true, + "type": "string", + "description": "The new value of the variable." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable." + } + } + }, + "ChannelHold": { + "id": "ChannelHold", + "description": "A channel initiated a media hold.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that initiated the hold event." + }, + "musicclass": { + "required": false, + "type": "string", + "description": "The music on hold class that the initiator requested." + } + } + }, + "ChannelUnhold": { + "id": "ChannelUnhold", + "description": "A channel initiated a media unhold.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that initiated the unhold event." + } + } + }, + "ChannelTalkingStarted": { + "id": "ChannelTalkingStarted", + "description": "Talking was detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking started." + } + } + }, + "ChannelTalkingFinished": { + "id": "ChannelTalkingFinished", + "description": "Talking is no longer detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking completed." + }, + "duration": { + "required": true, + "type": "int", + "description": "The length of time, in milliseconds, that talking was detected on the channel" + } + } + }, + "EndpointStateChange": { + "id": "EndpointStateChange", + "description": "Endpoint state changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + } + } + }, + "Dial": { + "id": "Dial", + "description": "Dialing state has changed.", + "properties": { + "caller": { + "required": false, + "type": "Channel", + "description": "The calling channel." + }, + "peer": { + "required": true, + "type": "Channel", + "description": "The dialed channel." + }, + "forward": { + "required": false, + "type": "string", + "description": "Forwarding target requested by the original dialed channel." + }, + "forwarded": { + "required": false, + "type": "Channel", + "description": "Channel that the caller has been forwarded to." + }, + "dialstring": { + "required": false, + "type": "string", + "description": "The dial string for calling the peer channel." + }, + "dialstatus": { + "required": true, + "type": "string", + "description": "Current status of the dialing attempt to the peer." + } + } + }, + "StasisEnd": { + "id": "StasisEnd", + "description": "Notification that a channel has left a Stasis application.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "StasisStart": { + "id": "StasisStart", + "description": "Notification that a channel has entered a Stasis application.", + "properties": { + "args": { + "required": true, + "type": "List[string]", + "description": "Arguments to the application" + }, + "channel": { + "required": true, + "type": "Channel" + }, + "replace_channel": { + "required": false, + "type": "Channel" + } + } + }, + "TextMessageReceived": { + "id": "TextMessageReceived", + "description": "A text message was received from an endpoint.", + "properties": { + "message": { + "required": true, + "type": "TextMessage" + }, + "endpoint": { + "required": false, + "type": "Endpoint" + } + } + }, + "ChannelConnectedLine": { + "id": "ChannelConnectedLine", + "description": "Channel changed Connected Line.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel whose connected line has changed." + } + } + } + } +} diff --git a/codegen3/resources/ari_1_8_0/mailboxes.json b/codegen3/resources/ari_1_8_0/mailboxes.json new file mode 100644 index 00000000..12b8832d --- /dev/null +++ b/codegen3/resources/ari_1_8_0/mailboxes.json @@ -0,0 +1,134 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "Jonathan Rose ", + "_svn_revision": "$Revision$", + "apiVersion": "1.8.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/mailboxes.{format}", + "apis": [ + { + "path": "/mailboxes", + "description": "Mailboxes", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all mailboxes.", + "nickname": "list", + "responseClass": "List[Mailbox]" + } + ] + }, + { + "path": "/mailboxes/{mailboxName}", + "description": "Mailbox state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a mailbox.", + "nickname": "get", + "responseClass": "Mailbox", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a mailbox. (Note - implicitly creates the mailbox).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "oldMessages", + "description": "Count of old messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "newMessages", + "description": "Count of new messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a mailbox.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + } + ] + } + ], + "models": { + "Mailbox": { + "id": "Mailbox", + "description": "Represents the state of a mailbox.", + "properties": { + "name": { + "type": "string", + "description": "Name of the mailbox.", + "required": true + }, + "old_messages": { + "type": "int", + "description": "Count of old messages in the mailbox.", + "required": true + }, + "new_messages": { + "type": "int", + "description": "Count of new messages in the mailbox.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_8_0/playbacks.json b/codegen3/resources/ari_1_8_0/playbacks.json new file mode 100644 index 00000000..d9683801 --- /dev/null +++ b/codegen3/resources/ari_1_8_0/playbacks.json @@ -0,0 +1,155 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.8.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/playbacks.{format}", + "apis": [ + { + "path": "/playbacks/{playbackId}", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a playback's details.", + "nickname": "get", + "responseClass": "Playback", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a playback.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + } + ] + }, + { + "path": "/playbacks/{playbackId}/control", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Control a playback.", + "nickname": "control", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "operation", + "description": "Operation to perform on the playback.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "restart", + "pause", + "unpause", + "reverse", + "forward" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "The provided operation parameter was invalid" + }, + { + "code": 404, + "reason": "The playback cannot be found" + }, + { + "code": 409, + "reason": "The operation cannot be performed in the playback's current state" + } +] + } + ] + } + ], + "models": { + "Playback": { + "id": "Playback", + "description": "Object representing the playback of media to a channel", + "properties": { + "id": { + "type": "string", + "description": "ID for this playback operation", + "required": true + }, + "media_uri": { + "type": "string", + "description": "URI for the media to play back.", + "required": true + }, + "target_uri": { + "type": "string", + "description": "URI for the channel or bridge to play the media on", + "required": true + }, + "language": { + "type": "string", + "description": "For media types that support multiple languages, the language requested for playback." + }, + "state": { + "type": "string", + "description": "Current state of the playback operation.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "playing", + "complete" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_8_0/recordings.json b/codegen3/resources/ari_1_8_0/recordings.json new file mode 100644 index 00000000..8686e882 --- /dev/null +++ b/codegen3/resources/ari_1_8_0/recordings.json @@ -0,0 +1,378 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.8.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/recordings.{format}", + "apis": [ + { + "path": "/recordings/stored", + "description": "Recordings", + "operations": [ + { + "httpMethod": "GET", + "summary": "List recordings that are complete.", + "nickname": "listStored", + "responseClass": "List[StoredRecording]" + } + ] + }, + { + "path": "/recordings/stored/{recordingName}", + "description": "Individual recording", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a stored recording's details.", + "nickname": "getStored", + "responseClass": "StoredRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete a stored recording.", + "nickname": "deleteStored", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "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" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}", + "description": "A recording that is in progress", + "operations": [ + { + "httpMethod": "GET", + "summary": "List live recordings.", + "nickname": "getLive", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a live recording and discard it.", + "nickname": "cancel", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/stop", + "operations": [ + { + "httpMethod": "POST", + "summary": "Stop a live recording and store it.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/pause", + "operations": [ + { + "httpMethod": "POST", + "summary": "Pause a live recording.", + "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.", + "nickname": "pause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unpause a live recording.", + "nickname": "unpause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/mute", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a live recording.", + "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a live recording.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + } + ], + "models": { + "StoredRecording": { + "id": "StoredRecording", + "description": "A past recording that may be played back.", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "LiveRecording": { + "id": "LiveRecording", + "description": "A recording that is in progress", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Base name for the recording" + }, + "format": { + "required": true, + "type": "string", + "description": "Recording format (wav, gsm, etc.)" + }, + "target_uri": { + "required": true, + "type": "string", + "description": "URI for the channel or bridge being recorded" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "recording", + "paused", + "done", + "failed", + "canceled" + ] + } + }, + "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." + }, + "cause": { + "required": false, + "type": "string", + "description": "Cause for recording failure if failed" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_8_0/sounds.json b/codegen3/resources/ari_1_8_0/sounds.json new file mode 100644 index 00000000..4cfa7ed4 --- /dev/null +++ b/codegen3/resources/ari_1_8_0/sounds.json @@ -0,0 +1,99 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.8.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/sounds.{format}", + "apis": [ + { + "path": "/sounds", + "description": "Sounds", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all sounds.", + "nickname": "list", + "responseClass": "List[Sound]", + "parameters": [ + { + "name": "lang", + "description": "Lookup sound for a specific language.", + "paramType": "query", + "dataType": "string", + "required": false + }, + { + "name": "format", + "description": "Lookup sound in a specific format.", + "paramType": "query", + "dataType": "string", + "required": false, + "__note": "core show translation can show translation paths between formats, along with relative costs. so this could be just installed format, or we could follow that for transcoded formats." + } + ] + } + ] + }, + { + "path": "/sounds/{soundId}", + "description": "Individual sound", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a sound's details.", + "nickname": "get", + "responseClass": "Sound", + "parameters": [ + { + "name": "soundId", + "description": "Sound's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + } + ], + "models": { + "FormatLangPair": { + "id": "FormatLangPair", + "description": "Identifies the format and language of a sound file", + "properties": { + "language": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "Sound": { + "id": "Sound", + "description": "A media file that may be played back.", + "properties": { + "id": { + "required": true, + "description": "Sound's identifier.", + "type": "string" + }, + "text": { + "required": false, + "description": "Text description of the sound, usually the words spoken.", + "type": "string" + }, + "formats": { + "required": true, + "description": "The formats and languages in which this sound is available.", + "type": "List[FormatLangPair]" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_9_0/applications.json b/codegen3/resources/ari_1_9_0/applications.json new file mode 100644 index 00000000..c8660cfc --- /dev/null +++ b/codegen3/resources/ari_1_9_0/applications.json @@ -0,0 +1,172 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.9.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/applications.{format}", + "apis": [ + { + "path": "/applications", + "description": "Stasis applications", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all applications.", + "nickname": "list", + "responseClass": "List[Application]" + } + ] + }, + { + "path": "/applications/{applicationName}", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get details of an application.", + "nickname": "get", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + } + ] + } + ] + }, + { + "path": "/applications/{applicationName}/subscription", + "description": "Stasis application", + "operations": [ + { + "httpMethod": "POST", + "summary": "Subscribe an application to a event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "subscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unsubscribe an application from an event source.", + "notes": "Returns the state of the application after the subscriptions have changed", + "nickname": "unsubscribe", + "responseClass": "Application", + "parameters": [ + { + "name": "applicationName", + "description": "Application's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "eventSource", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}[/{resource}], deviceState:{deviceName}", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing parameter; event source scheme not recognized." + }, + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 409, + "reason": "Application not subscribed to event source." + }, + { + "code": 422, + "reason": "Event source does not exist." + } + ] + } + ] + } + ], + "models": { + "Application": { + "id": "Application", + "description": "Details of a Stasis application", + "properties": { + "name": { + "type": "string", + "description": "Name of this application", + "required": true + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's for channels subscribed to.", + "required": true + }, + "bridge_ids": { + "type": "List[string]", + "description": "Id's for bridges subscribed to.", + "required": true + }, + "endpoint_ids": { + "type": "List[string]", + "description": "{tech}/{resource} for endpoints subscribed to.", + "required": true + }, + "device_names": { + "type": "List[string]", + "description": "Names of the devices subscribed to.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_9_0/asterisk.json b/codegen3/resources/ari_1_9_0/asterisk.json new file mode 100644 index 00000000..9dbf3822 --- /dev/null +++ b/codegen3/resources/ari_1_9_0/asterisk.json @@ -0,0 +1,692 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.9.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/asterisk.{format}", + "apis": [ + { + "path": "/asterisk/config/dynamic/{configClass}/{objectType}/{id}", + "description": "Asterisk dynamic configuration", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve a dynamic configuration object.", + "nickname": "getObject", + "responseClass": "List[ConfigTuple]", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to retrieve.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to retrieve.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "{configClass|objectType|id} not found" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Create or update a dynamic configuration object.", + "nickname": "updateObject", + "responseClass": "List[ConfigTuple]", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to create or update.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to create or update.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "fields", + "description": "The body object should have a value that is a list of ConfigTuples, which provide the fields to update. Ex. [ { \"attribute\": \"directmedia\", \"value\": \"false\" } ]", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Bad request body" + }, + { + "code": 403, + "reason": "Could not create or update object" + }, + { + "code": 404, + "reason": "{configClass|objectType} not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete a dynamic configuration object.", + "nickname": "deleteObject", + "responseClass": "void", + "parameters": [ + { + "name": "configClass", + "description": "The configuration class containing dynamic configuration objects.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "objectType", + "description": "The type of configuration object to delete.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "id", + "description": "The unique identifier of the object to delete.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 403, + "reason": "Could not delete object" + }, + { + "code": 404, + "reason": "{configClass|objectType|id} not found" + } + ] + } + ] + }, + { + "path": "/asterisk/info", + "description": "Asterisk system information (similar to core show settings)", + "operations": [ + { + "httpMethod": "GET", + "summary": "Gets Asterisk system information.", + "nickname": "getInfo", + "responseClass": "AsteriskInfo", + "parameters": [ + { + "name": "only", + "description": "Filter information returned", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "build", + "system", + "config", + "status" + ] + } + } + ] + } + ] + }, + { + "path": "/asterisk/modules", + "description": "Asterisk modules", + "operations": [ + { + "httpMethod": "GET", + "summary": "List Asterisk modules.", + "nickname": "listModules", + "responseClass": "List[Module]" + } + ] + }, + { + "path": "/asterisk/modules/{moduleName}", + "description": "Asterisk module", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get Asterisk module information.", + "nickname": "getModule", + "responseClass": "Module", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module could not be found in running modules." + }, + { + "code": 409, + "reason": "Module information could not be retrieved." + } + ] + }, + { + "httpMethod": "POST", + "summary": "Load an Asterisk module.", + "nickname": "loadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 409, + "reason": "Module could not be loaded." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unload an Asterisk module.", + "nickname": "unloadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module not found in running modules." + }, + { + "code": 409, + "reason": "Module could not be unloaded." + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Reload an Asterisk module.", + "nickname": "reloadModule", + "responseClass": "void", + "parameters": [ + { + "name": "moduleName", + "description": "Module's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Module not found in running modules." + }, + { + "code": 409, + "reason": "Module could not be reloaded." + } + ] + } + ] + }, + { + "path": "/asterisk/logging", + "description": "Asterisk log channels", + "operations": [ + { + "httpMethod": "GET", + "summary": "Gets Asterisk log channel information.", + "nickname": "listLogChannels", + "responseClass": "List[LogChannel]" + } + ] + }, + { + "path": "/asterisk/logging/{logChannelName}", + "description": "Asterisk log channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Adds a log channel.", + "nickname": "addLog", + "responseClass": "void", + "parameters": [ + { + "name": "logChannelName", + "description": "The log channel to add", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "configuration", + "description": "levels of the log channel", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Bad request body" + }, + { + "code": 409, + "reason": "Log channel could not be created." + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Deletes a log channel.", + "nickname": "deleteLog", + "responseClass": "void", + "parameters": [ + { + "name": "logChannelName", + "description": "Log channels name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Log channel does not exist." + } + ] + } + ] + }, + { + "path": "/asterisk/logging/{logChannelName}/rotate", + "description": "Asterisk log channel", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Rotates a log channel.", + "nickname": "rotateLog", + "responseClass": "void", + "parameters": [ + { + "name": "logChannelName", + "description": "Log channel's name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Log channel does not exist." + } + ] + } + ] + }, + { + "path": "/asterisk/variable", + "description": "Global variables", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a global variable.", + "nickname": "getGlobalVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "variable", + "description": "The variable to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a global variable.", + "nickname": "setGlobalVar", + "responseClass": "void", + "parameters": [ + { + "name": "variable", + "description": "The variable to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + } + ] + } + ] + } + ], + "models": { + "BuildInfo": { + "id": "BuildInfo", + "description": "Info about how Asterisk was built", + "properties": { + "os": { + "required": true, + "type": "string", + "description": "OS Asterisk was built on." + }, + "kernel": { + "required": true, + "type": "string", + "description": "Kernel version Asterisk was built on." + }, + "options": { + "required": true, + "type": "string", + "description": "Compile time options, or empty string if default." + }, + "machine": { + "required": true, + "type": "string", + "description": "Machine architecture (x86_64, i686, ppc, etc.)" + }, + "date": { + "required": true, + "type": "string", + "description": "Date and time when Asterisk was built." + }, + "user": { + "required": true, + "type": "string", + "description": "Username that build Asterisk" + } + } + }, + "SystemInfo": { + "id": "SystemInfo", + "description": "Info about Asterisk", + "properties": { + "version": { + "required": true, + "type": "string", + "description": "Asterisk version." + }, + "entity_id": { + "required": true, + "type": "string", + "description": "" + } + } + }, + "SetId": { + "id": "SetId", + "description": "Effective user/group id", + "properties": { + "user": { + "required": true, + "type": "string", + "description": "Effective user id." + }, + "group": { + "required": true, + "type": "string", + "description": "Effective group id." + } + } + }, + "ConfigInfo": { + "id": "ConfigInfo", + "description": "Info about Asterisk configuration", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Asterisk system name." + }, + "default_language": { + "required": true, + "type": "string", + "description": "Default language for media playback." + }, + "max_channels": { + "required": false, + "type": "int", + "description": "Maximum number of simultaneous channels." + }, + "max_open_files": { + "required": false, + "type": "int", + "description": "Maximum number of open file handles (files, sockets)." + }, + "max_load": { + "required": false, + "type": "double", + "description": "Maximum load avg on system." + }, + "setid": { + "required": true, + "type": "SetId", + "description": "Effective user/group id for running Asterisk." + } + } + }, + "StatusInfo": { + "id": "StatusInfo", + "description": "Info about Asterisk status", + "properties": { + "startup_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was started." + }, + "last_reload_time": { + "required": true, + "type": "Date", + "description": "Time when Asterisk was last reloaded." + } + } + }, + "AsteriskInfo": { + "id": "AsteriskInfo", + "description": "Asterisk system information", + "properties": { + "build": { + "required": false, + "type": "BuildInfo", + "description": "Info about how Asterisk was built" + }, + "system": { + "required": false, + "type": "SystemInfo", + "description": "Info about the system running Asterisk" + }, + "config": { + "required": false, + "type": "ConfigInfo", + "description": "Info about Asterisk configuration" + }, + "status": { + "required": false, + "type": "StatusInfo", + "description": "Info about Asterisk status" + } + } + }, + "Module": { + "id": "Module", + "description": "Details of an Asterisk module", + "properties": { + "name": { + "type": "string", + "description": "The name of this module", + "required": true + }, + "description": { + "type": "string", + "description": "The description of this module", + "required": true + }, + "use_count": { + "type": "int", + "description": "The number of times this module is being used", + "required": true + }, + "status": { + "type": "string", + "description": "The running status of this module", + "required": true + }, + "support_level": { + "type": "string", + "description": "The support state of this module", + "required": true + } + } + }, + "LogChannel": { + "id": "LogChannel", + "description": "Details of an Asterisk log channel", + "properties": { + "channel": { + "type": "string", + "description": "The log channel path", + "required": true + }, + "type": { + "type": "string", + "description": "Types of logs for the log channel", + "required": true + }, + "status": { + "type": "string", + "description": "Whether or not a log type is enabled", + "required": true + }, + "configuration": { + "type": "string", + "description": "The various log levels", + "required": true + } + } + }, + "Variable": { + "id": "Variable", + "description": "The value of a channel variable", + "properties": { + "value": { + "required": true, + "type": "string", + "description": "The value of the variable requested" + } + } + }, + "ConfigTuple": { + "id": "ConfigTuple", + "description": "A key/value pair that makes up part of a configuration object.", + "properties": { + "attribute": { + "required": true, + "type": "string", + "description": "A configuration object attribute." + }, + "value": { + "required": true, + "type": "string", + "description": "The value for the attribute." + } + } + } + } +} diff --git a/codegen3/resources/ari_1_9_0/bridges.json b/codegen3/resources/ari_1_9_0/bridges.json new file mode 100644 index 00000000..0e726a53 --- /dev/null +++ b/codegen3/resources/ari_1_9_0/bridges.json @@ -0,0 +1,656 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.9.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/bridges.{format}", + "apis": [ + { + "path": "/bridges", + "description": "Active bridges", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active bridges in Asterisk.", + "nickname": "list", + "responseClass": "List[Bridge]" + }, + { + "httpMethod": "POST", + "summary": "Create a new bridge.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "create", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Name to give to the bridge being created.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}", + "description": "Individual bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Create a new bridge or updates an existing one.", + "notes": "This bridge persists until it has been shut down, or Asterisk has been shut down.", + "nickname": "createWithId", + "responseClass": "Bridge", + "parameters": [ + { + "name": "type", + "description": "Comma separated list of bridge type attributes (mixing, holding, dtmf_events, proxy_media) to set.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "bridgeId", + "description": "Unique ID to give to the bridge being created.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Set the name of the bridge.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "GET", + "summary": "Get bridge details.", + "nickname": "get", + "responseClass": "Bridge", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Shut down a bridge.", + "notes": "If any channels are in this bridge, they will be removed and resume whatever they were doing beforehand.", + "nickname": "destroy", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/addChannel", + "description": "Add a channel to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Add a channel to a bridge.", + "nickname": "addChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to add to bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "role", + "description": "Channel's role in the bridge", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application; Channel currently recording" + }, + { + "code": 422, + "reason": "Channel not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/removeChannel", + "description": "Remove a channel from a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Remove a channel from a bridge.", + "nickname": "removeChannel", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "channel", + "description": "Ids of channels to remove from bridge", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Channel not found" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + }, + { + "code": 422, + "reason": "Channel not in this bridge" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/moh", + "description": "Play music on hold to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a bridge or change the MOH class that is playing.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Channel's id", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a bridge.", + "notes": "This will only stop music on hold being played via POST bridges/{bridgeId}/moh.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play", + "description": "Play media to the participants of a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "playbackId", + "description": "Playback Id.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/bridges/{bridgeId}/play/{playbackId}", + "description": "Play media to a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media on a bridge.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge not in a Stasis application" + } + ] + + } + ] + }, + { + "path": "/bridges/{bridgeId}/record", + "description": "Record audio on a bridge", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "This records the mixed audio from all channels participating in this bridge.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "bridgeId", + "description": "Bridge's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Bridge not found" + }, + { + "code": 409, + "reason": "Bridge is not in a Stasis application; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + } + ], + "models": { + "Bridge": { + "id": "Bridge", + "description": "The merging of media from one or more channels.\n\nEveryone on the bridge receives the same audio.", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for this bridge", + "required": true + }, + "technology": { + "type": "string", + "description": "Name of the current bridging technology", + "required": true + }, + "bridge_type": { + "type": "string", + "description": "Type of bridge technology", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "mixing", + "holding" + ] + } + }, + "bridge_class": { + "type": "string", + "description": "Bridging class", + "required": true + }, + "creator": { + "type": "string", + "description": "Entity that created the bridge", + "required": true + }, + "name": { + "type": "string", + "description": "Name the creator gave the bridge", + "required": true + }, + "channels": { + "type": "List[string]", + "description": "Ids of channels participating in this bridge", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_9_0/channels.json b/codegen3/resources/ari_1_9_0/channels.json new file mode 100644 index 00000000..cb41fb68 --- /dev/null +++ b/codegen3/resources/ari_1_9_0/channels.json @@ -0,0 +1,1550 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.9.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/channels.{format}", + "apis": [ + { + "path": "/channels", + "description": "Active channels", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all active channels in Asterisk.", + "nickname": "list", + "responseClass": "List[Channel]" + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originate", + "responseClass": "Channel", + "parameters": [ + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "label", + "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "The unique id of the channel which is originating this one.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + } + ] + }, + { + "path": "/channels/{channelId}", + "description": "Active channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Channel details.", + "nickname": "get", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Create a new channel (originate with id).", + "notes": "The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.", + "nickname": "originateWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "The unique id to assign the channel on creation.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "endpoint", + "description": "Endpoint to call.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to dial after the endpoint answers. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to dial after the endpoint answers. If omitted, uses 'default'. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to dial after the endpoint answers. If omitted, uses 1. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "long" + }, + { + "name": "label", + "description": "The label to dial after the endpoint answers. Will supersede 'priority' if provided. Mutually exclusive with 'app'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "app", + "description": "The application that is subscribed to the originated channel. When the channel is answered, it will be passed to this Stasis application. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application provided by 'app'. Mutually exclusive with 'context', 'extension', 'priority', and 'label'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "callerId", + "description": "CallerID to use when dialing the endpoint or extension.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "timeout", + "description": "Timeout (in seconds) before giving up dialing, or -1 for no timeout.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 30 + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds variable key/value pairs to set on the channel on creation. Other keys in the body object are interpreted as query parameters. Ex. { \"endpoint\": \"SIP/Alice\", \"variables\": { \"CALLERID(name)\": \"Alice\" } }", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + }, + { + "name": "otherChannelId", + "description": "The unique id to assign the second channel when using local channels.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "originator", + "description": "The unique id of the channel which is originating this one.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for originating a channel." + } + ] + + }, + { + "httpMethod": "DELETE", + "summary": "Delete (i.e. hangup) a channel.", + "nickname": "hangup", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "reason", + "description": "Reason for hanging up the channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defalutValue": "normal", + "allowableValues": { + "valueType": "LIST", + "values": [ + "normal", + "busy", + "congestion", + "no_answer" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid reason for hangup provided" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/continue", + "description": "Exit application; continue execution in the dialplan", + "operations": [ + { + "httpMethod": "POST", + "summary": "Exit application; continue execution in the dialplan.", + "nickname": "continueInDialplan", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "context", + "description": "The context to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "extension", + "description": "The extension to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "priority", + "description": "The priority to continue to.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "label", + "description": "The label to continue to - will supersede 'priority' if both are provided.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/redirect", + "description": "Inform the channel that it should redirect itself to a different location. Note that this will almost certainly cause the channel to exit the application.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Redirect the channel to a different location.", + "nickname": "redirect", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "endpoint", + "description": "The endpoint to redirect the channel to", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Endpoint parameter not provided" + }, + { + "code": 404, + "reason": "Channel or endpoint not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + }, + { + "code": 422, + "reason": "Endpoint is not the same type as the channel" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/answer", + "description": "Answer a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Answer a channel.", + "nickname": "answer", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/ring", + "description": "Send a ringing indication to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Indicate ringing to a channel.", + "nickname": "ring", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop ringing indication on a channel if locally generated.", + "nickname": "ringStop", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/dtmf", + "description": "Send DTMF to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Send provided DTMF to a given channel.", + "nickname": "sendDTMF", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "dtmf", + "description": "DTMF To send.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "before", + "description": "Amount of time to wait before DTMF digits (specified in milliseconds) start.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + }, + { + "name": "between", + "description": "Amount of time in between DTMF digits (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "duration", + "description": "Length of each DTMF digit (specified in milliseconds).", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 100 + }, + { + "name": "after", + "description": "Amount of time to wait after DTMF digits (specified in milliseconds) end.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0 + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "DTMF is required" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/mute", + "description": "Mute a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a channel.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to mute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a channel.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "direction", + "description": "Direction in which to unmute audio", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "both", + "allowableValues": { + "valueType": "LIST", + "values": [ + "both", + "in", + "out" + ] + } + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/hold", + "description": "Put a channel on hold", + "operations": [ + { + "httpMethod": "POST", + "summary": "Hold a channel.", + "nickname": "hold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Remove a channel from hold.", + "nickname": "unhold", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/moh", + "description": "Play music on hold to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play music on hold to a channel.", + "notes": "Using media operations such as /play on a channel playing MOH in this manner will suspend MOH without resuming automatically. If continuing music on hold is desired, the stasis application must reinitiate music on hold.", + "nickname": "startMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "mohClass", + "description": "Music on hold class to use", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing music on hold to a channel.", + "nickname": "stopMoh", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/silence", + "description": "Play silence to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Play silence to a channel.", + "notes": "Using media operations such as /play on a channel playing silence in this manner will suspend silence without resuming automatically.", + "nickname": "startSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop playing silence to a channel.", + "nickname": "stopSilence", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "play", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/play/{playbackId}", + "description": "Play media to a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start playback of media and specify the playbackId.", + "notes": "The media URI may be any of a number of URI's. Currently sound:, recording:, number:, digits:, characters:, and tone: URI's are supported. This operation creates a playback resource that can be used to control the playback of media (pause, rewind, fast forward, etc.)", + "nickname": "playWithId", + "responseClass": "Playback", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "playbackId", + "description": "Playback ID.", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "media", + "description": "Media's URI to play.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "lang", + "description": "For sounds, selects language for sound.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "offsetms", + "description": "Number of media to skip before playing.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "skipms", + "description": "Number of milliseconds to skip for forward/reverse operations.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 3000 + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/record", + "description": "Record audio from a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start a recording.", + "notes": "Record audio from a channel. Note that this will not capture audio sent to the channel. The bridge itself has a record feature if that's what you want.", + "nickname": "record", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "name", + "description": "Recording's filename", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "format", + "description": "Format to encode audio in", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "maxDurationSeconds", + "description": "Maximum duration of the recording, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "maxSilenceSeconds", + "description": "Maximum duration of silence, in seconds. 0 for no limit", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "int", + "defaultValue": 0, + "allowableValues": { + "valueType": "RANGE", + "min": 0 + } + }, + { + "name": "ifExists", + "description": "Action to take if a recording with the same name already exists.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "fail", + "allowableValues": { + "valueType": "LIST", + "values": [ + "fail", + "overwrite", + "append" + ] + } + }, + { + "name": "beep", + "description": "Play beep when recording begins", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean", + "defaultValue": false + }, + { + "name": "terminateOn", + "description": "DTMF input to terminate recording", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "any", + "*", + "#" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel is not in a Stasis application; the channel is currently bridged with other hcannels; A recording with the same name already exists on the system and can not be overwritten because it is in progress or ifExists=fail" + }, + { + "code": 422, + "reason": "The format specified is unknown on this system" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/variable", + "description": "Variables on a channel", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get the value of a channel variable or function.", + "nickname": "getChannelVar", + "responseClass": "Variable", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to get", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel or variable not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + }, + { + "httpMethod": "POST", + "summary": "Set the value of a channel variable or function.", + "nickname": "setChannelVar", + "responseClass": "void", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variable", + "description": "The channel variable or function to set", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "value", + "description": "The value to set the variable to", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Missing variable parameter." + }, + { + "code": 404, + "reason": "Channel not found" + }, + { + "code": 409, + "reason": "Channel not in a Stasis application" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannel", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + }, + { + "path": "/channels/{channelId}/snoop/{snoopId}", + "description": "Snoop (spy/whisper) on a channel", + "operations": [ + { + "httpMethod": "POST", + "summary": "Start snooping.", + "notes": "Snoop (spy/whisper) on a specific channel.", + "nickname": "snoopChannelWithId", + "responseClass": "Channel", + "parameters": [ + { + "name": "channelId", + "description": "Channel's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "snoopId", + "description": "Unique ID to assign to snooping channel", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "spy", + "description": "Direction of audio to spy on", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "whisper", + "description": "Direction of audio to whisper into", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string", + "defaultValue": "none", + "allowableValues": { + "valueType": "LIST", + "values": [ + "none", + "both", + "out", + "in" + ] + } + }, + { + "name": "app", + "description": "Application the snooping channel is placed into", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "appArgs", + "description": "The application arguments to pass to the Stasis application", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters" + }, + { + "code": 404, + "reason": "Channel not found" + } + ] + } + ] + } + ], + "models": { + "Dialed": { + "id": "Dialed", + "description": "Dialed channel information.", + "properties": {} + }, + "DialplanCEP": { + "id": "DialplanCEP", + "description": "Dialplan location (context/extension/priority)", + "properties": { + "context": { + "required": true, + "type": "string", + "description": "Context in the dialplan" + }, + "exten": { + "required": true, + "type": "string", + "description": "Extension in the dialplan" + }, + "priority": { + "required": true, + "type": "long", + "description": "Priority in the dialplan" + } + } + }, + "CallerID": { + "id": "CallerID", + "description": "Caller identification", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "number": { + "required": true, + "type": "string" + } + } + }, + "Channel": { + "id": "Channel", + "description": "A specific communication connection between Asterisk and an Endpoint.", + "properties": { + "id": { + "required": true, + "type": "string", + "description": "Unique identifier of the channel.\n\nThis is the same as the Uniqueid field in AMI." + }, + "name": { + "required": true, + "type": "string", + "description": "Name of the channel (i.e. SIP/foo-0000a7e3)" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "Down", + "Rsrved", + "OffHook", + "Dialing", + "Ring", + "Ringing", + "Up", + "Busy", + "Dialing Offhook", + "Pre-ring", + "Unknown" + ] + } + }, + "caller": { + "required": true, + "type": "CallerID" + }, + "connected": { + "required": true, + "type": "CallerID" + }, + "accountcode": { + "required": true, + "type": "string" + }, + "dialplan": { + "required": true, + "type": "DialplanCEP", + "description": "Current location in the dialplan" + }, + "creationtime": { + "required": true, + "type": "Date", + "description": "Timestamp when channel was created" + }, + "language": { + "required": true, + "type": "string", + "description": "The default spoken language" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_9_0/deviceStates.json b/codegen3/resources/ari_1_9_0/deviceStates.json new file mode 100644 index 00000000..a268a187 --- /dev/null +++ b/codegen3/resources/ari_1_9_0/deviceStates.json @@ -0,0 +1,151 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "Kevin Harwell ", + "_svn_revision": "$Revision$", + "apiVersion": "1.9.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/deviceStates.{format}", + "apis": [ + { + "path": "/deviceStates", + "description": "Device states", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all ARI controlled device states.", + "nickname": "list", + "responseClass": "List[DeviceState]" + } + ] + }, + { + "path": "/deviceStates/{deviceName}", + "description": "Device state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a device.", + "nickname": "get", + "responseClass": "DeviceState", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a device controlled by ARI. (Note - implicitly creates the device state).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "deviceState", + "description": "Device state value", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a device-state controlled by ARI.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "deviceName", + "description": "Name of the device", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Device name is missing" + }, + { + "code": 409, + "reason": "Uncontrolled device specified" + } + ] + } + ] + } + ], + "models": { + "DeviceState": { + "id": "DeviceState", + "description": "Represents the state of a device.", + "properties": { + "name": { + "type": "string", + "description": "Name of the device.", + "required": true + }, + "state": { + "type": "string", + "description": "Device's state", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "UNKNOWN", + "NOT_INUSE", + "INUSE", + "BUSY", + "INVALID", + "UNAVAILABLE", + "RINGING", + "RINGINUSE", + "ONHOLD" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_9_0/endpoints.json b/codegen3/resources/ari_1_9_0/endpoints.json new file mode 100644 index 00000000..c6a3020c --- /dev/null +++ b/codegen3/resources/ari_1_9_0/endpoints.json @@ -0,0 +1,279 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.9.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/endpoints.{format}", + "apis": [ + { + "path": "/endpoints", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all endpoints.", + "nickname": "list", + "responseClass": "List[Endpoint]" + } + ] + }, + { + "path": "/endpoints/sendMessage", + "description": "Send a message to some technology URI or endpoint.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some technology URI or endpoint.", + "nickname": "sendMessage", + "responseClass": "void", + "parameters": [ + { + "name": "to", + "description": "The endpoint resource or technology specific URI to send the message to. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}", + "description": "Asterisk endpoints", + "operations": [ + { + "httpMethod": "GET", + "summary": "List available endoints for a given endpoint technology.", + "nickname": "listByTech", + "responseClass": "List[Endpoint]", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoints (sip,iax2,...)", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}", + "description": "Single endpoint", + "operations": [ + { + "httpMethod": "GET", + "summary": "Details for an endpoint.", + "nickname": "get", + "responseClass": "Endpoint", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoints not found" + } + ] + } + ] + }, + { + "path": "/endpoints/{tech}/{resource}/sendMessage", + "description": "Send a message to some endpoint in a technology.", + "operations": [ + { + "httpMethod": "PUT", + "summary": "Send a message to some endpoint in a technology.", + "nickname": "sendMessageToEndpoint", + "responseClass": "void", + "parameters": [ + { + "name": "tech", + "description": "Technology of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "resource", + "description": "ID of the endpoint", + "paramType": "path", + "dataType": "string" + }, + { + "name": "from", + "description": "The endpoint resource or technology specific identity to send this message from. Valid resources are sip, pjsip, and xmpp.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "body", + "description": "The body of the message", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "variables", + "descriptioni": "The \"variables\" key in the body object holds technology specific key/value pairs to append to the message. These can be interpreted and used by the various resource types; for example, pjsip and sip resource types will add the key/value pairs as SIP headers,", + "paramType": "body", + "required": false, + "dataType": "containers", + "allowMultiple": false + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "Invalid parameters for sending a message." + }, + { + "code": 404, + "reason": "Endpoint not found" + } + ] + } + ] + } + ], + "models": { + "Endpoint": { + "id": "Endpoint", + "description": "An external device that may offer/accept calls to/from Asterisk.\n\nUnlike most resources, which have a single unique identifier, an endpoint is uniquely identified by the technology/resource pair.", + "properties": { + "technology": { + "type": "string", + "description": "Technology of the endpoint", + "required": true + }, + "resource": { + "type": "string", + "description": "Identifier of the endpoint, specific to the given technology.", + "required": true + }, + "state": { + "type": "string", + "description": "Endpoint's state", + "required": false, + "allowableValues": { + "valueType": "LIST", + "values": [ + "unknown", + "offline", + "online" + ] + } + }, + "channel_ids": { + "type": "List[string]", + "description": "Id's of channels associated with this endpoint", + "required": true + } + } + }, + "TextMessageVariable": { + "id": "TextMessageVariable", + "description": "A key/value pair variable in a text message.", + "properties": { + "key": { + "type": "string", + "description": "A unique key identifying the variable.", + "required": true + }, + "value": { + "type": "string", + "description": "The value of the variable.", + "required": true + } + } + }, + "TextMessage": { + "id": "TextMessage", + "description": "A text message.", + "properties": { + "from": { + "type": "string", + "description": "A technology specific URI specifying the source of the message. For sip and pjsip technologies, any SIP URI can be specified. For xmpp, the URI must correspond to the client connection being used to send the message.", + "required": true + }, + "to": { + "type": "string", + "description": "A technology specific URI specifying the destination of the message. Valid technologies include sip, pjsip, and xmp. The destination of a message should be an endpoint.", + "required": true + }, + "body": { + "type": "string", + "description": "The text of the message.", + "required": true + }, + "variables": { + "type": "List[TextMessageVariable]", + "description": "Technology specific key/value pairs associated with the message.", + "required": false + } + } + } + } +} diff --git a/codegen3/resources/ari_1_9_0/events.json b/codegen3/resources/ari_1_9_0/events.json new file mode 100644 index 00000000..464e06fa --- /dev/null +++ b/codegen3/resources/ari_1_9_0/events.json @@ -0,0 +1,863 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.9.0", + "swaggerVersion": "1.2", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/events.{format}", + "apis": [ + { + "path": "/events", + "description": "Events from Asterisk to applications", + "operations": [ + { + "httpMethod": "GET", + "upgrade": "websocket", + "websocketProtocol": "ari", + "summary": "WebSocket connection for events.", + "nickname": "eventWebsocket", + "responseClass": "Message", + "parameters": [ + { + "name": "app", + "description": "Applications to subscribe to.", + "paramType": "query", + "required": true, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "subscribeAll", + "description": "Subscribe to all Asterisk events. If provided, the applications listed will be subscribed to all events, effectively disabling the application specific subscriptions. Default is 'false'.", + "paramType": "query", + "required": false, + "allowMultiple": false, + "dataType": "boolean" + } + ] + } + ] + }, + { + "path": "/events/user/{eventName}", + "description": "Stasis application user events", + "operations": [ + { + "httpMethod": "POST", + "summary": "Generate a user event.", + "nickname": "userEvent", + "responseClass": "void", + "parameters": [ + { + "name": "eventName", + "description": "Event name", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "application", + "description": "The name of the application that will receive this event", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "source", + "description": "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + "paramType": "query", + "required": false, + "allowMultiple": true, + "dataType": "string" + }, + { + "name": "variables", + "description": "The \"variables\" key in the body object holds custom key/value pairs to add to the user event. Ex. { \"variables\": { \"key\": \"value\" } }", + "paramType": "body", + "required": false, + "allowMultiple": false, + "dataType": "containers" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Application does not exist." + }, + { + "code": 422, + "reason": "Event source not found." + }, + { + "code": 400, + "reason": "Invalid even tsource URI or userevent data." + } + ] + } + ] + } + ], + "models": { + "Message": { + "id": "Message", + "description": "Base type for errors and events", + "discriminator": "type", + "properties": { + "type": { + "type": "string", + "required": true, + "description": "Indicates the type of this message." + } + }, + "subTypes": [ + "MissingParams", + "Event" + ] + }, + "MissingParams": { + "id": "MissingParams", + "description": "Error event sent when required params are missing.", + "properties": { + "params": { + "required": true, + "type": "List[string]", + "description": "A list of the missing parameters" + } + } + }, + "Event": { + "id": "Event", + "description": "Base type for asynchronous events from Asterisk.", + "properties": { + "application": { + "type": "string", + "description": "Name of the application receiving the event.", + "required": true + }, + "timestamp": { + "type": "Date", + "description": "Time at which this event was created.", + "required": false + } + }, + "subTypes": [ + "DeviceStateChanged", + "PlaybackStarted", + "PlaybackFinished", + "RecordingStarted", + "RecordingFinished", + "RecordingFailed", + "ApplicationReplaced", + "BridgeCreated", + "BridgeDestroyed", + "BridgeMerged", + "BridgeBlindTransfer", + "BridgeAttendedTransfer", + "ChannelCreated", + "ChannelDestroyed", + "ChannelEnteredBridge", + "ChannelLeftBridge", + "ChannelStateChange", + "ChannelDtmfReceived", + "ChannelDialplan", + "ChannelCallerId", + "ChannelUserevent", + "ChannelHangupRequest", + "ChannelVarset", + "ChannelTalkingStarted", + "ChannelTalkingFinished", + "ChannelHold", + "ChannelUnhold", + "ContactStatusChange", + "EndpointStateChange", + "Dial", + "StasisEnd", + "StasisStart", + "TextMessageReceived", + "ChannelConnectedLine", + "PeerStatusChange" + ] + }, + "ContactInfo": { + "id": "ContactInfo", + "description": "Detailed information about a contact on an endpoint.", + "properties": { + "uri": { + "type": "string", + "description": "The location of the contact.", + "required": true + }, + "contact_status": { + "type": "string", + "description": "The current status of the contact.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "Unreachable", + "Reachable", + "Unknown", + "Created", + "Removed" + ] + } + }, + "aor": { + "type": "string", + "description": "The Address of Record this contact belongs to.", + "required": true + }, + "roundtrip_usec": { + "type": "string", + "description": "Current round trip time, in microseconds, for the contact.", + "required": false + } + } + }, + "Peer": { + "id": "Peer", + "description": "Detailed information about a remote peer that communicates with Asterisk.", + "properties": { + "peer_status": { + "type": "string", + "description": "The current state of the peer. Note that the values of the status are dependent on the underlying peer technology.", + "required": true + }, + "cause": { + "type": "string", + "description": "An optional reason associated with the change in peer_status.", + "required": false + }, + "address": { + "type": "string", + "description": "The IP address of the peer.", + "required": false + }, + "port": { + "type": "string", + "description": "The port of the peer.", + "required": false + }, + "time": { + "type": "string", + "description": "The last known time the peer was contacted.", + "required": false + } + } + }, + "DeviceStateChanged": { + "id": "DeviceStateChanged", + "description": "Notification that a device state has changed.", + "properties": { + "device_state": { + "type": "DeviceState", + "description": "Device state object", + "required": true + } + } + }, + "PlaybackStarted": { + "id": "PlaybackStarted", + "description": "Event showing the start of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "PlaybackFinished": { + "id": "PlaybackFinished", + "description": "Event showing the completion of a media playback operation.", + "properties": { + "playback": { + "type": "Playback", + "description": "Playback control object", + "required": true + } + } + }, + "RecordingStarted": { + "id": "RecordingStarted", + "description": "Event showing the start of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFinished": { + "id": "RecordingFinished", + "description": "Event showing the completion of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "RecordingFailed": { + "id": "RecordingFailed", + "description": "Event showing failure of a recording operation.", + "properties": { + "recording": { + "type": "LiveRecording", + "description": "Recording control object", + "required": true + } + } + }, + "ApplicationReplaced": { + "id": "ApplicationReplaced", + "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": {} + }, + "BridgeCreated": { + "id": "BridgeCreated", + "description": "Notification that a bridge has been created.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeDestroyed": { + "id": "BridgeDestroyed", + "description": "Notification that a bridge has been destroyed.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeMerged": { + "id": "BridgeMerged", + "description": "Notification that one bridge has merged into another.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "bridge_from": { + "required": true, + "type": "Bridge" + } + } + }, + "BridgeBlindTransfer": { + "id": "BridgeBlindTransfer", + "description": "Notification that a blind transfer has occurred.", + "properties": { + "channel": { + "description": "The channel performing the blind transfer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer when the transferee(s) can not be transferred directly", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "exten": { + "description": "The extension transferred to", + "required": true, + "type": "string" + }, + "context": { + "description": "The context transferred to", + "required": true, + "type": "string" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "bridge": { + "description": "The bridge being transferred", + "type": "Bridge" + } + } + }, + "BridgeAttendedTransfer": { + "id": "BridgeAttendedTransfer", + "description": "Notification that an attended transfer has occurred.", + "properties": { + "transferer_first_leg": { + "description": "First leg of the transferer", + "required": true, + "type": "Channel" + }, + "transferer_second_leg": { + "description": "Second leg of the transferer", + "required": true, + "type": "Channel" + }, + "replace_channel": { + "description": "The channel that is replacing transferer_first_leg in the swap", + "required": false, + "type": "Channel" + }, + "transferee": { + "description": "The channel that is being transferred", + "required": false, + "type": "Channel" + }, + "transfer_target": { + "description": "The channel that is being transferred to", + "required": false, + "type": "Channel" + }, + "result": { + "description": "The result of the transfer attempt", + "required": true, + "type": "string" + }, + "is_external": { + "description": "Whether the transfer was externally initiated or not", + "required": true, + "type": "boolean" + }, + "transferer_first_leg_bridge": { + "description": "Bridge the transferer first leg is in", + "type": "Bridge" + }, + "transferer_second_leg_bridge": { + "description": "Bridge the transferer second leg is in", + "type": "Bridge" + }, + "destination_type": { + "description": "How the transfer was accomplished", + "required": true, + "type": "string" + }, + "destination_bridge": { + "description": "Bridge that survived the merge result", + "type": "string" + }, + "destination_application": { + "description": "Application that has been transferred into", + "type": "string" + }, + "destination_link_first_leg": { + "description": "First leg of a link transfer result", + "type": "Channel" + }, + "destination_link_second_leg": { + "description": "Second leg of a link transfer result", + "type": "Channel" + }, + "destination_threeway_channel": { + "description": "Transferer channel that survived the threeway result", + "type": "Channel" + }, + "destination_threeway_bridge": { + "description": "Bridge that survived the threeway result", + "type": "Bridge" + } + } + }, + "ChannelCreated": { + "id": "ChannelCreated", + "description": "Notification that a channel has been created.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDestroyed": { + "id": "ChannelDestroyed", + "description": "Notification that a channel has been destroyed.", + "properties": { + "cause": { + "required": true, + "description": "Integer representation of the cause of the hangup", + "type": "int" + }, + "cause_txt": { + "required": true, + "description": "Text representation of the cause of the hangup", + "type": "string" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelEnteredBridge": { + "id": "ChannelEnteredBridge", + "description": "Notification that a channel has entered a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "type": "Channel" + } + } + }, + "ChannelLeftBridge": { + "id": "ChannelLeftBridge", + "description": "Notification that a channel has left a bridge.", + "properties": { + "bridge": { + "required": true, + "type": "Bridge" + }, + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelStateChange": { + "id": "ChannelStateChange", + "description": "Notification of a channel's state change.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "ChannelDtmfReceived": { + "id": "ChannelDtmfReceived", + "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, + "type": "string", + "description": "DTMF digit received (0-9, A-E, # or *)" + }, + "duration_ms": { + "required": true, + "type": "int", + "description": "Number of milliseconds DTMF was received" + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which DTMF was received" + } + } + }, + "ChannelDialplan": { + "id": "ChannelDialplan", + "description": "Channel changed location in the dialplan.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed dialplan location." + }, + "dialplan_app": { + "required": true, + "type": "string", + "description": "The application about to be executed." + }, + "dialplan_app_data": { + "required": true, + "type": "string", + "description": "The data to be passed to the application." + } + } + }, + "ChannelCallerId": { + "id": "ChannelCallerId", + "description": "Channel changed Caller ID.", + "properties": { + "caller_presentation": { + "required": true, + "type": "int", + "description": "The integer representation of the Caller Presentation value." + }, + "caller_presentation_txt": { + "required": true, + "type": "string", + "description": "The text representation of the Caller Presentation value." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that changed Caller ID." + } + } + }, + "ChannelUserevent": { + "id": "ChannelUserevent", + "description": "User-generated event with additional user-defined fields in the object.", + "properties": { + "eventname": { + "required": true, + "type": "string", + "description": "The name of the user event." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "A channel that is signaled with the user event." + }, + "bridge": { + "required": false, + "type": "Bridge", + "description": "A bridge that is signaled with the user event." + }, + "endpoint": { + "required": false, + "type": "Endpoint", + "description": "A endpoint that is signaled with the user event." + }, + "userevent": { + "required": true, + "type": "object", + "description": "Custom Userevent data" + } + } + }, + "ChannelHangupRequest": { + "id": "ChannelHangupRequest", + "description": "A hangup was requested on the channel.", + "properties": { + "cause": { + "type": "int", + "description": "Integer representation of the cause of the hangup." + }, + "soft": { + "type": "boolean", + "description": "Whether the hangup request was a soft hangup request." + }, + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which the hangup was requested." + } + } + }, + "ChannelVarset": { + "id": "ChannelVarset", + "description": "Channel variable changed.", + "properties": { + "variable": { + "required": true, + "type": "string", + "description": "The variable that changed." + }, + "value": { + "required": true, + "type": "string", + "description": "The new value of the variable." + }, + "channel": { + "required": false, + "type": "Channel", + "description": "The channel on which the variable was set.\n\nIf missing, the variable is a global variable." + } + } + }, + "ChannelHold": { + "id": "ChannelHold", + "description": "A channel initiated a media hold.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that initiated the hold event." + }, + "musicclass": { + "required": false, + "type": "string", + "description": "The music on hold class that the initiator requested." + } + } + }, + "ChannelUnhold": { + "id": "ChannelUnhold", + "description": "A channel initiated a media unhold.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel that initiated the unhold event." + } + } + }, + "ChannelTalkingStarted": { + "id": "ChannelTalkingStarted", + "description": "Talking was detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking started." + } + } + }, + "ChannelTalkingFinished": { + "id": "ChannelTalkingFinished", + "description": "Talking is no longer detected on the channel.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel on which talking completed." + }, + "duration": { + "required": true, + "type": "int", + "description": "The length of time, in milliseconds, that talking was detected on the channel" + } + } + }, + "ContactStatusChange": { + "id": "ContactStatusChange", + "description": "The state of a contact on an endpoint has changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + }, + "contact_info": { + "required": true, + "type": "ContactInfo" + } + } + }, + "PeerStatusChange": { + "id": "PeerStatusChange", + "description": "The state of a peer associated with an endpoint has changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + }, + "peer": { + "required": true, + "type": "Peer" + } + } + }, + "EndpointStateChange": { + "id": "EndpointStateChange", + "description": "Endpoint state changed.", + "properties": { + "endpoint": { + "required": true, + "type": "Endpoint" + } + } + }, + "Dial": { + "id": "Dial", + "description": "Dialing state has changed.", + "properties": { + "caller": { + "required": false, + "type": "Channel", + "description": "The calling channel." + }, + "peer": { + "required": true, + "type": "Channel", + "description": "The dialed channel." + }, + "forward": { + "required": false, + "type": "string", + "description": "Forwarding target requested by the original dialed channel." + }, + "forwarded": { + "required": false, + "type": "Channel", + "description": "Channel that the caller has been forwarded to." + }, + "dialstring": { + "required": false, + "type": "string", + "description": "The dial string for calling the peer channel." + }, + "dialstatus": { + "required": true, + "type": "string", + "description": "Current status of the dialing attempt to the peer." + } + } + }, + "StasisEnd": { + "id": "StasisEnd", + "description": "Notification that a channel has left a Stasis application.", + "properties": { + "channel": { + "required": true, + "type": "Channel" + } + } + }, + "StasisStart": { + "id": "StasisStart", + "description": "Notification that a channel has entered a Stasis application.", + "properties": { + "args": { + "required": true, + "type": "List[string]", + "description": "Arguments to the application" + }, + "channel": { + "required": true, + "type": "Channel" + }, + "replace_channel": { + "required": false, + "type": "Channel" + } + } + }, + "TextMessageReceived": { + "id": "TextMessageReceived", + "description": "A text message was received from an endpoint.", + "properties": { + "message": { + "required": true, + "type": "TextMessage" + }, + "endpoint": { + "required": false, + "type": "Endpoint" + } + } + }, + "ChannelConnectedLine": { + "id": "ChannelConnectedLine", + "description": "Channel changed Connected Line.", + "properties": { + "channel": { + "required": true, + "type": "Channel", + "description": "The channel whose connected line has changed." + } + } + } + } +} diff --git a/codegen3/resources/ari_1_9_0/mailboxes.json b/codegen3/resources/ari_1_9_0/mailboxes.json new file mode 100644 index 00000000..5b290fcd --- /dev/null +++ b/codegen3/resources/ari_1_9_0/mailboxes.json @@ -0,0 +1,134 @@ +{ + "_copyright": "Copyright (C) 2013, Digium, Inc.", + "_author": "Jonathan Rose ", + "_svn_revision": "$Revision$", + "apiVersion": "1.9.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/mailboxes.{format}", + "apis": [ + { + "path": "/mailboxes", + "description": "Mailboxes", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all mailboxes.", + "nickname": "list", + "responseClass": "List[Mailbox]" + } + ] + }, + { + "path": "/mailboxes/{mailboxName}", + "description": "Mailbox state", + "operations": [ + { + "httpMethod": "GET", + "summary": "Retrieve the current state of a mailbox.", + "nickname": "get", + "responseClass": "Mailbox", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "PUT", + "summary": "Change the state of a mailbox. (Note - implicitly creates the mailbox).", + "nickname": "update", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "oldMessages", + "description": "Count of old messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + }, + { + "name": "newMessages", + "description": "Count of new messages in the mailbox", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "int" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Destroy a mailbox.", + "nickname": "delete", + "responseClass": "void", + "parameters": [ + { + "name": "mailboxName", + "description": "Name of the mailbox", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Mailbox not found" + } + ] + } + ] + } + ], + "models": { + "Mailbox": { + "id": "Mailbox", + "description": "Represents the state of a mailbox.", + "properties": { + "name": { + "type": "string", + "description": "Name of the mailbox.", + "required": true + }, + "old_messages": { + "type": "int", + "description": "Count of old messages in the mailbox.", + "required": true + }, + "new_messages": { + "type": "int", + "description": "Count of new messages in the mailbox.", + "required": true + } + } + } + } +} diff --git a/codegen3/resources/ari_1_9_0/playbacks.json b/codegen3/resources/ari_1_9_0/playbacks.json new file mode 100644 index 00000000..e6cb7493 --- /dev/null +++ b/codegen3/resources/ari_1_9_0/playbacks.json @@ -0,0 +1,155 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.9.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/playbacks.{format}", + "apis": [ + { + "path": "/playbacks/{playbackId}", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a playback's details.", + "nickname": "get", + "responseClass": "Playback", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a playback.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "The playback cannot be found" + } + ] + } + ] + }, + { + "path": "/playbacks/{playbackId}/control", + "description": "Control object for a playback operation.", + "operations": [ + { + "httpMethod": "POST", + "summary": "Control a playback.", + "nickname": "control", + "responseClass": "void", + "parameters": [ + { + "name": "playbackId", + "description": "Playback's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + }, + { + "name": "operation", + "description": "Operation to perform on the playback.", + "paramType": "query", + "required": true, + "allowMultiple": false, + "dataType": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "restart", + "pause", + "unpause", + "reverse", + "forward" + ] + } + } + ], + "errorResponses": [ + { + "code": 400, + "reason": "The provided operation parameter was invalid" + }, + { + "code": 404, + "reason": "The playback cannot be found" + }, + { + "code": 409, + "reason": "The operation cannot be performed in the playback's current state" + } +] + } + ] + } + ], + "models": { + "Playback": { + "id": "Playback", + "description": "Object representing the playback of media to a channel", + "properties": { + "id": { + "type": "string", + "description": "ID for this playback operation", + "required": true + }, + "media_uri": { + "type": "string", + "description": "URI for the media to play back.", + "required": true + }, + "target_uri": { + "type": "string", + "description": "URI for the channel or bridge to play the media on", + "required": true + }, + "language": { + "type": "string", + "description": "For media types that support multiple languages, the language requested for playback." + }, + "state": { + "type": "string", + "description": "Current state of the playback operation.", + "required": true, + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "playing", + "complete" + ] + } + } + } + } + } +} diff --git a/codegen3/resources/ari_1_9_0/recordings.json b/codegen3/resources/ari_1_9_0/recordings.json new file mode 100644 index 00000000..bc2b9027 --- /dev/null +++ b/codegen3/resources/ari_1_9_0/recordings.json @@ -0,0 +1,378 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.9.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/recordings.{format}", + "apis": [ + { + "path": "/recordings/stored", + "description": "Recordings", + "operations": [ + { + "httpMethod": "GET", + "summary": "List recordings that are complete.", + "nickname": "listStored", + "responseClass": "List[StoredRecording]" + } + ] + }, + { + "path": "/recordings/stored/{recordingName}", + "description": "Individual recording", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a stored recording's details.", + "nickname": "getStored", + "responseClass": "StoredRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Delete a stored recording.", + "nickname": "deleteStored", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "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" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}", + "description": "A recording that is in progress", + "operations": [ + { + "httpMethod": "GET", + "summary": "List live recordings.", + "nickname": "getLive", + "responseClass": "LiveRecording", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Stop a live recording and discard it.", + "nickname": "cancel", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/stop", + "operations": [ + { + "httpMethod": "POST", + "summary": "Stop a live recording and store it.", + "nickname": "stop", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/pause", + "operations": [ + { + "httpMethod": "POST", + "summary": "Pause a live recording.", + "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.", + "nickname": "pause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unpause a live recording.", + "nickname": "unpause", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + }, + { + "path": "/recordings/live/{recordingName}/mute", + "operations": [ + { + "httpMethod": "POST", + "summary": "Mute a live recording.", + "notes": "Muting a recording suspends silence detection, which will be restarted when the recording is unmuted.", + "nickname": "mute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + }, + { + "httpMethod": "DELETE", + "summary": "Unmute a live recording.", + "nickname": "unmute", + "responseClass": "void", + "parameters": [ + { + "name": "recordingName", + "description": "The name of the recording", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ], + "errorResponses": [ + { + "code": 404, + "reason": "Recording not found" + }, + { + "code": 409, + "reason": "Recording not in session" + } + ] + } + ] + } + ], + "models": { + "StoredRecording": { + "id": "StoredRecording", + "description": "A past recording that may be played back.", + "properties": { + "name": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "LiveRecording": { + "id": "LiveRecording", + "description": "A recording that is in progress", + "properties": { + "name": { + "required": true, + "type": "string", + "description": "Base name for the recording" + }, + "format": { + "required": true, + "type": "string", + "description": "Recording format (wav, gsm, etc.)" + }, + "target_uri": { + "required": true, + "type": "string", + "description": "URI for the channel or bridge being recorded" + }, + "state": { + "required": true, + "type": "string", + "allowableValues": { + "valueType": "LIST", + "values": [ + "queued", + "recording", + "paused", + "done", + "failed", + "canceled" + ] + } + }, + "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." + }, + "cause": { + "required": false, + "type": "string", + "description": "Cause for recording failure if failed" + } + } + } + } +} diff --git a/codegen3/resources/ari_1_9_0/sounds.json b/codegen3/resources/ari_1_9_0/sounds.json new file mode 100644 index 00000000..70d65a4e --- /dev/null +++ b/codegen3/resources/ari_1_9_0/sounds.json @@ -0,0 +1,99 @@ +{ + "_copyright": "Copyright (C) 2012 - 2013, Digium, Inc.", + "_author": "David M. Lee, II ", + "_svn_revision": "$Revision$", + "apiVersion": "1.9.0", + "swaggerVersion": "1.1", + "basePath": "http://localhost:8088/ari", + "resourcePath": "/api-docs/sounds.{format}", + "apis": [ + { + "path": "/sounds", + "description": "Sounds", + "operations": [ + { + "httpMethod": "GET", + "summary": "List all sounds.", + "nickname": "list", + "responseClass": "List[Sound]", + "parameters": [ + { + "name": "lang", + "description": "Lookup sound for a specific language.", + "paramType": "query", + "dataType": "string", + "required": false + }, + { + "name": "format", + "description": "Lookup sound in a specific format.", + "paramType": "query", + "dataType": "string", + "required": false, + "__note": "core show translation can show translation paths between formats, along with relative costs. so this could be just installed format, or we could follow that for transcoded formats." + } + ] + } + ] + }, + { + "path": "/sounds/{soundId}", + "description": "Individual sound", + "operations": [ + { + "httpMethod": "GET", + "summary": "Get a sound's details.", + "nickname": "get", + "responseClass": "Sound", + "parameters": [ + { + "name": "soundId", + "description": "Sound's id", + "paramType": "path", + "required": true, + "allowMultiple": false, + "dataType": "string" + } + ] + } + ] + } + ], + "models": { + "FormatLangPair": { + "id": "FormatLangPair", + "description": "Identifies the format and language of a sound file", + "properties": { + "language": { + "required": true, + "type": "string" + }, + "format": { + "required": true, + "type": "string" + } + } + }, + "Sound": { + "id": "Sound", + "description": "A media file that may be played back.", + "properties": { + "id": { + "required": true, + "description": "Sound's identifier.", + "type": "string" + }, + "text": { + "required": false, + "description": "Text description of the sound, usually the words spoken.", + "type": "string" + }, + "formats": { + "required": true, + "description": "The formats and languages in which this sound is available.", + "type": "List[FormatLangPair]" + } + } + } + } +} diff --git a/codegen3/src/codegen3/ari4java.clj b/codegen3/src/codegen3/ari4java.clj new file mode 100644 index 00000000..70c1794a --- /dev/null +++ b/codegen3/src/codegen3/ari4java.clj @@ -0,0 +1,808 @@ +(ns codegen3.ari4java + (:require [codegen3.javagen :as jg] + [clojure.spec.alpha :as s] + [orchestra.spec.test :as st] + [codegen3.signatures :as sgn])) + +;; This namespace runs the translation of +;; a swagger database (e.g. sample_db.clj) as read in core +;; into an array of Java class definitions that will +;; then be written by javagen.clj + +;; LOGIC +;; We distinguish two kinds of objects: +;; - Actions: these are the actual objects that +;; are used to perform actions. When you run A4j +;; you use an interface, but the runtime object +;; is bound to the version you specified. +;; They are named e.g. "ActionApplications" and the +;; runtime version will be "ActionApplication_impl_{ariVer}" +;; - Models: these are data containers coming from Asterisk. +;; They are "only" data continers, so have no meaningful +;; method on themselves. We add .toString, .equals and +;; .hashCode just in case. + + +;; Method Permutations +;; .... + + +;; INTERFACES +;; .a4j.generated +;; +;; Actions: - +;; +;; Models: +;; e.g. (-> DB :ari_1_0_0 :applications :models :Application) +;; At the interface level, we make it a map +;; {"field" "swaggerType"} +;; To actually generate the model, we also need: +;; - All the ARI version(s) it is present in +;; - The description, as taken from most recent version +;; +;; A fixed set of models extend EventSource (for tagging) +;; +;; \TODO which models are "extends EventSource"? + + + + +(def IMPORTS_GENERATED_MODELS [ + "ch.loway.oss.ari4java.generated.*" + "com.fasterxml.jackson.databind.annotation.JsonDeserialize" + "java.util.Date" + "java.util.List" + "java.util.Map" ]) + + + +(def IMPORTS_INTERFACES_MODELS [ + "java.util.Date" + "java.util.List" + "java.util.Map" + "java.util.ArrayList" + "ch.loway.oss.ari4java.tools.RestException" + "ch.loway.oss.ari4java.tools.AriCallback" + "ch.loway.oss.ari4java.tools.tags.*" + ]) + + +(defn eventSources + "At the moment the list of EventSources is fixed. + But it would be better to read it from the DB." + [] + #{ :Bridge :Channel :Endpoint :DeviceState }) + +(defn isEvtSource + "A set can be looked-up as a function of its members" + [model] + (some? ((eventSources) model))) + + +(defn models-for + "A list of models for an ARI version. + Models are held in: + -> DB :ari_1_0_0 :applications :models + -> DB :ari_1_0_0 :events :models + + Returns a map of models indexed by model name. + " + [DB version] + (let [entries (-> DB version keys)] + (reduce into {} + (for [entry entries] + (-> DB version entry :models))))) + + +(defn model-names-for + [DB version] + (keys (models-for DB version))) + + +(defn all-ari-versions [db] + (keys db)) + + +(defn all-possible-model-names + "Returns a list of all possible model names across all ARI versions" + [DB] + (reduce into #{} + (map (partial model-names-for DB) + (all-ari-versions DB)))) + + +(defn get-model- [DB version name] + "Reads a model given a version and a name. + Annotates the ARI model with whether it's an event and + the ARI version it comes from" + + (let [am (-> DB version :applications :models name) + em (-> DB version :events :models name)] + + (cond + (and (nil? em) (nil? am)) + nil + (nil? em) + (into {:cljid name :ver version :isevt false} am) + :else + (into {:cljid name :ver version :isevt true} em)))) + + +(defn get-model [DB version name] + "Reads a model given a version and a name. + Annotates the ARI model with whether it's an event and + the ARI version it comes from" + + (let [entries (-> DB version keys) + lzModels (map #(-> DB version % :models name) entries) + found (first (filter some? lzModels))] + (cond + (nil? found) nil + :else (into {:cljid name :ver version :isevt false} found) + ))) + + + (defn merge-property + "Derives an annotated property from an existing annotated + property p1 + a non-annotated property and a version. + An annotated property has a name and + a list of versions it applies to. + " + [ap1 p2 name version] + + ;(prn "mergeprop" ap1 p2 name version) + + (cond + (nil? ap1) + (into {:versions [version] :name name} p2) + + :else + (cond + (= (:type ap1) (:type p2)) + (into ap1 {:versions (conj (:versions ap1) version)}) + + :else-exception + (throw (IllegalArgumentException. + (str "Different type in version: " version " for ap1:" ap1 " p2:" p2 )))) +)) + + + +(defn props-set + "Given a list of models and a prop to extract, + gets us the property." + [vModels prop] + (let [allprops (map + (fn [model] + {:ver (:ver model) + :name prop + :prop (get-in model [:properties prop])}) + vModels) + ; a prop might not exist + allexistingprops (filter #(some? (:prop %)) allprops) + + ] + + (reduce (fn [a v] (merge-property a (:prop v) prop (:ver v))) + nil + allexistingprops) + ) + + ) + + +(defn model-info + "What do we know about this model across our entire database? + + " + [DB name] + (let [models (map #(get-model DB % name) (all-ari-versions DB)) + found (filter some? models) + versions (map :ver found) + lastmod (last found) + allpropnames (keys (reduce into {} (map :properties found))) + allprops (map (partial props-set found) allpropnames) + ] + {:model name + :versions (vec versions) + :dscr (:description lastmod) + :evt (:isevt lastmod) + :properties (vec allprops) + ;:_fnd found + } + )) + + +(defn get-property-description [prop] + (str (:description prop) + "\n" + "\n" + "Supported versions: " (:versions prop) + ) + + ) + + +(defn get-model-description [prop] + (str (:dscr prop) + "\n" + "\n" + "Supported versions: " (:versions prop) + "\n" + "DEBUG:" prop "\n" + ) + + ) + +(defn generate-model-concrete + [model] + (jg/mkDataClass + "ch.loway.oss.ari4java.generated" + (name (:model model)) + + (get-model-description model) + + (mapv + (fn [prop] + {:type (jg/swagger->java + (:type prop) "") + :name (name (:name prop)) + :comment (get-property-description prop)}) + (:properties model) + + ))) + +(defn generate-model-interface + [model] + (let [modelName (:model model)] + + (jg/mkDataClassInterface + "ch.loway.oss.ari4java.generated" + (name modelName) + (if (isEvtSource modelName) " EventSource " nil ) ;; extends + [] ;; implements + IMPORTS_INTERFACES_MODELS + (get-model-description model) + + (mapv + (fn [prop] + {:type (jg/swagger->java + (:type prop) "") + :name (name (:name prop)) + :comment (get-property-description prop) + :interfaceonly true }) + (:properties model) + + )) + + + + ) + + ) + + +(defn generate-model-interfaces + "Builds all model interfaces. + " + [DB] + (let [models (map (partial model-info DB) (all-possible-model-names DB) )] + (map generate-model-interface models))) + + +(defn generate-model-implementation + "An implementaion is like an interface, but: + - if a field is not supported, it should throw + an error + - it has toString and hashCode methods added in + + " + [model ari] + + (jg/mkDataClass + ;(vec [ + + (str "ch.loway.oss.ari4java.generated." (name ari) ".models") + (str (name (:model model)) "_impl_" (name ari)) + nil ;; extends + [ (name (:model model)) ] ;; implements + IMPORTS_GENERATED_MODELS + (get-model-description model) + + (mapv + (fn [prop] + {:type (jg/swagger->java + (:type prop) "") + :name (name (:name prop)) + :comment (get-property-description prop) + :notimplemented (not (some #{ari} (:versions prop) )) } + ) + (:properties model)) + + ; ] + + )) + + + + +(defn generate-model-implementations [DB] + (let [allaris (all-ari-versions DB) + allmodels (all-possible-model-names DB) + models (map (partial model-info DB) allmodels)] + (for [m models a allaris] + (generate-model-implementation m a) + ;allaris + + ))) + + +(s/def ::odb_entry + (s/keys :req-un [::op_path + ::op_description + ::op_version + ::op_action + ::httpMethod + ::summary + ::nickname + ::responseClass + ::parameters + ])) + +(s/def ::odb + (s/coll-of ::odb_entry :kind sequential? )) + + + + +;; ACTIONS +;; In order to work on actions, we first transform the Actions database +;; so that it is a large list of Operations +;; enriched with: +;; :op_path +;; :op_description +;; :op_version :ari_0_0_1 +;; :op_type :bridges + +(defn dbDescr + "Loads a description of the DB in terms of aris and entities" + + [DB] + (let [allaris (all-ari-versions DB) + allentities (reduce into #{} + (map #(-> DB % keys) allaris)) ] + {:aris (vec (sort allaris)) + :ents (vec (sort allentities))} )) + + +(s/fdef opsDb + :ret ::odb) + + +(defn opsDb + "Loads a flat operations DB that can be easily filtered. + As sometimes some keys are missing, we add them in." + [DB] + (let [{aris :aris ents :ents} (dbDescr DB)] + (vec + (flatten + (for [ari aris + ent ents] + (let [apis (-> DB ari ent :apis)] + (for [api apis] + (let [path (:path api) + descr (:description api) + ops (:operations api)] + (map + (fn [op] (let [parms (get op :parameters []) + newParms (map #(into {:required true :allowMultiple false} %) parms) ] + (into {:op_path path + :op_description descr + :op_version ari + :op_action ent + ; sometimes those are missing + :parameters [] + } (into op {:parameters newParms})))) + ops))))))))) + + +;; Here we have a litte tool to understand the contents of our DB + +;; (aj/findParams (aj/opsDb DB) #(= "operation" (:name %) ) ) +(defn findParams + [odb pred] + (filter + #(pos? (count (filter pred (:parameters %)) ) ) + odb + )) + +(defn viewMethod [odb ari name] + + (let [predAri (cond + (nil? ari) #(= 1 1) + :else #(= ari (:op_version %))) + predName #(= name (:nickname %)) + ] + + + (filter + #(and (predAri %) (predName %)) + odb + ))) + + +; How many methods have multiple parameters? just a few +; +;(map #(vec [(:op_action %) (:nickname %)]) +; (aj/findParams +; (filter #(= :ari_1_8_0 (:op_version %)) (aj/opsDb DB)) +; #(= true (:allowMultiple %) ) )) +; +; ([:applications "subscribe"] +; [:applications "unsubscribe"] +; [:asterisk "getInfo"] +; [:bridges "addChannel"] +; [:bridges "removeChannel"] +; [:events "eventWebsocket"] +; [:events "userEvent"]) + +; How many methods have enums? +;(map #(vec [(:op_action %) (:nickname %)]) +; (aj/findParams +; (filter #(= :ari_1_8_0 (:op_version %)) (aj/opsDb DB)) +; #(= "LIST" (-> % :allowableValues :valueType) ) )) +; +; ([:asterisk "getInfo"] +; [:bridges "record"] +; [:channels "hangup"] +; [:channels "mute"] +; [:channels "unmute"] +; [:channels "record"] +; [:channels "snoopChannel"] +; [:channels "snoopChannelWithId"] +; [:deviceStates "update"] +; [:playbacks "control"]) + + + +;; ---------- Enums --------- +; Enums have a name that matches the field they go in. +; If multiple enums have the same name, their fields are coalesced. +; +; To find enums, we scan all fields for ":allowableValues :valueType" = "LIST" +; Enums are produced as a map of arrays: +; {e1 [v1 v2 v3], e2 [v1 v2 v3]} + +(defn find-enums + [odb] + (let [parms (flatten (map :parameters odb)) + wEnum (filter #(= "LIST" (-> % :allowableValues :valueType) ) parms) + tuples (map (fn [p] [(:name p) (set (-> p :allowableValues :values)) ]) wEnum) + groups (group-by first tuples) + mapk (map (fn [[k v]] [k (reduce into #{} (map second v)) ] ) groups) + ] + + (into {} mapk))) + + +(defn generate-enum-classes [odb] + (let [ens (find-enums odb)] + + (map + (fn [[k v]] + (jg/mkEnum "ch.loway.oss.ari4java.generated.enums" k "-" v)) + ens + ))) + + +; ================== +; ARIBUILDERS and such things + +(defn generate-ari-builder-interface + "public abstract ActionApplications actionApplications();" + [allmods allactions] + (let [allObj (sort (into allmods allactions))] + + { + :isInterface true + :classname "AriBuilder" + :package "ch.loway.app.oss.ari4java.generated" + :imports [ "ch.loway.oss.ari4java.ARI" ] + :notes "" + :stanzas (into + ["public abstract ARI.ClassFactory getClassFactory();"] + (map #(str "public abstract " + (jg/className (name %)) + " " + (jg/lcName (name %)) + "();") + allObj)) + })) + +(defn generate-ari-builder-impl + "public abstract ActionApplications actionApplications();" + [version DB allmods allactions] + (let [allObj (sort (into allmods allactions)) + ver (name version) + pkg (str "ch.loway.app.oss.ari4java.generated." ver) + knownModels (set (model-names-for DB version)) + ] + + { + :classname (str "AriBuilder_impl_" (name version)) + :package pkg + :imports [ (str pkg ".models.*;") + (str pkg ".actions.*;") + "ch.loway.oss.ari4java.generated.*" + "ch.loway.oss.ari4java.ARI" ] + :implements "AriBuilder" + :notes "" + :functions (map (fn [x] + {:method (jg/lcName (name x)) + :returns (jg/className (name x)) + :body (cond + (knownModels x) + + (str "return new " + (jg/className (name x)) + "_impl_" + ver + "();") + + :else + "throw new UnsupportedOperationException();") + + }) + allObj) + :stanzas (str "public ARI.ClassFactory getClassFactory() {\n" + "return new ClassTranslator_impl_" ver "();\n};\n") + })) + + +(defn generate-class-translator-impl + "" + [version DB allmods allactions] + (let [allObj (sort (into allmods allactions)) + ver (name version) + pkg (str "ch.loway.app.oss.ari4java.generated." ver) + knownModels (set (model-names-for DB version)) + ] + + { + :classname (str "ClassTranslator_impl_" (name version)) + :package pkg + :imports [ (str pkg ".models.*;") + (str pkg ".actions.*;") + "ch.loway.oss.ari4java.generated.*" + "ch.loway.oss.ari4java.ARI" ] + :implements "ARI.ClassFactory" + :notes "" + :stanzas (str "@Override\n" + "public Class getImplementationFor(Class interfaceClass) { \n" + (apply str (map (fn [o] (str "if ( interfaceClass.equals(" + (name o) ".class) ) {\n" + "return (" (name o) "_impl_" ver ".class);\n" + "} else \n")) allObj)) + "{\n return null;\n } }" + + ) + })) + + + + +(defn generate-ari-builders + "We generate a generic AriBuilder interface for + all models plus an implementor for each ARI version." + [DB] + (let [allaris (all-ari-versions DB) + allmods (all-possible-model-names DB) + allacts [] ] + + (flatten + [(generate-ari-builder-interface allmods allacts) + (map #(generate-ari-builder-impl % DB allmods allacts) allaris) + (map #(generate-class-translator-impl % DB allmods allacts) allaris)] + + ))) + + +; ================================================================= +; ACTIONS +; Generation of all actions is based on an opsDb +; when testing, you can: +; (def ODB (opsDb (codegen3.core/readAll))) +; (allSignaturesForAction ODB :applications) + + + +(defn allActions [ODB] + (->> ODB + (map :op_action) + set + sort + vec )) + +(s/fdef allActions + :args (s/cat :odb ::odb) + :ret vector?) + + +; op_entity -> op_action + + +(s/fdef signature + :args (s/cat :dbe ::odb_entry)) + +(defn signature + "Gets a signature tuple. [{:nick....} :ari_0] + As :parameters might not exist, we read it through a get + so we can put a default." + [dbe] + (let [p (get dbe :parameters [])] + [{:nickname (:nickname dbe) + :parms (sgn/explode-parms-permutations p) + :responseClass (:responseClass dbe) + } + (:op_version dbe)] + )) + +(s/def ::tuple + (s/and vector? + #(= 2 (count %)) )) + +(s/fdef groupTuples + :args (s/cat :tuples (s/coll-of ::tuple )) + :ret map?) + +(defn groupTuples + "Translates a sequence of [ [item tag]...] + into a map {item [tag...]} + " + [sTuples] + (into {} + (map + (fn [[k v]] [k (mapv second v)] ) + (group-by first sTuples)))) + + +(s/fdef allSignaturesForAction + :args (s/cat :dbe ::odb + :action keyword?)) + +(defn allSignaturesForAction + [ODB action] + (let [odb (filter #(= action (:op_action %)) ODB)] + (groupTuples (mapv signature odb)))) + + +(defn getMethodDetails [ODB action ariVer nick] + (let [methods (filter #(and (= ariVer (:op_version %)) + (= action (:op_action %)) + (= nick (:nickname %))) + ODB) + _ (cond + (not= 1 (count methods)) + (throw (IllegalArgumentException. + ("Multiple or missing methods " ariVer action nick " found:" (count methods))))) + method (first methods)] + + method + + )) + + +(s/fdef generate-action-interface-methods + :args (s/cat :methodSig (s/keys :req-un [::nickname ::parms ::responseClass]) + :methodInAri ::odb_entry + :available-in (s/coll-of keyword?) + )) + + +(defn generate-action-interface-methods + [methodSig methodInAri available-in] + + (flatten + (let [parmNames (map :name (:parameters methodInAri))] + (for [parameters (sgn/string-perms (:parms methodSig))] + [ + ; normal call + {:method (:nickname methodSig) + :returns (:responseClass methodSig) + :args (map (fn [name type] {:type type :name name}) parmNames parameters) + :notes (str parameters) + } + + ;ARI callback + {:method (:nickname methodSig) + :returns "void" + :args (map (fn [name type] {:type type :name name}) + (conj parmNames "callback") + (conj parameters (str "AriCallback<" (:responseClass methodSig) ">" ))) + :notes (str parameters) + } + ] + )))) + + + +(defn generate-action-interfaces + [ODB action] + + (let [interfaceTuples (allSignaturesForAction ODB action) + method-sigs (sort-by :nickname (keys interfaceTuples))] + + (flatten + (for [method-sig method-sigs + :let [available-in (get interfaceTuples method-sig) + method-ari (getMethodDetails + ODB + action + (first available-in) ; any version of ARI + (:nickname method-sig))]] + + (generate-action-interface-methods method-sig method-ari available-in) + + )))) + + +(defn generate-action-interface-class + [ODB action] + { + :classname (jg/camelName "Action" (name action)) + :isInterface true + :package "ch.loway.oss.ari4java.generated" + ;:imports a list of imports + ;:implements a list of implementations + ;:extends the class to extend + :notes "" + :functions (generate-action-interfaces ODB action) + ;:stanzas a list of text to implement (added after the methods) + } + + ) + + + +(defn generate-all-action-interfaces + [DB] + (let [odb (opsDb DB) + allActions (allActions odb)] + (map #(generate-action-interface-class odb %) allActions))) + + +; ================================================================= +; Try everything once. + + +(defn process + "Turns a database into a set of interfaces and classes." + [database] + + (let [mif (generate-model-interfaces database) + mci (generate-model-implementations database) + odb (opsDb database) + enm (generate-enum-classes odb) + bld (generate-ari-builders database) + aif (generate-all-action-interfaces database) + + + + all (-> [] + (into mif) + (into mci) + (into enm) + (into bld) + (into aif) + ) + ] + + ;(prn aif) + (map jg/writeOutKlass all) + )) + + + + +; Orchestra instrumentation is active automagically +(st/instrument) diff --git a/codegen3/src/codegen3/core.clj b/codegen3/src/codegen3/core.clj new file mode 100644 index 00000000..3581ec1d --- /dev/null +++ b/codegen3/src/codegen3/core.clj @@ -0,0 +1,215 @@ +(ns codegen3.core + (:require [clojure.data.json :as json]) + (:require [codegen3.methods :as meth]) + (:require [codegen3.javagen :as javagen]) + (:require [codegen3.ari4java :as aj]) + (:require [com.rpl.specter :as spk]) + (:gen-class)) + +;; Load func: cmd+enter +;; Load all: shift+cmd+enter + +;; TBD +;; - check signatures using :pre and :post + +;; WHAT WE HAVE TO BUILD +;; I would +;; - Read all AMI versions [*] +;; - Generate Java signatures +;; - Merge all signatures -> Interfaces +;; - Write interfaces +;; - Write each specific object + +;; ## INTERFACES + +;; ### ActionXXXX +;; e.g. ActionApplication.java + +;; ### AriBuilder + +;; ### Oggetti +;; es Dialed- vuoto +;; + +;; ### Eventi +;; es DEvicestate extends EventSource + +;; ## IMPLEMENTATION +;; ### Action +;; ### AriBuilder +;; ### Oggetti + + + + + + + + + +(defn -main + "I don't do a whole lot ... yet." + [& args] + (println "Hellox, World!")) + +;; ALL KNOWN ARI VERSIONS +(def ARI_VERSIONS + ["ari_0_0_1" + "ari_1_0_0" + "ari_1_5_0" + "ari_1_6_0" + "ari_1_5_0" + "ari_1_7_0" + "ari_1_8_0" + ]) + + +(def ARI-VERSIONS-KW + (vec (map keyword ARI_VERSIONS))) + +;; ALL KNOWN ARI FILES +(def ALL_FILES + {"applications" {}, + "asterisk" {}, + "bridges" {}, + "channels" {}, + "deviceStates" {}, + "events" {} + "playbacks" {} + "sounds" {} + "endpoints" {} + "mailboxes" {} + "recordings" {} + + + }) + + +(def ALL-FILES-KW + (vec (map keyword (keys ALL_FILES)))) + +;; READ ARI FOLDER as JSON +(defn loadResourceFile + "Loads a resource file as plain text; if missing, + returns the default contents" + [resource-path default-if-missing] + (let [resource (clojure.java.io/resource resource-path) + contents (cond + (nil? resource) default-if-missing + :else (slurp resource))] + contents)) + + +(defn readJson + "Loads a JSON file as a Clojure structure. + e.g. + (readJson \"ari_0_0_1\" \"applications\") + " + [ariVersion filename] + (let [file (str ariVersion "/" filename ".json") + data (loadResourceFile file "{}")] + (json/read-str data :key-fn keyword))) + +(defn readJsonAsStruct + "Legge un file json come + {:ari {:filename {...data...}}}" + [ariVersion filename] + (let [kVer (keyword ariVersion) + kFnam (keyword filename) + data (readJson ariVersion filename)] + + {kVer {kFnam data}})) + + + +(defn readKnownFilesForVersion + "Loads all known files for a given version" + [acc ariVersion] + (let [files (keys ALL_FILES) + redLoadFile (fn [acc filename] + (assoc-in acc [(keyword ariVersion) + (keyword filename)] + (readJson ariVersion filename)))] + (reduce redLoadFile acc files))) + + +(defn readAll + "Reads all files for all known Asterisk versions" + [] + (reduce readKnownFilesForVersion {} ARI_VERSIONS)) + + +(defn allFilesAllAris + "Ritorna tuple di tutte le permutazioni di file e di tutte le ARI, + anche quelle che non esistono" + [] + (for [ari ARI_VERSIONS + file (keys ALL_FILES)] + [(keyword ari) (keyword file)])) + + +(defn mkFnSignature + "Creates a list of signatures for each file" + [apiOp] + + ) + + + +(defn write$interfaces [DB] + (for [file ALL-FILES-KW] + + (let [signatures (meth/allSigsForInterface DB file ARI-VERSIONS-KW)] + (javagen/writeInterface + file + "--comment--" + (vals signatures))))) + +(defn write$modelInterfaces [DB] + (for [file ALL-FILES-KW] + (let [signatures (meth/allModelsForAriFile DB file ARI-VERSIONS-KW)] + (javagen/writeInterface + file + "--comment--" + (vals signatures))))) + + + + +(defn run$ + [] + (let [DB (readAll)] + (do + (write$interfaces DB) + ;(write$models DB) + + ))) + + + + + +;; How is this supposed to be working? +;; 1. we read the contents of known files in all +;; ari interface bindings. So we have all we need. +;; 2. we build the interface definitions. These are obtained by +;; joining together all forms of all methods. +;; 3. we build events +;; 4. we build ??? +;; 5. for each version of the interface, we build ... + + +;; READ ALL METHODS +;; (def DT (readAll)) +;; apis is an array +;; (get-in DT [:ari_1_0_0 :asterisk :apis 0 :operations]) + +;; READS ALL MODELS +;; (keys (get-in DT [:ari_1_0_0 :asterisk :models])) +;; a specific model +;; (get-in DT [:ari_1_0_0 :asterisk :models :BuildInfo]) + + + + +;; SVILUPPO diff --git a/codegen3/src/codegen3/javagen.clj b/codegen3/src/codegen3/javagen.clj new file mode 100644 index 00000000..e2ff4c3a --- /dev/null +++ b/codegen3/src/codegen3/javagen.clj @@ -0,0 +1,693 @@ +(ns codegen3.javagen + (:require [clojure.data.json :as json] + [clojure.string :as str] + [orchestra.spec.test :as orchestra] + [clojure.spec.alpha :as s])) + +;(def BASE-CLASS-PATH "./gen-java") +(def BASE-CLASS-PATH "../classes") + +(def PREAMBLE + (str " - (clj) THIS CLASS IS AUTOMATICALLY GENERATED - \n" + " - - PLEASE DO NOT EDIT MANUALLY - - \n\n" + " Generated on: " (.toString (java.util.Date.)) + "\n\n")) + + + +;ch.loway.oss.ari4java.generated +;(def BASE-GEN-PKG "gg") +(def BASE-GEN-PKG "ch.loway.oss.ari4java.generated") + +(def IMPORTS-INTERFACE [ + "java.util.Date" + "java.util.List" + "java.util.Map" + "java.util.ArrayList" + "ch.loway.oss.ari4java.tools.RestException" + "ch.loway.oss.ari4java.tools.AriCallback" + "ch.loway.oss.ari4java.tools.tags.*"]) + + + +;(genclassfile {:package "a.b.c" +; :classname "Pippon" +; :imports ["java.w"] +; :implements ["tool", "tool2"] +; :extends "base" +; :functions [ +; { :method "pippo" +; :returns "void" +; :args [ {:type "int" :name "pippo +; {:type "String" :name "plut"}] +; :notes ["yoo"]} +; ] +; :stanzas ["m;" ] } ) + + +; ============= SPECS ============ + +(defn existing-string? [s] + (and (string? s) + (pos? (count s)))) + +(defn optional-bool? [b] + (or nil? boolean?)) + +(defn optional-existing-string? [s] + (or nil? existing-string?)) + + +(s/def ::attr (s/and #(existing-string? (:name %)) + #(existing-string? (:type %)))) + + +(s/def ::method existing-string?) +(s/def ::returns existing-string?) +(s/def ::isPrivate boolean?) +(s/def ::args (s/coll-of ::attr)) +(s/def ::notes string?) +(s/def ::body string?) +(s/def ::isAbstract boolean?) +(s/def ::annotation string?) +(s/def ::throws (s/coll-of existing-string?)) + +(s/def ::methodBody + (s/keys :req-un [::method ::returns ::isPrivate ::args ::notes + ::body ::isAbstract ] + :opt-un [::annotation ::throws])) + + +(s/def ::classname existing-string?) +(s/def ::isInterface boolean?) +(s/def ::isEnum boolean?) +(s/def ::package existing-string?) +(s/def ::imports (s/coll-of existing-string?)) +(s/def ::implements (s/coll-of existing-string?)) +(s/def ::extends existing-string?) + +(s/def ::functions (s/coll-of ::methodBody)) + +(s/def ::stanza existing-string?) +(s/def ::stanzas (s/coll-of ::stanza)) + +(s/def ::classFile + (s/keys :req-un [::classname ::isInterface + ::package ::imports + ::notes ::functions] + :opt-un [::isEnum ::implements ::extends ::stanzas] + + )) + + +; ================================= + +(defn camelNameInner + "Creates a camelName - es getDate by joining 'get' (prefix) + and 'date' (value)" + [p v fnTrasformer] + {:pre [(pos? (count v))]} + (str p + (fnTrasformer (subs v 0 1)) + (subs v 1))) + +(s/fdef + camelNameInner + :args (s/cat :p string? + :v existing-string? + :fnTrasformer ifn?) + :ret string?) + + +(defn camelName + "Creates a camelName - es getDate by joining 'get' (prefix) + and 'date' (value)" + [p v] + (camelNameInner p v str/upper-case)) + +(s/fdef + camelName + :args (s/cat :p string? + :v (s/and string? #(-> % count pos?)))) + + + + +(defn className + "A class' name is uppecased" + [c] + (camelName "" c)) + +(s/fdef + className + :args (s/cat :c (s/and string? #(-> % count pos?)))) + + + +(defn lcName [c] + (camelNameInner "" c str/lower-case)) + +(s/fdef + lcName + :args (s/cat :c (s/and string? #(-> % count pos?)))) + + +(defn mkSection + "Crea una sezione con prefisso e suffisso. + Items puo' essere: + - nil o vettore vuoto: non fa nulla + - uno scalare: aggiunge solo una volta + - un vettore: aggiunge n volte" + [itemprefix itempostfix items] + (let [i2 (cond + (string? items) [items] + :else (vec items))] + (reduce + #(str %1 itemprefix %2 itempostfix) + "" + i2))) + +(s/fdef + mkSection + :args (s/cat :itemprefix string? + :itempostfix string? + :items (s/or :nil nil? + :onestr string? + :manystr (s/coll-of string?))) + :ret string? + ) + + + + +(defn mkImports + "Creates import section." + [lImports] + (mkSection "import " ";\n" lImports)) + +(s/fdef + mkImports + :args (s/cat :lImports (s/coll-of string?))) + + +(defn indent-prefix + "Adds a given prefix to a block of text (string). + Returns the string with prefix applied. " + [prefix text] + (cond + (nil? text) (indent-prefix prefix "") + :else (str/join "\n" + (map #(str prefix %) (str/split-lines text)))) + + ) + +(s/fdef + indent-prefix + :args (s/cat :prefix string? + :text string?) + :ret string?) + + +(defn indent + "Indents a text by three spaces" + [text] + (indent-prefix " " text)) + +(s/fdef + indent + :args (s/cat :text string?)) + + +(defn mkComment + "Creates a Java comment. + Receives one string of (multi-line) text." + [text] + (cond + (nil? text) (mkComment "") + :else (let [STARS "************************************************"] + (str "/" STARS "\n" + (indent-prefix " * " text) "\n" + " " STARS "/" "\n\n" + )))) + +(s/fdef + mkComment + :args (s/cat :text string?)) + + +(defn genAttr + "Generate an attribute. Checks that :type and :name are defined." + [{t :type n :name}] + (str t " " n)) + +(s/fdef + genAttr + :args (s/cat :input ::attr)) + +(defn genAttrs + "The attributes for a method. + data is a list of attributes." + [data] + (let [signatures (map genAttr data)] + (str/join ", " signatures))) + +(s/fdef + genAttrs + :args (s/cat :data (s/coll-of ::attr))) + +(defn genMethodBody + "Creates a Java method + :method + :returns + :isPrivate if undefined, public + :args [{:type :name}] + :notes + :body + :isAbstract + :annotation + :throws [eccezioni] + " + [data] + (let [{:keys [method returns isPrivate args notes body isAbstract annotation throws]} data] + (str + "\n\n" + (mkComment notes) + (if annotation (str annotation "\n") "") + (if isPrivate "private " "public ") + returns " " + method "(" + (genAttrs args) + ")" + ; throws + (if (pos? (count throws)) + (str " throws " + (str/join ", " throws)) + "" + ) + + (if isAbstract + ";" + (str + "{\n" + (indent body) + "\n" + "}")) + "\n" + + ))) + + +(s/fdef + genMethodBody + :args (s/cat :data ::methodBody) + :ret existing-string? + ) + + + + +(defn genFilename + "Returns the relative filename of a package + class" + [pkgName kName] + (let [pkg (str/replace pkgName "." "/")] + (str pkg "/" kName ".java"))) + + +(s/fdef + genFilename + :args (s/cat :pkgName existing-string? + :kName existing-string?)) + + + +(defn genClassFile + " + Given a data structure that describes + our own class, creates a text file containing + the class itself and a proposed text file. + + + Inputs + :classname the class name + :isInterface + :isEnum + :package the package name + :imports a list of imports + :implements a list of implementations + :extends the class to extend + :notes the class comments (version etc) + :functions a list of methods to implement (may be empty) + :stanzas a list of text to implement (added after the methods) + + Output + :body the textual class in Java + :filename the file name to store it to + " + [data] + (let [{:keys [classname isInterface isEnum package imports implements extends notes functions stanzas]} data] + {:filename (genFilename package classname) + :body + (str + "package " package ";\n\n" + (mkImports imports) + "\n" + (mkComment (str PREAMBLE notes)) + "public " + (cond + isInterface " interface " + isEnum " enum " + :else " class ") + + classname + (mkSection " extends " "" extends) + (mkSection " implements " " " implements) + + " {\n" + + (mkSection "" "\n\n" stanzas) + (mkSection "" "\n\n" (map #(indent (genMethodBody %)) functions)) + + "}\n\n") + } + )) + +(s/fdef + genClassFile + :args (s/cat :data ::classFile) + :ret (s/and #(existing-string? (:filename %)) + #(existing-string? (:body %))) + ) + + +(def knownSwaggerTypes + "These Swagger types match a Java type directly." + + { + "string" "String", + "long" "long", + "int" "int", + "double" "double", + "date" "Date", + "object" "String", + "boolean" "boolean", + "containers" "Map" + }) + + + +(defn swagger->java + "Turns a Swagger type into a matching Java type. + We need to know if we are asking for a concrete implementation + or an interface (as for native objects this is different) + so we set the API version when we require a concrete + implementation. + " + [sw-type api-version] + (let [inList (get (re-matches #"^List\[(.+)\]$" sw-type) 1) + known (knownSwaggerTypes sw-type) + concrete? (pos? (count api-version))] + (cond + inList (str "List<" (swagger->java inList api-version) ">") + known known + :else (if concrete? + (str sw-type "_impl_" api-version) + sw-type)))) + +;; DATA CLASSES +;; Only containers for data. + + +(defn notImplemented + [] + (str "throw new IllegalArgumentException(\"This version of ARI does not support this field\");")) + +(defn mkSetterTypeAnnotation + "If type is List, Jackson needs a type hint + to deserialize elements because it does not see + the elided signature. + + @JsonDeserialize( contentAs=String.class ) + public void setBridge_ids(List val ) + + + " + + [t] + (let [inList (get (re-matches #"^List<(.+)>$" t) 1)] + (cond + inList (str "@JsonDeserialize( contentAs=" inList ".class )") + :else "" + + ))) + + +(defn mkGetterVal [field] + (let [{t :type v :name c :comment ni :notimplemented io :interfaceonly} field] + { + :method (camelName "get" v) + :returns t + :args [] + :notes (str "get " v "\n" c) + :isAbstract (= true io) + :body (cond + (true? io) + "" + (true? ni) + (notImplemented) + :else + (str "return this." v ";")) + })) + +(s/fdef + mkGetterVal + :args (s/cat :field existing-string?) + :ret ::methodBody) + + +(defn mkSetterVal [field] + (let [{t :type v :name c :comment ni :notimplemented io :interfaceonly} field] + { + :method (camelName "set" v) + :returns "void" + :args [field] + :annotation (cond + (true? io) nil + :else (mkSetterTypeAnnotation t)) + :notes (str "sets " v "\n" c) + :isAbstract (= true io) + :body (cond + (true? io) + "" + (true? ni) + (notImplemented) + :else + (str "this." v " = " v ";")) + })) + +(s/fdef + mkSetterVal + :args (s/cat :field existing-string?) + :ret ::methodBody) + + +(defn mkPrivateField [acc field] + (let [{t :type v :name} field] + + (conj acc + (str "private " t " " v ";")) + )) + + +(defn mkGettersSetters + "da usare con reduce" + [funcs field] + (conj funcs + (mkGetterVal field) + (mkSetterVal field)) + ) + + +(defn mkCommonDataClass + [package klass extends implements imports notes] + { + :classname klass + :package package + :extends extends + :implements implements + :imports imports + :notes notes + }) + +(s/fdef + mkGetterVal + :args (s/cat :package existing-string? + :classname existing-string? + :extends string? + :implements string? + :imports (s/coll-of string?) + :notes string?) + :ret ::classFile) + + + +(defn sortFields + "We keep fields in a sorted order so they + don't bounce around in different builds." + [lfields] + (sort-by :name lfields)) + + +(defn mkDataClassInterface + [package klass extends implements imports notes lfields] + (into + (mkCommonDataClass package klass extends implements imports notes) + { + :isInterface true + :functions (reduce mkGettersSetters [] (sortFields lfields)) + })) + + +(defn mkDataClass + " + (mkDataClass p c n + [{:type int :name pluto} + {:type String :name pippo}] + )" + + [package klass extends implements imports notes lfields] + (into + (mkCommonDataClass package klass extends implements imports notes) + + + { + :functions (reduce mkGettersSetters [] (sortFields lfields)) + :stanzas (reduce mkPrivateField [] (sortFields lfields)) + })) + + +(defn mkDataClassForModelClass + "Crea una data class" + [{:keys [id properties]}] + (let [newProps (map (fn [[k v]] + [:name (str k) + :type (:type v)]) + properties)] + + + + ) + + + + + ) + + +(defn mkEnumEntry + "Creates an enum entry. + e.g. 'hold' -> HOLD('hold') + '*' -> STAR('*') + + The title is uppercased + and * and # are translated. + " + [v] + + (let [t (-> v + (str/replace "*" "STAR") + (str/replace "#" "POUND") + (str/upper-case))] + (str " " t "(\"" v "\") "))) + + + +(defn mkEnum + [package klass notes values] + + { + :isEnum true + :classname (className klass) + :package package + :notes notes + :stanzas [(str/join ",\n " (map mkEnumEntry (sort values))) + ";" + "public final String value;" + (str "private " (className klass) "(String v) { this.value = v; }") + "public String toString() { return this.value; }" + + ] + } + + ) + + + +(defn writeOutKlass + "Generates and writes a classfile on disk. + Returns the filename." + [klass] + (let [{:keys [filename body]} (genClassFile klass) + realPath (str BASE-CLASS-PATH "/" filename)] + (clojure.java.io/make-parents realPath) + (spit realPath body) + realPath)) + +(s/fdef + writeOutKlass + :args (s/cat :klass ::classFile) + :ret string?) + + + +(defn writeInterface + "Una interfaccia è scritta su disco + sulla base del nome del file e dei metodi" + [file comments meths] + (let [klass { + :classname (camelName "Action" (name file)) + :isInterface true + :package BASE-GEN-PKG + :imports IMPORTS-INTERFACE + ;:implements "" + ;:extends the class to extend + :notes comments + :functions meths + ;:stanzas a list of text to implement (added after the methods) + }] + (writeOutKlass klass))) + + + + + + +;(writeOutKlass +; (mkDataClass "p.k.g" "c" "no" +; [{:type "int" :name "pluto"} {:type "String" :name "pippno"}] )) + + + + + + + + + + + + + + + + + + + + +;; CREATE FILE +;; (let [file-name "path/to/whatever.txt"] +;; (make-parents file-name) +;; (spit file-name "whatever")) + + +(orchestra/instrument) \ No newline at end of file diff --git a/codegen3/src/codegen3/methods.clj b/codegen3/src/codegen3/methods.clj new file mode 100644 index 00000000..0bfa07a5 --- /dev/null +++ b/codegen3/src/codegen3/methods.clj @@ -0,0 +1,251 @@ +(ns codegen3.methods + (:require [clojure.data.json :as json] + [codegen3.javagen :as javagen] + [codegen3.signatures :as sgn]) + (:gen-class) ) + + +;; Il metodo di base si aspetta: +;; :path +;; :descr +;; :op (che è una sola delle operations) + + +; { +; "path": "/applications/{applicationName}", +; "description": "Stasis application", +; "operations": [ +; { +; "httpMethod": "GET", +; "summary": "Get details of an application.", +; "nickname": "get", +; "responseClass": "Application", +; "parameters": [ +; { +; "name": "applicationName", +; "description": "Application's name", +; "paramType": "path", +; "required": true, +; "allowMultiple": false, +; "dataType": "string" +; } +; ], +; "errorResponses": [ +; { +; "code": 404, +; "reason": "Application does not exist." +; } +; ] +; } +; ] +; } + + +(defn mkParm + "Dato un elemento parameters e un tipo di espansione, ritorna il + parametro in formato {:type :name :comment}" + [parm exp] + (let [n (:name parm) + t (javagen/swagger->java (:dataType parm) "") + c (:description parm)] + {:type t + :name n + :comment c})) + + +(defn baseSignature + "La signature di base, senza callback" + [path descr op] + (let [nick (:nickname op) + summary (str descr "\n" (:summary op)) + response (javagen/swagger->java (:responseClass op) "") + parms (:parameters op)] + { + :method nick + :returns response + :isPrivate false + :args (mapv #(mkParm % "") parms) + :notes summary + :body "" + :isAbstract true + :throws ["RestException"] + })) + + +(defn allSignsForPath + "Per un path dato, tutte le sue signatures" + [path-str] + (let [path (:path path-str) + des (:description path-str) + ops (:operations path-str)] + (map #(baseSignature path des %) ops))) + + +(defn javaField + " + Trasforma una descrizione d un field ARI in una Java. + + Esempi ARI: + + {:id {:type 'string', :description '..', :required true}} + + {:type `string`, :description `Type of bridge technology`, :required true, :allowableValues {:valueType `LIST`, :values [`mixing` `holding`]}} + + {:type `List[string]`, :description `Ids of channels participating in this bridge`, :required true} + + quelle JAva sono + {:type ... :name ....} + + " + + [ariNameSymbol ariField] + (let [atype (:type ariField) + jtype (javagen/swagger->java atype "") + jname (name ariNameSymbol)] + {:type jtype + :name jname + :comment "xxx"} + )) + + +(defn modelFromFile + " + Genera un modello partendo da un descrittore. + " + [ariModel] + (let [cName (:id ariModel) + pkg "-" + nota (:description ariModel) + fieldsAri (:properties ariModel) + fieldsJava (map #(javaField (first %) (second %) ) fieldsAri)] + + (javagen/mkDataClass pkg cName nota fieldsJava) + + )) + + +(defn allModelsForAriFile + " + Genera i modelli per questo file. + + codegen3.core> (keys (get-in _db [:ari_1_0_0 :bridges :models :Bridge])) + (:id :description :properties) + codegen3.core> (keys (get-in _db [:ari_1_0_0 :bridges :models :Bridge :properties])) + (:id :technology :bridge_type :bridge_class :creator :name :channels) + + + " + [db ari-ver file] + + ;; VEDI SOTTO + (let [models (get-in db [ari-ver file :models]) + modelData (map #(modelFromFile (second %)) models) + ] + modelData + + )) + + + + + +(defn allSigsForAriFile + "Tutte Le Signatures Per un file dato di una versione ari data" + [db ari-ver file] + (let [file-paths (get-in db [ari-ver file :apis])] + (flatten (mapv allSignsForPath file-paths)))) + + +(defn- rdc-addSigToMap + [acc sig] + (let [k (sgn/getMethodSignature sig)] + (assoc-in acc [k] sig))) + + +(defn allSigsForInterface + "Tutte le signatures per creare un'interfaccia. + Per calcolarle: + - cerco le signatures per tutte le versioni note dell'ari + - le rendo univoche sulla base della loro signature java + Restituisco un hash la cui chiave è la sig Java ed il contenuto è + il metodo. + " + [DB file ari-versions] + (let [all-possible-sgns + (reduce into [] + (map #(allSigsForAriFile DB % file) ari-versions))] + (reduce rdc-addSigToMap {} all-possible-sgns) + + )) + + +(defn reduceSigsForModel + "Data una lista di modelli, li unifica per nome + tenendo tutte le loro proprties" + + [lModels] + + ;(group-by :id lModels) + + (reduce (fn [acc m] + (let [model-id (:id m) + model-in-acc (get acc model-id {:id model-id + :properties {}}) + curr-props (:properties model-in-acc) + props (:properties m) + new-props (merge curr-props props) + new-model (assoc model-in-acc :properties new-props) + ;_ (prn "Merging " model-in-acc m) + ] + + (assoc acc model-id new-model) + + )) + {} lModels) + + ) + + +(defn allSigsForModels + " + Ottiene tutte le signatures per tutti i modelli + ricostruendole nelle varie versioni dell'ARI. + + Ritorna una sequenza di modelli del tipo: + + \"ChannelLeftBridge\" {:id \"ChannelLeftBridge\", + :properties {:bridge {:required true, :type \"Bridge\"}, :channel {:required true, :type \"Channel\"}}},\n \"EndpointStateChange\" {:id \"EndpointStateChange\", :properties {:endpoint {:required true, :type \"Endpoint\"}}}}\n + + + + " + [DB ari-versions] + + + + (vals (reduceSigsForModel + (flatten + (for [ari ari-versions] + (let [appmods (vals (get-in DB [ari :applications :models])) + evtmods (vals (get-in DB [ari :events :models])) + allmods (into appmods evtmods)] + allmods + + )))))) + + + + + +;(def DB (readAll)) +;(reduce into #{} (map #(allSigsForAriFile DB % :applications) +; [:ari_0_0_1 :ari_1_0_0]))) + + + + + + + + + diff --git a/codegen3/src/codegen3/signatures.clj b/codegen3/src/codegen3/signatures.clj new file mode 100644 index 00000000..a18e64cb --- /dev/null +++ b/codegen3/src/codegen3/signatures.clj @@ -0,0 +1,157 @@ +(ns codegen3.signatures + (:require [clojure.spec.alpha :as s] + ; [clojure.spec.gen.alpha :as gen] + [orchestra.spec.test :as st] + [codegen3.javagen :as jg] + [clojure.string :as str]) + (:gen-class)) + +;; compares method signatures +;; generate permutations + +; :method (camelName "get" v) +; :returns t +; :args [{:type :name}] +; :notes (str "get " v) +; :body (str "return this." v ";") + + +(defn getMethodSignature + "Gets a Java signature as an array for our method + e.g. public int pippo(int a, int b) -> + [int pippo int int] + " + [{n :method t :returns a :args}] + (let [args (map :type a) + start [t n]] + (into start args))) + +(defn getSignaturesForClass + "Returns a list of signatures for my class" + [{lFuncs :functions}] + (map getMethodSignature lFuncs) + ; AGGIUNGERE ASSERTIONS: metodi unici + ) + + + +; ////////////////// +(defn existing-string? [s] + (and (-> s string?) + (-> s count pos?))) + +(s/def ::name existing-string?) +(s/def ::required boolean?) +(s/def ::allowMultiple boolean?) +(s/def ::dataType existing-string?) +(s/def ::fnparms (s/keys :req-un [::name ::required ::allowMultiple ::dataType] )) + + +(def ARICALLBACK "AriCallback") + +; The most basic method (the one that has a full implementaion) +; is the one with multiple items and the ARI callback. +; When that is created, we create its aliases. + +; (a int, b +str) +; -> +; (a int, b Collection, AriCallBack cb) +; (a int, b str, AriCallBack) +; (a int, b Collection ) +; (a int, b str) + +(defn string-perms + "Given an array of arrays of choices, produces + all permutations. + nil is a valid entry and will be removed, e.g. + + (string-perms [[:a :b] [:c] [:d nil]] ) + => [[:a :c :d] [:a :c] [:b :c :d] [:b :c]] + " + ; use the single-parm version + ([erest] + (mapv :x (flatten (string-perms [] erest)))) + + ; creates a seq of seqs + ([ehead erest] + (let [;_ (prn "H:" ehead " R:" erest " N:" (empty? erest)) + vs (first erest)] + (cond + (empty? erest) + [{:x (filterv some? ehead)}] ; remove nils + :else + (map + #(string-perms (conj ehead %) (rest erest)) + vs) + )))) + + +(s/fdef string-perms + :args + (s/or + :arity1 (s/coll-of (s/and sequential? + ;#(pos? (count %)) + ) + :kind sequential? ) + :arity2 (s/cat :ehead sequential? + :erest sequential?))) + + +(defn explode-parms-permutations + "Given a set of paramer types and whether they are multiple, + builds possible permutations" + [parms] + (vec + (for [{:keys [allowMultiple dataType]} parms + :let [jDataType (jg/swagger->java dataType "")]] + (cond + (true? allowMultiple) + [(str "Collection<" jDataType ">") jDataType] + :else + [jDataType])))) + +(s/fdef explode-parms-permutations + :args (s/cat :parms (s/coll-of ::fnparms :kind sequential? ))) + +(defn explode-parms + "Returns all possible parameter permutations" + [parms] + (let [permutables (explode-parms-permutations parms) + wAriCB (into permutables [[ARICALLBACK nil]])] + (string-perms wAriCB))) + +(s/fdef explode-parms + :args (s/cat :parms (s/coll-of ::fnparms :kind sequential? ))) + +(defn hasCallback? + "Does this signature include the ARI CB" + [parms] + (= (last parms) ARICALLBACK)) + +(defn isMasterImplementation? + "It is a 'master' implementation if: + - has AriCallback + - all multiple parameters are expressed as Collection + " + [parms lJavaTypes] + (cond + (hasCallback? lJavaTypes) + ; check if thea are all true at the same time + (= (map :allowMultiple parms) + (map #(str/starts-with? % "Collection") (butlast lJavaTypes))) + + :else + false + + )) + +(s/fdef isMasterImplementation? + :args (s/cat :parms (s/coll-of ::fnparms :kind sequential? ) + :javaTypes (s/coll-of existing-string? :kind sequential?) + ) + + ) + + +;; Orchestra +(st/instrument) \ No newline at end of file diff --git a/codegen3/test/codegen3/ari4java_test.clj b/codegen3/test/codegen3/ari4java_test.clj new file mode 100644 index 00000000..eccbbcdd --- /dev/null +++ b/codegen3/test/codegen3/ari4java_test.clj @@ -0,0 +1,54 @@ +(ns codegen3.ari4java-test + (:require [clojure.test :refer :all] + [codegen3.ari4java :refer :all])) + + + +(deftest test-merge-property + (testing "Empty property" + (is (= {:type "a" :versions ["v1"] :name "pippo"} + (merge-property nil {:type "a"} "pippo" "v1") + ))) + + (testing "Existing property" + (is (= {:type "a" :versions ["v1" "v2"] :name "pippo"} + (merge-property + {:type "a" :versions ["v1"] :name "pippo"} + {:type "a"} "pippo" "v2") + ))) + + (testing "Different type" + (is (= "ExcRaised" + (try + (merge-property + {:type "a" :versions ["v1"] :name "pippo"} + {:type "x"} "pippo" "v2") + (catch IllegalArgumentException e + "ExcRaised")) ))) + + ) + + +(def modelProps + + [{:cljid :StasisEnd, + :ver :ari_0_0_1, + :isevt true, + :id "StasisEnd", + :description "Notification that a channel has left a Stasis application.", + :properties {:channel {:required true, :type "Channel"}}} + {:cljid :StasisEnd, + :ver :ari_1_0_0, + :isevt true, + :id "StasisEnd", + :description "Notification that a channel has left a Stasis application.", + :properties {:channel {:required true, :type "Channel"}}} ]) + +(deftest test-props-set + (testing "" + (is (= {:versions [:ari_0_0_1 :ari_1_0_0] + :name :channel + :required true, :type "Channel"} + (props-set modelProps :channel) + ))) + ) diff --git a/codegen3/test/codegen3/core_test.clj b/codegen3/test/codegen3/core_test.clj new file mode 100644 index 00000000..7bdd94f1 --- /dev/null +++ b/codegen3/test/codegen3/core_test.clj @@ -0,0 +1,7 @@ +(ns codegen3.core-test + (:require [clojure.test :refer :all] + [codegen3.core :refer :all])) + +(deftest a-test + (testing "FIXME, I dont fail." + (is (= 1 1)))) diff --git a/codegen3/test/codegen3/javagen_test.clj b/codegen3/test/codegen3/javagen_test.clj new file mode 100644 index 00000000..9ddaa0c5 --- /dev/null +++ b/codegen3/test/codegen3/javagen_test.clj @@ -0,0 +1,65 @@ +(ns codegen3.javagen-test + (:require [clojure.test :refer :all] + [codegen3.javagen :refer :all])) + +(deftest mkSection-nil + (testing "mkSection con Nil" + (is (= "" (mkSection "<" ">" nil))))) + +(deftest mkSection-emptyString + (testing "mkSection con stringa vuota" + (is (= "<>" (mkSection "<" ">" ""))))) + +(deftest mkSection-string + (testing "mkSection con stringa non vuota" + (is (= "" (mkSection "<" ">" "a"))))) + +(deftest mkSection-list + (testing "mkSection con stringa vuota" + (is (= "" (mkSection "<" ">" ["a" "b" "c"]))))) + +(deftest camelName-samples + (testing "esempio base" + (is (= "getBelloCiao" (camelName "get" "belloCiao" )))) + (testing "un solo carattere" + (is (= "getX" (camelName "get" "x" )))) ) + + + +(deftest typeTranslator-basics + (testing "esempio base: string" + (is (= "String" (swagger->java "string" "")))) + (testing "esempio base: List of string" + (is (= "List" (swagger->java "List[string]" "")))) + (testing "object: abstract" + (is (= "Pluto" (swagger->java "Pluto" "")))) + (testing "object:concrete" + (is (= "Pluto_impl_V1" (swagger->java "Pluto" "V1")))) + +) + + +(deftest classFileName + (testing "Plain sample" + (is (= "a/b/c.java" (genFilename "a.b" "c"))))) + + +(deftest genAttributesTest + (testing "One attribute" + (is (= "int P" (genAttrs [{:name "P" :type "int"}]) ))) + (testing "Multiple attribute" + (is (= "int P, String Q" + (genAttrs [{:name "P" :type "int"} {:name "Q" :type "String"}]) ))) + + ) + + +(deftest testTypeAnnotation + (testing "Anotazioni" + (is (= "@JsonDeserialize( contentAs=String.class )" + (mkSetterTypeAnnotation "List"))) + (is (= "" + (mkSetterTypeAnnotation "String"))) + + )) + diff --git a/codegen3/test/codegen3/methods_test.clj b/codegen3/test/codegen3/methods_test.clj new file mode 100644 index 00000000..8a4d6ac4 --- /dev/null +++ b/codegen3/test/codegen3/methods_test.clj @@ -0,0 +1,16 @@ +(ns codegen3.methods-test + (:require [clojure.test :refer :all] + [codegen3.methods :refer :all])) + +(def PARM {:name "applicationName" + :description "descr" + :paramType "path" + :required true + :allowMultiple false + :dataType "string" }) + + +(deftest plainParm + (testing "Parametro semplice, tipo nativo" + (is (= {:type "String", :name "applicationName", :comment "descr"} + (mkParm PARM :PLAIN))))) diff --git a/codegen3/test/codegen3/sample_db.clj b/codegen3/test/codegen3/sample_db.clj new file mode 100644 index 00000000..b1b344bc --- /dev/null +++ b/codegen3/test/codegen3/sample_db.clj @@ -0,0 +1,680 @@ +(ns codegen3.sample-db + (:require + [clojure.test :refer :all] + [com.rpl.specter :as sr])) + + +;; + + + + +(def DB + {:ari_0_0_1 {:applications {:swaggerVersion "1.1", + :resourcePath "/api-docs/applications.{format}", + :_svn_revision "$Revision: 403134 $", + :models {:Application {:id "Application", + :description "Details of a Stasis application", + :properties {:name {:type "string", + :description "Name of this application", + :required true}, + :channel_ids {:type "List[string]", + :description "Id's for channels subscribed to.", + :required true}, + :bridge_ids {:type "List[string]", + :description "Id's for bridges subscribed to.", + :required true}, + :endpoint_ids {:type "List[string]", + :description "{tech}/{resource} for endpoints subscribed to.", + :required true}, + :device_names {:type "List[string]", + :description "Names of the devices subscribed to.", + :required true}}}}, + :_author "David M. Lee, II ", + :apis [{:path "/applications", + :description "Stasis applications", + :operations [{:httpMethod "GET", + :summary "List all applications.", + :nickname "list", + :responseClass "List[Application]"}]} + {:path "/applications/{applicationName}", + :description "Stasis application", + :operations [{:httpMethod "GET", + :summary "Get details of an application.", + :nickname "get", + :responseClass "Application", + :parameters [{:name "applicationName", + :description "Application's name", + :paramType "path", + :required true, + :allowMultiple false, + :dataType "string"}], + :errorResponses [{:code 404, :reason "Application does not exist."}]}]} + {:path "/applications/{applicationName}/subscription", + :description "Stasis application", + :operations [{:httpMethod "POST", + :summary "Subscribe an application to a event source.", + :notes "Returns the state of the application after the subscriptions have changed", + :nickname "subscribe", + :responseClass "Application", + :parameters [{:name "applicationName", + :description "Application's name", + :paramType "path", + :required true, + :allowMultiple false, + :dataType "string"} + {:name "eventSource", + :description "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + :paramType "query", + :required true, + :allowMultiple true, + :dataType "string"}], + :errorResponses [{:code 400, :reason "Missing parameter."} + {:code 404, :reason "Application does not exist."} + {:code 422, :reason "Event source does not exist."}]} + {:httpMethod "DELETE", + :summary "Unsubscribe an application from an event source.", + :notes "Returns the state of the application after the subscriptions have changed", + :nickname "unsubscribe", + :responseClass "Application", + :parameters [{:name "applicationName", + :description "Application's name", + :paramType "path", + :required true, + :allowMultiple false, + :dataType "string"} + {:name "eventSource", + :description "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, device_state:{deviceName}", + :paramType "query", + :required true, + :allowMultiple true, + :dataType "string"}], + :errorResponses [{:code 400, + :reason "Missing parameter; event source scheme not recognized."} + {:code 404, :reason "Application does not exist."} + {:code 409, + :reason "Application not subscribed to event source."} + {:code 422, :reason "Event source does not exist."}]}]}], + :_copyright "Copyright (C) 2013, Digium, Inc.", + :apiVersion "0.0.1", + :basePath "http://localhost:8088/stasis"}, + :events {:swaggerVersion "1.2", + :resourcePath "/api-docs/events.{format}", + :_svn_revision "$Revision: 403134 $", + :models {:ChannelCallerId {:id "ChannelCallerId", + :description "Channel changed Caller ID.", + :properties {:caller_presentation {:required true, + :type "int", + :description "The integer representation of the Caller Presentation value."}, + :caller_presentation_txt {:required true, + :type "string", + :description "The text representation of the Caller Presentation value."}, + :channel {:required true, + :type "Channel", + :description "The channel that changed Caller ID."}}}, + :ChannelVarset {:id "ChannelVarset", + :description "Channel variable changed.", + :properties {:variable {:required true, + :type "string", + :description "The variable that changed."}, + :value {:required true, + :type "string", + :description "The new value of the variable."}, + :channel {:required false, + :type "Channel", + :description "The channel on which the variable was set. + + If missing, the variable is a global variable."}}}, + :StasisEnd {:id "StasisEnd", + :description "Notification that a channel has left a Stasis application.", + :properties {:channel {:required true, :type "Channel"}}}, + :Message {:id "Message", + :description "Base type for errors and events", + :discriminator "type", + :properties {:type {:type "string", + :required true, + :description "Indicates the type of this message."}}, + :subTypes ["MissingParams" "Event"]}, + :ChannelDialplan {:id "ChannelDialplan", + :description "Channel changed location in the dialplan.", + :properties {:channel {:required true, + :type "Channel", + :description "The channel that changed dialplan location."}, + :dialplan_app {:required true, + :type "string", + :description "The application about to be executed."}, + :dialplan_app_data {:required true, + :type "string", + :description "The data to be passed to the application."}}}, + :MissingParams {:id "MissingParams", + :description "Error event sent when required params are missing.", + :properties {:params {:required true, + :type "List[string]", + :description "A list of the missing parameters"}}}, + :ChannelLeftBridge {:id "ChannelLeftBridge", + :description "Notification that a channel has left a bridge.", + :properties {:bridge {:required true, :type "Bridge"}, + :channel {:required true, :type "Channel"}}}, + :ChannelDtmfReceived {:id "ChannelDtmfReceived", + :description "DTMF received on a channel. + + This event is sent when the DTMF ends. There is no notification about the start of DTMF", + :properties {:digit {:required true, + :type "string", + :description "DTMF digit received (0-9, A-E, # or *)"}, + :duration_ms {:required true, + :type "int", + :description "Number of milliseconds DTMF was received"}, + :channel {:required true, + :type "Channel", + :description "The channel on which DTMF was received"}}}, + :StasisStart {:id "StasisStart", + :description "Notification that a channel has entered a Stasis application.", + :properties {:args {:required true, + :type "List[string]", + :description "Arguments to the application"}, + :channel {:required true, :type "Channel"}}}, + :ChannelStateChange {:id "ChannelStateChange", + :description "Notification of a channel's state change.", + :properties {:channel {:required true, :type "Channel"}}}, + :ChannelEnteredBridge {:id "ChannelEnteredBridge", + :description "Notification that a channel has entered a bridge.", + :properties {:bridge {:required true, :type "Bridge"}, + :channel {:type "Channel"}}}, + :Event {:id "Event", + :description "Base type for asynchronous events from Asterisk.", + :properties {:application {:type "string", + :description "Name of the application receiving the event.", + :required true}, + :timestamp {:type "Date", + :description "Time at which this event was created.", + :required false}}, + :subTypes ["DeviceStateChanged" + "PlaybackStarted" + "PlaybackFinished" + "ApplicationReplaced" + "BridgeCreated" + "BridgeDestroyed" + "BridgeMerged" + "ChannelCreated" + "ChannelDestroyed" + "ChannelEnteredBridge" + "ChannelLeftBridge" + "ChannelStateChange" + "ChannelDtmfReceived" + "ChannelDialplan" + "ChannelCallerId" + "ChannelUserevent" + "ChannelHangupRequest" + "ChannelVarset" + "EndpointStateChange" + "StasisEnd" + "StasisStart"]}, + :PlaybackStarted {:id "PlaybackStarted", + :description "Event showing the start of a media playback operation.", + :properties {:playback {:type "Playback", + :description "Playback control object", + :required true}}}, + :RecordingStarted {:id "RecordingStarted", + :extends "Event", + :description "Event showing the start of a recording operation.", + :properties {:recording {:type "LiveRecording", + :description "Recording control object", + :required true}}}, + :ChannelHangupRequest {:id "ChannelHangupRequest", + :description "A hangup was requested on the channel.", + :properties {:cause {:type "int", + :description "Integer representation of the cause of the hangup."}, + :soft {:type "boolean", + :description "Whether the hangup request was a soft hangup request."}, + :channel {:required true, + :type "Channel", + :description "The channel on which the hangup was requested."}}}, + :RecordingFinished {:id "RecordingFinished", + :extends "Event", + :description "Event showing the completion of a recording operation.", + :properties {:recording {:type "LiveRecording", + :description "Recording control object", + :required true}}}, + :DeviceStateChanged {:id "DeviceStateChanged", + :description "Notification that a device state has changed.", + :properties {:device_state {:type "DeviceState", + :description "Device state object", + :required true}}}, + :BridgeCreated {:id "BridgeCreated", + :description "Notification that a bridge has been created.", + :properties {:bridge {:required true, :type "Bridge"}}}, + :ApplicationReplaced {:id "ApplicationReplaced", + :description "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.", + :properties {}}, + :BridgeMerged {:id "BridgeMerged", + :description "Notification that one bridge has merged into another.", + :properties {:bridge {:required true, :type "Bridge"}, + :bridge_from {:required true, :type "Bridge"}}}, + :ChannelCreated {:id "ChannelCreated", + :description "Notification that a channel has been created.", + :properties {:channel {:required true, :type "Channel"}}}, + :BridgeDestroyed {:id "BridgeDestroyed", + :description "Notification that a bridge has been destroyed.", + :properties {:bridge {:required true, :type "Bridge"}}}, + :RecordingFailed {:id "RecordingFailed", + :extends "Event", + :description "Event showing failure of a recording operation.", + :properties {:recording {:type "LiveRecording", + :description "Recording control object", + :required true}}}, + :ChannelUserevent {:id "ChannelUserevent", + :description "User-generated event with additional user-defined fields in the object.", + :properties {:eventname {:required true, + :type "string", + :description "The name of the user event."}, + :channel {:required true, + :type "Channel", + :description "The channel that signaled the user event."}, + :userevent {:required true, + :type "object", + :description "Custom Userevent data"}}}, + :EndpointStateChange {:id "EndpointStateChange", + :description "Endpoint state changed.", + :properties {:endpoint {:required true, :type "Endpoint"}}}, + :ChannelDestroyed {:id "ChannelDestroyed", + :description "Notification that a channel has been destroyed.", + :properties {:cause {:required true, + :description "Integer representation of the cause of the hangup", + :type "int"}, + :cause_txt {:required true, + :description "Text representation of the cause of the hangup", + :type "string"}, + :channel {:required true, :type "Channel"}}}, + :PlaybackFinished {:id "PlaybackFinished", + :description "Event showing the completion of a media playback operation.", + :properties {:playback {:type "Playback", + :description "Playback control object", + :required true}}}}, + :_author "David M. Lee, II ", + :apis [{:path "/events", + :description "Events from Asterisk to applications", + :operations [{:httpMethod "GET", + :upgrade "websocket", + :websocketProtocol "ari", + :summary "WebSocket connection for events.", + :nickname "eventWebsocket", + :responseClass "Message", + :parameters [{:name "app", + :description "Applications to subscribe to.", + :paramType "query", + :required true, + :allowMultiple true, + :dataType "string"}]}]}], + :_copyright "Copyright (C) 2012 - 2013, Digium, Inc.", + :apiVersion "0.0.1", + :basePath "http://localhost:8088/stasis"}}, + :ari_1_0_0 {:applications {:swaggerVersion "1.1", + :resourcePath "/api-docs/applications.{format}", + :_svn_revision "$Revision: 404509 $", + :models {:Application {:id "Application", + :description "Details of a Stasis application", + :properties {:name {:type "string", + :description "Name of this application", + :required true}, + :channel_ids {:type "List[string]", + :description "Id's for channels subscribed to.", + :required true}, + :bridge_ids {:type "List[string]", + :description "Id's for bridges subscribed to.", + :required true}, + :endpoint_ids {:type "List[string]", + :description "{tech}/{resource} for endpoints subscribed to.", + :required true}, + :device_names {:type "List[string]", + :description "Names of the devices subscribed to.", + :required true}}}}, + :_author "David M. Lee, II ", + :apis [{:path "/applications", + :description "Stasis applications", + :operations [{:httpMethod "GET", + :summary "List all applications.", + :nickname "list", + :responseClass "List[Application]"}]} + {:path "/applications/{applicationName}", + :description "Stasis application", + :operations [{:httpMethod "GET", + :summary "Get details of an application.", + :nickname "get", + :responseClass "Application", + :parameters [{:name "applicationName", + :description "Application's name", + :paramType "path", + :required true, + :allowMultiple false, + :dataType "string"}], + :errorResponses [{:code 404, :reason "Application does not exist."}]}]} + {:path "/applications/{applicationName}/subscription", + :description "Stasis application", + :operations [{:httpMethod "POST", + :summary "Subscribe an application to a event source.", + :notes "Returns the state of the application after the subscriptions have changed", + :nickname "subscribe", + :responseClass "Application", + :parameters [{:name "applicationName", + :description "Application's name", + :paramType "path", + :required true, + :allowMultiple false, + :dataType "string"} + {:name "eventSource", + :description "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + :paramType "query", + :required true, + :allowMultiple true, + :dataType "string"}], + :errorResponses [{:code 400, :reason "Missing parameter."} + {:code 404, :reason "Application does not exist."} + {:code 422, :reason "Event source does not exist."}]} + {:httpMethod "DELETE", + :summary "Unsubscribe an application from an event source.", + :notes "Returns the state of the application after the subscriptions have changed", + :nickname "unsubscribe", + :responseClass "Application", + :parameters [{:name "applicationName", + :description "Application's name", + :paramType "path", + :required true, + :allowMultiple false, + :dataType "string"} + {:name "eventSource", + :description "URI for event source (channel:{channelId}, bridge:{bridgeId}, endpoint:{tech}/{resource}, deviceState:{deviceName}", + :paramType "query", + :required true, + :allowMultiple true, + :dataType "string"}], + :errorResponses [{:code 400, + :reason "Missing parameter; event source scheme not recognized."} + {:code 404, :reason "Application does not exist."} + {:code 409, + :reason "Application not subscribed to event source."} + {:code 422, :reason "Event source does not exist."}]}]}], + :_copyright "Copyright (C) 2013, Digium, Inc.", + :apiVersion "1.0.0", + :basePath "http://localhost:8088/stasis"}, + :events {:swaggerVersion "1.2", + :resourcePath "/api-docs/events.{format}", + :_svn_revision "$Revision: 404184 $", + :models {:ChannelCallerId {:id "ChannelCallerId", + :description "Channel changed Caller ID.", + :properties {:caller_presentation {:required true, + :type "int", + :description "The integer representation of the Caller Presentation value."}, + :caller_presentation_txt {:required true, + :type "string", + :description "The text representation of the Caller Presentation value."}, + :channel {:required true, + :type "Channel", + :description "The channel that changed Caller ID."}}}, + :ChannelVarset {:id "ChannelVarset", + :description "Channel variable changed.", + :properties {:variable {:required true, + :type "string", + :description "The variable that changed."}, + :value {:required true, + :type "string", + :description "The new value of the variable."}, + :channel {:required false, + :type "Channel", + :description "The channel on which the variable was set. + + If missing, the variable is a global variable."}}}, + :StasisEnd {:id "StasisEnd", + :description "Notification that a channel has left a Stasis application.", + :properties {:channel {:required true, :type "Channel"}}}, + :Message {:id "Message", + :description "Base type for errors and events", + :discriminator "type", + :properties {:type {:type "string", + :required true, + :description "Indicates the type of this message."}}, + :subTypes ["MissingParams" "Event"]}, + :ChannelDialplan {:id "ChannelDialplan", + :description "Channel changed location in the dialplan.", + :properties {:channel {:required true, + :type "Channel", + :description "The channel that changed dialplan location."}, + :dialplan_app {:required true, + :type "string", + :description "The application about to be executed."}, + :dialplan_app_data {:required true, + :type "string", + :description "The data to be passed to the application."}}}, + :MissingParams {:id "MissingParams", + :description "Error event sent when required params are missing.", + :properties {:params {:required true, + :type "List[string]", + :description "A list of the missing parameters"}}}, + :ChannelLeftBridge {:id "ChannelLeftBridge", + :description "Notification that a channel has left a bridge.", + :properties {:bridge {:required true, :type "Bridge"}, + :channel {:required true, :type "Channel"}}}, + :ChannelDtmfReceived {:id "ChannelDtmfReceived", + :description "DTMF received on a channel. + + This event is sent when the DTMF ends. There is no notification about the start of DTMF", + :properties {:digit {:required true, + :type "string", + :description "DTMF digit received (0-9, A-E, # or *)"}, + :duration_ms {:required true, + :type "int", + :description "Number of milliseconds DTMF was received"}, + :channel {:required true, + :type "Channel", + :description "The channel on which DTMF was received"}}}, + :StasisStart {:id "StasisStart", + :description "Notification that a channel has entered a Stasis application.", + :properties {:args {:required true, + :type "List[string]", + :description "Arguments to the application"}, + :channel {:required true, :type "Channel"}}}, + :ChannelStateChange {:id "ChannelStateChange", + :description "Notification of a channel's state change.", + :properties {:channel {:required true, :type "Channel"}}}, + :ChannelEnteredBridge {:id "ChannelEnteredBridge", + :description "Notification that a channel has entered a bridge.", + :properties {:bridge {:required true, :type "Bridge"}, + :channel {:type "Channel"}}}, + :Event {:id "Event", + :description "Base type for asynchronous events from Asterisk.", + :properties {:application {:type "string", + :description "Name of the application receiving the event.", + :required true}, + :timestamp {:type "Date", + :description "Time at which this event was created.", + :required false}}, + :subTypes ["DeviceStateChanged" + "PlaybackStarted" + "PlaybackFinished" + "RecordingStarted" + "RecordingFinished" + "RecordingFailed" + "ApplicationReplaced" + "BridgeCreated" + "BridgeDestroyed" + "BridgeMerged" + "ChannelCreated" + "ChannelDestroyed" + "ChannelEnteredBridge" + "ChannelLeftBridge" + "ChannelStateChange" + "ChannelDtmfReceived" + "ChannelDialplan" + "ChannelCallerId" + "ChannelUserevent" + "ChannelHangupRequest" + "ChannelVarset" + "EndpointStateChange" + "Dial" + "StasisEnd" + "StasisStart"]}, + :PlaybackStarted {:id "PlaybackStarted", + :description "Event showing the start of a media playback operation.", + :properties {:playback {:type "Playback", + :description "Playback control object", + :required true}}}, + :RecordingStarted {:id "RecordingStarted", + :extends "Event", + :description "Event showing the start of a recording operation.", + :properties {:recording {:type "LiveRecording", + :description "Recording control object", + :required true}}}, + :ChannelHangupRequest {:id "ChannelHangupRequest", + :description "A hangup was requested on the channel.", + :properties {:cause {:type "int", + :description "Integer representation of the cause of the hangup."}, + :soft {:type "boolean", + :description "Whether the hangup request was a soft hangup request."}, + :channel {:required true, + :type "Channel", + :description "The channel on which the hangup was requested."}}}, + :RecordingFinished {:id "RecordingFinished", + :extends "Event", + :description "Event showing the completion of a recording operation.", + :properties {:recording {:type "LiveRecording", + :description "Recording control object", + :required true}}}, + :DeviceStateChanged {:id "DeviceStateChanged", + :description "Notification that a device state has changed.", + :properties {:device_state {:type "DeviceState", + :description "Device state object", + :required true}}}, + :BridgeCreated {:id "BridgeCreated", + :description "Notification that a bridge has been created.", + :properties {:bridge {:required true, :type "Bridge"}}}, + :ApplicationReplaced {:id "ApplicationReplaced", + :description "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.", + :properties {}}, + :BridgeMerged {:id "BridgeMerged", + :description "Notification that one bridge has merged into another.", + :properties {:bridge {:required true, :type "Bridge"}, + :bridge_from {:required true, :type "Bridge"}}}, + :ChannelCreated {:id "ChannelCreated", + :description "Notification that a channel has been created.", + :properties {:channel {:required true, :type "Channel"}}}, + :BridgeDestroyed {:id "BridgeDestroyed", + :description "Notification that a bridge has been destroyed.", + :properties {:bridge {:required true, :type "Bridge"}}}, + :RecordingFailed {:id "RecordingFailed", + :extends "Event", + :description "Event showing failure of a recording operation.", + :properties {:recording {:type "LiveRecording", + :description "Recording control object", + :required true}}}, + :ChannelUserevent {:id "ChannelUserevent", + :description "User-generated event with additional user-defined fields in the object.", + :properties {:eventname {:required true, + :type "string", + :description "The name of the user event."}, + :channel {:required true, + :type "Channel", + :description "The channel that signaled the user event."}, + :userevent {:required true, + :type "object", + :description "Custom Userevent data"}}}, + :EndpointStateChange {:id "EndpointStateChange", + :description "Endpoint state changed.", + :properties {:endpoint {:required true, :type "Endpoint"}}}, + :Dial {:id "Dial", + :description "Dialing state has changed.", + :properties {:caller {:required false, + :type "Channel", + :description "The calling channel."}, + :peer {:required true, + :type "Channel", + :description "The dialed channel."}, + :forward {:required false, + :type "string", + :description "Forwarding target requested by the original dialed channel."}, + :forwarded {:required false, + :type "Channel", + :description "Channel that the caller has been forwarded to."}, + :dialstring {:required false, + :type "string", + :description "The dial string for calling the peer channel."}, + :dialstatus {:required true, + :type "string", + :description "Current status of the dialing attempt to the peer."}}}, + :ChannelDestroyed {:id "ChannelDestroyed", + :description "Notification that a channel has been destroyed.", + :properties {:cause {:required true, + :description "Integer representation of the cause of the hangup", + :type "int"}, + :cause_txt {:required true, + :description "Text representation of the cause of the hangup", + :type "string"}, + :channel {:required true, :type "Channel"}}}, + :PlaybackFinished {:id "PlaybackFinished", + :description "Event showing the completion of a media playback operation.", + :properties {:playback {:type "Playback", + :description "Playback control object", + :required true}}}}, + :_author "David M. Lee, II ", + :apis [{:path "/events", + :description "Events from Asterisk to applications", + :operations [{:httpMethod "GET", + :upgrade "websocket", + :websocketProtocol "ari", + :summary "WebSocket connection for events.", + :nickname "eventWebsocket", + :responseClass "Message", + :parameters [{:name "app", + :description "Applications to subscribe to.", + :paramType "query", + :required true, + :allowMultiple true, + :dataType "string"}]}]}], + :_copyright "Copyright (C) 2012 - 2013, Digium, Inc.", + :apiVersion "1.0.0", + :basePath "http://localhost:8088/stasis"}}}) + + +(def MINIDB { + :ari_1 {:applications {:models "M APP 1" + :apis "LE API"} + :bridges {:models "MODELS" + :apis "LE API"}} + + :ari_2 {:applications {:models "M APP 2" + :apis "LE API"} + :bridges {:models "MODELS" + :apis "LE API"} + :zebra {:models "MODELS" + :apis "LE API"}} + + }) + + + + +(deftest which-aris + (testing "Controlla le versioni dell'ARI che ci sono nel DB di prova" + (let [keys-db (sr/select [sr/ALL sr/FIRST] DB)] + (is (= [:ari_0_0_1 + :ari_1_0_0] keys-db))))) + +(deftest which-files + (testing "Controlla le versioni dei files che ci sono nel DB di prova" + (let [files (apply sorted-set + (sr/select [sr/MAP-VALS sr/ALL sr/FIRST] DB))] + (is (= #{:applications :events} files))))) + +(deftest all-models-for-applications-in-minidb + (testing "Controlla le versioni dei files che ci sono nel DB di prova" + (let [my-application :applications + files (sr/select [sr/MAP-VALS my-application :models] MINIDB)] + (is (= ["M APP 1" "M APP 2"] files))))) + + + + + diff --git a/codegen3/test/codegen3/signatures_test.clj b/codegen3/test/codegen3/signatures_test.clj new file mode 100644 index 00000000..0c80824e --- /dev/null +++ b/codegen3/test/codegen3/signatures_test.clj @@ -0,0 +1,58 @@ +(ns codegen3.signatures-test + (:require [clojure.test :refer :all] + [codegen3.signatures :refer :all])) + + + +(deftest testSignature + (testing "Signature for method with 2 parms" + (is (= ["String" "hurrah" "int" "int"] + (getMethodSignature + {:method "hurrah" + :returns "String" + :args [{:type "int" :name "a"} {:type "int" :name "b"}] + }) + + + )))) + + +(def PARMS1 [{:name "a" + :required true + :allowMultiple true + :dataType "string" } + {:name "b" + :required true + :allowMultiple false + :dataType "int" }] ) + + + +(deftest testSignatureExplosion + (testing "Multiple sigs exploded" + (is (= [["Collection" "int" "AriCallback"] + ["Collection" "int"] + ["String" "int" "AriCallback"] + ["String" "int"]] + + (explode-parms PARMS1) + + )))) + + + +(deftest testSignatureTests + (testing "hasCallback?" + (is (true? (hasCallback? ["Collection" "int" "AriCallback"]))) + (is (false? (hasCallback? ["Collection" "int"])))) + + (testing "hasCallback?" + (is (true? (isMasterImplementation? PARMS1 ["Collection" "int" "AriCallback"]))) + (is (false? (isMasterImplementation? PARMS1 ["String" "int" "AriCallback"])))) + ) + + + + + +