asterisk/asterisk.git
9 years agoMemory leaks fix
Kevin Harwell [Thu, 29 Aug 2013 21:37:29 +0000 (21:37 +0000)]
Memory leaks fix

(closes ASTERISK-22376)
Reported by: John Hardin
Patches:
     memleak.patch uploaded by jhardin (license 6512)
     memleak2.patch uploaded by jhardin (license 6512)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397947 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoRevert r394939 due to (numerous) objections
Matthew Jordan [Thu, 29 Aug 2013 20:22:08 +0000 (20:22 +0000)]
Revert r394939 due to (numerous) objections

The patch from ASTERISK-21965 was committed perhaps a bit too hastily. Walter
and Tzafrir have pointed out numerous issues with the approach and have
propsed an alternative in r/2757. Since it's not a time critical issue and
is not worth holding up the release of 12 for it, I've gone ahead and reverted
r394939 from 12/trunk and re-opened ASTERISK-21965.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397939 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAccount for {} in Swagger notes
David M. Lee [Thu, 29 Aug 2013 16:21:31 +0000 (16:21 +0000)]
Account for {} in Swagger notes
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397932 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoRecursively search for '.c' files when making documentation with 'make full'
Matthew Jordan [Thu, 29 Aug 2013 16:05:23 +0000 (16:05 +0000)]
Recursively search for '.c' files when making documentation with 'make full'

Without this, documentation defined in sub-folders is ignored. Since having
properly generated documentation is especially important in Asterisk 12 -
not having it can cause a module to not load - 'make full' needs to look in
all .c files.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397925 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoMultiple revisions 397921-397922
Mark Michelson [Thu, 29 Aug 2013 15:43:23 +0000 (15:43 +0000)]
Multiple revisions 397921-397922

........
  r397921 | mmichelson | 2013-08-29 10:42:10 -0500 (Thu, 29 Aug 2013) | 6 lines

  Resolve assumptions that bridge snapshots would be non-NULL for transfer stasis events.

  Attempting to transfer an unbridged call would result in crashes in either CEL code or
  in the conversion to AMI messages.
........
  r397922 | mmichelson | 2013-08-29 10:42:29 -0500 (Thu, 29 Aug 2013) | 3 lines

  Remove extra debug message.
........

Merged revisions 397921-397922 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397923 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoActually *add* the database schema management utilities
Matthew Jordan [Thu, 29 Aug 2013 12:30:07 +0000 (12:30 +0000)]
Actually *add* the database schema management utilities

In r397874, the scripts were removed... but not replaced. Thanks to
Michael Young for noticing this!
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397912 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix some uninitialized buffers for CDR handling valgrind found.
Richard Mudgett [Wed, 28 Aug 2013 23:15:43 +0000 (23:15 +0000)]
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

9 years agoFixed problems with ast_cdr_serialize_variables().
Richard Mudgett [Wed, 28 Aug 2013 22:56:03 +0000 (22:56 +0000)]
Fixed problems with ast_cdr_serialize_variables().

* Fixed return value of ast_cdr_serialize_variables() on error.  It needs
to return 0 indicating no CDR variables found.

* Made ast_cdr_serialize_variables() check the return value of
cdr_object_format_property() and assert if nonzero.  A member of the
cdr_readonly_vars[] was not handled.

* Removed unused elements from cdr_readonly_vars[]: total_duration,
total_billsec, first_start, and first_answer.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397901 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoMade the on/off in CLI "cdr set debug [on|off]" case insensitive.
Richard Mudgett [Wed, 28 Aug 2013 22:43:14 +0000 (22:43 +0000)]
Made the on/off in CLI "cdr set debug [on|off]" case insensitive.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397899 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoMake CDR variable name chandling consistently case insensitive.
Richard Mudgett [Wed, 28 Aug 2013 22:38:30 +0000 (22:38 +0000)]
Make CDR variable name chandling consistently case insensitive.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397897 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoMake CDR code deal with channel names case insensitively.
Richard Mudgett [Wed, 28 Aug 2013 22:35:25 +0000 (22:35 +0000)]
Make CDR code deal with channel names case insensitively.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397895 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoSome CDR code optimization.
Richard Mudgett [Wed, 28 Aug 2013 22:24:01 +0000 (22:24 +0000)]
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

9 years agoWhitespace and curly braces.
Richard Mudgett [Wed, 28 Aug 2013 21:38:39 +0000 (21:38 +0000)]
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

9 years agoImprove detection of answer on SIP blind transfer.
Mark Michelson [Wed, 28 Aug 2013 21:09:43 +0000 (21:09 +0000)]
Improve detection of answer on SIP blind transfer.

A problem encountered during testing was that res_pjsip_refer would
not ever send a NOTIFY with a 200 OK sipfrag. This is because the framehook
that was supposed to send the NOTIFY would never be told that an answer
had occurred. This happened for two reasons:

1) The transferee channel on which the framehook was on was already up.
2) Answers are rarely if ever written to channels. Rather, the ast_answer()
or ast_raw_answer() function is used to answer channels.

Thanks to a suggestion by Matt Jordan, the best way to detect that the call
had been answered was to find out when the transferee channel joined a bridge.
With stasis this is an easy task. So now, in addition to the framehook logic,
there is a stasis subscription used to determine when the transferee has entered
a bridge. Once it has entered, an appropriate NOTIFY is sent.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397877 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd database schema management using Alembic
Matthew Jordan [Wed, 28 Aug 2013 20:55:53 +0000 (20:55 +0000)]
Add database schema management using Alembic

This patch replaces contrib/realtime/ with a new setup for managing the
database schema required for database integration with Asterisk.  In
addition to initializing a database with the proper schema, alembic can do a
database migration to assist with upgrading Asterisk in the future.
Hopefully this helps make setting up and operating Asterisk with a database
easier.

With this the schema only needs to be maintained in one place instead of
once per database.  The schemas I have added here have a bit of improvement
over the examples that were there before (some added consistency and added
some missing indexes).  Managing the schema in one place here also applies
to all databases supported by SQLAlchemy.

See contrib/ast-db-manage/README.md for more details.

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

patch by Russell Bryant (license 6300)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397875 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoUpdate CHANGES file for Asterisk 12
Matthew Jordan [Wed, 28 Aug 2013 20:49:02 +0000 (20:49 +0000)]
Update CHANGES file for Asterisk 12

This updates the Asterisk 12 CHANGES file with the things that were missed
during the development cycle.

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397872 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agopbx.c: Make ast_str_substitute_variables_full() not mask variables.
Richard Mudgett [Wed, 28 Aug 2013 16:13:18 +0000 (16:13 +0000)]
pbx.c: Make ast_str_substitute_variables_full() not mask variables.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397860 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoast_free() is null tollerant.
Richard Mudgett [Wed, 28 Aug 2013 16:09:12 +0000 (16:09 +0000)]
ast_free() is null tollerant.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397858 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoMatch use of ast_free() with ast_calloc() and add some curly braces.
Richard Mudgett [Wed, 28 Aug 2013 16:07:30 +0000 (16:07 +0000)]
Match use of ast_free() with ast_calloc() and add some curly braces.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397857 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix dialog matching in the SIP distributor.
Mark Michelson [Wed, 28 Aug 2013 15:43:15 +0000 (15:43 +0000)]
Fix dialog matching in the SIP distributor.

Dialog matching is performed in the distributor for the sole
purpose of retrieving an associated serializer so the request
may be serialized.

This patch fixes two problems.

First, incoming CANCEL requests that had no to-tag (which really
should be *all* CANCEL requests) would not match with a dialog.
An earlier bug fix to deal with early CANCEL requests would result
in the CANCEL being replied to with a 481. The fix for this is to
find the matching INVITE transaction and get the dialog from that
transaction.

Second, no SIP responses were matching dialogs. This is because we
were inverting the tags that we were passing into PJSIP's dialog
finding function. This logic has been corrected by setting local
and remote tag variables based on whether the incoming message is
a request or response.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397855 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoARI: WebSocket event cleanup
David M. Lee [Tue, 27 Aug 2013 19:19:36 +0000 (19:19 +0000)]
ARI: WebSocket event cleanup

Stasis events (which get distributed over the ARI WebSocket) are created
by subscribing to the channel_all_cached and bridge_all_cached topics,
filtering out events for channels/bridges currently subscribed to.

There are two issues with that. First was a race condition, where
messages in-flight to the master subscribe-to-all-things topic would get
sent out, even though the events happened before the channel was put
into Stasis. Secondly, as the number of channels and bridges grow in the
system, the work spent filtering messages becomes excessive.

Since r395954, individual channels and bridges have caching topics, and
can be subscribed to individually. This patch takes advantage, so that
channels and bridges are subscribed to on demand, instead of filtering
the global topics.

The one case where filtering is still required is handling BridgeMerge
messages, which are published directly to the bridge_all topic.

Other than the change to how subscriptions work, this patch mostly just
moves code around. Most of the work generating JSON objects from
messages was moved to .to_json handlers on the message types. The
callback functions handling app subscriptions were moved from res_stasis
(b/c they were global to the model) to stasis/app.c (b/c they are local
to the app now).

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397820 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoMade MALLOC_DEBUG less CPU intensive by default.
Richard Mudgett [Tue, 27 Aug 2013 18:52:23 +0000 (18:52 +0000)]
Made MALLOC_DEBUG less CPU intensive by default.

Storing a backtrace for each allocation in anticipation of a memory
management problem is very CPU intensive.

* Added the CLI "memory backtrace {on|off}" command to request that the
backtrace be gathered only on request.  The backtrace is off by default.

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397811 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAST-2013-005: Fix crash caused by invalid SDP
Matthew Jordan [Tue, 27 Aug 2013 18:10:40 +0000 (18:10 +0000)]
AST-2013-005: Fix crash caused by invalid SDP

If the SIP channel driver processes an invalid SDP that defines media
descriptions before connection information, it may attempt to reference
the socket address information even though that information has not yet
been set. This will cause a crash.

This patch adds checks when handling the various media descriptions that
ensures the media descriptions are handled only if we have connection
information suitable for that media.

Thanks to Walter Doekes, OSSO B.V., for reporting, testing, and providing
the solution to this problem.

(closes issue ASTERISK-22007)
Reported by: wdoekes
Tested by: wdoekes
patches:
  issueA22007_sdp_without_c_death.patch uploaded by wdoekes (License 5674)
........

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

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397760 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAST-2013-004: Fix crash when handling ACK on dialog that has no channel
Matthew Jordan [Tue, 27 Aug 2013 17:35:20 +0000 (17:35 +0000)]
AST-2013-004: Fix crash when handling ACK on dialog that has no channel

A remote exploitable crash vulnerability exists in the SIP channel driver if an
ACK with SDP is received after the channel has been terminated. The handling
code incorrectly assumed that the channel would always be present.

This patch adds a check such that the SDP will only be parsed and applied if
Asterisk has a channel present that is associated with the dialog.

Note that the patch being applied was modified only slightly from the patch
provided by Walter Doekes of OSSO B.V.

(closes issue ASTERISK-21064)
Reported by: Colin Cuthbertson
Tested by: wdoekes, Colin Cutherbertson
patches:
  issueA21064_fix.patch uploaded by wdoekes (License 5674)
........

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

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397753 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix uninitialized value in struct ast_control_pvt_cause_code usage.
Richard Mudgett [Tue, 27 Aug 2013 16:51:08 +0000 (16:51 +0000)]
Fix uninitialized value in struct ast_control_pvt_cause_code usage.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397746 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoBetter handle clearing the OUTGOING flag when a channel leaves a bridge
Matthew Jordan [Mon, 26 Aug 2013 23:48:56 +0000 (23:48 +0000)]
Better handle clearing the OUTGOING flag when a channel leaves a bridge

When a channel with the OUTGOING flag leaves a bridge, and it will survive
being pulled from the bridge (either because it will execute dialplan,
go into another bridge, or live in a friendly autoloop), we have to clear
the OUTGOING flag. This is the signal to the CDR engine that this channel
is no longer a second class citizen, i.e., it is not "dialed".

The soft hangup flags are only half the picture. If a channel is being
moved from one bridge to another, the soft hangup flags aren't set; however,
the state of the bridge_channel will not be hung up. Since the channel does
not have one of the two hang up states, that implies that the channel is
still technically alive.

This patch modifies the check so that it checks both the soft hangup flags
as well as the bridge_channel state. If either suggests that the channel
is going to persist, we clear the OUTGOING flag.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397691 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFixed bucket.c for systems where tv_usec is not an unsigned long.
David M. Lee [Mon, 26 Aug 2013 21:32:13 +0000 (21:32 +0000)]
Fixed bucket.c for systems where tv_usec is not an unsigned long.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397674 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agobridging: Fix a livelock with local channel optimization.
Richard Mudgett [Mon, 26 Aug 2013 16:25:39 +0000 (16:25 +0000)]
bridging: Fix a livelock with local channel optimization.

Use a better means of waking up the bridge channel thread.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397651 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agochan_dahdi: Add some missing build cleanup.
Richard Mudgett [Mon, 26 Aug 2013 16:15:02 +0000 (16:15 +0000)]
chan_dahdi: Add some missing build cleanup.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397644 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix bucket unit tests
Matthew Jordan [Sun, 25 Aug 2013 18:12:42 +0000 (18:12 +0000)]
Fix bucket unit tests

After the review for buckets was completed (r2715), the handling of names in
the bucket core was deferred to the wizards. As such, the bucket unit tests
cannot expect that passing a URI with a scheme specified but no actual resource
name will automatically fail. The tests have been updated to not make this
check.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397631 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix the config_options_test
Matthew Jordan [Sun, 25 Aug 2013 18:00:46 +0000 (18:00 +0000)]
Fix the config_options_test

The config options test requires the entire configuration item to be transparent from
the documentation system. So we let it do that too.

As an aside, please do not use this power for evil. Documentation is your friend, and
you really should document your configurations. Hiding your module's configuration
information from the system attempting to enforce some sanity in the universe is something
only a Bond villain would contemplate.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397629 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd rtpengine configuration parameter
Matthew Jordan [Sun, 25 Aug 2013 01:15:28 +0000 (01:15 +0000)]
Add rtpengine configuration parameter

The rtpengine configuration parameter was documented in the XML documentation,
but it was not actually registered with the sorcery object. This adds the
parameter with a default of "asterisk", such that res_rtp_asterisk is chosen as
the default RTP implementation.

(closes issue ASTERISK-22380)
Reported by: Rusty Newton
Tested by: Rusty Newton
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397622 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoSet new merge properties on 12
Matthew Jordan [Fri, 23 Aug 2013 22:40:57 +0000 (22:40 +0000)]
Set new merge properties on 12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397615 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix building of trunk.
Joshua Colp [Fri, 23 Aug 2013 22:20:39 +0000 (22:20 +0000)]
Fix building of trunk.

Note: This is why I commit on the weekend.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397613 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix channel reference leak in Originated channels
Matthew Jordan [Fri, 23 Aug 2013 22:12:57 +0000 (22:12 +0000)]
Fix channel reference leak in Originated channels

When originating channels, ast_pbx_outgoing_* caused the dialed channel
reference to be bumped twice. Ostensibly, this routine is bumping the channel
lifetime such that the channel doesn't get nuked in between locks/unlocks;
however, since the routine should return the dialed channel with its
reference bumped, it only needs to do this one time.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397606 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoBlocked revisions 397604
Joshua Colp [Fri, 23 Aug 2013 21:59:31 +0000 (21:59 +0000)]
Blocked revisions 397604

........
Make libuuid an optional dependency for res_rtp_asterisk instead of a requirement.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397605 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd some clarifying documentation to the rewrite_contact endpoint option.
Mark Michelson [Fri, 23 Aug 2013 21:53:48 +0000 (21:53 +0000)]
Add some clarifying documentation to the rewrite_contact endpoint option.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397603 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoBlank line tweaks.
Richard Mudgett [Fri, 23 Aug 2013 21:51:19 +0000 (21:51 +0000)]
Blank line tweaks.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397602 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd the bucket API.
Joshua Colp [Fri, 23 Aug 2013 21:49:47 +0000 (21:49 +0000)]
Add the bucket API.

Bucket is a URI based API for the creation, retrieval, updating, and deletion
of "buckets" and files contained within them.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397600 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix a bug where the argc value was passed as no_doc when registering custom sorcery...
Joshua Colp [Fri, 23 Aug 2013 21:45:48 +0000 (21:45 +0000)]
Fix a bug where the argc value was passed as no_doc when registering custom sorcery types.

This also adds a _nodoc equivalent.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397599 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd test events necessary for bridge tests to pass in the test suite.
Mark Michelson [Fri, 23 Aug 2013 21:02:26 +0000 (21:02 +0000)]
Add test events necessary for bridge tests to pass in the test suite.

(closes issue AST-1200)
reported by John Bigelow
Review: https://reviewboard.asterisk.org/r/2790/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397593 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix error in using ast_channel_snapshot_type before initialization
Matthew Jordan [Fri, 23 Aug 2013 20:14:46 +0000 (20:14 +0000)]
Fix error in using ast_channel_snapshot_type before initialization

Starting Asterisk would kick back an ERROR message stating that the Stasis
message type ast_channel_snapshot_type was used prior to initialization.
This occurred due to the caching topic being created prior to the message
type that it depended on.

This patch re-orders the start up such that the message type is initialized
prior to the caching topic. It also checks the return value of the
initialization of the agent login/logoff types.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397585 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agobridge_native_rtp: Fix hold chain bugs caused by native RTP bridge framehook
Jonathan Rose [Fri, 23 Aug 2013 19:05:20 +0000 (19:05 +0000)]
bridge_native_rtp: Fix hold chain bugs caused by native RTP bridge framehook

Issuing hold/unhold would lead to odd behavior. Between two chan_sip devices,
a hold could cause an endless chain of updates while with pjsip a similar chain
would begin but then end somewhat randomly. This patch fixes that by no longer
tweaking the RTP glue on both sides of the call for every
HOLD/UNHOLD/UPDATE_RTP_PEER frame.

(issue ASTERISK-22217)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2794/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397578 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoHandle DTMF and hold wrapup when a channel leaves the bridging system.
Richard Mudgett [Fri, 23 Aug 2013 18:33:36 +0000 (18:33 +0000)]
Handle DTMF and hold wrapup when a channel leaves the bridging system.

DTMF start/end and hold/unhold events have state because a DTMF begin
event and hold event must be ended by something.

The following cases need to be handled when a channel is moved around in
the system.

* When a channel leaves a bridge it may owe a DTMF end event to the
bridge.

* When a channel leaves a bridge it may owe an UNHOLD event to the bridge.
(This case is explicitly ignored because things like transfers need
explicit control over this.)

* When a channel leaves the bridging system it may need to simulate a DTMF
end event to the channel.

* When a channel leaves the bridging system it may need to simulate an
UNHOLD event to the channel.

The patch also fixes the following:
* Fixes playing a file and restarting MOH using the latest MOH class used.

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397577 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix sorcery unit tests
Matthew Jordan [Fri, 23 Aug 2013 18:10:11 +0000 (18:10 +0000)]
Fix sorcery unit tests

When strict XML documentation checking was re-enabled, the test objects used in
sorcery would fail to register as the types were not marked internal and the
nodoc option wasn't used for the options. This fixes that problem, such that,
as one would hope, they once again pass.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397571 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix memory corruption when trying to get "core show locks".
Richard Mudgett [Fri, 23 Aug 2013 18:07:40 +0000 (18:07 +0000)]
Fix memory corruption when trying to get "core show locks".

Review https://reviewboard.asterisk.org/r/2580/ tried to fix the mismatch
in memory pools but had a math error determining the buffer size and
didn't address other similar memory pool mismatches.

* Effectively reverted the previous patch to go in the same direction as
trunk for the returned memory pool of ast_bt_get_symbols().

* Fixed memory leak in ast_bt_get_symbols() when BETTER_BACKTRACES is
defined.

* Fixed some formatting in ast_bt_get_symbols().

* Fixed sig_pri.c freeing memory allocated by libpri when MALLOC_DEBUG is
enabled.

* Fixed __dump_backtrace() freeing memory from ast_bt_get_symbols() when
MALLOC_DEBUG is enabled.

* Moved __dump_backtrace() because of compile issues with the utils
directory.

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

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397570 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoPrevent seg fault in off nominal path when registered option fails to validate
Matthew Jordan [Fri, 23 Aug 2013 18:02:36 +0000 (18:02 +0000)]
Prevent seg fault in off nominal path when registered option fails to validate

If an option is registered to a type and it is the last known type in the list
of registered types, and the option fails to register, an overrun of the types
array can occur due to the index variable having been already incremented.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397568 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoPSJIP - sip.conf to res_sip.conf script
Kevin Harwell [Fri, 23 Aug 2013 17:45:05 +0000 (17:45 +0000)]
PSJIP - sip.conf to res_sip.conf script

Most, if not all, of the backing features of a conf file should now be
implemented (e.g. multi-line comments, includes, templates, etc...).  A
few of the options still need to be mapped.  Those are currently listed
in the 'sip_to_res_sip.py' file.

Things to do:

(1) There is more work to do here, at least for the sip.conf items that
aren't currently parsed. An issue will be created for that.
(2) All of the scripts should probably be passed through pylint and have
as many PEP8 issues fixed as possible.
(3) A public review is probably warranted at that point of the entire script.

Reported by: Matt Jordan

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397567 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoARI: Correct error codes for bridge operations
David M. Lee [Fri, 23 Aug 2013 17:19:02 +0000 (17:19 +0000)]
ARI: Correct error codes for bridge operations

This patch adds error checking to ARI bridge operations, when
adding/removing channels to/from bridges.

In general, the error codes fall out as follows:
 * Bridge not found - 404 Not Found
 * Bridge not in Stasis - 409 Conflict
 * Channel not found - 400 Bad Request
 * Channel not in Stasis - 422 Unprocessable Entity
 * Channel not in this bridge (on remove) - 422 Unprocessable Entity

(closes issue ASTERISK-22036)
Review: https://reviewboard.asterisk.org/r/2769/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397565 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoUpdate CHANGES file to reflect pass through support for Opus/VP8
Matthew Jordan [Fri, 23 Aug 2013 15:49:50 +0000 (15:49 +0000)]
Update CHANGES file to reflect pass through support for Opus/VP8

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397527 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd pass through support for Opus and VP8; Opus format attribute negotiation
Matthew Jordan [Fri, 23 Aug 2013 15:42:27 +0000 (15:42 +0000)]
Add pass through support for Opus and VP8; Opus format attribute negotiation

This patch adds pass through support for Opus and VP8. That includes:

* Format attribute negotiation for Opus. Note that unlike some other codecs,
  the draft RFC specifies having spaces delimiting the attributes in addition
  to ';', so you have "attra=X; attrb=Y". This broke the attribute parsing in
  chan_sip, so a small tweak was also included in this patch for that.

* A format attribute negotiation module for Opus, res_format_attr_opus

* Fast picture update for VP8. Since VP8 uses a different RTCP packet number
  than FIR, this really is specific to VP8 at this time.

Note that the format attribute negotiation in res_pjsip_sdp_rtp was written
by mjordan. The rest of this patch was written completely by Lorenzo Miniero.

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

(closes issue ASTERISK-21981)
Reported by: Tzafrir Cohen
patches:
  asterisk_opus+vp8_passthrough_20130718.patch uploaded by lminiero (License 6518)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397526 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoUpdate config framework/sorcery with types/options without documentation
Matthew Jordan [Fri, 23 Aug 2013 15:21:40 +0000 (15:21 +0000)]
Update config framework/sorcery with types/options without documentation

There are times when a configuration option should not have documentation.

1. Some options are registered with a particular object merely as a warning to
   users. These options aren't even really 'deprecated' - which has its own
   separate API call - they are actually provided by a different configuration
   file. The options are merely registered so that the user gets a warning that
   a different configuration file provides the item.

2. Some object types - most notably some used by modules that use sorcery - are
   completely internal and should never be shown to the user.

3. Sorcery itself has several 'hidden' fields that should never be shown to a
   user.

This patch updates the configuration framework and sorcery with additional API
calls that allow a module to register types as internal and options as not
requiring documentation. This bypasses the XML documentation checking.

This patch also re-enables the strict XML documentation checking in trunk, as
well as updates some documentation that was missing.

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

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

(closes issue ASTERISK-22112)
Reported by: Rusty Newton

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397524 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix crash when answering after a transport error occurs.
Joshua Colp [Fri, 23 Aug 2013 13:58:08 +0000 (13:58 +0000)]
Fix crash when answering after a transport error occurs.

If a response to an initial incoming INVITE results in a transport error
the INVITE transaction is removed from the INVITE session. Any attempts
to answer the INVITE session after this results in a crash as it requires
the INVITE transaction to exist. This change explicitly locks the dialog
and checks to ensure that the INVITE transaction exists before answering.

(closes issue AST-1203)
Reported by: John Bigelow

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397515 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoUpdate CEL sample config
Kinsey Moore [Fri, 23 Aug 2013 13:18:51 +0000 (13:18 +0000)]
Update CEL sample config

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397514 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoARI: Music on Hold/Background Music for bridges
Jonathan Rose [Fri, 23 Aug 2013 00:26:19 +0000 (00:26 +0000)]
ARI: Music on Hold/Background Music for bridges

Adds ARI functions to be able to turn on/off music on hold in a
bridge. It actually functions more as a background music without
further actions on the bridge since if the rest of the channels
in the bridge aren't explicitly muted, they will still be able
to communicate.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397505 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoMinor tweaks with ast_moh_start() callers.
Richard Mudgett [Thu, 22 Aug 2013 23:15:14 +0000 (23:15 +0000)]
Minor tweaks with ast_moh_start() callers.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397494 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd SayAlphaCase and similar functionality for AGI
Kinsey Moore [Thu, 22 Aug 2013 22:33:48 +0000 (22:33 +0000)]
Add SayAlphaCase and similar functionality for AGI

This adds a new dialplan application, SayAlphaCase, that performs much
the same function as SayAlpha except that it takes additional options
which allow the user to specify whether the case of each letter should
be announced for uppercase, lowercase, or all letters. Similar
functionality has been added to the SAY ALPHA AGI command via an
optional parameter.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397493 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agores_sip_dtmf_info: Support sending of 'raw' DTMF
Kevin Harwell [Thu, 22 Aug 2013 22:09:16 +0000 (22:09 +0000)]
res_sip_dtmf_info: Support sending of 'raw' DTMF

Added the ability to handle 'raw' DTMF within the body of an INFO message.
Also made it so values 10-16 are mapped to valid DTMF values.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397484 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd missing configOption close tags
Kinsey Moore [Thu, 22 Aug 2013 21:39:10 +0000 (21:39 +0000)]
Add missing configOption close tags

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397483 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoUpdate MOH start/stop routine doxygen.
Richard Mudgett [Thu, 22 Aug 2013 21:29:16 +0000 (21:29 +0000)]
Update MOH start/stop routine doxygen.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397482 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix missing xml doc configOption 'type' for for both 'system' and 'global' configObjects
Rusty Newton [Thu, 22 Aug 2013 21:21:25 +0000 (21:21 +0000)]
Fix missing xml doc configOption 'type' for for both 'system' and 'global' configObjects

(issue ASTERISK-22344)
(closes issue ASTERISK-22344)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397481 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoBridge API: Set a cause code on a channel when it is ejected from a bridge.
Richard Mudgett [Thu, 22 Aug 2013 21:09:52 +0000 (21:09 +0000)]
Bridge API: Set a cause code on a channel when it is ejected from a bridge.

The cause code needs to be passed from the disconnecting channel to the
bridge peers if the disconnecting channel dissolves the bridge.

* Made the call to an app_agent_pool agent disconnect with the busy cause
code if the agent does not ack the call in time or hangs up before acking
the call.

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397472 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoEnsure CEL creates a default config if it isn't provided with one
Kinsey Moore [Thu, 22 Aug 2013 20:29:15 +0000 (20:29 +0000)]
Ensure CEL creates a default config if it isn't provided with one

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397471 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoRemove set but unused variable 'meid'.
Mark Michelson [Thu, 22 Aug 2013 20:18:27 +0000 (20:18 +0000)]
Remove set but unused variable 'meid'.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397466 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix crash when getting CEL config
Kinsey Moore [Thu, 22 Aug 2013 19:52:59 +0000 (19:52 +0000)]
Fix crash when getting CEL config

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397461 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoMassively clean up app_queue.
Mark Michelson [Thu, 22 Aug 2013 18:52:41 +0000 (18:52 +0000)]
Massively clean up app_queue.

This essentially makes app_queue usable again. From reviewboard:

* Reporting of transfers and call completion is done by creating stasis
  subscriptions and listening for specific events in order to determine
  when the call is finished (either via a transfer or hangup).
* Dial end messages have been added where they were previously missing.
* Queue stats are properly being updated again once calls have finished.
* AgentComplete stasis messages and AMI events are now occurring again.
* Mixmonitor starting has been factored into its own function and uses the
  Mixmonitor API now instead of using ast_pbx_run()

In addition to the changes in app_queue, there are several supplementary changes as well:

* Queue logging now differentiates between attended and blind transfers. A
  note about this is in the CHANGES file.
* Local channel optimization events now report more information. This
  includes which of the two local channels involved is the destination of
  the optimization, the channel that is replacing the destination local channel,
  and an identifier so that begin and end events can be matched to each other.
  The end events are now sent whether the optimization was successful or not and
  includes an indicator of whether the optimization was successful.
* Changes were made to features and bridging_basic so that additional flags may
  be set on a bridge. This is necessary because the queue requires that its
  bridge only allows move-swap local channel optimizations into the bridge.

(closes issue ASTERISK-21517)
Reported by Matt Jordan

(closes issue ASTERISK-21943)
Reported by Matt Jordan

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397451 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoHandle default body types for SIP event packages in res_pjsip_pubsub
Mark Michelson [Thu, 22 Aug 2013 17:42:37 +0000 (17:42 +0000)]
Handle default body types for SIP event packages in res_pjsip_pubsub

Prior to this change, we would reject SUBSCRIBE requests that had no Accept
headers. Now event package handlers that handle the default type for the
event package indicate that they do so. Therefore, if we have a handler that
can handle the default type, we can allow SUBSCRIBEs for the handler's event
package that have no Accept headers.

(closes issue ASTERISK-22067)
reported by Mark Michelson

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397441 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoMade the abstract jitter buffer resync on some more control frames.
Richard Mudgett [Thu, 22 Aug 2013 17:34:46 +0000 (17:34 +0000)]
Made the abstract jitter buffer resync on some more control frames.

Resync the abstract jitter buffer on the following additional control
frames:
AST_CONTROL_HOLD
AST_CONTROL_UNHOLD
AST_CONTROL_T38_PARAMETERS

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397440 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoMake CEL behavior conform to the documentation
Kinsey Moore [Thu, 22 Aug 2013 17:13:16 +0000 (17:13 +0000)]
Make CEL behavior conform to the documentation

This modifies the behavior of the CEL engine to conform to documented
behavior for Asterisk 12 as defined on the wiki
https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+CEL+Specification

The primary changes deal with removal of the peer field from function
calls since it is no longer directly relevant to the bridging system
and removal of the layer of CDR-like business logic that was providing
a partial emulation of Asterisk 11 CEL functionality. With this change,
there is no longer a distinction between "bridges" and "conferences"
and all participation changes are denoted with bridge enter and bridge
exit messages.

This updates the CEL unit tests to handle these changes and simplifies
some of the macros used in the process.

This also fixes a segfault when attempting to ref a configuration that
failed to load.

Review: https://reviewboard.asterisk.org/r/2788/
(issue ASTERISK-21567)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397431 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoUpdate BUGBUG comment.
Richard Mudgett [Thu, 22 Aug 2013 16:46:01 +0000 (16:46 +0000)]
Update BUGBUG comment.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397426 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoDon't store repeated commands in the editline history buffer.
Walter Doekes [Thu, 22 Aug 2013 12:28:33 +0000 (12:28 +0000)]
Don't store repeated commands in the editline history buffer.

The equivalent of bash HISTCONTROL=ignoredups.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397415 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd _IO_stdin_used in version-script to fix SIGBUSes on Sparc.
Walter Doekes [Thu, 22 Aug 2013 08:26:55 +0000 (08:26 +0000)]
Add _IO_stdin_used in version-script to fix SIGBUSes on Sparc.

The --version-script,asterisk.exports linker flag (and the module
exports) didn't provide _IO_stdin_used in the list of exported symbols.
That causes some kind of libc compatibility mode to kick in, where
stdio file structures (stdout/stderr) land somewhere else. In the
case of the Sparc, they landed on misaligned memory.

This became apparent first after r376428 (Reorder startup sequence)
when a lot of ast_log's were replaced with fprintf's. Writing to
stderr triggered a SIGBUS. (Compared to x86 and amd64 architectures,
the Sparc is very picky about memory alignment.)

(issue ASTERISK-21763)
(issue ASTERISK-21665)

Reported by: Jeremy Kister
Review: https://reviewboard.asterisk.org/r/2760/
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397379 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoUDPTL: Fix a regression where UDPTL won't load default settings
Jonathan Rose [Wed, 21 Aug 2013 23:09:14 +0000 (23:09 +0000)]
UDPTL: Fix a regression where UDPTL won't load default settings

If the file udptl.conf is unavailable at startup, UDPTL will fail to
initialize and while it makes some noise, it isn't immediately
obvious why consumers start to fail when using it. This patch makes
UDPTL load as though an empty config was provided  when udptl is
unavailable at startup.

(closes issue ASTERISK-22349)
Reported by: Jonathan Rose
Review: https://reviewboard.asterisk.org/r/2773/
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397366 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years ago* Move ast_bridge_channel_setup_features() into bridge_basic.c.
Richard Mudgett [Wed, 21 Aug 2013 20:02:24 +0000 (20:02 +0000)]
* Move ast_bridge_channel_setup_features() into bridge_basic.c.

* Made application map hooks be removed on a basic bridge personality
change.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397355 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoDeferred some more BUGBUG comments to a JIRA issue or XXX comment.
Richard Mudgett [Wed, 21 Aug 2013 18:58:28 +0000 (18:58 +0000)]
Deferred some more BUGBUG comments to a JIRA issue or XXX comment.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397346 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoComplete http_shutdown.
David M. Lee [Wed, 21 Aug 2013 17:12:30 +0000 (17:12 +0000)]
Complete http_shutdown.

This patch frees up some resources allocated in http.c.
 * tcp listeners stopped
 * tls settings freed
 * uri redirects freed
 * unregister internal http.c uri's

(closes issue ASTERISK-22237)
Reported by: Corey Farrell

Patches:
    http.patch uploaded by Corey Farrell (license 5909)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397310 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoSet 14400 as the default max bit rate if T38MaxBitRate is not specified
Matthew Jordan [Wed, 21 Aug 2013 16:31:58 +0000 (16:31 +0000)]
Set 14400 as the default max bit rate if T38MaxBitRate is not specified

If an endpoint fails to include the T38MaxBitRate attribute during negotiation,
Asterisk will negotiate a bit rate of 2400 instead of the ITU recommended
bit rate of 14400. This patch fixes this by making AST_T38_RATE_14400 the
'default' value of the enum by assigning it a value of 0, such that if an
endpoint fails to include the attribute, the default will be 14400.

Note that Walter Doekes included the nice comment in frame.h about why we are
purposefully assigning AST_T38_RATE_14400 a value of 0.

(closes issue ASTERISK-22275)
Reported by: Andreas Steinmetz
patches:
  fax-fix.patch uploaded by anstein (License 6523)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397307 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoARI: Correct segfault with /variable calls are missing ?variable parameter.
David M. Lee [Wed, 21 Aug 2013 16:23:59 +0000 (16:23 +0000)]
ARI: Correct segfault with /variable calls are missing ?variable parameter.

Both /asterisk/variable and /channel/{channelId}/variable requires a
?variable parameter to be passed into the query. But we weren't checking
for the parameter being missing, which caused a segfault.

All calls now properly return 400 Bad Request errors when the parameter
is missing. The Swagger api-docs were updated accordingly.

(closes issue ASTERISK-22273)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397306 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoARI: Remove the 'channel:' scheme from endpoint's channel list.
David M. Lee [Wed, 21 Aug 2013 16:09:09 +0000 (16:09 +0000)]
ARI: Remove the 'channel:' scheme from endpoint's channel list.

For times when a reference in ARI might be ambiguous, the reference is
built as an URI (such as channel:1376341790.3).

An endpoint's channel list is not ambiguous, and in fact the field is
named 'channel_ids', but it had channel URI's instead of channel id's.
This patch changes the list to be the raw id instead of the URI.

(closes issue ASTERISK-22291)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397297 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agores_stasis: remove call to missing function control_continue.
David M. Lee [Wed, 21 Aug 2013 16:00:10 +0000 (16:00 +0000)]
res_stasis: remove call to missing function control_continue.

In the shuffling around of res_stasis, control_continue was renamed to
stasis_app_control_continue, but the call in res_stasis wasn't updated.
In looking into it, it turns out it wasn't really the right thing to do
in res_stasis anyways.

This patch changes the handling of received a AST_CONTROL_HANGUP frame
to be the same as receiving a NULL frame, and removed the declaration of
control_continue(), since it doesn't exist any more.

(closes issue ASTERISK-22292)
Reported by: Denis Smirnov

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397295 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix several interrelated issues dealing with the holding bridge technology.
Richard Mudgett [Wed, 21 Aug 2013 15:51:19 +0000 (15:51 +0000)]
Fix several interrelated issues dealing with the holding bridge technology.

* Added an option flags parameter to interval hooks.  Interval hooks now
can specify if the callback will affect the media path or not.

* Added an option flags parameter to the bridge action custom callback.
The action callback now can specify if the callback will affect the media
path or not.

* Made the holding bridge technology reexamine the participant idle mode
option whenever the entertainment is restarted.

* Fixed app_agent_pool waiting agents needlessly starting and stopping MOH
every second by specifying the heartbeat interval hook as not affecting
the media path.

* Fixed app_agent_pool agent alert from restarting the MOH after the alert
beep.  The agent entertainment is now changed from MOH to silence after
the alert beep.

* Fixed holding bridge technology to defer starting the entertainment.  It
was previously a mixture of immediate and deferred.

* Fixed holding bridge technology to immediately stop the entertainment.
It was previously a mixture of immediate and deferred.  If the channel
left the bridging system, any deferred stopping was discarded before
taking effect.

* Miscellaneous holding bridge technology rework coding improvements.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397294 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoPrevent a crash on outbound SIP MESSAGE requests.
Mark Michelson [Wed, 21 Aug 2013 14:39:17 +0000 (14:39 +0000)]
Prevent a crash on outbound SIP MESSAGE requests.

If a From header on an outbound out-of-call SIP MESSAGE were
malformed, the result could crash Asterisk.

In addition, if a From header on an incoming out-of-call SIP
MESSAGE request were malformed, the message was happily accepted
rather than being rejected up front. The incoming message path
would not result in a crash, but the behavior was bad nonetheless.

(closes issue ASTERISK-22185)
reported by Zhang Lei
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397255 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAllow channels in app_stasis to hangup properly
Kinsey Moore [Wed, 21 Aug 2013 14:08:23 +0000 (14:08 +0000)]
Allow channels in app_stasis to hangup properly

This detects hangups that occur while bridged to allow channels to exit
app_stasis even if the hangup frame was absorbed by the bridge the
channel was in.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397244 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAllow the SIP_CODEC family of variables to specify more than one codec
Matthew Jordan [Wed, 21 Aug 2013 13:41:05 +0000 (13:41 +0000)]
Allow the SIP_CODEC family of variables to specify more than one codec

The SIP_CODEC family of variables let you set the preferred codec to be
offered on an outbound INVITE request. However, for video calls, you need to
be able to set both the audio and video codecs to be offered. This patch lets
the SIP_CODEC variables accept a comma delineated list of codecs. The first
codec in the list is set as the preferred codec; additional codecs are still
offered however.

This lets a dialplan writer set both audio and video codecs, e.g.,
Set(SIP_CODEC=ulaw,h264)

Note that this feature was written by both Dennis Guse and Frank Haase

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

(closes issue ASTERISK-21976)
Reported by: Denis Guse
Tested by: mjordan, sysreq
patches:
  patch-channels-chan__sip.c-393919 uploaded by dennis.guse (license 6513)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397243 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix Not Storing Current Incoming Recv Address
Michael L. Young [Wed, 21 Aug 2013 02:15:16 +0000 (02:15 +0000)]
Fix Not Storing Current Incoming Recv Address

In 1.8, r384779 introduced a regression by retrieving an old dialog and keeping
the old recv address since recv was already set.  This has caused a problem when
a proxy is involved since responses to incoming requests from the proxy server,
after an outbound call is established, are never sent to the correct recv
address.

In 11, r382322 introduced this regression.

The fix is to revert that change and always store the recv address on incoming
requests.

Thank you Walter Doekes for helping to point out this error and Mark Michelson
for your input/review of the fix.

(closes issue ASTERISK-22071)
Reported by: Alex Zarubin
Tested by: Alex Zarubin, Karsten Wemheuer
Patches:
    asterisk-22071-store-recvd-address.diff by Michael L. Young (license 5026)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397206 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoLocalize and rename ACL configuration.
Mark Michelson [Tue, 20 Aug 2013 21:01:59 +0000 (21:01 +0000)]
Localize and rename ACL configuration.

This is more-or-less a reversion of previous ACL behavior so that
it is more self-contained. ACL sections are now only parsed if res_pjsip_acl.so
is loaded. Moreover, the configuration section is now "type=acl" instead of
"type=security".

The original reason for having ACLs configured in a "type=security" section
was to lump ACLs and other security-related items into the same section. The
problem is that ACLs really should be in their own sections and there are
no other security-related options implemented anyways.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397193 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoRemove REF_DEBUG definition.
Mark Michelson [Tue, 20 Aug 2013 17:42:11 +0000 (17:42 +0000)]
Remove REF_DEBUG definition.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397158 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoFix refcounting of sip_pvt in test_sip_rtpqos test and unlink it from the list of...
Mark Michelson [Tue, 20 Aug 2013 16:25:33 +0000 (16:25 +0000)]
Fix refcounting of sip_pvt in test_sip_rtpqos test and unlink it from the list of pvts.

(closes issue ASTERISK-22248)
reported by Corey Farrell
patches:
test_sip_rtpqos.patch uploaded by Corey Farrell (license #5909)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397142 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoClarify documentation for the "identify_by" option for SIP endpoints.
Mark Michelson [Tue, 20 Aug 2013 15:39:38 +0000 (15:39 +0000)]
Clarify documentation for the "identify_by" option for SIP endpoints.

This also removes documentation for the options that no longer exist.

(closes issue ASTERISK-22306)
reported by Rusty Newton

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397111 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoUnregister CLI commands on exit
Kinsey Moore [Tue, 20 Aug 2013 15:36:10 +0000 (15:36 +0000)]
Unregister CLI commands on exit

This patch ensures that CLI commands enabled by DEBUG_FD_LEAKS and
DEBUG_THREADLOCALS are cleaned up properly on exit.

(closes issue ASTERISK-22238)
Reported by: Corey Farrell
Tested by: Corey Farrell
Patches:
    debug_cli_unregister.patch uploaded by Corey Farrell
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397110 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd debug message to res_pjsip_endpoint_identifier_ip to indicate when an endpoint...
Mark Michelson [Tue, 20 Aug 2013 15:32:20 +0000 (15:32 +0000)]
Add debug message to res_pjsip_endpoint_identifier_ip to indicate when an endpoint is successfully retrieved.

(closes issue ASTERISK-22101)
reported by Rusty Newton

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397109 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd warning messages for registration failure paths.
Mark Michelson [Tue, 20 Aug 2013 15:27:48 +0000 (15:27 +0000)]
Add warning messages for registration failure paths.

(closes issue ASTERISK-22089)
reported by Rusty Newton
patches:
patch1.txt uploaded by John Bigelow (License #5091)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397108 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoAdd note to transport configuration that a restart is required to change transports.
Mark Michelson [Tue, 20 Aug 2013 14:43:56 +0000 (14:43 +0000)]
Add note to transport configuration that a restart is required to change transports.

(closes issue ASTERISK-22094)
reported by Rusty Newton

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397073 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 years agoRecorded merge of revisions 397067 from http://svn.asterisk.org/svn/asterisk/branches/11
Kinsey Moore [Tue, 20 Aug 2013 14:26:20 +0000 (14:26 +0000)]
Recorded merge of revisions 397067 from svn.asterisk.org/svn/asterisk/branches/11

........
Fix xmldoc memory leak

This fixes a single-attribute memory leak that was occurring when the
"required" attribute was not true.

(closes issue ASTERISK-22249)
Reported by: Corey Farrell
Tested by: Corey Farrell
Patches:
    xmldoc-free_attr_required.patch uploaded by Corey Farrell
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397072 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 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
Patches:
    cel-config.patch uploaded by Corey Farrell
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397035 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 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.

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396996 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 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: https://origsvn.digium.com/svn/asterisk/trunk@396993 65c4cc65-6c06-0410-ace0-fbb531ad65f3

9 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 http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396949 65c4cc65-6c06-0410-ace0-fbb531ad65f3

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

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
CONFFLAG_DONT_DENOISE conflicts with CONFFLAG_INTROUESR_VMREC. This patch
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 http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396946 65c4cc65-6c06-0410-ace0-fbb531ad65f3

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@396930 65c4cc65-6c06-0410-ace0-fbb531ad65f3