Commit Graph

644 Commits

Author SHA1 Message Date
Scott Griepentrog 80ef9a21b9 uniqueid: channel linkedid, ami, ari object creation with id's
Much needed was a way to assign id to objects on creation, and
much change was necessary to accomplish it.  Channel uniqueids
and linkedids are split into separate string and creation time
components without breaking linkedid propgation.  This allowed
the uniqueid to be specified by the user interface - and those
values are now carried through to channel creation, adding the
assignedids value to every function in the chain including the
channel drivers. For local channels, the second channel can be
specified or left to default to a ;2 suffix of first.  In ARI,
bridge, playback, and snoop objects can also be created with a
specified uniqueid.

Along the way, the args order to allocating channels was fixed
in chan_mgcp and chan_gtalk, and linkedid is no longer lost as
masquerade occurs.

(closes issue ASTERISK-23120)
Review: https://reviewboard.asterisk.org/r/3191/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-07 15:47:55 +00:00
Corey Farrell e468e73b9e Remove extra defines of AST_PBX_MAX_STACK.
* Ensure AST_PBX_MAX_STACK is only defined in extconf.h and pbx.h.
* Fix incorrect function parameters in utils/extconf.c.

(closes issue ASTERISK-23141)
Reported by: Maxim
Review: https://reviewboard.asterisk.org/r/3241/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408788 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-22 02:31:04 +00:00
Matthew Jordan 438a7abc27 pbx: Handle a completely empty dialplan during a context merge
It is highly unlikely, but - at least in Asterisk 12 - theoretically possible
to load Asterisk with no dialplan whatsoever. If that occurs, and some other
module (that is not a pbx module) attempts to merge its contexts into the
dialplan, the existing merge routine will crash. This is because it is not
insane, and rightly believes that you provided some sort of dialplan,
somewhere.

This patch will gracefully merge the contexts in such a case. Note that this
is highly unlikely to occur in 1.8/11, as features will most likely provide
some dialplan via parking. However, in Asterisk 12, parking is now provided
by res_parking, and hence may create its dialplan later.

(closes issue ASTERISK-23297)
Reported by: CJ Oster

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-16 03:25:15 +00:00
Matthew Jordan 66c46fba24 CDRs: fix a variety of dial status problems, h/hangup handler creating CDRs
This patch fixes a number of small-ish problems that were noticed when
witnessing the records that the FreePBX dialplan produces:
(1) Mid-call events (as well as privacy options) have the ability to change the
    overall state of the Dial operation after the called party answers. This
    means that publishing the DialEnd event when the called party is premature;
    we have to wait for the execution of these subroutines to complete before
    we can signal the overall status of the DialEnd. This patch moves that
    publication and adds handlers for the mid-call events.
(2) The AST_FLAG_OUTGOING channel flag is cleared if an after bridge goto
    datastore is detected. This flag was preventing CDRs from being recorded
    for all outbound channels that had a 'continue' option enabled on them by
    the Dial application.
(3) The CDR engine now locks the 'Dial' application as being the CDR
    application if it detects that the current CDR has entered that app. This
    is similar to the logic that is done for Parking. In general, if we entered
    into Dial, then we want that CDR to record the application as such - this
    prevents pre-dial handlers, mid-call handlers, and other shenaniganry
    from changing the application value.
(4) The CDR engine now checks for the AST_SOFTHANGUP_HANGUP_EXEC in more places
    to determine if the channel is in hangup logic or dead. In either case, we
    don't want to record changes in the channel.
(5) The default option for "endbeforehexten" has been changed to "yes". In
    general, you don't want to see CDRs in the 'h' exten or in hangup logic.
    Since the semantics of that option changed in 12, it made sense to update
    the default value as well.
(6) Finally, because we now have the ability to synchronize on the messages
    published to the CDR topic, on shutdown the CDR engine will now synchronize
    to the messages currently in flight. This helps to ensure that all
    in-flight CDRs are written before shutting down.

(closes issue ASTERISK-23164)
Reported by: Matt Jordan

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-31 23:40:51 +00:00
Scott Griepentrog 64e2e1d5d8 pbx.c: Pre-initialize timezone to avoid crash on destroy
In ast_build_timing, initialize the timezone value to NULL
in order to avoid deferencing an uninitialized value later
when calling ast_destroy_timing.  The timezone value could
be uninitialized if ast_build_timing were to fail due to a
zero length time string.

(closes issue ASTERISK-22861)
Reported by: Sebastian Murray-Roberts
Review: https://reviewboard.asterisk.org/r/3134/
Patches:
     ast_build_timing-initialize-timezone.patch uploaded by coreyfarrell (license 5909)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@406269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-22 22:24:39 +00:00
Richard Mudgett 828f339a9c verbosity: Fix performance of console verbose messages.
The per console verbose level feature as previously implemented caused a
large performance penalty.  The fix required some minor incompatibilities
if the new rasterisk is used to connect to an earlier version.  If the new
rasterisk connects to an older Asterisk version then the root console
verbose level is always affected by the "core set verbose" command of the
remote console even though it may appear to only affect the current
console.  If an older version of rasterisk connects to the new version
then the "core set verbose" command will have no effect.

* Fixed the verbose performance by not generating a verbose message if
nothing is going to use it and then filtered any generated verbose
messages before actually sending them to the remote consoles.

* Split the "core set debug" and "core set verbose" CLI commands to remove
the per module verbose support that cannot work with the per console
verbose level.

* Added a silent option to the "core set verbose" command.

* Fixed "core set debug off" tab completion.

* Made "core show settings" list the current console verbosity in addition
to the root console verbosity.

* Changed the default verbose level of the 'verbose' setting in the
logger.conf [logfiles] section.  The default is now to once again follow
the current root console level.  As a result, using the AMI Command action
with "core set verbose" could again set the root console verbose level and
affect the verbose level logged.

(closes issue AST-1252)
Reported by: Guenther Kelleter

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-14 18:14:02 +00:00
Matthew Jordan 7e9febbf86 app_cdr,app_forkcdr,func_cdr: Synchronize with engine when manipulating state
When doing the rework of the CDR engine that pushed all of the logic into cdr.c
and made it respond to changes in channel state over Stasis, we knew that
accessing the CDR engine from the dialplan would be "slightly"
non-deterministic. Dialplan threads would be accessing CDRs while Stasis
threads would be updating the state of said CDRs - whereas in the past,
everything happened on the dialplan threads. Tests have shown that "slightly"
is in reality "very".

This patch synchronizes things by making the dialplan applications/functions
that manipulate CDRs do so over Stasis. ForkCDR, NoCDR, ResetCDR, CDR, and
CDR_PROP now all use Stasis to send their requests over to the CDR engine,
and synchronize on the channel Stasis topic via a subscription so that they
return their values/control to the dialplan at the appropriate time.

While going through this, the following changes were also made:
 * DISA, which can reset the CDR when a user successfully authenticates, now
   just uses the ResetCDR app to do this. This prevents having to duplicate
   the same Stasis synchronization logic in that application.
 * Answer no longer disables CDRs. It actually didn't work anyway - calling
   DISABLE on the channel's CDR doesn't stop the CDR from getting the Answer
   time - it just kills all CDRs on that channel, which isn't what the caller
   would intend.

(closes issue ASTERISK-22884)
(closes issue ASTERISK-22886)

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-19 00:50:01 +00:00
Kevin Harwell 28c0cb28d0 channel locking: Add locking for channel snapshot creation
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
2013-12-18 20:33:37 +00:00
Joshua Colp e2630fcd51 channels: Return allocated channels locked.
This change makes ast_channel_alloc return allocated channels
locked. By doing so no other thread can acquire, lock, and manipulate
the channel before it is completely set up.

(closes issue AST-1256)

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404210 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-18 19:28:05 +00:00
David M. Lee 744556c01d security: Inhibit execution of privilege escalating functions
This patch allows individual dialplan functions to be marked as
'dangerous', to inhibit their execution from external sources.

A 'dangerous' function is one which results in a privilege escalation.
For example, if one were to read the channel variable SHELL(rm -rf /)
Bad Things(TM) could happen; even if the external source has only read
permissions.

Execution from external sources may be enabled by setting
'live_dangerously' to 'yes' in the [options] section of asterisk.conf.
Although doing so is not recommended.

Also, the ABI was changed to something more reasonable, since Asterisk
12 does not yet have a public release.

(closes issue ASTERISK-22905)
Review: http://reviewboard.digium.internal/r/432/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403960 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-16 19:11:51 +00:00
Scott Griepentrog 102d448486 pbx.c: put copy of ast_exten.data on stack to prevent memory corruption
During dialplan execution in pbx_extension_helper(), the contexts global
read lock prevents link list corruption, but was released with a pointer
to the ast_exten and data later used in variable substitution.  Instead,
this patch removes pbx_substitute_variables() and locates a copy of the
ast_exten data on the stack before releasing the lock, where ast_exten
could get free'd by another thread performing a module reload.

(issue AST-1179)
Reported by: Thomas Arimont
(issue AST-1246)
Reported by: Alexander Hömig
Review: https://reviewboard.asterisk.org/r/3055/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403865 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-16 16:12:44 +00:00
David M. Lee 1212906351 Reverting r403311. It's causing ARI tests to hang.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-05 22:10:20 +00:00
Mark Michelson 8e8b329e14 Add channel locking for channel snapshot creation.
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.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-03 17:07:29 +00:00
Jonathan Rose ad0e70ba83 Say: If SAY_DTMF_INTERRUPT is set to an ast_true value, jump on DTMF
Similar to how background works, if a say application is called with
this variable set to 'true', 'yes', 'on', etc. then using DTMF while
the say action is in progress will result in the channel jumping to
that extension in the dialplan.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-11-14 20:32:45 +00:00
Matthew Jordan 076b29dd5b Remove some spammy debug messages; improve clarity of others
Debug messages aren't free. Even when the debug level is sufficiently low such
that the messages are never evaluated, there is a cost to having to parse
Asterisk logs that contain debug messages that (a) fail to convey sufficient
information or (b) occur so frequently as to be next to meaningless. Based on
having to stare at lots of DEBUG messages, this patch makes the following
changes:

* channel.c: When copying variables from a parent channel to a child channel,
  specify the channels involved. Do not log anything for a variable that is not
  inherited; the fact that it doesn't have an _ or __ already signifies that it
  won't be inherited.
* pbx.c: Specify what function evaluation has occurred that created the result.
* translate.c: Bump up the translator path messages to 10. I've never once had
  to use these debug messages, and for each format that is registered (on
  startup) and unregistered (on shutdown) the entire f^2 matrix is logged out.
  For short tests in the Asterisk Test Suite, this should make finding the
  actual test much easier.
* xmldoc.c: The debug message that 'blah' is not found in the tree is expected.
  Often, description elements - which are not required - are not provided.
  This debug message adds no additional value, as it is not indicative of an
  error or helpful in debugging which element did not contain a 'blah' element
  as a child. If an element is supposed to contain a child element, then that
  XML tree should have failed validation in the first place.

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-29 12:57:35 +00:00
Scott Griepentrog 7b42a6828a pbx.c: fix confused match caller id that deleted exten still in hash
This fixes a bug where a zero length callerid match adjacent to a no
match callerid extension entry would be deleted together, which then
resulted in hashtable references to free'd memory.  A third state of
the matchcid value has been added to indicate match to any extension
which allows enforcing comparison of matchcid on/off without errors.

(closes issue AST-1235)
Reported by: Guenther Kelleter
Review: https://reviewboard.asterisk.org/r/2930/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-25 20:51:13 +00:00
Joshua Colp d183c6e134 Return a channel snapshot when originating using ARI, and subscribe the Stasis application to it.
This change allows a user of ARI to know what channel it has originated and also follow any
progress. If a Stasis application is provided it will be automatically subscribed to the
originated channel immediately.

(closes issue ASTERISK-22485)
Reported by: David Lee

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-19 14:45:14 +00:00
Richard Mudgett be62f83d54 Originate: Make setting caller id on outgoing call use either name or number.
Previous code was requiring both name and number to be available.

Also restored a comment block on why caller id is also set on an outgoing
call leg in addition to connected line from earlier versions of Asterisk.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 20:31:02 +00:00
Joshua Colp c1235f2639 Reduce channel snapshot creation and publishing by up to 50%.
This change introduces the ability to stage channel snapshot
creation and publishing by suppressing the implicit creation
and publishing that some functions have. Once all operations
are executed the staging is marked as done and a single snapshot
is created and published.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-02 16:23:34 +00:00
David M. Lee 2de42c2a25 Multiple revisions 399887,400138,400178,400180-400181
........
  r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line
  
  Minor performance bump by not allocate manager variable struct if we don't need it
........
  r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines
  
  Stasis performance improvements
  
  This patch addresses several performance problems that were found in
  the initial performance testing of Asterisk 12.
  
  The Stasis dispatch object was allocated as an AO2 object, even though
  it has a very confined lifecycle. This was replaced with a straight
  ast_malloc().
  
  The Stasis message router was spending an inordinate amount of time
  searching hash tables. In this case, most of our routers had 6 or
  fewer routes in them to begin with. This was replaced with an array
  that's searched linearly for the route.
  
  We more heavily rely on AO2 objects in Asterisk 12, and the memset()
  in ao2_ref() actually became noticeable on the profile. This was
  #ifdef'ed to only run when AO2_DEBUG was enabled.
  
  After being misled by an erroneous comment in taskprocessor.c during
  profiling, the wrong comment was removed.
  
  Review: https://reviewboard.asterisk.org/r/2873/
........
  r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines
  
  Taskprocessor optimization; switch Stasis to use taskprocessors
  
  This patch optimizes taskprocessor to use a semaphore for signaling,
  which the OS can do a better job at managing contention and waiting
  that we can with a mutex and condition.
  
  The taskprocessor execution was also slightly optimized to reduce the
  number of locks taken.
  
  The only observable difference in the taskprocessor implementation is
  that when the final reference to the taskprocessor goes away, it will
  execute all tasks to completion instead of discarding the unexecuted
  tasks.
  
  For systems where unnamed semaphores are not supported, a really
  simple semaphore implementation is provided. (Which gives identical
  performance as the original taskprocessor implementation).
  
  The way we ended up implementing Stasis caused the threadpool to be a
  burden instead of a boost to performance. This was switched to just
  use taskprocessors directly for subscriptions.
  
  Review: https://reviewboard.asterisk.org/r/2881/
........
  r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines
  
  Optimize how Stasis forwards are dispatched
  
  This patch optimizes how forwards are dispatched in Stasis.
  
  Originally, forwards were dispatched as subscriptions that are invoked
  on the publishing thread. This did not account for the vast number of
  forwards we would end up having in the system, and the amount of work it
  would take to walk though the forward subscriptions.
  
  This patch modifies Stasis so that rather than walking the tree of
  forwards on every dispatch, when forwards and subscriptions are changed,
  the subscriber list for every topic in the tree is changed.
  
  This has a couple of benefits. First, this reduces the workload of
  dispatching messages. It also reduces contention when dispatching to
  different topics that happen to forward to the same aggregation topic
  (as happens with all of the channel, bridge and endpoint topics).
  
  Since forwards are no longer subscriptions, the bulk of this patch is
  simply changing stasis_subscription objects to stasis_forward objects
  (which, admittedly, I should have done in the first place.)
  
  Since this required me to yet again put in a growing array, I finally
  abstracted that out into a set of ast_vector macros in
  asterisk/vector.h.
  
  Review: https://reviewboard.asterisk.org/r/2883/
........
  r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines
  
  Remove dispatch object allocation from Stasis publishing
  
  While looking for areas for performance improvement, I realized that an
  unused feature in Stasis was negatively impacting performance.
  
  When a message is sent to a subscriber, a dispatch object is allocated
  for the dispatch, containing the topic the message was published to, the
  subscriber the message is being sent to, and the message itself.
  
  The topic is actually unused by any subscriber in Asterisk today. And
  the subscriber is associated with the taskprocessor the message is being
  dispatched to.
  
  First, this patch removes the unused topic parameter from Stasis
  subscription callbacks.
  
  Second, this patch introduces the concept of taskprocessor local data,
  data that may be set on a taskprocessor and provided along with the data
  pointer when a task is pushed using the ast_taskprocessor_push_local()
  call. This allows the task to have both data specific to that
  taskprocessor, in addition to data specific to that invocation.
  
  With those two changes, the dispatch object can be removed completely,
  and the message is simply refcounted and sent directly to the
  taskprocessor.
  
  Review: https://reviewboard.asterisk.org/r/2884/
........

Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:55:27 +00:00
Richard Mudgett bac9a478eb pbx.c: Make pbx_substitute_variables_helper_full() not mask variables.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 01:20:05 +00:00
Richard Mudgett b252c11aff pbx.c: Make ast_str_substitute_variables_full() not mask variables.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 16:13:18 +00:00
Matthew Jordan f4bf1823e9 Fix channel reference leak in Originated channels
When originating channels, ast_pbx_outgoing_* caused the dialed channel
reference to be bumped twice. Ostensibly, this routine is bumping the channel
lifetime such that the channel doesn't get nuked in between locks/unlocks;
however, since the routine should return the dialed channel with its
reference bumped, it only needs to do this one time.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-23 22:12:57 +00:00
Kinsey Moore 7b032c1adb Add SayAlphaCase and similar functionality for AGI
This adds a new dialplan application, SayAlphaCase, that performs much
the same function as SayAlpha except that it takes additional options
which allow the user to specify whether the case of each letter should
be announced for uppercase, lowercase, or all letters. Similar
functionality has been added to the SAY ALPHA AGI command via an
optional parameter.

Original Patch by: Kevin Scott Adams
Reported by: Kevin Scott Adams
Review: https://reviewboard.asterisk.org/r/2725/
(closes issue ASTERISK-20782)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-22 22:33:48 +00:00
Kinsey Moore 59753b1ea1 Strip down the old event system
This removes unused code, event types, IE pltypes, and event IE types
where possible and makes several functions private that were once
public. This includes a renumbering of the remaining event and IE types
which breaks binary compatibility with previous versions. The last
remaining consumers of the old event system (or parts thereof) are
main/security_events.c, res/res_security_log.c, tests/test_cel.c,
tests/test_event.c, main/cel.c, and the CEL backends.

Review: https://reviewboard.asterisk.org/r/2703/
(closes issue ASTERISK-22139)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-17 14:39:27 +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
Walter Doekes c43e19e8e5 Prevent heap alloc functions from running out of stack space.
When asterisk has run out of memory (for whatever reason), the alloc
function logs a message. Logging requires memory. A recipe for
infinite recursion.

Stop the recursion by comparing the function call depth for sane values
before attempting another OOM log message.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396822 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-16 07:18:51 +00:00
Matthew Jordan 5b013bc659 Unlock outgoing dial lock on off nominal path
If the thread servicing the dial request isn't created successfully, the
outgoing dial lock will still be held when the function returns. This patch
unlocks the lock on this off nominal path.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-12 15:48:58 +00:00
Matthew Jordan fba429409e Unlock the dial operation lock on a failed dial
If a dial operation fails, the pbx_outgoing_attempt routine will exit without
first having unlocked the outgoing dial lock. This would be a "bad thing".


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-10 04:18:33 +00:00
Jonathan Rose b3813c8bc5 pbx: Make originate threads indicate dial status when synchronous
This makes it so that we can detect failures to originate as with
earlier versions of Asterisk, which restores the Asterisk 11 behavior
for the originate manager action. This was causing the ACL tests for
SIP and IAX2 to fail since those tests expected originate failures
when ACLs would cause rejections. Also, this patch fixes crashes in
chan_sip when ACLs rejected peers during registration verification.

(closes issue ASTERISK-22212)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2753/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-09 17:28:15 +00:00
Walter Doekes ccdfe67bf2 Check result of ast_var_assign() calls for memory allocation failure.
We try to keep the system running even when all available memory is
spent.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-06 08:36:15 +00:00
David M. Lee 357b275239 Fix res_ari_asterisk load issue
The new res_ari_asterisk.so module presents several config options
from asterisk main. Unfortunately, they aren't exported, so the module
won't load on Linux.

This patch renames the variables, adding the ast_ prefix so they will
be exported.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-05 14:35:00 +00:00
Matthew Jordan 38236e54a8 Remove dead code from features.c; refactor pickup code into pickup.c
This patch does the following:
 * It moves the pickup code out of features.c and into pickup.c
 * It removes the vast majority of dead code out of features.c. In particular,
   this includes the parking code.

(issue ASTERISK-22134)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02 02:32:44 +00:00
David M. Lee e1b959ccbb Split caching out from the stasis_caching_topic.
In working with res_stasis, I discovered a significant limitation to
the current structure of stasis_caching_topics: you cannot subscribe
to cache updates for a single channel/bridge/endpoint/etc.

To address this, this patch splits the cache away from the
stasis_caching_topic, making it a first class object. The stasis_cache
object is shared amongst individual stasis_caching_topics that are
created per channel/endpoint/etc. These are still forwarded to global
whatever_all_cached topics, so their use from most of the code does
not change.

In making these changes, I noticed that we frequently used a similar
pattern for bridges, endpoints and channels:

     single_topic  ---------------->  all_topic
           ^
           |
     single_topic_cached  ----+---->  all_topic_cached
                              |
                              +---->  cache

This pattern was extracted as the 'Stasis Caching Pattern', defined in
stasis_caching_pattern.h. This avoids a lot of duplicate code between
the different domain objects.

Since the cache is now disassociated from its upstream caching topics,
this also necessitated a change to how the 'guaranteed' flag worked
for retrieving from a cache. The code for handling the caching
guarantee was extracted into a 'stasis_topic_wait' function, which
works for any stasis_topic.

(closes issue ASTERISK-22002)
Review: https://reviewboard.asterisk.org/r/2672/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01 13:49:34 +00:00
Kinsey Moore 684c83b29b Add transfer support to CEL
This adds CEL support for blind and attended transfers and call pickup.
During the course of adding this functionality I noticed that
CONF_ENTER, CONF_EXIT, and BRIDGE_TO_CONF events are particularly
useless without a bridge identifier, so I added that as well.

This adds tests for blind transfers, several types of attended
transfers, and call pickup.

The extra field in CEL records now consists of a JSON blob whose fields
are defined on a per-event basis.

Review: https://reviewboard.asterisk.org/r/2658/
(closes issue ASTERISK-21565)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-20 13:10:22 +00:00
Joshua Colp 7c044acbd9 Refactor operations to access the stasis cache instead of objects directly when retrieving information.
(closes issue ASTERISK-21883)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-08 19:19:55 +00:00
Matthew Jordan b193c2873d Handle hangup logic in the Stasis message bus and consumers of Stasis messages
This patch does the following:
* It adds a new soft hangup flag AST_SOFTHANGUP_HANGUP_EXEC that is set when a
  channel is executing dialplan hangup logic, i.e., the 'h' extension or a
  hangup handler. Stasis messages now also convey the soft hangup flag so
  consumers of the messages can know when a channel is executing said
  hangup logic.
* It adds a new channel flag, AST_FLAG_DEAD, which is set when a channel is
  well and truly dead. Not just a zombie, but dead, Jim. Manager, CEL, CDRs,
  and other consumers of Stasis have been updated to look for this flag to
  know when the channel should by lying six feet under.
* The CDR engine has been updated to better handle a channel entering and
  leaving a bridge. Previously, a new CDR was automatically created when a
  channel left a bridge and put into the 'Pending' state; however, this
  way of handling CDRs made it difficult for the 'endbeforehexten' logic to
  work correctly - there was always a new CDR waiting in the hangup logic
  and, even if 'ended', wouldn't be the CDR people wanted to inspect in the
  hangup routine. This patch completely removes the Pending state and instead
  defers creation of the new CDR until it gets a new message that requires
  a new CDR.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-07 20:34:38 +00:00
Matthew Jordan 3841520a6e Prevent crash during synchronous AMI origination by ref bumping returned channel
The originate APIs allow callers to provide a pointer to a channel that will
point to the originated channel if the function call succeeds. This is used by AMI
to provide channel information when the originate is performed synchronously.
Unfortunately, if the originate fails in certain ways, the outbound channel is
already disposed of during the dialing itself. This results in the channel being
improperly dereferenced by the internal originate function in pbx.c.

This patch ref bumps the channel to prevent this from occurring. Callers must now
unlock and unref the channel (which is more in line with general channel management
guidelines anyway).

This only affects manager, as it is the only consumer of this API function that
actually passes in a channel pointer.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-01 21:24:20 +00:00
Joshua Colp 77002bc377 Merge in current pimp_my_sip work, including:
1. Security events
2. Websocket support
3. Diversion header + redirecting support
4. An anonymous endpoint identifier
5. Inbound extension state subscription support
6. PIDF notify generation
7. One touch recording support (special thanks Sean Bright!)
8. Blind and attended transfer support
9. Automatic inbound registration expiration
10. SRTP support
11. Media offer control dialplan function
12. Connected line support
13. SendText() support
14. Qualify support
15. Inband DTMF detection
16. Call and pickup groups
17. Messaging support

Thanks everyone!

Side note: I'm reminded of the song "How Far We've Come" by Matchbox Twenty.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-22 14:03:22 +00:00
Matthew Jordan 6258bbe7bd Update Asterisk's CDRs for the new bridging framework
This patch is the initial push to update Asterisk's CDR engine for the new
bridging framework. This patch guts the existing CDR engine and builds the new
on top of messages coming across Stasis. As changes in channel state and bridge
state are detected, CDRs are built and dispatched accordingly. This
fundamentally changes CDRs in a few ways.
(1) CDRs are now *very* reflective of the actual state of channels and bridges.
    This means CDRs track well with what an actual channel is doing - which
    is useful in transfer scenarios (which were previously difficult to pin
    down). It does, however, mean that CDRs cannot be 'fooled'. Previous
    behavior in Asterisk allowed for CDR applications, channels, and other
    properties to be spoofed in parts of the code - this no longer works.
(2) CDRs have defined behavior in multi-party scenarios. This behavior will not
    be what everyone wants, but it is a defined behavior and as such, it is
    predictable.
(3) The CDR manipulation functions and applications have been overhauled. Major
    changes have been made to ResetCDR and ForkCDR in particular. Many of the
    options for these two applications no longer made any sense with the new
    framework and the (slightly) more immutable nature of CDRs.

There are a plethora of other changes. For a full description of CDR behavior,
see the CDR specification on the Asterisk wiki.

(closes issue ASTERISK-21196)

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17 03:00:38 +00:00
Kinsey Moore 4f84e48028 Refactor CEL channel events on top of Stasis-Core
This uses the channel state change events from Stasis-Core to determine
when channel-related CEL events should be raised. Those refactored in
this patch are:
* AST_CEL_CHANNEL_START
* AST_CEL_ANSWER
* AST_CEL_APP_START
* AST_CEL_APP_END
* AST_CEL_HANGUP
* AST_CEL_CHANNEL_END

Retirement of Linked IDs is also refactored.

CEL configuration has been refactored to use the config framework.

Note: Some HANGUP events are not generated correctly because the bridge
layer does not propagate hangupcause/hangupsource information yet.

Review: https://reviewboard.asterisk.org/r/2544/
(closes issue ASTERISK-21563)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-13 13:15:56 +00:00
Jonathan Rose 8954661207 res_parking: Automatically generate extensions, hints, etc.
(closes issue ASTERISK-21645)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2545/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-07 16:07:18 +00:00
Kinsey Moore 1458a20e47 Refactor code and fix a reference leak
Refactor some channel blob publishing code to use
ast_channel_publish_blob now that it is available and fix a JSON
reference leak that was occurring during varset publishing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-31 19:00:51 +00:00
Mark Michelson fac3839e68 Adds support for a core attended transfer function plus adds some hiding of masquerades.
The attended transfer API call can complete the attended transfer in a number of ways
depending on the current bridged states of the channels involved.

The hiding of masquerades is done in some bridging-related functions, such as the manager
Bridge action and the Bridge dialplan application. In addition, call pickup was edited
to "move" a channel rather than masquerade it.

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

(closes issue ASTERISK-21334)
Reported by Matt Jordan

(closes issue Asterisk-21336)
Reported by Matt Jordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-28 14:45:31 +00:00
Matthew Jordan 06be8463b6 Migrate a large number of AMI events over to Stasis-Core
This patch moves a number of AMI events over to the Stasis-Core message bus.
This includes:
 * ChanSpyStart/Stop
 * MonitorStart/Stop
 * MusicOnHoldStart/Stop
 * FullyBooted/Reload
 * All Voicemail/MWI related events

In addition, it adds some Stasis-Core and AMI support for generic AMI messages,
refactors the message router in AMI to use a single router with topic
forwarding for the topics that AMI cares about, and refactors MWI message
types and topics to be more name compliant.

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

(closes issue ASTERISK-21462)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-24 20:44:07 +00:00
Richard Mudgett 3d63833bd6 Merge in the bridge_construction branch to make the system use the Bridging API.
Breaks many things until they can be reworked.  A partial list:
chan_agent
chan_dahdi, chan_misdn, chan_iax2 native bridging
app_queue
COLP updates
DTMF attended transfers
Protocol attended transfers


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-21 18:00:22 +00:00
Matthew Jordan d8aec72494 Set the AST_CDR_FLAG_ORIGINATED flag on originated channel's CDRs
This may alleviate some of the CDR woes with originated channels, as CDRs
do like to know when a channel was originated. Eventually this will get
converted to be a channel flag, so its location is still good to know
post the great CDR shakeup of 2013.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-20 19:24:16 +00:00
Joshua Colp b46840ae3e Don't hold the outgoing lock for a prolonged period of time as it may block the originator.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-19 02:21:44 +00:00
Joshua Colp 4d8c35abf2 If the caller of the originate API calls wants the channel ensure it has been requested and dialed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389116 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-19 00:49:15 +00:00
Joshua Colp 7316abeb8f Fix a bug where synchronous origination (oddly enough triggered by doing an async manager Originate) would not work properly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-18 22:49:14 +00:00
Joshua Colp 4e38a4eb64 Move origination to use the dialing API and send Stasis messages on dial begin and end.
(closes issue ASTERISK-21549)
Reported by: Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-18 19:47:24 +00:00
David M. Lee b97c71bb11 Fix shutdown assertions in stasis-core
In r388005, macros were introduced to consistently define message
types. This added an assert if a message type was used either before
it was initialized or after it had been cleaned up. It turns out that
this assertion fires during shutdown.

This actually exposed a hidden shutdown ordering problem. Since
unsubscribing is asynchronous, it's possible that the message types
used by the subscription could be freed before the final message of
the subscription was processed.

This patch adds stasis_subscription_join(), which blocks until the
last message has been processed by the subscription. Since joining was
most commonly done right after an unsubscribe, a
stasis_unsubscribe_and_join() convenience function was also added.

Similar functions were also added to the stasis_caching_topic and
stasis_message_router, since they wrap subscriptions and have similar
problems.

Other code in trunk was refactored to join() where appropriate, or at
least verify that the subscription was complete before being
destroyed.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-17 21:10:32 +00:00
Jonathan Rose 6a257dd534 pbx: Fix lack of cleanup on macrolock and context_table
(closes issue ASTERISK-21723)
Reported by: Corey Farrell
Patches:
    core-pbx-cleanup.patch uploaded by Correy Farrell (license 5909)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-13 19:29:56 +00:00
Kinsey Moore 71a01725b8 Move presence state distribution to Stasis-core
Convert presence state events to Stasis-core messages and remove
redundant serializers where possible.

Review: https://reviewboard.asterisk.org/r/2410/
(closes issue ASTERISK-21102)
Patch-by: Kinsey Moore <kmoore@digium.com>


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-16 15:48:16 +00:00
Kinsey Moore 191cf99ae1 Move device state distribution to Stasis-core
In the move from Asterisk's event system to Stasis, this makes
distributed device state aggregation always-on, removes unnecessary
task processors where possible, and collapses aggregate and
non-aggregate states into a single cache for ease of retrieval. This
also removes an intermediary step in device state aggregation.

Review: https://reviewboard.asterisk.org/r/2389/
(closes issue ASTERISK-21101)
Patch-by: Kinsey Moore <kmoore@digium.com>


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385860 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-16 15:33:59 +00:00
Matthew Jordan b8d4e573f1 Add multi-channel Stasis messages; refactor Dial AMI events to Stasis
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
2013-04-08 14:26:37 +00:00
Kinsey Moore 71206544a7 Break the world. Stasis message type accessors should now all be named correctly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-28 15:45:18 +00:00
David M. Lee cf9324b25e Move more channel events to Stasis; move res_json.c to main/json.c.
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
2013-03-22 14:06:46 +00:00
David M. Lee 4edd8be35c This patch adds a new message bus API to Asterisk.
For the initial use of this bus, I took some work kmoore did creating
channel snapshots. So rather than create AMI events directly in the
channel code, this patch generates Stasis events, which manager.c uses
to then publish the AMI event.

This message bus provides a generic publish/subscribe mechanism within
Asterisk. This message bus is:

 - Loosely coupled; new message types can be added in seperate modules.
 - Easy to use; publishing and subscribing are straightforward
   operations.

In addition to basic publish/subscribe, the patch also provides
mechanisms for message forwarding, and for message caching.

(issue ASTERISK-20887)
(closes issue ASTERISK-20959)
Review: https://reviewboard.asterisk.org/r/2339/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-08 15:15:13 +00:00
Kinsey Moore 2e1e0735fe Revamp of terminal color codes
The core module related to coloring terminal output was old and needed
some love.  The main thing here was an attempt to get rid of the
obscene number of stack-local buffers that were allocated for no other
reason than to colorize some output.  Instead, this uses a simple trick
to allocate several buffers within threadlocal storage, then
automatically rotates between them, so that you can make multiple calls
to the colorization routine within one function and not need to
allocate multiple buffers.

Review: https://reviewboard.asterisk.org/r/2241/
Patches:
    bug.patch uploaded by Tilghman Lesher


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-14 18:47:56 +00:00
Richard Mudgett 0e442112ad pbx: Fix regression caused by taking advantage of the function name sort.
Taking advantage of the sorted order of the registered functions container
requires that they are actually inserted in the expected sort order.

* Insert the registered functions into the container in case sensitive
position.  As a result, only the complete_functions() routine needs to
search the entire container because it does a case insensitive search for
convenience.

Caught by the unit tests.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-09 20:58:53 +00:00
Richard Mudgett 1e65035d17 pbx: Make function and application containers take advantage of being sorted.
* Fixed "core show function" tab completion and token count checking.

* Refactored function and application container handling code to reduce
redundancy.

* Made __ast_pbx_run() return using the defines the caller should expect.
Doesn't change the returned values.  Just made use the defines.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-09 03:51:32 +00:00
Richard Mudgett 4f6c90bf3a Cleanup pbx on exit.
* Cleanup CLI commands on exit.

* Unreference hints and statecbs containers on exit.

(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
      pbx-cleanup-1_8.patch (license #5909) patch uploaded by Corey Farrell
      pbx-cleanup-10.patch (license #5909) patch uploaded by Corey Farrell
      pbx-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
      Modified
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-12-11 20:05:32 +00:00
Richard Mudgett 95a4a82702 Fix extension matching with the '-' char.
The '-' char is supposed to be ignored by the dialplan extension matching.
Unfortunately, it's treatment is not handled consistently throughout the
extension matching code.

* Made the old exten matching code consistently ignore '-' chars.

* Made the old exten matching code consistently handle case in the
matching.

* Made ignore empty character sets.

* Fixed ast_extension_cmp() to return -1, 0, or 1 as documented.  The only
user of it in pbx_lua.c was testing for -1.  It was originally returning
the strcmp() value for less than which is not usually going to be -1.

* Fix character set sorting if the sets have the same number of characters
and start with the same character.  Character set [0-9] now sorts before
[02-9a] as originally intended.

* Updated some extension label and priority already in use warnings to
also indicate if the extension is aliased.

(closes issue ASTERISK-19205)
Reported by: Philippe Lindheimer, Birger "WIMPy" Harzenetter
Tested by: rmudgett

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376691 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-28 00:13:10 +00:00
Joshua Colp c42d9d0d62 Properly check if the "Context" and "Extension" headers are empty in a ShowDialPlan action.
The code which handles the ShowDialPlan action wrongly assumed that a non-NULL return value
from the function which retrieves headers from an action indicates that the header has a
value. This is incorrect and the contents must be checked to see if they are blank.

(closes issue ASTERISK-20628)
Reported by: jkroon
Patches:
     asterisk-showdialplan-incorrect-error.patch uploaded by jkroon
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-12 20:46:51 +00:00
Michael L. Young d04bf30215 Fix Dynamic Hints Variable Substition - Underscore Problem
When adding a dynamic hint, if an extension contains an underscore no variable
subsitution is being performed.

This patch changes from checking if the extension contains an underscore to
checking if the extension begins with an underscore.

(closes issue ASTERISK-20639)
Reported by: Steven T. Wheeler
Tested by: Steven T. Wheeler, Michael L. Young
Patches:
  asterisk-20639-dynamic-hint-underscore.diff 
                                     uploaded by Michael L. Young (license 5026)

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376148 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-12 20:18:47 +00:00
Mark Michelson f2bb9afe17 Multiple revisions 375993-375994
........
  r375993 | mmichelson | 2012-11-07 11:01:13 -0600 (Wed, 07 Nov 2012) | 30 lines
  
  Fix misuses of timeouts throughout the code.
  
  Prior to this change, a common method for determining if a timeout
  was reached was to call a function such as ast_waitfor_n() and inspect
  the out parameter that told how many milliseconds were left, then use
  that as the input to ast_waitfor_n() on the next go-around.
  
  The problem with this is that in some cases, submillisecond timeouts
  can occur, resulting in the out parameter not decreasing any. When this
  happens thousands of times, the result is that the timeout takes much
  longer than intended to be reached. As an example, I had a situation where
  a 3 second timeout took multiple days to finally end since most wakeups
  from ast_waitfor_n() were under a millisecond.
  
  This patch seeks to fix this pattern throughout the code. Now we log the
  time when an operation began and find the difference in wall clock time
  between now and when the event started. This means that sub-millisecond timeouts
  now cannot play havoc when trying to determine if something has timed out.
  
  Part of this fix also includes changing the function ast_waitfor() so that it
  is possible for it to return less than zero when a negative timeout is given
  to it. This makes it actually possible to detect errors in ast_waitfor() when
  there is no timeout.
  
  (closes issue ASTERISK-20414)
  reported by David M. Lee
  
  Review: https://reviewboard.asterisk.org/r/2135/
........
  r375994 | mmichelson | 2012-11-07 11:08:44 -0600 (Wed, 07 Nov 2012) | 3 lines
  
  Remove some debugging that accidentally made it in the last commit.
........

Merged revisions 375993-375994 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07 19:15:26 +00:00
Mark Michelson da85f8489f Make evaluation of channel variables consistently case-sensitive.
Due to inconsistencies in how variable names were evaluated, the
decision was made to make all evaluations case-sensitive. See the
UPGRADE.txt file or https://wiki.asterisk.org/wiki/display/AST/Case+Sensitivity
for more details.

(closes issue ASTERISK-20163)
reported by Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-29 21:27:09 +00:00
Walter Doekes 6d57ecd48c Change a few warnings to debug and the inverse.
Remove the "RTP Read too short" warning for RTP keepalives. Remove the
the warning about the application delimiter switch from pipe to comma.
(You should've done this by now.) Make cdr_odbc report more when an
insert fails. Make chan_sip warn less when the peer wants SRTP (and we
don't) or sends a zero port to disable a media type.

Review: https://reviewboard.asterisk.org/r/2167
(closes issue ASTERISK-20538)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-17 14:24:52 +00:00
Richard Mudgett 9a0ff62452 Fix execution of 'i' extension due to uninitialized variable.
The fix for ASTERISK-18243 added code that could potentially use
dst_exten[] uninitialized.  As a result the 'i' exten may not be executed
when it should.

(closes issue ASTERISK-20455)
Reported by: Richard Miller
Patches:
      pbx-1.8.16.0.diff (license #5685) patch uploaded by Richard Miller
      Made some cosmetic modifications.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-09 22:24:10 +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
Andrew Latham fd98835f1f Doxygen Updates Janitor Work
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags.
* Add cleanup to Makefile for the Doxygen configuration update
* Start updating Doxygen configuration for cleaner output
* Enable inclusion of configuration files into documentation
* remove mantisworkflow...
* update documentation README
* Add markup to Tilghman's email and talk with him about updating his email, he knows...
* no code changes on this commit other than the mentioned Makefile change

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22 20:43:30 +00:00
Kinsey Moore 8fb1897e89 Ensure counts generated in manager_show_dialplan_helper are correct
When manager_show_dialplan_helper was written, the counter increment
for the total number of contexts was placed with the extensions
increment instead of in the enclosing loop.  This function should
now generate correct context counts.

(closes issue AST-970)
Reported-by: John Bigelow
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-05 19:08:15 +00:00
Matthew Jordan 8018b879a2 Clean up doxygen warnings
This patch fixes numerous doxygen warnings across Asterisk.  It also updates
the makefile to regenerate the doxygen configuration on the local system
before running doxygen to help prevent warnings/errors on the local system.

Much thanks to Andrew for tackling one of the Asterisk janitor projects!

(issue ASTERISK-20259)
Reported by: Andrew Latham
Patches:
  doxygen_partial.diff uploaded by Andrew Latham (license 5985)
  make_progdocs.diff uploaded by Andrew Latham (license 5985)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-30 14:23:28 +00:00
Mark Michelson 9ee8b3c0f6 Extend extension state callbacks to have more information.
Quote from review board:

This patch extends the extension state callbacks so that monitoring channels
(as chan_sip) get more information of the devices which are responsible for
an extension state change. The additional information is needed by chan_sip
to present names/numbers of the caller and callee in an early-state SIP
notification. Users of extenstion state callback not interested in the
additional information are not affected by the changes.

Motivation: to present the involved party's name/number in an early-state
nofification (used by the notified device as a pickup offer) one after another
so that a user can see which call he will pick up in an undirected pickup.
Such a pickup offer to a user shall indicate the same call (number/name-A calls
number/name-B) as the call which would be picked up when an undirected pickup
is executed.


Users interested in additional state info must use the new functions
ast_extension_state_add_extended() resp.
ast_extension_state_add_destroy_extended() to register an extended state
callback. When the callback is registered this way, an extra member
device_state_info of struct ast_state_cb_info is passed to the callback in
addition to the aggregated extension state. This container holds an object for
every device of the monitored extension hint consisting of the device name, the
device state and a channel reference to the channel which (presumably) caused
the device state.

The information is used by chan_sip for early-state notifications. When the
state of a device changes and the new state contains AST_EVENT_RINGING, an
early-state notification is sent to the subscribed devices with the
caller/callee names/numbers of the oldest ringing channel of the monitored
extension. The notified user may then invoke a direct pickup, which will pickup
exactly this channel.

Users of the old non-extended callbacks will only be called when the aggregated
state did change (same behavior as before). Users of the extended callback will
also be called when the state is unchanged but does contain AST_EVENT_RINGING.
That could be the case if two channels are ringing at one device and one of
them hangs up, so the aggregated state does not change. This way the monitoring
channel can create a new early-state notification with the now ringing
party-ids.

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

This contribution comes from Guenther Kelleter



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-09 14:52:16 +00:00
Mark Michelson eb9e645a27 Allow support for early media on AMI originates and call files.
This is based on the work done by Olle Johansson on review board.

The idea is that the channel specified in an AMI originate or call
file is typically not connected to the outgoing extension until the
channel has been answered. With this change, an EarlyMedia header can
be specified for AMI originates and an early_media option can
be specified in call files. With this option set, once early media is
received on a channel, it will be connected with the outgoing extension.

(closes issue ASTERISK-18644)
Reported by Olle Johansson

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-08 22:39:40 +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
Terry Wilson 38f1081fd3 Revert a change that broke compilation
1) There is no such function as ast_ref()
2) The patch was originally credited as the one uploaded by Guenther
   Kelleter (license 6372) via issue AST-921, but the patch committed
   was not the patch referenced on the issue.
3) Guenther Kelleter's patch was actually correct. It moved the
   ast_free above the presencechange_cleanup label. I am not
   committing his change as it is not technically necesary--calling
   ast_free(NULL) is perfectly safe and I worry that moving the
   ast_free outside of the label could lead to future bugs if
   someone ever adds another failure conditional and expects
   'goto presencechange_cleanup;' to clean up after everything.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-25 03:51:28 +00:00
Jonathan Rose 729c91b312 Don't attempt free of NULL ptr in pbx.c handle_presencechange
(closes issue AST-921)
Reported by: Guenther Kelleter
Patches:
    nullptr.patch uploaded by Guenther Kelleter (license 6372)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-24 21:30:21 +00:00
Kevin P. Fleming 79087cbbd5 Ensure that all ast_datastore_info structures are 'const'.
While addressing a bug, I came across a instance of 'struct ast_datastore_info'
that was not declared 'const'. Since the API already expects them to be
'const', this patch changes the declarations of all existing instances
that were not already declared that way.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-18 17:18:20 +00:00
Matthew Jordan 2ffae5745d Add some additional documentation for core AMI events
This patch adds some basic documentation for a number of modules.  This
includes core source files in Asterisk (those in main), as well as
chan_agent, chan_dahdi, chan_local, sig_analog, and sig_pri.  The DTD
has also been updated to allow referencing of AMI commands.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-10 22:26:27 +00:00
Kinsey Moore 6416a246ed Improve Goto and GotoIf related documentation
Correct documentation on labeliftrue and labeliffalse parameters of
GotoIf() and update several other locations that use the same syntax.

(closes issue ASTERISK-20007)
Patch-by: Leif Madsen
Reported-by: WIMPy
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-10 13:40:32 +00:00
Richard Mudgett ac35b92b62 Hangup handlers - Dialplan subroutines that run when the channel hangs up.
Hangup handlers are an alternative to the h extension.  They can be used
in addition to the h extension.  The idea is to attach a Gosub routine to
a channel that will execute when the call hangs up.  Whereas which h
extension gets executed depends on the location of dialplan execution when
the call hangs up, hangup handlers are attached to the call channel.  You
can attach multiple handlers that will execute in the order of most
recently added first.

(closes issue ASTERISK-19549)
Reported by: Mark Murawski
Tested by: rmudgett

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-29 17:02:32 +00:00
Jonathan Rose 5eb94d7ebb Unique Call ID logging Phases III and IV
Adds call ID logging changes to specific channel drivers that weren't handled
handled in phase II of Call ID Logging. Also covers logging for threads for
threads created by systems that may be involved with many different calls.
Extra special thanks to Richard for rigorous review of chan_dahdi and its
various signalling modules.

review: https://reviewboard.asterisk.org/r/1927/
review: https://reviewboard.asterisk.org/r/1950/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-26 21:45:22 +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 aaa591447d Make the Hangup application set a softhangup flag.
The Hangup application used to just return -1 to cause normal dialplan
execution to hangup a channel.  For the non-normal execution routines like
predial and connected-line interception routines, the hangup request would
exit the routine early but otherwise be ignored.

* Made the Hangup application not allow setting a cause code of zero.  A
zero cause code is not defined.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-14 22:57:21 +00:00
Mark Michelson 14a985560e Merge changes dealing with support for Digium phones.
Presence support has been added. This is accomplished by
allowing for presence hints in addition to device state
hints. A dialplan function called PRESENCE_STATE has been
added to allow for setting and reading presence. Presence
can be transmitted to Digium phones using custom XML
elements in a PIDF presence document.

Voicemail has new APIs that allow for moving, removing,
forwarding, and playing messages. Messages have had a new
unique message ID added to them so that the APIs will work
reliably. The state of a voicemail mailbox can be obtained
using an API that allows one to get a snapshot of the mailbox.
A voicemail Dialplan App called VoiceMailPlayMsg has been
added to be able to play back a specific message.

Configuration hooks have been added. Configuration hooks
allow for a piece of code to be executed when a specific
configuration file is loaded by a specific module. This is
useful for modules that are dependent on the configuration
of other modules.

chan_sip now has a public method that allows for a custom
SIP INFO request to be sent mid-dialog. Digium phones use
this in order to display progress bars when files are played.

Messaging support has been expanded a bit. The main
visible difference is the addition of an AMI action
MessageSend.

Finally, a ParkingLots manager action has been added in order
to get a list of parking lots.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04 20:26:12 +00:00
Richard Mudgett e434a456cd Fix WaitExten(x,m(musicclass)) string termination.
The AST_CONTROL_HOLD MOH class from the WaitExten application can now be
queued onto a channel, passed over local channels with the /m option, and
passed over IAX channels.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-23 23:22:42 +00:00
Jonathan Rose a1da70097d logger: Fix a potential callid reference leak discovered in development
Uncovered a nasty reference leak while I was writing some changes to
chan_dahdi/sig_analog. Slapped myself around a bit after seeing that I
performed the unchecked return causing this problem.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-23 20:39:22 +00:00
Matthew Jordan 7b51320642 Fix a variety of memory leaks
This patch addresses a number of memory leaks in a variety of modules that were
found by a static analysis tool.  A brief summary of the changes:

* app_minivm:       free ast_str objects on off nominal paths
* app_page:         free the ast_dial object if the requested channel technology
                    cannot be appended to the dialing structure
* app_queue:        if a penalty rule failed to match any existing rule list
                    names, the created rule would not be inserted and its memory
                    would be leaked
* app_read:         dispose of the created silence detector in the presence of
                    off nominal circumstances
* app_voicemail:    dispose of an allocated unique ID field for MWI event
                    un-subscribe requests in off nominal paths; dispose of
                    configuration objects when using the secret.conf option
* chan_dahdi:       dispose of the allocated frame produced by ast_dsp_process
* chan_iax2:        properly unref peer in CLI command "iax2 unregister"
* chan_sip:         dispose of the allocated frame produced by sip_rtp_read's
                    call of ast_dsp_process; free memory in parse unit tests
* func_dialgroup:   properly deref ao2 object grhead in nominal path of
                    dialgroup_read
* func_odbc:        free resultset in off nominal paths of odbc_read
* cli:              free match_list in off nominal paths of CLI match completion
* config:           free comment_buffer/list_buffer when configuration file load
                    is unchanged; free the same buffers any time they were
                    created and config files were processed
* data:             free XML nodes in various places
* enum:             free context buffer in off nominal paths
* features:         free ast_call_feature in off nominal paths of applicationmap
                    config processing
* netsock2:         users of ast_sockaddr_resolve pass in an ast_sockaddr struct
                    that is allocated by the method.  Failures in
                    ast_sockaddr_resolve could result in the users of the method
                    not knowing whether or not the buffer was allocated.  The
                    method will now not allocate the ast_sockaddr struct if it
                    will return failure.
* pbx:              cleanup hash table traversals in off nominal paths; free
                    ignore pattern buffer if it already exists for the specified
                    context
* xmldoc:           cleanup various nodes when we no longer need them
* main/editline:    various cleanup of pointers not being freed before being
                    assigned to other memory, cleanup along off nominal paths
* menuselect/mxml:  cleanup of value buffer for an attribute when that attribute
                    did not specify a value
* res_calendar*:    responses are allocated via the various *_request method
                    returns and should not be allocated in the various
                    write_event methods; ensure attendee buffer is freed if no
                    data exists in the parsed node; ensure that calendar objects
                    are de-ref'd appropriately
* res_jabber:       free buffer in off nominal path
* res_musiconhold:  close the DIR* object in off nominal paths
* res_rtp_asterisk: if we run out of ports, close the rtp socket object and free
                    the rtp object
* res_srtp:         if we fail to create the session in libsrtp, destroy the
                    temporary ast_srtp object

(issue ASTERISK-19665)
Reported by: Matt Jordan

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18 14:43:44 +00:00
Jonathan Rose cd37bec058 logger: Adds additional support for call id logging and chan_sip specific stuff
This patch improves the handling of call id logging significantly with regard
to transfers and adding APIs to better handle specific aspects of logging.
Also, changes have been made to chan_sip in order to better handle the creation
of callids and to enable the monitor thread to bind itself to a particular
call id when a dialog is determined to be related to a callid. It then unbinds
itself before returning to normal monitoring.

review: https://reviewboard.asterisk.org/r/1886/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-17 16:28:20 +00:00
Kinsey Moore dd81b047db Resolve FORWARD_NULL static analysis warnings
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20,
22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111,
and 115. Finding numbers 26, 33, and 29 were already resolved.  Those skipped
were either extended/deprecated or in areas of code that shouldn't be
disturbed.

(Closes issue ASTERISK-19650)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10 20:56:09 +00:00
Jonathan Rose 8227f70cd7 Coverity Report: Fix issues for error type CHECKED_RETURN for core
(issue ASTERISK-19658)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/1905/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10 18:35:14 +00:00
Matthew Jordan 11faa15d11 Fix channel opaquification slip-up in r365477
Those channels are opaque now...


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-07 18:58:40 +00:00
Matthew Jordan 9e7de73fee Support VoiceMail d() option when extension does not exist in channel's context
The VoiceMail d([c]) option is documented to accept digits for a new extension
in context <c>, if played during the greeting.  This option works fine if the
extension being redirected to has an extension with the same initial digit in
the channel's current context.  If that digit did not happen to exist in some
extension, a dialplan match would fail and the user would not be redirected.

This patch fixes it such that if the <c> option is used, the extensions are
matched in that context as opposed to the caller's original context.

(closes issue ASTERISK-18243)
Reported by: mjordan
Tested by: mjordan

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-07 18:42:48 +00:00
Richard Mudgett b43f4a60dd * Add more information to some messages in __ast_pbx_run().
* Simplify some dialplan priority setting code in ast_explicit_goto()
because of opaquification.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-20 16:04:37 +00:00
Kinsey Moore a485f44022 Add missing newlines to CLI logging
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361476 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06 18:19:03 +00:00
Jonathan Rose 655a8d4420 Introducing the log message unique call identifiers feature
Log messages will now display a call number that they are tied to (ordered for calls
based on when they started). This feature is made to be minimally invasive without
requiring changes to many of the existing log messages. These IDs  won't show up for
verbose messages on CLI (but they will in log files) This is currently in phase II
of production, see more about this feature on the wiki --
https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29 20:01:20 +00:00
Jonathan Rose d501c2ea2d undoing 360785 due to merging mistake
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29 19:59:30 +00:00
Jonathan Rose bf994f0e04 Introducing the log message unique call identifiers feature
Log messages will now display a call number that they are tied to (ordered for calls
based on when they started). This feature is made to be minimally invasive without
requiring changes to many of the existing log messages. These IDs  won't show up for
verbose messages on CLI (but they will in log files) This is currently in phase II
of production, see more about this feature on the wiki --
https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29 19:54:35 +00:00
Kinsey Moore c5b3db1956 Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these
whitespace-only changes didn't break anything (and shouldn't have).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22 19:51: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
Mark Michelson 827f2eae92 Revert the pre-dial addition.
The code may be just fine, but it had not received a "ship it!" on
review board yet.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-16 15:38:45 +00:00
Mark Murawki d6e1c619d4 Fix warning from commit r359705 (predial options for app_dial)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-15 20:11:55 +00:00
Mark Murawki c65b41f57a Add options PreDial options 'b' and 'B' to app_dial
* Added 'b' and 'B' options to Dial.  These options will allow you to run
  last-minute dialplan on the caller and callee channels while the Dial
  application is executing, but before the call is started.  For example you
  can use the 'b' option to run dialplan on the callee channel to get the name
  of the newly created channel right away.

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

(closes issue: ASTERISK-19548)
Reported by: Mark Murawski
Tested by: Mark Murawski, Stefan Schmidt



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-15 18:58:25 +00:00
Russell Bryant 6ec5c103d6 Don't use a buffer after it goes out of scope.
's' is set to 'workspace'.  Make sure 'workspace' doesn't go out of scope while
the reference to it via 's' is still used.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14 00:01:40 +00:00
Terry Wilson 786f5898d1 Finalize ast_channel opaquification
Review: https://reviewboard.asterisk.org/r/1786/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13 18:20:34 +00:00
Terry Wilson 0e5c761c28 Opaquify ast_channel typedefs, fd arrays, and softhangup flag
Review: https://reviewboard.asterisk.org/r/1784/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-01 22:09:18 +00:00
Terry Wilson a9d607a357 Opaquify ast_channel structs and lists
Review: https://reviewboard.asterisk.org/r/1773/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29 16:52:47 +00:00
Terry Wilson ebaf59a656 Opaquification for ast_format structs in struct ast_channel
Review: https://reviewboard.asterisk.org/r/1770/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 00:32:20 +00:00
Terry Wilson 57f42bd74f ast_channel opaquification of pointers and integral types
Review: https://reviewboard.asterisk.org/r/1753/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 23:43:27 +00:00
Tilghman Lesher a78b0af5ea Re-commit the verbose branch.
This change permits each verbose destination (consoles, logger) to have its
own concept of what the verbosity level is.  The big feature here is that
the logger will now be able to capture a particular verbosity level without
condemning each console to need to suffer that level of verbosity.
Additionally, a stray 'core set verbose' will no longer change what will go
to the log.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14 20:27:16 +00:00
Terry Wilson 34c55e8e7c Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 17:27:06 +00:00
Walter Doekes db24fc2523 Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: Clod Patry
Review: https://reviewboard.asterisk.org/r/1651


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08 20:49:48 +00:00
Richard Mudgett 23bc964e1c Constify some more channel driver technology callback parameters.
Review: https://reviewboard.asterisk.org/r/1707/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01 19:53:38 +00:00
Richard Mudgett 27b69e7d29 Audit of ao2_iterator_init() usage for v1.8.
Fixes numerous reference leaks and missing ao2_iterator_destroy() calls as
a result.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27 18:47:16 +00:00
Terry Wilson 99cae5b750 Opaquify channel stringfields
Continue channel opaque-ification by wrapping all of the stringfields.
Eventually, we will restrict what can actually set these variables, but
the purpose for now is to hide the implementation and keep people from
adding code that directly accesses the channel structure. Semantic
changes will follow afterward.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24 20:12:09 +00:00
Terry Wilson 04da92c379 Replace direct access to channel name with accessor functions
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
2012-01-09 22:15:50 +00:00
Jonathan Rose 573e1e5dc0 Fix documentation for SayNumber to reflect the fact that language is changed in CHANNEL()
(closes issue ASTERISK-18962)
reported by: Nir Simionovich
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-04 18:46:51 +00:00
Richard Mudgett 32e35e5fcd Fix extension state callback references in chan_sip.
Chan_sip gives a dialog reference to the extension state callback and
assumes that when ast_extension_state_del() returns, the callback cannot
happen anymore.  Chan_sip then reduces the dialog reference count
associated with the callback.  Recent changes (ASTERISK-17760) have
resulted in the potential for the callback to happen after
ast_extension_state_del() has returned.  For chan_sip, this could be very
bad because the dialog pointer could have already been destroyed.

* Added ast_extension_state_add_destroy() so chan_sip can account for the
sip_pvt reference given to the extension state callback when the extension
state callback is deleted.

* Fix pbx.c awkward statecbs handling in ast_extension_state_add_destroy()
and handle_statechange() now that the struct ast_state_cb has a destructor
to call.

* Ensure that ast_extension_state_add_destroy() will never return -1 or 0
for a successful registration.

* Fixed pbx.c statecbs_cmp() to compare the correct information.  The
passed in value to compare is a change_cb function pointer not an object
pointer.

* Make pbx.c ast_merge_contexts_and_delete() not perform callbacks with
AST_EXTENSION_REMOVED with locks held.  Chan_sip is notorious for
deadlocking when those locks are held during the callback.

* Removed unused lock declaration for the pbx.c store_hints list.

(closes issue ASTERISK-18844)
Reported by: rmudgett

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23 02:35:13 +00:00
Richard Mudgett b05d4603c4 Fix crash during CDR update.
The ast_cdr_setcid() and ast_cdr_update() were shown in ASTERISK-18836 to
be called by different threads for the same channel.  The channel driver
thread and the PBX thread running dialplan.

* Add lock protection around CDR API calls that access an ast_channel
pointer.

(closes issue ASTERISK-18836)
Reported by: gpluser

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-16 21:10:19 +00:00
Richard Mudgett 01d3fd2167 Fix some parsing issues in add_exten_to_pattern_tree().
* Simplify compare_char() and avoid potential sign extension issue.

* Fix infinite loop in add_exten_to_pattern_tree() handling of character
set escape handling.

* Added buffer overflow checks in add_exten_to_pattern_tree() character
set collection.

* Made ignore empty character sets.

* Added escape character handling to end-of-range character in character
sets.  This has a slight change in behavior if the end-of-range character
is an escape character.  You must now escape it.

* Fix potential sign extension issue when expanding character set ranges.

* Made remove duplicated characters from character sets.  The duplicate
characters lower extension matching priority and prevent duplicate
extension detection.

* Fix escape character handling when the escape character is trying to
escape the end-of-string.  We could have continued processing characters
after the end of the exten string.  We could have added the previous
character to the pattern matching tree incorrectly.

(closes issue ASTERISK-18909)
Reported by: Luke-Jr
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347813 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-09 01:33:29 +00:00
Jonathan Rose 9b33408ba1 Documents CHANNEL(musicclass) taking priority over m([x]) in waitExten
If waitExten specifies a music class to use with its music on hold option, it will use
CHANNEL(musicclass) instead if that channel variable has been set on the initiating
channel.  This documents that behavior in the waitExten app so that this can be known
without checking the documentation of the code in function local_ast_moh_start.

(closes issue ASTERISK-18804)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@347241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-06 22:01:00 +00:00
Jonathan Rose c5fe1cfdc0 Resolve duplicate label used in multiple priorities for the same extension.
Prior to this patch, if labels with the same name were used for different priorities in
the same extension, the new label would be accepted, but it would be unusable since
attempts to reach that label would just go to the first one. Now pbx.c detects this,
generates a warning in logs, and culls the label before adding it to the dialplan.

(closes issue ASTERISK-18807)
Reported by: Kenneth Shumard
Patches:
	pbx.c.patch uploaded by Kenneth Shumard (License 5077)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@346956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-05 15:04:12 +00:00
Richard Mudgett 1cef6cf8cd Fix Progress spelling error in main/pbx.c.
(closes issue ASTERISK-18857)
Reported by: David M
Patches:
      mainpbx-trivial.patch (License #6326) patch uploaded by David M
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-14 20:48:19 +00:00
Jonathan Rose 8d994bed55 Fix a segmentation fault when using an extension with CID matching and no CID.
Attempting to call an extension which used Caller ID matching with a channel that
has an empty caller id string would result in a segmentation fault.

(closes issue ASTERISK-18392
Reported By: Ales Zelenik
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-11 15:47:39 +00:00
Matthew Jordan 9333071c1f Fixed invalid memory access when adding extension to pattern match tree
When an extension is removed from a context, its entry in the pattern match
tree is not deleted.  Instead, the extension is marked as deleted.  When an
extension is removed and re-added, if that extension is also a prefix of
another extension, several log messages would report an error and did not
check whether or not the extension was deleted before accessing the memory.
Additionally, if the extension was already in the tree but previously
deleted, and the pattern was at the end of a match, the findonly flag was
not honored and the extension would be erroneously undeleted.  

Additionaly, it was discovered that an IAX2 peer could be unregistered
via the CLI, while at the same time it could be scheduled for unregistration
by Asterisk.  The unregistration method now checks to see if the peer
was already unregistered before continuing with an unregistration.

(closes issue ASTERISK-18135)
Reported by: Jaco Kroon, Henry Fernandes, Kristijan Vrban
Tested by: Matt Jordan

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-31 16:10:32 +00:00
Matthew Nicholson bb07ca66a1 Merged revisions 340109 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r340109 | mnicholson | 2011-10-10 09:15:41 -0500 (Mon, 10 Oct 2011) | 18 lines
  
  Merged revisions 340108 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r340108 | mnicholson | 2011-10-10 09:14:48 -0500 (Mon, 10 Oct 2011) | 11 lines
    
    Load the proper XML documentation when multiple modules document the same application.
    
    This patch adds an optional "module" attribute to the XML documentation spec
    that allows the documentation processor to match apps with identical names from
    different modules to their documentation. This patch also fixes a number of
    bugs with the documentation processor and should make it a little more
    efficient. Support for multiple languages has also been properly implemented.
    
    ASTERISK-18130
    Review: https://reviewboard.asterisk.org/r/1485/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-10 14:16:27 +00:00
Richard Mudgett 55b70ae625 Merged revisions 337974 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r337974 | rmudgett | 2011-09-26 14:35:23 -0500 (Mon, 26 Sep 2011) | 37 lines
  
  Merged revisions 337973 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r337973 | rmudgett | 2011-09-26 14:30:39 -0500 (Mon, 26 Sep 2011) | 30 lines
    
    Fix deadlock when using dummy channels.
    
    Dummy channels created by ast_dummy_channel_alloc() should be destoyed by
    ast_channel_unref().  Using ast_channel_release() needlessly grabs the
    channel container lock and can cause a deadlock as a result.
    
    * Analyzed use of ast_dummy_channel_alloc() and made use
    ast_channel_unref() when done with the dummy channel.  (Primary reason for
    the reported deadlock.)
    
    * Made app_dial.c:dial_exec_full() not call ast_call() holding any channel
    locks.  Chan_local could not perform deadlock avoidance correctly.
    (Potential deadlock exposed by this issue.  Secondary reason for the
    reported deadlock since the held lock was part of the deadlock chain.)
    
    * Fixed some uses of ast_dummy_channel_alloc() not checking the returned
    channel pointer for failure.
    
    * Fixed some potential chan=NULL pointer usage in func_odbc.c.  Protected
    by testing the bogus_chan value.
    
    * Fixed needlessly clearing a 1024 char auto array when setting the first
    char to zero is enough in manager.c:action_getvar().
    
    (closes issue ASTERISK-18613)
    Reported by: Thomas Arimont
    Patches:
          jira_asterisk_18613_v1.8.patch (license #5621) patch uploaded by rmudgett
    Tested by: Thomas Arimont
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-26 19:40:12 +00:00
Olle Johansson 7b08b2cf53 Merged revisions 337219 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r337219 | oej | 2011-09-21 11:32:50 +0200 (Ons, 21 Sep 2011) | 13 lines
  
  Make ast_pbx_run() not default to s@default if extension is not found
  
  Review: https://reviewboard.asterisk.org/r/1446/
  
  This is a bug - or architecture mistake - that has been in Asterisk for a 
  very long time. It was exposed by the AMI originate action and possibly
  some other applications. Most channel drivers checks if an extension
  exists BEFORE starting a pbx on an inbound call, so most calls will
  not depend on this issue.
  
  Thanks everyone involved in the review and on IRC and the mailing list
  for a quick review and all the feedback.

  (closes issue ASTERISK-18578)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337220 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-21 09:39:13 +00:00
Kinsey Moore 486b6042f3 Merged revisions 337062 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r337062 | kmoore | 2011-09-20 16:05:01 -0500 (Tue, 20 Sep 2011) | 18 lines
  
  Merged revisions 337061 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r337061 | kmoore | 2011-09-20 16:04:11 -0500 (Tue, 20 Sep 2011) | 11 lines
    
    Make CANMATCH with the new pattern match engine behave more like the old one
    
    When checking an extension for E_CANMATCH using the new extension matching
    algorithm, an exact match was not returned as a possible match resulting in the
    queue failing to allow a caller to exit on DTMF.  This removes the requirement
    that an extension be longer than acquired digits for an E_CANMATCH operation
    to succeed.
    
    (closes issue ASTERISK-18044)
    Review: https://reviewboard.asterisk.org/r/1367/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20 21:05:42 +00:00
Matthew Nicholson b292ff3b32 Merged revisions 335653 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r335653 | mnicholson | 2011-09-13 13:47:57 -0500 (Tue, 13 Sep 2011) | 12 lines
  
  Merged revisions 335618 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r335618 | mnicholson | 2011-09-13 13:20:52 -0500 (Tue, 13 Sep 2011) | 5 lines
    
    Don't limit the size of appdata for manager originate actions.
    
    ASTERISK-17709
    Patch by: tilghman (with modifications)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 18:49:26 +00:00
Matthew Jordan 8b5ba33fe0 Merged revisions 335078 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r335078 | mjordan | 2011-09-09 11:27:01 -0500 (Fri, 09 Sep 2011) | 29 lines
  
  Merged revisions 335064 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r335064 | mjordan | 2011-09-09 11:09:09 -0500 (Fri, 09 Sep 2011) | 23 lines
    
    Updated SIP 484 handling; added Incomplete control frame
    
    When a SIP phone uses the dial application and receives a 484 Address 
    Incomplete response, if overlapped dialing is enabled for SIP, then
    the 484 Address Incomplete is forwarded back to the SIP phone and the
    HANGUPCAUSE channel variable is set to 28.  Previously, the Incomplete
    application dialplan logic was automatically triggered; now, explicit
    dialplan usage of the application is required.
    
    Additionally, this patch adds a new AST_CONTOL_FRAME type called
    AST_CONTROL_INCOMPLETE.  If a channel driver receives this control frame,
    it is an indication that the dialplan expects more digits back from the
    device.  If the device supports overlap dialing it should attempt to 
    notify the device that the dialplan is waiting for more digits; otherwise,
    it can handle the frame in a manner appropriate to the channel driver.
    
    (closes issue ASTERISK-17288)
    Reported by: Mikael Carlsson
    Tested by: Matthew Jordan
    
    Review: https://reviewboard.asterisk.org/r/1416/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09 16:28:23 +00:00
Jonathan Rose eb14a69209 Removes colorful verb statements erroneously commited with r332760
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-08 13:36:11 +00:00
Alec L Davis 7b63ad3afb Merged revisions 334617 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r334617 | alecdavis | 2011-09-07 19:45:00 +1200 (Wed, 07 Sep 2011) | 17 lines
  
  Merged revisions 334616 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r334616 | alecdavis | 2011-09-07 19:33:39 +1200 (Wed, 07 Sep 2011) | 10 lines
    
    Prevent segfault if call arrives before Asterisk is fully booted.
    
    Prevent ast_pbx_start and ast_run_start from starting a new thread unless asterisk
    is fully booted.
     
    alecdavis (license 585)
    Tested by: alecdavis
     
    Review: https://reviewboard.asterisk.org/r/1407/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07 07:48:25 +00:00
Tilghman Lesher 25a8cb4265 Merged revisions 334235 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r334235 | tilghman | 2011-09-01 12:39:32 -0500 (Thu, 01 Sep 2011) | 9 lines
  
  Merged revisions 334234 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r334234 | tilghman | 2011-09-01 12:38:33 -0500 (Thu, 01 Sep 2011) | 2 lines
    
    Remove 1.6 compatibility documentation from 1.8, as it no longer applies.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-01 17:41:09 +00:00
Jonathan Rose 901e275c4c Add option for logging congested calls as CONGESTION instead of NO_ANSWER in CDR
This patch adds a CDR option to cdr.conf that will allow CDR files to log calls ending
with congestion in a way that is unique from other unanswered calls.

(closes issue ASTERISK-14842)
Reported by: Alec Davis
Patches:
	cdr_congestion.diff.txt (License #5546) patch uploaded by Alec Davis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@332760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22 17:05:14 +00:00
Richard Mudgett b99b1116be Merged revisions 331265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r331265 | rmudgett | 2011-08-09 18:12:49 -0500 (Tue, 09 Aug 2011) | 22 lines
  
  Merged revisions 331248 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r331248 | rmudgett | 2011-08-09 17:12:59 -0500 (Tue, 09 Aug 2011) | 15 lines
    
    Misc minor items found in code.
    
    * Add some reentrancy protection in pbx.c when creating the contexts_table
    hash table.
    
    * Fix inverted test in chan_sip.c conditional code.
    
    * Fix uninitialized variable and use of the wrong variable in chan_iax2.c.
    
    * Fix test of return value in app_parkandannounce.c.  Explicitly testing
    for -1 is bad if the function does not actually return that value when it
    fails.
    
    * Fixup some comments and add some curly braces in features.c.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-09 23:17:13 +00:00
Jonathan Rose d170e5e829 reverting 329840 due to failing tests. Going to change this feature to be purely optional.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-27 21:22:12 +00:00
Jonathan Rose 3ee80d6a90 Adds cdr logging of calls resulting in CONGESTION
Applies a patch made a long time ago by alecdavis which adds a CDR feature for logging
calls that failed due to congestion.

(closes issue #15907)
Reported by: alecdavis
Patches: 
      cdr_congestion.diff.txt uploaded by alecdavis (license #5546)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329835 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-27 20:42:18 +00:00
Richard Mudgett c0f592df46 Merged revisions 329334 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r329334 | rmudgett | 2011-07-22 16:14:22 -0500 (Fri, 22 Jul 2011) | 1 line
  
  Make use less redundant loop construct for iterating over hints.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-22 21:15:28 +00:00
Richard Mudgett a5c65bb939 Merged revisions 329331 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r329331 | rmudgett | 2011-07-22 15:43:07 -0500 (Fri, 22 Jul 2011) | 55 lines
  
  Merged revisions 329299 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r329299 | rmudgett | 2011-07-22 10:44:58 -0500 (Fri, 22 Jul 2011) | 48 lines
    
    Deadlocks dealing with dialplan hints during reload.
    
    There are two remaining different deadlocks reported dealing with dialplan
    hints.
    
    The deadlock in ASTERISK-17666 is caused by invalid locking order in
    ast_remove_hint().  The hints container must be locked before the hint
    object.
    
    The deadlock in ASTERISK-17760 is caused by a catch-22 situation in
    handle_statechange().  The deadlock is caused by not having the conlock
    before calling the watcher callbacks.  Unfortunately, having that lock
    causes a different deadlock as reported in ASTERISK-16961.
    
    * Fixed ast_remove_hint() locking order.
    
    * Made handle_statechange() no longer call the watcher callbacks holding
    any locks that matter.
    
    * Made hint ao2 destructor do the watcher callbacks for extension
    deactivation to guarantee that they get called.
    
    * Fixed hint reference leak in ast_add_hint() if the callback container
    constructor failed.
    
    * Fixed hint reference leak in complete_core_show_hint() for every hint it
    found for CLI tab completion.
    
    * Adjusted locking in ast_merge_contexts_and_delete() for safety.
    
    * Added context_merge_lock to prevent ast_merge_contexts_and_delete() and
    handle_statechange() from interfering with each other.
    
    * Fixed ast_change_hint() not taking into account that the extension is
    used for the hash key.
    
    (closes issue ASTERISK-17666)
    Reported by: irroot
    Tested by: irroot
    JIRA SWP-3318
    
    (closes issue ASTERISK-17760)
    Reported by: Byron Clark
    Tested by: irroot
    JIRA SWP-3393
    
    Review: https://reviewboard.asterisk.org/r/1313/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@329332 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-22 20:46:36 +00:00
Matthew Nicholson 7eda60dca1 Merged revisions 327512 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r327512 | mnicholson | 2011-07-11 08:53:59 -0500 (Mon, 11 Jul 2011) | 2 lines
  
  reset our buffer each iteration when doing variable substitution
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@327513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-11 13:55:28 +00:00
Matthew Nicholson 2ac180275d Merged revisions 327106 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r327106 | mnicholson | 2011-07-08 14:52:51 -0500 (Fri, 08 Jul 2011) | 11 lines
  
  Reset our ast_str before passing it on to dialplan function backends.
  
  It is possible for a dialplan backend to not modify the given buffer or ast_str
  and still return success. This causes any previous value stored in the buffer
  to be used as if the new function call provided it. Some functions also append
  to the given buffer assuming it is empty.
  
  The test_substitution unit test has also been modified to detect this problem.
  
  (closes issue ASTERISK-17878)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@327107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-08 19:54:23 +00:00
Richard Mudgett a0cbad527c Merged revisions 326985 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r326985 | rmudgett | 2011-07-07 20:08:05 -0500 (Thu, 07 Jul 2011) | 12 lines
  
  Some code cleanup in pbx.c
  
  * Mostly comment and format changes.
  
  * ast_context_remove_extension_callerid() and ast_add_extension_nolock()
  will write lock the found specific context.
  
  * ast_context_find() will now tolerate a NULL name.
  
  * Eliminated some inlined versions of find_context() and
  find_context_locked().
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@327000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-08 01:26:01 +00:00
David Vossel 09a359449e Merged revisions 324364 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r324364 | dvossel | 2011-06-21 15:11:52 -0500 (Tue, 21 Jun 2011) | 10 lines
  
  Fixes locking inversion issue in ast_async_goto()
  
  During this function we can not hold the "chan" lock while
  doing the masquerade, the explicit goto on the tmp chan, or
  the channel alloc.  Instead we need to get the channel lock,
  store off information about the channel that we need, and
  then let the channel lock go for the remainder of the function.
  
  Review: https://reviewboard.asterisk.org/r/1275/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@324365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-21 20:15:41 +00:00
Leif Madsen 71e4b2a5d1 Merged revisions 324115 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r324115 | lmadsen | 2011-06-17 11:14:54 -0400 (Fri, 17 Jun 2011) | 3 lines
  
  Fix grammar in documentation for Goto() and GotoIf()
  (closes issue ASTERISK-18023)
  Reported by: Tim Osman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@324131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-17 15:32:08 +00:00
Russell Bryant c73ea18012 Merged revisions 317917 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r317917 | russell | 2011-05-06 16:06:33 -0500 (Fri, 06 May 2011) | 7 lines
  
  Fix calculation of free RAM to make minmemfree option work.
  
  (closes issue #17124)
  Reported by: loic
  Patches:
        pbx_c.diff uploaded by loic (license 1020)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-06 21:07:49 +00:00
Russell Bryant 37aa52fd78 Merged revisions 316265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines
  
  Fix a bunch of compiler warnings generated by gcc 4.6.0.
  
  Most of these are -Wunused-but-set-variable, but there were a few others
  mixed in here, as well.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 20:45:32 +00:00
Richard Mudgett 24b6939496 Merged revisions 315645 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r315645 | rmudgett | 2011-04-26 17:14:31 -0500 (Tue, 26 Apr 2011) | 21 lines
  
  The 'e' special extension fails to trigger in at least two cases.
  
  The 'e' extension is a fall back for the 'i', 't', or 'T' extensions if
  any of them do not exist.  Many of the places the 'e' extension was
  supposed to be invoked fail because the priority was set wrong.  There
  were two places where the 'e' extension was not even checked for fall
  back.
  
  * Made invoke the 'e' extension similarly to the previous 'i', 't', or 'T'
  extension check and added the 'e' extension as a fall back to the two
  missing locations.
  
  * Prioritized and optimized some hangup tests associated with the 'e'
  extension.
  
  (closes issue #19136)
  Reported by: kshumard
  Tested by: rmudgett
  
  Review: https://reviewboard.asterisk.org/r/1196/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@315649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-26 22:18:41 +00:00