Skip to content
Snippets Groups Projects
  1. Nov 22, 2017
    • Kevin Harwell's avatar
      pjsip: 183 without To tag does not negotiate media · db21f7f2
      Kevin Harwell authored
      If a 183 with sdp response is receive without a To tag the sdp is not
      negotiated. According to RFC 3261 section 12.1.2 while a To tag is required,
      the client needs to still be able to handle the missing tag case for
      backwards compatibility.
      
      This patch, accepted by and applied to pjproject, makes it so if an incoming
      180/183 with SDP comes in without a To tag it gets appropriately handled.
      
      ASTERISK-27442 #close
      
      Change-Id: Ic9d6b01e05e8f4874eebbd7adfe05d932025d203
      db21f7f2
  2. Nov 20, 2017
  3. Nov 19, 2017
    • Corey Farrell's avatar
      Build: Fix OSX build issues. · b4f7f825
      Corey Farrell authored
      OSX does not support 'readlink -f' or 'sed -r'.  Replace readlink with
      the GNU make macro 'realpath'.  Replace sed with grep in one place, cut
      in the other.
      
      ASTERISK-27332
      
      Change-Id: I5d34ecca905384decb22ead45c913ae5e8aff748
      b4f7f825
  4. Nov 13, 2017
    • George Joseph's avatar
      bundled_pjproject: sip_parser: Fix return code in pjsip_find_msg · f6ebd16b
      George Joseph authored
      The default return code for pjsip_find_msg was PJ_SUCCESS so if
      a Content-Length header wasn't found at all, pjsip_find_msg was
      returning PJ_SUCCESS instead of PJSIP_EMISSINGHDR.
      
      Also added the volatile keyword to a few variables that are used
      both inside and outside the PJ_TRY/PJ_CATCH block.
      
      Partial fix for ASTERISK_27408
      
      Change-Id: If82ba9de921e3d57df9c68cf96ee45ccc1491f7a
      f6ebd16b
    • Ben Ford's avatar
      bundled_pjproject: Update to 2.7.1 · 2e7f6cd3
      Ben Ford authored
      Update from 2.7 to 2.7.1 for bundled pjproject. Changed version
      and removed patch files included in the update.
      
      Change-Id: I55cea8e734b318c2df9daf86aa0802c559ec8357
      2e7f6cd3
  5. Nov 10, 2017
    • Joshua Colp's avatar
      pjsip: Add patch to allow all transports to be destroyed. · 96f2ee86
      Joshua Colp authored
      If a transport is created with the same transport type, source
      IP address, and source port as one that already exists the old
      transport is moved into a linked list called "tp_list".
      
      If this old transport is later shutdown it will not be destroyed
      as the process checks whether the transport is valid or not. This
      check does not look at the "tp_list" when making the determination
      causing the transport to not be destroyed.
      
      This change updates the logic to query not just the main storage
      method for transports but also the "tp_list".
      
      Upstream issue https://trac.pjsip.org/repos/ticket/2061
      
      ASTERISK-27411
      
      Change-Id: Ic5c2bb60226df0ef1c8851359ed8d4cd64469429
      96f2ee86
  6. Nov 08, 2017
    • George Joseph's avatar
      AST-2017-009: pjproject: Add validation of numeric header values · 74432f51
      George Joseph authored
      Parsing the numeric header fields like cseq, ttl, port, etc. all
      had the potential to overflow, either causing unintended values to
      be captured or, if the values were subsequently converted back to
      strings, a buffer overrun.  To address this, new "strto" functions
      have been created that do range checking and those functions are
      used wherever possible in the parser.
      
       * Created pjlib/include/limits.h and pjlib/include/compat/limits.h
         to either include the system limits.h or define common numeric
         limits if there is no system limits.h.
      
       * Created strto*_validate functions in sip_parser that take bounds
         and on failure call the on_str_parse_error function which prints
         an error message and calls PJ_THROW.
      
       * Updated sip_parser to validate the numeric fields.
      
       * Fixed an issue in sip_transport that prevented error messages
         from being properly displayed.
      
       * Added "volatile" to some variables referenced in PJ_CATCH blocks
         as the optimizer was sometimes optimizing them away.
      
       * Fixed length calculation in sip_transaction/create_tsx_key_2543
         to account for signed ints being 11 characters, not 9.
      
      ASTERISK-27319
      Reported by: Youngsung Kim at LINE Corporation
      
      Change-Id: I48de2e4ccf196990906304e8d7061f4ffdd772ff
      74432f51
  7. Oct 23, 2017
  8. Oct 20, 2017
  9. Sep 25, 2017
  10. Aug 15, 2017
    • Richard Mudgett's avatar
      configure: Check cache for valid pjproject tarball before downloading. · c049d1c3
      Richard Mudgett authored
      On a fresh Asterisk source directory, the bundled pjproject tarball is
      unconditionally downloaded even if the tarball is already in a specified
      cache directory.
      
      * Made check if the pjproject tarball is valid in the cache directory
      before downloading the tarball on a fresh source directory.
      
      Change-Id: Ic7ec842d3c97ecd8dafbad6f056b7fdbce41cae5
      c049d1c3
  11. Aug 08, 2017
    • George Joseph's avatar
      Make --with-pjproject-bundled the default for Asterisk 15 · 305bd0d9
      George Joseph authored
      '--with-pjproject-bundled' is now the default when running
      ./configure. It can be disabled with '--without-pjproject-bundled'.
      
      To make building without an internet connection easier, a new
      ./configure option '--with-download-cache' was added that sets
      the cache for externals (like pjproject, the codecs and the DPMA),
      AND the sounds files.  It can also be specified as an environment
      variable named "AST_DOWNLOAD_CACHE".  The existing
      '--with-sounds-cache' option / SOUNDS_CACHE_DIR env variable and
      '--with-externals-cache' option / EXTERNALS_CACHE_DIR env variable
      remain and if specified, will override '--with-downloads-cache'.
      
      ASTERISK-27189
      
      Change-Id: Ifa9783fddf44aafadb060c9feba713dfa81d38ce
      305bd0d9
  12. Aug 01, 2017
    • George Joseph's avatar
      bundled_pjproject: Improve SSL/TLS error handling · ac6d98b2
      George Joseph authored
      OpenSSL has 2 levels or error processing.  It's possible for the
      top layer to return SSL_ERROR_SYSCALL but the lower layer return
      no error, in which case processing should continue.  Only the top
      layer was being examined though so connections were being torn
      down when they didn't need to be.  This patch adds the examination
      of the lower level codes, and if they return no errors, allows
      processing to continue.
      
      ASTERISK-27001
      Reported-by: Ian Gilmour
      patches:
      	pjproject-2.6.patch submitted by Ian Gilmour (license 6889)
      
      Updated-by: George Joseph and Sauw Ming (Teluu)
      
      Merged to upstream pjproject on 7/27/2017 (commit 5631)
      
      Change-Id: I23844ca0c68ef1ee550f14d46f6dae57d33b7bd2
      ac6d98b2
  13. Jul 18, 2017
  14. Jun 30, 2017
    • George Joseph's avatar
      pjproject_bundled: Allow passing configure options to bundled · f573e599
      George Joseph authored
      There wasn't any good way to pass options like --host or --build
      down to the pjproject configure which makes cross-compiling difficult.
      
      * Added a new PJPROJECT_CONFIGURE_OPTS environment variable which
        can be used to pass arbitrary options to pjproject configure.
      * Automatically set the pjproject configure --host and --build
        options to match those supplied for the asterisk configure.
      
      ASTERISK-27097 #close
      Reported-by: Kinsey Moore
      
      Change-Id: I5fa776e110262851173002a26ffe1172e4c35b2e
      f573e599
  15. Jun 29, 2017
    • George Joseph's avatar
      chan_pjsip: Fix ability to send UPDATE on COLP · c0c99c76
      George Joseph authored
      When connected_line_method is "invite", we're supposed to determine
      if the client can support UPDATE and if it can, send UPDATE instead
      of INVITE to avoid the SDP renegotiation.  Not only was pjproject
      not setting the PJSIP_INV_SUPPORT_UPDATE flag, we were testing
      that invite_tsx wasn't NULL which isn't always the case.
      
      * Updated chan_pjsip/update_connected_line_information to drop the
        requirement that invite_tsx isn't NULL.
      * Submitted patch to pjproject sip_inv.c that sets the
        PJSIP_INV_SUPPORT_UPDATE flag correctly.
      * Updated pjsip.conf.sample to clarify what happens when "invite"
        is specified.
      
      ASTERISK-27095
      
      Change-Id: Ic2381b3567b8052c616d96fbe79564c530e81560
      c0c99c76
  16. Jun 13, 2017
  17. May 19, 2017
  18. Apr 26, 2017
    • George Joseph's avatar
      pjproject_bundled: Add --disable-libwebrtc to configure · 858ed604
      George Joseph authored
      Without the disable, pjproject tries to build it's internal
      webrtc implementation which requires sse2.  This fails on
      platforms without sse2.
      
      ASTERISK-26930 #close
      Reported-by: abelbeck
      
      Change-Id: I07231f9160c35cfa42b194d3aad4e7d51fd9a410
      858ed604
  19. Apr 07, 2017
  20. Apr 05, 2017
    • George Joseph's avatar
      pjproject_bundled: Add 3 upstream patches · 01e9eaf3
      George Joseph authored
      0035-r5572-svn-backport-dialog-transaction-deadlock.patch
      0036-r5573-svn-backport-ua-pjsua-transaction-deadlock.patch
      0037-r5576-svn-backport-session-timer-crash.patch
      
      Also removed the progress bar from wget download to stdout.
      
      ASTERISK-26905 #close
      Reported-by: Ross Beer
      
      Change-Id: I268fb3cf71a3bb24283ff0d24bd8b03239d81256
      01e9eaf3
  21. Mar 27, 2017
  22. Mar 23, 2017
    • Kevin Harwell's avatar
      pjproject_bundled: raise timeout value used when downloading · 12dde3b5
      Kevin Harwell authored
      After configuring Asterisk with '--with-pjproject-bundled' the configure/build
      process attempts to download pjproject from its download site. Currently, a
      timeout of 10 seconds is used that will stop the download process if pjproject
      has not been fully downloaded in that time. For some systems this was not enough
      time and the process was timing out too early.
      
      This patch raises the download timeout value to '60'. Also, this patch fixes
      another bug where the DOWNLOAD_TIMEOUT variable was not being properly exported
      due to a naming error. DOWNLOAD_MAX_TIMEOUT is now properly renamed to
      DOWNLOAD_TIMEOUT.
      
      ASTERISK-26814 #close
      
      Change-Id: Ia56e4e8a3d39db76bc8a1852b2cf07ec10b39842
      12dde3b5
  23. Mar 21, 2017
  24. Mar 11, 2017
  25. Mar 08, 2017
    • Joshua Colp's avatar
      res_pjsip_transport_websocket: Add support for IPv6. · 4e3b0ced
      Joshua Colp authored
      This change adds a PJSIP patch (which has been contributed upstream)
      to allow the registration of IPv6 transport types.
      
      Using this the res_pjsip_transport_websocket module now registers
      an IPv6 Websocket transport and uses it for the corresponding
      traffic.
      
      ASTERISK-26685
      
      Change-Id: Id1f9126f995b31dc38db8fdb58afd289b4ad1647
      4e3b0ced
  26. Feb 23, 2017
    • George Joseph's avatar
      pjproject_bundled: Update for pjproject 2.6 · a537dae6
      George Joseph authored
       * Removed all 2.5.5 functional patches.
       * Updated usages of pj_release_pool to be "safe".
       * Updated configure options to disable webrtc.
       * Updated config_site.h to disable webrtc in pjmedia.
       * Added Richard Mudgett's recent resolver patches.
      
      Change-Id: Ib400cc4dfca68b3d07ce14d314e829bfddc252c7
      a537dae6
  27. Feb 20, 2017
    • Richard Mudgett's avatar
      pjproject: Fixes to resolve DNS SRV crashes. · 7f83bcd6
      Richard Mudgett authored
      * Re #1945 (misc): Don't trigger SRV complete callback when there is a
      parse error.
      
      * srv_resolver.c: Don't try to send query if already considered resolved.
      
      ** In resolve_hostnames() don't try to resolve a query that is already
      considered resolved.
      
      ** In resolve_hostnames() fix DNS typo in comments.
      
      ** In build_server_entries() move a common expression assigning to cnt
      earlier.
      
      * sip_transport.c: Fix tdata object name to actually contain the pointer.
      
      It helps if the logs referencing a tdata object buffer actually have a
      name that includes the correct pointer as part of the name.  Also since
      the tdata has its own pool it helps if any logs referencing the pool have
      the same name as the tdata object.  This change brings tdata logging in
      line with how tsx objects are named.
      
      ASTERISK-26669 #close
      ASTERISK-26738 #close
      
      Change-Id: I56af2ded25476b3e870ca586ee69ed6954ef75af
      7f83bcd6
    • Richard Mudgett's avatar
      pjproject: Increase SENDER_WIDTH column size for 64-bit system logs. · bf78c3c9
      Richard Mudgett authored
      ASTERISK-26669
      ASTERISK-26738
      
      Change-Id: Ibae6fc8cae69a1f04df0c577c4c11200499d6fe0
      bf78c3c9
  28. Feb 15, 2017
    • George Joseph's avatar
      res_pjsip_pubsub: Correctly implement persisted subscriptions · 4bdf5d32
      George Joseph authored
      This patch fixes 2 original issues and more that those 2 exposed.
      
      * When we send a NOTIFY, and the client either doesn't respond or
        responds with a non OK, pjproject only calls our
        pubsub_on_evsub_state callback, no others.  Since
        pubsub_on_evsub_state (which does the sub_tree cleanup) does not
        expect to be called back without the other callbacks being called
        first, it just returns leaving the sub_tree orphaned.  Now
        pubsub_on_evsub_state checks the event for PJSIP_EVENT_TSX_STATE
        which is what pjproject will set to tell us that it was the
        transaction that timed out or failed and not the subscription
        itself timing our or being terminated by the client. If is
        TSX_STATE, pubsub_on_evsub_state now does the proper cleanup
        regardless of the state of the subscription.
      
      * When a client renews a subscription, we don't update the
        persisted subscription with the new expires timestamp.  This causes
        subscription_persistence_recreate to prune the subscription if/when
        asterisk restarts.  Now, pubsub_on_rx_refresh calls
        subscription_persistence_update to apply the new expires timestamp.
        This exposed other issues however...
      
      * When creating a dialog from rdata (which sub_persistence_recreate
        does from the packet buffer) there must NOT be a tag on the To
        header (which there will be when a client refreshes a
        subscription).  If there is one, pjsip_dlg_create_uas will fail.
        To address this, subscription_persistence_update now accepts a flag
        that indicates that the original packet buffer must not be updated.
        New subscribes don't set the flag and renews do.  This makes sure
        that when the rdata is recreated on asterisk startup, it's done
        from the original subscribe packet which won't have the tag on To.
      
      * When creating a dialog from rdata, we were setting the dialog's
        remote (SUBSCRIBE) cseq to be the same as the local (NOTIFY) cseq.
        When the client tried to resubscribe after a restart with the
        correct cseq, we'd reject the request with an Invalid CSeq error.
      
      * The acts of creating a dialog and evsub by themselves when
        recreating a subscription does NOT restart pjproject's subscription
        timer.  The result was that even if we did correctly recreate the
        subscription, we never removed it if the client happened to go away
        or send a non-OK response to a NOTIFY.  However, there is no
        pjproject function exposed to just set the timer on an evsub that
        wasn't created by an incoming subscribe request.  To address this,
        we create our own timer using ast_sip_schedule_task.  This timer is
        used only for re-establishing subscriptions after a restart.
      
        An earlier approach was to add support for setting pjproject's
        timer (via a pjproject patch) and while that patch is still included
        here, we don't use that call at the moment.
      
      While addressing these issues, additional debugging was added and
      some existing messages made more useful.  A few formatting changes
      were also made to 'pjsip show scheduled tasks' to make displaying
      the subscription timers a little more friendly.
      
      ASTERISK-26696
      ASTERISK-26756
      
      Change-Id: I8c605fc1e3923f466a74db087d5ab6f90abce68e
      4bdf5d32
  29. Jan 23, 2017
    • George Joseph's avatar
      pjproject_bundled: Fix setting max log level · 96e7291c
      George Joseph authored
      An earlier attempt to prevent pjsua from spitting out an extra 6795
      lines of debug output every time the testsuite called it was also
      turning off the ability for asterisk to output debug info when it
      needed to.  This patch reverts the earlier fix and instead adds
      a pjproject patch that sets the startup log level to 1 for pjsua
      pjsystest and the pjsua python binding.  This is an asterisk-only
      patch that does not affect pjproject functionality and will not be
      submitted upstream.
      
      Change-Id: I347a8b58b2626f2906ccfc1d339e907627a0c9e8
      96e7291c
  30. Jan 08, 2017
  31. Jan 03, 2017
    • George Joseph's avatar
      pjproject_bundled: Compile pjsua with max log level = 2 · ceb9dae5
      George Joseph authored
      A while back, we changed config_site.h to set PJ_LOG_MAX_LEVEL = 6.
      This allowed us to control the log level better from inside Asterisk.
      An unfortunate side effect of this was that the pjsua binary and
      python bindings were also compiled with log level set to 6 so whenever
      a testsuite test that uses pjsua runs, it spits out 6795 lines of
      debug in an instant even before the test starts.  I believe this
      overruns the Jenkins capture buffer and prevents the test from
      properly terminating.  In turn, this results in the testsuite just
      hanging until the job is killed.  It's more frequent on the higher
      end agents because they can spit out the messages faster.
      
      Unfortunately, the messages are all spit out before we have control
      of the python pj.Lib instance where we can set logging levels so the
      only alternative was to actually compile pjsua and _pjsua.so with an
      overridden PJ_LOG_MAX_LEVEL.  Although defining a lower max level was
      done in the Makefile, the define in config_site.h had to be wrapped
      with "#ifndef" so the change would take effect.
      
      Change-Id: I2af9e7d48dde1927279c586c9c725d868fe6f3ff
      ceb9dae5
  32. Dec 18, 2016
    • George Joseph's avatar
      pjproject_bundled: Make build single threaded · d29eb3b9
      George Joseph authored
      There were just too many issues in various environments with
      multi threaded building of pjproject.  It doesn't really speed
      things up anyway since asterisk is already being compiled in
      parallel.
      
      Change-Id: Ie5648fb91bb89b4224b6bf43a0daa1af793c4ce1
      d29eb3b9
  33. Dec 09, 2016
    • George Joseph's avatar
      pjproject_bundled: Retry download if previously saved tarball is bad · 31268e0a
      George Joseph authored
      If a tarball is corrupted during download, the makefile will attempt to
      download it again. If the tarball somehow gets corrupted after it's
      downloaded however, the makefile was just failing.  We now
      retry the download.
      
      ASTERISK-26653 #close
      
      Change-Id: I1b24d454852d80186f60c5a65dc4624ea8a1c359
      31268e0a
  34. Dec 07, 2016
    • Richard Mudgett's avatar
      Bundled pjproject: Fix finding SIP transactions. · 76d52dc2
      Richard Mudgett authored
      Occasionally SIP message transactions are not found when they should be.
      In the particular case an incoming INVITE transaction is CANCELed but the
      INVITE transaction cannot be found so a 481 response is returned for the
      CANCEL.  The problematic calls have a '_' character in the Via branch
      parameter.
      
      The problem is in the pjproject PJ_HASH_USE_OWN_TOLOWER feature's code.
      The problem with the "own tolower" code is that it does not calculate the
      same hash value as when the pj_tolower() function is used.  The "own
      tolower" code will erroneously modify the ASCII characters '@', '[', '\\',
      ']', '^', and '_'.  Calls to pj_hash_calc_tolower() can use the
      PJ_HASH_USE_OWN_TOLOWER substitute algorithm when enabled.  Calls to
      pj_hash_get_lower(), pj_hash_set_lower(), and pj_hash_set_np_lower() call
      find_entry() which never uses the PJ_HASH_USE_OWN_TOLOWER algorithm.  As a
      result you may not be able to find a hash tabled entry because the
      calculated hash values would differ.
      
      * Simply disable PJ_HASH_USE_OWN_TOLOWER.
      
      ASTERISK-26490 #close
      
      Change-Id: If89bfdb5f301b8b685881a9a2a6e0c3c5af32253
      76d52dc2
  35. Dec 06, 2016
    • George Joseph's avatar
      pjproject_bundled: Fix missing inclusion of symbols · fe9f0708
      George Joseph authored
      Added back in a -g3, and an -O3 when DONT_OPTIMIZE is not set, to
      the CFLAGS.  Not sure how they went missing.
      
      Also fixed an uninstall problem where we weren't removing the
      symlink from libasteriskpj.so.2 to libasteriskpj.so.  While I was
      there, I fixed it for libasteriskssl as well.
      
      Change-Id: I9e00873b1e9082d05b5549d974534b48a2142556
      fe9f0708
  36. Nov 30, 2016
    • Richard Mudgett's avatar
      PJPROJECT logging: Made easier to get available logging levels. · 1dfa11b6
      Richard Mudgett authored
      Use of the new logging is as simple as issuing the new CLI command or
      setting the new pjproject.conf option.
      
      Other options that can affect the logging are how you have the pjproject
      log levels mapped to Asterisk log types in pjproject.conf and if you have
      configured Asterisk to log the DEBUG type messages.  Altering the
      pjproject.conf level mapping shouldn't be necessary for most installations
      as the default mapping is sensible.  Configuring Asterisk to log the DEBUG
      message type is standard practice for collecting debug information.
      
      * Added CLI "pjproject set log level" command to dynamically adjust the
      maximum pjproject log message level.
      
      * Added CLI "pjproject show log level" command to see the currently set
      maximum pjproject log message level.
      
      * Added pjproject.conf startup section "log_level" option to set the
      initial maximum pjproject log message level so all messages could be
      captured from initialization.
      
      * Set PJ_LOG_MAX_LEVEL to 6 to compile in all defined logging levels into
      bundled pjproject.  Pjproject will use the currently set run time log
      level to determine if a log message is generated just like Asterisk
      verbose and debug logging levels.
      
      * In log_forwarder(), made always log enabled and mapped pjproject log
      messages.  DEBUG mapped log messages are no longer gated by the current
      Asterisk debug logging level.
      
      * Removed RAII_VAR() from res_pjproject.c:get_log_level().
      
      ASTERISK-26630 #close
      
      Change-Id: I6dca12979f482ffb0450aaf58db0fe0f6d2e5389
      1dfa11b6
  37. Nov 18, 2016
    • George Joseph's avatar
      pjproject_bundled: Improve reliability of pjproject download · d3f070c7
      George Joseph authored
      The download process now has a timeout which will cause wget to retry
      if it stops retrieving data for 5 seconds and fetch and curl to timeout
      if the whole retrieval take smore than 30 seconds.
      
      If the tarball retrieval works, the MD5SUM file is retrieved from
      the downloads site and the md5 checksum is verified.
      
      If either the tarball retrieval or MD5SUM retrieval fails, or the
      checksums don't match, the entire process is retried once.  If it
      fails again, any incomplete tarball is deleted.
      
      .DELETE_ON_ERROR: was also added to the Makefile.  Not only does
      this delete the tarball on failure, it till also delete corrupted
      library files from the pjproject source directory should they
      fail to build correctly.
      
      Tested all the way back to FreeBSD 9, CentOS 6, Debian 6 and
      Ubuntu 14.
      
      Change-Id: Iea7d33b96a31622ab1b6e54baebaf271959514e1
      d3f070c7
Loading