Skip to content
Snippets Groups Projects
  1. Jan 06, 2021
    • Kevin Harwell's avatar
      pbx_realtime: wrong type stored on publish of ast_channel_snapshot_type · d9aef0e6
      Kevin Harwell authored
      A prior patch segmented channel snapshots, and changed the underlying
      data object type associated with ast_channel_snapshot_type stasis
      messages. Prior to Asterisk 18 it was a type ast_channel_snapshot, but
      now it type ast_channel_snapshot_update.
      
      When publishing ast_channel_snapshot_type in pbx_realtime the
      ast_channel_snapshot was being passed in as the message data
      object. When a handler, expecting a data object type of
      ast_channel_snapshot_update, dereferenced this value a crash
      would occur.
      
      This patch makes it so pbx_realtime now uses the expected type, and
      channel snapshot publish method when publishing.
      
      ASTERISK-29168 #close
      
      Change-Id: I9a2cfa0ec285169317f4b9146e4027da8a4fe896
      d9aef0e6
  2. Nov 26, 2018
    • 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
  3. Nov 21, 2018
  4. Dec 22, 2017
  5. Feb 22, 2017
    • Sean Bright's avatar
      pbx_realtime: Prevent premature extension matching · 15ed7af0
      Sean Bright authored
      The patterns provided by pbx_realtime were checked in the order in
      which they were returned from the realtime backend. If there was
      overlap between multiple patterns, the first one to correctly match was
      chosen even though it may not have been the best match.
      
      We now sort the patterns descending by their length and compare in that
      order. There may be cases where this still results in a sub-optimal
      match, but this patch should improve the overall behavior.
      
      ASTERISK-18271 #close
      Reported by: Charlie Smurthwaite
      
      Change-Id: I56d9ac15810eb1775966b669c3028e32cc7bd809
      15ed7af0
  6. Feb 21, 2017
    • Sean Bright's avatar
      realtime: Fix ast_load_realtime_multientry handling · ab04a018
      Sean Bright authored
      ast_load_realtime_multientry() returns an ast_config structure whose
      ast_categorys are keyed with the empty strings. Several modules were
      giving semantic meaning to the category names causing problems at
      runtime.
      
      * app_directory: Treated the category name as the mailbox name, and
        would fail to direct calls to the appropriate extension after an
        entry was chosen.
      
      * app_queue: Queues, queue members, and queue rules were all affected
        and needed to be updated.
      
      * pbx_realtime: Pattern matching would never succeed because the
        extension entered by the user was always compared to the empty
        string.
      
      Change-Id: Ie7e44986344b0b76ea8f6ddb5879f5040c6ca8a7
      ab04a018
  7. Oct 27, 2016
    • Corey Farrell's avatar
      Remove ASTERISK_REGISTER_FILE. · a6e5bae3
      Corey Farrell authored
      ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
      all traces of it.
      
      Previously exported symbols removed:
      * __ast_register_file
      * __ast_unregister_file
      * ast_complete_source_filename
      
      This also removes the mtx_prof static variable that was declared when
      MTX_PROFILE was enabled.  This variable was only used in lock.c so it
      is now initialized in that file only.
      
      ASTERISK-26480 #close
      
      Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
      a6e5bae3
  8. Apr 13, 2015
    • Matt Jordan's avatar
      git migration: Refactor the ASTERISK_FILE_VERSION macro · 4a582616
      Matt Jordan authored
      Git does not support the ability to replace a token with a version
      string during check-in. While it does have support for replacing a
      token on clone, this is somewhat sub-optimal: the token is replaced
      with the object hash, which is not particularly easy for human
      consumption. What's more, in practice, the source file version was often
      not terribly useful. Generally, when triaging bugs, the overall version
      of Asterisk is far more useful than an individual SVN version of a file. As a
      result, this patch removes Asterisk's support for showing source file
      versions.
      
      Specifically, it does the following:
      
      * Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
        remove passing the version in with the macro. Other facilities
        than 'core show file version' make use of the file names, such as
        setting a debug level only on a specific file. As such, the act of
        registering source files with the Asterisk core still has use. The
        macro rename now reflects the new macro purpose.
      
      * main/asterisk:
        - Refactor the file_version structure to reflect that it no longer
          tracks a version field.
        - Remove the "core show file version" CLI command. Without the file
          version, it is no longer useful.
        - Remove the ast_file_version_find function. The file version is no
          longer tracked.
        - Rename ast_register_file_version/ast_unregister_file_version to
          ast_register_file/ast_unregister_file, respectively.
      
      * main/manager: Remove value from the Version key of the ModuleCheck
        Action. The actual key itself has not been removed, as doing so would
        absolutely constitute a backwards incompatible change. However, since
        the file version is no longer tracked, there is no need to attempt to
        include it in the Version key.
      
      * UPGRADE: Add notes for:
        - Modification to the ModuleCheck AMI Action
        - Removal of the "core show file version" CLI command
      
      Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
      4a582616
  9. Oct 13, 2014
    • George Joseph's avatar
      manager/config: Support templates and non-unique category names via AMI · c7e6b6ba
      George Joseph authored
      This patch provides the capability to manipulate templates and categories
      with non-unique names via AMI.
      
      Summary of changes:
      
      GetConfig and GetConfigJSON: Added "Filter" parameter:  A comma separated list
      of name_regex=value_regex expressions which will cause only categories whose
      variables match all expressions to be considered.  The special variable name
      TEMPLATES can be used to control whether templates are included.  Passing
      'include' as the value will include templates along with normal categories.
      Passing 'restrict' as the value will restrict the operation to ONLY templates.
      Not specifying a TEMPLATES expression results in the current default behavior
      which is to not include templates.
      
      UpdateConfig: NewCat now includes options for allowing duplicate category
      names, indicating if the category should be created as a template, and
      specifying templates the category should inherit from.  The rest of the
      actions now accept a filter string as defined above.  If there are non-unique
      category names, you can now update specific ones based on variable values.
      
      To facilitate the new capabilities in manager, corresponding changes had to be
      made to config, most notably the addition of filter criteria to many of the
      APIs.  In some cases it was easy to change the references to use the new
      prototype but others would have required touching too many files for this
      patch so a wrapper with the original prototype was created.  Macros couldn't
      be used in this case because it would break binary compatibility with modules
      such as res_digium_phone that are linked to real symbols.
      
      Tested-by: George Joseph
      
      Review: https://reviewboard.asterisk.org/r/4033/
      ........
      
      Merged revisions 425383 from http://svn.asterisk.org/svn/asterisk/branches/12
      ........
      
      Merged revisions 425384 from http://svn.asterisk.org/svn/asterisk/branches/13
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      c7e6b6ba
  10. Aug 06, 2014
  11. Jul 25, 2014
  12. Jul 04, 2014
    • Matthew Jordan's avatar
      Remove many deprecated modules · 97834718
      Matthew Jordan authored
      Billing records are fair,
      To get paid is quite bright,
      You should really use ODBC;
      Good-bye cdr_sqlite.
      
      Microsoft did once push H.323,
      Hell, we all remember NetMeeting.
      But try to compile chan_h323 now
      And you will take quite a beating.
      
      The XMPP and SIP war was fierce,
      And in the distant fray
      Was birthed res_jabber/chan_jingle;
      But neither to stay.
      
      For everyone did care and chase what Google professed.
      "Free Internet Calling" was what devotees cried,
      But Google did change the specs so often
      That the developers were happy the day chan_gtalk died.
      
      And then there was that odd application
      Dedicated to the Polish tongue.
      app_saycountpl was subsumed by Say;
      One could say its bell was rung.
      
      To read and parse a file from the dialplan
      You could (I guess) use an application.
      app_readfile did fill that purpose, but I think
      A function is perhaps better in its creation.
      
      Barging is rude, I'm not sure why we do it.
      Inwardly, the caller will probably sigh.
      But if you really must do it,
      Don't use app_dahdibarge, use ChanSpy.
      
      We all despise the sound of tinny robots
      It makes our queues so cold.
      To control such an abomination
      It's better to not use Wait/SetMusicOnHold.
      
      It's often nice to know properties of a channel
      It makes our calls right
      We have a nice function called CHANNEL
      And so SIPCHANINFO is sent off into the night.
      
      And now things get odd;
      Apparently one could delimit with a colon
      Properties from the SIPPEER function!
      Commas are in; all others are done.
      
      Finally, a word on pipes and commas.
      We're sorry. We can't say it enough.
      But those compatibility options in asterisk.conf;
      To maintain them forever was just too tough.
      
      This patch removes:
      
      * cdr_sqlite
      * chan_gtalk
      * chan_jingle
      * chan_h323
      * res_jabber
      * app_saycountpl
      * app_readfile
      * app_dahdibarge
      
      It removes the following applications/functions:
      
      * WaitMusicOnHold
      * SetMusicOnHold
      * SIPCHANINFO
      
      It removes the colon delimiter from the SIPPEER function.
      
      Finally, it also removes all compatibility options that were configurable from
      asterisk.conf, as these all applied to compatibility with Asterisk 1.4 systems.
      
      Review: https://reviewboard.asterisk.org/r/3698/
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@418019 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      97834718
  13. Dec 18, 2013
    • Kevin Harwell's avatar
      channel locking: Add locking for channel snapshot creation · 28c0cb28
      Kevin Harwell authored
      Original commit message by mmichelson (asterisk 12 r403311):
      
      "This adds channel locks around calls to create channel snapshots as well
      as other functions which operate on a channel and then end up
      creating a channel snapshot. Functions that expect the channel to be
      locked prior to being called have had their documentation updated to
      indicate such."
      
      The above was initially committed and then reverted at r403398.  The problem
      was found to be in core_local.c in the publish_local_bridge_message function.
      The ast_unreal_lock_all function locks and adds a reference to the returned
      channels and while they were being unlocked they were not being unreffed when
      no longer needed.  Fixed by unreffing the channels.
      
      Also in bridge.c a lock was obtained on "other->chan", but then an attempt was
      made to unlock "other" and not the previously locked channel.  Fixed by
      unlocking "other->chan"
      
      (closes issue ASTERISK-22709)
      Reported by: John Bigelow
      ........
      
      Merged revisions 404237 from http://svn.asterisk.org/svn/asterisk/branches/12
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      28c0cb28
  14. Dec 05, 2013
  15. Dec 03, 2013
  16. Apr 08, 2013
    • Matthew Jordan's avatar
      Add multi-channel Stasis messages; refactor Dial AMI events to Stasis · b8d4e573
      Matthew Jordan authored
      This patch does the following:
       * A new Stasis payload has been defined for multi-channel messages. This
         payload can store multiple ast_channel_snapshot objects along with a single
         JSON blob. The payload object itself is opaque; the snapshots are stored
         in a container keyed by roles. APIs have been provided to query for and
         retrieve the snapshots from the payload object.
       * The Dial AMI events have been refactored onto Stasis. This includes dial
         messages in app_dial, as well as the core dialing framework. The AMI events
         have been modified to send out a DialBegin/DialEnd events, as opposed to
         the subevent type that was previously used.
       * Stasis messages, types, and other objects related to channels have been
         placed in their own file, stasis_channels. Unit tests for some of these
         objects/messages have also been written.
      
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      b8d4e573
  17. Mar 28, 2013
  18. Mar 22, 2013
    • David M. Lee's avatar
      Move more channel events to Stasis; move res_json.c to main/json.c. · cf9324b2
      David M. Lee authored
      This patch started out simply as fixing the bouncing tests introduced
      in r382685, but required some other changes to give it a decent
      implementation.
      
      To fix the bouncing tests, the UserEvent and Newexten AMI events
      needed to be refactored to dispatch via Stasis. Dispatching directly
      to AMI resulted in those events sometimes getting ahead of the
      associated Newchannel events, which would understandably confuse anyone.
      
      I found that instead of creating a zillion different message types and
      structures associated with them, it would be preferable to define a
      message type that has a channel snapshot and a blob of structured data
      with a small bit of additional information. The JSON object model
      provides a very nice way of representing structured data, so I went
      with that.
      
       * Move JSON support from res_json.c to main/json.c
         * Made libjansson-dev a required dependency
       * Added an ast_channel_blob message type, which has a channel
         snapshot and JSON blob of data.
       * Changed UserEvent and Newexten events so that they are dispatched
         via ast_channel_blob messages on the channel's topic.
       * Got rid of the ast_channel_varset message; used ast_channel_blob
         instead.
       * Extracted the manager functions converting Stasis channel events to
         AMI events into manager_channel.c.
      
      (issue ASTERISK-21096)
      Review: https://reviewboard.asterisk.org/r/2381/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      cf9324b2
  19. Jul 31, 2012
  20. Apr 04, 2012
  21. Feb 20, 2012
  22. Feb 13, 2012
  23. Jan 24, 2012
  24. Jan 09, 2012
    • Terry Wilson's avatar
      Replace direct access to channel name with accessor functions · 04da92c3
      Terry Wilson authored
      There are many benefits to making the ast_channel an opaque handle, from
      increasing maintainability to presenting ways to kill masquerades. This patch
      kicks things off by taking things a field at a time, renaming the field to
      '__do_not_use_${fieldname}' and then writing setters/getters and converting the
      existing code to using them. When all fields are done, we can move ast_channel
      to a C file from channel.h and lop off the '__do_not_use_'.
      
      This patch sets up main/channel_interal_api.c to be the only file that actually
      accesses the ast_channel's fields directly. The intent would be for any API
      functions in channel.c to use the accessor functions. No more monkeying around
      with channel internals. We should use our own APIs.
      
      The interesting changes in this patch are the addition of
      channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to
      channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to
      use accessor functions when ast_channel is really opaque), and some re-working
      of the way channel iterators/callbacks are handled so as to avoid creating fake
      ast_channels on the stack to pass in matching data by directly accessing fields
      (since "name" is a stringfield and the fake channel doesn't init the
      stringfields, you can't use the ast_channel_name_set() function). I went with
      ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a
      setter.
      
      The majority of the grunt-work for this change was done by writing a semantic
      patch using Coccinelle ( http://coccinelle.lip6.fr/ ).
      
      Review: https://reviewboard.asterisk.org/r/1655/
      
      
      git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
      04da92c3
  25. Oct 17, 2011
  26. Jul 14, 2011
  27. Sep 02, 2010
  28. Aug 27, 2010
  29. May 27, 2010
  30. Jun 15, 2009
  31. Dec 15, 2008
  32. Nov 25, 2008
  33. Jul 09, 2008
  34. Jul 06, 2008
  35. Jul 05, 2008
  36. Jun 19, 2008
  37. Jun 03, 2008
  38. May 27, 2008
  39. May 22, 2008
Loading