Skip to content
Snippets Groups Projects
  1. Jul 24, 2022
    • Sergey V. Lobanov's avatar
      build: fix bininstall launchd issue on cross-platform build · f645157a
      Sergey V. Lobanov authored
      configure script detects /sbin/launchd, but the result of this
      check is not used in Makefile (bininstall). Makefile also detects
      /sbin/launchd file to decide if it is required to install
      safe_asterisk.
      
      configure script correctly detects cross compile build and sets
      PBX_LAUNCHD=0
      
      In case of building asterisk on MacOS host for Linux target using
      external toolchain (e.g. OpenWrt toolchain), bininstall does not
      install safe_asterisk (due to /sbin/launchd detection in Makefile),
      but it is required on target (Linux).
      
      This patch adds HAVE_SBIN_LAUNCHD=@PBX_LAUNCHD@ to makeopts.in to
      use the result of /sbin/launchd detection from configure script in
      Makefile.
      Also this patch uses HAVE_SBIN_LAUNCHD in Makefile (bininstall) to
      decide if it is required to install safe_asterisk.
      
      ASTERISK-29905 #close
      
      Change-Id: Iff61217276cd188f43f51ef4cdbffe39d9f07f65
      f645157a
  2. Jul 13, 2022
    • Mike Bradeen's avatar
      Makefile: Avoid git-make user conflict · 7cc026b3
      Mike Bradeen authored
      make_version now silently checks if the required git commands will
      fail.  If they do, then return UNKNOWN__git_check_fail to
      distinguish this failure from other UNKNOWN__ version failures
      
      Makefile checks for this value on install and exits out with
      instructions
      
      ASTERISK-30029
      
      Change-Id: If8f10cac8f509c08981120f17555762342020221
      7cc026b3
  3. Mar 29, 2022
    • George Joseph's avatar
      Makefile: Disable XML doc validation · 3e97156f
      George Joseph authored
      make_xml_documentation was being called with the --validate
      flag set when it shouldn't have been.  This was causing
      build failures if neither xmllint nor xmlstarlet were installed.
      The correct behavior is to simply print a message that either
      one of those tools should be installed for validation and
      continue with the build.
      
      ASTERISK-29988
      
      Change-Id: Idc6c44114e7dd3fadae183a4e22f4fdba0b8a645
      3e97156f
    • George Joseph's avatar
      make_xml_documentation: Remove usage of get_sourceable_makeopts · 144b3c54
      George Joseph authored
      get_sourceable_makeopts wasn't handling variables with embedded
      double quotes in them very well.  One example was the DOWNLOAD
      variable when curl was being used instead of wget.  Rather than
      trying to fix get_sourceable_makeopts, it's just been removed.
      
      ASTERISK-29986
      Reported by: Stefan Ruijsenaars
      
      Change-Id: Idf2a90902228c2558daa5be7a4f8327556099cd2
      144b3c54
  4. Feb 28, 2022
    • George Joseph's avatar
      Makefile: Allow XML documentation to exist outside source files · 2e00b5ed
      George Joseph authored
      Moved the xmldoc build logic from the top-level Makefile into
      its own script "make_xml_documentation" in the build_tools
      directory.
      
      Created a new utility script "get_sourceable_makeopts", also in
      the build_tools directory, that dumps the top-level "makeopts"
      file in a format that can be "sourced" from shell sscripts.
      This allows scripts to easily get the values of common make
      build variables such as the location of the GREP, SED, AWK, etc.
      utilities as well as the AST* and library *_LIB and *_INCLUDE
      variables.
      
      Besides moving logic out of the Makefile, some optimizations
      were done like removing "third-party" from the list of
      subdirectories to be searched for documentation and changing some
      assignments from "=" to ":=" so they're only evaluated once.
      The speed increase is noticeable.
      
      The makeopts.in file was updated to include the paths to
      REALPATH and DIRNAME.  The ./conifgure script was setting them
      but makeopts.in wasn't including them.
      
      So...
      
      With this change, you can now place documentation in any"c"
      source file AND you can now place it in a separate XML file
      altogether.  The following are examples of valid locations:
      
      res/res_pjsip.c
          Using the existing /*** DOCUMENTATION ***/ fragment.
      
      res/res_pjsip/pjsip_configuration.c
          Using the existing /*** DOCUMENTATION ***/ fragment.
      
      res/res_pjsip/pjsip_doc.xml
          A fully-formed XML file.  The "configInfo", "manager",
          "managerEvent", etc. elements that would be in the "c"
          file DOCUMENTATION fragment should be wrapped in proper
          XML.  Example for "somemodule.xml":
      
          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE docs SYSTEM "appdocsxml.dtd">
          <docs>
              <configInfo>
              ...
              </configInfo>
          </docs>
      
      It's the "appdocsxml.dtd" that tells make_xml_documentation
      that this is a documentation XML file and not some other XML file.
      It also allows many XML-capable editors to do formatting and
      validation.
      
      Other than the ".xml" suffix, the name of the file is not
      significant.
      
      As a start... This change also moves the documentation that was
      in res_pjsip.c to 2 new XML files in res/res_pjsip:
      pjsip_config.xml and pjsip_manager.xml.  This cut the number of
      lines in res_pjsip.c in half. :)
      
      Change-Id: I486c16c0b5a44d7a8870008e10c941fb19b71ade
      2e00b5ed
  5. Dec 08, 2021
    • Alexander Traud's avatar
      progdocs: Update Makefile. · f3b29c6a
      Alexander Traud authored
      In developer mode, use internal documentation as well.
      This should produce no warnings. Fix yours!
      
      In noisy mode, output all possible warnings of Doxygen.
      This creates zillion of warnings. Double-check your current module!
      
      Any warnings are in the file './doxygen.log'. Beside that, this change
      avoids deprecated parameters because the configuration file for Doxygen
      contains only those parameters which differ from the default. This
      avoids the need to update the file on each run. Furthermore, it adds
      AST_VECTOR to be expanded. Finally, the default name for that file is
      Doxyfile. Therefore, let us use that!
      
      ASTERISK-26991
      ASTERISK-20259
      
      Change-Id: I4129092a199d5e24c319a09cd088614b121015af
      f3b29c6a
  6. Nov 15, 2021
    • Josh Soref's avatar
      Makefile: Spelling fixes · 4490f0b9
      Josh Soref authored
      Correct typos of the following word families:
      
      libraries
      install
      overwrite
      
      ASTERISK-29714
      
      Change-Id: I6488814f79186d6c23dfd7b7f9bba0a046126174
      4490f0b9
  7. Oct 11, 2021
    • Sean Bright's avatar
      Makefile: Use basename in a POSIX-compliant way. · 9fcd50a8
      Sean Bright authored
      If you aren't using GNU coreutils, chances are that your basename
      doesn't know about the -s argument. Luckily for us, basename does what
      we need it do even without the -s argument.
      
      Change-Id: I8b81a429bb037b997ee6640ff8a2b5e860962bb7
      9fcd50a8
  8. Mar 16, 2021
    • Joshua C. Colp's avatar
      xml: Embed module information into core XML documentation. · 149e5e5b
      Joshua C. Colp authored
      This change embeds the MODULEINFO block of modules
      into the core XML documentation. This provides a shared
      mechanism for use by both menuselect and Asterisk for
      information and a definitive source of truth.
      
      ASTERISK-29335
      
      Change-Id: Ifbfd5c700049cf320a3e45351ac65dd89bc99d90
      149e5e5b
  9. Dec 09, 2020
    • lvl's avatar
      Introduce astcachedir, to be used for temporary bucket files · b0842713
      lvl authored
      As described in the issue, /tmp is not a suitable location for a
      large amount of cached media files, since most distributions make
      /tmp a RAM-based tmpfs mount with limited capacity.
      
      I opted for a location that can be configured separately, as opposed
      to using a subdirectory of spooldir, given the different storage
      profile (transient files vs files that might stay there indefinitely).
      
      This commit just makes the cache directory configurable, and changes
      the default location from /tmp to /var/cache/asterisk.
      
      ASTERISK-29143
      
      Change-Id: Ic54e95199405abacd9e509cef5f08fa14c510b5d
      b0842713
  10. Aug 14, 2020
    • cmaj's avatar
      Makefile: Fix certified version numbers · 3040edcb
      cmaj authored
      Adds sed before awk to produce reasonable ASTERISKVERSIONNUM
      on certified versions of Asterisk eg. 16.8-cert3 is 160803
      instead of the previous 00800.
      
      ASTERISK-29021 #close
      
      Change-Id: Icf241df0ff6db09011b8c936a317a84b0b634e16
      3040edcb
  11. May 01, 2020
    • Ben Ford's avatar
      res_stir_shaken: Implemented signature verification. · 9acf840f
      Ben Ford authored
      There are a lot of moving parts in this patch, but the focus of it is on
      the verification of the signature using a public key located at the
      public key URL provided in the JSON payload. First, we check the
      database to see if we have already downloaded the key. If so, check to
      see if it has expired. If it has, redownload from the URL. If we don't
      have an entry in the database, just go ahead and download the public
      key. The expiration is tested each time we download the file. After
      that, read the public key from the file and use it to verify the
      signature. All sanity checking is done when the payload is first
      received, so the verification is complete once this point is reached.
      
      The XML has also been added since a new config option was added to
      general (curl_timeout). The maximum amount of time to wait for a
      download can be configured through this option, with a low value by
      default.
      
      Change-Id: I3ba4c63880493bf8c7d17a9cfca1af0e934d1a1c
      9acf840f
  12. Mar 25, 2020
    • Jaco Kroon's avatar
      build: enable building with uClibc · a699e016
      Jaco Kroon authored
      This patch has been included in Gentoo distribution for at least since
      asterisk 1.8, but there are references in the logs going back as far as
      1.0.0 - not sure if this is still required in any way, it does apply,
      and it doesn't (as far as we can determine) cause build failures.
      
      Change-Id: I46d8845e30200205e80580680bf060aa3012ba54
      a699e016
  13. Jul 16, 2019
    • George Joseph's avatar
      Build: Separate header install/uninstall · c781806e
      George Joseph authored
      Asterisk headers are no longer installed and uninstalled
      automatically when performing a "make install" or a
      "make uninstall".  To install/uninstall the headers, use
      "make install-headers" and "make uninstall-headers".
      The headers also continue to be uninstalled when performing a
      "make uninstall-all".
      
      Also corrects an issue where /usr/include/asterisk.h was never
      being removed at all.
      
      Change-Id: Ia7399f3a0203a4825fc4a9f43b9034dae9a2b643
      c781806e
  14. Aug 16, 2018
    • Rodrigo Ramírez Norambuena's avatar
      make config: os-release output error. · 01c90fef
      Rodrigo Ramírez Norambuena authored
      Fix not show the error
      "/bin/sh: /etc/os-release: No such file or directory" when the command
      'make config' is run in a System without systemv.
      
      The instruction 'make config' pre execute the syntax
      "$(shell . /etc/os-release && echo $$ID)" to identified if system is a
      Slackware and Opensuse.
      
      This change prevent show the message and is send to the /dev/null
      
      Change-Id: I7f43e281a8d9405b2519fc653de82d9b8b645fdf
      01c90fef
  15. Jul 26, 2018
    • Corey Farrell's avatar
      Build System: Create 'make install-configs' target. · 852e157b
      Corey Farrell authored
      This target requires specifying CONFIG_SRC=path_to_configs.  This can be
      used to install custom configs for the Asterisk build while still
      performing directory replacements on asterisk.conf.
      
      Modify internal INSTALL_CONFIGS so first argument requires full path to
      the config sources relative to Asterisk source root.
      
      Change-Id: Idcd841df3c8d5bfe23d566bb9e2e448e9df4f8ab
      852e157b
  16. Jul 18, 2018
  17. Apr 09, 2018
    • Corey Farrell's avatar
      Build System: Enable python3 compatibility. · 879e592b
      Corey Farrell authored
      * Consistently use spaces in rest-api-templates/asterisk_processor.py.
      * Exclude third-party from docs/full-en_US.xml.
      * Add docs/full-en_US.xml to .gitignore.
      * Use list() to convert python3 view.
      * Use python3 print function.
      * Replace cmp() with equivalent equation.
      * Replace reference to out of scope subtype variable with name
        parameter.
      * Use unescaping triple bracket notation in mustache templates where
        needed.  This causes behavior of Python2 to be maintained when using
        Python3.
      * Fix references to has_websocket / is_websocket in
        res_ari_resource.c.mustache.
      * Update calculation of has_websocket to use any().
      * Use unicode mode for writing output file in transform.py.
      * Replace 'from swagger_model import *' with explicit import of required
        symbols.
      
      I have not tested spandspflow2pcap.py or voicemailpwcheck.py, only the
      print syntax has been fixed.
      
      Change-Id: If5c5b556a2800d41a3e2cfef080ac2e151178c33
      879e592b
  18. Mar 23, 2018
  19. Mar 09, 2018
    • Alexander Traud's avatar
      BuildSystem: Add NetBSD. · 5b525c97
      Alexander Traud authored
      Headers, libraries, and rpath.
      
      ASTERISK-27728
      ASTERISK-11015
      Reported by: Curt Sampson
      
      Change-Id: I50aa5fcd095937df32a2e33307caac7e79a8b5b7
      5b525c97
  20. Mar 07, 2018
    • Richard Mudgett's avatar
      BuildSystem regression: Fix errors reported by clean targets. · 1fe913f7
      Richard Mudgett authored
      Doing a 'make clean', 'make distclean', or 'make dist-clean' gets errors
      about an invalid shell option: "/bin/sh: 0: Illegal option -".
      
      The clean targets do not include the makeopts file which defines GREP and
      LDCONFIG because the file may not exist and the distclean/dist-clean
      targets will delete it anyway.
      
      ASTERISK-27715
      
      Change-Id: I33d40acdb03862bc89aeb6fb1ff497894a8ea7f5
      1fe913f7
  21. Mar 05, 2018
  22. Mar 03, 2018
  23. Mar 02, 2018
  24. Feb 13, 2018
  25. Jan 19, 2018
  26. Jan 16, 2018
    • Alexander Traud's avatar
      BuildSystem: Avoid $EUID and use id -u instead. · a046305f
      Alexander Traud authored
      Makefile included a call to ${EUID} which requires the shell bash. To keep
      compatibility with other shells like dash or ksh, use id -u instead.
      
      ASTERISK-27589
      
      Change-Id: Ia6e74f5bc9aab4e6dc62b7439f647b7964e6f657
      a046305f
  27. Dec 22, 2017
  28. Nov 09, 2017
    • Corey Farrell's avatar
      Build System: Disable parallel make in the root Makefile. · 23b0ef3e
      Corey Farrell authored
      This ensures that the root Makefile runs only a single target at a time.
      SUBMAKE will still honor requested parallelism, so 'make -j8' will build
      one directory at a time but allow 8 jobs at once when building a sub
      directory.
      
      This will fix some display glitches related to rebuild of XML
      documentation.  It will also prevent some edge case errors where
      bundled pjproject needs to be rebuild before other parts of Asterisk.
      
      Change-Id: I4f2ec6fbbec1ada0ccb1109a28ea303524239b1e
      23b0ef3e
  29. Oct 25, 2017
    • Corey Farrell's avatar
      Build System: Fix --disable-xmldoc option. · 5553adb8
      Corey Farrell authored
      The configure option to disable XML documentation does not currently
      work.  This patch makes it effective, but also causes an ABI change by
      removing the ast_xmldoc_* symbols.  Disabling xmldoc also prevents docs
      from being automatically generated, but they can still be manually
      generated with 'make doc/core-en_US.xml'.
      
      ASTERISK-26639
      
      Change-Id: Ifac562340c09f80c83e0203de098fcac93bf8c44
      5553adb8
  30. Jun 08, 2017
    • David M. Lee's avatar
      CFLAGS for BIND8 support · fcb1a0d7
      David M. Lee authored
      Some systems (like macOS) require BIND_8_COMPAT to be defined so that
      the nameser libraries are, well, BIND8 compatible.
      
      Change-Id: If79fc27a64f90de1835b5aa3aadfa9be22bd16b0
      fcb1a0d7
  31. Mar 30, 2017
    • Walter Doekes's avatar
      build: Fix deb build issues with fakeroot · a7d94f50
      Walter Doekes authored
      If DESTDIR is set, don't call ldconfig. Assume that DESTDIR is used to
      create a binary archive. The ldconfig call should be delegated to the
      archive postinst script. This fixes the case where fakeroot wraps 'make
      install' causing $EUID to be 0 even though it doesn't have permission to
      call ldconfig.
      
      The previous logic in configure.ac to detect and correct libdir
      has been removed as it was not completely accurate.  CentOS 64-bit
      users should again specifiy --libdir=/usr/lib64 when configuring
      to prevent install to /usr/lib.
      
      Updated Makefile:check-old-libdir to check for orphans in
      lib64 when installing to lib as well as orphans in lib when installing
      to lib64.
      
      Updated Makefile and main/Makefile uninstall targets to remove the
      orphans using the new logic.
      
      ASTERISK-26705
      
      Change-Id: I51739d4a03e60bff38be719b8d2ead0007afdd51
      a7d94f50
  32. Mar 27, 2017
  33. Feb 27, 2017
    • George Joseph's avatar
      build: Warn if asterisk is installed in both 32 and 64 bit sys dirs · 4692a32e
      George Joseph authored
      ... and clean them both up on uninstall.
      
      We've fixed the issue where 'make install' was installing to
      /usr/lib on 64-bit systems that use /usr/lib64.  Now we need
      to clean up the remnants in /usr/lib.
      
      * 'make install' now prints a warning if DESTDIR/ASTLIBDIR
        contains 'lib64' and libasterisk* shared libraries or modules
        are also found in DESTDIR/ASTLIBDIR with 'lib64' transformed
        to 'lib'.
      
      * 'make uninstall' ALWAYS cleans up both DESTDIR/ASTLIBDIR and
        DESTDIR/ASTLIBDIR with 'lib64' transformed to 'lib'.
      
      ASTERISK-26705
      
      Change-Id: I6edddeb3c07a51e7c7ba7cac3c05e4bf3ec3f01f
      4692a32e
  34. Feb 23, 2017
    • George Joseph's avatar
      build: Execute ldconfig to build cache. (take two) · b0067bcf
      George Joseph authored
      On some platforms a multiarch approach is used for libraries.
      The build system does not take this into account and still
      places libraries into the lib directory if no --libdir is
      specified to configure. On initial startup this results in
      libasteriskssl.so not being found, as it is not in the multiarch
      lib directory.  To make matters worse, options were being passed
      to ldconfig on both Linux and FreeBSD that actually prevented
      the rebuild of the cache.
      
       * Fedora has a /usr/share/config.site that automatically tells
         autoconf to use /usr/lib64 but CentOS does not. This logic was
         copied to configure.ac and modified so systems like Ubuntu,
         which still use /usr/lib for 64-bit systems, aren't affected.
      
      Now that we have them in the correct directory...
      
      In order for the system loader to find libasteriskssl and
      libasteriskpj, one of 3 things has to happen...
      
        - The linker cache must be rebuilt including the directory
          where the libasterisk* libraries were installed.  Only root
          can rebuild the cache.  This was busted.
        - We have to link the asterisk binary with an rpath pointing
          to the directrory where the libasterisk* libraries were
          installed.  This makes things very complicated and will happen
          over the collective dead bodies of everyone who's had to
          package a distribution with an rpath.
        - Finally, you can start asterisk with LD_LIBRARY_PATH set to the
          directrory where the libasterisk* libraries were installed.
      
      There are no other options. So...
      
       * The invokation of ldconfig has been moved from main/Makefile
         to ASTTOPDIR/Makefile, the options have been removed, and
         DESTDIR/ASTLIBDIR appended.  If you aren't root, you will be
         warned after the "Asterisk Installation Compete" banner that
         you must re-run 'make install' as root, manually run
         'ldconfig DESTDIR/ASTLIBDIR' as root, or run asterisk with
         LD_LIBRARY_PATH.
      
      ASTERISK-26705
      
      Change-Id: I2a64b7c33a7d3e9bde20f47e3d3ab771977af982
      b0067bcf
  35. Oct 10, 2016
    • George Joseph's avatar
      bundled_pjproject: Add tests for programs used by the Makefile, et al. · 5fb848ee
      George Joseph authored
      Added tests for bzip2, tar, patch, sed and nm to configure.ac.
      
      Set DOWNLOAD_TO_STDOUT to a working command line regardless of
      whether the download program is wget, curl or fetch.
      
      Added a 'configure.m4' file to the third-party directory which takes
      care of calling any third-party project setup.  Had to move some
      pjproject_bundled stuff up in configure.ac so it was called before
      the third-party configure macro.
      
      The pjproject tarball is now downloaded to the externals_cache_dir if
      it was specified on the ./configure command line
      
      Removed regeneration of the pjproject aconfigure file.  It was only
      needed for an old patch that no longer applies.
      
      Converted the tests for symbols to explicit tests since we know that
      they're now available in the bundled version.  Saves a little time
      during configure.
      
      ASTERISK-26416 #close
      Reported-by: Corey Farrell
      
      Change-Id: Id1d94251c0155f8dd41b7de7067f35cfbaafbb9b
      (cherry picked from commit e6b0053d)
      (cherry picked from commit a0d02f38)
      5fb848ee
  36. Sep 06, 2016
    • George Joseph's avatar
      build: Add download capability for external packages · 6caf6bcd
      George Joseph authored
      The DPMA and g729a, silk, siren7 and siren14 codecs hosted at
      http://downloads.digium.com/pub/telephony/ are now listed in the
      "External" sections of the "Resource Modules" and "Codec Translators"
      pages in menuselect.  Any that are selected will automatically be
      downloaded and installed when "make install" is run.  Their LICENSE and
      README (if avaialble) files will be installed to
      ASTVARLIBDIR/documentation/thirdparty/<product_name>.
      
      Example use with codecs:
      
      The codecs/codecs.xml file is a menuselect style xml file that lists
      the codecs to be included.  Their support levels are 'external', which
      triggers the download and install, and defaultenabled is no.  Also
      because codec_g729a is actually in a directory named codec_g729 on the
      download server, the newly added 'member_data' element is used to
      override the default of the directory name being the package name.  You
      can use the 'directory_name' attribute to keep default base URL
      (http://downloads.digium.com/pub/telephony/) but use the new directory,
      or you use the 'remote_url' attribute to specify a full URL to the
      download directory.  In this case, you must still follow the same
      subdirectory naming conventions as that used for the packages located
      at 'http://downloads.digium.com/pub/telephony'.
      
      A new configure option '--with-externals-cache' was added and like
      '--with-sounds-cache' it allows the installer to cache tarballs so
      they're not downloaded every time.
      
      To assist with the download and install process, each external package
      now has a manifest.xml file that, among other things, contains a package
      version and checksums for each file in the tarball.  The manifest is
      saved to both the cache directory and ASTMODDIR and together with the
      manifest.xml on the downloads site, tells the install scripts whether
      a download and/or update is needed.
      
      bash and xmlstarlet are required for downloader operation.  If they're
      not installed, the external items in menuselect will be unavailable.
      
      Change-Id: Id3dcf1289ffd3cb0bbd7dfab3cafbb87be60323a
      6caf6bcd
  37. Jul 19, 2016
Loading