diff options
-rw-r--r-- | apps/app_minivm.c | 2 | ||||
-rw-r--r-- | include/asterisk/doxygen/asterisk-git-howto.h | 235 | ||||
-rw-r--r-- | include/asterisk/doxygen/commits.h | 114 | ||||
-rw-r--r-- | include/asterisk/doxygen/releases.h | 294 | ||||
-rw-r--r-- | include/asterisk/doxygen/reviewboard.h | 125 | ||||
-rw-r--r-- | include/asterisk/doxyref.h | 6 | ||||
-rw-r--r-- | main/acl.c | 61 | ||||
-rw-r--r-- | main/bridge_basic.c | 24 | ||||
-rw-r--r-- | res/res_fax.c | 15 | ||||
-rw-r--r-- | res/res_pjsip/location.c | 19 | ||||
-rw-r--r-- | res/res_pjsip/pjsip_configuration.c | 2 | ||||
-rw-r--r-- | res/res_pjsip_endpoint_identifier_anonymous.c | 6 | ||||
-rw-r--r-- | res/res_pjsip_endpoint_identifier_user.c | 12 | ||||
-rw-r--r-- | res/snmp/agent.c | 4 | ||||
-rw-r--r-- | tests/test_logger.c | 4 | ||||
-rw-r--r-- | tests/test_pbx.c | 2 |
16 files changed, 106 insertions, 819 deletions
diff --git a/apps/app_minivm.c b/apps/app_minivm.c index 6b1e8bb83..dcf0ee2fa 100644 --- a/apps/app_minivm.c +++ b/apps/app_minivm.c @@ -1254,7 +1254,7 @@ static int sendmail(struct minivm_template *template, struct minivm_account *vmu struct ast_channel *chan = NULL; char *fromaddress; char *fromemail; - int res; + int res = -1; if (!str1 || !str2) { return -1; diff --git a/include/asterisk/doxygen/asterisk-git-howto.h b/include/asterisk/doxygen/asterisk-git-howto.h deleted file mode 100644 index 1ecce15c0..000000000 --- a/include/asterisk/doxygen/asterisk-git-howto.h +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Asterisk -- An open source telephony toolkit. - * - * Copyright (C) 1999 - 2009, Digium, Inc. - * - * See http://www.asterisk.org for more information about - * the Asterisk project. Please do not directly contact - * any of the maintainers of this project for assistance; - * the project provides a web site, mailing lists and IRC - * channels for your use. - * - * This program is free software, distributed under the terms of - * the GNU General Public License Version 2. See the LICENSE file - * at the top of the source tree. - */ - -/*! - * \file - */ - -/*! - * \page AsteriskGitHowto How to setup a local GIT mirror of the Asterisk SVN repository - * - * <hr> - * - * \section Introduction Introduction - * This document will instruct you how to setup a local git mirror of the - * Asterisk SVN repository. - * - * Why would you want that? for starters, it's a fast repository browser - * and works well even when offline. More on why and why not at 'Pros and Cons' - * in the end of this document. - * <hr> - * - * \section Setup Setup - * - * Make sure you have the package - * - \verbatim - git-svn - \endverbatim - * - * installed. It is part of the standard git distribution and included in - * any recent Linux distribution. - * - * Next, get the files from this repository: - * - \verbatim - git clone http://git.tzafrir.org.il/git/asterisk-tools.git - \endverbatim - * - * Which will create the subdirectory 'asterisk-tools' under your working - * directory. For the purpose of this HOWTO I assume that you will later - * download Asterisk under the same directory. - * - * Now let's get Asterisk: - * - \verbatim - git svn clone -s http://svn.digium.com/svn/asterisk - \endverbatim - * - * This will download the whole /trunk , /tags and /branches hirarchies - * to a new git repository under asterisk/ . - * This will take a L O N G time. In the order of magnitude of a - * day. If it stops in the middle: - * - \verbatim - # cd asterisk; git svn fetch --fetch-all - \endverbatim - * - * All commands as of this point are run from the newly-created subdirectory - * 'asterisk' - * - \verbatim - cd asterisk - \endverbatim - * - * Next make your repository more compact: - * - * \note FIXME: I now get a .git subdirectory of the size of 135MB. This seems - * overly large considering what I got a few monthes ago. - * - \verbatim - git repack -a - \endverbatim - * - * Now fix the menuselect bits. One possible venue is to use submodules. - * This would require setting a separate menuselect repository . And - * fixing the submodule references in every new tag to point to the right - * place. I gave up at this stage, and instead reimplememented menuselect - * - \verbatim - cp -a ../asterisk-tools/menuselect menuselect - make -C menuselect dummies - chmod +x menuselect/menuselect - \endverbatim - * - * Next thing to do is ignore generated files. .gitignore is somewhat - * like svn:ignore . Though it is possible to use one at the top - * directory. Hence I decided to make it ignore itself as well: - * - \verbatim - cp ../asterisk-tools/asterisk_gitignore .gitignore - \endverbatim - * - * Now let's generate tags that will point to the tags/* branches. - * e.g. tag 'v1.4.8' will point to the head of branch tags/1.4.8 . - * If you don't like the extra 'v', just edit the sed command. - * - \verbatim - ../asterisk-tools/update_tags - \endverbatim - * - * Example configuration (refer to menuselect/menuselelct for more - * information). For instance: res_snmp breaks building 1.4 from git: - * - \verbatim - echo 'exclude res_snmp' >build_tools/conf - \endverbatim - * - * <hr> - * - * \section Update Update - * The main Asterisk repository tends to get new commits occasionally. I - * suppose you want those updates in your local copy. The following command - * should normally be done from the master branch. If you actually use branches, - * it is recommended to switch to it beforehand: - * - \verbatim - git checkout master - \endverbatim - * - * Next, get all updates. - * <hr> - * - * \section Usage Usage - * - * If you use git from the command-line, it is highly recommended to enable - * programmable bash completion. The git command-line is way more complex - * than svn, but the completion makes it usable: - * - * - \verbatim - asterisk$ git show v1.2.28<tab><tab> - v1.2.28 v1.2.28.1 - - asterisk$ git show v1.2.28:c<tab><tab> - callerid.c channel.c cli.c coef_out.h contrib/ - cdr/ channels/ codecs/ config.c cryptostub.c - cdr.c chanvars.c coef_in.h configs/ cygwin/ - - asterisk$ git svn<tab><tab> - clone fetch log set-tree - commit-diff find-rev propget show-externals - create-ignore info proplist show-ignore - dcommit init rebase - - asterisk$ git svn rebase --f - --fetch-all --follow-parent - \endverbatim - * - * Some useful commands: - * - \verbatim - git svn rebase --fetch-all # pull updates from upstream - man git-FOO # documentation for 'git FOO' - # <tree> is any place on graph of branches: HEAD, name of a branch or - # a tag, commit ID, and some others - git show <tree> # The top commit in this tree (log + diff) - git show <tree>:directory # directory listing - git show <tree>:some/file # get that file - git log <tree> # commit log up to that point - git branch # shows local branches and in which one you are - git branch -r # List remote branches. Such are SVN ones. - \endverbatim - * - * For more information, see the man page gittutorial as well as - * \arg http://git-scm.com/documentation - * - \verbatim - git svn rebase --fetch-all - \endverbatim - * - * <hr> - * - * \section ProsAndCons Pros and Cons - * - * \subsection TheGood The Good - * - * Working off-line: - * If you want to be able to use 'svn log' and 'svn diff' to a different - * branch, now you can. - * - * Efficient repository browser: - * With git you can effectively browse commit logs and working copies of - * various branches. In fact, using it merely as a logs and versions - * browser can be useful on its own. - * - * Branches really work: - * With SVN merging a branch is complicated. Partially because lack of - * separate merge tracking.With git you don't need the extra svnmerge: - * changes that don't collide with your branch merge in a quick merge - * operation. - * - * \subsection Limitations Limitations - * - * svn:externals : - * does not really work well with git-svn (and similar systems: svk, - * bzr-svn and hg-svn). Git has something called submodules that allows - * emulating the basic functionality of svn:externals, but is not as - * transparent. - * - * Commiting: - * Not sure how safe it is to commit from such a copy. In most places I - * see that it is not recommended to commit directly from git-svn. OTOH, - * git has some tools that make it easy to prepare a patch set out of a - * branch (e.g. git format-patch). - * - * IIRC there are also some issues for git-svn with https certificate - * authentication in the first place. - * - * Tags: - * /tags are branches. SVN tags are really branches that we pretend not - * to change. And in fact in Asterisk we practically do change. But see - * workaround below to generate tags from the tag branches. - * - * /team branches:: - * At least with git 1.5.x you can't easily follow all the team branches. - * This is due to a bug in their handling of wildcards in branches - * description. I believe this has been resolved in 1.6 but I didn't get - * to test that. Even if it will, it will require an extra step of manual - * editing. - * - * <hr> - */ diff --git a/include/asterisk/doxygen/commits.h b/include/asterisk/doxygen/commits.h deleted file mode 100644 index 032bfc5f4..000000000 --- a/include/asterisk/doxygen/commits.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Asterisk -- An open source telephony toolkit. - * - * Copyright (C) 1999 - 2009, Digium, Inc. - * - * See http://www.asterisk.org for more information about - * the Asterisk project. Please do not directly contact - * any of the maintainers of this project for assistance; - * the project provides a web site, mailing lists and IRC - * channels for your use. - * - * This program is free software, distributed under the terms of - * the GNU General Public License Version 2. See the LICENSE file - * at the top of the source tree. - */ - -/*! - * \file - */ - -/*! - * \page CommitMessages Guidelines for Commit Messages - * - * <hr> - * - * \section CommitMsgFormatting Commit Message Formatting - * - * The following illustrates the basic outline for commit messages: - * - * \verbatim - * <One-liner summary of changes> - * - * <Empty Line> - * - * <Verbose description of the changes> - * - * <Empty Line> - * - * <Special Tags> - * \endverbatim - * - * Some commit history viewers treat the first line of commit messages as the - * summary for the commit. So, an effort should be made to format our commit - * messages in that fashion. The verbose description may contain multiple - * paragraphs, itemized lists, etc. Always end the first sentence (and any - * subsequent sentences) with punctuation. - * - * Commit messages should be wrapped at 80 %columns. - * - * \note For trivial commits, such as "fix the build", or "fix spelling mistake", - * the verbose description may not be necessary. - * - * <hr> - * - * \section CommitMsgTags Special Tags for Commit Messages - * - * \subsection MantisTags Mantis (https://issues.asterisk.org/) - * - * To have a commit noted in an issue, use a tag of the form: - * \arg (issue #1234) - * - * To have a commit automatically close an issue, use a tag of the form: - * \arg (closes issue #1234) - * - * When making a commit for a mantis issue, it is easiest to use the - * provided commit %message template functionality. It will format the - * special tags appropriately, and will also include information about who - * reported the issue, which patches are being applied, and who did testing. - * - * Assuming that you have bug marshal access (and if you have commit access, - * it is pretty safe to assume that you do), you will find the commit %message - * template section directly below the issue details section and above the - * issue relationships section. You will have to click the '+' next to - * "Commit message template" to make the contents of the section visible. - * - * Here is an example of what the template will generate for you: - * - * \verbatim - * (closes issue #1234) - * Reported by: SomeGuy - * Patches: - * fix_bug_1234.diff uploaded by SomeDeveloper (license 5678) - * \endverbatim - * - * If the patch being committed was written by the person doing the commit, - * and is not available to reference as an upload to the issue, there is no - * need to include something like "fixed by me", as that will be the default - * assumption when a specific patch is not referenced. - * - * \subsection ReviewBoardTags Review Board (https://reviewboard.asterisk.org/) - * - * To have a commit set a review request as submitted, include the full URL - * to the review request. For example: - * \arg Review: %https://reviewboard.asterisk.org/r/95/ - * - * \note The trailing slash in the review URL is required. - * - * <hr> - * - * \section CommitMsgSvnmerge Commit Messages with svnmerge - * - * When using the svnmerge tool for merging changes between branches, use the - * commit %message generated by svnmerge. The '-f' option to svnmerge allows - * you to specify a file for svnmerge to write out a commit %message to. The - * '-F' option to svn commit allows you to specify a file that contains the - * commit %message. - * - * If you are using the expect script wrappers for svnmerge from repotools, - * a commit %message is automatically placed in the file '../merge.msg'. - * - * For more detailed information about working with branches and merging, - * see the following page on %asterisk.org: - * \arg https://wiki.asterisk.org/wiki/display/AST/Subversion+Usage - */ diff --git a/include/asterisk/doxygen/releases.h b/include/asterisk/doxygen/releases.h deleted file mode 100644 index d1b33ffd2..000000000 --- a/include/asterisk/doxygen/releases.h +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Asterisk -- An open source telephony toolkit. - * - * Copyright (C) 1999 - 2009, Digium, Inc. - * - * See http://www.asterisk.org for more information about - * the Asterisk project. Please do not directly contact - * any of the maintainers of this project for assistance; - * the project provides a web site, mailing lists and IRC - * channels for your use. - * - * This program is free software, distributed under the terms of - * the GNU General Public License Version 2. See the LICENSE file - * at the top of the source tree. - */ - -/*! - * \file - */ - -/*! - * \page ReleaseStatus Asterisk Release Status - * - * \section warranty Warranty - * The following warranty applies to all open source releases of Asterisk: - * - * NO WARRANTY - * - * BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY - * FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN - * OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES - * PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED - * OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS - * TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE - * PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, - * REPAIR OR CORRECTION. - - * IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING - * WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR - * REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, - * INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING - * OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED - * TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY - * YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER - * PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGES. - * - * \section releasestatustypes Release Status Types - * - * Release management is a essentially an agreement between the development - * community and the %user community on what kind of updates can be expected - * for Asterisk releases, and what types of changes these updates will contain. - * Once these policies are established, the development community works very - * hard to adhere to them. However, the development community does reserve - * the right to make exceptions to these rules for special cases as the need - * arises. - * - * Asterisk releases are in various states of maintenance. The states are - * defined here: - * - * \arg <b>None</b> - This release series is receiving no updates whatsoever. - * \arg <b>Security-Only</b> - This release series is receiving updates, but - * only to address security issues. Security issues found and fixed in - * this release series will be accompanied by a published security advisory - * from the Asterisk project. - * \arg <b>Full-Support</b> - This release series is receiving updates for all - * types of bugs. - * \arg <b>Full-Development</b> - Changes in this part of Asterisk include bug - * fixes, as well as new %features and architectural improvements. - * - * \section AsteriskReleases Asterisk Maintenance Levels - * - * \htmlonly - * <table border="1"> - * <tr> - * <td><b>Name</b></td> - * <td><b>SVN Branch</b></td> - * <td><b>Status</b></td> - * <td><b>Notes</b></td> - * </tr> - * <tr> - * <td>Asterisk 1.0</td> - * <td>/branches/1.0</td> - * <td>None</td> - * </tr> - * <tr> - * <td>Asterisk 1.2</td> - * <td>/branches/1.2</td> - * <td>Security-Only</td> - * </tr> - * <tr> - * <td>Asterisk 1.4</td> - * <td>/branches/1.4</td> - * <td>Full-Support</td> - * </tr> - * <tr> - * <td>Asterisk 1.6.0</td> - * <td>/branches/1.6.0</td> - * <td>Full-Support</td> - * </tr> - * <tr> - * <td>Asterisk 1.6.1</td> - * <td>/branches/1.6.1</td> - * <td>Full-Support</td> - * <td>Still in beta</td> - * </tr> - * <tr> - * <td>Asterisk trunk</td> - * <td>/trunk</td> - * <td>Full-Development</td> - * <td>No releases are made directly from trunk.</td> - * </tr> - * </table> - * \endhtmlonly - * - * For more information on how and when Asterisk releases are made, see the - * release policies page: - * \arg \ref ReleasePolicies - */ - -/*! - * \page ReleasePolicies Asterisk Release and Commit Policies - * - * \section releasestatus Asterisk Release Status - * - * For more information on the current status of each Asterisk release series, - * please see the Asterisk Release Status page: - * - * \arg \ref ReleaseStatus - * - * <hr> - * - * \section commitmonitoring Commit Monitoring - * - * To monitor commits to Asterisk and related projects, visit - * <a href="http://lists.digium.com/">http://lists.digium.com</a>. The Digium - * mailing list server hosts a %number of mailing lists for commits. - * - * <hr> - * - * \section ast10policy Asterisk 1.0 - * - * \subsection svnbranch SVN Branch - * - * \arg /branches/1.0 - * - * \subsection ast10releases Release and Commit Policy - * No more releases of Asterisk 1.0 will be made for any reason. - * - * No commits should be made to the Asterisk 1.0 branch. - * - * <hr> - * - * \section ast12policy Asterisk 1.2 - * - * \subsection svnbranch SVN Branch - * - * \arg /branches/1.2 - * - * \subsection ast12releases Release and Commit Policy - * - * There will be no more scheduled releases of Asterisk 1.2. - * - * Commits to the Asterisk 1.2 branch should only address security issues or - * regressions introduced by previous security fixes. For a security issue, the - * commit should be accompanied by an - * <a href="http://downloads.asterisk.org/pub/security/">Asterisk Security Advisory</a> - * and an immediate release. When a commit goes in to fix a regression, the previous - * security advisory that is related to the change that introduced the bug should get - * updated to indicate that there is an updated version of the fix. A release should - * be made immediately for these regression fixes, as well. - * - * \subsection ast12releasenumbers Release Numbering - * - * - 1.2.X - a release that contains new security fixes - * - 1.2.X.Y - a release that contains fixes to the security patches released in - * version 1.2.X - * - * <hr> - * - * \section ast14policy Asterisk 1.4 - * - * \subsection svnbranch SVN Branch - * - * \arg /branches/1.4 - * - * \subsection ast14releases Release and Commit Policy - * - * Asterisk 1.4 is receiving regular bug fix release updates. An attempt is made to - * make releases of every four to six weeks. Since this release series is receiving - * changes for all types of bugs, the number of changes in a single release can be - * significant. 1.4.X releases go through a release candidate testing cycle to help - * catch any regressions that may have been introduced. - * - * Commits to Asterisk 1.4 must be to address bugs only. No new %features should be - * introduced into Asterisk 1.4 to reduce the %number of changes to this established - * release series. The only exceptions to this %rule are for cases where something - * that may be considered a feature is needed to address a bug or security issue. - * - * \subsection ast14releasenumbers Release Numbering - * - * - 1.4.X - a release that contains new bug fixes to the 1.4 release series - * - 1.4.X.Y - a release that contains very few changes on top of 1.4.X. This - * may be for a security patch, or for a regression introduced in 1.4.X. - * - * <hr> - * - * \section ast16policy Asterisk 1.6 - * - * \subsection svnbranch SVN Branch - * - * \arg /branches/1.6.* - * - * \subsection ast16releases Release and Commit Policy - * - * Asterisk 1.6 is managed in a different way than previous Asterisk release series. - * From a high level, it was inspired by the release model used for Linux 2.6. - * The intended time frame for 1.6.X releases is every 2 or 3 months. Each 1.6.X - * release gets its own branch. The 1.6.X branches are branches off of trunk. - * Once the branch is created, it only receives bug fixes. Each 1.6.X release goes - * through a beta and release candidate testing cycle. - * - * After a 1.6.X release is published, it will be maintained until 1.6.[X + 3] is - * released. While a 1.6.X release branch is still maintained, it will receive only - * bug fixes. Periodic maintenance releases will be made and labeled as 1.6.X.Y. - * 1.6.X.Y releases should go through a release candidate test cycle before being - * published. - * - * For now, all previous 1.6 release will be maintained for security issues. Once - * we have more 1.6 releases to deal with, this part of the policy will likely change. - * - * For some history on the motivations for Asterisk 1.6 release management, see the - * first two sections of this - * <a href="http://lists.digium.com/pipermail/asterisk-dev/2007-October/030083.html">mailing list post</a>. - * - * \subsection ast16releasenumbers Release Numbering - * - * - 1.6.X - a release that includes new functionality - * - 1.6.X.Y - a release that contains fixes for bugs or security issues identified - * in the 1.6.X release series. - * - * <hr> - * - * \section asttrunk Asterisk Trunk - * - * \subsection svnbranch SVN Branch - * - * \arg /trunk - * - * \subsection asttrunkpolicy Release and Commit Policy - * - * No releases are ever made directly from Asterisk trunk. - * - * Asterisk trunk is used as the main development area for upcoming Asterisk 1.6 - * releases. Commits to Asterisk trunk are not limited. They can be bug fixes, - * new %features, and architectural improvements. However, for larger sets - * of changes, developers should work with the Asterisk project leaders to - * schedule them for inclusion. Care is taken not to include too many invasive - * sets of changes for each new Asterisk 1.6 release. - * - * No changes should go into Asterisk trunk that are not ready to go into a - * release. While the upcoming release will go through a beta and release - * candidate test cycle, code should not be in trunk until the code has been - * tested and reviewed such that there is reasonable belief that the code - * is ready to go. - * - * <hr> - * - * \section astteam Asterisk Team Branches - * - * \subsection svnbranch SVN Branch - * - * \arg /team/<developername> - * - * \subsection astteampolicy Release and Commit Policy - * - * The Asterisk subversion repository has a special directory called "team" - * where developers can make their own personal development branches. This is - * where new %features, bug fixes, and architectural improvements are developed - * while they are in %progress. - * - * Just about anything goes as far as commits to this area goes. However, - * developers should keep in mind that anything committed here, as well as - * anywhere else on Digium's SVN server, falls under the contributor license - * agreement. - * - * In addition to each developer having their own space for working on projects, - * there is also a team/group folder where %group development efforts take place. - * - * Finally, in each developer folder, there is a folder called "private". This - * is where developers can create branches for working on things that they are - * not ready for the whole world to see. - */ diff --git a/include/asterisk/doxygen/reviewboard.h b/include/asterisk/doxygen/reviewboard.h deleted file mode 100644 index 59ab852bd..000000000 --- a/include/asterisk/doxygen/reviewboard.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -* Asterisk -- An open source telephony toolkit. -* -* Copyright (C) 1999 - 2009, Digium, Inc. -* -* See http://www.asterisk.org for more information about -* the Asterisk project. Please do not directly contact -* any of the maintainers of this project for assistance; -* the project provides a web site, mailing lists and IRC -* channels for your use. -* -* This program is free software, distributed under the terms of -* the GNU General Public License Version 2. See the LICENSE file -* at the top of the source tree. -*/ - -/*! -* \file -*/ - -/*! - * \page Reviewboard Reviewboard Usage and Guidelines - * - * <hr> - * - * \section ReviewboardGuidelines Usage Guidelines - * - * Mantis (https://issues.asterisk.org) and Reviewboard (https://reviewboard.asterisk.org) - * are both utilities that the Asterisk development community uses to help - * track and review code being written for Asterisk. Since both systems - * are used for posting patches, it is worth discussing when it is appropriate - * to use reviewboard and when not. - * - * Here are the situations in which it is appropriate to post code to reviewboard: - * - A committer has a patch that they would like to get some feedback on before - * merging into one of the main branches. - * - A committer or bug marshal has requested a contributor to post their patch - * from Mantis on reviewboard to aid in the review process. This typically - * happens with complex code contributions where reviewboard can help aid in - * providing feedback. - * - * We do encourage all interested parties to participate in the review process. - * However, aside from the cases mentioned above, we prefer that all code - * submissions first go through Mantis. - * - * \note It is acceptable for a committer to post patches to reviewboard before - * they are complete to get some feedback on the approach being taken. However, - * if the code is not yet ready to be merged, it \b must be documented as such. - * A review request with a patch proposed for merging should have documented - * testing and should not have blatant coding guidelines violations. Lack of - * these things is careless and shows disrespect for those reviewing your code. - * - * <hr> - * - * \section ReviewboardPosting Posting Code to Reviewboard - * - * \subsection postreview Using post-review - * - * The easiest way to post a patch to reviewboard is by using the - * post-review tool. We have post-review in our repotools svn repository. - * - * \verbatim - * $ svn co http://svn.digium.com/svn/repotools - * \endverbatim - * - * Essentially, post-review is a script that will take the output of "svn - * diff" and create a review request out of it for you. So, once you have - * a working copy with the changes you expect in the output of "svn diff", - * you just run the following command: - * - * \verbatim - * $ post-review - * \endverbatim - * - * If it complains about not knowing which reviewboard server to use, add - * the server option: - * - * \verbatim - * $ post-review --server=https://reviewboard.asterisk.org - * \endverbatim - * - * \subsection postreviewnewfiles Dealing with New Files - * - * I have one final note about an oddity with using post-review. If you - * maintain your code in a team branch, and the new code includes new - * files, there are some additional steps you must take to get post-review - * to behave properly. - * - * You would start by getting your changes applied to a trunk working copy: - * - * \verbatim - * $ cd .../trunk - * \endverbatim - * - * Then, apply the changes from your branch: - * - * \verbatim - * $ svn merge .../trunk .../team/group/my_new_code - * \endverbatim - * - * Now, the code is merged into your working copy. However, for a new - * file, subversion treats it as a copy of existing content and not new - * content, so new files don't show up in "svn diff" at this point. To get - * it to show up in the diff, use the following commands so svn treats it - * as new content and publishes it in the diff: - * - * \verbatim - * $ svn revert my_new_file.c - * $ svn add my_new_file.c - * \endverbatim - * - * Now, it should work, and you can run "post-review" as usual. - * - * \subsection postreviewupdate Updating Patch on Existing Review Request - * - * Most of the time, a patch on reviewboard will require multiple iterations - * before other sign off on it being ready to be merged. To update the diff - * for an existing review request, you can use post-review and the -r option. - * Apply the current version of the diff to a working copy as described above, - * and then run the following command: - * - * \verbatim - * $ post-review -r <review request number> - * \endverbatim - */ diff --git a/include/asterisk/doxyref.h b/include/asterisk/doxyref.h index 55500230d..14ebb4b83 100644 --- a/include/asterisk/doxyref.h +++ b/include/asterisk/doxyref.h @@ -33,12 +33,6 @@ * * \section devpolicy Development and Release Policies * \arg \ref CodeGuide : The must-read document for all developers - * \arg \ref CommitMessages : Information on formatting and special tags for commit messages - * \arg \ref ReleaseStatus : The current support level for various Asterisk releases - * \arg \ref ReleasePolicies : Asterisk Release and Commit Policies - * \arg \ref Reviewboard : Reviewboard Usage and Guidelines - * \arg \ref MantisWorkflow : Workflow Guidelines for Asterisk Open Source Issue Tracker - * \arg \ref AsteriskGitHowto : How to setup a local GIT mirror of the Asterisk SVN repository * \arg \ref AstCREDITS : A Thank You to contributors (unfortunately out of date) * * \section apisandinterfaces Asterisk APIs and Interfaces diff --git a/main/acl.c b/main/acl.c index 94a242af2..43035329c 100644 --- a/main/acl.c +++ b/main/acl.c @@ -283,6 +283,12 @@ struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original) while (start) { current = ast_duplicate_ha(start); /* Create copy of this object */ + if (!current) { + ast_free_ha(ret); + + return NULL; + } + if (prev) { prev->next = current; /* Link previous to this object */ } @@ -320,7 +326,7 @@ struct ast_acl_list *ast_duplicate_acl_list(struct ast_acl_list *original) } if (!(clone = ast_calloc(1, sizeof(*clone)))) { - ast_log(LOG_WARNING, "Failed to allocate ast_acl_list struct while cloning an ACL\n"); + ast_log(LOG_ERROR, "Failed to allocate ast_acl_list struct while cloning an ACL\n"); return NULL; } AST_LIST_HEAD_INIT(clone); @@ -329,8 +335,10 @@ struct ast_acl_list *ast_duplicate_acl_list(struct ast_acl_list *original) AST_LIST_TRAVERSE(original, current_cursor, list) { if ((acl_new(¤t_clone, current_cursor->name))) { - ast_log(LOG_WARNING, "Failed to allocate ast_acl struct while cloning an ACL."); - continue; + ast_log(LOG_ERROR, "Failed to allocate ast_acl struct while cloning an ACL.\n"); + ast_free_acl_list(clone); + clone = NULL; + break; } /* Copy data from original ACL to clone ACL */ @@ -340,6 +348,15 @@ struct ast_acl_list *ast_duplicate_acl_list(struct ast_acl_list *original) current_clone->is_realtime = current_cursor->is_realtime; AST_LIST_INSERT_TAIL(clone, current_clone, list); + + if (current_cursor->acl && !current_clone->acl) { + /* Deal with failure after adding to clone so we don't have to free + * current_clone separately. */ + ast_log(LOG_ERROR, "Failed to duplicate HA list while cloning ACL.\n"); + ast_free_acl_list(clone); + clone = NULL; + break; + } } AST_LIST_UNLOCK(original); @@ -450,6 +467,8 @@ void ast_append_acl(const char *sense, const char *stuff, struct ast_acl_list ** if (error) { *error = 1; } + AST_LIST_UNLOCK(working_list); + return; } // Need to INSERT the ACL at the head here. AST_LIST_INSERT_HEAD(working_list, acl, list); @@ -479,7 +498,8 @@ void ast_append_acl(const char *sense, const char *stuff, struct ast_acl_list ** AST_LIST_TRAVERSE(working_list, current, list) { if (!strcasecmp(current->name, tmp)) { /* ACL= */ /* Inclusion of the same ACL multiple times isn't a catastrophic error, but it will raise the error flag and skip the entry. */ - ast_log(LOG_ERROR, "Named ACL '%s' is already included in the ast_acl container.", tmp); + ast_log(LOG_ERROR, "Named ACL '%s' occurs multiple times in ACL definition. " + "Please update your ACL configuration.\n", tmp); if (error) { *error = 1; } @@ -538,6 +558,22 @@ int ast_acl_list_is_empty(struct ast_acl_list *acl_list) return 1; } +/*! + * \internal + * \brief Used by ast_append_ha to avoid ast_strdupa in a loop. + * + * \note This function is only called at debug level 3 and higher. + */ +static void debug_ha_sense_appended(struct ast_ha *ha) +{ + const char *parsed_mask = ast_strdupa(ast_sockaddr_stringify(&ha->netmask)); + + ast_log(LOG_DEBUG, "%s/%s sense %u appended to ACL\n", + ast_sockaddr_stringify(&ha->addr), + parsed_mask, + ha->sense); +} + struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha *path, int *error) { struct ast_ha *ha; @@ -547,7 +583,6 @@ struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha char *address = NULL, *mask = NULL; int addr_is_v4; int allowing = strncasecmp(sense, "p", 1) ? AST_SENSE_DENY : AST_SENSE_ALLOW; - const char *parsed_addr, *parsed_mask; ret = path; while (path) { @@ -655,10 +690,9 @@ struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha } prev = ha; - parsed_addr = ast_strdupa(ast_sockaddr_stringify(&ha->addr)); - parsed_mask = ast_strdupa(ast_sockaddr_stringify(&ha->netmask)); - - ast_debug(3, "%s/%s sense %u appended to ACL\n", parsed_addr, parsed_mask, ha->sense); + if (DEBUG_ATLEAST(3)) { + debug_ha_sense_appended(ha); + } } return ret; @@ -667,10 +701,11 @@ struct ast_ha *ast_append_ha(const char *sense, const char *stuff, struct ast_ha void ast_ha_join(const struct ast_ha *ha, struct ast_str **buf) { for (; ha; ha = ha->next) { - const char *addr = ast_strdupa(ast_sockaddr_stringify_addr(&ha->addr)); - ast_str_append(buf, 0, "%s%s/%s", - ha->sense == AST_SENSE_ALLOW ? "!" : "", - addr, ast_sockaddr_stringify_addr(&ha->netmask)); + ast_str_append(buf, 0, "%s%s/", + ha->sense == AST_SENSE_ALLOW ? "!" : "", + ast_sockaddr_stringify_addr(&ha->addr)); + /* Separated to avoid duplicating stringified addresses. */ + ast_str_append(buf, 0, "%s", ast_sockaddr_stringify_addr(&ha->netmask)); if (ha->next) { ast_str_append(buf, 0, ","); } diff --git a/main/bridge_basic.c b/main/bridge_basic.c index b24df0506..ef6d47cfe 100644 --- a/main/bridge_basic.c +++ b/main/bridge_basic.c @@ -1549,6 +1549,23 @@ static void stimulate_attended_transfer(struct attended_transfer_properties *pro ao2_unlock(props); } +static void remove_attended_transfer_stimulus(struct attended_transfer_properties *props, + enum attended_transfer_stimulus stimulus) +{ + struct stimulus_list *list; + + ao2_lock(props); + AST_LIST_TRAVERSE_SAFE_BEGIN(&props->stimulus_queue, list, next) { + if (list->stimulus == stimulus) { + AST_LIST_REMOVE_CURRENT(next); + ast_free(list); + break; + } + } + AST_LIST_TRAVERSE_SAFE_END; + ao2_unlock(props); +} + /*! * \brief Get a desired transfer party for a bridge the transferer is not in. * @@ -2341,6 +2358,10 @@ static enum attended_transfer_state blond_nonfinal_exit(struct attended_transfer return TRANSFER_RESUME; case STIMULUS_TIMEOUT: ast_softhangup(props->recall_target, AST_SOFTHANGUP_EXPLICIT); + /* It is possible before we hung them up that they queued up a recall target answer + * so we remove it if present as it should not exist. + */ + remove_attended_transfer_stimulus(props, STIMULUS_RECALL_TARGET_ANSWER); case STIMULUS_RECALL_TARGET_HANGUP: props->recall_target = ast_channel_unref(props->recall_target); return TRANSFER_RECALLING; @@ -2806,7 +2827,8 @@ static struct ast_frame *transfer_target_framehook_cb(struct ast_channel *chan, if (event == AST_FRAMEHOOK_EVENT_READ && frame && frame->frametype == AST_FRAME_CONTROL && - frame->subclass.integer == AST_CONTROL_ANSWER) { + frame->subclass.integer == AST_CONTROL_ANSWER && + !ast_check_hangup(chan)) { ast_debug(1, "Detected an answer for recall attempt on attended transfer %p\n", props); if (props->superstate == SUPERSTATE_TRANSFER) { diff --git a/res/res_fax.c b/res/res_fax.c index 666c2d997..6e4451b67 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -4563,12 +4563,7 @@ static int acf_faxopt_write(struct ast_channel *chan, const char *cmd, char *dat unsigned int gwtimeout; if (sscanf(timeout, "%30u", &gwtimeout) == 1) { - if (gwtimeout >= 0) { - details->gateway_timeout = gwtimeout * 1000; - } else { - ast_log(LOG_WARNING, "%s(%s) timeout cannot be negative. Ignoring timeout\n", - cmd, data); - } + details->gateway_timeout = gwtimeout * 1000; } else { ast_log(LOG_WARNING, "Unsupported timeout '%s' passed to FAXOPT(%s).\n", timeout, data); } @@ -4607,13 +4602,7 @@ static int acf_faxopt_write(struct ast_channel *chan, const char *cmd, char *dat if (details->faxdetect_id < 0) { if (timeout) { if (sscanf(timeout, "%30u", &fdtimeout) == 1) { - if (fdtimeout >= 0) { - fdtimeout *= 1000; - } else { - ast_log(LOG_WARNING, "%s(%s) timeout cannot be negative. Ignoring timeout\n", - cmd, data); - fdtimeout = 0; - } + fdtimeout *= 1000; } else { ast_log(LOG_WARNING, "Unsupported timeout '%s' passed to FAXOPT(%s).\n", timeout, data); diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c index 8ba409e2e..2bd40e84f 100644 --- a/res/res_pjsip/location.c +++ b/res/res_pjsip/location.c @@ -71,16 +71,17 @@ static void aor_deleted_observer(const void *object) { const struct ast_sip_aor *aor = object; const char *aor_id = ast_sorcery_object_get_id(object); - /* Give enough space for ^ at the beginning and ;@ at the end, since that is our object naming scheme */ - char regex[strlen(aor_id) + 4]; + /* Give enough space for ;@ at the end, since that is our object naming scheme */ + size_t prefix_len = strlen(aor_id) + sizeof(";@") - 1; + char prefix[prefix_len + 1]; struct ao2_container *contacts; if (aor->permanent_contacts) { ao2_callback(aor->permanent_contacts, OBJ_NODATA | OBJ_MULTIPLE | OBJ_UNLINK, destroy_contact, NULL); } - snprintf(regex, sizeof(regex), "^%s;@", aor_id); - if (!(contacts = ast_sorcery_retrieve_by_regex(ast_sip_get_sorcery(), "contact", regex))) { + sprintf(prefix, "%s;@", aor_id); /* Safe */ + if (!(contacts = ast_sorcery_retrieve_by_prefix(ast_sip_get_sorcery(), "contact", prefix, prefix_len))) { return; } /* Destroy any contacts that may still exist that were made for this AoR */ @@ -217,13 +218,13 @@ struct ao2_container *ast_sip_location_retrieve_aor_contacts_nolock(const struct struct ao2_container *ast_sip_location_retrieve_aor_contacts_nolock_filtered(const struct ast_sip_aor *aor, unsigned int flags) { - /* Give enough space for ^ at the beginning and ;@ at the end, since that is our object naming scheme */ - char regex[strlen(ast_sorcery_object_get_id(aor)) + 4]; + /* Give enough space for ;@ at the end, since that is our object naming scheme */ + size_t prefix_len = strlen(ast_sorcery_object_get_id(aor)) + sizeof(";@") - 1; + char prefix[prefix_len + 1]; struct ao2_container *contacts; - snprintf(regex, sizeof(regex), "^%s;@", ast_sorcery_object_get_id(aor)); - - if (!(contacts = ast_sorcery_retrieve_by_regex(ast_sip_get_sorcery(), "contact", regex))) { + sprintf(prefix, "%s;@", ast_sorcery_object_get_id(aor)); /* Safe */ + if (!(contacts = ast_sorcery_retrieve_by_prefix(ast_sip_get_sorcery(), "contact", prefix, prefix_len))) { return NULL; } diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c index 81234d695..d2e7b2b69 100644 --- a/res/res_pjsip/pjsip_configuration.c +++ b/res/res_pjsip/pjsip_configuration.c @@ -368,7 +368,7 @@ static int contact_acl_to_str(const void *obj, const intptr_t *args, char **buf) static int dtmf_handler(const struct aco_option *opt, struct ast_variable *var, void *obj) { struct ast_sip_endpoint *endpoint = obj; - enum ast_sip_dtmf_mode dtmf = ast_sip_str_to_dtmf(var->value); + int dtmf = ast_sip_str_to_dtmf(var->value); if (dtmf == -1) { return -1; diff --git a/res/res_pjsip_endpoint_identifier_anonymous.c b/res/res_pjsip_endpoint_identifier_anonymous.c index b93133824..2a47cbe3f 100644 --- a/res/res_pjsip_endpoint_identifier_anonymous.c +++ b/res/res_pjsip_endpoint_identifier_anonymous.c @@ -56,9 +56,11 @@ static int find_transport_state_in_use(void *obj, void *arg, int flags) return 0; } +#define DOMAIN_NAME_LEN 255 + static struct ast_sip_endpoint *anonymous_identify(pjsip_rx_data *rdata) { - char domain_name[64], id[AST_UUID_STR_LEN]; + char domain_name[DOMAIN_NAME_LEN + 1]; struct ast_sip_endpoint *endpoint; RAII_VAR(struct ast_sip_domain_alias *, alias, NULL, ao2_cleanup); RAII_VAR(struct ao2_container *, transport_states, NULL, ao2_cleanup); @@ -70,6 +72,8 @@ static struct ast_sip_endpoint *anonymous_identify(pjsip_rx_data *rdata) } if (!ast_sip_get_disable_multi_domain()) { + char id[sizeof("anonymous@") + DOMAIN_NAME_LEN]; + /* Attempt to find the endpoint given the name and domain provided */ snprintf(id, sizeof(id), "anonymous@%s", domain_name); if ((endpoint = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "endpoint", id))) { diff --git a/res/res_pjsip_endpoint_identifier_user.c b/res/res_pjsip_endpoint_identifier_user.c index 30da062ed..b79dcb59b 100644 --- a/res/res_pjsip_endpoint_identifier_user.c +++ b/res/res_pjsip_endpoint_identifier_user.c @@ -74,10 +74,12 @@ static int find_transport_state_in_use(void *obj, void *arg, int flags) return 0; } +#define DOMAIN_NAME_LEN 255 +#define USERNAME_LEN 255 + static struct ast_sip_endpoint *find_endpoint(pjsip_rx_data *rdata, char *endpoint_name, char *domain_name) { - char id[AST_UUID_STR_LEN]; struct ast_sip_endpoint *endpoint; RAII_VAR(struct ast_sip_domain_alias *, alias, NULL, ao2_cleanup); RAII_VAR(struct ao2_container *, transport_states, NULL, ao2_cleanup); @@ -85,6 +87,8 @@ static struct ast_sip_endpoint *find_endpoint(pjsip_rx_data *rdata, char *endpoi RAII_VAR(struct ast_sip_transport *, transport, NULL, ao2_cleanup); if (!ast_sip_get_disable_multi_domain()) { + char id[DOMAIN_NAME_LEN + USERNAME_LEN + sizeof("@")]; + /* Attempt to find the endpoint given the name and domain provided */ snprintf(id, sizeof(id), "%s@%s", endpoint_name, domain_name); if ((endpoint = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "endpoint", id))) { @@ -116,8 +120,8 @@ static struct ast_sip_endpoint *find_endpoint(pjsip_rx_data *rdata, char *endpoi static struct ast_sip_endpoint *username_identify(pjsip_rx_data *rdata) { - char username[64]; - char domain[64]; + char username[USERNAME_LEN + 1]; + char domain[DOMAIN_NAME_LEN + 1]; struct ast_sip_endpoint *endpoint; if (get_from_header(rdata, username, sizeof(username), domain, sizeof(domain))) { @@ -149,7 +153,7 @@ static struct ast_sip_endpoint *username_identify(pjsip_rx_data *rdata) static struct ast_sip_endpoint *auth_username_identify(pjsip_rx_data *rdata) { - char username[64], realm[64]; + char username[USERNAME_LEN + 1], realm[DOMAIN_NAME_LEN + 1]; struct ast_sip_endpoint *endpoint; pjsip_authorization_hdr *auth_header = NULL; diff --git a/res/snmp/agent.c b/res/snmp/agent.c index 9d1528dde..7cd895559 100644 --- a/res/snmp/agent.c +++ b/res/snmp/agent.c @@ -63,6 +63,10 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <net-snmp/net-snmp-includes.h> #include <net-snmp/agent/net-snmp-agent-includes.h> +#if !defined(RONLY) && defined(NETSNMP_OLDAPI_RONLY) +#define RONLY NETSNMP_OLDAPI_RONLY +#endif + #include "asterisk/paths.h" /* need ast_config_AST_SOCKET */ #include "asterisk/channel.h" #include "asterisk/logger.h" diff --git a/tests/test_logger.c b/tests/test_logger.c index bf809ba54..08585a6b8 100644 --- a/tests/test_logger.c +++ b/tests/test_logger.c @@ -192,7 +192,7 @@ static char *handle_cli_performance_test(struct ast_cli_entry *e, int cmd, struc static char *handle_cli_queue_test(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { - unsigned int level; + int level; int current_queue_limit; unsigned int x; struct timeval start, end; @@ -222,7 +222,7 @@ static char *handle_cli_queue_test(struct ast_cli_entry *e, int cmd, struct ast_ ast_cli(a->fd, "Test: Failed, could not register level 'queuetest'.\n"); return CLI_SUCCESS; } - ast_cli(a->fd, "Test: got level %u for 'queuetest'.\n", level); + ast_cli(a->fd, "Test: got level %d for 'queuetest'.\n", level); if (ast_logger_create_channel(tmppath, "queuetest") != AST_LOGGER_SUCCESS) { ast_cli(a->fd, "Test: Unable to create logger channel '%s'\n", tmppath); diff --git a/tests/test_pbx.c b/tests/test_pbx.c index acf7484c1..df6b88dc8 100644 --- a/tests/test_pbx.c +++ b/tests/test_pbx.c @@ -39,6 +39,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/pbx.h" #include "asterisk/test.h" +#include <signal.h> + /*! * If we determine that we really need * to be able to register more than 10 |