Skip to content
Snippets Groups Projects
  1. Nov 18, 2019
    • Kevin Harwell's avatar
      various files - fix some alerts raised by lgtm code analysis · bdd785d3
      Kevin Harwell authored
      This patch fixes several issues reported by the lgtm code analysis tool:
      
      https://lgtm.com/projects/g/asterisk/asterisk
      
      Not all reported issues were addressed in this patch. This patch mostly fixes
      confirmed reported errors, potential problematic code points, and a few other
      "low hanging" warnings or recommendations found in core supported modules.
      These include, but are not limited to the following:
      
      * innapropriate stack allocation in loops
      * buffer overflows
      * variable declaration "hiding" another variable declaration
      * comparisons results that are always the same
      * ambiguously signed bit-field members
      * missing header guards
      
      Change-Id: Id4a881686605d26c94ab5409bc70fcc21efacc25
      bdd785d3
  2. Nov 07, 2019
  3. Oct 14, 2019
    • cmaj's avatar
      app_voicemail.c: Support multiple file formats for forwarded messages. · 2d67dbfe
      cmaj authored
      If you specify multiple formats in voicemail.conf, eg. "format = gsm|wav"
      and are using realtime ODBC backend, only the first format gets stored
      in the database. So when you forward a message later on, there is a bug
      generating the email, related to the stored format (GSM) being different
      than the desired email format (WAV) specified for the user. Sox can
      handle this, but Asterisk needs to tell sox exactly what to do.
      
      ASTERISK-22192
      
      Change-Id: I7321e7f7e7c58adbf41dd4fd7191c887b9b2eafd
      2d67dbfe
  4. Oct 08, 2019
  5. Sep 19, 2019
  6. Sep 10, 2019
    • Frederic LE FOLL's avatar
      ChanIsAvail() generates a CDR when unanswered=yes in cdr.conf. · 2d0eee54
      Frederic LE FOLL authored
      ChanIsAvail() creates a temporary channel with ast_request() to test
      resource availability. It should not generate a CDR when it hangs up
      this temporary channel.
      
      This patch disables CDR generation for the temporary channel with
      ast_cdr_set_property().
      
      ASTERISK-28527
      
      Change-Id: I7b0555c6909c7d322e452dde97c9ea5b111552d1
      2d0eee54
  7. Aug 20, 2019
    • Sean Bright's avatar
      audiohook.c: Substitute silence for unavailable audio frames · 64906c4c
      Sean Bright authored
      There are 4 scenarios to consider when capturing audio from a channel
      with an audiohook:
      
       1. There is no rx and no tx audio, so return nothing.
       2. There is rx but no tx audio, so return rx.
       3. There is tx but no rx audio, so return tx.
       4. There is rx and tx audio, so mix them and return.
      
      The file passed as the primary argument to MixMonitor will be written to
      in scenarios 2, 3, and 4. However, if you pass the r() and t() options
      to MixMonitor, a frame will only be written to the r() file if there was
      rx audio and a frame will only be written to the t() file if there was
      tx audio.
      
      If you subsequently take the r() and t() files and try to mix them, the
      sides of the conversation will 'drift' and be non-representative of the
      user experience.
      
      This patch adds a new 'S' option to MixMonitor that injects a frame of
      silence on either the r() side or the t() side of the channel so that
      when later mixed, there is no such drift.
      
      Change-Id: Ibf5ed73a811087727bd561a89a59f4447b4ee20e
      64906c4c
  8. Aug 15, 2019
  9. Aug 06, 2019
    • Sean Bright's avatar
      app_voicemail: Remove extra menuselect build options · 9d07d5a6
      Sean Bright authored
      You now select voicemail backends like normal dialplan applications, so
      there is no longer a need for their own menuselect category.
      
      Reported by snuff-work in #asterisk-dev
      
      Change-Id: Idfa4c9c8349726074318a9e6b68d24c374521005
      9d07d5a6
  10. Aug 01, 2019
    • Kevin Harwell's avatar
      various modules: json integer overflow · 3656c42c
      Kevin Harwell authored
      There were still a few places in the code that could overflow when "packing"
      a json object with a value outside the base type integer's range. For instance:
      
      unsigned int value = INT_MAX + 1
      ast_json_pack("{s: i}", value);
      
      would result in a negative number being "packed". In those situations this patch
      alters those values to a ast_json_int_t, which widens the value up to a long or
      long long.
      
      ASTERISK-28480
      
      Change-Id: Ied530780d83e6f1772adba0e28d8938ef30c49a1
      3656c42c
  11. Jul 09, 2019
    • Kevin Harwell's avatar
      app_voicemail: Remove dependency on the stasis cache · c93c5791
      Kevin Harwell authored
      app_voicemail utilized the stasis cache when polling mailboxes for MWI. This
      caused a memory leak (items were not being appropriately removed from the
      cache), and subsequent slowdown in system processing. This patch removes the
      stasis cache dependency, thus alleviating the memory leak. It does this by
      utilizing the new MWI API that better manages state lifetime.
      
      ASTERISK-28443
      ASTERISK-27121
      
      Change-Id: Ie89fedaca81ea1fd03d150d9d3a1ef3d53740e46
      c93c5791
  12. Jun 28, 2019
    • Chris-Savinovich's avatar
      app_voicemail.c: Build all three variants for app_voicemail at the same time · 6b1f6ea2
      Chris-Savinovich authored
      Changes made to apps/Makefile to optionally build all three app_voicemail
      variations at the same time: 1) file (default), 2) odbc, and 3) imap.
      This functionality was requested by users. modules.conf.sample warns the
      user to make sure only one voicemail is loaded at a time.
      
      Change-Id: Iba3cd8ffb4b7e8b1c64a11dd383e1eafcd3ed0e7
      6b1f6ea2
  13. Jun 21, 2019
    • Nasir Iqbal's avatar
      app_amd: issue with silence suppression fixed · 29bc7cf6
      Nasir Iqbal authored
      Now AMD algorithm will not ignore AST_FRAME_NULL, As I think using manual
      wait time instead of `framelength` is enough to fix timeout / TOOLONG issue.
      
      ASTERISK-28419 #close
      
      Change-Id: I16ea2d6295bc99b975e8c092e5f9fbd9214debdb
      29bc7cf6
  14. Jun 13, 2019
    • George Joseph's avatar
      app_confbridge: Attended transfer event fixup · f3e5419d
      George Joseph authored
      When a channel already in a conference bridge is attended transfered
      to another extension, or when an existing call is attended
      transferred into a conference bridge, we now generate ConfbridgeJoin
      and ConfbridgeLeave events for the entering and departing channels.
      
      Change-Id: Id7709cfbceb26fbcb828b2d0d2a6b2fbeaf028e1
      f3e5419d
  15. Jun 11, 2019
    • Alexei Gradinari's avatar
      app_attended_transfer: new application AttendedTransfer · 3eaeb3e6
      Alexei Gradinari authored
      AttendedTransfer queues up attended transfer to the given extension.
      
      This application can be useful with Custom Dynamic Features.
      For example to make attended transfer to a predefined number.
      
      features.conf
      ;;;
      [applicationmap]
      my_atxfer => *7,self,GoSub,"my_atxfer,s,1",default
      ;;;
      
      extensions.conf
      ;;;
      [globals]
      DYNAMIC_FEATURES=my_atxfer
      TRANSFER_CONTEXT=my_transfer
      
      [my_atxfer]
      exten => s,1,AttendedTransfer(1234567890)
         same => n,Return()
      
      [my_transfer]
      include => default
      ;;;
      
      This application also can be used to completly redefine Attended transfer
      feature using dialplan. For example:
      
      features.conf
      ;;;
      [featuremap]
      atxfer => *7
      
      [applicationmap]
      custom_atxfer => *2,self,GoSub,"custom_atxfer,s,1",default
      ;;;
      
      extensions.conf
      ;;;
      [globals]
      DYNAMIC_FEATURES=custom_atxfer
      TRANSFER_CONTEXT=my_transfer
      
      [custom_atxfer]
      exten => s,1,
         same => n,Playback(pbx-transfer)
         same => n,Read(dest,dial,10,i,3,3)
         same => n,AttendedTransfer(${dest})
         same => n,Return()
      
      [my_transfer]
      include => default
      ;;;
      
      Change-Id: Ie5cfa455d0813cffd5c85a6fb117f07d8f0b903b
      3eaeb3e6
  16. Jun 07, 2019
    • Alexei Gradinari's avatar
      app_blind_transfer: new application BlindTransfer · 745cbab5
      Alexei Gradinari authored
      BlindTransfer redirects all channels currently bridged to the
      caller channel to the specified destination.
      
      This application can be useful with Custom Dynamic Features.
      For example to make blind transfer to a predefined number.
      
      features.conf
      ;;;
      [applicationmap]
      my_blindxfer => *6,self,GoSub,"my_blindxfer,s,1",default
      ;;;
      
      extensions.conf
      ;;;
      [globals]
      DYNAMIC_FEATURES=my_blindxfer
      
      [my_blindxfer]
      exten => s,1,BlindTransfer(1234567890,default)
         same => n,Return()
      ;;;
      
      This application also can be used to completly redefine Blind transfer
      feature using dialplan. For example:
      
      features.conf
      ;;;
      [featuremap]
      blindxfer =>
      
      [applicationmap]
      custom_blindxfer => ##,self,GoSub,"custom_blindxfer,s,1",default
      ;;;
      
      extensions.conf
      ;;;
      [globals]
      DYNAMIC_FEATURES=custom_blindxfer
      
      [custom_blindxfer]
      exten => s,1,
         same => n,Playback(pbx-transfer)
         same => n,Read(dest,dial,10,i,3,3)
         same => n,BlindTransfer(${dest},default)
         same => n,Return()
      ;;;
      
      Change-Id: I9d55e7f69ccfd4472dec00d62771d6de8803215a
      745cbab5
  17. May 23, 2019
  18. May 10, 2019
    • George Joseph's avatar
      Fixes for GCC 9 · c5c953c1
      George Joseph authored
      Various fixes for issues caught by gcc 9.  Mostly snprintf
      trying to copy to a buffer potentially too small.
      
      ASTERISK-28412
      
      Change-Id: I9e85a60f3c81d46df16cfdd1c329ce63432cf32e
      c5c953c1
  19. May 02, 2019
    • Joshua Colp's avatar
      app_confbridge: Add "all" variants of REMB behavior. · 80dba268
      Joshua Colp authored
      When producing a combined REMB value the normal behavior
      is to have a REMB value which is unique for each sender
      based on all of their receivers. This can result in one
      sender having low bitrate while all the rest are high.
      
      This change adds "all" variants which produces a bridge
      level REMB value instead. All REMB reports are combined
      together into a single REMB value that is the same for
      each sender.
      
      ASTERISK-28401
      
      Change-Id: I883e6cc26003b497c8180b346111c79a131ba88c
      80dba268
  20. Apr 30, 2019
  21. Apr 29, 2019
    • Rodrigo Ramírez Norambuena's avatar
      app_queue: Set correct value by default for shared_lastcall · ed615afb
      Rodrigo Ramírez Norambuena authored
      There a long history here:
      
      In commit dd1e62c0 has introduce by default shared_lastcall = true by
      default but this now only happen is there not [general] directive in
      queues.conf
      
      After that, the commit 4b50e3f1 fix the
      sample file.
      
      We'll need to keep the same setting if there a general or not section in
      configuration file since the shared_lastcall is by a long time in
      sample files as default value to 'no'.
      
      Change-Id: Id44faec370136df8d57902b453ad4059ed21b94c
      ed615afb
  22. Apr 24, 2019
    • Antoni Goldstein's avatar
      app_dial.c: RINGTIME, PROGRESSTIME and ms resolution dial timings · 8e21c25c
      Antoni Goldstein authored
      Added RINGTIME, RINGTIME_MS, PROGRESSTIME, PROGRESSTIME_MS variables filled
      at the earliest received PROGRESS or RINGING.
      Added millisecond versions of DIALEDTIME and ANSWEREDTIME.
      
      Added millisecond versions of ast_channel_get_up_time and
      ast_channel_get_duration in channel.c.
      
      ASTERISK-28363
      
      Change-Id: If95f1a7d8c4acbac740037de0c6e3109ff6620b1
      8e21c25c
  23. Apr 23, 2019
    • Kevin Harwell's avatar
      mwi core: Move core MWI functionality into its own files · ff0d0ac2
      Kevin Harwell authored
      There is enough MWI functionality to warrant it having its own 'c' and header
      files. This patch moves all current core MWI data structures, and functions
      into the following files:
      
      main/mwi.h
      main/mwi.c
      
      Note, code was simply moved, and not modified. However, this patch is also in
      preparation for core MWI changes, and additions to come.
      
      Change-Id: I9dde8bfae1e7ec254fa63166e090f77e4d3097e0
      ff0d0ac2
  24. Apr 13, 2019
    • Sean Bright's avatar
      app_voicemail: Don't split mailbox options on comma · d58d7d45
      Sean Bright authored
      Because the per-mailbox options are the last thing on a line, don't look
      for or stomp on any subsequent commas.
      
      ASTERISK-27935 #close
      Reported by: Sébastien Duthil
      
      Change-Id: I07b2eb4a33c303d0c7114d5b906f8c067c60a153
      d58d7d45
  25. Apr 12, 2019
    • Sean Bright's avatar
      app_voicemail: Cleanup stale lock files on module load · 63f86cac
      Sean Bright authored
      If Asterisk crashes while a VM directory is locked, lock files in the VM
      spool directory will not get properly cleaned up. We now clear them on
      module load.
      
      ASTERISK-20207 #close
      Reported by: Steven Wheeler
      
      Change-Id: If40ccd508e2f6e5ade94dde2f0bcef99056d0aaf
      63f86cac
  26. Mar 29, 2019
    • Sean Bright's avatar
      app_queue: Fix a few member pause bugs · e8cf3693
      Sean Bright authored
      * Always set member->lastpause when setting member->paused
      
      * Fixed typo (using member->lastcall instead of member->lastpause) in
        'queue show' output.
      
      * Use a constant 'now' in 'queue show' output for a better point-in-time
        view of time based stats.
      
      ASTERISK-27541 #close
      Reported by: César Benjamín García Martínez
      
      Change-Id: Ib41ced90cfdb66f9bb1e7b263d0f6fc1ac6e18fa
      e8cf3693
  27. Mar 26, 2019
  28. Mar 13, 2019
  29. Mar 11, 2019
    • Joshua Colp's avatar
      stasis: Improve topic/subscription names and statistics. · 0231dd6a
      Joshua Colp authored
      Topic names now follow: <subsystem>:<functionality>[/<object>]
      
      This ensures that they are all unique, and also provides better
      insight in to what each topic is for.
      
      Subscriber ids now also use the main topic name they are
      subscribed to and an incrementing integer as their identifier to
      make it easier to understand what the subscription is primarily
      responsible for.
      
      Both the CLI commands for listing topic and subscription statistics
      now sort to make it a bit easier to see what is going on.
      
      Subscriptions will now show all topics that they are receiving messages
      from, not just the main topic they were subscribed to.
      
      ASTERISK-28335
      
      Change-Id: I484e971a38c3640f2bd156282e532eed84bf220d
      0231dd6a
  30. Mar 08, 2019
  31. Mar 04, 2019
    • Sean Bright's avatar
      app_queue: Handle empty 'interface' in queue member config · f6b5b720
      Sean Bright authored
      While the 'interface' column is a NOT NULL, the empty string is still
      allowed. res_config_odbc treats the empty string as a NULL and we crash
      when trying to dereference.
      
      Also cleaned up an adjacent error message for consistency.
      
      ASTERISK-28168 #close
      
      Change-Id: I55e012b540fbcda99bb40bede3099b7ae5db8202
      f6b5b720
  32. Feb 19, 2019
  33. Feb 07, 2019
    • Joshua Colp's avatar
      res_odbc: Add basic query logging. · 54a912b2
      Joshua Colp authored
      When Asterisk is connected and used with a database the response
      time of the database can cause problems in Asterisk if it is long.
      Normally the only way to see this problem would be to retrieve a
      backtrace from Asterisk and examine where things are blocked, or
      examine the database to see if there is any indication of a
      problem.
      
      This change adds some basic query logging to make it easier to
      investigate such a problem. When logging is enabled res_odbc will
      now keep track of the number of queries executed, as well as the
      query that has taken the longest time to execute. There is also
      an option which will cause a WARNING message to be output if a
      query takes longer than a configurable amount of time to execute.
      
      This makes it easier and clearer for users that their database may
      be experiencing a problem that could impact Asterisk.
      
      ASTERISK-28277
      
      Change-Id: I173cf4928b10754478a6a8c27dfa96ede0f058a6
      54a912b2
  34. Jan 22, 2019
    • George Joseph's avatar
      app_voicemail: Add Mailbox Aliases · c6980e32
      George Joseph authored
      You can now define an "aliases" context in voicemail.conf
      whose entries point to actual mailboxes.  These can be used anywhere
      the mailbox is specified.
      
      Example:
      [general]
      aliasescontext = myaliases
      
      [default]
      1234 = yadayada
      
      [myaliases]
      4321@devices = 1234@default
      
      Now you can use 4321@devices to refer to the 1234@default mailbox.
      
      This can be useful to provide channel drivers with constant
      mailbox specifications such as <extension>@devices leaving
      app_voicemail to control exactly which mailbox the alias points to.
      Now, only voicemail has to be reloaded to make changes instead of
      individual channel drivers which are usually more expensive to
      reload.
      
      Change-Id: I395b9205c91523a334fe971be0d1de4522067b04
      c6980e32
  35. Jan 02, 2019
  36. Dec 18, 2018
    • George Joseph's avatar
      app_voicemail: Don't delete mailbox state unless mailbox is deleted · c23c8d92
      George Joseph authored
      The free_user function was automatically deleting the stasis mailbox
      state but this only makes sense when the mailbox is actually
      deleted, not just the structure freed.  This was causing issues
      where leave_voicemail would publish the mwi message to stasis and
      delete the state before the message could be processed by
      res_pjsip_mwi.
      
      * Removed the delete of state from free_user().
      
      * Created a new free_user_final() function that both frees the data
        structure and deletes the state.  This function is only called
        during module load/unload where it's appropriate to delete the
        state.
      
      ASTERISK-28215
      
      Change-Id: I305e8b3c930e9ac41d901e5dc8a58fd7904d98dd
      c23c8d92
  37. Dec 12, 2018
  38. Dec 03, 2018
  39. Nov 29, 2018
    • George Joseph's avatar
      Revert "app_voicemail: Remove need to subscribe to stasis" · 4f0bf027
      George Joseph authored
      This reverts commit 29115e23.
      
      That commit closed a long standing hole which allowed subscriptions
      to mailboxes that weren't configured in voicemail.conf.  This
      caused an issue with FreePBX which depdended on that behavior.
      The commit is being reverted until FreePBX can handle the new
      behavior.
      
      ASTERISK-28151
      Reported by: Ronald Raikes
      
      Change-Id: I57b7b85e75d7dd97c742b5c69d718a0f61260c15
      4f0bf027
Loading