Skip to content
Snippets Groups Projects
  1. Feb 19, 2019
  2. 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
  3. 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
  4. Jan 02, 2019
  5. 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
  6. Dec 12, 2018
  7. Dec 03, 2018
  8. 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
  9. Nov 26, 2018
    • George Joseph's avatar
      bridges: Remove reliance on stasis caching · 3667c5e1
      George Joseph authored
      * The bridging core no longer uses the stasis cache for bridge
        snapshots.  The latest bridge snapshot is now stored on the
        ast_bridge structure itself.
      
      * The following APIs are no longer available since the stasis cache
        is no longer used:
          ast_bridge_topic_cached()
          ast_bridge_topic_all_cached()
      
      * A topic pool is now used for individual bridge topics.
      
      * The ast_bridge_cache() function was removed since there's no
        longer a separate container of snapshots.
      
      * A new function "ast_bridges()" was created to retrieve the
        container of all bridges.  Users formerly calling
        ast_bridge_cache() can use the new function to iterate over
        bridges and retrieve the latest snapshot directly from the
        bridge.
      
      * The ast_bridge_snapshot_get_latest() function was renamed to
        ast_bridge_get_snapshot_by_uniqueid().
      
      * A new function "ast_bridge_get_snapshot()" was created to retrieve
        the bridge snapshot directly from the bridge structure.
      
      * The ast_bridge_topic_all() function now returns a normal topic
        not a cached one so you can't use stasis cache functions on it
        either.
      
      * The ast_bridge_snapshot_type() stasis message now has the
        ast_bridge_snapshot_update structure as it's data.  It contains
        the last snapshot and the new one.
      
      * cdr, cel, manager and ari have been updated to use the new
        arrangement.
      
      Change-Id: I7049b80efa88676ce5c4666f818fa18ad1985369
      3667c5e1
    • Joshua Colp's avatar
      stasis: Segment channel snapshot to reduce creation cost. · 50ac85cb
      Joshua Colp authored
      When a channel snapshot was created it used to be done
      from scratch, copying all data (many strings). This incurs
      a cost when doing so.
      
      This change segments the channel snapshot into different
      components which can be reused if unchanged from the
      previous snapshot creation, reducing the cost. In normal
      cases this results in some pointers being copied with
      reference count being bumped, some integers being set,
      and a string or two copied. The other benefit is that it
      is now possible to determine if a channel snapshot update
      is redundant and thus stop it before a message is published
      to stasis.
      
      The specific segments in the channel snapshot were split up
      based on whether they are changed together, how often they
      are changed, and their general grouping. In practice only
      1 (or 0) of the segments actually get changed in normal
      operation.
      
      Invalidation is done by setting a flag on the channel when
      the segment source is changed, forcing creation of a new
      segment when the channel snapshot is created.
      
      ASTERISK-28119
      
      Change-Id: I5d7ef3df963a88ac47bc187d73c5225c315f8423
      50ac85cb
    • Joshua Colp's avatar
      stasis: Use an implementation specific channel snapshot cache. · d0ccbb33
      Joshua Colp authored
      Channels no longer use the Stasis cache for channel snapshots. Instead
      they are stored in a hash table in stasis_channels which reduces the
      number of Stasis messages created and allows better storage.
      
      As a result the following APIs are no longer available since the stasis
      cache is no longer used:
      ast_channel_topic_cached()
      ast_channel_topic_all_cached()
      
      The ast_channel_cache_all() and ast_channel_cache_by_name() functions
      now return an ao2_container of ast_channel_snapshots rather than
      a container of stasis_messages therefore you can't (and don't need
      to) call stasis_cache functions on it.
      
      The ast_channel_topic_all() function now returns a normal topic not
      a cached one so you can't use stasis cache functions on it either.
      
      The ast_channel_snapshot_type() stasis message now has the
      ast_channel_snapshot_update structure as it's data. It contains the
      last snapshot and the new one.
      
      ast_channel_snapshot_get_latest() still returns the latest snapshot.
      
      The latest snapshot is now stored on the channel itself to eliminate
      cache hits when Stasis messages that have the snapshot as a payload
      are created.
      
      ASTERISK-28102
      
      Change-Id: I9334febff60a82d7c39703e49059fa3a68825786
      d0ccbb33
  10. Nov 21, 2018
  11. Nov 19, 2018
  12. Nov 18, 2018
    • Joshua Colp's avatar
      stasis: Add internal filtering of messages. · 3077ad0c
      Joshua Colp authored
      This change adds the ability for subscriptions to indicate
      which message types they are interested in accepting. By
      doing so the filtering is done before being dispatched
      to the subscriber, reducing the amount of work that has
      to be done.
      
      This is optional and if a subscriber does not add
      message types they wish to accept and set the subscription
      to selective filtering the previous behavior is preserved
      and they receive all messages.
      
      There is also the ability to explicitly force the reception
      of all messages for cases such as AMI or ARI where a large
      number of messages are expected that are then generically
      converted into a different format.
      
      ASTERISK-28103
      
      Change-Id: I99bee23895baa0a117985d51683f7963b77aa190
      3077ad0c
  13. Oct 24, 2018
    • Alexei Gradinari's avatar
      app_dial/queue/followme: 'I' options to block initial updates in both directions · 4a567cee
      Alexei Gradinari authored
      The 'I' option currently blocks initial CONNECTEDLINE or REDIRECTING updates
      from the called parties to the caller.
      
      This patch also blocks updates in the other direction before call is
      answered.
      
      ASTERISK-27980
      
      Change-Id: I6ce9e151a2220ce9e95aa66666933cfb9e2a4a01
      4a567cee
    • George Joseph's avatar
      bridge_softmix: Add SDP "label" attribute to streams · 8d1c6bb6
      George Joseph authored
      Adding the "label" attribute used for participant info correlation
      was previously done in app_confbridge but it wasn't working
      correctly because it didn't have knowledge about which video
      streams belonged to which channel.  Only bridge_softmix has that
      data so now it's set when the bridge topology is changed.
      
      ASTERISK-28107
      
      Change-Id: Ieddeca5799d710cad083af3fcc3e677fa2a2a499
      8d1c6bb6
  14. Oct 18, 2018
    • Richard Mudgett's avatar
      app_dial/app_queue: Update application option documentation · 9838a5e5
      Richard Mudgett authored
      * Update the post-answer documentation and example.  The Dial example was
      incorrect and misleading for the post-answer subroutine useage.
      
      * Fix note and warning paragraphs in option descriptions.  They don't show
      up in the wiki.
      
      Change-Id: I81019a1fd75d5b9151f76b52c38e2a90da682d14
      9838a5e5
  15. Oct 17, 2018
  16. Oct 01, 2018
  17. Sep 28, 2018
    • George Joseph's avatar
      app_confbridge: Use bridge join hook to send join and leave events · f10c7b6e
      George Joseph authored
      The first attempt at publishing confbridge events to participants
      involved publishing them at the same time stasis events were
      created.  This caused issues with bridge and channel locks.  The
      second attempt involved publishing them when the stasis events
      were received by the code that published the confbridge AMI events.
      This caused timing issues because, depending on resources available,
      the event could be received before channels actually joined the
      bridge and would therefore fail to send messages to the participant.
      
      This attempt reverts to the original mechanism with one exception.
      The join and leave events are published via bridge join and leave
      hooks.  This guarantees the states of the channels and bridge and
      provides deterministic timing for event publishing.
      
      Change-Id: I2660074f8a30a5224cb953d5e047ee84484a9036
      f10c7b6e
  18. Sep 27, 2018
    • Cao Minh Hiep's avatar
      app_queue: Fix Attended transfer hangup with removing pending member. · f23a1224
      Cao Minh Hiep authored
      This issue related to setting of holdtime, announcements, member delays.
      It works well if we set the member delays to "0" and no announcements
      and no holdtime.This issue will happen if we set member delays to "1",
      "2"... or announcements or holdtime and hangs up the call during
      processing it.
      
      And here is the reason:
      (At the step of answering a phone.)
      It takes care any holdtime, announcements, member delays,
      or other options after a call has been answered if it exists.
      
      Normally, After the call has been aswered,
      and we wait for the processing one of the cases of the member delays
      or hold time or announcements finished, "if (ast_check_hangup(peer))"
      will be not executed, then queue will be updated at update_queue().
      Here, pending member will be removed.
      
      However, after the call has been aswered,
      if we hangs up the call during one of the cases of the member delays
      or hold time or announcements, "if (ast_check_hangup(peer))"
      will be executed.
      outgoing = NULL and at hangupcalls, pending members will not be removed.
      
      * This fixed patch will remove the pending member from container
      before hanging up the call with outgoing is NULL.
      
      ASTERISK-27920
      
      Reported by: Cao Minh Hiep
      Tested by: Cao Minh Hiep
      
      Change-Id: Ib780fbf48ace9d2d8eaa1270b9d530a4fc14c855
      f23a1224
  19. Sep 24, 2018
    • George Joseph's avatar
      app_voicemail: Cleanup mailbox topic and cache · 06c0676d
      George Joseph authored
      app_voicemail wasn't properly cleaning up the stasis cache or the
      mwi topic pool when the module was unloaded or when a user was
      deleted as a result of a reload.  This resulted in leaks in both
      areas.
      
      * app_voicemail now calls ast_delete_mwi_state_full when it frees
        a user structure and ast_delete_mwi_state_full in turn now calls
        the new stasis_topic_pool_delete_topic function to clear the topic
        from the pool.
      
      Change-Id: Ide23144a4a810e7e0faad5a8e988d15947965df8
      06c0676d
  20. Sep 21, 2018
    • George Joseph's avatar
      app_voicemail: Fix stack overrun in append_mailbox · 22cf065e
      George Joseph authored
      The append_mailbox function wasn't calculating the correct length
      to pass to ast_alloca and it wasn't handling the case where context
      might be empty.
      
      Found by the Address Sanitizer.
      
      Change-Id: I7eb51c7bd18a7a8dbdba261462a95cc69e84f161
      22cf065e
  21. Sep 18, 2018
    • George Joseph's avatar
      app_voicemail: Remove need to subscribe to stasis · cdece3b6
      George Joseph authored
      app_voicemail was using the stasis cache to build and maintain a
      list of mailboxes that had subscribers.  It then used this list
      to determine if a mailbox should be polled for new messages if
      polling was enabled.  For this to work, stasis had to cache every
      subscription and unsubscription to the mailbox which caused a lot of
      overhead, both cpu and memory related.
      
      Since polling is only required when changes are being made to
      mailboxes outside of app_voicemail and since the number of mailboxes
      that don't have any subscribers is likely to be very low, all
      mailboxes are now polled instead of just the ones with subscribers.
      
      This paves the way for disabling the caching of stasis subscription
      change messages.
      
      Also fixed cleanup in some of the unit tests that not only left
      test users in the users list but also caused segfaults if the tests
      were run more than once.
      
      ASTERISK-27121
      
      Change-Id: I5cceb737246949f9782955c64425b8bd25a9e9ee
      cdece3b6
  22. Sep 06, 2018
  23. Sep 03, 2018
  24. Aug 22, 2018
    • Sean Bright's avatar
      app_queue: Silence GCC 8 compiler warning · 14c6f8be
      Sean Bright authored
      I'm only seeing an error in 14+, so I assume it is due to different
      compiler options:
      
      app_queue.c: In function ‘handle_queue_add_member’:
      app_queue.c:10234:19: error: ‘%d’ directive writing between 1 and 11
          bytes into a region of size 3 [-Werror=format-overflow=]
           sprintf(num, "%d", state);
                         ^~
      app_queue.c:10234:18: note: directive argument in the range
          [-2147483648, 99]
           sprintf(num, "%d", state);
                        ^~~~
      
      Compiler: gcc version 8.0.1 20180414 (experimental)
          [trunk revision 259383] (Ubuntu 8-20180414-1ubuntu2) 
      
      Change-Id: I18577590da46829c1ea7d8b82e41d69f105baa10
      14c6f8be
  25. Aug 13, 2018
    • Ivan Poddubny's avatar
      app_queue: set QUEUESTATUS to LEAVEEMPTY instead of CONTINUE · 2ce06109
      Ivan Poddubny authored
      When a call leaves a queue on leaveempty condition, QUEUESTATUS
      must be set to LEAVEEMPTY, no matter whether Queue was executed with or
      without the "c" (continue) option.
      
      The regression was introduced in the fix for ASTERISK_25665.
      The following fix (ASTERISK_27065) was incomplete, as QUEUESTATUS was
      overwritten in case when "c" is set, regardless of what was the cause
      for leaving the queue.
      
      ASTERISK-27973 #close
      Reported-by: Valentin Safonov
      
      Change-Id: Iec013fe6a26a4e825ca572a1dda4f3cee5f6f80c
      2ce06109
  26. Jul 18, 2018
  27. Jul 13, 2018
    • George Joseph's avatar
      app_confbridge: Use the SDP 'label' attribute to correlate users · 34f3fe95
      George Joseph authored
      Previously, the msid "label" attribute was used to correlate
      participant info but because streams could be reused, the msid
      wasn't being updated correctly when someone left the bridge and
      another joined.
      
      Now, instead of looking for the msid attribute on a channel's streams,
      app_confbridge sets an "SDP:LABEL" attribute on the stream which
      res_pjsip_sdp_rtp looks for.  If it finds it, it adds a "label"
      attribute to the current sdp.
      
      Change-Id: I6cbaa87fb59a2e0688d956e72d2d09e4ac20d5a5
      34f3fe95
  28. Jun 29, 2018
    • Robert Mordec's avatar
      app_confbridge: Bridge and announcers not removed if conference ends quickly · 9d3f3a4b
      Robert Mordec authored
      If a conference is ended very quickly after it was created (i.e., the
      first user immediately hangs up) then the conference bridge and announcer
      channels are not removed.
      
      When a conference is created, the push_announcer() function is added to
      the playback queue task processor and the conference object reference is
      bumped.  If a conference is ended while the push_announcer() function is
      still going then the ao2_cleanup(conference) at the end of
      push_announcer() will call the destructor function -
      destroy_conference_bridge().
      
      The destroy_conference_bridge() function will then add the
      hangup_playback() task to the playback queue and will wait for it to end.
      Since it is already a current task of the playback queue it will wait
      forever.
      
      This patch makes the conference thread call push_announcer() directly.
      This way the conference object reference bump is not needed.  Since the
      playback queue task processor is only used by the conference thread
      itself, there is no danger of trying to play announcements before the
      announcer is pushed to the bridge.
      
      ASTERISK-27870 #close
      
      Change-Id: I947a50fb121422d90fd1816d643a54d75185a477
      9d3f3a4b
  29. Jun 26, 2018
    • George Joseph's avatar
      app_confbridge: Move participant info code to confbridge_manager. · 5f12e2bd
      George Joseph authored
      With the participant info code in app_confbridge, we were still
      in the process of adding the channel to the bridge when trying to send
      an in-dialog MESSAGE.  This caused 2 threads to grab the channel
      blocking flag at the same time.  To mitigate this, the participant
      info code was moved to confbridge_manager so it runs after all
      channel/bridge actions have finished.
      
      Change-Id: I228806ac153074f45e0b35d5236166e92e132abd
      5f12e2bd
  30. Jun 21, 2018
    • Kristian F. Høgh's avatar
      app_queue: Add option for predial handlers on caller and callee channels · 184b375b
      Kristian F. Høgh authored
      Add predial handler support to app_queue.  app_dial (ASTERISK_19548) and
      app_originate (ASTERISK_26587) have the ability to execute predial
      handlers on caller and callee channels.  This patch adds predial handlers
      to app_queue and uses the same options as Dial and Originate (b and B).
      The caller routine gets executed when the caller first enters the queue.
      The callee routine gets executed for each queue member when they are about
      to be called.
      
      ASTERISK-27912
      
      Change-Id: I5acf5c32587ee008658d12e8a8049eb8fa4d0f24
      184b375b
  31. Jun 19, 2018
  32. Jun 15, 2018
    • Sam Wierema's avatar
      app_mp3: remove 10 seconds of silence after mp3 playback · 4c7ab734
      Sam Wierema authored
      This patch changes the way asterisk polls output from mpg123, instead
      of waiting for 10 seconds(when playing an http url) it now uses a
      timeout of one second and iterates 10 times using this same timeout.
      
      The main difference is that for every timeout asterisk receives it now
      checks if mpg123 is still running before poll again.
      
      ASTERISK-27752
      
      Change-Id: Ib7df8462e3e380cb328011890ad9270d9e9b4620
      4c7ab734
  33. Jun 13, 2018
    • George Joseph's avatar
      app_confbridge: Enable sending events to participants · e7a7506f
      George Joseph authored
      ConfBridge can now send events to participants via in-dialog MESSAGEs.
      All current Confbridge events are supported, such as ConfbridgeJoin,
      ConfbridgeLeave, etc.  In addition to those events, a new event
      ConfbridgeWelcome has been added that will send a list of all
      current participants to a new participant.
      
      For all but the ConfbridgeWelcome event, the JSON message contains
      information about the bridge, such as its id and name, and information
      about the channel that triggered the event such as channel name,
      callerid info, mute status, and the MSID labels for their audio and
      video tracks. You can use the labels to correlate callerid and mute
      status to specific video elements in a webrtc client.
      
      To control this behavior, the following options have been added to
      confbridge.conf:
      
      bridge_profile/enable_events:  This must be enabled on any bridge where
      events are desired.
      
      user_profile/send_events:  This must be set for a user profile to send
      events.  Different user profiles connected to the same bridge can have
      different settings.  This allows admins to get events but not normal
      users for instance.
      
      user_profile/echo_events:  In some cases, you might not want the user
      triggering the event to get the event sent back to them.  To prevent it,
      set this to false.
      
      A change was also made to res_pjsip_sdp_rtp to save the generated msid
      to the stream so it can be re-used.  This allows participant A's video
      stream to appear as the same label to all other participants.
      
      Change-Id: I26420aa9f101f0b2387dc9e2fd10733197f1318e
      e7a7506f
  34. Jun 04, 2018
    • George Joseph's avatar
      app_sendtext: Allow content types other than text/plain · 437ab418
      George Joseph authored
      There was no real reason to limit the conteny type to text/plain other
      than that's what it was limited to before.  Now any text/* content
      type will be allowed for channel drivers that don't support enhanced
      messaging and any type will be allowed for channel drivers that do
      support enhanced messaging.
      
      Change-Id: I94a90cfee98b4bc8e22aa5c0b6afb7b862f979d9
      437ab418
  35. Jun 01, 2018
    • William McCall's avatar
      app_confbridge: Add talking indicator for ConfBridgeList AMI response · a7f41212
      William McCall authored
      When an AMI client connects, it cannot determine if a user was talking
      prior to a transition in the user speaking state (which would generate
      a ConfbridgeTalking event). This patch causes app_confbridge to track the
      talking state and make this state available via ConfBridgeList.
      
      ASTERISK-27877 #close
      
      Change-Id: I19b5284f34966c3fda94f5b99a7e40e6b89767c6
      a7f41212
Loading