pax_global_header00006660000000000000000000000064132162167210014513gustar00rootroot0000000000000052 comment=3dc70b702180d5a705fd96e29936ee3184cc48f3 janus-gateway-0.2.6/000077500000000000000000000000001321621672100142775ustar00rootroot00000000000000janus-gateway-0.2.6/.editorconfig000066400000000000000000000001251321621672100167520ustar00rootroot00000000000000root = true [*] end_of_line = lf indent_style = tab trim_trailing_whitespace = true janus-gateway-0.2.6/.gitattributes000066400000000000000000000000171321621672100171700ustar00rootroot00000000000000*.mulaw binary janus-gateway-0.2.6/.github/000077500000000000000000000000001321621672100156375ustar00rootroot00000000000000janus-gateway-0.2.6/.github/CONTRIBUTING.md000066400000000000000000000026321321621672100200730ustar00rootroot00000000000000Contributing to Janus ===================== If you really want to help, then first of all, thank you! Janus is a project we firmly believe in, and so any contribution is more than welcome to make it better. If you want to open an issue, please make sure that: 1. you actually found a bug: for generic questions, use the [meetecho-janus](http://groups.google.com/d/forum/meetecho-janus) group instead; 2. nobody opened the same bug already (do a search); 3. the issue wasn't already solved; 4. you don't paste a huge amount of text in the issue or comments: use a service like [pastebin](http://pastebin.com/) or similar; 5. you provide a GDB stacktrace if Janus crashed on you, and/or output from AddressSanitizer or Valgrind (more details available [here](http://janus.conf.meetecho.com/docs/debug.html)). If you want to contribute to the project by providing fixes, enhancements, new features or other materials, then just clone the repo, make your changes, push to your fork (good commit messages that explain what changed are welcome!) and submit a pull request. Please make sure that, especially if you're modifying the C code, you follow the same coding style we're using and that you properly comment the code as we usually do ourselves. That said, please beware that we do require all contributors to sign the Contributor License Agreement before we can accept any code. janus-gateway-0.2.6/.github/ISSUE_TEMPLATE.md000066400000000000000000000012411321621672100203420ustar00rootroot00000000000000> If you want to open an issue, please make sure that: > > 1. you actually found a bug: for generic questions, use the [meetecho-janus](http://groups.google.com/d/forum/meetecho-janus) group instead; > 2. nobody opened the same bug already (do a search); > 3. the issue wasn't already solved; > 4. you don't paste a huge amount of text in the issue or comments: use a service like [pastebin](http://pastebin.com/) or similar; > 5. you provide a GDB stacktrace if Janus crashed on you, and/or output from AddressSanitizer or Valgrind (more details available[here](http://janus.conf.meetecho.com/docs/debug.html)). > > If so, just remove this text and share your findings! janus-gateway-0.2.6/.gitignore000066400000000000000000000013421321621672100162670ustar00rootroot00000000000000cmdline.c cmdline.h version.c docs/html/ /janus /janus-pp-rec /plugins/*.so /transports/*.so /events/*.so Makefile Makefile.in /build /configure /autom4te.cache /aclocal.m4 /m4 /missing /libtool /depcomp /compile /install-sh /ltmain.sh /config.log /config.guess /config.status /config.sub /*.o /plugins/*.o /plugins/*.lo /plugins/*.la /plugins/.libs /transports/*.o /transports/*.lo /transports/*.la /transports/.libs /events/*.o /events/*.lo /events/*.la /events/.libs /postprocessing/*.o /conf/janus.cfg.sample /conf/janus.plugin.recordplay.cfg.sample /conf/janus.plugin.streaming.cfg.sample /conf/janus.plugin.voicemail.cfg.sample /conf/janus.transport.http.cfg.sample /conf/janus.transport.websockets.cfg.sample .deps .dirstamp janus-gateway-0.2.6/COPYING000066400000000000000000001054071321621672100153410ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. 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 them 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 prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. 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. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. If you modify this Program, or any covered work, by linking or combining it with OpenSSL (or a modified version of that library), containing parts covered by the terms of OpenSSL License, the licensors of this Program grant you additional permission to convey the resulting work. Corresponding Source for a non-source form of such a combination shall include the source code for the parts of openssl used as well as that of the covered work. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. 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. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. 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 state 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) 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 3 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, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program 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, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU 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 Lesser General Public License instead of this License. But first, please read . janus-gateway-0.2.6/Makefile.am000066400000000000000000000371121321621672100163370ustar00rootroot00000000000000ACLOCAL_AMFLAGS = -I m4 # FIXME: These flags should be produced in configure.ac using AX_APPEND_COMPILE_FLAGS AM_CFLAGS = \ -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ -Wunused -fstrict-aliasing -Wextra -Wformat=2 -Winit-self -Winline \ -Wpacked -Wpointer-arith -Wmissing-format-attribute -Wmissing-noreturn \ -Wnested-externs -Wstrict-prototypes -Wunsafe-loop-optimizations \ -Wwrite-strings -Wno-missing-field-initializers -Wno-unused-parameter \ -Wcast-align -Wformat-nonliteral -Wformat-security -Wswitch-default \ -Wmissing-include-dirs -Wno-aggregate-return -Wunused-but-set-variable \ -Warray-bounds -Wold-style-definition -Wsign-compare -Wlarger-than=65537 AM_CFLAGS += -Wno-undef # sofiasip is not -Wundef--safe AM_CFLAGS += -Wno-redundant-decls # sofiasip also contains redundant declarations AM_CFLAGS += -Wno-override-init # we need this for JANUS_PLUGIN_INIT and JANUS_TRANSPORT_INIT and JANUS_EVENTHANDLER_INIT # FIXME: These should be enabled once the code is safe for them. That requires # some fairly big refactoring though, which can wait. # AM_CFLAGS += -Wshadow -Wstrict-aliasing=2 AM_CFLAGS += -fstack-protector-all -g -ggdb -fPIC -rdynamic -pthread # FIXME: make docs work with distcheck DISTCHECK_CONFIGURE_FLAGS = --disable-docs --enable-post-processing EXTRA_DIST = $(NULL) CLEANFILES = $(NULL) bin_PROGRAMS = janus headerdir = $(includedir)/janus header_HEADERS = apierror.h config.h log.h debug.h mutex.h record.h \ rtcp.h rtp.h rtpsrtp.h sdp-utils.h ip-utils.h utils.h text2pcap.h pluginsheaderdir = $(includedir)/janus/plugins pluginsheader_HEADERS = plugins/plugin.h transportsheaderdir = $(includedir)/janus/transports transportsheader_HEADERS = transports/transport.h eventsheaderdir = $(includedir)/janus/events eventsheader_HEADERS = events/eventhandler.h confdir = $(sysconfdir)/janus conf_DATA = conf/janus.cfg.sample certdir = $(datadir)/janus/certs cert_DATA = certs/mycert.key certs/mycert.pem plugindir = $(libdir)/janus/plugins plugin_LTLIBRARIES = $(NULL) transportdir = $(libdir)/janus/transports transport_LTLIBRARIES = $(NULL) eventdir = $(libdir)/janus/events event_LTLIBRARIES = $(NULL) SUBDIRS = html html_DATA = README.md streamdir = $(datadir)/janus/streams stream_DATA = $(NULL) recordingsdir = $(datadir)/janus/recordings recordings_DATA = $(NULL) demosdir = $(datadir)/janus/demos demos_DATA = $(NULL) jsmodulesdir = $(datadir)/janus/javascript jsmodules_DATA = html/janus.js %.sample: %.sample.in $(MKDIR_P) $(@D) $(AM_V_GEN) sed -e "\ s|[@]confdir[@]|$(confdir)|;\ s|[@]certdir[@]|$(certdir)|;\ s|[@]plugindir[@]|$(plugindir)|;\ s|[@]transportdir[@]|$(transportdir)|;\ s|[@]eventdir[@]|$(eventdir)|;\ s|[@]recordingsdir[@]|$(recordingsdir)|;\ s|[@]demosdir[@]|$(demosdir)|;\ s|[@]streamdir[@]|$(streamdir)|" \ $< > $@ || rm $@ EXTRA_DIST += conf/janus.cfg.sample.in CLEANFILES += conf/janus.cfg.sample ## # Janus ## janus_SOURCES = \ apierror.c \ apierror.h \ auth.c \ auth.h \ cmdline.c \ cmdline.h \ config.c \ config.h \ debug.h \ dtls.c \ dtls.h \ dtls-bio.c \ dtls-bio.h \ events.c \ events.h \ ice.c \ ice.h \ janus.c \ janus.h \ log.c \ log.h \ mutex.h \ record.c \ record.h \ rtcp.c \ rtcp.h \ rtp.c \ rtp.h \ rtpsrtp.h \ sctp.c \ sctp.h \ sdp.c \ sdp.h \ sdp-utils.c \ sdp-utils.h \ ip-utils.c \ ip-utils.h \ turnrest.c \ turnrest.h \ utils.c \ utils.h \ version.c \ version.h \ text2pcap.c \ text2pcap.h \ plugins/plugin.c \ plugins/plugin.h \ transports/transport.h \ events/eventhandler.h \ $(NULL) janus_CFLAGS = \ $(AM_CFLAGS) \ $(JANUS_CFLAGS) \ -DPLUGINDIR=\"$(plugindir)\" \ -DTRANSPORTDIR=\"$(transportdir)\" \ -DEVENTDIR=\"$(eventdir)\" \ -DCONFDIR=\"$(confdir)\" \ $(BORINGSSL_CFLAGS) \ $(NULL) janus_LDADD = \ $(BORINGSSL_LIBS) \ $(JANUS_LIBS) \ $(JANUS_MANUAL_LIBS) \ $(NULL) man1_MANS = janus.1 BUILT_SOURCES = cmdline.c cmdline.h version.c cmdline.c: janus.c gengetopt --set-package="janus" --set-version="$(VERSION)" < janus.ggo directory = .git dir_target = $(directory)-$(wildcard $(directory)) dir_present = $(directory)-$(directory) dir_absent = $(directory)- if WITH_SOURCE_DATE_EPOCH build_date = $(shell LC_ALL=C date --utc --date="@$(SOURCE_DATE_EPOCH)") else build_date = $(shell date) endif version.c: FORCE | $(dir_target) echo "$(build_date)" | awk 'BEGIN {} {print "const char *janus_build_git_time = \""$$0"\";"} END {} ' >> version.c $(dir_present): `which git` rev-parse HEAD | awk 'BEGIN {print "#include \"version.h\""} {print "const char *janus_build_git_sha = \"" $$0"\";"} END {}' > version.c $(dir_absent): echo "not-a-git-repo" | awk 'BEGIN {print "#include \"version.h\""} {print "const char *janus_build_git_sha = \"" $$0"\";"} END {}' > version.c .PHONY: FORCE FORCE: EXTRA_DIST += janus.ggo CLEANFILES += cmdline.c cmdline.h version.c ## # Transports ## transports_cflags = \ $(AM_CFLAGS) \ $(TRANSPORTS_CFLAGS) \ $(NULL) transports_libadd = \ $(TRANSPORTS_LIBS) \ $(NULL) if ENABLE_REST transport_LTLIBRARIES += transports/libjanus_http.la transports_libjanus_http_la_SOURCES = transports/janus_http.c transports_libjanus_http_la_CFLAGS = $(transports_cflags) $(MHD_CFLAGS) transports_libjanus_http_la_LDFLAGS = $(transports_ldflags) $(MHD_LDFLAGS) $(MHD_LIBS) transports_libjanus_http_la_LIBADD = $(transports_libadd) $(MHD_LDFLAGS) conf_DATA += conf/janus.transport.http.cfg.sample EXTRA_DIST += conf/janus.transport.http.cfg.sample.in CLEANFILES += conf/janus.transport.http.cfg.sample endif if ENABLE_WEBSOCKETS transport_LTLIBRARIES += transports/libjanus_websockets.la transports_libjanus_websockets_la_SOURCES = transports/janus_websockets.c transports_libjanus_websockets_la_CFLAGS = $(transports_cflags) transports_libjanus_websockets_la_LDFLAGS = $(transports_ldflags) $(WS_MANUAL_LIBS) transports_libjanus_websockets_la_LIBADD = $(transports_libadd) conf_DATA += conf/janus.transport.websockets.cfg.sample EXTRA_DIST += conf/janus.transport.websockets.cfg.sample.in CLEANFILES += conf/janus.transport.websockets.cfg.sample endif if ENABLE_RABBITMQ transport_LTLIBRARIES += transports/libjanus_rabbitmq.la transports_libjanus_rabbitmq_la_SOURCES = transports/janus_rabbitmq.c transports_libjanus_rabbitmq_la_CFLAGS = $(transports_cflags) transports_libjanus_rabbitmq_la_LDFLAGS = $(transports_ldflags) -lrabbitmq transports_libjanus_rabbitmq_la_LIBADD = $(transports_libadd) conf_DATA += conf/janus.transport.rabbitmq.cfg.sample EXTRA_DIST += conf/janus.transport.rabbitmq.cfg.sample endif if ENABLE_MQTT transport_LTLIBRARIES += transports/libjanus_mqtt.la transports_libjanus_mqtt_la_SOURCES = transports/janus_mqtt.c transports_libjanus_mqtt_la_CFLAGS = $(transports_cflags) transports_libjanus_mqtt_la_LDFLAGS = $(transports_ldflags) -lpaho-mqtt3a transports_libjanus_mqtt_la_LIBADD = $(transports_libadd) conf_DATA += conf/janus.transport.mqtt.cfg.sample EXTRA_DIST += conf/janus.transport.mqtt.cfg.sample endif if ENABLE_PFUNIX transport_LTLIBRARIES += transports/libjanus_pfunix.la transports_libjanus_pfunix_la_SOURCES = transports/janus_pfunix.c transports_libjanus_pfunix_la_CFLAGS = $(transports_cflags) transports_libjanus_pfunix_la_LDFLAGS = $(transports_ldflags) transports_libjanus_pfunix_la_LIBADD = $(transports_libadd) conf_DATA += conf/janus.transport.pfunix.cfg.sample EXTRA_DIST += conf/janus.transport.pfunix.cfg.sample endif ## # Event handlers ## events_cflags = \ $(AM_CFLAGS) \ $(EVENTS_CFLAGS) \ $(NULL) events_libadd = \ $(EVENTS_LIBS) \ $(NULL) if ENABLE_SAMPLEEVH event_LTLIBRARIES += events/libjanus_sampleevh.la events_libjanus_sampleevh_la_SOURCES = events/janus_sampleevh.c events_libjanus_sampleevh_la_CFLAGS = $(events_cflags) events_libjanus_sampleevh_la_LDFLAGS = $(events_ldflags) -lcurl events_libjanus_sampleevh_la_LIBADD = $(events_libadd) conf_DATA += conf/janus.eventhandler.sampleevh.cfg.sample EXTRA_DIST += conf/janus.eventhandler.sampleevh.cfg.sample endif if ENABLE_RABBITMQEVH event_LTLIBRARIES += events/libjanus_rabbitmqevh.la events_libjanus_rabbitmqevh_la_SOURCES = events/janus_rabbitmqevh.c events_libjanus_rabbitmqevh_la_CFLAGS = $(events_cflags) events_libjanus_rabbitmqevh_la_LDFLAGS = $(events_ldflags) -lrabbitmq events_libjanus_rabbitmqevh_la_LIBADD = $(events_libadd) conf_DATA += conf/janus.eventhandler.rabbitmqevh.cfg.sample EXTRA_DIST += conf/janus.eventhandler.rabbitmqevh.cfg.sample endif ## # Plugins ## plugins_cflags = \ $(AM_CFLAGS) \ $(PLUGINS_CFLAGS) \ $(NULL) plugins_libadd = \ $(PLUGINS_LIBS) \ $(NULL) if ENABLE_PLUGIN_AUDIOBRIDGE plugin_LTLIBRARIES += plugins/libjanus_audiobridge.la plugins_libjanus_audiobridge_la_SOURCES = plugins/janus_audiobridge.c plugins_libjanus_audiobridge_la_CFLAGS = $(plugins_cflags) $(OPUS_CFLAGS) plugins_libjanus_audiobridge_la_LDFLAGS = $(plugins_ldflags) $(OPUS_LDFLAGS) $(OPUS_LIBS) plugins_libjanus_audiobridge_la_LIBADD = $(plugins_libadd) $(OPUS_LIBADD) conf_DATA += conf/janus.plugin.audiobridge.cfg.sample EXTRA_DIST += conf/janus.plugin.audiobridge.cfg.sample endif if ENABLE_PLUGIN_ECHOTEST plugin_LTLIBRARIES += plugins/libjanus_echotest.la plugins_libjanus_echotest_la_SOURCES = plugins/janus_echotest.c plugins_libjanus_echotest_la_CFLAGS = $(plugins_cflags) plugins_libjanus_echotest_la_LDFLAGS = $(plugins_ldflags) plugins_libjanus_echotest_la_LIBADD = $(plugins_libadd) conf_DATA += conf/janus.plugin.echotest.cfg.sample EXTRA_DIST += conf/janus.plugin.echotest.cfg.sample endif if ENABLE_PLUGIN_RECORDPLAY plugin_LTLIBRARIES += plugins/libjanus_recordplay.la plugins_libjanus_recordplay_la_SOURCES = plugins/janus_recordplay.c plugins_libjanus_recordplay_la_CFLAGS = $(plugins_cflags) plugins_libjanus_recordplay_la_LDFLAGS = $(plugins_ldflags) plugins_libjanus_recordplay_la_LIBADD = $(plugins_libadd) conf_DATA += conf/janus.plugin.recordplay.cfg.sample recordings_DATA += \ plugins/recordings/1234.nfo \ plugins/recordings/rec-sample-audio.mjr \ plugins/recordings/rec-sample-video.mjr EXTRA_DIST += \ conf/janus.plugin.recordplay.cfg.sample.in \ $(recordings_DATA) CLEANFILES += conf/janus.plugin.recordplay.cfg.sample endif if ENABLE_PLUGIN_SIP plugin_LTLIBRARIES += plugins/libjanus_sip.la plugins_libjanus_sip_la_SOURCES = plugins/janus_sip.c plugins_libjanus_sip_la_CFLAGS = $(plugins_cflags) $(SOFIA_CFLAGS) plugins_libjanus_sip_la_LDFLAGS = $(plugins_ldflags) $(SOFIA_LDFLAGS) $(SOFIA_LIBS) plugins_libjanus_sip_la_LIBADD = $(plugins_libadd) $(SOFIA_LIBADD) conf_DATA += conf/janus.plugin.sip.cfg.sample EXTRA_DIST += conf/janus.plugin.sip.cfg.sample endif if ENABLE_PLUGIN_SIPRE plugin_LTLIBRARIES += plugins/libjanus_sipre.la plugins_libjanus_sipre_la_SOURCES = plugins/janus_sipre.c plugins_libjanus_sipre_la_CFLAGS = $(plugins_cflags) $(LIBRE_CFLAGS) plugins_libjanus_sipre_la_LDFLAGS = $(plugins_ldflags) $(LIBRE_LDFLAGS) $(LIBRE_LIBS) plugins_libjanus_sipre_la_LIBADD = $(plugins_libadd) $(LIBRE_LIBADD) conf_DATA += conf/janus.plugin.sipre.cfg.sample EXTRA_DIST += conf/janus.plugin.sipre.cfg.sample endif if ENABLE_PLUGIN_NOSIP plugin_LTLIBRARIES += plugins/libjanus_nosip.la plugins_libjanus_nosip_la_SOURCES = plugins/janus_nosip.c plugins_libjanus_nosip_la_CFLAGS = $(plugins_cflags) plugins_libjanus_nosip_la_LDFLAGS = $(plugins_ldflags) plugins_libjanus_nosip_la_LIBADD = $(plugins_libadd) conf_DATA += conf/janus.plugin.nosip.cfg.sample EXTRA_DIST += conf/janus.plugin.nosip.cfg.sample endif if ENABLE_PLUGIN_STREAMING plugin_LTLIBRARIES += plugins/libjanus_streaming.la plugins_libjanus_streaming_la_SOURCES = plugins/janus_streaming.c plugins_libjanus_streaming_la_CFLAGS = $(plugins_cflags) plugins_libjanus_streaming_la_LDFLAGS = $(plugins_ldflags) plugins_libjanus_streaming_la_LIBADD = $(plugins_libadd) conf_DATA += conf/janus.plugin.streaming.cfg.sample stream_DATA += \ plugins/streams/music.mulaw \ plugins/streams/radio.alaw \ plugins/streams/test_gstreamer.sh \ plugins/streams/test_gstreamer_1.sh EXTRA_DIST += \ conf/janus.plugin.streaming.cfg.sample.in \ $(stream_DATA) CLEANFILES += conf/janus.plugin.streaming.cfg.sample endif if ENABLE_PLUGIN_VIDEOCALL plugin_LTLIBRARIES += plugins/libjanus_videocall.la plugins_libjanus_videocall_la_SOURCES = plugins/janus_videocall.c plugins_libjanus_videocall_la_CFLAGS = $(plugins_cflags) plugins_libjanus_videocall_la_LDFLAGS = $(plugins_ldflags) plugins_libjanus_videocall_la_LIBADD = $(plugins_libadd) conf_DATA += conf/janus.plugin.videocall.cfg.sample EXTRA_DIST += conf/janus.plugin.videocall.cfg.sample endif if ENABLE_PLUGIN_VIDEOROOM plugin_LTLIBRARIES += plugins/libjanus_videoroom.la plugins_libjanus_videoroom_la_SOURCES = plugins/janus_videoroom.c plugins_libjanus_videoroom_la_CFLAGS = $(plugins_cflags) plugins_libjanus_videoroom_la_LDFLAGS = $(plugins_ldflags) plugins_libjanus_videoroom_la_LIBADD = $(plugins_libadd) conf_DATA += conf/janus.plugin.videoroom.cfg.sample EXTRA_DIST += conf/janus.plugin.videoroom.cfg.sample endif if ENABLE_PLUGIN_VOICEMAIL plugin_LTLIBRARIES += plugins/libjanus_voicemail.la plugins_libjanus_voicemail_la_SOURCES = plugins/janus_voicemail.c plugins_libjanus_voicemail_la_CFLAGS = $(plugins_cflags) plugins_libjanus_voicemail_la_LDFLAGS = $(plugins_ldflags) -logg plugins_libjanus_voicemail_la_LIBADD = $(plugins_libadd) conf_DATA += conf/janus.plugin.voicemail.cfg.sample EXTRA_DIST += conf/janus.plugin.voicemail.cfg.sample.in endif if ENABLE_PLUGIN_TEXTROOM plugin_LTLIBRARIES += plugins/libjanus_textroom.la plugins_libjanus_textroom_la_SOURCES = plugins/janus_textroom.c plugins_libjanus_textroom_la_CFLAGS = $(plugins_cflags) plugins_libjanus_textroom_la_LDFLAGS = $(plugins_ldflags) plugins_libjanus_textroom_la_LIBADD = $(plugins_libadd) conf_DATA += conf/janus.plugin.textroom.cfg.sample EXTRA_DIST += conf/janus.plugin.textroom.cfg.sample endif ## # Post-processing ## if ENABLE_POST_PROCESSING bin_PROGRAMS += janus-pp-rec man1_MANS += postprocessing/janus-pp-rec.1 janus_pp_rec_SOURCES = \ postprocessing/pp-g711.c \ postprocessing/pp-g711.h \ postprocessing/pp-g722.c \ postprocessing/pp-g722.h \ postprocessing/pp-h264.c \ postprocessing/pp-h264.h \ postprocessing/pp-opus.c \ postprocessing/pp-opus.h \ postprocessing/pp-opus-silence.h \ postprocessing/pp-rtp.h \ postprocessing/pp-srt.c \ postprocessing/pp-srt.h \ postprocessing/pp-webm.c \ postprocessing/pp-webm.h \ postprocessing/janus-pp-rec.c \ log.c \ $(NULL) janus_pp_rec_CFLAGS = \ $(AM_CFLAGS) \ $(POST_PROCESSING_CFLAGS) \ $(NULL) janus_pp_rec_LDADD = \ $(POST_PROCESSING_LIBS) \ $(NULL) endif ## # Docs ## if ENABLE_DOCS SUBDIRS += docs endif ## # JavaScript module flavours for janus.js ## if ENABLE_JAVASCRIPT_ES_MODULE jsmodules_DATA += npm/bundles/janus.es.js EXTRA_DIST += npm/bundles/janus.es.js CLEANFILES += npm/bundles/janus.es.js endif if ENABLE_JAVASCRIPT_UMD_MODULE jsmodules_DATA += npm/bundles/janus.umd.js EXTRA_DIST += npm/bundles/janus.umd.js CLEANFILES += npm/bundles/janus.umd.js endif if ENABLE_JAVASCRIPT_IIFE_MODULE jsmodules_DATA += npm/bundles/janus.iife.js EXTRA_DIST += npm/bundles/janus.iife.js CLEANFILES += npm/bundles/janus.iife.js endif if ENABLE_JAVASCRIPT_COMMON_JS_MODULE jsmodules_DATA += npm/bundles/janus.cjs.js EXTRA_DIST += npm/bundles/janus.cjs.js CLEANFILES += npm/bundles/janus.cjs.js endif if ENABLE_JAVASCRIPT_MODULES npm/node_modules/rollup/bin/rollup: npm/package.json cd npm && $(NPM) install && touch node_modules/rollup/bin/rollup npm/bundles/janus.%.js: html/janus.js npm/node_modules/rollup/bin/rollup npm/rollup.config.js npm/module.js cd npm && $(NPM) run rollup -- --o $(patsubst npm/%,%,$@) --f $* endif ## # Configuration ## configs: $(MKDIR_P) $(DESTDIR)$(confdir) $(foreach config,$(conf_DATA),cp "$(CURDIR)/$(config)" "$(DESTDIR)$(confdir)/$(notdir $(basename $(config) .sample))";) ## # Extra cleanup ## clean-local: -rm -f docs/doxygen_sqlite3.db janus-gateway-0.2.6/README.md000066400000000000000000000441741321621672100155700ustar00rootroot00000000000000Janus WebRTC Gateway ==================== Janus is an open source, general purpose, WebRTC gateway designed and developed by [Meetecho](http://www.meetecho.com). This version of the gateway can only be installed on Linux systems: next versions will take into account cross compilation on different environments. For some online demos and documentations, make sure you pay the [project website](http://janus.conf.meetecho.com/) a visit! To discuss Janus with us and other users, there's a Google Group called [meetecho-janus](http://groups.google.com/d/forum/meetecho-janus) that you can use. If you encounter issues, though, please submit an issue on [github](https://github.com/meetecho/janus-gateway/issues) instead. ## Dependencies To install it, you'll need to satisfy the following dependencies: * [Jansson](http://www.digip.org/jansson/) * [libnice](http://nice.freedesktop.org/wiki/) * [OpenSSL](http://www.openssl.org/) (at least v1.0.1e) * [libsrtp](https://github.com/cisco/libsrtp) (at least v1.5 suggested) * [usrsctp](https://github.com/sctplab/usrsctp) (only needed if you are interested in Data Channels) * [libmicrohttpd](http://www.gnu.org/software/libmicrohttpd/) (only needed if you are interested in REST support for the Janus API) * [libwebsockets](https://libwebsockets.org/) (only needed if you are interested in WebSockets support for the Janus API) * [cmake](http://www.cmake.org/) (only needed if you are interested in WebSockets and/or BoringSSL support, as they make use of it) * [rabbitmq-c](https://github.com/alanxz/rabbitmq-c) (only needed if you are interested in RabbitMQ support for the Janus API) * [paho.mqtt.c](https://eclipse.org/paho/clients/c) (only needed if you are interested in MQTT support for the Janus API) * [libcurl](https://curl.haxx.se/libcurl/) (only needed if you are interested in the TURN REST API support) A couple of plugins depend on a few more libraries: * [Sofia-SIP](http://sofia-sip.sourceforge.net/) (only needed for the SIP plugin) * [libopus](http://opus-codec.org/) (only needed for the bridge plugin) * [libogg](http://xiph.org/ogg/) (only needed for the voicemail plugin) * [libcurl](https://curl.haxx.se/libcurl/) (only needed if you are interested in RTSP support in the Streaming plugin or in the sample Event Handler plugin) Additionally, you'll need the following libraries and tools: * [GLib](http://library.gnome.org/devel/glib/) * [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/) * [gengetopt](http://www.gnu.org/software/gengetopt/) All of those libraries are usually available on most of the most common distributions. Installing these libraries on a recent Fedora, for instance, is very simple: yum install libmicrohttpd-devel jansson-devel libnice-devel \ openssl-devel libsrtp-devel sofia-sip-devel glib-devel \ opus-devel libogg-devel libcurl-devel pkgconfig gengetopt \ libtool autoconf automake Notice that you may have to `yum install epel-release` as well if you're attempting an installation on a CentOS machine instead. On Ubuntu or Debian, it would require something like this: aptitude install libmicrohttpd-dev libjansson-dev libnice-dev \ libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev \ libopus-dev libogg-dev libcurl4-openssl-dev pkg-config gengetopt \ libtool automake * *Note:* please notice that libopus may not be available out of the box on Ubuntu or Debian, unless you're using a recent version (e.g., Ubuntu 14.04 LTS). In that case, you'll have to [install it manually](http://www.opus-codec.org). * *Note:* For custom installations of libnice, you can run `pkg-config --cflags --libs nice` to make sure Janus can find the installation. If not, you may need to set the `PKG_CONFIG_PATH` environment variable prior to compiling Janus, eg. `export PKG_CONFIG_PATH=/path/to/libnice/lib/pkgconfig` In case you're interested in compiling the sample Event Handler plugin, you'll need to install the development version of libcurl as well (usually `libcurl-devel` on Fedora/CentOS, `libcurl4-openssl-dev` on Ubuntu/Debian). If your distro ships a pre-1.5 version of libsrtp, you'll have to uninstall that version and [install 1.5 or 2.0.0 manually](https://github.com/cisco/libsrtp/releases). In fact, 1.4.x is known to cause several issues with WebRTC. Installation of version 1.5.4 is quite straightforward: wget https://github.com/cisco/libsrtp/archive/v1.5.4.tar.gz tar xfv v1.5.4.tar.gz cd libsrtp-1.5.4 ./configure --prefix=/usr --enable-openssl make shared_library && sudo make install The instructions for version 2.0.0 is practically the same: wget https://github.com/cisco/libsrtp/archive/v2.0.0.tar.gz tar xfv v2.0.0.tar.gz cd libsrtp-2.0.0 ./configure --prefix=/usr --enable-openssl make shared_library && sudo make install The Janus configure script autodetects which one you have installed and links to the correct library automatically, choosing v2.0.0 if both are installed. If you want v1.5.4 to be picked, pass `--disable-libsrtp2` when configuring Janus to force it to use the older version instead. * *Note:* when installing libsrtp, no matter which version, you may need to pass `--libdir=/usr/lib64` to the configure script if you're installing on a x86_64 distribution. If you want to make use of BoringSSL instead of OpenSSL (e.g., because you want to take advantage of `--enable-dtls-settimeout`), you'll have to manually install it to a specific location. Use the following steps: git clone https://boringssl.googlesource.com/boringssl cd boringssl # Don't barf on errors sed -i s/" -Werror"//g CMakeLists.txt # Build mkdir -p build cd build cmake -DCMAKE_CXX_FLAGS="-lrt" .. make cd .. # Install sudo mkdir -p /opt/boringssl sudo cp -R include /opt/boringssl/ sudo mkdir -p /opt/boringssl/lib sudo cp build/ssl/libssl.a /opt/boringssl/lib/ sudo cp build/crypto/libcrypto.a /opt/boringssl/lib/ Once the library is installed, you'll have to pass an additional `--enable-boringssl` flag to the configure script, as by default Janus will be built assuming OpenSSL will be used. By default, Janus expects BoringSSL to be installed in `/opt/boringssl` -- if it's installed in another location, pass the path to the configure script as such: `--enable-boringssl=/path/to/boringssl` If you were using OpenSSL and want to switch to BoringSSL, make sure you also do a `make clean` in the Janus folder before compiling with the new BoringSSL support. If you enabled BoringSSL support and also want Janus to detect and react to DTLS timeouts with faster retransmissions, then pass `--enable-dtls-settimeout` to the configure script too. For what concerns usrsctp, which is needed for Data Channels support, it is usually not available in repositories, so if you're interested in them (support is optional) you'll have to install it manually. It is a pretty easy and standard process: git clone https://github.com/sctplab/usrsctp cd usrsctp ./bootstrap ./configure --prefix=/usr && make && sudo make install * *Note:* you may need to pass `--libdir=/usr/lib64` to the configure script if you're installing on a x86_64 distribution. The same applies for libwebsockets, which is needed for the optional WebSockets support. If you're interested in supporting WebSockets to control Janus, as an alternative (or replacement) to the default plain HTTP REST API, you'll have to install it manually: git clone git://git.libwebsockets.org/libwebsockets cd libwebsockets # If you want the stable version of libwebsockets, uncomment the next line # git checkout v2.4-stable mkdir build cd build # See https://github.com/meetecho/janus-gateway/issues/732 re: LWS_MAX_SMP cmake -DLWS_MAX_SMP=1 -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_C_FLAGS="-fpic" .. make && sudo make install * *Note:* if libwebsockets.org is unreachable for any reason, replace the first line with this: git clone https://github.com/warmcat/libwebsockets.git The same applies for Eclipse Paho MQTT C client library, which is needed for the optional MQTT support. If you're interested in integrating MQTT queues as an alternative (or replacement) to HTTP and/or WebSockets to control Janus, you can install the latest version with the following steps: git clone https://github.com/eclipse/paho.mqtt.c.git cd paho.mqtt.c make && sudo make install * *Note:* you may want to set up a different install path for the library, to achieve that, replace the last command by 'sudo prefix=/usr make install'. Finally, the same can be said for rabbitmq-c as well, which is needed for the optional RabbitMQ support. In fact, several different versions of the library can be found, and the versions usually available in most distribution repositories are not up-do-date with respect to the current state of the development. As such, if you're interested in integrating RabbitMQ queues as an alternative (or replacement) to HTTP and/or WebSockets to control Janus, you can install the latest version with the following steps: git clone https://github.com/alanxz/rabbitmq-c cd rabbitmq-c git submodule init git submodule update mkdir build && cd build cmake -DCMAKE_INSTALL_PREFIX=/usr .. make && sudo make install * *Note:* you may need to pass `--libdir=/usr/lib64` to the configure script if you're installing on a x86_64 distribution. To conclude, should you be interested in building the gateway documentation as well, you'll need some additional tools too: * [Doxygen](http://www.doxygen.org) * [Graphviz](http://www.graphviz.org/) On Fedora: yum install doxygen graphviz On Ubuntu/Debian: aptitude install doxygen graphviz ## Compile Once you have installed all the dependencies, get the code: git clone https://github.com/meetecho/janus-gateway.git cd janus-gateway Then just use: sh autogen.sh to generate the configure file. After that, configure and compile as usual to start the whole compilation process: ./configure --prefix=/opt/janus make make install Since Janus requires configuration files for both the core and its modules in order to work, you'll probably also want to install the default configuration files to use, which you can do this way: make configs Remember to only do this once, or otherwise a subsequent `make configs` will overwrite any configuration file you may have modified in the meanwhile. If you're installed the above libraries but are not interested in Data Channels, WebSockets, MQTT and/or RabbitMQ (or you don't care about any of them), you can disable them when configuring: ./configure --disable-websockets --disable-data-channels --disable-rabbitmq --disable-mqtt If the libraries are not installed, instead, no need to manually disable them, as the configure script will skip them automatically and disable the related features by itself. A summary of what's going to be built will always appear after you do a configure, allowing you to double check if what you need and don't need is there. If Doxygen and graphviz are available, the process can also build the documentation for you. By default the compilation process will not try to build the documentation, so if you instead prefer to build it, use the --enable-docs configuration option: ./configure --enable-docs You can also selectively enable/disable other features (e.g., specific plugins you don't care about, or whether or not you want to build the recordings post-processor). Use the --help option when configuring for more info. ### Building on MacOS While most of the above instructions will work when compiling Janus on MacOS as well, there are a few aspects to highlight when doing that. First of all, you can use `brew` to install most of the dependencies: brew tap homebrew/boneyard brew install jansson libnice openssl libusrsctp libmicrohttpd libwebsockets cmake rabbitmq-c sofia-sip opus libogg curl glib pkg-config gengetopt autoconf automake libtool For what concerns `libsrtp`, which needs to be installed manually, just pass `/usr/local` as a prefix when configuring, and proceed as normal: [..] ./configure --prefix=/usr/local [..] Finally, you may need to provide a custom `prefix` and `PKG_CONFIG_PATH` when configuring Janus as well: ./configure --prefix=/usr/local/janus PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig Everything else works exactly the same way as on Linux. ## Configure and start To start the gateway, you can use the janus executable. There are several things you can configure, either in a configuration file: /etc/janus/janus.cfg or on the command line: /bin/janus --help janus 0.2.6 Usage: janus [OPTIONS]... -h, --help Print help and exit -V, --version Print version and exit -b, --daemon Launch Janus in background as a daemon (default=off) -N, --disable-stdout Disable stdout based logging (default=off) -L, --log-file=path Log to the specified file (default=stdout only) -i, --interface=ipaddress Interface to use (will be the public IP) -P, --plugins-folder=path Plugins folder (default=./plugins) -C, --config=filename Configuration file to use -F, --configs-folder=path Configuration files folder (default=./conf) -c, --cert-pem=filename DTLS certificate -k, --cert-key=filename DTLS certificate key -S, --stun-server=filename STUN server(:port) to use, if needed (e.g., gateway behind NAT, default=none) -1, --nat-1-1=ip Public IP to put in all host candidates, assuming a 1:1 NAT is in place (e.g., Amazon EC2 instances, default=none) -E, --ice-enforce-list=list Comma-separated list of the only interfaces to use for ICE gathering; partial strings are supported (e.g., eth0 or eno1,wlan0, default=none) -X, --ice-ignore-list=list Comma-separated list of interfaces or IP addresses to ignore for ICE gathering; partial strings are supported (e.g., vmnet8,192.168.0.1,10.0.0.1 or vmnet,192.168., default=vmnet) -6, --ipv6-candidates Whether to enable IPv6 candidates or not (experimental) (default=off) -l, --libnice-debug Whether to enable libnice debugging or not (default=off) -I, --ice-lite Whether to enable the ICE Lite mode or not (default=off) -T, --ice-tcp Whether to enable ICE-TCP or not (warning: only works with ICE Lite) (default=off) -U, --bundle Whether to force BUNDLE or not (whether audio, video and data will always be bundled) (default=off) -u, --rtcp-mux Whether to force rtcp-mux or not (whether RTP and RTCP will always be muxed) (default=off) -q, --max-nack-queue=number Maximum size of the NACK queue (in ms) per user for retransmissions -t, --no-media-timer=number Time (in s) that should pass with no media (audio or video) being received before Janus notifies you about this -r, --rtp-port-range=min-max Port range to use for RTP/RTCP (only available if the installed libnice supports it) -d, --debug-level=1-7 Debug/logging level (0=disable debugging, 7=maximum debug level; default=4) -D, --debug-timestamps Enable debug/logging timestamps (default=off) -o, --disable-colors Disable color in the logging (default=off) -a, --apisecret=randomstring API secret all requests need to pass in order to be accepted by Janus (useful when wrapping Janus API requests in a server, none by default) -A, --token-auth Enable token-based authentication for all requests (default=off) -e, --event-handlers Enable event handlers (default=off) Options passed through the command line have the precedence on those specified in the configuration file. To start the gateway, simply run: /bin/janus This will start the gateway, and have it look at the configuration file. As far as transports are concerned (that is, with respect to how you can interact with your Janus instance), using the default configuration files provided after issuing a `make configs` will result in Janus only enabling an HTTP webserver (port 8088) and a plain WebSocket server (8188), assuming the related transport modules have been compiled, of course. To enable HTTPS or Secure WebSockets support, edit the related transport configuration file accordingly. You can also change the base path that the webserver uses: by default this is `/janus`, but you can change it to anything you want and with any nesting you want (e.g., `/mypath`, `/my/path`, or `/my/really/nested/path`). This is done to allow you to more easily customize rules in any frontend you may have (e.g., Apache in front of your services). Please notice that the path configuration is not provided for WebSockets, instead, as it is not needed there. The RabbitMQ module, if compiled, is disabled by default, so you'll have to enable it manually if interested in it. To test whether it's working correctly, you can use the demos provided with this package in the `html` folder: these are exactly the same demos available online on the [project website](http://janus.conf.meetecho.com/). Just copy the file it contains in a webserver, or use a userspace webserver to serve the files in the `html` folder (e.g., with php or python), and open the index.html page in either Chrome or Firefox. A list of demo pages exploiting the different plugins will be available. Remember to edit the transport/port details in the demo JavaScript files if you changed any transport-related configuration from its defaults. ## Help us! Any thought, feedback or (hopefully not!) insult is welcome! Developed by [@meetecho](https://github.com/meetecho) janus-gateway-0.2.6/apierror.c000066400000000000000000000035121321621672100162670ustar00rootroot00000000000000#include "apierror.h" const char *janus_get_api_error(int error) { switch(error) { case JANUS_OK: return "Success"; case JANUS_ERROR_UNAUTHORIZED: return "Unauthorized request (wrong or missing secret/token)"; case JANUS_ERROR_UNAUTHORIZED_PLUGIN: return "Unauthorized access to plugin (token is not allowed to)"; case JANUS_ERROR_UNKNOWN: return "Unknown error"; case JANUS_ERROR_TRANSPORT_SPECIFIC: return "Transport specific error"; case JANUS_ERROR_MISSING_REQUEST: return "Missing request"; case JANUS_ERROR_UNKNOWN_REQUEST: return "Unknown request"; case JANUS_ERROR_INVALID_JSON: return "Invalid JSON"; case JANUS_ERROR_INVALID_JSON_OBJECT: return "Invalid JSON Object"; case JANUS_ERROR_MISSING_MANDATORY_ELEMENT: return "Missing mandatory element"; case JANUS_ERROR_INVALID_REQUEST_PATH: return "Invalid path for this request"; case JANUS_ERROR_SESSION_NOT_FOUND: return "Session not found"; case JANUS_ERROR_HANDLE_NOT_FOUND: return "Handle not found"; case JANUS_ERROR_PLUGIN_NOT_FOUND: return "Plugin not found"; case JANUS_ERROR_PLUGIN_ATTACH: return "Error attaching plugin"; case JANUS_ERROR_PLUGIN_MESSAGE: return "Error sending message to plugin"; case JANUS_ERROR_PLUGIN_DETACH: return "Error detaching from plugin"; case JANUS_ERROR_JSEP_UNKNOWN_TYPE: return "Unsupported JSEP type"; case JANUS_ERROR_JSEP_INVALID_SDP: return "Invalid SDP"; case JANUS_ERROR_TRICKE_INVALID_STREAM: return "Invalid stream"; case JANUS_ERROR_INVALID_ELEMENT_TYPE: return "Invalid element type"; case JANUS_ERROR_SESSION_CONFLICT: return "Session ID already in use"; case JANUS_ERROR_UNEXPECTED_ANSWER: return "Unexpected ANSWER (no OFFER)"; case JANUS_ERROR_TOKEN_NOT_FOUND: return "Token not found"; default: return "Unknown error"; } } janus-gateway-0.2.6/apierror.h000066400000000000000000000066461321621672100163070ustar00rootroot00000000000000/*! \file apierror.h * \author Lorenzo Miniero * \copyright GNU General Public License v3 * \brief Janus API errors definition * \details Definition of all the API errors that may occur when invoking * the Janus web-based JSON API. * \todo This code still needs proper hooks in the JavaScript libraries that use the interface. * * \ingroup core * \ref core */ #ifndef _JANUS_API_ERROR_H #define _JANUS_API_ERROR_H /*! \brief Success (no error) */ #define JANUS_OK 0 /*! \brief Unauthorized (can only happen when using apisecret/auth token) */ #define JANUS_ERROR_UNAUTHORIZED 403 /*! \brief Unauthorized access to a plugin (can only happen when using auth token) */ #define JANUS_ERROR_UNAUTHORIZED_PLUGIN 405 /*! \brief Unknown/undocumented error */ #define JANUS_ERROR_UNKNOWN 490 /*! \brief Transport related error */ #define JANUS_ERROR_TRANSPORT_SPECIFIC 450 /*! \brief The request is missing in the message */ #define JANUS_ERROR_MISSING_REQUEST 452 /*! \brief The gateway does not suppurt this request */ #define JANUS_ERROR_UNKNOWN_REQUEST 453 /*! \brief The payload is not a valid JSON message */ #define JANUS_ERROR_INVALID_JSON 454 /*! \brief The object is not a valid JSON object as expected */ #define JANUS_ERROR_INVALID_JSON_OBJECT 455 /*! \brief A mandatory element is missing in the message */ #define JANUS_ERROR_MISSING_MANDATORY_ELEMENT 456 /*! \brief The request cannot be handled for this webserver path */ #define JANUS_ERROR_INVALID_REQUEST_PATH 457 /*! \brief The session the request refers to doesn't exist */ #define JANUS_ERROR_SESSION_NOT_FOUND 458 /*! \brief The handle the request refers to doesn't exist */ #define JANUS_ERROR_HANDLE_NOT_FOUND 459 /*! \brief The plugin the request wants to talk to doesn't exist */ #define JANUS_ERROR_PLUGIN_NOT_FOUND 460 /*! \brief An error occurring when trying to attach to a plugin and create a handle */ #define JANUS_ERROR_PLUGIN_ATTACH 461 /*! \brief An error occurring when trying to send a message/request to the plugin */ #define JANUS_ERROR_PLUGIN_MESSAGE 462 /*! \brief An error occurring when trying to detach from a plugin and destroy the related handle */ #define JANUS_ERROR_PLUGIN_DETACH 463 /*! \brief The gateway doesn't support this SDP type * \todo The gateway currently only supports OFFER and ANSWER. */ #define JANUS_ERROR_JSEP_UNKNOWN_TYPE 464 /*! \brief The Session Description provided by the peer is invalid */ #define JANUS_ERROR_JSEP_INVALID_SDP 465 /*! \brief The stream a trickle candidate for does not exist or is invalid */ #define JANUS_ERROR_TRICKE_INVALID_STREAM 466 /*! \brief A JSON element is of the wrong type (e.g., an integer instead of a string) */ #define JANUS_ERROR_INVALID_ELEMENT_TYPE 467 /*! \brief The ID provided to create a new session is already in use */ #define JANUS_ERROR_SESSION_CONFLICT 468 /*! \brief We got an ANSWER to an OFFER we never made */ #define JANUS_ERROR_UNEXPECTED_ANSWER 469 /*! \brief The auth token the request refers to doesn't exist */ #define JANUS_ERROR_TOKEN_NOT_FOUND 470 /*! \brief The current request cannot be handled because of not compatible WebRTC state */ #define JANUS_ERROR_WEBRTC_STATE 471 /*! \brief Helper method to get a string representation of an API error code * @param[in] error The API error code * @returns A string representation of the error code */ const char *janus_get_api_error(int error); #endif janus-gateway-0.2.6/auth.c000066400000000000000000000145251321621672100154130ustar00rootroot00000000000000/*! \file auth.c * \author Lorenzo Miniero * \copyright GNU General Public License v3 * \brief Requests authentication * \details Implementation of a simple mechanism for authenticating * requests. If enabled (it's disabled by default), the Janus admin API * can be used to specify valid tokens; each request must then contain * a valid token string, or otherwise the request is rejected with an * error. Whether tokens should be shared across users or not is * completely up to the controlling application: these tokens are * completely opaque to Janus, and treated as strings, which means * Janus will only check if the token exists or not when asked. * * \ingroup core * \ref core */ #include "auth.h" #include "debug.h" #include "mutex.h" /* Hash table to contain the tokens to match */ static GHashTable *tokens = NULL, *allowed_plugins = NULL; static gboolean auth_enabled = FALSE; static janus_mutex mutex; static void janus_auth_free_token(char *token) { g_free(token); } /* Setup */ void janus_auth_init(gboolean enabled) { if(enabled) { JANUS_LOG(LOG_INFO, "Token based authentication enabled\n"); tokens = g_hash_table_new_full(g_str_hash, g_str_equal, (GDestroyNotify)janus_auth_free_token, NULL); allowed_plugins = g_hash_table_new_full(g_str_hash, g_str_equal, (GDestroyNotify)janus_auth_free_token, NULL); auth_enabled = TRUE; } else { JANUS_LOG(LOG_WARN, "Token based authentication disabled\n"); } janus_mutex_init(&mutex); } gboolean janus_auth_is_enabled(void) { return auth_enabled; } void janus_auth_deinit(void) { janus_mutex_lock(&mutex); if(tokens != NULL) g_hash_table_destroy(tokens); tokens = NULL; if(allowed_plugins != NULL) g_hash_table_destroy(allowed_plugins); allowed_plugins = NULL; janus_mutex_unlock(&mutex); } /* Tokens manipulation */ gboolean janus_auth_add_token(const char *token) { if(!auth_enabled || tokens == NULL) { JANUS_LOG(LOG_ERR, "Can't add token, authentication mechanism is disabled\n"); return FALSE; } if(token == NULL) return FALSE; janus_mutex_lock(&mutex); if(g_hash_table_lookup(tokens, token)) { JANUS_LOG(LOG_VERB, "Token already validated\n"); janus_mutex_unlock(&mutex); return TRUE; } char *new_token = g_strdup(token); g_hash_table_insert(tokens, new_token, new_token); janus_mutex_unlock(&mutex); return TRUE; } gboolean janus_auth_check_token(const char *token) { /* Always TRUE if the mechanism is disabled, of course */ if(!auth_enabled || tokens == NULL) return TRUE; janus_mutex_lock(&mutex); if(token && g_hash_table_lookup(tokens, token)) { janus_mutex_unlock(&mutex); return TRUE; } janus_mutex_unlock(&mutex); return FALSE; } GList *janus_auth_list_tokens(void) { /* Always NULL if the mechanism is disabled, of course */ if(!auth_enabled || tokens == NULL) return NULL; janus_mutex_lock(&mutex); GList *list = NULL; if(g_hash_table_size(tokens) > 0) { GHashTableIter iter; gpointer value; g_hash_table_iter_init(&iter, tokens); while (g_hash_table_iter_next(&iter, NULL, &value)) { const char *token = value; list = g_list_append(list, g_strdup(token)); } } janus_mutex_unlock(&mutex); return list; } gboolean janus_auth_remove_token(const char *token) { if(!auth_enabled || tokens == NULL) { JANUS_LOG(LOG_ERR, "Can't remove token, authentication mechanism is disabled\n"); return FALSE; } janus_mutex_lock(&mutex); gboolean ok = token && g_hash_table_remove(tokens, token); /* Also clear the allowed plugins mapping */ GList *list = g_hash_table_lookup(allowed_plugins, token); g_hash_table_remove(allowed_plugins, token); if(list != NULL) g_list_free(list); /* Done */ janus_mutex_unlock(&mutex); return ok; } /* Plugins access */ gboolean janus_auth_allow_plugin(const char *token, void *plugin) { if(!auth_enabled || allowed_plugins == NULL) { JANUS_LOG(LOG_ERR, "Can't allow access to plugin, authentication mechanism is disabled\n"); return FALSE; } if(token == NULL || plugin == NULL) return FALSE; janus_mutex_lock(&mutex); if(!g_hash_table_lookup(tokens, token)) { janus_mutex_unlock(&mutex); return FALSE; } GList *list = g_hash_table_lookup(allowed_plugins, token); if(list == NULL) { /* Add the new permission now */ list = g_list_append(list, plugin); char *new_token = g_strdup(token); g_hash_table_insert(allowed_plugins, new_token, list); janus_mutex_unlock(&mutex); return TRUE; } /* We already have a list, update it if needed */ if(g_list_find(list, plugin) != NULL) { JANUS_LOG(LOG_VERB, "Plugin access already allowed for token\n"); janus_mutex_unlock(&mutex); return TRUE; } list = g_list_append(list, plugin); char *new_token = g_strdup(token); g_hash_table_insert(allowed_plugins, new_token, list); janus_mutex_unlock(&mutex); return TRUE; } gboolean janus_auth_check_plugin(const char *token, void *plugin) { /* Always TRUE if the mechanism is disabled, of course */ if(!auth_enabled || allowed_plugins == NULL) return TRUE; janus_mutex_lock(&mutex); if(!g_hash_table_lookup(tokens, token)) { janus_mutex_unlock(&mutex); return FALSE; } GList *list = g_hash_table_lookup(allowed_plugins, token); if(g_list_find(list, plugin) == NULL) { janus_mutex_unlock(&mutex); return FALSE; } janus_mutex_unlock(&mutex); return TRUE; } GList *janus_auth_list_plugins(const char *token) { /* Always NULL if the mechanism is disabled, of course */ if(!auth_enabled || allowed_plugins == NULL) return NULL; janus_mutex_lock(&mutex); if(!g_hash_table_lookup(tokens, token)) { janus_mutex_unlock(&mutex); return FALSE; } GList *list = NULL; GList *plugins_list = g_hash_table_lookup(allowed_plugins, token); if(plugins_list != NULL) list = g_list_copy(plugins_list); janus_mutex_unlock(&mutex); return list; } gboolean janus_auth_disallow_plugin(const char *token, void *plugin) { if(!auth_enabled || allowed_plugins == NULL) { JANUS_LOG(LOG_ERR, "Can't disallow access to plugin, authentication mechanism is disabled\n"); return FALSE; } janus_mutex_lock(&mutex); if(!g_hash_table_lookup(tokens, token)) { janus_mutex_unlock(&mutex); return FALSE; } GList *list = g_hash_table_lookup(allowed_plugins, token); if(list != NULL) { /* Update the list */ list = g_list_remove_all(list, plugin); char *new_token = g_strdup(token); g_hash_table_insert(allowed_plugins, new_token, list); } janus_mutex_unlock(&mutex); return TRUE; } janus-gateway-0.2.6/auth.h000066400000000000000000000065771321621672100154300ustar00rootroot00000000000000/*! \file auth.h * \author Lorenzo Miniero * \copyright GNU General Public License v3 * \brief Requests authentication (headers) * \details Implementation of a simple mechanism for authenticating * requests. If enabled (it's disabled by default), the Janus admin API * can be used to specify valid tokens; each request must then contain * a valid token string, or otherwise the request is rejected with an * error. Whether tokens should be shared across users or not is * completely up to the controlling application: these tokens are * completely opaque to Janus, and treated as strings, which means * Janus will only check if the token exists or not when asked. * * \ingroup core * \ref core */ #ifndef _JANUS_AUTH_H #define _JANUS_AUTH_H #include /*! \brief Method to initializing the token based authentication * @param[in] enabled Whether the authentication mechanism should be enabled or not */ void janus_auth_init(gboolean enabled); /*! \brief Method to check whether the mechanism is enabled or not */ gboolean janus_auth_is_enabled(void); /*! \brief Method to de-initialize the mechanism */ void janus_auth_deinit(void); /*! \brief Method to add a new valid token for authenticating * @param[in] token The new valid token * @returns true if the operation was successful, false otherwise */ gboolean janus_auth_add_token(const char *token); /*! \brief Method to check whether a provided token is valid or not * @param[in] token The token to validate * @returns true if the token is valid, false otherwise */ gboolean janus_auth_check_token(const char *token); /*! \brief Method to return a list of the tokens * \note It's the caller responsibility to free the list and its values * @returns A pointer to a GList instance containing the tokens */ GList *janus_auth_list_tokens(void); /*! \brief Method to invalidate an existing token * @param[in] token The valid to invalidate * @returns true if the operation was successful, false otherwise */ gboolean janus_auth_remove_token(const char *token); /*! \brief Method to allow a token to use a plugin * @param[in] token The token that can now access this plugin * @param[in] plugin Opaque pointer to the janus_plugin instance this token can access * @returns true if the operation was successful, false otherwise */ gboolean janus_auth_allow_plugin(const char *token, void *plugin); /*! \brief Method to check whether a provided token can access a specified plugin * @param[in] token The token to check * @param[in] plugin The plugin to check as an opaque pointer to a janus_plugin instance * @returns true if the token is allowed to access the plugin, false otherwise */ gboolean janus_auth_check_plugin(const char *token, void *plugin); /*! \brief Method to return a list of the plugins a specific token has access to * \note It's the caller responsibility to free the list (but NOT the values) * @param[in] token The token to get the list for * @returns A pointer to a GList instance containing the liist */ GList *janus_auth_list_plugins(const char *token); /*! \brief Method to disallow a token to use a plugin * @param[in] token The token this operation refers to * @param[in] plugin Opaque pointer to the janus_plugin instance this token can not access anymore * @returns true if the operation was successful, false otherwise */ gboolean janus_auth_disallow_plugin(const char *token, void *plugin); #endif janus-gateway-0.2.6/autogen.sh000077500000000000000000000001741321621672100163020ustar00rootroot00000000000000#!/bin/sh srcdir=`dirname $0` test -z "$srcdir" && srcdir=. mkdir -p m4 autoreconf --verbose --force --install || exit 1 janus-gateway-0.2.6/bower.json000066400000000000000000000017541321621672100163170ustar00rootroot00000000000000{ "name": "janus-gateway", "version": "0.2.6", "homepage": "https://github.com/meetecho/janus-gateway", "authors": [ "Lorenzo Miniero ", "Philip Withnall ", "Jack Leigh", "Pierce Lopez ", "Benjamin Trent ", "Dustin Oprea ", "Maurizio Porrato", "Giacomo Vacca", "mrauhu", "Min Wang", "leonuh", "Nicholas Wylie", "Graeme Yeates ", "gatecrasher777", "Damon Oehlman ", "Scott " ], "description": "A javascript library for interacting with the C based Janus WebRTC Gateway", "main": "./html/janus.js", "license": "GPLv3", "ignore": [ "**/.*", "**/*.alaw", "**/*.mjr", "node_modules", "bower_components", "test", "tests" ], "dependencies": { "jquery": "*", "webrtc-adapter": "5.0.1" } } janus-gateway-0.2.6/certs/000077500000000000000000000000001321621672100154175ustar00rootroot00000000000000janus-gateway-0.2.6/certs/README.md000066400000000000000000000031121321621672100166730ustar00rootroot00000000000000Certificates ============ This folder contains a sample certificate and key that you can use in Janus for everything that's related to security, most importantly DTLS-SRTP and, in case you need it (see the deployment instructions in the docs on why you may not), for HTTPS and/or secure WebSockets as well. Please beware that these certificates are just for testing: they're self signed and not certificated by any authority (and certainly not by us!). You can change the certificates to use in the ```janus.cfg``` settings. Should you want to generate some certificates yourself, refer to the instructions on how to do so that can be found pretty much everywhere. Please beware, though, that 512 bit certificates should be avoided, as explained in #251. # Feeling lazy? Just as an example and for the lazy (you'll probably find better samples around), here's how you can quickly create a certificate as needed by Janus: openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout privateKey.key -out certificate.crt Just follow the instructions. This will create a private key in ```privateKey.key``` and a certificate in ```certificate.crt```. To use them, update the configuration file ```janus.cfg``` accordingly, to have the ```cert_pem``` and ```cert_key``` in ```[certificates]``` point to the newly created files. If you are in need of certificates for use by browsers, for instance for the HTTP or WebSockets transports, you can get them from many Certificate Authorities including Letsencrypt.org, a CA that signs certificates for free and automatically using scripts on your server. janus-gateway-0.2.6/certs/mycert.key000066400000000000000000000016241321621672100174370ustar00rootroot00000000000000-----BEGIN PRIVATE KEY----- MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALFYwKzIRd4mhG4u nmZ8dM95Iz+SJTJYSSphVxDqW0VyAXxMFrCb5KiXuOKNgyPQMjRzXl5QVBwRhOh+ sR4bk3KvtBwQ5EeKlQoWKpahTjzXNt2e30BT+TF2QH0Hkvd7E4zR9YvHTPpZpdIW Wj90pS5BMAwCtisXJDKtoLPFnL7tAgMBAAECgYBEFDPyn/biLpsLyO2ZnhEhS/lS AAIzb1y23iMUJULgR8F2O6dCKLYAWi3pGjXLW7LKG7eQMPn4xGjm7yuCyUcyTcM6 RbOKIZhh3b2B3bpum6Jlil4dJ1UvEkqkJd0+r7PHs8FGECglqc/CsdQ/pYrGinSw L8IkOBwTVu7I9tpSQQJBANt49JFFWIxElS1u25yT9FhDwnqCvm1s2QhPoFyQj3XH RO25HRIx2XRjppUffgUfY050cJS+ET/ZElczGDZL0tUCQQDO3PKI5ymNmmYSW7d8 L+5b5PMqBcZT2h/RN8L/8R9WFpRgc3GvPh1F/pPukWBcl2/C72+Buhxh4iOf0F+6 /1e5AkA/L4+Z01Eu8P/R2Ly5U49hagCvrLyOXGwPjH0qqSPkUL5zgnvwJRHqBFaN UEfDycmZaMSQzjfBHgm9uSQbXbERAkEAv3Gj1Cd7QV2fEWZoTTpeshUVJdLqVTgN MicVBKE2iwmikBDHKZOmq9yLM8K/F3HfMN0+qSSAl+Ydag4CSqF9oQJAAykCIVcp jcfkZvTLAeDGx8hucMdSYojjPfK8aE5DMt8AFfYQaYIakbUDWDbTvkTpA2WftIso AbnGatWAt6uGrQ== -----END PRIVATE KEY----- janus-gateway-0.2.6/certs/mycert.pem000066400000000000000000000017751321621672100174370ustar00rootroot00000000000000-----BEGIN CERTIFICATE----- MIICxjCCAi+gAwIBAgIJAMjcXehohH9WMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNV BAYTAklUMQ8wDQYDVQQIDAZOYXBvbGkxDzANBgNVBAcMBk5hcG9saTEYMBYGA1UE CgwPTWVldGVjaG8gcy5yLmwuMQ4wDAYDVQQDDAVqYW51czEhMB8GCSqGSIb3DQEJ ARYSamFudXNAbWVldGVjaG8uY29tMB4XDTE1MDYwNDEzMjAxOFoXDTE2MDYwMzEz MjAxOFowfDELMAkGA1UEBhMCSVQxDzANBgNVBAgMBk5hcG9saTEPMA0GA1UEBwwG TmFwb2xpMRgwFgYDVQQKDA9NZWV0ZWNobyBzLnIubC4xDjAMBgNVBAMMBWphbnVz MSEwHwYJKoZIhvcNAQkBFhJqYW51c0BtZWV0ZWNoby5jb20wgZ8wDQYJKoZIhvcN AQEBBQADgY0AMIGJAoGBALFYwKzIRd4mhG4unmZ8dM95Iz+SJTJYSSphVxDqW0Vy AXxMFrCb5KiXuOKNgyPQMjRzXl5QVBwRhOh+sR4bk3KvtBwQ5EeKlQoWKpahTjzX Nt2e30BT+TF2QH0Hkvd7E4zR9YvHTPpZpdIWWj90pS5BMAwCtisXJDKtoLPFnL7t AgMBAAGjUDBOMB0GA1UdDgQWBBTXYPi6RVDqd4vCD5f8bTH9h7+F5jAfBgNVHSME GDAWgBTXYPi6RVDqd4vCD5f8bTH9h7+F5jAMBgNVHRMEBTADAQH/MA0GCSqGSIb3 DQEBCwUAA4GBAAOi1TaCPUZxn1ns0uWn5mRquxSTuQ/picYrbasKkM+5gNMeYnay jJzigo3UQGJBnTmvJOuEIaRmnKsVet+wbx26t690BP8KcawRybYM6+6av5AXxwrl sDpjOaAha5JZ/y1kPu7Vk0XPIgYw3vx7/BbxYC7Fbyet+ZVDd7vdBx+V -----END CERTIFICATE----- janus-gateway-0.2.6/conf/000077500000000000000000000000001321621672100152245ustar00rootroot00000000000000janus-gateway-0.2.6/conf/janus.cfg.sample.in000066400000000000000000000244301321621672100207150ustar00rootroot00000000000000; General configuration: folders where the configuration and the plugins ; can be found, how output should be logged, whether Janus should run as ; a daemon or in foreground, default interface to use, debug/logging level ; and, if needed, shared apisecret and/or token authentication mechanism ; between application(s) and Janus. [general] configs_folder = @confdir@ ; Configuration files folder plugins_folder = @plugindir@ ; Plugins folder transports_folder = @transportdir@ ; Transports folder events_folder = @eventdir@ ; Event handlers folder ;log_to_stdout = false ; Whether the Janus output should be written ; to stdout or not (default=true) ;log_to_file = /path/to/janus.log ; Whether to use a log file or not ;daemonize = true ; Whether Janus should run as a daemon ; or not (default=run in foreground) ;pid_file = /path/to/janus.pid ; PID file to create when Janus has been ; started, and to destroy at shutdown ;interface = 1.2.3.4 ; Interface to use (will be used in SDP) debug_level = 4 ; Debug/logging level, valid values are 0-7 ;debug_timestamps = yes ; Whether to show a timestamp for each log line ;debug_colors = no ; Whether colors should be disabled in the log ;api_secret = janusrocks ; String that all Janus requests must contain ; to be accepted/authorized by the Janus core. ; Useful if you're wrapping all Janus API requests ; in your servers (that is, not in the browser, ; where you do the things your way) and you ; don't want other application to mess with ; this Janus instance. ;token_auth = yes ; Enable a token based authentication ; mechanism to force users to always provide ; a valid token in all requests. Useful if ; you want to authenticate requests from web ; users. For this to work, the Admin API MUST ; be enabled, as tokens are added and removed ; through messages sent there. admin_secret = janusoverlord ; String that all Janus requests must contain ; to be accepted/authorized by the admin/monitor. ; only needed if you enabled the admin API ; in any of the available transports. ;server_name = MyJanusInstance ; Public name of this Janus instance ; as it will appear in an info request ;session_timeout = 60 ; How long (in seconds) we should wait before ; deciding a Janus session has timed out. A ; session times out when no request is received ; for session_timeout seconds (default=60s). ; Setting this to 0 will disable the timeout ; mechanism, which is NOT suggested as it may ; risk having orphaned sessions (sessions not ; controlled by any transport and never freed). ; To avoid timeouts, keep-alives can be used. ;recordings_tmp_ext = tmp ; The extension for recordings, in Janus, is ; .mjr, a custom format we devised ourselves. ; By default, we save to .mjr directly. If you'd ; rather the recording filename have a temporary ; extension while it's being saved, and only ; have the .mjr extension when the recording ; is over (e.g., to automatically trigger some ; external scripts), then uncomment and set the ; recordings_tmp_ext property to the extension ; to add to the base (e.g., tmp --> .mjr.tmp). ; Certificate and key to use for DTLS. [certificates] cert_pem = @certdir@/mycert.pem cert_key = @certdir@/mycert.key ; Media-related stuff: you can configure whether if you want ; to enable IPv6 support (still WIP, so handle with care), the maximum size ; of the NACK queue (in milliseconds, defaults to 500ms) for retransmissions, the ; range of ports to use for RTP and RTCP (by default, no range is envisaged), the ; starting MTU for DTLS (1472 by default, it adapts automatically), ; if BUNDLE should be forced (defaults to false) and if RTCP muxing should ; be forced (defaults to false), and finally how much time, in seconds, ; should pass with no media (audio or video) being received before Janus ; notifies you about this (default=1s, 0 disables these events entirely). [media] ;ipv6 = true ;max_nack_queue = 500 ;rtp_port_range = 20000-40000 ;dtls_mtu = 1200 ;force-bundle = true ;force-rtcp-mux = true ;no_media_timer = 1 ; NAT-related stuff: specifically, you can configure the STUN/TURN ; servers to use to gather candidates if the gateway is behind a NAT, ; and srflx/relay candidates are needed. In case STUN is not enough and ; this is needed (it shouldn't), you can also configure Janus to use a ; TURN server; please notice that this does NOT refer to TURN usage in ; browsers, but in the gathering of relay candidates by Janus itself, ; e.g., if you want to limit the ports used by a Janus instance on a ; private machine. Furthermore, you can choose whether Janus should be ; configured to work in ICE-Lite mode (by default it doesn't). Finally, ; you can also enable ICE-TCP support (beware that it currently *only* ; works if you enable ICE Lite as well), choose which interfaces should ; be used for gathering candidates, and enable or disable the ; internal libnice debugging, if needed. [nat] ;stun_server = stun.voip.eutelia.it ;stun_port = 3478 nice_debug = false ;ice_lite = true ;ice_tcp = true ; In case you're deploying Janus on a server which is configured with ; a 1:1 NAT (e.g., Amazon EC2), you might want to also specify the public ; address of the machine using the setting below. This will result in ; all host candidates (which normally have a private IP address) to ; be rewritten with the public address provided in the settings. As ; such, use the option with caution and only if you know what you're doing. ; Besides, it's still recommended to also enable STUN in those cases, ; and keep ICE Lite disabled as it's not strictly speaking a public server. ;nat_1_1_mapping = 1.2.3.4 ; You can configure a TURN server in two different ways: specifying a ; statically configured TURN server, and thus provide the address of the ; TURN server, the transport (udp/tcp/tls) to use, and a set of valid ; credentials to authenticate... ;turn_server = myturnserver.com ;turn_port = 3478 ;turn_type = udp ;turn_user = myuser ;turn_pwd = mypassword ; ... or you can make use of the TURN REST API to get info on one or more ; TURN services dynamically. This makes use of the proposed standard of ; such an API (https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00) ; which is currently available in both rfc5766-turn-server and coturn. ; You enable this by specifying the address of your TURN REST API backend, ; the HTTP method to use (GET or POST) and, if required, the API key Janus ; must provide. ;turn_rest_api = http://yourbackend.com/path/to/api ;turn_rest_api_key = anyapikeyyoumayhaveset ;turn_rest_api_method = GET ; You can also choose which interfaces should be explicitly used by the ; gateway for the purpose of ICE candidates gathering, thus excluding ; others that may be available. To do so, use the 'ice_enforce_list' ; setting and pass it a comma-separated list of interfaces or IP addresses ; to enforce. This is especially useful if the server hosting the gateway ; has several interfaces, and you only want a subset to be used. Any of ; the following examples are valid: ; ice_enforce_list = eth0 ; ice_enforce_list = eth0,eth1 ; ice_enforce_list = eth0,192.168. ; ice_enforce_list = eth0,192.168.0.1 ; By default, no interface is enforced, meaning Janus will try to use them all. ;ice_enforce_list = eth0 ; In case you don't want to specify specific interfaces to use, but would ; rather tell Janus to use all the available interfaces except some that ; you don't want to involve, you can also choose which interfaces or IP ; addresses should be excluded and ignored by the gateway for the purpose ; of ICE candidates gathering. To do so, use the 'ice_ignore_list' setting ; and pass it a comma-separated list of interfaces or IP addresses to ; ignore. This is especially useful if the server hosting the gateway ; has several interfaces you already know will not be used or will simply ; always slow down ICE (e.g., virtual interfaces created by VMware). ; Partial strings are supported, which means that any of the following ; examples are valid: ; ice_ignore_list = vmnet8,192.168.0.1,10.0.0.1 ; ice_ignore_list = vmnet,192.168. ; Just beware that the ICE ignore list is not used if an enforce list ; has been configured. By default, Janus ignores all interfaces whose ; name starts with 'vmnet', to skip VMware interfaces: ice_ignore_list = vmnet ; You can choose which of the available plugins should be ; enabled or not. Use the 'disable' directive to prevent Janus from ; loading one or more plugins: use a comma separated list of plugin file ; names to identify the plugins to disable. By default all available ; plugins are enabled and loaded at startup. [plugins] ; disable = libjanus_voicemail.so,libjanus_recordplay.so ; You can choose which of the available transports should be enabled or ; not. Use the 'disable' directive to prevent Janus from loading one ; or more transport: use a comma separated list of transport file names ; to identify the transports to disable. By default all available ; transports are enabled and loaded at startup. [transports] ; disable = libjanus_rabbitmq.so ; Event handlers allow you to receive live events from Janus happening ; in core and/or plugins. Since this can require some more resources, ; the feature is disabled by default. Setting broadcast to yes will ; enable them. You can then choose which of the available event handlers ; should be loaded or not. Use the 'disable' directive to prevent Janus ; from loading one or more event handlers: use a comma separated list of ; file names to identify the event handlers to disable. By default, if ; broadcast is set to yes all available event handlers are enabled and ; loaded at startup. Finally, you can choose how often media statistics ; (packets sent/received, losses, etc.) should be sent: by default it's ; once per second (audio and video statistics sent separately), but may ; considered too verbose, or you may want to limit the number of events, ; especially if you have many PeerConnections active. To change this, ; just set 'stats_period' to the number of seconds that should pass in ; between statistics for each handle. Setting it to 0 disables them (but ; not other media-related events). [events] ; broadcast = yes ; disable = libjanus_sampleevh.so ; stats_period = 5 janus-gateway-0.2.6/conf/janus.eventhandler.rabbitmqevh.cfg.sample000066400000000000000000000024151321621672100252700ustar00rootroot00000000000000; This configures the RabbitMQ event handler. [general] enabled = no ; By default the module is not enabled events = all ; Comma separated list of the events mask you're interested ; in. Valid values are none, sessions, handles, jsep, webrtc, ; media, plugins, transports, core and all. By default we ; subscribe to everything (all) grouping = yes ; Whether events should be sent individually , or if it's ok ; to group them. The default is 'yes' to limit the number of ; messages host = localhost ; The address of the RabbitMQ server ;port = 5672 ; The port of the RabbitMQ server (5672 by default) ;username = guest ; Username to use to authenticate, if needed ;password = guest ; Password to use to authenticate, if needed ;vhost = / ; Virtual host to specify when logging in, if needed ;exchange = janus-exchange route_key = janus-events ; Name of the queue for event messages ;ssl_enable = no ; Whether ssl support must be enabled ;ssl_verify_peer = yes ; Whether peer verification must be enabled ;ssl_verify_hostname = yes ; Whether hostname verification must be enabled ; certificates to use when SSL support is enabled, if needed ;ssl_cacert = /path/to/cacert.pem ;ssl_cert = /path/to/cert.pem ;ssl_key = /path/to/key.pem janus-gateway-0.2.6/conf/janus.eventhandler.sampleevh.cfg.sample000066400000000000000000000034621321621672100247530ustar00rootroot00000000000000; This configures the sample event handler. Since this plugin simply ; forwards each event it receives via HTTP POST, you simply need to ; configure (i) which events to subscribe to, and (ii) the address of ; the web server which will receive the requests. [general] enabled = no ; By default the module is not enabled events = all ; Comma separated list of the events mask you're interested ; in. Valid values are none, sessions, handles, jsep, webrtc, ; media, plugins, transports, core and all. By default we ; subscribe to everything (all) grouping = yes ; Whether events should be sent individually (one per ; HTTP POST, JSON object), or if it's ok to group them ; (one or more per HTTP POST, JSON array with objects) ; The default is 'yes' to limit the number of connections. backend = http://your.webserver.here/and/a/path ; Address the plugin will send all events to as HTTP POST ; requests with an application/json payload. In case ; authentication is required to contact the backend, set ; the credentials as well (basic authentication only). ;backend_user = myuser ;backend_pwd = mypwd ; You can also configure how retransmissions should ; happen, after a failed attempt to deliver an event. ; Specifically, you can specify how many times a ; retransmission should be attempted (default=5) and ; which step is used, in milliseconds, for the exponential ; backoff before retrying (e.g, if step=100ms, then the ; the first retry will happen after 100ms, the second ; after 200ms, then 400ms, and so on). If the event cannot ; be retransmitted after the maximum number of attemps ; is reached, then it's lost. Beware that retransmissions ; will also delay pending events and increase the queue. ;max_retransmisson = 5 ;retransmissions_backoff = 100 janus-gateway-0.2.6/conf/janus.plugin.audiobridge.cfg.sample000066400000000000000000000037561321621672100240720ustar00rootroot00000000000000; [] ; description = This is my awesome room ; is_private = yes|no (whether this room should be in the public list, default=yes) ; secret = ; pin = ; sampling_rate = (e.g., 16000 for wideband mixing) ; audiolevel_ext = yes|no (whether the ssrc-audio-level RTP extension must ; be negotiated/used or not for new joins, default=yes) ; audiolevel_event = yes|no (whether to emit event to other users or not, default=no) ; audio_active_packets = 100 (number of packets with audio level, default=100, 2 seconds) ; audio_level_average = 25 (average value of audio level, 127=muted, 0='too loud', default=25) ; record = true|false (whether this room should be recorded, default=false) ; record_file = /path/to/recording.wav (where to save the recording) ; ; The following lines are only needed if you want the mixed audio ; to be automatically forwarded via plain RTP to an external component ; (e.g., an ffmpeg script, or a gstreamer pipeline) for processing ; rtp_forward_id = numeric RTP forwarder ID for referencing it via API (optional: random ID used if missing) ; rtp_forward_host = host address to forward RTP packets of mixed audio to ; rtp_forward_port = port to forward RTP packets of mixed audio to ; rtp_forward_ssrc = SSRC to use to use when streaming (optional: stream_id used if missing) ; rtp_forward_ptype = payload type to use when streaming (optional: 100 used if missing) ; rtp_forward_always_on = true|false, whether silence should be forwarded when the room is empty (optional: false used if missing) [general] ;admin_key = supersecret ; If set, rooms can be created via API only ; if this key is provided in the request ;events = no ; Whether events should be sent to event ; handlers (default is yes) [1234] description = Demo Room secret = adminpwd sampling_rate = 16000 record = false ;record_file = /path/to/recording.wav janus-gateway-0.2.6/conf/janus.plugin.echotest.cfg.sample000066400000000000000000000001331321621672100234140ustar00rootroot00000000000000; events = yes|no, whether events should be sent to event handlers [general] ;events = no janus-gateway-0.2.6/conf/janus.plugin.nosip.cfg.sample000066400000000000000000000004571321621672100227370ustar00rootroot00000000000000[general] ; Specify which local IP address to use. If not set it will be automatically ; guessed from the system ;local_ip = 1.2.3.4 ; Range of ports to use for RTP/RTCP (default=10000-60000) rtp_port_range = 20000-40000 ; Whether events should be sent to event handlers (default is yes) ;events = no janus-gateway-0.2.6/conf/janus.plugin.recordplay.cfg.sample.in000066400000000000000000000002501321621672100243470ustar00rootroot00000000000000; path = where to place recordings in the file system ; events = yes|no, whether events should be sent to event handlers [general] path = @recordingsdir@ ;events = no janus-gateway-0.2.6/conf/janus.plugin.sip.cfg.sample000066400000000000000000000014371321621672100224010ustar00rootroot00000000000000[general] ; Specify which local IP address to use. If not set it will be automatically ; guessed from the system ;local_ip = 1.2.3.4 ; Enable local keep-alives to keep the registration open. Keep-alives are ; sent in the form of OPTIONS requests, at the given interval inseconds. ; (0 to disable) keepalive_interval = 120 ; Indicate if the server is behind NAT. If so, the server will use STUN ; to guess its own public IP address and use it in the Contact header of ; outgoing requests behind_nat = no ; User-Agent string to be used ; user_agent = Cool WebRTC Gateway ; Expiration time for registrations register_ttl = 3600 ; Range of ports to use for RTP/RTCP (default=10000-60000) rtp_port_range = 20000-40000 ; Whether events should be sent to event handlers (default is yes) ;events = no janus-gateway-0.2.6/conf/janus.plugin.sipre.cfg.sample000066400000000000000000000006531321621672100227270ustar00rootroot00000000000000[general] ; Specify which local IP address to use. If not set it will be automatically ; guessed from the system ;local_ip = 1.2.3.4 ; User-Agent string to be used ; user_agent = Cool WebRTC Gateway ; Expiration time for registrations register_ttl = 3600 ; Range of ports to use for RTP/RTCP (default=10000-60000) rtp_port_range = 20000-40000 ; Whether events should be sent to event handlers (default is yes) ;events = no janus-gateway-0.2.6/conf/janus.plugin.streaming.cfg.sample.in000066400000000000000000000132551321621672100242050ustar00rootroot00000000000000; [stream-name] ; type = rtp|live|ondemand|rtsp ; rtp = stream originated by an external tool (e.g., gstreamer or ; ffmpeg) and sent to the plugin via RTP ; live = local file streamed live to multiple listeners ; (multiple listeners = same streaming context) ; ondemand = local file streamed on-demand to a single listener ; (multiple listeners = different streaming contexts) ; rtsp = stream originated by an external RTSP feed (only ; available if libcurl support was compiled) ; id = (if missing, a random one will be generated) ; description = This is my awesome stream ; is_private = yes|no (private streams don't appear when you do a 'list' ; request) ; secret = ; pin = ; filename = path to the local file to stream (only for live/ondemand) ; audio = yes|no (do/don't stream audio) ; video = yes|no (do/don't stream video) ; The following options are only valid for the 'rtp' type: ; data = yes|no (do/don't stream text via datachannels) ; audioport = local port for receiving audio frames ; audiomcast = multicast group port for receiving audio frames, if any ; audioiface = network interface or IP address to bind to, if any (binds to all otherwise) ; audiopt =