Commit Graph

914 Commits

Author SHA1 Message Date
Russell Bryant 5b7a769fd8 (mix)monitor: Add options to enable a periodic beep
Add an option to enable a periodic beep to be played into a call if it
is being recorded.  If enabled, it uses the PERIODIC_HOOK() function
internally to play the 'beep' prompt into the call at a specified
interval.  This option is provided for both Monitor() and
MixMonitor().

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-15 23:21:19 +00:00
Russell Bryant 39ba6a16f5 func_periodic_hook: move module ref
The previous code left one error path where the module would be unref'd twice
instead of once.  It was done once in the error handling block, and again inside
of datastore destruction.

Now the module ref is only released in the datastore destructor and only acquired
when the datastore has been successfully allocated.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-12 01:35:34 +00:00
Russell Bryant 23329d07cf func_periodic_hook: add module ref counting
This module lacked necessary module ref count incrementing and decrementing
when used.  This patch adds it.  There's already a datastore used, so doing the
ref counting along with the lifetime of the datastore provides a convenient
place to do it.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-12 01:26:28 +00:00
Russell Bryant 607c6e9772 func_periodic_hook: List more modules as dependencies
This module makes use of some existing Asterisk components.  app_chanspy was
already listed as a dependency.  There are a few function modules used, as
well, so list them.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-08 00:26:57 +00:00
Russell Bryant ea290b2c3e func_periodic_hook: New function for periodic hooks.
This commit introduces a new dialplan function, PERIODIC_HOOK().
It allows you run to a dialplan hook on a channel periodically.  The
original use case that inspired this was the ability to play a beep
periodically into a call being recorded.  The implementation is much
more generic though and could be used for many other things.

The implementation makes heavy use of existing Asterisk components.
It uses a combination of Local channels and ChanSpy() to run some
custom dialplan and inject any audio it generates into an active call.

The other important bit of the implementation is how it figures out
when to trigger the beep playback.  This implementation uses the
audiohook API, even though it's not actually touching the audio in any
way.  It's a convenient way to get a callback and check if it's time
to kick off another beep.  It would be nice if this was timer event
based instead of polling based, but unfortunately I don't see a way to
do it that won't interfere with other things.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-04-05 13:06:34 +00:00
Corey Farrell fbe0dfaf44 Fix dialplan function NULL channel safety issues
(closes issue ASTERISK-23391)
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/3386/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-27 19:21:44 +00:00
Mark Michelson d44aefeef4 Fix stuck channel in ARI through the introduction of synchronous bridge actions.
Playing back a file to a channel in an ARI bridge would attempt to wait until
the playback concluded before returning. The method used involved signaling the
waiting thread in the ARI custom playback function.

The problem with this is that there were some corner cases that were not accounted for:
* If a bridge channel could not be found, then we never would attempt the playback but
  would still attempt to wait for the playback to complete.
* If the bridge playfile action failed to queue, we would still attempt to wait for the
  playback to complete.
* If the bridge playfile action were queued but some circumstance caused the playback
  not to occur (the bridge dies, the channel is removed from the bridge), then we would
  never be notified.

The solution to this is to move the waiting logic into the bridge code. A new bridge
API function is added to queue a synchronous action on a bridge. The waiting thread
is notified when the queued frame has been freed, either due to an error occurring
or due to successful playback. As a failsafe, the waiting thread has a 10 minute
timeout just in case there is a frame leak somewhere.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-17 17:22:12 +00:00
George Joseph a4906e9f86 sorcery: Create AST_SORCERY dialplan function.
This patch creates the AST_SORCERY dialplan function which allows someone to
retrieve any value from a sorcery-based config file.  It's similar to 
AST_CONFIG.

The creation of the function itself was fairly straightforward but it required
changes to the underlying sorcery infrastructure that rippled into individual
sorcery objects.  The changes stemmed from inconsistencies in how sorcery
created ast_variable objectsets from sorcery objects and the inconsistency
in how individual objects used that feature especially when it came to
parameters that can be specified multiple times like contact in aor and match
in identify.  You can read more here...
http://lists.digium.com/pipermail/asterisk-dev/2014-February/065202.html

So, what this patch does, besides actually creating the AST_SORCERY function,
is the following...

* Creates ast_variable_list_append which is a helper to append one ast_variable
  list to another.
* Modifies the ast_sorcery_object_field_register functions to accept the
  already-defined sorcery_fields_handler callback.
* Modifies ast_sorcery_objectset_create to accept a parameter indicating return
  type preference...a single ast_variable with all values concatenated or an
  ast_variable list with multiple entries.  Also fixed a few bugs.
* Modifies individual sorcery object implementations to use the new function
  definition of the ast_sorcery_object_field_register functions.
* Modifies location.c and res_pjsip_endpoint_identifier_ip.c to implement
  sorcery_fields_handler handlers so they return multiple occurrences as an
  ast_variable_list.
* Added a whole bunch of tests to test_sorcery.

(closes issue ASTERISK-22537)
Review: http://reviewboard.asterisk.org/r/3254/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@410042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-06 22:39:54 +00:00
Mark Michelson ad39358e19 Fix documentation for PRESENCE_STATE to properly illustrate how to create a presence hint.
There was a missing comma.
This was discovered by Dan Kaplan.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-05 18:47:30 +00:00
Michael L. Young 959c3a7c15 func_audiohookinheritance: Check If A Channel Was Specified
This patch prevents a crash when using the function audiohookinheritance without
setting the channel.

(closes issue ASTERISK-23104)
Reported by: Joel Vandal
Tested by: Joel Vandal
Patches:
    asterisk-23104_audiohook_inherit_no_channel-11.diff
                                     uploaded by Michael L. Young (license 5026)

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@409627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-03-04 19:34:52 +00:00
Matthew Jordan 5fd63e2d0b funcs/func_cdr: Handle empty time values when extracting parsed values
When extracting timestamps that are parsed, time stamp values that are not set
(time values of 0.000000) should not actually result in a parsed string. The
value should be skipped, and the result of the CDR function should be an
empty string.

Prior to this patch, the result was fed to the time formatting, which would
result in an output of a date/time in 1969.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407748 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-07 19:40:23 +00:00
Matthew Jordan 9e7a10d894 funcs/func_cdr: Fix non-epoch timestamps broken by improper char array deref
Thanks to snuffy for pointing this issue out and fixing it.

(closes issue ASTERISK-23250)
Reported by: snuffy
patches:
  func_cdr-fix.diff uploaded by snuffy (License 5024)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-02-04 16:55: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 373965dbff CDRs: Synchronize dialplan applications that manipulate CDRs with the engine
In https://reviewboard.asterisk.org/r/3057/, applications and functions that
manipulate CDRs were made to interact over Stasis. This was done to
synchronize manipulations of CDRs from the dialplan with the updates the
engine itself receives over the message bus.

This change rested on a faulty premise: that messages published to the CDR
topic or to a topic that forwards to the CDR topic are synchronized with the
messages handled by the CDR topic subscription in the CDR engine. This is not
the case. There is no ordering guaranteed for two messages published to the
same topic; ordering is only guaranteed if a message is published to the same
subscriber.

Stasis was modified in r405311 to allow a publisher to synchronize on the
subscriber. This patch uses that API to synchronize the CDR publishers with
the CDR engine message router, which maintains the overall topic subscription.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-12 22:13:12 +00:00
Scott Griepentrog ff02c8e254 func_strings: use memmove to prevent overlapping memory on strcpy
When calling REPLACE() with an empty replace-char argument, strcpy
is used to overwrite the the matching <find-char>.  However as the
src and dest arguments to strcpy must not overlap, it causes other
parts of the string to be overwritten with adjacent characters and
the result is mangled.  Patch replaces call to strcpy with memmove
and adds a test suite case for REPLACE.

(closes issue ASTERISK-22910)
Reported by: Gareth Palmer
Review: https://reviewboard.asterisk.org/r/3083/
Patches:
    func_strings.patch uploaded by Gareth Palmer (license 5169)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-01-02 19:38:09 +00:00
Richard Mudgett e4803bbd9e Voicemail: Remove mailbox identifier format (box@context) assumptions in the system.
This change is in preparation for external MWI support.

Removed code from the system for normal mailbox handling that appends
@default to the mailbox identifier if it does not have a context.  The
only exception is the legacy hasvoicemail users.conf option.  The legacy
option will only work for app_voicemail mailboxes.  The system cannot make
any assumptions about the format of the mailbox identifer used by
app_voicemail.

chan_sip and chan_dahdi/sig_pri had the most changes because they both
tried to interpret the mailbox identifier.  chan_sip just stored and
compared the two components.  chan_dahdi actually used the box
information.

The ISDN MWI support configuration options had to be reworked because
chan_dahdi was parsing the box@context format to get the box number.  As a
result the mwi_vm_boxes chan_dahdi.conf option was added and is documented
in the chan_dahdi.conf.sample file.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-19 16:52:43 +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
Rusty Newton 2a6df87fcd func_strings: Documentation fix for QUOTE()
Example output was inaccurate.

(issue ASTERISK-22970)
(closes issue ASTERISK-22970)
Reported by: Gareth Palmer
Patches:
   func_strings.patch uploaded by Gareth Palmer (license 5169)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-18 00:36:54 +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
Matthew Jordan ce423d2ea4 func_channel, chan_pjsip: Add CHANNEL read function support for chan_pjsip
This patch adds CHANNEL read support for chan_pjsip. This allows the dialplan
to use the CHANNEL function on a chan_pjsip channel to obtain run-time
information about the channel from the PJSIP channel driver and the PJSIP
stack. This includes:
 * RTP information, including source/destination media addresses, whether or
   not the media is secure, held, and other properties.
 * RTCP information. This includes sets of parseable information, as well as
   individual statistic attriutes.
 * PJSIP information. This includes URIs, local/remote signalling addresses,
   whether or not the signalling is secure, and other properties.
 * The endpoint name. This can be used in conjunction with the PJSIP_ENDPOINT
   function to obtain more detailed endpoint information.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-11 13:06:30 +00:00
Matthew Jordan f46b30bd36 func_pjsip_endpoint: Add PJSIP_ENDPOINT function for querying endpoint details
This patch adds a new function, PJSIP_ENDPOINT, which lets the dialplan query,
for any endpoint, any property configured on an endpoint. This function is a
companion to the CHANNEL function, which can be used to extract the endpoint
name for a channel.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@403617 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-12-11 12:31:57 +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 beb5cdbef5 memory leaks: Memory leak cleanup patch by Corey Farrell (first set)
(issue ASTERSIK-22467)
Reported by: Corey Farrell
Patches:
    chan_sip-parse_contact_header_test-free-contacts.patch uploaded by coreyfarrell (license 5909)
    cli-filename-completion-leak.patch uploaded by coreyfarrell (license 5909)
    func_math.patch uploaded by corefarrell (license 5909)
    main-test-cleanup.patch uploaded by coreyfarrell (license 5909)
    test_dlinklists.patch uploaded by coreyfarrell (license 5909)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-23 20:10:30 +00:00
Kinsey Moore 4e72ad1b4f Fix func_config list entry allocation
The AST_CONFIG dialplan function defined in func_config.c allocates its
config file list entries using ast_malloc. List entry allocations
destined for use with Asterisk's linked list API must be ast_calloc()d
or otherwise initialized so that list pointers are set to NULL. These
uses of ast_malloc have been replaced by ast_calloc to prevent
dereferencing of uninitialized pointer values when traversing the list.

(closes issue ASTERISK-22483)
Reported by: Brian Scott
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-10-08 18:19:59 +00:00
Matthew Jordan de07050d0f Parse arguments passed to the CDR_PROP function correctly
I can only blame this on a bad merge, because this in no way worked properly
the way it was written. Mea culpa. The function should now parse its arguments
correctly and function properly. (Note that the API used by the CDR_PROP
function has working unit tests... this was merely bad coding of the actual
registered function)

(closes issue ASTERISK-22613)
Reported by: Private Name
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 19:58:19 +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 83bf017db9 Fix incorrect usages of ast_realloc().
There are several locations in the code base where this is done:
buf = ast_realloc(buf, new_size);

This is going to leak the original buf contents if the realloc fails.

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398760 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-10 18:05:47 +00:00
Richard Mudgett 186db8fdaf Fix some uninitialized buffers for CDR handling valgrind found.
* Made ast_strftime_locale() ensure that the output buffer is initialized.
The std library strftime() returns 0 and does not touch the buffer if it
has an error.  However, the function can also return 0 without an error.

(closes issue ASTERISK-22412)
Reported by: rmudgett
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 23:15:43 +00:00
Richard Mudgett 5482fd21c8 Some CDR code optimization.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 22:24:01 +00:00
Richard Mudgett 4ea0acbb44 Whitespace and curly braces.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-28 21:38:39 +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
David M. Lee c790848794 ARI: Add recording controls
This patch implements the controls from ARI recordings. The controls
are:

 * DELETE /recordings/live/{recordingName} - stop recording and
   discard it
 * POST /recordings/live/{recordingName}/stop - stop recording
 * POST /recordings/live/{recordingName}/pause - pause recording
 * POST /recordings/live/{recordingName}/unpause - resume recording
 * POST /recordings/live/{recordingName}/mute - mute recording (record
   silence to the file)
 * POST /recordings/live/{recordingName}/unmute - unmute recording.

Since this underlying functionality did not already exist, is was
added to app.c by a set of control frames, similar to how playback
control works. The pause/mute control frames are toggles, even though
the ARI controls are idempotent, to be consistent with the playback
control frames.

(closes issue ASTERISK-22181)
Review: https://reviewboard.asterisk.org/r/2697/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-06 14:44:45 +00:00
Walter Doekes 07d3705b42 Check result of ast_var_assign() calls for memory allocation failure (2).
Missed a spot in the previous commit.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-06 08:43:22 +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
Mark Michelson f8622e7c5c Get rid of ast_bridged_channel() and the bridged_channel field on ast_channels.
This commit is smaller than the initial review placed on review board. This is because
a change to allow for channel drivers to access parking functionality externally was
committed and invalidated quite a few of the changes initially made.

(closes issue ASTERISK-22039)
reported by Matt Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-02 14:05:07 +00:00
Kinsey Moore 03090a88ba Fix documentation replication issues
This prevents XML documentation duplication by expanding channel and
bridge snapshot tags into channel and bridge snapshot parameter sets
with a given prefix or defaulting to no prefix. This also prevents
documentation from becoming fractured and out of date by keeping all
variations of the documentation in template form such that it only
needs to be updated once and keeps maintenance to a minimum.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-01 17:07:52 +00:00
Matthew Jordan cafc115896 A great big renaming patch
This patch renames the bridging* files to bridge*. This may seem pedantic
and silly, but it fits better in line with current Asterisk naming conventions:
* channel is not "channeling"
* monitor is not "monitoring"
etc.

A bridge is an object. It is a first class citizen in Asterisk. "Bridging" is
the act of using a bridge on a set of channels - and the API that fulfills that
role is more than just the action.

(closes issue ASTERISK-22130)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-25 04:06:32 +00:00
Matthew Jordan 9d8a5ceb02 Move after bridge callbacks into their own file
One more major refactoring to go.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-25 02:20:23 +00:00
Jonathan Rose f3fcf0aa2e func_channel: dtmf_features setting
Allows reading andsetting dtmf features via a channel function
CHANNEL(dtmf_features)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@395215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-23 21:32:33 +00:00
Matthew Jordan 88e344d2df Clean up documentation
This patch cleans up documentation in func_channel for the following items:
* rtpsource
* secure_signaling
* secure_media
* various OOH323 parameters

(closes issue ASTERISK-20969)
Reported by: snuffy
patches:
  func_chan-update.diff uploaded by snuffy (License 5024)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-21 22:09:23 +00:00
Matthew Jordan a3592db1fb Clarify documentation for function PASSTHRU
It is not apparent to the average user that the PASSTHRU function should not
be passed as ${PASSTHRU(string)} but just as PASSTHRU(string) to functions
which take a variable name and not its contents.

This patch clarifies the behavior in the documentation and provides an example.

(closes issue ASTERISK-21717)
Reported by: Richard Miller
patches:
  func_strings.diff uploaded by Richard Miller (license 5685)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-14 02:00:02 +00:00
Jonathan Rose d014ad2261 func_channel: Read/Write after_bridge_goto option
Allows reading and setting of a channel's after_bridge_goto datastore

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-26 20:59:14 +00:00
Matthew Jordan 68103abba3 Handle variable substitution in dummy variables
When func_cdr is used for variable substitution, there is no channel name
and hence no run-time information available for CDR variable substitution.
In that case, the correct thing to do is to use the CDR object on the channel
passed to the function. This patch checks to see if the channel passed in
has a name - if not, it uses ast_cdr_format_var instead of ast_cdr_get_var.

This allows CDR backends to continue to use variable substitution in order to
resolve ast_cdr object properties.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-19 01:28:40 +00:00
David M. Lee 4aa47d6893 Fix build warnings related to printf/scanf of tv_usec.
The type of tv_usec is suseconds_t. On Linux, this is usually a long int, but
the specification is actually pretty lax on what it might actually be. And,
sadly, there's no printf/scanf width specifier for suseconds_t. So it could
bit an int or a long, but there's not a great way to tell which it is.

This patch fixes scanf by reading into a long temporary variable that's then
stored into the tv_usec. It fixes printf by casting the tv_usec to a long
first.

This patch also adds some missing width specifiers for some debug statements,
which would cause ".000001" to be displayed at ".1".


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-17 18:58:56 +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
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
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
Matthew Jordan b3bb6608ef Migrate SHARED's use of the VarSet AMI event to Stasis-Core
This patch removes the direct call to AMI from the SHARED function
and instead call Stasis-Core. Stasis-Core delivers the notification
that a shared variable has changed on a channel to all interested
consumers.

(issue ASTERISK-21462)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-04 15:24:31 +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
Matthew Jordan 1cafccdf87 Update documentation for CHANNEL function
Document that you can read/write the 'accountcode' and 'amaflags' on a channel.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-04-03 17:17:33 +00:00
Walter Doekes 220cc9b9af Have func_curl log a warning when a curl request fails.
Review: https://reviewboard.asterisk.org/r/2403/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-20 20:27:37 +00:00
Walter Doekes 0b1e78cace Minor cleanup in func_curl near hashcompat code.
Review: https://reviewboard.asterisk.org/r/2402/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@383458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-03-20 20:18:40 +00:00
Jonathan Rose d7a616c945 PRESENCE_STATE: Provide better documentation for the 'e' option.
Notes that the 'e' option actually decodes data when used as a write function
such as with the SET application while it encodes data when used to read.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-18 19:48:47 +00:00
Matthew Jordan c209e85ad3 Fix crash in PresenceState AMI action when specifying an invalid provider
This patch fixes a crash in Asterisk that could be caused by using the
PresenceState AMI action while providing an invalid provider. This patch
also adds some additional warnings when a user attempts to provide the
PresenceState action with invalid data, and removes some NOTICE statements
that were still lurking in the code from testing.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-02-15 23:29:28 +00:00
Richard Mudgett 32ac38ea37 Improve func FRAME_TRACE DTMF digit format.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@380655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-31 18:15:49 +00:00
Matthew Jordan 7d9871b394 Add ControlPlayback manager action
This patch adds the capability for asynchronous manipulation of audio being
played back to a channel though a new AMI action "ControlPlayback". The
ControlPlayback action supports a number of operations, the availability of
which depend on the application being used to send audio to the channel.
When the audio playback was initiated using the ControlPlayback application
or CONTROL STREAM FILE AGI command, the audio can be paused, stopped,
restarted, reversed, or skipped forward. When initiated by other mechanisms
(such as the Playback application), the audio can be stopped, reversed, or
skipped forward.

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

(closes issue ASTERISK-20882)
Reported by: mjordan



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-22 15:16:20 +00:00
Matthew Jordan 89f9e077d7 Prevent crashes from occurring when reading from data sources with large values
When reading configuration data from an Asterisk .conf file or when pulling
data from an Asterisk RealTime backend, Asterisk was copying the data on the
stack for manipulation. Unfortunately, it is possible to read configuration
data or realtime data from some data source that provides a large blob of
characters. This could potentially cause a crash via a stack overflow.

This patch prevents large sets of data from being read from an ARA backend or
from an Asterisk conf file.

(issue ASTERISK-20658)
Reported by: wdoekes
Tested by: wdoekes, mmichelson
patches:
 * issueA20658_dont_process_overlong_config_lines.patch uploaded by wdoekes (license 5674)
 * issueA20658_func_realtime_limit.patch uploaded by wdoekes (license 5674)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378377 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 22:10:32 +00:00
Matthew Jordan 8fb5bdce9a Prevent exhaustion of system resources through exploitation of event cache
Asterisk maintains an internal cache for devices in the event subsystem. The
device state cache holds the state of each device known to Asterisk, such that
consumers of device state information can query for the last known state for
a particular device, even if it is not part of an active call. The concept of
a device in Asterisk can include entities that do not have a physical
representation. One way that this occurred was when anonymous calls are allowed
in Asterisk. A device was automatically created and stored in the cache for
each anonymous call that occurred; this was possible in the SIP and IAX2
channel drivers and through channel drivers that utilized the
res_jabber/res_xmpp resource modules (Gtalk, Jingle, and Motif). These devices
are never removed from the system, allowing anonymous calls to potentially
exhaust a system's resources.

This patch changes the event cache subsystem and device state management to
no longer cache devices that are not associated with a physical entity.

(issue ASTERISK-20175)
Reported by: Russell Bryant, Leif Madsen, Joshua Colp
Tested by: kmoore
patches:
  event-cachability-3.diff uploaded by jcolp (license 5000)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-01-02 18:11:59 +00:00
Sean Bright 0877ba5b37 Minor spelling fix to the VOLUME documentation.
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-30 17:08:41 +00:00
Matthew Jordan a0c363e227 Refactor ast_timer_ack to return an error and handle the error in timer users
Currently, if an acknowledgement of a timer fails Asterisk will not realize
that a serious error occurred and will continue attempting to use the timer's
file descriptor.  This can lead to situations where errors stream to the
CLI/log file.  This consumes significant resources, masks the actual problem
that occurred (whatever caused the timer to fail in the first place), and
can leave channels in odd states.

This patch propagates the errors in the timing resource modules up through
the timer core, and makes users of these timers handle acknowledgement
failures.  It also adds some defensive coding around the use of timers
to prevent using bad file descriptors in off nominal code paths.

Note that the patch created by the issue reporter was modified slightly for
this commit and backported to 1.8, as it was originally written for
Asterisk 10.

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

(issue ASTERISK-20032)
Reported by: Jeremiah Gowdy
patches:
  jgowdy-timerfd-6-22-2012.diff uploaded by Jeremiah Gowdy (license 6358)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-05 23:10:14 +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
Andrew Latham b106b77041 Title update
Update title that was left behind many years ago. Used revision 6596 as my guide for what it should be.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14 21:56:13 +00:00
Mark Michelson fdfb3ae5fa Allow for redirecting reasons to be set to arbitrary strings.
This allows for the REDIRECTING dialplan function to be
used to set the reason to any string.

The SIP channel driver has been modified to set the redirecting
reason string to the value received in a Diversion header. In
addition, SIP 480 response reason text will set the redirecting
reason as well.

(closes issue AST-942)
reported by Malcolm Davenport

(closes issue AST-943)
reported by Malcolm Davenport

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 19:29:14 +00:00
Mark Michelson d9d7b1f3e3 "He who go through turnstile sideways is going to Bangkok"
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-25 14:13:08 +00:00
Jonathan Rose 87370eeced func_audiohookinherit: Document some missed sources.
This patch also mentions that AUDIOHOOK_INHERIT can be used to
transfer MixMonitor audiohooks. There is also wiki that addresses
audiohooks and the use of AUDIOHOOK_INHERIT at the following link:
https://wiki.asterisk.org/wiki/display/AST/Audiohooks

(closes issue ASTERISK-18220)
Reported by: Ishfaq Malik
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-24 21:19:49 +00:00
Andrew Latham 6f61cb50c5 Doxygen Updates - janitor work
Doxygen updates including mistakes, misspellings, missing parameters, updates for Doxygen style.  Some missing txt file links are removed but their content or essense will be included in some later updates.  A majority of the txt files were removed in the 1.6 era but never noted. The HR and EXTREF are simple changes that make the documentation more compatable with more versions of Doxygen.

Further updates coming.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-21 17:14:59 +00:00
Richard Mudgett da5944fc56 Named call pickup groups. Fixes, missing functionality, and improvements.
* ASTERISK-20383
Missing named call pickup group features:

CHANNEL(callgroup) - Need CHANNEL(namedcallgroup)
CHANNEL(pickupgroup) - Need CHANNEL(namedpickupgroup)
Pickup() - Needs to also select from named pickup groups.

* ASTERISK-20384
Using the pickupexten, the pickup channel selection could fail even though
there was a call it could have picked up.  In a call pickup race when
there are multiple calls to pickup and two extensions try to pickup a
call, it is conceivable that the loser will not pick up any call even
though it could have picked up the next oldest matching call.

Regression because of the named call pickup group feature.

* See ASTERISK-20386 for the implementation improvements.  These are the
changes in channel.c and channel.h.

* Fixed some locking issues in CHANNEL().

(closes issue ASTERISK-20383)
Reported by: rmudgett
(closes issue ASTERISK-20384)
Reported by: rmudgett
(closes issue ASTERISK-20386)
Reported by: rmudgett
Tested by: rmudgett

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-20 17:22:41 +00:00
Richard Mudgett 8b90b7a565 Remove annoying unconditional debug message from INC/DEC functions.
(closes issue AST-1001)
Reported by: Guenther Kelleter
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@372631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-07 22:10:33 +00:00
Mark Michelson 6a539ace84 Fix misuses of asprintf throughout the code.
This fixes three main issues

* Change asprintf() uses to ast_asprintf() so that it
pairs properly with ast_free() and no longer causes
MALLOC_DEBUG to freak out.

* When ast_asprintf() fails, set the pointer NULL if
it will be referenced later.

* Fix some memory leaks that were spotted while taking
care of the first two points.

(Closes issue ASTERISK-20135)
reported by Richard Mudgett

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-21 21:01:11 +00:00
Matthew Jordan 78fea20ea7 Make the name of the "HangupCauseClear" application consistent
The name of the "HangupCauseClear" application is "HangupCauseClear",
not "HangupcauseClear".  The incorrect case of 'cause' caused the
XML documentation to not register properly.

As an aside, this commit message felt very awkward, but I'm not sure
how else to note that "X", which has to be "X", was referred to as "x".

(closes issue ASTERISK-20253)
Reported by: Andrew Latham
Patches:
  hangupcause.diff uploaded by Andrew Latham (license #5985)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-18 01:34:50 +00:00
Richard Mudgett fb6238899b Add private representation of caller, connected and redirecting party ids.
This patch adds the feature "Private representation of caller, connected
and redirecting party ids", as previously discussed with us (DATUS) and
Digium.

1. Feature motivation

Until now it is quite difficult to modify a party number or name which can
only be seen by exactly one particular instantiated technology channel
subscriber.  One example where a modified party number or name on one
channel is spread over several channels are supplementary services like
call transfer or pickup.  To implement these features Asterisk internally
copies caller and connected ids from one channel to another.  Another
example are extension subscriptions.  The monitoring entities (watchers)
are notified of state changes and - if desired - of party numbers or names
which represent the involving call parties.  One major feature where a
private representation of party names is essentially needed, i.e.  where a
party name shall be exclusively signaled to only one particular user, is a
private user-specific name resolution for party numbers.  A lookup in a
private destination-dependent telephone book shall provide party names
which cannot be seen by any other user at any time.

2. Feature Description

This feature comes along with the implementation of additional private
party id elements for caller id, connected id and redirecting ids inside
Asterisk channels.

The private party id elements can be read or set by the user using
Asterisk dialplan functions.

When a technology channel is initiating a call, receives an internal
connected-line update event, or receives an internal redirecting update
event, it merges the corresponding public id with the private id to create
an effective party id.  The effective party id is then used for protocol
signaling.

The channel technologies which initially support the private id
representation with this patch are SIP (chan_sip), mISDN (chan_misdn) and
PRI (chan_dahdi).

Once a private name or number on a channel is set and (implicitly) made
valid, it is generally used for any further protocol signaling until it is
rewritten or invalidated.

To simplify the invalidation of private ids all internally generated
connected/redirecting update events and also all connected/redirecting
update events which are generated by technology channels -- receiving
regarding protocol information - automatically trigger the invalidation of
private ids.

If not using the private party id representation feature at all, i.e.  if
using only the 'regular' caller-id, connected and redirecting related
functions, the current characteristic of Asterisk is not affected by the
new extended functionality.

3. User interface Description

To grant access to the private name and number representation from the
Asterisk dialplan, the CALLERID, CONNECTEDLINE and REDIRECTING dialplan
functions are extended by the following data types.  The formats of these
data types are equal to the corresponding regular 'non-private' already
existing data types:

CALLERID:
priv-all
priv-name priv-name-valid priv-name-charset priv-name-pres
priv-num priv-num-valid priv-num-plan priv-num-pres
priv-subaddr priv-subaddr-valid priv-subaddr-type priv-subaddr-odd
priv-tag

CONNECTEDLINE:
priv-name priv-name-valid priv-name-pres priv-name-charset
priv-num priv-num-valid priv-num-pres priv-num-plan
priv-subaddr priv-subaddr-valid priv-subaddr-type priv-subaddr-odd
priv-tag

REDIRECTING:
priv-orig-name priv-orig-name-valid priv-orig-name-pres priv-orig-name-charset
priv-orig-num priv-orig-num-valid priv-orig-num-pres priv-orig-num-plan
priv-orig-subaddr priv-orig-subaddr-valid priv-orig-subaddr-type priv-orig-subaddr-odd
priv-orig-tag

priv-from-name priv-from-name-valid priv-from-name-pres priv-from-name-charset
priv-from-num priv-from-num-valid priv-from-num-pres priv-from-num-plan
priv-from-subaddr priv-from-subaddr-valid priv-from-subaddr-type priv-from-subaddr-odd
priv-from-tag

priv-to-name priv-to-name-valid priv-to-name-pres priv-to-name-charset
priv-to-num priv-to-num-valid priv-to-num-pres priv-to-num-plan
priv-to-subaddr priv-to-subaddr-valid priv-to-subaddr-type priv-to-subaddr-odd
priv-to-tag

Reported by: Thomas Arimont

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-10 19:54:55 +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
Richard Mudgett 49a6b4935e Fix some presence-state unit test typos.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370597 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-30 23:18:13 +00:00
Matthew Jordan b6a0ae0b35 Unit tests for the Jitter Buffer API; remove unnecessary resync
This patch includes the following:
* Unit tests for the abstract Jitter Buffer API.  This includes both fixed
  and adaptive flavors, testing nominal creation, frame input, frame retrieval,
  resyncing; off nominal frame input overflow, out of order, and others.
* Tweaks to the abstract_jb API to remove the unnecessary resync_threshold
  parameter from the create function (resync_threshold is already in the
  struct passed into the create function)
* Ensure the fixed jitter buffer is empty before destroying it, to avoid an
  ASSERT
* Don't "resync" the adaptive jitter buffer.  The mechanism that was being
  used actually causes the jitter buffer to think its being overflowed by going
  around the jitterbuf API and attempting to 'resynch' it improperly.  If a
  resync is needed, the jitter buffer will do it properly by itself.  Note that
  this is only an optimization needed for trunk, as the worst that happens is 
  the loss of three voice packets before the adaptive jitter buffer will resync
  anyway.
  
Review: https://reviewboard.asterisk.org/r/2035


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-23 21:15:26 +00:00
Kevin P. Fleming ec14c2563e Improve documentation for the SHELL() dialplan function.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-23 21:10:27 +00:00
Kinsey Moore cb9756daa2 Add hangupcause translation support
The HANGUPCAUSE hash (trunk only) meant to replace SIP_CAUSE has now
been replaced with the HANGUPCAUSE and HANGUPCAUSE_KEYS dialplan
functions to better facilitate access to the AST_CAUSE translations
for technology-specific cause codes. The HangupCauseClear application
has also been added to remove this data from the channel.

(closes issue SWP-4738)
Review: https://reviewboard.asterisk.org/r/2025/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-20 15:48:55 +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
Michael L. Young 6761812566 Correct Documentation For DEC Function
The documentation for DEC in func_math.c was incorrect.  Looks like a copy and
paste error.

(Closes issue ASTERISK-20095)
Reported by: Billy Chia
Tested by: Michael L. Young
Patches:
    func_math.patch uploaded by Billy Chia (license 6381)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-12 14:38:44 +00:00
Michael L. Young 9bd9eb809c Reverting last merge since it wasn't completed properly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-12 14:36:44 +00:00
Michael L. Young a8c12c6e67 Correct Documentation For DEC Function
The documentation for DEC in func_math.c was incorrect.  Looks like a copy and
paste error.

(Closes issue ASTERISK-20095)
Reported by: Billy Chia
Tested by: Michael L. Young
Patches:
    func_math.patch uploaded by Billy Chia (license 6381)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-12 14:27:56 +00:00
Tilghman Lesher 6190ae4430 Allow the REALTIME() function to report errors back to the caller.
Also, do more error checking on the arguments specified to the REALTIME()
function and clarify the documentation.  While I was editing the file, a
few coding guidelines fixups, as well.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-11 17:16:50 +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
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
Mark Michelson 21997aa7bb Fix a deadlock that occurs when func_volume is used on a local channel.
This was discovered by trying to perform a call forward to an extension
that makes use of func_volume. When the local channel is optimized away,
the datastore on the local;2 channel would have its audiohook destroyed
rather than detaching the audiohook from the channel and then destroying
it.

With this patch, func_volume's datastore destructor takes the proper
route of detaching the audiohook and then destroying it.

(closes issue ASTERISK-19611)
reported by Volker Sauer
Patches:
	ASTERISK-19611.patch uploaded by Mark Michelson (license #5049)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368900 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-13 21:17:13 +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
Michael L. Young a7a3050de9 Add documentation to function CHANNEL for options echocan_mode and buffers
The ability to set "echocan_mode" and "buffers" through the dialplan was added
to chan_dahdi some time ago.  This patch adds some documentation to
func_channel.

(Closes issue ASTERISK-19911)
Reported by: Dale Noll
Tested by: Michael L. Young
Patches: 
  asterisk-19911-branch18.diff uploaded by Michael L. Young (license 5026)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-01 03:30:01 +00:00
Richard Mudgett dd2427c141 Coverity Report: Fix issues for error type REVERSE_INULL (core modules)
* Fixes findings: 0-2,5,7-15,24-26,28-31

(issue ASTERISK-19648)
Reported by: Matt Jordan
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-31 18:39:30 +00:00
Matthew Jordan 6eb4e81033 Fix more memory leaks
This patch adds to what was fixed in r366880.  Specifically, it addresses the
following:

* chan_sip:   dispose of an allocated frame in off nominal code paths in
              sip_rtp_read
* func_odbc:  when disposing of an allocated resultset, ensure that any rows
              that were appended to that resultset are also disposed of
* cli:        free the created return string buffer in another off nominal code
              path
* chan_dahdi: free a frame that was allocated by the dsp layer if we choose
              not to process that frame

(issue ASTERISK-19665)
Reported by: Matt Jordan

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18 15:51:16 +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
Kinsey Moore b5a6de76fc Commit framework for HANGUPCAUSE (replacement for SIP_CAUSE)
This is the starting point for the Asterisk 11: Who Hung Up work and provides
a framework which will allow channel drivers to report the types of hangup
cause information available in SIP_CAUSE without incurring the overhead of the
MASTER_CHANNEL dialplan function. The initial implementation only includes
cause generation for chan_sip and does not include cause code translation
utilities.

This change deprecates SIP_CAUSE and replaces its method of reporting cause
codes with the new framework. This change also deprecates the 'storesipcause'
option in sip.conf.

Review: https://reviewboard.asterisk.org/r/1822/
(Closes issue SWP-4221)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-14 19:44:27 +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
Jonathan Rose d1e7473649 Coverity Report: Fix issues for error type UNINIT in Core supported modules
(issue ASTERISK-19652)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/1909/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10 15:57:26 +00:00
Kinsey Moore 781f4657b9 Fix many issues from the NULL_RETURNS Coverity report
Most of the changes here are trivial NULL checks.  There are a couple
optimizations to remove the need to check for NULL and outboundproxy parsing
in chan_sip.c was rewritten to avoid use of strtok.  Additionally, a bug was
found and fixed with the parsing of outboundproxy when "outboundproxy=," was
set.

(Closes issue ASTERISK-19654)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@365400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-04 22:17:38 +00:00
Mark Michelson b5f0647fc8 Fix Coverity-reported ARRAY_VS_SINGLETON error.
As it turned out, this wasn't a huge deal. We were calling
ast_app_parse_options() for a set of options of which none
took arguments. The proper thing to do for this case is to
pass NULL for the "args" parameter here. We were instead passing
a seemingly-randomly chosen char * from the function. While this
would never get written to, you can rest assured things would
have gotten bad had new options (which took arguments) been added
to func_volume.

(closes issue ASTERISK-19656)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-01 23:11:22 +00:00
Richard Mudgett 73f48997f9 Add original party id and reason support.
ISDN ETSI PTP and Q.SIG (And SS7 in future) have support for reporting who
was the original redirecting party of a call.

* Added support for the original redirecting party and reason to the
REDIRECTING function and the system core as well as to the stubbed
locations in sig_pri.c.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-20 00:57:13 +00:00
Walter Doekes 92ca507d72 Fix documentation for ${VERSION(ASTERISK_VERSION_NUM)}.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-19 22:01:20 +00:00
Matthew Jordan 2cc415417e Fix places where a negative return from ftello could be used as invalid input
In a variety of locations in both reading and writing a file, the result
from the C library function ftello is used as input to other functions.  For
the parameters and functions in question, a negative value is invalid input.
This patch checks the return value from the ftello function to determine if
we were able to determine the current position in the file stream and, if not,
fail gracefully.

(issue ASTERISK-19655)
Reported by: Matt Jordan

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17 20:59:25 +00:00
Walter Doekes fc63e07135 Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: junky
Review: https://reviewboard.asterisk.org/r/1743/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17 18:57:40 +00:00
Matthew Jordan 38c0a62413 Allow func_curl to exit gracefully if list allocation fails during write
If the global_curl_info data structure could not be allocated, the
datastore associated with the operation would be free'd, but the function
would not return.  This would later dereference the datastore, almost
certainly causing Asterisk to crash.  With this patch, if the data
structure is not allocated the method will return an error code, and
not attempt any further operation.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-09 21:47:54 +00:00
Matthew Jordan f4fd1b2fb0 Change SHARED function to use a safe traversal when modifying a variable
When the SHARED function modifies a variable, it removes it from its list of
variables and reinserts the new value at the head of the list of variables.
Doing this inside a standard list traversal can be dangerous, as the
standard list traversal does not account for the list being changed.  While
the code in question should not cause a use after free violation due to its
breaking out of the loop after freeing the variable, it could lead to a
maintenance issue if the loop was modified.  This also fixes a violation
reported by a static analysis tool, which also makes this code easier to
maintain in the future. 
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361659 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-09 19:44:35 +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
Paul Belanger fcb7eb3c59 Multiple revisions 361403,361412
........
  r361403 | pabelanger | 2012-04-06 12:24:36 -0400 (Fri, 06 Apr 2012) | 2 lines
  
  Fix typo in svn:keywords
........
  r361412 | pabelanger | 2012-04-06 12:27:30 -0400 (Fri, 06 Apr 2012) | 2 lines
  
  Fix typo in svn:keywords
........

Merged revisions 361403,361412 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-06 16:33:24 +00:00
Jonathan Rose 6cd462cca8 Make 'help devstate change' display properly (get rid of excess comma)
(closes issue ASTERISK-19444)
Reported by: Makoto Dei
Patches:
	devstate-change-usage-truncate.patch uploaded by Makoto Dei (license 5027)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04 19:32:57 +00:00
Russell Bryant 5affceaa15 func_curl: Fix leak of an ast_str in error handling code path.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-24 23:49:39 +00:00
Tilghman Lesher 9af5c769c3 Enable macros in 1.8 to find the next highest "h" extension in a context, like in 1.4.
This change restores functionality that was present in 1.4, when AEL macros
were implemented with the Macro dialplan application.  Macros are fraught with
functionality issues, because they consume a large portion of the underlying
application stack.  This limits the ability of AEL users to call many layers
of subroutines, an issue which Gosub does not have (originally tested to
100,000 levels deep).  Therefore, starting in 1.6.0, AEL macros were
implemented with Gosub.

However, there were some implicit behaviors of Macro, which were not replicated
at the same time as with the transition to Gosub, one of which is documented in
the related issue.  In particular, the "h" extension is designed to execute not
in the Macro context, but in the topmost calling context.  Due to legacy issues
with a misapplied bugfix many years ago, when a macro exited in 1.4, it looks
in all calling contexts, bubbling up from the deepest level until it finds an
"h" extension.

Since AEL hides the complexity of the underlying dialplan logic from the AEL
programmer, it's reasonable to assume that this behavior should not change in
the transition from Asterisk 1.4 LTS to Asterisk 1.8 LTS, lest we break
working AEL configurations in the transition to Asterisk 1.8 LTS.  This fix
is the result, which implements a search for the "h" extension in all calling
Gosub contexts.

Fixes ASTERISK-19336

Patch: 20120308__ael_bugfix_for_trunk__2.diff (License #5003) by Tilghman Lesher
	(with slight modifications for 1.8)

Tested by: Johan Wilfer

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13 08:06:20 +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
Terry Wilson 8100a1703d Note that CDRs are immutable once a bridge is torn down
CDRs cannot be modified after a bridge is torn down, (e.g. after
Dial() returns) even though the CDR() function may be called. Since
modifying the CDR code to change this behavior could very easily
break all kinds of things, this patch just documents this limitation.

(closes issues ASTERISK-16923)
Review: https://reviewboard.asterisk.org/r/1720/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09 22:06:41 +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
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
Richard Mudgett 2144ba5df2 Fix locking issues with channel datastores in func_odbc.c.
* Fixed a potential memory leak when an existing datastore is manually
destroyed by inline code instead of calling ast_datastore_free().

(closes issue ASTERISK-17948)
Reported by: Archie Cobbs

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24 17:04:20 +00:00
Richard Mudgett 20c6ff71b6 Fix ast_app_dtget() time unit inconsistency.
Note: Noone calls ast_app_dtget() with the timeout parameter of zero so
the bad code normally will never get executed.

* Fix unnecessary floating point division in func_timeout.c
timeout_write() when all other values are integers.

(closes issue ASTERISK-16817)
Reported by: Dmitry Andrianov
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-21 00:23:13 +00:00
Richard Mudgett 47a55ad652 Fix absolute/relative time mismatch in LOCK function.
The time passed by the LOCK function to an internal function was relative
time when the function expected absolute time.

* Don't use C++ keywords in get_lock().

(closes issue ASTERISK-16868)
Reported by: Andrey Solovyev
Patches:
      20101102__issue18207.diff.txt (license #5003) patch uploaded by Andrey Solovyev (modified)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350313 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-10 22:10:18 +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
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 5dbff9a2a8 Remove invalid flag given to iterator in func_dialgroup.c
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343338 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-03 19:57:49 +00:00
Paul Belanger 0e887d1a50 Fixed typo from previous commit
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-20 21:28:31 +00:00
Paul Belanger 5f5e908b19 Updated documentation for the optional CID parameter with CALLERID
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341666 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-20 20:48:31 +00:00
Jonathan Rose e77f1a6ae1 Some additional module documentation changes for 10 for the menuselect change.
(issue ASTERISK-18268)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-14 18:38:08 +00:00
Gregory Nietsky fca9962766 Merged revisions 338995 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r338995 | irroot | 2011-10-03 16:21:40 +0200 (Mon, 03 Oct 2011) | 6 lines
  
  Remove the channel function OOH323() and place its options into
  CHANNEL()
  
  channel drivers should not have there own dialplan functions.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@338996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-03 14:24:45 +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
Tilghman Lesher 4310b5ad59 ................
........
Escape commas in keys and values, when keys and values are enumerated by commas.

Review: https://reviewboard.asterisk.org/r/1433
........
Merged revisions 337325 from https://origsvn.digium.com/svn/asterisk/branches/1.8
................
Merged revisions 337342 from https://origsvn.digium.com/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337343 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-21 20:53:13 +00:00
Richard Mudgett 1313c12847 Merged revisions 337119 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r337119 | rmudgett | 2011-09-20 17:47:45 -0500 (Tue, 20 Sep 2011) | 16 lines
  
  Fix crash with STRREPLACE function.
  
  The ast_func_read() function calls the .read2 callback with the len
  parameter set to zero indicating no size restrictions on the supplied
  ast_str buffer.  The value was used to dimension a local starts[] array
  with the array subsequently used.
  
  * Reworked the strreplace() function to perform the string replacement in
  a straight forward manner.  Eliminated the need for the starts[] array.
  
  (closes issue ASTERISK-18545)
  Reported by: Federico Alves
  Patches:
        jira_asterisk_18545_v10.patch (license #5621) patch uploaded by rmudgett
  Tested by: rmudgett, Federico Alves
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20 22:54:21 +00:00
Tilghman Lesher 8c06ce6cc9 Merged revisions 336789 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r336789 | tilghman | 2011-09-19 16:41:16 -0500 (Mon, 19 Sep 2011) | 2 lines
  
  Ensure substring will not be found in the previous match.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 21:42:11 +00:00
Terry Wilson 46a21ca6d9 Merged revisions 336316 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r336316 | twilson | 2011-09-16 17:11:39 -0500 (Fri, 16 Sep 2011) | 9 lines
  
  Merged revisions 336314 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r336314 | twilson | 2011-09-16 17:10:56 -0500 (Fri, 16 Sep 2011) | 2 lines
    
    Whitespace fix
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 22:12:24 +00:00
Terry Wilson 9223069c6e Merged revisions 336313 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r336313 | twilson | 2011-09-16 17:07:00 -0500 (Fri, 16 Sep 2011) | 12 lines
  
  Merged revisions 336312 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r336312 | twilson | 2011-09-16 17:04:25 -0500 (Fri, 16 Sep 2011) | 5 lines
    
    Add missing frame types to func_frame_trace
    
    Also casts control frames to the proper enum so that the compile will catch
    new additions.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 22:11:01 +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
Gregory Nietsky 8017b65bb9 Merged revisions 335014 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r335014 | irroot | 2011-09-09 09:23:53 +0200 (Fri, 09 Sep 2011) | 9 lines
  
  
  Move code for VALID_EXTEN from app_readexten to func_dialplan
  
  Mark VALID_EXTEN deprecated.
  
  Review: https://reviewboard.asterisk.org/r/1396/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09 07:28:42 +00:00
Richard Mudgett e12184cf95 Merged revisions 331576 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r331576 | rmudgett | 2011-08-11 16:42:21 -0500 (Thu, 11 Aug 2011) | 16 lines
  
  Merged revisions 331575 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r331575 | rmudgett | 2011-08-11 16:39:58 -0500 (Thu, 11 Aug 2011) | 9 lines
    
    Segfault in shell_helper in func_shell.c.
    
    The return value of popen() was not checked for failure to open.
    
    (closes issue ASTERISK-18109)
    JIRA SWP-3633
    Reported by: Michael Myles
    Tested by: rmudgett
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331577 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-11 21:44:08 +00:00
Kinsey Moore c3bd5892a6 Allow ENUM query functions to report lookup errors
The ENUM dialplan functions do not report DNS query errors properly. It is
useful to differentiate between failed query (e.g. non-existent domain) vs. no
data records of the appropriate type. This is required to make overlapped
dialing work.

(closes issue ASTERISK-13769)
Review: https://reviewboard.asterisk.org/r/1355/
Patch-by: Timo Teras


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-09 17:08:33 +00:00
Tilghman Lesher e7f507ce18 Merged revisions 328541 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

................
  r328541 | tilghman | 2011-07-18 02:11:26 -0500 (Mon, 18 Jul 2011) | 9 lines
  
  Merged revisions 328540 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r328540 | tilghman | 2011-07-18 02:10:15 -0500 (Mon, 18 Jul 2011) | 2 lines
    
    Typo
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-18 07:12:22 +00:00
Leif Madsen a525edea59 Merged revisions 328247 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

................
  r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines
  
  Merged revisions 328209 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines
    
    Introduce <support_level> tags in MODULEINFO.
    This change introduces MODULEINFO into many modules in Asterisk in order to show
    the community support level for those modules. This is used by changes committed
    to menuselect by Russell Bryant recently (r917 in menuselect). More information about
    the support level types and what they mean is available on the wiki at
    https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14 20:28:54 +00:00
Tilghman Lesher 7d179abfd4 Merged revisions 326411 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r326411 | tilghman | 2011-07-05 17:08:29 -0500 (Tue, 05 Jul 2011) | 14 lines
  
  Add the attribute "type" to each "<use>" for menuselect.
  
  This matters only when autoconf fails to detect that weak linking is supported.
  External optional dependencies will become optional in both cases, as they are
  removed at compile time when not detected.  However, runtime-optional modules
  are made mandatory when weak linking is not found.  This change affects only
  the external optional dependencies; previously, they were incorrectly required
  when weak linking support was not detected.
  
  Patches:
  	20110702__issue18062__asterisk_trunk.diff.txt by tilghman (License #5003)
  
  Tested by: iasgoscouk
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-05 22:11:40 +00:00
Gregory Nietsky e789eb8b2d CHANNEL(pickupgroup)
Allow Setting / Reading the pickupgroup of a channel with func_channel.c
  
  (closes issue #19045)
  Reported by: irroot
  
  Review: https://reviewboard.asterisk.org/r/1148/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@320772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-25 15:43:28 +00:00
Jonathan Rose 1b57da8673 Adds STRREPLACE function
Adds a new STRREPLACe function to func_strings.c that allows users to search and replace
against a variable in the dialplan.

(closes issue #18023)
Reported by: wdoekes

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@320040 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-20 16:27:12 +00:00
David Vossel 00dc1556ab Fixes reliability issues with func_jitterbuffer's usage in the new ConfBridge application.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@317197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-05 18:08:42 +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
Tilghman Lesher 1fca95b1d4 Merged revisions 316094 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r316094 | tilghman | 2011-05-02 14:09:55 -0500 (Mon, 02 May 2011) | 15 lines
  
  Merged revisions 316093 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r316093 | tilghman | 2011-05-02 14:04:36 -0500 (Mon, 02 May 2011) | 8 lines
    
    More possible crashes based upon invalid inputs.
    
    (closes issue #18161)
     Reported by: wdoekes
     Patches: 
           20110301__issue18161.diff.txt uploaded by tilghman (license 14)
     Tested by: wdoekes
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-02 19:15:46 +00:00
David Vossel 18d591cb48 Introduction of the JITTERBUFFER dialplan function.
Review: https://reviewboard.asterisk.org/r/1157/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-20 20:52:15 +00:00
Leif Madsen fd2f95b3c4 Merged revisions 314206 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r314206 | lmadsen | 2011-04-19 09:28:15 -0500 (Tue, 19 Apr 2011) | 14 lines
  
  Merged revisions 314205 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r314205 | lmadsen | 2011-04-19 09:27:50 -0500 (Tue, 19 Apr 2011) | 6 lines
    
    Remove duplicate documentation from func_channel.c
    
    (closes issue #18970)
    Reported by: IgorG
    Patches: 
          func_channel.c.doc.diff uploaded by IgorG (license 20)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-19 14:28:46 +00:00
Jonathan Rose 1c1c9c2bd4 Merged revisions 310587 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r310587 | jrose | 2011-03-14 10:27:57 -0500 (Mon, 14 Mar 2011) | 15 lines
  
  Merged revisions 310585 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r310585 | jrose | 2011-03-14 08:56:22 -0500 (Mon, 14 Mar 2011) | 8 lines
    
    Adds 'p' as an option to func_volume.  When it is on, the old behavior with DTMF controlling volume adjustment will be enforced.
    When it is off, DTMF will not be processed by the function.
    
    Programmed by Jonathan Rose
    Reviewed by David Vossel, Leif Madsen, and Russell Bryant
    
    http://reviewboard.digium.internal/r/93/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@310588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-14 15:40:43 +00:00
Tilghman Lesher 9650fb3e1a Merged revisions 310415 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r310415 | tilghman | 2011-03-12 14:05:46 -0600 (Sat, 12 Mar 2011) | 14 lines
  
  Merged revisions 310414 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r310414 | tilghman | 2011-03-12 13:51:23 -0600 (Sat, 12 Mar 2011) | 7 lines
    
    Transactional handles should be used for the insertbuf, if available.
    
    Also, fix a possible resource leak.
    
    (closes issue #18943)
     Reported by: irroot
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@310416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-12 20:08:19 +00:00
Tilghman Lesher 67c91388db Merged revisions 310142 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r310142 | tilghman | 2011-03-09 23:53:29 -0600 (Wed, 09 Mar 2011) | 19 lines
  
  Merged revisions 310141 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r310141 | tilghman | 2011-03-09 23:51:37 -0600 (Wed, 09 Mar 2011) | 12 lines
    
    Merged revisions 310140 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r310140 | tilghman | 2011-03-09 23:38:44 -0600 (Wed, 09 Mar 2011) | 5 lines
      
      Initialize column size to 0 to deal with a potential UnixODBC bug on 64-bit systems.
      
      (closes issue #18295)
       Reported by: pruiz
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@310143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-10 05:54:53 +00:00
Richard Mudgett 928ec2b990 Merged revisions 309445 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r309445 | rmudgett | 2011-03-04 09:22:04 -0600 (Fri, 04 Mar 2011) | 46 lines
  
  Get real channel of a DAHDI call.
  
  Starting with Asterisk v1.8, the DAHDI channel name format was changed for
  ISDN calls to: DAHDI/i<span>/<number>[:<subaddress>]-<sequence-number>
  
  There were several reasons that the channel name had to change.
  
  1) Call completion requires a device state for ISDN phones.  The generic
  device state uses the channel name.
  
  2) Calls do not necessarily have B channels.  Calls placed on hold by an
  ISDN phone do not have B channels.
  
  3) The B channel a call initially requests may not be the B channel the
  call ultimately uses.  Changes to the internal implementation of the
  Asterisk master channel list caused deadlock problems for chan_dahdi if it
  needed to change the channel name.  Chan_dahdi no longer changes the
  channel name.
  
  4) DTMF attended transfers now work with ISDN phones because the channel
  name is "dialable" like the chan_sip channel names.
  
  For various reasons, some people need to know which B channel a DAHDI call
  is using.
  
  * Added CHANNEL(dahdi_span), CHANNEL(dahdi_channel), and
  CHANNEL(dahdi_type) so the dialplan can determine the B channel currently
  in use by the channel.  Use CHANNEL(no_media_path) to determine if the
  channel even has a B channel.
  
  * Added AMI event DAHDIChannel to associate a DAHDI channel with an
  Asterisk channel so AMI applications can passively determine the B channel
  currently in use.  Calls with "no-media" as the DAHDIChannel do not have
  an associated B channel.  No-media calls are either on hold or
  call-waiting.
  
  (closes issue #17683)
  Reported by: mrwho
  Tested by: rmudgett
  
  (closes issue #18603)
  Reported by: arjankroon
  Patches:
        issue17683_18603_v1.8_v2.patch uploaded by rmudgett (license 664)
  Tested by: stever28, rmudgett
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-04 15:28:20 +00:00
Richard Mudgett ffe9e4acfc Merged revisions 309170 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r309170 | rmudgett | 2011-03-01 15:57:26 -0600 (Tue, 01 Mar 2011) | 7 lines
  
  Document CHANNEL(keypad_digits) and CHANNEL(no_media_path).
  
  * Added XML documentation for CHANNEL(keypad_digits) and
  CHANNEL(no_media_path).
  
  * Tweaked XML documentation for CHANNEL(reversecharge).
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-01 21:57:58 +00:00
Tilghman Lesher 008aa0e3b8 Merged revisions 308991 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r308991 | tilghman | 2011-02-28 03:33:22 -0600 (Mon, 28 Feb 2011) | 14 lines
  
  Merged revisions 308990 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r308990 | tilghman | 2011-02-28 03:32:22 -0600 (Mon, 28 Feb 2011) | 7 lines
    
    Statements updating zero rows may return SQL_NO_DATA.  This is fine; it's handled.
    
    (closes issue #18815)
     Reported by: irroot
     Patches: 
           func_odbc.insert_nodata.patch uploaded by irroot (license 52)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-28 09:34:16 +00:00
David Vossel d760e81f37 Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd audio ConfBridge, and other stuff
-Functional changes
1. Dynamic global format list build by codecs defined in codecs.conf
2. SILK 8khz, 12khz, 16khz, and 24khz with custom attributes defined in codecs.conf
3. Negotiation of SILK attributes in chan_sip.
4. SPEEX 32khz with translation
5. SLINEAR 8khz, 12khz, 24khz, 32khz, 44.1khz, 48khz, 96khz, 192khz with translation
   using codec_resample.c
6. Various changes to RTP code required to properly handle the dynamic format list
   and formats with attributes.
7. ConfBridge now dynamically jumps to the best possible sample rate.  This allows
   for conferences to take advantage of HD audio (Which sounds awesome)
8. Audiohooks are no longer limited to 8khz audio, and most effects have been
   updated to take advantage of this such as Volume, DENOISE, PITCH_SHIFT.
9. codec_resample now uses its own code rather than depending on libresample.

-Organizational changes
Global format list is moved from frame.c to format.c
Various format specific functions moved from frame.c to format.c

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-22 23:04:49 +00:00
Tilghman Lesher e38fa2d3cd Merged revisions 307837 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r307837 | tilghman | 2011-02-15 01:02:45 -0600 (Tue, 15 Feb 2011) | 15 lines
  
  Merged revisions 307836 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r307836 | tilghman | 2011-02-15 01:01:37 -0600 (Tue, 15 Feb 2011) | 8 lines
    
    Need to retrieve the rows affected before using the associated variable.
    
    (closes issue #18795)
     Reported by: irroot
     Patches: 
           20110211__issue18795.diff.txt uploaded by tilghman (license 14)
     Tested by: tilghman
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-15 07:03:44 +00:00
Richard Mudgett 49feb747ba Pass a MCID request to the bridged channel.
Pass a MCID request to the bridged channel so the bridged channel can send
it to the network.

The ability to send the MCID request on an ISDN span is enabled with the
new chan_dahdi.conf mcid_send option.

JIRA SWP-2845
JIRA ABE-2736


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-07 23:33:44 +00:00
David Vossel c26c190711 Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal.  For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal

The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs.  Functionally
no change in behavior should be present in this patch.  Thanks to twilson
and russell for all the time they spent reviewing these changes.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 16:22:10 +00:00
Tilghman Lesher 2740326200 Merged revisions 305844 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r305844 | tilghman | 2011-02-02 14:05:43 -0600 (Wed, 02 Feb 2011) | 5 lines
  
  Eliminate a file descriptor leak when using the FILE() dialplan function.
  
  (closes issue #18731)
  Reported by: marioabajo
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@305845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-02 20:06:33 +00:00
Andrew Latham 93bade5639 Replacing doc/* and asterisk.pdf with wiki links
Adding links to http(s)://wiki.asterisk.org



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@305843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-02 19:30:49 +00:00
Andrew Latham f9c3b26241 Add Function and Application Relationships to documentation
Add and extend the see-also sections to the documentation for applications
and functions in an effort to expand the online documentation of the wiki.
Also check for and update any links to moved documentation in the doc folder.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@304913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-30 00:22:59 +00:00
Matthew Nicholson e706b5706e According to section 19.1.2 of RFC 3261:
For each component, the set of valid BNF expansions defines exactly
  which characters may appear unescaped.  All other characters MUST be
  escaped.

This patch modifies ast_uri_encode() to encode strings in line with this recommendation.  This patch also adds an ast_escape_quoted() function which escapes '"' and '\' characters in quoted strings in accordance with section 25.1 of RFC 3261.  The ast_uri_encode() function has also been modified to take an ast_flags struct describing the set of rules it should use when escaping characters to allow for it to escape SIP URIs in addition to HTTP URIs and other types of URIs or variations of those two URI types in the future.

The ast_uri_decode() function has also been modified to accept an ast_flags struct describing the set of rules to use when decoding to enable decoding '+' as ' ' in legacy http URLs.

The unit tests for these functions have also been updated.

ABE-2705

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@303509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-24 18:59:22 +00:00
Tilghman Lesher 52dbebad8e Add DB_KEYS.
Discussion on #asterisk on 2011-01-19:
(02:07:03 PM) boch: i wonder how to cycle all entries in a tree
(02:07:11 PM) leifmadsen: use While()
(02:07:17 PM) leifmadsen: you need to know the tree structure already though
(02:07:36 PM) boch: what you mean?
(02:09:02 PM) leifmadsen: you need to know the structure prior to looping, because you can't just return the structure from the dialplan
(02:09:43 PM) leifmadsen: the only way I can think of doing that is via something like writing the output of:  asterisk -rx "database show" to a file, then looping through that to know the structure of the database and check everything
(02:09:59 PM) leifmadsen: but at that point you're better off just using either a relational database or an external script
(02:10:13 PM) boch: for example i need to know all entries in the tree
(02:10:15 PM) boch: got it
(02:10:20 PM) leifmadsen: exactly
(02:10:22 PM) leifmadsen: that's the problem
(02:10:22 PM) boch: thank you
(02:13:09 PM) mateu: yeah, i'm surprised there isn't something from the dialplan like 'database show family' so one can get all keys in a family to loop over.
(02:15:35 PM) leifmadsen: database shows everything
(02:16:22 PM) mateu: i mean something from the dial plan that mimics 'database show <family>'
(02:16:41 PM) leifmadsen: guess no one has found that important enough to program :)
(02:16:52 PM) leifmadsen: at that point you should probably just use a relational database...
(02:17:10 PM) mateu: i dunno
(02:17:16 PM) mateu: seems pretty basic to me.
(02:17:16 PM) leifmadsen: me either
(02:17:19 PM) leifmadsen: sure does
(02:17:24 PM) leifmadsen: no one has programmed it though
(02:17:28 PM) ***leifmadsen shrugs
(02:17:43 PM) mateu: ok, well at least we know how it currently stands.  thanks leifmadsen
(02:28:52 PM) Corydon76-home: leifmadsen: something like HASHKEYS() ?
(02:30:11 PM) leifmadsen: Corydon76-home: ummm, I was thinking more like DUNDI_QUERY() and DUNDI_RESULT()
(02:30:31 PM) leifmadsen: although HASHKEYS() might work
(02:30:58 PM) leifmadsen: actually ya, looking at it, similar to HASHKEYS()
(02:31:01 PM) leifmadsen: DBKEYS() I guess?
(02:31:45 PM) Corydon76-home: So with no argument, retrieves families, with an argument, retrieves keys of that family?
(02:34:02 PM) leifmadsen: ya
(02:34:16 PM) leifmadsen: how would you iterate through layers of them?
(02:34:30 PM) leifmadsen: i.e. family/key/key/key ?
(02:34:43 PM) Corydon76-home: Essentially, yes


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@303198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-21 08:13:18 +00:00
Andrew Latham 7cb1c06dd3 Add relationships to function documentation.
Fix amatuer type mistake 


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@301850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-14 20:07:02 +00:00
Andrew Latham ca8a5498b1 Add relationships to function documentation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@301846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-14 19:39:22 +00:00
Tilghman Lesher b2a70b4065 Oops, missed the actual decoding part.
(closes issue #18046)
 Reported by: wdoekes


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@301008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-07 18:23:52 +00:00
Tilghman Lesher a58b2fb395 XML validation
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300841 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-06 17:50:57 +00:00
Tilghman Lesher 473e176df8 Add a hashcompat mode called "legacy", which translates a literal plus sign to a space.
(closes issue #18046)
 Reported by: wdoekes
 Patches: 
       20100930__issue18046.diff.txt uploaded by tilghman (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@300840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-06 17:28:32 +00:00
Tilghman Lesher ac77932bac Merged revisions 298478 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r298478 | tilghman | 2010-12-16 02:56:13 -0600 (Thu, 16 Dec 2010) | 15 lines
  
  Merged revisions 298477 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r298477 | tilghman | 2010-12-16 02:54:23 -0600 (Thu, 16 Dec 2010) | 8 lines
    
    Eliminate duplicates from container.
    
    (closes issue #18091)
     Reported by: bunny
     Patches: 
           20101006__issue18091.diff.txt uploaded by tilghman (license 14)
     Tested by: bunny
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@298479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-16 08:56:59 +00:00
Tilghman Lesher 53357354a4 Merged revisions 294989 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r294989 | tilghman | 2010-11-15 01:44:38 -0600 (Mon, 15 Nov 2010) | 15 lines
  
  Merged revisions 294988 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r294988 | tilghman | 2010-11-15 01:42:39 -0600 (Mon, 15 Nov 2010) | 8 lines
    
    It is possible to crash Asterisk by feeding the curl engine invalid data.
    
    (closes issue #18161)
     Reported by: wdoekes
     Patches: 
           20101029__issue18161.diff.txt uploaded by tilghman (license 14)
     Tested by: tilghman
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@294990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-15 07:45:42 +00:00
Jeff Peeler 34c30c8ad3 Merged revisions 293159 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r293159 | jpeeler | 2010-10-28 11:11:08 -0500 (Thu, 28 Oct 2010) | 18 lines
  
  Merged revisions 293158 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r293158 | jpeeler | 2010-10-28 11:09:40 -0500 (Thu, 28 Oct 2010) | 11 lines
    
    Fix infinite loop in FILTER(). 
    
    Specifically when you're using characters above \x7f or invalid character
    escapes (e.g. \xgg).
    
    (closes issue #18060)
    Reported by: wdoekes
    Patches: 
          issue18060_func_strings_filter_infinite_loop.patch uploaded by wdoekes (license 717)
    Tested by: wdoekes
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@293160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-28 16:11:53 +00:00
Tilghman Lesher 6d0e383321 Merged revisions 289543,289581 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r289543 | tilghman | 2010-09-30 12:50:52 -0500 (Thu, 30 Sep 2010) | 2 lines
  
  More Solaris compatibility fixes
........
  r289581 | tilghman | 2010-09-30 15:23:10 -0500 (Thu, 30 Sep 2010) | 2 lines
  
  Solaris fixes.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@289588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-30 20:40:08 +00:00
Tilghman Lesher 794ff358a3 Merged revisions 288713 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r288713 | tilghman | 2010-09-24 08:54:17 -0500 (Fri, 24 Sep 2010) | 12 lines
  
  Merged revisions 288712 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r288712 | tilghman | 2010-09-24 08:53:30 -0500 (Fri, 24 Sep 2010) | 5 lines
    
    Solaris won't printf a NULL.
    
    (closes issue #18041)
     Reported by: asgaroth
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@288714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-24 13:55:11 +00:00
David Vossel 2f3dee2379 Merged revisions 287647 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r287647 | dvossel | 2010-09-20 17:09:16 -0500 (Mon, 20 Sep 2010) | 21 lines
  
  Addition of the FrameHook API (AKA AwesomeHooks)
  
  So far all our tools for viewing and manipulating media streams
  within Asterisk have been entirely focused on audio.  That made
  sense then, but is not scalable now.  The FrameHook API lets us
  tap into and manipulate _ANY_ type of media or signaling passed
  on a channel present today or in the future.  This tool is a step
  in the direction of expanding Asterisk's boundaries and will help
  generate some rather interesting applications in the future.
  
  In addition to the FrameHook API, a simple dialplan function
  exercising the api has been included as well.  This function
  is called FRAME_TRACE().  FRAME_TRACE() allows for the internal
  ast_frames read and written to a channel to be output.  Filters
  can be placed on this function to debug only certain types of frames.
  This function could be thought of as an internal way of doing
  ast_frame packet captures.
  
  Review: https://reviewboard.asterisk.org/r/925/
........



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@287648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-20 22:16:37 +00:00
Terry Wilson d04046fbe7 Merged revisions 286189 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r286189 | twilson | 2010-09-10 17:04:53 -0500 (Fri, 10 Sep 2010) | 30 lines
  
  Merged revisions 286115 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r286115 | twilson | 2010-09-10 15:35:25 -0500 (Fri, 10 Sep 2010) | 23 lines
    
    Merged revisions 286059 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r286059 | twilson | 2010-09-10 14:25:08 -0500 (Fri, 10 Sep 2010) | 16 lines
      
      Inherit CHANNEL() writes to both sides of a Local channel
      
      Having Local (/n) channels as queue members and setting the language in the
      extension with Set(CHANNEL(language)=fr) sets the language on the Local/...,2
      channel. Hold time report playbacks happen on the Local/...,1 channel and
      therefor do not play in the specified language.
      
      This patch modifies func_channel_write to call the setoption callback and pass
      the CHANNEL() write info to the callback. chan_local uses this information to
      look up the other side of the channel and apply the same changes to it.
      
      (closes issue #17673)
      Reported by: Guggemand
      
      Review: https://reviewboard.asterisk.org/r/903/
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@286190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-10 22:15:47 +00:00
Tilghman Lesher 1c12ca0407 Merged revisions 285484 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r285484 | tilghman | 2010-09-08 02:14:17 -0500 (Wed, 08 Sep 2010) | 2 lines
  
  Documentation only
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-08 07:15:19 +00:00
Tilghman Lesher 2302618bb7 Merged revisions 285373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r285373 | tilghman | 2010-09-07 16:14:03 -0500 (Tue, 07 Sep 2010) | 7 lines
  
  Add CHANNEL(checkhangup) to check whether a channel is in the process of being hanged up.
  
  (closes issue #17652)
   Reported by: kobaz
   Patches: 
         func_channel.patch uploaded by kobaz (license 834)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-07 21:14:54 +00:00
Tilghman Lesher 8190e96fad Merged revisions 284610 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r284610 | tilghman | 2010-09-02 00:20:59 -0500 (Thu, 02 Sep 2010) | 10 lines
  
  When optional_api is non-optional, force dependent modules to be loaded.
  
  (closes issue #17707)
   Reported by: ira
   Patches: 
         20100819__issue17707__asterisk1.8.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman
   
  Review: https://reviewboard.asterisk.org/r/876/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-02 05:27:53 +00:00
Russell Bryant 2de5bbc89f Merged revisions 283350 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r283350 | russell | 2010-08-24 07:49:41 -0500 (Tue, 24 Aug 2010) | 2 lines
  
  Don't attempt to release a NULL ODBC handle.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@283351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-24 12:51:46 +00:00
Tilghman Lesher 42490d744b Merged revisions 280809 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r280809 | tilghman | 2010-08-03 15:25:10 -0500 (Tue, 03 Aug 2010) | 12 lines
  
  Sneak FIELDNUM() into 1.8.  Returns a 1-based index into a list of a specified item.
  
  Matches up with FIELDQTY() and CUT().
  
  (closes issue #17713)
   Reported by: gareth
   Patches: 
         svn-279754.diff uploaded by gareth (license 208)
   Tested by: gareth, tilghman
  
   Review: https://reviewboard.asterisk.org/r/810/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@280810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-03 20:29:51 +00:00
Terry Wilson d6e1c724e5 Remove built-in AES code and use optional_api instead
Review: https://reviewboard.asterisk.org/r/793/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-21 19:11:32 +00:00
Tilghman Lesher b4e18d5660 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 19:35:02 +00:00
Richard Mudgett cf7bbcc4c6 Expand the caller ANI field to an ast_party_id
Expand the ani field in ast_party_caller and ast_party_connected_line to
an ast_party_id.

This is an extension to the ast_callerid restructuring patch in review:
https://reviewboard.asterisk.org/r/702/

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 16:58:03 +00:00
Richard Mudgett ec37ffbdaf ast_callerid restructuring
The purpose of this patch is to eliminate struct ast_callerid since it has
turned into a miscellaneous collection of various party information.

Eliminate struct ast_callerid and replace it with the following struct
organization:

struct ast_party_name {
	char *str;
	int char_set;
	int presentation;
	unsigned char valid;
};
struct ast_party_number {
	char *str;
	int plan;
	int presentation;
	unsigned char valid;
};
struct ast_party_subaddress {
	char *str;
	int type;
	unsigned char odd_even_indicator;
	unsigned char valid;
};
struct ast_party_id {
	struct ast_party_name name;
	struct ast_party_number number;
	struct ast_party_subaddress subaddress;
	char *tag;
};
struct ast_party_dialed {
	struct {
		char *str;
		int plan;
	} number;
	struct ast_party_subaddress subaddress;
	int transit_network_select;
};
struct ast_party_caller {
	struct ast_party_id id;
	char *ani;
	int ani2;
};

The new organization adds some new information as well.

* The party name and number now have their own presentation value that can
be manipulated independently.  ISDN supplies the presentation value for
the name and number at different times with the possibility that they
could be different.

* The party name and number now have a valid flag.  Before this change the
name or number string could be empty if the presentation were restricted.
Most channel drivers assume that the name or number is then simply not
available instead of indicating that the name or number was restricted.

* The party name now has a character set value.  SIP and Q.SIG have the
ability to indicate what character set a name string is using so it could
be presented properly.

* The dialed party now has a numbering plan value that could be useful to
have available.

The various channel drivers will need to be updated to support the new
core features as needed.  They have simply been converted to supply
current functionality at this time.


The following items of note were either corrected or enhanced:

* The CONNECTEDLINE() and REDIRECTING() dialplan functions were
consolidated into func_callerid.c to share party id handling code.

* CALLERPRES() is now deprecated because the name and number have their
own presentation values.

* Fixed app_alarmreceiver.c write_metadata().  The workstring[] could
contain garbage.  It also can only contain the caller id number so using
ast_callerid_parse() on it is silly.  There was also a typo in the
CALLERNAME if test.

* Fixed app_rpt.c using ast_callerid_parse() on the channel's caller id
number string.  ast_callerid_parse() alters the given buffer which in this
case is the channel's caller id number string.  Then using
ast_shrink_phone_number() could alter it even more.

* Fixed caller ID name and number memory leak in chan_usbradio.c.

* Fixed uninitialized char arrays cid_num[] and cid_name[] in
sig_analog.c.

* Protected access to a caller channel with lock in chan_sip.c.

* Clarified intent of code in app_meetme.c sla_ring_station() and
dial_trunk().  Also made save all caller ID data instead of just the name
and number strings.

* Simplified cdr.c set_one_cid().  It hand coded the ast_callerid_merge()
function.

* Corrected some weirdness with app_privacy.c's use of caller
presentation.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 15:48:36 +00:00
Tilghman Lesher 0ae9097e3e Oops, XML documentation fix.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276122 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-13 19:05:17 +00:00
Tilghman Lesher fc9efc4ff5 It really cannot fail in the places below, but the stupid compiler doesn't know that.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-13 19:00:02 +00:00
Tilghman Lesher e939dfea9d Weird compiler error on Bamboo.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-13 18:41:59 +00:00
Tilghman Lesher 50d5f134c8 FILE() now supports line-mode and writing (altering) files.
(closes issue #16461)
 Reported by: skyman
 Patches: 
       20100622__issue16461.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman
 
Review: https://reviewboard.asterisk.org/r/737/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-13 18:31:41 +00:00
Tilghman Lesher da8450323f Kill some startup warnings and errors and make some messages more helpful in tracking down the source.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-09 17:00:22 +00:00
Bradley Latus 4405813297 Add High Resolution Times to CDRs for Asterisk
People expressed an interest in having access to the exact length of calls to a finer degree than seconds. See the CHANGES and UPGRADE.txt for usage also updated the sample configs to note the change.

Patch by snuffy.

(closes issue #16559)
Reported by: cianmaher
Tested by: cianmaher, snuffy

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08 23:48:17 +00:00
Terry Wilson 857814f435 Add SRTP support for Asterisk
After 5 years in mantis and over a year on reviewboard, SRTP support is finally
being comitted. This includes generic CHANNEL dialplan functions that work for
getting the status of whether a call has secure media or signaling as defined
by the underlying channel technology and for setting whether or not a new
channel being bridged to a calling channel should have secure signaling or
media. See doc/tex/secure-calls.tex for examples.

Original patch by mikma, updated for trunk and revised by me.

(closes issue #5413)
Reported by: mikma
Tested by: twilson, notthematrix, hemanshurpatel

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08 05:29:08 +00:00
Tilghman Lesher da0138932e Handle OOM errors more gracefully.
(closes issue #17084)
 Reported by: falves11
 Patches: 
       issue17084_162_A.diff uploaded by falves11 (license 374)
 Tested by: falves11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-03 19:46:42 +00:00
Tilghman Lesher 4eaea01cad Needs to be wrapped in <para>
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-30 20:18:03 +00:00
Tilghman Lesher 2da88f1977 Setup environment variables for the benefit of child processes and disallow changing them.
(closes issue #14899)
 Reported by: jmls
 Patches: 
       20090916__issue14899.diff.txt uploaded by tilghman (license 14)
 Tested by: jmls


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-28 22:50:06 +00:00
Mark Michelson b5d5cc565f Enhancements to connected line and redirecting work.
From reviewboard:

Digium has a commercial customer who has made extensive use of the connected party and
redirecting information present in later versions of Asterisk Business Edition and which
is to be in the upcoming 1.8 release. Through their use of the feature, new problems and solutions
have come about. This patch adds several enhancements to maximize usage of the connected party
and redirecting information functionality.

First, Asterisk trunk already had connected line interception macros. These macros allow you to
manipulate connected line information before it was sent out to its target. This patch adds the
same feature except for redirecting information instead.

Second, the ast_callerid and ast_party_id structures have been enhanced to provide a "tag." This
tag can be set with func_callerid, func_connectedline, func_redirecting, and in the case of DAHDI,
mISDN, and SIP channels, can be set in a configuration file. The idea behind the callerid tag is
that it can be set to whatever value the administrator likes. Later, when running connected line
and redirecting macros, the admin can read the tag off the appropriate structure to determine what
action to take. You can think of this sort of like a channel variable, except that instead of having
the variable associated with a channel, the variable is associated with a specific identity within
Asterisk.

Third, app_dial has two new options, s and u. The s option lets a dialplan writer force a specific
caller ID tag to be placed on the outgoing channel. The u option allows the dialplan writer to force
a specific calling presentation value on the outgoing channel.

Fourth, there is a new control frame subclass called AST_CONTROL_READ_ACTION added. This was added
to correct a very specific situation. In the case of SIP semi-attended (blond) transfers, the party
being transferred would not have the opportunity to run a connected line interception macro to
possibly alter the transfer target's connected line information. The issue here was that during a
blond transfer, the SIP transfer code has no bridged channel on which to queue the connected line
update. The way this was corrected was to add this new control frame subclass. Now, we queue an
AST_CONTROL_READ_ACTION frame on the channel on which the connected line interception macro should
be run. When ast_read is called to read the frame, ast_read responds by calling a callback function
associated with the specific read action the control frame describes. In this case, the action taken
is to run the connected line interception macro on the transferee's channel.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@263541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-17 15:36:31 +00:00
Tilghman Lesher 03e1608c29 Double free crash
(closes issue #17245)
 Reported by: thedavidfactor
 Patches: 
       20100426__issue17245.diff.txt uploaded by tilghman (license 14)
 Tested by: murraytm


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@261917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-07 20:54:35 +00:00
Mark Michelson 693d1c44b1 Add small documentation update to func_callcompletion.c.
This directs users to documents which can help explain the
concepts and configuration options settable with the function.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@258345 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-21 19:07:25 +00:00
Mark Michelson 6640f309a9 Commit compromise I suggested on review 608.
This allows for multiple SRV queries to be done
from the dialplan for the same service on a single call while
still allowing one to bypass the call to SRVQUERY if they so
please.

Taking action since no comments had been left for a while.
This can easily be reverted if needed. External tests
still pass.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@257851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-19 18:42:31 +00:00
Mark Michelson fb0a4e5bd0 Address Russell's comments on func_srv from reviewboard.
* Change copyright date
* Place channel in autoservice when doing SRV lookup
* Get rid of trailing whitespace
* Change logic in load_module function



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@257025 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-13 16:15:36 +00:00
Mark Michelson ae7b76a1b9 Fix some compiler errors that popped up after the CCSS merge.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-09 15:56:55 +00:00
Mark Michelson e24661fd18 Merge Call completion support into trunk.
From Reviewboard:
CCSS stands for Call Completion Supplementary Services. An admittedly out-of-date
overview of the architecture can be found in the file doc/CCSS_architecture.pdf
in the CCSS branch. Off the top of my head, the big differences between what is
implemented and what is in the document are as follows:

1. We did not end up modifying the Hangup application at all.
2. The document states that a single call completion monitor may be used across
   multiple calls to the same device. This proved to not be such a good idea
   when implementing protocol-specific monitors, and so we ended up using one
   monitor per-device per-call.
3. There are some configuration options which were conceived after the document
   was written. These are documented in the ccss.conf.sample that is on this
   review request.
		      
For some basic understanding of terminology used throughout this code, see the
ccss.tex document that is on this review.

This implements CCBS and CCNR in several flavors.

First up is a "generic" implementation, which can work over any channel technology
provided that the channel technology can accurately report device state. Call
completion is requested using the dialplan application CallCompletionRequest and can
be canceled using CallCompletionCancel. Device state subscriptions are used in order
to monitor the state of called parties.

Next, there is a SIP-specific implementation of call completion. This method uses the
methods outlined in draft-ietf-bliss-call-completion-06 to implement call completion
using SIP signaling. There are a few things to note here:

* The agent/monitor terminology used throughout Asterisk sometimes is the reverse of
  what is defined in the referenced draft.

* Implementation of the draft required support for SIP PUBLISH. I attempted to write
  this in a generic-enough fashion such that if someone were to want to write PUBLISH
  support for other event packages, such as dialog-state or presence, most of the effort
  would be in writing callbacks specific to the event package.

* A subportion of supporting PUBLISH reception was that we had to implement a PIDF
  parser. The PIDF support added is a bit minimal. I first wrote a validation
  routine to ensure that the PIDF document is formatted properly. The rest of the
  PIDF reading is done in-line in the call-completion-specific PUBLISH-handling
  code. In other words, while there is PIDF support here, it is not in any state
  where it could easily be applied to other event packages as is.

Finally, there are a variety of ISDN-related call completion protocols supported. These
were written by Richard Mudgett, and as such I can't really say much about their
implementation. There are notes in the CHANGES file that indicate the ISDN protocols
over which call completion is supported.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-09 15:31:32 +00:00
Mark Michelson 6cad0f1602 func_srv and explicit specification of a remote IP for SIP.
From Review Board:
There are two interrelated changes here.

First, there is the introduction of func_srv. This adds two new read-only
dialplan functions, SRVQUERY and SRVRESULT. They work very similarly to the
ENUMQUERY and ENUMRESULT functions, except that this allows one to query SRV
records instead. In order to facilitate this work, I added a couple of new API
calls to srv.h. ast_srv_get_record_count tells the number of records returned
by an SRV lookup. This number is calculated at the time of the SRV lookup.
ast_srv_get_nth_record allows one to get a numbered SRV record.

Second, there is the modification to chan_sip that allows one to specify a
hostname or IP address (along with a port) to send an outgoing INVITE to when
dialing a SIP peer. This goes hand-in-hand with func_srv. You can query SRV
records and then use the host and port from the results to dial via a specific
host instead of what is configured in sip.conf.

Review: https://reviewboard.asterisk.org/r/608
SWP-1200



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-09 14:37:50 +00:00
Richard Mudgett a5a0a5f867 Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
SWP-1229
ABE-2161

* Ensure chan_local.c:local_call() will not leak cid.cid_dnid when
copying.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-03 02:12:33 +00:00
Russell Bryant 008930a3f2 Fix memory corruption found by unit tests.
ast_str_reset() was being called on a potentially uninitialized pointer.
Valgrind is my hero, once again.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-20 16:50:38 +00:00
Tilghman Lesher afb6bac829 Hmmm, apparently needed to be fixed in trunk, too.
(closes issue #16900)
 Reported by: bluecrow76
 Patches: 
       asterisk-1.6.2.4-func_strings.diff uploaded by bluecrow76 (license 270)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10 20:54:03 +00:00
Tilghman Lesher dd3176cc91 It's amazing what writing a test will find.
(issue #16900)
 Reported by: bluecrow76


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10 20:30:34 +00:00
Tilghman Lesher e58fc610ae Change needed to make Mac OS X 10.6 happy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-08 05:12:55 +00:00
David Vossel 86a215c83e fixes xml error in func_pitchshift
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-05 21:51:25 +00:00
David Vossel f468595789 PITCH_SHIFT dialplan function
The PITCH_SHIFT function can be used on a channel to independently
modify the pitch of both rx and tx audio streams.  Now you can
improve your conference calls by assigning a random pitch effect
to everyone entering a meetme room, or just make your day more
interesting by making your co-workers sound funny.  These are just
some of the numerious practical uses for this function. Enjoy!

https://reviewboard.asterisk.org/r/526/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-05 20:21:13 +00:00
Mark Michelson 7acfebf2b8 Adjust XML for func_channel to indicate that rtpdest can take a "text" argument.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-04 20:12:26 +00:00
Russell Bryant e3d176d0d3 Remove unnecessary warning message, make a couple of formatting tweaks
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-24 06:39:27 +00:00
Jeff Peeler 27a4cda821 Add support for GROUP_MATCH_COUNT regex matching on category
Current support for regex matching was previously only available on the group.
Also, error reporting for regex failures has been added. In addition to this
feature enhancement a unit test has been written to check the regular expression
logic to ensure the count operation is working as expected.

(closes issue #16642)
Reported by: kobaz
Patches: 
      groupmatch2.patch uploaded by kobaz (license 834)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 19:51:53 +00:00
Tilghman Lesher 47f3850a1e Fussy compiler on another machine...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246204 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10 21:24:10 +00:00
Tilghman Lesher 00b5520a6f Fix weird issue with unit tests on optimized build - turned out to be a signing issue.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10 21:19:35 +00:00
Tilghman Lesher eaea15aa02 Enable warnings on atypical conditions for the FILTER function (suggested by mmichelson on the -dev list).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10 15:36:57 +00:00
Tilghman Lesher 5b86e43b30 Merged revisions 245944 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r245944 | tilghman | 2010-02-10 07:37:13 -0600 (Wed, 10 Feb 2010) | 2 lines
  
  Include examples of FILTER usage in extension patterns where a "." may be a risk.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10 14:06:12 +00:00
Russell Bryant bbed34f764 Various updates to the unit test API.
1) It occurred to me that the difference in usage between the error ast_str and
the ast_test_update_status() usage has turned out to be a bit ambiguous in
practice.  In a lot of cases, the same message was being sent to both.
In other cases, it was only sent to one or the other.  My opinion now is that
in every case, I think it makes sense to do both; we should output it to the
CLI as well as save it off for logging purposes.

This change results in most of the changes in this diff, since it required
changes to all existing unit tests.  It also allowed for some simplifications
of unit test API implementation code.

2) Update ast_test_status_update() to include the file, function, and line
number for the code providing the update.

3) There are some formatting tweaks here and there.  Hopefully they aren't too
distracting for code review purposes.  Reviewboard's diff viewer seems to do a
pretty good job of pointing out when something is a whitespace change.

4) I moved the md5_test and sha1_test into the test_utils module.  It seemed
like a better approach since these tests are so tiny.

5) I changed the number of nodes used in heap_test_2 from 1 million to
100 thousand.  The only reason for this was to reduce the time it took
for this test to run.

6) Remove an unused function prototype that was at the bottom of utils.h.

7) Simplify test_insert() using the LIST_INSERT_SORTALPHA() macro.  The one
minor difference in behavior is that it no longer checks for a test registered
with the same name.

8) Expand the code in test_alloc() to provide specific error messages for each
failure case, to clearly inform developers if they forget to set the name,
summary, description, etc.

9) Tweak the output of the "test show registered" CLI command.  I swapped the
name and category to have the category first.  It seemed more natural since
that is the sort key.

10) Don't output the status ast_str in the "test show results" CLI command.
This is going to tend to be pretty verbose, so just leave that for the
detailed test logs (test generate results).

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-09 23:32:14 +00:00
Tilghman Lesher 5071b6debc Correct some off-by-one errors, especially when expressions don't contain expected spaces.
Also include the tests provided by the reporter, as regression tests.

(closes issue #16667)
 Reported by: wdoekes
 Patches: 
       astsvn-func_match-off-by-one.diff uploaded by wdoekes (license 717)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244331 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-02 18:54:33 +00:00
Russell Bryant 34317fb0d3 Fix the ability to specify an OSP token for an outbound IAX2 call.
When this patch was originally submitted, the code allowed for the token to be
set via a channel variable.  I decided that a cleaner approach would be to
integrate it into the CHANNEL() function.  Unfortunately, that is not a suitable
approach.  It's not possible to get the value set on the channel soon enough
using that method.  So, go back to the simple channel variable method.

(closes issue #16711)
Reported by: homesick
Patches:
      iax-svn.diff uploaded by homesick (license 91)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243482 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27 17:32:07 +00:00
Russell Bryant 7770192d7f Update func_aes to its pre-ast_str_substitution state.
This change makes the AES tests in test_substitution.c pass.  We still need to
work through what's going wrong in the ast_str version.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26 15:16:59 +00:00
Tilghman Lesher 44a9aab93a Merged revisions 241765 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r241765 | tilghman | 2010-01-20 23:53:17 -0600 (Wed, 20 Jan 2010) | 2 lines
  
  Guard against division by zero.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-21 05:54:30 +00:00
Tilghman Lesher f6b5cf960f Make HASHes inheritable across channel creation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 19:26:07 +00:00
Tilghman Lesher 0a1b7d8965 Merged revisions 238230 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r238230 | tilghman | 2010-01-06 15:41:55 -0600 (Wed, 06 Jan 2010) | 4 lines
  
  Revise documentation on disposition values to the actual values used.
  (closes issue #16289)
   Reported by: wdoekes
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-06 21:45:17 +00:00
David Vossel ec98fba3ad Merged revisions 232268 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r232268 | dvossel | 2009-12-02 09:41:36 -0600 (Wed, 02 Dec 2009) | 9 lines
  
  fixes segfault in func_groupcount
  
  closes issue #16337)
  Reported by: Parantido
  Patches:
        issue_16337.diff uploaded by dvossel (license 671)
  	  Tested by: Parantido, dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 15:42:54 +00:00
Russell Bryant 4a0c4b0578 Fix a build error on FreeBSD.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01 23:38:34 +00:00
Tilghman Lesher 0bccc4fbe6 Add REPLACE & PASSTHRU functions, overhaul of func_strings, fix API docs for the ast_get_encoded_* functions.
* Add REPLACE function, which searches a given variable for a set of
   characters and replaces each with a given character.
 * Add PASSTHRU function, which passes a literal string back, like a NoOp for
   functions.  Intent is to be able to specify a literal string to another
   function that takes a variable name as an argument.
 * Let the array manipulation functions work with dialplan functions, in
   addition to variables.  This allows the array manipulation functions to
   modify ASTDB and ODBC backends, assuming the func_odbc configuration has
   both read and write functions.
(closes issue #15223)
 Reported by: ajohnson
Patches: 
       20091112__issue15223.diff.txt uploaded by tilghman (license 14)
 Tested by: lmadsen, tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-24 04:58:44 +00:00
David Vossel a1037d3d7e Merged revisions 229669 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r229669 | dvossel | 2009-11-12 10:41:49 -0600 (Thu, 12 Nov 2009) | 6 lines
  
  fixes merging error, datastore was being freed in the wrong function.
  
  (closes issue #16219)
  Reported by: aragon
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-12 16:44:39 +00:00
Matthew Nicholson f44f8650cb Merged revisions 228378 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228378 | mnicholson | 2009-11-06 10:26:59 -0600 (Fri, 06 Nov 2009) | 8 lines
  
  Properly handle '=' while decoding base64 messages and null terminate strings returned from BASE64_DECODE.
  
  (closes issue #15271)
  Reported by: chappell
  Patches:
        base64_fix.patch uploaded by chappell (license 8)
  Tested by: kobaz
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06 19:47:11 +00:00
David Vossel a729d9bb4b fixes memory leak in func_audiohookinherit.c
(closes issue #15394)
Reported by: boroda
Patches:
      bug15394_memoryleak_diff2.txt uploaded by dbrooks (license 790)
Tested by: dbrooks, boroda



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06 15:04:24 +00:00
Mark Michelson 0d1a6d9303 Fix XML in func_cdr.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-05 22:59:02 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
Matthew Nicholson 7ed425ec80 This patch adds a sequence field to CDRs that can be combined with the linkedid or uniqueid field to uniquely identify a CDR.
(closes issue #15180)
Reported by: Nick_Lewis
Patches:
      cdr-sequence10.diff uploaded by mnicholson (license 96)
Tested by: mnicholson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 21:21:09 +00:00
Olle Johansson 8021cf48d8 Adding some clarifications to func_speex doxygen docs.
The functions needed doesn't exist in Speex 1.05 which is what a lot of distros use.
1.2 seems to have been in beta status for years, and does include the sexy functions needed for func_speex to work.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 16:56:48 +00:00
Richard Mudgett 1174a61612 Add support for calling and called subaddress. Partial support for COLP subaddress.
The Telecom Specs in NZ suggests that SUB ADDRESS is always on, so doing
"desk to desk" between offices each with an asterisk box over the ISDN
should then be possible, without a whole load of DDI numbers required.

(closes issue #15604)
Reported by: alecdavis
Patches:
      asterisk_subaddr_trunk.diff11.txt uploaded by alecdavis (license 585)
      Some minor modificatons were made.
Tested by: alecdavis, rmudgett

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22 16:33:22 +00:00
Kevin P. Fleming cdd1f9e296 Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ast_channel_iterator to use it.
This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the
case where multiple results need to be returned; OBJ_NODATA mode
already was supported). In addition, it converts ast_channel_iterators
(only the targeted versions, not the ones that iterate over all
channels) to use this method.

During this work, I removed the 'ao2_flags' arguments to the
ast_channel_iterator constructor functions; there were no uses of that
argument yet, there is only one possible flag to pass, and it made the
iterators less 'opaque'. If at some point in the future someone really
needs an ast_channel_iterator that does not lock the container, we can
provide constructor(s) for that purpose.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 21:08:47 +00:00
Tilghman Lesher 77031501a5 Merged revisions 224855 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224855 | tilghman | 2009-10-20 17:07:11 -0500 (Tue, 20 Oct 2009) | 5 lines
  
  Pay attention to the return value of the manipulate function.
  While this looks like an optimization, it prevents a crash from occurring
  when used with certain audiohook callbacks (diagnosed with SVN trunk,
  backported to 1.4 to keep the source consistent across versions).
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-20 22:09:07 +00:00
Kevin P. Fleming 1c9fe00920 Recorded merge of revisions 222152 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222152 | kpfleming | 2009-10-05 20:16:36 -0500 (Mon, 05 Oct 2009) | 20 lines
  
  Fix ao2_iterator API to hold references to containers being iterated.
  
  See Mantis issue for details of what prompted this change.
  
  Additional notes:
  
  This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK
  has become an enum instead of a macro, with a name that fits our
  naming policy; also, it is now necessary to call
  ao2_iterator_destroy() on any iterator that has been
  created. Currently this only releases the reference to the container
  being iterated, but in the future this could also release other
  resources used by the iterator, if the iterator implementation changes
  to use additional resources.
  
  (closes issue #15987)
  Reported by: kpfleming
  
  Review: https://reviewboard.asterisk.org/r/383/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 01:24:24 +00:00
Matthias Nick 63984d5c21 Merged revisions 221153,221157,221303 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221153 | mnick | 2009-09-30 10:37:39 -0500 (Wed, 30 Sep 2009) | 2 lines
  
  check bounds - prevents for buffer overflow
........
  r221157 | mnick | 2009-09-30 10:41:46 -0500 (Wed, 30 Sep 2009) | 8 lines
  
  added a new dialplan function 'CSV_QUOTE' and changed the cdr_custom.sample.conf
  
  (closes issue #15471)
  Reported by: dkerr
  Patches:
        csv_quote_14.txt uploaded by mnick (license )
  Tested by: mnick
........
  r221303 | mnick | 2009-09-30 14:02:00 -0500 (Wed, 30 Sep 2009) | 2 lines
  
  changed the prototype definition of csv_quote
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 19:42:36 +00:00
Tilghman Lesher 751f191dfa Allow locks to be inherited through a masquerade without causing starvation.
(closes issue #14859)
 Reported by: atis
 Patches: 
       20090821__issue14859.diff.txt uploaded by tilghman (license 14)
       20090925__issue14859__1.6.1.diff.txt uploaded by tilghman (license 14)
 Tested by: atis, tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 04:32:36 +00:00
Michiel van Baak 7eac18b09c add name argument for the CALLERID dialplan function to the xml documentation.
Pointed out to me on IRC by snuff-home. Thanks


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-27 20:40:16 +00:00
Tilghman Lesher 75d8960740 Allow multiple rows to be fetched within the normal mode of operation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@216846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-07 17:15:37 +00:00
Tilghman Lesher 2cfddf8cb6 Add MASTER_CHANNEL() dialplan function, as well as a useful usage.
(closes issue #13140)
 Reported by: cpina
 Patches: 
       20090807__issue13140.diff.txt uploaded by tilghman (license 14)
 Tested by: lmadsen
 Change-type: feature


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-01 23:41:06 +00:00
Olle Johansson 9b12df5731 By copying this code I got bad comments in reviewboard... Better fix the original.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@215023 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-31 18:17:38 +00:00
Tilghman Lesher 18a5f4c490 Add SSL_VERIFYPEER, as requested on the -users list
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@212249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-14 17:36:40 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
David Brooks 48363c16e1 Fixes numerous spelling errors. Patch submitted by alecdavis.
(closes issue #15595)
Reported by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-30 16:07:05 +00:00
Tilghman Lesher 5484d2f5d0 Merged revisions 207945 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r207945 | tilghman | 2009-07-21 17:38:54 -0500 (Tue, 21 Jul 2009) | 8 lines
  
  Force an error if a blank is passed to QUOTE (because the documentation states the argument is not optional).
  This change makes URIENCODE and QUOTE behave similarly, since the documentation
  states that the argument is not optional, for both.
  (closes issue #15439)
   Reported by: pkempgen
   Patches: 
         20090706__issue15439.diff.txt uploaded by tilghman (license 14)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21 22:45:32 +00:00
Kevin P. Fleming 96e4e31eeb Merged revisions 207647 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r207647 | kpfleming | 2009-07-21 08:04:44 -0500 (Tue, 21 Jul 2009) | 12 lines
  
  Ensure that user-provided CFLAGS and LDFLAGS are honored.
  
  This commit changes the build system so that user-provided flags (in ASTCFLAGS
  and ASTLDFLAGS) are supplied to the compiler/linker *after* all flags provided
  by the build system itself, so that the user can effectively override the
  build system's flags if desired. In addition, ASTCFLAGS and ASTLDFLAGS can now
  be provided *either* in the environment before running 'make', or as variable
  assignments on the 'make' command line. As a result, the use of COPTS and LDOPTS
  is no longer necessary, so they are no longer documented, but are still supported
  so as not to break existing build systems that supply them when building Asterisk.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@207680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-21 13:28:04 +00:00
David Vossel 82ce0f4efc TIMEOUT(absolute) returned negative value.
(closes issue #15513)
Reported by: ys



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-16 21:45:14 +00:00
Tilghman Lesher f8c37545ad Merged revisions 206807 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r206807 | tilghman | 2009-07-16 11:27:35 -0500 (Thu, 16 Jul 2009) | 6 lines
  
  Fix a memory leak.
  (closes issue #15517)
   Reported by: adomjan
   Patches: 
         func_realtime.c-ast_variable_destroy.diff uploaded by adomjan (license 487)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206808 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-16 16:51:05 +00:00
Matthew Nicholson 728fbf077e Convert func_odbc to use ast_dummy_alloc_channel()
Review: https://reviewboard.asterisk.org/r/290/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205666 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-09 20:04:43 +00:00