Commit Graph

75 Commits

Author SHA1 Message Date
Naveen Albert a9223f210e db: Add AMI action to retrieve DB keys at prefix.
Adds the DBGetTree action, which can be used to
retrieve all of the DB keys beginning with a
particular prefix, similar to the capability
provided by the database show CLI command.

ASTERISK-30136 #close

Change-Id: I3be9425e53be71f24303fdd4d2923c14e84337e6
2022-07-20 13:02:12 -05:00
Naveen Albert bcc18ca9f5 general: Fix various typos.
ASTERISK-30089 #close

Change-Id: I1f5db911fd05a3a211c522c13e990fa1d0e62275
2022-07-12 07:46:03 -05:00
Naveen Albert 350ffcb02b db: Notify user if deleted DB entry didn't exist.
Currently, if using the CLI to delete a DB entry,
"Database entry removed" is always returned,
regardless of whether or not the entry actually
existed in the first place. This meant that users
were never told if entries did not exist.

The same issue occurs if trying to delete a DB key
using AMI.

To address this, new API is added that is more stringent
in deleting values from AstDB, which will not return
success if the value did not exist in the first place,
and will print out specific error details if available.

ASTERISK-30001 #close

Change-Id: Ic84e3eddcd66c7a6ed7fea91cdfd402568378b18
2022-07-01 10:15:57 -05:00
Sean Bright fc99ac8c9a db: Initialize condition primitive before use
The db_init() function ultimately calls db_sync() which signals the
condition before it is initialized.

Change-Id: Id4a4e025b637bc4ac7d90557fcb71d56598892ab
2019-12-27 17:32:22 -06:00
Richard Mudgett 467f7c6724 Fix 'statement' typo throughout code.
Most were in comments.  A couple were in warning messages.

Pointed out by Jonathan H on the Asterisk users mailing list.

Change-Id: I6286939dff5d0a27a2758140570106f1cb351855
2018-10-18 12:44:10 -05:00
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
Corey Farrell 1b80ffa495 Fix Common Typo's.
Fix instances of:
* Retreive
* Recieve
* other then
* different then
* Repeated words ("the the", "an an", "and and", etc).
* othterwise, teh

ASTERISK-24198 #close

Change-Id: I3809a9c113b92fd9d0d9f9bac98e9c66dc8b2d31
2017-12-20 12:40:01 -05:00
Sean Bright 9a9edc6c9e astdb: Improve prefix searches in astdb
Using the LIKE operator requires a full table scan of 'astdb', whereas a
comparison operation is able to use the primary key index.

This patch adds a new function to the AstDB API for quick prefix matches
and updates res_sorcery_astdb to utilize it. This showed substantial
performance improvement in my test environment.

Related to ASTERISK~26806, but does not completely resolve it.

Change-Id: I7d37f9ba2aea139dabf2ca72d31fbe34bd9b2fa1
2017-12-10 12:51:16 -06:00
Richard Mudgett ee08f10d06 Fix ast_(v)asprintf() malloc failure usage conditions.
When (v)asprintf() fails, the state of the allocated buffer is undefined.
The library had better not leave an allocated buffer as a result or no one
will know to free it.  The most likely way it can return failure is for an
allocation failure.  If the printf conversion fails then you actually have
a threading problem which is much worse because another thread modified
the parameter values.

* Made __ast_asprintf()/__ast_vasprintf() set the returned buffer to NULL
on failure.  That is much more useful than either an uninitialized pointer
or a pointer that has already been freed.  Many uses won't have to check
for failure to ensure that the buffer won't be double freed or prevent an
attempt to free an uninitialized pointer.

* stasis.c: Fixed memory leak in multi_object_blob_to_ami() allocated by
ast_asprintf().

* ari/resource_bridges.c:ari_bridges_play_helper(): Remove assignment to
the wrong thing which is now not needed even if assigning to the right
thing.

Change-Id: Ib5252fb8850ecf0f78ed0ee2ca0796bda7e91c23
2017-11-06 12:47:30 -05:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
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
2016-10-27 09:53:55 -04:00
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
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
2015-04-13 03:48:57 -04:00
Richard Mudgett c7ea108e02 Revert -r430452 It needs to be redone for the next major AMI version change instead.
ASTERISK-24049


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-12 18:09:27 +00:00
Richard Mudgett ef34a05f21 AMI: Remove no longer used parameter from astman_send_listack().
Follow-up issue to -r430435 from reviewboard review.

ASTERISK-24049
Review: https://reviewboard.asterisk.org/r/4315/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09 18:53:49 +00:00
Richard Mudgett 52a7cdb101 AMI: Make AMI actions that generate event lists consistent.
* Made the following AMI actions use list API calls for consistency:
Agents
BridgeInfo
BridgeList
BridgeTechnologyList
ConfbridgeLIst
ConfbridgeLIstRooms
CoreShowChannels
DAHDIShowChannels
DBGet
DeviceStateList
ExtensionStateList
FAXSessions
Hangup
IAXpeerlist
IAXpeers
IAXregistry
MeetmeList
MeetmeListRooms
MWIGet
ParkedCalls
Parkinglots
PJSIPShowEndpoint
PJSIPShowEndpoints
PJSIPShowRegistrationsInbound
PJSIPShowRegistrationsOutbound
PJSIPShowResourceLists
PJSIPShowSubscriptionsInbound
PJSIPShowSubscriptionsOutbound
PresenceStateList
PRIShowSpans
QueueStatus
QueueSummary
ShowDialPlan
SIPpeers
SIPpeerstatus
SIPshowregistry
SKINNYdevices
SKINNYlines
Status
VoicemailUsersList

* Incremented the AMI version to 2.7.0.

* Changed astman_send_listack() to not use the listflag parameter and
always set the value to "Start" so the start capitalization is consistent.
i.e., The FAXSessions used "Start" while the rest of the system used
"start".  The corresponding complete event always used "Complete".

* Fixed ami_show_resource_lists() "PJSIPShowResourceLists" to output the
AMI ActionID for all of its list events.

* Fixed off-nominal AMI protocol error in manager_bridge_info(),
manager_parking_status_single_lot(), and
manager_parking_status_all_lots().  Use of astman_send_error() after
responding to the original AMI action request violates the action response
pattern by sending two responses.

* Fixed minor protocol error in action_getconfig() when no requested
categories are found.  Each line needs to be formatted as "Header: text".

* Fixed off-nominal memory leak in manager_build_parked_call_string().

* Eliminated unnecessary use of RAII_VAR() in ami_subscription_detail().

ASTERISK-24049 #close
Reported by: Jonathan Rose

Review: https://reviewboard.asterisk.org/r/4315/
........

Merged revisions 430434 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-01-09 18:16:54 +00:00
Michael L. Young 7059b001ad core/db: Revert Patch Added In Attempt To Improve I/O Performance
Reverting the patch since it was causing a regression and after fixing the
regression, there were no performance gains.  At least based on my method
for measurement.

ASTERISK-24050

Review: https://reviewboard.asterisk.org/r/3841/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-24 21:01:37 +00:00
Michael L. Young b4a681684d core/db: Improve I/O When Updating Rows
When updating a row, we are currently doing an INSERT OR REPLACE INTO.  The
downside to this is that the row is deleted if it exists and then a new row is
inserted.  So, we are hitting the disk twice.  One for the deletion and one for
the insertion.

This patch changes this statement to an INSERT INTO and if the insert fails
because a row with that key exists, we will IGNORE the failure.  Then we will
attempt to perform an UPDATE on the existing row if that row wasn't just
INSERTed.

ASTERISK-24050 #close
Reported by: Michael L. Young
patches:
  astdb-insert-update-io-help_trunk_v2.diff
                                     uploaded by Michael L. Young (license 5026)

Review: https://reviewboard.asterisk.org/r/3815/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-07-22 18:56:00 +00:00
Igor Goncharovskiy a1e0a5e4b0 We have faced situation when using CDR and CEL by sqlite3 modules. With system having high load (~100 concurrent calls created by sipp) we found many cdr and cel records missed. There is special finction in sqlite3, that make able to fix this situation - sqlite3_wait_timeout, that also can replace awful code cdr_sqlite3 ad cel_sqlite3 modules. Also this function can be used for aastdb and res_config_sqlite3 to avoid missed writes to sqlite db.
#ASTERISK-23766 #close
Reported by: Igor Goncharovsky

Review: https://reviewboard.asterisk.org/r/3559/
........

Merged revisions 416336 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 416337 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 416338 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@416339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-06-16 09:04:05 +00:00
Mark Michelson 510a6e6e64 Remove an extra ast_cond_wait() that slipped through the patch.
........

Merged revisions 410606 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 410607 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 20:55:06 +00:00
Mark Michelson c1e9d2f177 Prevent delayed astdb syncs.
The syncing thread sleeps for a second before waiting to be
told to attempt to sync again. If a signal were sent during this
sleeping period, we would end up having to wait until the next
sync signal occurred in order to sync up the astdb.

This code rearrangement also ensures that any pending transactions
will be synced prior to Asterisk shutting down.

Patches: db_sync.patch by John Hardin (License #6512)
........

Merged revisions 410556 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 410559 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-14 16:19:21 +00:00
Scott Griepentrog 2882c5f9f1 astdb: crash in sqlite3 during shutdown
When Asterisk is shut down, the astdb_atexit() function releases
(finalize) the previously initiated (prepared) SQL statements in
sqlite3.  Another thread making a subsequent request can cause a
crash in sqlite3.  This patch eliminates that issue by resetting
the statement pointer after it is released/cleared.  The sqlite3
code detects the null pointer, and aborts the operation cleanly.

(closes issue AST-1265)
Reported by: Alexander Hömig
(closes issue ASTERISK-22350)
Reported by: Birger "WIMPy" Harzenetter
Review: https://reviewboard.asterisk.org/r/3078/
........

Merged revisions 404344 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 404345 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-19 16:33:09 +00:00
Richard Mudgett e47d3db365 Doxygen comment tweaks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-16 17:33:21 +00:00
Matthew Jordan a243f4f153 Properly finalize prepared SQLite3 statements to prevent memory leak
The AstDB uses prepared SQLite3 statements to retrieve data from the SQLite3
database.  These statements should be finalized during Asterisk shutdown so
that the SQLite3 database can be properly closed.  Failure to finalize the
statements results in a memory leak and a failure when closing the database.

This patch fixes those issues by ensuring that all prepared statements are
properly finalized at shutdown.

(closes issue ASTERISK-20647)
Reported by: Corey Farrell
patches:
  astdb-sqlite3_close.patch uploaded by Corey Farrell (license 5909)
........

Merged revisions 375761 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 375763 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-04 01:19:43 +00:00
David M. Lee c5acf22cec Fix DBDelTree error codes for AMI, CLI and AGI
The AMI DBDelTree command will return Success/Key tree deleted successfully even
if the given key does not exist. The CLI command 'database deltree' had a
similar problem, but was saved because it actually responded with '0 database
entries removed'. AGI had a slightly different error, where it would return
success if the database was unavailable.

This came from confusion about the ast_db_deltree retval, which is -1 in the
event of a database error, or number of entries deleted (including 0 for
deleting nothing).

* Changed some poorly named res variables to num_deleted
* Specified specific errors when calling ast_db_deltree (database unavailable
  vs. entry not found vs. success)
* Fixed similar bug in AGI database deltree, where 'Database unavailable'
  results in successful result

(closes issue AST-967)
Reported by: John Bigelow
Review: https://reviewboard.asterisk.org/r/2138/
........

Merged revisions 374426 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374427 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374428 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-04 15:48:24 +00:00
Matthew Jordan a094707d51 Fix a variety of ref counting issues
This patch resolves a number of ref leaks that occur primarily on Asterisk
shutdown.  It adds a variety of shutdown routines to core portions of
Asterisk such that they can reclaim resources allocate duringd initialization.

Review: https://reviewboard.asterisk.org/r/2137
........

Merged revisions 374177 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374178 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374196 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-02 01:47:16 +00:00
Sean Bright b9eeff1521 app_queue: Support persisting and loading of long member lists.
Greenlight in #asterisk brought up that he was receiving an error message "Could
not create persistent member string, out of space" when running app_queue in
Asterisk 10.  dump_queue_members() made an assumption that 8K would be enough to
store the generated string, but with queues that have large member lists this is
not always the case.  This patch removes the limitation and uses ast_str instead
of a fixed sized buffer.

The complicating factor comes from the fact that ast_db_get requires a buffer
and buffer size argument, which doesn't let us pull back more than what we pass
in, so I introduced a new ast_db_get_allocated() which returns an ast_strdup()'d
copy of the value from astdb.

As an aside, I did some testing on the maximum size of data that we can store in
the BDB library we distribute and was able to store a 10MB string and retrieve
it with no problems, so I feel this is a safe patch.

Review: https://reviewboard.asterisk.org/r/2136/
........

Merged revisions 374108 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 374135 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374150 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 20:36:25 +00:00
Sean Bright b3c739a842 Use ast_copy_string instead of strncpy to guarantee a NUL terminated string.
........

Merged revisions 374132 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 374133 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 17:28:41 +00:00
Kinsey Moore 9b16c8b0f6 Clean up and ensure proper usage of alloca()
This replaces all calls to alloca() with ast_alloca() which calls gcc's
__builtin_alloca() to avoid BSD semantics and removes all NULL checks
on memory allocated via ast_alloca() and ast_strdupa().

(closes issue ASTERISK-20125)
Review: https://reviewboard.asterisk.org/r/2032/
Patch-by: Walter Doekes (wdoekes)
........

Merged revisions 370642 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 370643 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31 20:21:43 +00:00
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Richard Mudgett 334f13d8b8 Allow AMI action callback to be reentrant.
Fix AMI module reload deadlock regression from ASTERISK-18479 when it
tried to fix the race between calling an AMI action callback and
unregistering that action.  Refixes ASTERISK-13784 broken by
ASTERISK-17785 change.

Locking the ao2 object guaranteed that there were no active callbacks that
mattered when ast_manager_unregister() was called.  Unfortunately, this
causes the deadlock situation.  The patch stops locking the ao2 object to
allow multiple threads to invoke the callback re-entrantly.  There is no
way to guarantee a module unload will not crash because of an active
callback.  The code attempts to minimize the chance with the registered
flag and the maximum 5 second delay before ast_manager_unregister()
returns.

The trunk version of the patch changes the API to fix the race condition
correctly to prevent the module code from unloading from memory while an
action callback is active.

* Don't hold the lock while calling the AMI action callback.

(closes issue ASTERISK-19487)
Reported by: Philippe Lindheimer

Review: https://reviewboard.asterisk.org/r/1818/
Review: https://reviewboard.asterisk.org/r/1820/
........

Merged revisions 359979 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 359980 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-20 17:31:28 +00:00
Sean Bright 409751e2dc Sort the output of 'database showkey' as well.
You can pass wildcards (%) to the database CLI commands, so this will sort the
returned list of matches.
........

Merged revisions 350978 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 17:12:36 +00:00
Sean Bright 382d14a214 Sort the output of 'database show' by key.
This more closely mimics the behavior of 'database show' before the conversion
to sqlite3.
........

Merged revisions 350938 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 14:31:37 +00:00
Walter Doekes a2a3b3ee4b Fix shutdown handling of sqlite3 astdb.
If a db_sync was scheduled just before shutdown, the atexit code calling
db_sync would have no effect, causing the astdb commit thread to stay
alive. This caused the SIP/realtime_sipregs test to fail. (The fallback
kill would run the atexit code again and that would wreak havoc.) This
fixes that the atexit kill condition is picked up properly.

(closes issue ASTERISK-18883)
Reviewed by: Terry Wilson

Review: https://reviewboard.asterisk.org/r/1659
........

Merged revisions 350180 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 19:37:23 +00:00
Terry Wilson 980ab2d018 Add ASTSBINDIR to the list of configurable paths
This patch also makes astdb2sqlite3 and astcanary use the configured
directory instead of relying on $PATH.

(closes issue ASTERISK-18959)
Review: https://reviewboard.asterisk.org/r/1613/
........

Merged revisions 347344 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347345 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-07 20:15:29 +00:00
Tilghman Lesher 6e7359f594 Update the documentation to better clarify how the existing commands work.
Review: https://reviewboard.asterisk.org/r/1593/
........

Merged revisions 345682 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 345683 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-19 15:11:45 +00:00
Tilghman Lesher 6b8b13ec2d Fix a change in behavior in 'database show' from 1.8.
In 1.8 and previous versions, one could use any fullword portion of the key
name, including the full key, to obtain the record.  Until this patch, this
did not work for the full key.

Closes issue ASTERISK-18886

Patch: by tilghman
Review: by twilson (http://pastebin.com/7rtu6bpk) on #asterisk-dev
........

Merged revisions 345640 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-18 22:20:47 +00:00
Terry Wilson 15fd1e375c Return error when no rows are deleted for AMI DBDelTree
(closes issue AST-654)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-10 23:10:11 +00:00
Terry Wilson cf8db24132 Merged revisions 340222 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r340222 | twilson | 2011-10-10 15:55:39 -0700 (Mon, 10 Oct 2011) | 8 lines
  
  On astdb conversion, also warn about permissions requirements
  
  The user running Asterisk must have permission to the directory
  the Asterisk database resides in since SQLite 3 needs to be able
  to create a journal file.
  
  (closes issue ASTERISK-18174)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-10 22:58:10 +00:00
Terry Wilson f0c8b18c18 Use older functions out of deference to older distros
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-07 16:50:54 +00:00
Terry Wilson efd040cd11 Replace Berkeley DB with SQLite 3
There were some bugs in the very ancient version of Berkeley DB that Asterisk
used. Instead of spending the time tracking down the bugs in the Berkeley code
we move to the much better documented SQLite 3.

Conversion of the old astdb happens at runtime by running the included
astdb2sqlite3 utility. The ast_db API with SQLite 3 backend should behave
identically to the old Berkeley backend, but in the future we could offer a
much more robust interface.

We do not include the SQLite 3 library in the source tree, but instead rely
upon the distribution-provided libraries. SQLite is so ubiquitous that this
should not place undue burden on administrators.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-06 20:58:12 +00:00
Terry Wilson 58ca560291 Merged revisions 322981 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r322981 | twilson | 2011-06-10 08:29:00 -0700 (Fri, 10 Jun 2011) | 11 lines
  
  Avoid a DB1 infinite loop bug
  
  Explicity check the last entry in the DB and make sure that we don't iterate
  past it. Since there can be no duplicates, this just makes sure that we stop
  after matching the last key.
  
  This patch also refactors the code to get away from some code duplication. A
  previous patch added many astdb tests and this patch passed them.
  
  Review: https://reviewboard.asterisk.org/r/1259/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@322982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-10 15:30:50 +00:00
Russell Bryant f13654961a Merged revisions 286112 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r286112 | russell | 2010-09-10 15:31:58 -0500 (Fri, 10 Sep 2010) | 9 lines
  
  Rate limit calls to fsync() to 1 per second after astdb updates.
  
  Astdb was determined to be one of the most significant bottlenecks in SIP
  registration processing.  This patch improved the speed of an astdb load
  test by 50000% (yes, Fifty-Thousand Percent).  On this particular load test
  setup, this doubled the number of SIP registrations the server could handle.
  
  Review: https://reviewboard.asterisk.org/r/825/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@286498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-13 22:13:27 +00:00
Tilghman Lesher d66b4616f0 Add DBGetComplete event after a DBGetResponse.
(closes issue #16965)
 Reported by: rrb3942
 Patches: 
       DBGetComplete.patch uploaded by rrb3942 (license 1003)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269938 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-11 18:17:28 +00:00
Kevin P. Fleming 82fb56886e More 'static' qualifiers on module global variables.
The 'pglobal' tool is quite handy indeed :-)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 17:34:30 +00:00
Eliel C. Sardanons 2c882626a0 Implement a new element in AstXML for AMI actions documentation.
A new xml element was created to manage the AMI actions documentation,
using AstXML.
To register a manager action using XML documentation it is now possible
using ast_manager_register_xml().
The CLI command 'manager show command' can be used to show the parsed
documentation.

Example manager xml documentation:
<manager name="ami action name" language="en_US">
    <synopsis>
        AMI action synopsis.
    </synopsis>
    <syntax>
        <xi:include xpointer="xpointer(...)" /> <-- for ActionID
        <parameter name="header1" required="true">
	    <para>Description</para>
	</parameter>
	...
    </syntax>
    <description>
        <para>AMI action description</para>
    </description>
    <see-also>
    	...
    </see-also>
</manager>



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22 17:52:35 +00:00
Tilghman Lesher 3e22e8bc94 Merged revisions 182449 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r182449 | tilghman | 2009-03-17 00:50:52 -0500 (Tue, 17 Mar 2009) | 7 lines
  
  Fix race in astdb
  The underlying db1 implementation does not fully isolate the pages retrieved
  from astdb, so the lock protecting accesses needs to be extended until the
  copy from the shared memory structure is done.
  (closes issue #14682)
   Reported by: makoto
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-17 05:51:54 +00:00
Mark Michelson 483c555c41 Merged revisions 167299 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r167299 | mmichelson | 2009-01-06 15:35:57 -0600 (Tue, 06 Jan 2009) | 8 lines

Use the correct variable when creating the format string

(closes issue #14177)
Reported by: nic_bellamy
Patches:
      asterisk-trunk-svn-r167242-ast_db_gettree.patch uploaded by nic (license 299)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@167301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-06 21:36:44 +00:00
Eliel C. Sardanons 1e8e12efcf Janitor, use ARRAY_LEN() when possible.
(closes issue #13990)
Reported by: eliel
Patches:
      array_len.diff uploaded by eliel (license 64)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161218 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 10:31:25 +00:00
Tilghman Lesher 857e3412f4 Several manager changes:
1) Add the Dialplan class, for NewExten and VarSet events, which should cut
down on the volume of traffic in the Call class.
2) Permit some commands to be run from multiple classes, such as allowing
DBGet to be run from either the System or the Reporting class.
3) Heavily document each class in the sample config, as there were several
that made no sense to be in the write= line, and two that made no sense to be
in the read= line (since they controlled no permissions there).

(Closes issue #10386)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 00:12:35 +00:00
Luigi Rizzo fd88390af7 remove unnecessary (char *) casts for ast_config_AST_* variables.
There are some left in the .flex files, left to the maintainer...



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-18 09:46:18 +00:00
Luigi Rizzo e0ff5fef5c remove a bunch of useless #include "options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:09:02 +00:00