8 years agoBlocked revisions 397034
Kinsey Moore [Tue, 20 Aug 2013 14:08:37 +0000 (14:08 +0000)]
Blocked revisions 397034

Protect CEL from an invalid config on reload

This patch fixes CEL to properly handle an invalid config on reload.

(closes issue ASTERISK-22259)
Reported by: Corey Farrell
Tested by: Corey Farrell
    cel-config.patch uploaded by Corey Farrell

Merged revisions 397033 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoAdd "autoframing" option to sip.conf.sample and h323.conf.sample.
Walter Doekes [Tue, 20 Aug 2013 11:48:57 +0000 (11:48 +0000)]
Add "autoframing" option to sip.conf.sample and h323.conf.sample.

The autoframing option was added to chan_sip.c in r43243 (mogorman,
2006-09-19 01:32:57), but never made its way into the sample configs.


Merged revisions 396994 from

Merged revisions 396995 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoRemove assumption in res_pjsip_dtmf_info that all INFO messages will contain a body.
Joshua Colp [Tue, 20 Aug 2013 11:33:43 +0000 (11:33 +0000)]
Remove assumption in res_pjsip_dtmf_info that all INFO messages will contain a body.

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

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoLet Queue wrap up time influence member availability
Matthew Jordan [Tue, 20 Aug 2013 00:08:33 +0000 (00:08 +0000)]
Let Queue wrap up time influence member availability

Queue members who happen to be in multiple queues at the same time may not
have any wrap up time. This problem occurred due to a code change in Asterisk
11.3.0 that unified device state tracking of Queue members in multiple
Queues (which fixed some other problems, but unfortunately caused this one).

This patch fixes the behavior by having the is_member_available function
check the queue's wrap up time and the time of the member's last call, such
that for a particular queue, the member won't be considered available if their
last call is within the wrap up time.

(closes issue ASTERISK-22189)
Reported by: Tony Lewis
Tested by: Tony Lewis

Merged revisions 396948 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoResolve conflicts between CONFFLAG_DONT_DENOISE and CONFFLAG_INTROUSER_VMREC
Matthew Jordan [Mon, 19 Aug 2013 23:58:47 +0000 (23:58 +0000)]

When r382230 added an option to not denoise the MeetMe conference (if a user
had a channel whose format's sample rate changed frequently, for example),
the value added was the maximum allowed value for the constants that define
the options for MeetMe in 1.8. Not so in 11 - unfortunately, the option
fixes that, and also tweaks one of the way in which the constants was
declared for consistency.

Thanks to Tony Mountifield for pointing out the problem and solution.

(closes issue ASTERISK-22269)
Reported by: Tony Mountifield

Merged revisions 396944 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoUpdate BUGBUG comment.
Richard Mudgett [Mon, 19 Aug 2013 16:10:41 +0000 (16:10 +0000)]
Update BUGBUG comment.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoattended transfers: Fix a bug affecting external blond transfers
Jonathan Rose [Mon, 19 Aug 2013 14:54:08 +0000 (14:54 +0000)]
attended transfers: Fix a bug affecting external blond transfers

Performing a blond transfer (attended transfer that is completed
before the transfer recipient picks up) externally through chan_sip
or chan_pjsip would result in lost references to the channels
involved with the transfer as well as their bridge.

(closes issue ASTERISK-22092)
Reported by: mmichelson

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoWhitespace cleanup
Matthew Jordan [Mon, 19 Aug 2013 14:53:49 +0000 (14:53 +0000)]
Whitespace cleanup

Remove some extraneous blobs

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix invalid access to disposed memory in main/data unit test
Matthew Jordan [Sun, 18 Aug 2013 21:26:37 +0000 (21:26 +0000)]
Fix invalid access to disposed memory in main/data unit test

It is not safe to iterate over a macro'd list of ao2 objects, deref them such
that the item's destructor is called, and leave them in the list. The list
macro to iterate over items requires the item to be a valid allocated object
in order to proceed to the next item; with MALLOC_DEBUG on the corruption of
the linked list is caught in the crash.

This patch fixes the invalid access to free'd memory by removing the ao2 item
from the list before de-refing it.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoUpdate chan_mgcp to the modified parking API
Kinsey Moore [Sun, 18 Aug 2013 03:05:23 +0000 (03:05 +0000)]
Update chan_mgcp to the modified parking API

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoDisable build of res_corosync until it is back in a compiling state
Kinsey Moore [Sun, 18 Aug 2013 02:55:54 +0000 (02:55 +0000)]
Disable build of res_corosync until it is back in a compiling state

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoxml doc changes for 'aor' config object and a few of its options
Rusty Newton [Sat, 17 Aug 2013 18:13:11 +0000 (18:13 +0000)]
xml doc changes for 'aor' config object and a few of its options

Added or modified text in the xml doc for the 'aor' config object to address a few issues:
* help for the 'mailboxes' option didn't make it clear how the "list" should be formatted.
* AoR object's involvement in inbound registration wasn't mentioned.
* help for the 'contact' option didn't describe how to specify multiple contacts.
* help for the 'max_contacts' option didn't tell whether it limited the amount of contacts defined through static configuration.

(issue ASTERISK-22118)
(closes issue ASTERISK-22118)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years ago'domain_alias' config object XML help doesn't make it clear that the name used for...
Rusty Newton [Sat, 17 Aug 2013 17:47:34 +0000 (17:47 +0000)]
'domain_alias' config object XML help doesn't make it clear that the name used for the object is the domain alias

(issue ASTERISK-22114)
(closes issue ASTERISK-22114)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoxml doc changes for clarity - 'auth' config object and auth's 'auth_type' config...
Rusty Newton [Sat, 17 Aug 2013 17:40:34 +0000 (17:40 +0000)]
xml doc changes for clarity - 'auth' config object and auth's 'auth_type' config option

(issue ASTERISK-22108)
(closes issue ASTERISK-22108)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoxml doc change for transport config object - remove non-applicable warning and add...
Rusty Newton [Sat, 17 Aug 2013 17:27:40 +0000 (17:27 +0000)]
xml doc change for transport config object - remove non-applicable warning and add text regarding Asterisk restart

(closes issue ASTERISK-22105)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoAllow res_parking to be unloadable
Kinsey Moore [Sat, 17 Aug 2013 15:01:54 +0000 (15:01 +0000)]
Allow res_parking to be unloadable

This change protects accesses of res_parking such that it can unload
safely once transient uses of its registered functions are complete.
The parking API has been restructured such that its consumers do not
have access to the vtable exposed by the parking provider, but instead
route through stubs to prevent consumers from holding on to function

This adds calls to all the parking unload functions and moves
application loading and unloading into functions in
parking_applications.c similar to the rest of the parts of res_parking.

(closes issue ASTERISK-22142)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoRefactor CEL to avoid using the event system core
Kinsey Moore [Sat, 17 Aug 2013 14:46:44 +0000 (14:46 +0000)]
Refactor CEL to avoid using the event system core

This removes usage of the event system for CEL backend data
distribution and strips unused pieces out of the event system.


git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoStrip down the old event system
Kinsey Moore [Sat, 17 Aug 2013 14:39:27 +0000 (14:39 +0000)]
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.

(closes issue ASTERISK-22139)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix CLI "bridge kick <bridge> <channel>" to check if the bridge needs dissolving.
Richard Mudgett [Fri, 16 Aug 2013 20:48:13 +0000 (20:48 +0000)]
Fix CLI "bridge kick <bridge> <channel>" to check if the bridge needs dissolving.

SIP/foo -- Local;1==Local;2 -- .... -- Local;1==Local;2 -- SIP/bar
Kick a ;1 channel and the chain toward SIP/foo goes away.
Kick a ;2 channel and the chain toward SIP/bar goes away.

This can leave a local channel chain between the kicked ;1 and ;2 channels
that are orphaned until you manually request one of those channels to
hangup or request the bridge to dissolve.

* Added ast_bridge_kick() as a companion to ast_bridge_remove().  The
functional difference is that ast_bridge_kick() may dissolve the bridge as
a result of the channel leaving the bridge.

* Made CLI "bridge kick <bridge> <channel>" use ast_bridge_kick() instead
of ast_bridge_remove() so the bridge can dissolve if needed.

* Renamed bridge_channel_handle_hangup() to ast_bridge_channel_kick() and
made it accessible to other files.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix some doxygen bridging file references.
Richard Mudgett [Fri, 16 Aug 2013 18:34:31 +0000 (18:34 +0000)]
Fix some doxygen bridging file references.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoDoxygen comment tweaks.
Richard Mudgett [Fri, 16 Aug 2013 17:33:21 +0000 (17:33 +0000)]
Doxygen comment tweaks.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix utilities compilation/linking.
Richard Mudgett [Fri, 16 Aug 2013 16:26:11 +0000 (16:26 +0000)]
Fix utilities compilation/linking.

The horrid structure of the source in the utils directory strikes again.
Moved the _ast_mem_backtrace_buffer[] definition from the logical location
in utils.c to hashtab.c so the aelparse and conf2ael utilities can link.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoutils.h: Minor formatting tweaks.
Richard Mudgett [Fri, 16 Aug 2013 16:22:26 +0000 (16:22 +0000)]
utils.h: Minor formatting tweaks.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoStasis: address refcount races; implementation comments
David M. Lee [Fri, 16 Aug 2013 16:03:34 +0000 (16:03 +0000)]
Stasis: address refcount races; implementation comments

Change r395954 reordered some stasis object destruction, which should
have been fine. Unfortunately, it caused some hard to reproduce issues
related to objects being accessed after they had been destroyed. The
patch in r396329 fixed the destruction order problem; this patch
addresses the underlying issue. A few other stasis-related fixes were
also added.

 * Add ref-bumps around areas where objects may get transitively
   destroyed. (For example, where we lock a topic, unref a subscription,
   which unrefs the topic, which explodes the topic when we try to
   unlock it.)

 * Wrote an extensive doxygen page about Stasis implementation,
   relationships between objects, lifecycles of objects, how the
   refcounting works, etc. Many other comments were added, corrected, or
   cleaned up.

 * Added an assert to the topic dtor to catch extra ref decrements.

 * Fixed type used after destruction errors for graceful shutdown in

 * I added two unit tests in an attempt to catch destruction order
   issues. Since the underlying cause is a race condition, though, the
   tests rarely failed even when the code was wrong.

 * Fixed a leak in stasis_cache_pattern.c.

(closes issue ASTERISK-22243)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoImprove sounds indexer CLI commands
Kinsey Moore [Fri, 16 Aug 2013 12:20:59 +0000 (12:20 +0000)]
Improve sounds indexer CLI commands

This reworks the CLI commands used to access sounds information from
"sounds show[ soundid]" to "core show sounds" and
"core show sound <soundid>". This also reworks the "sounds reload" CLI
command to fall under normal module reloading ("module reload sounds").

Also, make trunk build when DEBUG_MALLOC is not enabled.

(closes issue ASTERISK-22141)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoPrevent heap alloc functions from running out of stack space.
Walter Doekes [Fri, 16 Aug 2013 07:18:51 +0000 (07:18 +0000)]
Prevent heap alloc functions from running out of stack space.

When asterisk has run out of memory (for whatever reason), the alloc
function logs a message. Logging requires memory. A recipe for
infinite recursion.

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


git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoBridge: Don't suspend/unspend the channel for interception routines.
Richard Mudgett [Thu, 15 Aug 2013 22:10:20 +0000 (22:10 +0000)]
Bridge: Don't suspend/unspend the channel for interception routines.

By their nature, the connected line and redirecting interception routines
are not supposed to affect the channel's media.  Therefore, they should
not suspend and unsuspend the channel while running.  The
suspend/unsuspend operations could be expensive depending upon the bridge
and channel technology involved.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoMinor parking cleanup.
Richard Mudgett [Thu, 15 Aug 2013 21:52:01 +0000 (21:52 +0000)]
Minor parking cleanup.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoParking: Eliminate local channel name hack to get peer channel.
Richard Mudgett [Thu, 15 Aug 2013 20:09:10 +0000 (20:09 +0000)]
Parking: Eliminate local channel name hack to get peer channel.

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

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoRemove early bridge BUGBUG comments. Remove some unneeded features.c comments.
Richard Mudgett [Thu, 15 Aug 2013 19:14:43 +0000 (19:14 +0000)]
Remove early bridge BUGBUG comments.  Remove some unneeded features.c comments.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoUpdate features.conf.sample atxferdropcall option.
Richard Mudgett [Thu, 15 Aug 2013 19:13:34 +0000 (19:13 +0000)]
Update features.conf.sample atxferdropcall option.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoChanged some BUGBUG tags to associated JIRA issue tags.
Richard Mudgett [Thu, 15 Aug 2013 18:20:52 +0000 (18:20 +0000)]
Changed some BUGBUG tags to associated JIRA issue tags.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoResolve some BUGBUG comments.
Richard Mudgett [Thu, 15 Aug 2013 17:57:33 +0000 (17:57 +0000)]
Resolve some BUGBUG comments.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoRemove leading spaces from the CLI command before parsing
Kinsey Moore [Thu, 15 Aug 2013 16:37:06 +0000 (16:37 +0000)]
Remove leading spaces from the CLI command before parsing

If you've mistakenly put a space before typing in a command, the
leading space will be included as part of the command, and the command
parser will not find the corresponding command. This patch rectifies
that situation by stripping the leading spaces on commands.

Patch-by: Tilghman Lesher

Merged revisions 396745 from

Merged revisions 396746 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoRemove some dead code dealing with: AST_BRIDGE_REC_CHANNEL_0, AST_BRIDGE_REC_CHANNEL_...
Richard Mudgett [Thu, 15 Aug 2013 15:12:16 +0000 (15:12 +0000)]

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix Bridge API DTMF hook matching for begin and end DTMF events.
Richard Mudgett [Thu, 15 Aug 2013 14:20:59 +0000 (14:20 +0000)]
Fix Bridge API DTMF hook matching for begin and end DTMF events.

The Bridge API DTMF hook matching would not deal with DTMF end events
only.  It required a DTMF begin event to start matching the DTMF hooks.
There are many places in Asterisk where code only generates DTMF end
events without the corresponding begin event.  One such place is the AMI
action Atxfer.

* Fixed DTMF hook matching if there is a string of DTMF frames in the read
queue.  We could potentially miss some of them before.

* Fixed AMI Atxfer action documentation.

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


git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix feature_attended_transfer test
Kinsey Moore [Thu, 15 Aug 2013 12:17:41 +0000 (12:17 +0000)]
Fix feature_attended_transfer test

The feature_attended_transfer test is failing due to Asterisk not
passing DTMF in the bridges created for internal attended transfers.
This sets the features initialization routine to set this flag by
default and adjusts the basic bridge and confbridge's use of the
bridging system accordingly as per Richard's suggestion instead of
adjusting this individual case. This change allows the necessary DTMF
to pass through the attended transfer bridge and complete the test

(closes issue ASTERISK-22222)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix deadlocks in chan_sip in REFER and BYE handling
Kinsey Moore [Thu, 15 Aug 2013 12:12:26 +0000 (12:12 +0000)]
Fix deadlocks in chan_sip in REFER and BYE handling

This resolves several deadlocks in chan_sip relating to usage of
ast_channel_bridge_peer and improves accessibility of lock debugging
function calls.

(closes issue ASTERISK-22215)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoPrevent automagic things from happening to Stasis application bridges
Kinsey Moore [Thu, 15 Aug 2013 12:05:41 +0000 (12:05 +0000)]
Prevent automagic things from happening to Stasis application bridges

This prevents swap optimization, merges, and transfers involving Stasis
application bridges. It wouldn't be nice if the bridge you thought you
owned disappeared from under you.

Reported-by: Richard Mudgett

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoRemove unsupported channel technology callbacks.
Richard Mudgett [Thu, 15 Aug 2013 00:16:39 +0000 (00:16 +0000)]
Remove unsupported channel technology callbacks.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agochan_vpb: Effectively remove native support. Left enough bread crumbs to be able...
Richard Mudgett [Wed, 14 Aug 2013 23:35:08 +0000 (23:35 +0000)]
chan_vpb: Effectively remove native support.  Left enough bread crumbs to be able to convert later if needed.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agochan_iax2: Conditionally remove native support for now.
Richard Mudgett [Wed, 14 Aug 2013 23:20:02 +0000 (23:20 +0000)]
chan_iax2: Conditionally remove native support for now.

(issue ASTERISK-21944)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agochan_misdn: Effectively remove native support. Left enough bread crumbs to be able...
Richard Mudgett [Wed, 14 Aug 2013 22:53:27 +0000 (22:53 +0000)]
chan_misdn: Effectively remove native support.  Left enough bread crumbs to be able to convert later if needed.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoapp_bridgewait: Inhibit local channel optimizations to the bridge.
Richard Mudgett [Wed, 14 Aug 2013 21:28:21 +0000 (21:28 +0000)]
app_bridgewait: Inhibit local channel optimizations to the bridge.

Holding bridges can allow local channel move/swap optimization to the
bridge.  However, we cannot allow it for the BridgeWait holding bridge
because the call will lose the channel roles and dialplan location as a

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoTweak comment for why usleep is used.
Joshua Colp [Wed, 14 Aug 2013 19:06:59 +0000 (19:06 +0000)]
Tweak comment for why usleep is used.

Merged revisions 396656 from

Merged revisions 396657 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoTweak test_hashtab_thrash test to allow the critical threads to execute.
Joshua Colp [Wed, 14 Aug 2013 18:10:08 +0000 (18:10 +0000)]
Tweak test_hashtab_thrash test to allow the critical threads to execute.

Depending on certain conditions it was possible for the hashtab counting thread
to starve other threads, preventing them from executing in the expected fashion.
This change adds a sleep to allow the others to do what they need to do. While
this doesn't thrash the hashtab as much as previously, it at least works.

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

Merged revisions 396619 from

Merged revisions 396620 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agochan_sip: Convert 'just did sched_add waitid...' from warning to debug message.
Walter Doekes [Tue, 13 Aug 2013 18:47:58 +0000 (18:47 +0000)]
chan_sip: Convert 'just did sched_add waitid...' from warning to debug message.

    reviewboard-2377.patch uploaded by Paul Belanger

Merged revisions 396582 from

Merged revisions 396583 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agochan_sip: Fix IP-addr in warning when rejecting a contact ACL.
Walter Doekes [Tue, 13 Aug 2013 18:36:27 +0000 (18:36 +0000)]
chan_sip: Fix IP-addr in warning when rejecting a contact ACL.

    reviewboard-2155.patch uploaded by Paul Belanger

Merged revisions 396579 from

Merged revisions 396580 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoARI: allow other operations to happen while bridged
David M. Lee [Tue, 13 Aug 2013 15:27:32 +0000 (15:27 +0000)]
ARI: allow other operations to happen while bridged

This patch changes ARI bridging to allow other channel operations to
happen while the channel is bridged.

ARI channel operations are designed to queue up and execute
sequentially. This meant, though, that while a channel was bridged,
any other channel operations would queue up and execute only after the
channel left the bridge.

This patch changes ARI bridging so that channel commands can execute
while the channel is bridged. For most operations, things simply work
as expected. The one thing that ended up being a bit odd is recording.

The current recording implementation will fail when one attempts to
record a channel that's in a bridge. Note that the bridge itself may
be recording; it's recording a specific channel in the bridge that
fails. While this is an annoying limitation, channel recording is
still very useful for use cases such as voice mail, and bridge
recording makes up much of the difference for other use cases.

(closes issue ASTERISK-22084)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoMissed a spot in r396559
David M. Lee [Tue, 13 Aug 2013 15:11:44 +0000 (15:11 +0000)]
Missed a spot in r396559

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix build warnings when printf a tv_usec.
David M. Lee [Tue, 13 Aug 2013 14:57:34 +0000 (14:57 +0000)]
Fix build warnings when printf a tv_usec.

The debug logs added in r396528 neglected to account for suseconds_t
being an int.

See r392076 for more info.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoAdd test suite events for when contacts are added or removed from an AOR
John Bigelow [Mon, 12 Aug 2013 22:05:18 +0000 (22:05 +0000)]
Add test suite events for when contacts are added or removed from an AOR

These are needed by the pjsip inbound registration test suite tests.

(issue ASTERISK-21833)
(issue ASTERISK-21834)
(issue ASTERISK-21835)
(issue ASTERISK-21837)


git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix two race conditions and ref counting issue when joining a bridge
Matthew Jordan [Mon, 12 Aug 2013 15:59:19 +0000 (15:59 +0000)]
Fix two race conditions and ref counting issue when joining a bridge

These problems were all caught by a test in the Asterisk Test Suite that
originated some Local channels and attempted to move the ;2 half of the Local
channel into a bridge using the Bridge AMI action.

(1) When originating a channel, the Newchannel event is emitted quickly;
    however, the ;2 channel will not have a pbx thread assigned to it until
    after the outbound 'dialing' for the ;1 is complete. Thus, there is a period
    of time where the outside world "knows" of the channel's existence and can
    influence it but Asterisk has not yet started the dialplan execution thread.
    If a Bridge AMI action is taken on the channel, the channel appears to be a
    Dialed channel with no PBX thread; hence, the channel will be imparted into
    the Bridge by first 'yanking' the channel. At the same time, a race condition
    can occur after the yank (but before entering the bridge) when ;1 answers
    and starts a PBX on the ;2. The end result currently is an assertion failure
    in the Bridging API, as a channel with a PBX is imparted into the Bridge.

    There's no way to prevent AMI from attempting to Bridge a channel
    immediately after creation; likewise, holding the channel lock through the
    entire Dial operation is unwise (and impossible). Instead of treating the
    presence of a PBX thread as an error, we simply bail out of the adding the
    channel to the bridge through ast_bridge_impart. The Bridge action will
    then fail - but we avoid a situation where the channel is both executing
    a PBX thread and simultaneously being given a separate thread in the
    bridging system (which would be a "bad thing"). Since imparting a channel
    with a PBX *can* occur and is not a programming error, the asserts have been

(2) When the first condition occurs, we have to take one of two actions: either
    hangup the yanked channel as it did not enter the bridge, or deref it
    because we don't own it. We can determine if we own it or not by testing
    for the presence of the PBX thread. If we hung it up directly, we'd crash.

(3) bridge_find_channel does not increase the reference count of the
    ast_bridge_channel object. The RAII_VAR usage in ast_bridge_add_channel
    thus created a ticking time bomb in whatever bridge the channel moved into,
    as the destructor for the ast_bridge_channel object would be called.


git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoUnlock outgoing dial lock on off nominal path
Matthew Jordan [Mon, 12 Aug 2013 15:48:58 +0000 (15:48 +0000)]
Unlock outgoing dial lock on off nominal path

If the thread servicing the dial request isn't created successfully, the
outgoing dial lock will still be held when the function returns. This patch
unlocks the lock on this off nominal path.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoPipe test output through test object not stdout
Matthew Jordan [Sat, 10 Aug 2013 20:29:56 +0000 (20:29 +0000)]
Pipe test output through test object not stdout

Otherwise, it doesn't show up in the automated test failures

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoAdd some debugging when test_hashtab_thrash fails
Matthew Jordan [Sat, 10 Aug 2013 19:45:31 +0000 (19:45 +0000)]
Add some debugging when test_hashtab_thrash fails

Disabling DEBUG_THREADS caused this test to fail on the 32-bit build agent.
Adding some debugging to see why it thinks the test is timing out.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoUnlock the dial operation lock on a failed dial
Matthew Jordan [Sat, 10 Aug 2013 04:18:33 +0000 (04:18 +0000)]
Unlock the dial operation lock on a failed dial

If a dial operation fails, the pbx_outgoing_attempt routine will exit without
first having unlocked the outgoing dial lock. This would be a "bad thing".

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agobridge_native_rtp: Remove some unnecessary NULL checks on c1.
Richard Mudgett [Fri, 9 Aug 2013 21:50:08 +0000 (21:50 +0000)]
bridge_native_rtp: Remove some unnecessary NULL checks on c1.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoDon't leak frames when memory is full in autoservice_run.
Walter Doekes [Fri, 9 Aug 2013 20:29:09 +0000 (20:29 +0000)]
Don't leak frames when memory is full in autoservice_run.


git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agopbx: Make originate threads indicate dial status when synchronous
Jonathan Rose [Fri, 9 Aug 2013 17:28:15 +0000 (17:28 +0000)]
pbx: Make originate threads indicate dial status when synchronous

This makes it so that we can detect failures to originate as with
earlier versions of Asterisk, which restores the Asterisk 11 behavior
for the originate manager action. This was causing the ACL tests for
SIP and IAX2 to fail since those tests expected originate failures
when ACLs would cause rejections. Also, this patch fixes crashes in
chan_sip when ACLs rejected peers during registration verification.

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

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agobridge_channel: Support the lonely flag and make ARI use it.
Jonathan Rose [Fri, 9 Aug 2013 17:22:28 +0000 (17:22 +0000)]
bridge_channel: Support the lonely flag and make ARI use it.

The lonely flag is an optional flag for bridge channels that will
make them leave a bridge when a channel leaves if only lonely
channels are in the bridge at that point. This is useful for things
like ending recording and playback channels when they cease to be
interacting with other channels in the bridge.

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

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoUpdate documentation for ConfBridge with some additional markup
Matthew Jordan [Fri, 9 Aug 2013 13:58:02 +0000 (13:58 +0000)]
Update documentation for ConfBridge with some additional markup

Add some additional markup for items that needed it, e.g.,
replaceable tags, literal tags, etc.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix stasis/core unit test. Should have had the CR/LF.
Richard Mudgett [Thu, 8 Aug 2013 22:57:06 +0000 (22:57 +0000)]
Fix stasis/core unit test.  Should have had the CR/LF.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agochan_dahdi: create channels at run-time
Tzafrir Cohen [Thu, 8 Aug 2013 22:09:07 +0000 (22:09 +0000)]
chan_dahdi: create channels at run-time

This code adds chan_dahdi the command 'dahdi create channels <range>'
(where <range> is a single <n>-<m> or 'new') and updates 'dahdi destroy
channel' with a similar 'dahdi destroy channels'. It allows DAHDI
channels and spans to be added after the initial channel load
(without destroying all other channels as in 'dahdi restart').

It also includes some fixes to the D-Channel / span destruction code

This change is intended to provide a hook for a script running from
udev once a span has been assigned ("registered") / unassigned
("unregistered") for its channels. The udev hook configures the span's
channels with dahdi_cfg -S, and can then ask Asterisk to create ethe
channels. See the scripts added to DAHDI-tools in 2.7.0.


git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoAdd missing CR/LF to FakeMI stasis test AMI event.
Richard Mudgett [Thu, 8 Aug 2013 20:52:49 +0000 (20:52 +0000)]
Add missing CR/LF to FakeMI stasis test AMI event.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoRemove extra CR/LF from AMI event.
Richard Mudgett [Thu, 8 Aug 2013 20:51:38 +0000 (20:51 +0000)]
Remove extra CR/LF from AMI event.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoBlocked revisions 396441
Walter Doekes [Thu, 8 Aug 2013 20:23:26 +0000 (20:23 +0000)]
Blocked revisions 396441

Consistent memory allocation by ast_bt_get_symbols.

Always use ast_alloc/ast_free. This is handled differently in trunk (r391012).


Merged revisions 396427 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoMake bridge snapshots use prefixes.
Richard Mudgett [Thu, 8 Aug 2013 19:16:33 +0000 (19:16 +0000)]
Make bridge snapshots use prefixes.

* Changed ast_manager_build_bridge_state_string() to assume an empty
prefix string just like ast_manager_build_channel_state_string().

* Created ast_manager_build_bridge_state_string_prefix() to work just like

* Made BridgeMerge AMI event use To/From prefixes.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoImprove disk writes for wav49 format
Matthew Jordan [Thu, 8 Aug 2013 18:40:15 +0000 (18:40 +0000)]
Improve disk writes for wav49 format

Writing to a file in the wav49 format performs rather inefficiently. The
procedure is approximately:
 (1) Write GSM frame to the end of the file
 (2) Seek to the end of the file
 (3) Seek to the header
 (4) Update the file size
 (5) Seek (again) to the end of the file
 (6) Repeat

This pattern negates any attempt to use the stdio buffering setup in
ast_writefile. It also results in many small writes that require a seek going
to the disk each second which translates to poor disk performance on certain
file systems, particularly when there are multiple wav49 files being written

(closes issue ASTERISK-19595)
Reported by: Byron Clark
Tested by: Byron Clark
  gsm_wav_only_update_header_on_close.patch uploaded by byronclark (License 6157)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoRemove some resolved or obsolete BUGBUG comments.
Richard Mudgett [Thu, 8 Aug 2013 17:51:26 +0000 (17:51 +0000)]
Remove some resolved or obsolete BUGBUG comments.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoHide the Surrogate channels from external consumers; kill Masquerade events
Matthew Jordan [Thu, 8 Aug 2013 14:13:05 +0000 (14:13 +0000)]
Hide the Surrogate channels from external consumers; kill Masquerade events

This patch does three things:
1. It provides a Surrogate channel technology with a consolidated
   "implementation detail flag" on the channel technology. This tells
   consumers of Stasis that the creation of this channel is an implementation
   detail in Asterisk and can be ignored (if they so choose). This
   consolidates the conference recorder/announcer flags as well - these flags
   had no additional meaning beyond "ignore this channel please".

2. It modifies allocation of a channel in two ways:
   (a) If a channel technology can be determined from the name, we set it
       directly in the allocation routine. This prevents the initial
       publication of the message from going out with a NULL channel technology
       where possible. This lets Stasis consumers get the right channel
       technology on the first publication.
   (b) It reorganizes allocation to make use of the 'finalized' property on the
       channel. This was already used to know that a channel had completely
       finished its construction in the masquerade routine; now we also use it
       to know whether or not the setting of certain channel properties is
       occurring during or post construction. The various set routines were
       modified accordingly as well.

3. The masquerade event is now dead, Jim. It no longer served any purpose
   whatsoever - if you perform a call pickup you'll get a Pickup event;
   if you perform an attended transfer you will still get those events; if you
   steal a channel to put it elsewhere you'll get the corresponding NewExten or
   BridgeEnter events.


git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoPrevent spurious memory error when appending backtrace with MALLOC_DEBUG
Matthew Jordan [Thu, 8 Aug 2013 13:54:46 +0000 (13:54 +0000)]
Prevent spurious memory error when appending backtrace with MALLOC_DEBUG

Backtraces are allocated outside of the usual memory tracking performed by
MALLOC_DEBUG. This allows them to be used by the memory tracking enabled
by that build option; however, it also means that when backtraces are
disposed of they have to be done so outside of the re-defined free.

This patch undef's free prior to disposing of the allocated backtrace when
a backtrace is appended as a result of 'core show locks'.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoPrevent unreal channels from optimizing during DTMF emulation
Kinsey Moore [Thu, 8 Aug 2013 12:38:06 +0000 (12:38 +0000)]
Prevent unreal channels from optimizing during DTMF emulation

This prevents unreal channel optimization during the prequalification
phase when either channel is involved in DTMF emulation. This prevents
a situation where an emulated digit would be missed because the
emulation was never completed.

(closes issue ASTERISK-22214)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years ago - Fix different issues with call transfer cancel. In case 3rd party busy or congesti...
Igor Goncharovskiy [Thu, 8 Aug 2013 07:05:54 +0000 (07:05 +0000)]
 - Fix different issues with call transfer cancel. In case 3rd party busy or congestion call was not returned.
 - Fix displaying soft button 'Redial' in case of no redial number exists

Merged revisions 396377 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoHandle Surrogate channels in Dial message processing
Matthew Jordan [Thu, 8 Aug 2013 02:58:01 +0000 (02:58 +0000)]
Handle Surrogate channels in Dial message processing

Depending on when a Surrogate channel replaces an existing channel, it is
possible to get a Dial message for the Surrogate channel. When this occurs, no
CDR will exist for the channel as Surrogate channels are ignored. Safely handle
the case when a CDR doesn't exist for a Dial message.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoPerform Ring-No-Answer checks before processing Hangup logic
Matthew Jordan [Wed, 7 Aug 2013 21:38:17 +0000 (21:38 +0000)]
Perform Ring-No-Answer checks before processing Hangup logic

The rna() routine will raise a Stasis message involving both the caller and the
agent. This doesn't work so well if we already hung up the agent channel, as
the channel doesn't quite exist. Not surprisingly, this will crash. This patch
properly runs the rna subroutine (performing all of the Ring-No-Answer logic)
prior to hanging up the agent channel.

(closes issue ASTERISK-22258)
Reported by: Kiril Valchev
Tested by: Kiril Valchev

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFixed app_meetme for cache split changes
David M. Lee [Tue, 6 Aug 2013 21:20:58 +0000 (21:20 +0000)]
Fixed app_meetme for cache split changes

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoARI: Add recording controls
David M. Lee [Tue, 6 Aug 2013 14:44:45 +0000 (14:44 +0000)]
ARI: Add recording controls

This patch implements the controls from ARI recordings. The controls

 * 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)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoTweak caching topics to fix CEL tests
David M. Lee [Tue, 6 Aug 2013 14:28:23 +0000 (14:28 +0000)]
Tweak caching topics to fix CEL tests

The Stasis changes in r395954 had an unanticipated side effect: messages
published directly to an _all topic does not get forwarded to the
corresponding caching topic.

This patch fixes that by changing how caching topics forward messages,
and how the caching pattern forwards are setup.

For the caching pattern, the all_topic is forwarded to the
all_topic_cached. This forwards messages published directly to the
all_topic to all_topic_cached.

In order to avoid duplicate messages on all_topic_cached, caching topics
were changed to no longer forward uncached messages. Subscribers to an
individual caching topic should only expect to receive cache updates,
and subscription change messages. Since individual caching topics are
new, this shouldn't be a problem.

There are a few minor changes to the pre-cache split behavior.

 * For topics changed to use the caching pattern, the all_topic_cached
   will forward snapshots in addition to cache updates. Since
   subscribers by design ignore unexpected messages, this should be

 * Caching topics that don't use the caching pattern no longer forward
   non-cache updates. This makes no difference for the current caching

   * mwi_topic_cached, channel_by_name_topic and
     presence_state_topic_cached have no subscribers

   * device_state_topic_cached's only subscriber only processes cache

(issue ASTERISK-22243)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoExpose res_pjsip threadpool options
Kinsey Moore [Tue, 6 Aug 2013 13:08:13 +0000 (13:08 +0000)]
Expose res_pjsip threadpool options

Expose initial size, automatic increment, maximum size, and idle
timeout as configurable parameters for the res_pjsip thread pool.

(closes issue ASTERISK-22143)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix memory leaks in the CDR engine
Kinsey Moore [Tue, 6 Aug 2013 12:45:39 +0000 (12:45 +0000)]
Fix memory leaks in the CDR engine

Fix refcount bugs and a possible locking problem in the CDR engine
relating to use of ao2_iterators.

(closes issue ASTERISK-22126)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix crash in res_pjsip_outbound_registration when the remote server can not be resolved.
Joshua Colp [Tue, 6 Aug 2013 12:39:27 +0000 (12:39 +0000)]
Fix crash in res_pjsip_outbound_registration when the remote server can not be resolved.

This crash was caused by decrementing the reference count of a newly created message when
it should not be. This change fixes that but also fixes all other cases where this was
incorrectly done.

(closes issue ASTERISK-22188)
Reported by: Kinsey Moore

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoCheck result of ast_var_assign() calls for memory allocation failure (2).
Walter Doekes [Tue, 6 Aug 2013 08:43:22 +0000 (08:43 +0000)]
Check result of ast_var_assign() calls for memory allocation failure (2).

Missed a spot in the previous commit.

Merged revisions 396310 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoCheck result of ast_var_assign() calls for memory allocation failure.
Walter Doekes [Tue, 6 Aug 2013 08:36:15 +0000 (08:36 +0000)]
Check result of ast_var_assign() calls for memory allocation failure.

We try to keep the system running even when all available memory is


Merged revisions 396279 from

Merged revisions 396287 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix Registration Failure When A Peer And TLS Are Used
Michael L. Young [Mon, 5 Aug 2013 20:20:41 +0000 (20:20 +0000)]
Fix Registration Failure When A Peer And TLS Are Used

If a peer is used in a register line and TLS is defined as the transport, the
registration fails since the transport on the dialog is never set properly
resulting in UDP being used instead of TLS.

This patch sets the dialog's transport based on the transport that was defined
in the register line.  If the register line does not specify a transport, the
parsing function for the register line always defaults back to UDP.

(closes issue ASTERISK-21964)
Reported by: Doug Bailey
Tested by: Doug Bailey
by Michael L. Young (license 5026)

Merged revisions 396240 from

Merged revisions 396248 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agobridge features: Dial and Queue add features instead of replace them.
Jonathan Rose [Mon, 5 Aug 2013 20:18:54 +0000 (20:18 +0000)]
bridge features: Dial and Queue add features instead of replace them.

Dial and Queue would previously apply a new set of features whenever
bridging. These options would be based purely on the options supplied
to the dial/queue applications. This patch changes the function those
applications use to bridge calls so that the features will be added
to the set of existing features for each channel rather than having
them override the existing features.

(closes issue ASTERISK-22209)
Reported by: Jonathan Rose

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoAdd AMI registration events for PJSIP outbound registration attempts
Matthew Jordan [Mon, 5 Aug 2013 19:01:45 +0000 (19:01 +0000)]
Add AMI registration events for PJSIP outbound registration attempts

This patch adds AMI events whenever an outbound registration attempt succeeds
or fails from res_pjsip_outbound_registration. This brings it inline with
the existing SIP channel driver and IAX channel driver.


git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoChange "from" to "From".
Michael L. Young [Mon, 5 Aug 2013 18:52:22 +0000 (18:52 +0000)]
Change "from" to "From".

(related to issue ASTERISK-21903)

Merged revisions 396199 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoAdding a note to UPGRADE.txt about a change made to res_agi in order to
Michael L. Young [Mon, 5 Aug 2013 18:46:57 +0000 (18:46 +0000)]
Adding a note to UPGRADE.txt about a change made to res_agi in order to
indicate when streaming an audio file fails like it is done in other parts
of the code to indicate an error.

Note was requested by Paul Belanger:

(related to issue ASTERISK-21903)

Merged revisions 396196 from

Merged revisions 396197 from

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agobridge_holding: Add suspsend/unsuspend callbacks
Jonathan Rose [Mon, 5 Aug 2013 17:48:03 +0000 (17:48 +0000)]
bridge_holding: Add suspsend/unsuspend callbacks

Suspend and unsuspend callbacks are added to the holding bridge so
that entertainment can be disabled and re-enabled when operations
would suspend a channel on the bridge (such as playback operations).
This fixes entertainment so that when those operations end, the
entertainment can pick back up and it also serves as an optimization.
Also, this patch fixes a bug caused by triggering ringing frames
immediately instead of pushing them to the queue which created a race
condition where sometimes parking with ringing during attended
transfers would cause the ringing to be interrupted by an unhold

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

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoARI: bridges/{bridgeID}/addChannel: add roles parameter
Jonathan Rose [Mon, 5 Aug 2013 16:59:13 +0000 (16:59 +0000)]
ARI: bridges/{bridgeID}/addChannel: add roles parameter

Roles are now cleared with each entry into a bridge with addChannel.
If the roles parameter is present, the role specified will be applied
to all channels being added with the addChannel command.

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

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agores_parking: Unit tests
Jonathan Rose [Mon, 5 Aug 2013 16:00:01 +0000 (16:00 +0000)]
res_parking: Unit tests

Adds the following unit tests:
* create_lot: tests adding and removal of a new parking lot (baseline)
* park_extensions: creates a parking lot that registers extensions and
      then confirms that all of the expected extensions exist
* extensions_conflicts: creates numerous parking lots to test that
      extension conflicts in parking lots result in parking lot
      creation failing
* dynamic_parking_variables: Tests that the creation of dynamic
      parking lots respects the related channel variables set on the
      channel that requests them.
* park_call: Tests adding a channel to a parking lot's holding bridge
      by standard parking functions.
* retrieve_call: Tests pulling a channel out of a parking lot's
      holding bridge via parked call retrieval functions.

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

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoFix res_ari_asterisk load issue
David M. Lee [Mon, 5 Aug 2013 14:35:00 +0000 (14:35 +0000)]
Fix res_ari_asterisk load issue

The new module presents several config options
from asterisk main. Unfortunately, they aren't exported, so the module
won't load on Linux.

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


git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoDon't unsubscribe from the AMI message router from manager_bridges
Matthew Jordan [Sat, 3 Aug 2013 03:53:46 +0000 (03:53 +0000)]
Don't unsubscribe from the AMI message router from manager_bridges

The AMI message router is owned wholly by manager.c. Previously, each of the
manager_{item} source files had their own message router and they unsubscribed
from each; once they moved over to using a single message router only a single
unsubscribe became necessary.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoAnd get rid of another ast_bridged_channel()
Mark Michelson [Fri, 2 Aug 2013 17:50:40 +0000 (17:50 +0000)]
And get rid of another ast_bridged_channel()

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoClean up ast_json with ast_json_unref
David M. Lee [Fri, 2 Aug 2013 17:29:52 +0000 (17:29 +0000)]
Clean up ast_json with ast_json_unref

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoRemoved svnmerge-integrated from trunk
David M. Lee [Fri, 2 Aug 2013 16:59:15 +0000 (16:59 +0000)]
Removed svnmerge-integrated from trunk

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoGet the SNMP code to compile.
Mark Michelson [Fri, 2 Aug 2013 15:01:37 +0000 (15:01 +0000)]
Get the SNMP code to compile.

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoARI - GET /ari/asterisk/info
David M. Lee [Fri, 2 Aug 2013 14:46:21 +0000 (14:46 +0000)]
ARI - GET /ari/asterisk/info

This patch adds basic system information access to ARI.

The results are roughly what you get from 'core show settings', with a
few minor differences.

 * Data is structured, with 'build', 'system', 'config' and 'status'
 * Each sub-object is selectable, using the ?only= parameter. A comma
   separated list can be provided to select multiple sections.
 * A few config options are numeric, for which 0 means 'unlimited'.
   Instead of having a special interpretation of those fields, they
   are simply omitted if they're 0.
 * The information is limited to what might be useful to building
   external applications.

(closes issue ASTERISK-21575)

git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3

8 years agoARI - implement allowMultiple for parameters
David M. Lee [Fri, 2 Aug 2013 14:36:32 +0000 (14:36 +0000)]
ARI - implement allowMultiple for parameters

Swagger allows parameters to be specified as 'allowMultiple', meaning
that the parameter may be specified as a comma separated list of

I had written some of the API docs using that, but promptly forgot
about implementing it. This patch finally fills in that gap.

The codegen template was updated to represent 'allowMultiple' fields
as array/size fields in the _args structs. It also parses the comma
separated list using ast_app_separate_args(), so quoted strings in the
argument will be handled properly.


git-svn-id: 65c4cc65-6c06-0410-ace0-fbb531ad65f3