Commit Graph

4715 Commits

Author SHA1 Message Date
George Joseph bd42a09d7f config: BUG: Restore ability for non-templ to be used as base objs in config.
My recent refactor of config.c accidentally removed the capability for an
object to inherit from a non-template object.

This patch restores the capability to inherit from both template and
non-template objects.

Tested-by: George Joseph
Reported-by: Scott Griepentrog
ASTERISK-24487 #close

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-04 20:49:14 +00:00
Corey Farrell bdc35c77b9 Fix crash caused by merge error on review 4138
When merging from 12 to 13 there were conflicts,
I mistakenly had the loop run ast_closestream(others[0])
when it should be ast_closestream(others[x]).
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-04 14:11:54 +00:00
Corey Farrell 509c04ef38 Fix ast_writestream leaks
Fix cleanup in __ast_play_and_record where others[x] may be leaked.
This was caught where prepend != NULL && outmsg != NULL, once
realfile[x] == NULL any further others[x] would be leaked. A cleanup
block was also added for prepend != NULL && outmsg == NULL.

11+: Fix leak of ast_writestream recording_fs in
app_voicemail:leave_voicemail.

ASTERISK-24476 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4138/
........

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-02 08:13:52 +00:00
Corey Farrell 85c1822a9d func_jitterbuffer: fix frame leaks.
Fix code paths where it is possible for frames to leak.
Fix uninitialized variable in jb_get_fixed and jb_get_adaptive.

ASTERISK-22409 #related
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4128/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-11-02 07:40:57 +00:00
Corey Farrell ced81afff2 audiohooks: Clean references to formats
Cleanup references to in_translate[x].format and
out_translate[x].format in ast_audiohook_detach_list.

ASTERISK-24465 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4124/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426804 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-30 23:45:25 +00:00
Corey Farrell 67e496c275 manager: Unsubscribe from acl_change_sub at shutdown.
ASTERISK-24453 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4110/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426526 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-28 20:44:22 +00:00
Matthew Jordan 8e9f593e3a main/bridge: Destroy features struct on off nominal path during bridge impart
When a channel is imparted to a bridge, the invocation of the function may
provide an ast_bridge_features struct. Upon passing this to ast_bridge_impart,
the caller must assume that ownership has passed to the function, as in all
paths the function destroys the struct prior to returning (as its purpose is
to configure the behavior of the channel while in the bridge). On one off
nominal path - where the channel already has a PBX thread - the struct was not
being destroyed.

This patch fixes that glitch.

ASTERISK-24437 #close
Reported by: Scott Griepentrog
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-28 16:41:17 +00:00
Matthew Jordan f4b4d42630 main/manager: Fix typo in AMI event documentation of "OriginateResponse"
The parameter name is "Response", not "Resonse".

ASTERISK-24430 #close
Reported by: Dafi Ni
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-28 14:59:47 +00:00
Jonathan Rose c084728690 Documentation: Improve documentation for ExtensionStatus AMI events
Review: https://reviewboard.asterisk.org/r/4085/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-24 15:32:35 +00:00
Richard Mudgett 2165868be7 translage.c: Fix regression when generating translation path strings.
Fix the AMI Status action read and write translation path strings from
growing for each channel in the status event list by reseting the ast
string given to ast_translate_path_to_str() to fill in the given
translation path.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-21 18:04:43 +00:00
Matthew Jordan dad0334cf1 AST-2014-011: Fix POODLE security issues
There are two aspects to the vulnerability:
(1) res_jabber/res_xmpp use SSLv3 only. This patch updates the module to use
    TLSv1+. At this time, it does not refactor res_jabber/res_xmpp to use the
    TCP/TLS core, which should be done as an improvement at a latter date.
(2) The TCP/TLS core, when tlsclientmethod/sslclientmethod is left unspecified,
    will default to the OpenSSL SSLv23_method. This method allows for all
    ecnryption methods, including SSLv2/SSLv3. A MITM can exploit this by
    forcing a fallback to SSLv3, which leaves the server vulnerable to POODLE.
    This patch adds WARNINGS if a user uses SSLv2/SSLv3 in their configuration,
    and explicitly disables SSLv2/SSLv3 if using SSLv23_method.

For TLS clients, Asterisk will default to TLSv1+ and WARN if SSLv2 or SSLv3 is
explicitly chosen. For TLS servers, Asterisk will no longer support SSLv2 or
SSLv3.

Much thanks to abelbeck for reporting the vulnerability and providing a patch
for the res_jabber/res_xmpp modules.

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

ASTERISK-24425 #close
Reported by: abelbeck
Tested by: abelbeck, opsmonitor, gtjoseph
patches:
  asterisk-1.8-jabber-tls.patch uploaded by abelbeck (License 5903)
  asterisk-11-jabber-xmpp-tls.patch uploaded by abelbeck (License 5903)
  AST-2014-011-1.8.diff uploaded by mjordan (License 6283)
  AST-2014-011-11.diff uploaded by mjordan (License 6283)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@426003 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-20 14:20:15 +00:00
Richard Mudgett f91cb1207c AMI: Add missing VarSet events when a channel inherits variables.
There should be AMI VarSet events when channel variables are inherited by
an outgoing channel.  Also local;2 should generate VarSet events when it
gets all of its channel variables from channel local;1.

ASTERISK-24415 #close
Reported by: Richard Mudgett
Patches:
      jira_asterisk_24415_v12.patch (license #5621) patch uploaded by Richard Mudgett

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425784 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-17 02:49:57 +00:00
Matthew Jordan 873d956144 main/cdr: Use 'time' when rescheduling batched CDRs as opposed to 'size'
When refactoring CDRs to use the configuration framework, a 'whoops' was
introduced where the CDR batch size was used when rescheduling a batch,
as opposed to the time duration. This patch corrects that obvious mistake.

ASTERISK-24426 #close
Reported by: Shane Blaser
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425744 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-16 21:21:44 +00:00
George Joseph c2ec5f0f6f config: Fix inf loop using ast_category_browse and ast_variable_retrieve
Fix infinite loop when calling ast_variable_retrieve inside an
ast_category_browse loop when there is more than 1 category with
the same name.

Tested-by: George Joseph

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425715 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-16 17:32:16 +00:00
George Joseph 104fca5001 config: Fix SEGV in unit test with MALLOC_DEBUG
With MALLOC_DEBUG the /main/config config_basic_ops test was causing a
SEGV while doing an ast_category_delete in an ast_category_browse loop.
Apparently this never worked but was also never tested.  I removed the
test, added 2 notes to config.h indicating that it's not supported and
added a few lines of code to ast_category_delete to prevent the SEGV
should someone attempt it in the future.

Tested-by: George Joseph

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-14 20:48:06 +00:00
Jonathan Rose 87b5006ff0 Scheduler: Fix a nasty scheduler caching bug which makes new tasks not execute
Tasks that were marked for pending deletion in the scheduler would be moved to
the cache for later reuse, but after being recycled the deleted mark wouldn't
be removed resulting in fresh tasks being deleted without reason... and
immediately moved back into the cache where they could be reused again. This
could cause horrendous things to happen in just about anything that used a
scheduler.

ASTERISK-24321 #close
Reported by: Steve Pitts
Review: https://reviewboard.asterisk.org/r/4071/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-14 19:12:58 +00:00
Richard Mudgett c61b66e107 stasis_channels.c: Resolve unfinished Dials when doing masquerades (Part 2)
Masquerades into and out of channels that are involved in a dial operation
don't create the expected dial end event.  The missing dial end event goes
against the model for things like CDRs and generating Dial end manager
actions and such.

There are four cases:

1) A channel masquerades into the caller channel.  The case happens when
performing a blonde transfer using the channel driver's protocol.

2) A channel masquerades into a callee channel.  The case happens when
performing a directed call pickup.

3) The caller channel masquerades out of dial.  The case happens when
using the Bridge application on the caller channel.

4) A callee channel masquerades out of dial.  The case happens when using
the Bridge application on a peer channel.

As it turned out, all four cases need to be handled instead of just the
first one.

ASTERISK-24237
Reported by: Richard Mudgett

ASTERISK-24394 #close
Reported by: Richard Mudgett

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-14 16:43:33 +00:00
George Joseph c7e6b6ba3d manager/config: Support templates and non-unique category names via AMI
This patch provides the capability to manipulate templates and categories
with non-unique names via AMI.

Summary of changes:

GetConfig and GetConfigJSON: Added "Filter" parameter:  A comma separated list
of name_regex=value_regex expressions which will cause only categories whose
variables match all expressions to be considered.  The special variable name
TEMPLATES can be used to control whether templates are included.  Passing
'include' as the value will include templates along with normal categories.
Passing 'restrict' as the value will restrict the operation to ONLY templates.
Not specifying a TEMPLATES expression results in the current default behavior
which is to not include templates.

UpdateConfig: NewCat now includes options for allowing duplicate category
names, indicating if the category should be created as a template, and
specifying templates the category should inherit from.  The rest of the
actions now accept a filter string as defined above.  If there are non-unique
category names, you can now update specific ones based on variable values.

To facilitate the new capabilities in manager, corresponding changes had to be
made to config, most notably the addition of filter criteria to many of the
APIs.  In some cases it was easy to change the references to use the new
prototype but others would have required touching too many files for this
patch so a wrapper with the original prototype was created.  Macros couldn't
be used in this case because it would break binary compatibility with modules
such as res_digium_phone that are linked to real symbols.

Tested-by: George Joseph

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-13 16:12:17 +00:00
Joshua Colp 98d5b7090d bridge: During a smart bridge operation provide a more complete bridge to the old technology.
When a smart bridge operation occurs and a bridge transitions from one
technology to another the old technology is provided the channels formerly
in it and told that they are leaving. Unfortunately the bridge provided
along with them is incomplete. The bridge, despite there being channels in it,
contains none. This forces technology implementations to have additional
logic when channels are leaving or to store their own duplicated
state.

This change makes the bridge more complete so it contains the expected
channels. Now that the bridge is complete special logic within
bridge_native_rtp is no longer needed and has been removed.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-10 20:48:46 +00:00
Kinsey Moore 37b5f52da7 CallerID: Fix parsing regression
This fixes a regression in callerid parsing introduced when another bug
was fixed. This bug occurred when the name was composed entirely of
DTMF keys and quoted without a number section (<>). 

ASTERISK-24406 #close
Reported by: Etienne Lessard
Tested by: Etienne Lessard
Patches:
    callerid_fix.diff uploaded by Kinsey Moore
Review: https://reviewboard.asterisk.org/r/4067/
........

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@425156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-10 13:03:18 +00:00
George Joseph cc595f7353 res_phoneprov: Refactor phoneprov to allow pluggable config providers
This patch makes res_phoneprov more modular so other modules (like pjsip)
can provide configuration information instead of res_phoneprov relying solely
on users.conf and sip.conf.  To accomplish this a new ast_phoneprov public API
is now exposed which allows config providers to register themselves, set
defaults (server profile, etc) and add user extensions.

* ast_phoneprov_provider_register registers the provider and provides callbacks
  for loading default settings and loading users.
* ast_phoneprov_provider_unregister clears the defaults and users.
* ast_phoneprov_add_extension should be called once for each user/extension
  by the provider's load_users callback to add them.
* ast_phoneprov_delete_extension deletes one extension.
* ast_phoneprov_delete_extensions deletes all extensions for the provider.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/3970/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424965 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-09 17:46:23 +00:00
Richard Mudgett 0f50e8856b cdr.c: Make turning on CDR debug a one step process instead of two.
Now "cdr set debug on" doesn't also require "core set verbose 1" to see
CDR debug output.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-09 16:38:40 +00:00
Kinsey Moore 5e50638539 Stasis: Relegate log message to dev-mode
This error message primarily applies to development tasks and will now
only show up when dev-mode is enabled via configure.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-08 18:24:47 +00:00
Kinsey Moore 3dfc485e35 Indexer: Format message types may not exist
In Asterisk 13+, any given message type is not guaranteed to exist even
if Asterisk comes up correctly since creation of the message type could
be declined. The indexer should not prevent Asterisk from starting
under these conditions.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424834 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-08 14:54:54 +00:00
Kinsey Moore d8bbf1ec1d Stasis: Only log errors for non-declined types
When message type creation is declined via stasis.conf, certain
operations log errors assuming that the declined type is being used
before initialization or after destruction. These error messages get
quite spammy for oft used message types and should not be logged in the
first place since the message type is validly NULL.

Reported by: Matt DiMeo
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424770 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-07 20:33:29 +00:00
Joshua Colp f7225da08a data: Properly access formats in capabilities structure when adding codecs.
Formats within a capabilities structure are addressed starting at 0, not 1.
Assuming 1 causes it to exceed an array.

ASTERISK-24389 #close
Reported by: Kevin Harwell
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-07 18:34:40 +00:00
Matthew Jordan 39bd5b7a70 message: Don't close an AMI connection on SendMessage action error
If SendMessage encounters an error (such as incorrect input provided to the
action), it will currently return -1. Actions should only return -1 if the
connection to the AMI client should be closed. In this case, SendMessage
causing the client to disconnect is inappropriate.

This patch causes the action to return 0, which simply causes the action to
fail.

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

ASTERISK-24354 #close
Reported by: Peter Katzmann
patches:
  sendMessage.patch uploaded by Peter Katzmann (License 5968)
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-06 18:39:54 +00:00
Richard Mudgett c384532aa4 features.c: Fix lingering channel ref while Bridge() application is active.
Using the Bridge application to bridge a channel that is executing an
applicaiton such as Wait results in a lingering Surrogate channel in the
CLI "core show channels" output even though it has already hungup.

* Fix bridge_exec() to not hold onto the current_dest_chan ref once it has
been put into the bridge.

* Eliminated bridge_exec()'s use of RAII_VAR().

ASTERISK-24224 #close
Reported by: Mark Michelson

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-06 15:41:32 +00:00
Matthew Jordan 3a87f32dc0 sdp_srtp: Add new lines to some WARNING messages
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-06 12:39:03 +00:00
Corey Farrell 9611ef4f1e Release AMI connections on shutdown.
ASTERISK-24378 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4037/
........

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-05 00:49:45 +00:00
Richard Mudgett 70301b0438 audiohooks: Reevaluate the bridge technology when an audiohook is added or removed.
Adding a mixmonitor to a channel causes the bridge to change technologies
from native to simple_bridge so the call can be recorded.  However, when
the mixmonitor is stopped the bridge does not switch back to the native
technology.

* Added unbridge requests to reevaluate the bridge when a channel
audiohook is removed.

* Moved the unbridge request into ast_audiohook_attach() ensure that the
bridge reevaluates whenever an audiohook is attached.  This simplified the
mixmonitor and chan_spy start code as well.

* Added defensive code to stop_mixmonitor_full() in case additional
arguments are ever added to the StopMixMonitor application.

* Made ast_framehook_detach() not do an unbridge request if the framehook
does not exist.

* Made ast_framehook_list_fixup() do an unbridge request if there are any
framehooks.  Also simplified the loop.

ASTERISK-24195 #close
Reported by: Jonathan Rose

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-03 19:42:54 +00:00
Richard Mudgett 0165c5f95a chan_pjsip: Fix deadlock when masquerading PJSIP channels.
Performing a directed call pickup resulted in a deadlock when PJSIP
channels were involved.

A masquerade needs to hold onto the channel locks while it swaps channel
information between the two channels involved in the masquerade.  With
PJSIP channels, the fixup routine needed to push a fixup task onto the
PJSIP channel's serializer.  Unfortunately, if the serializer was also
processing a task that needed to lock the channel, you get deadlock.

* Added a new control frame that is used to notify the channels that a
masquerade is about to start and when it has completed.

* Added the ability to query taskprocessors if the current thread is the
taskprocessor thread.

* Added the ability to suspend/unsuspend the PJSIP serializer thread so a
masquerade could fixup the PJSIP channel without using the serializer.

ASTERISK-24356 #close
Reported by: rmudgett

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424473 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-03 17:47:42 +00:00
George Joseph 4967478d18 sorcery: Prevent SEGV in sorcery_wizard_create when there's no create function
When you call ast_sorcery_create() you don't necessarily know which wizard is
going to be invoked.  If it happens to be a wizard like 'config' that doesn't
have a 'create' virtual function you get a segfault in the
sorcery_wizard_create callback.  This patch catches the null function pointer,
does an ast_assert, and logs an error.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-03 15:55:57 +00:00
Kinsey Moore 4246652603 Manager: Add missing fields and documentation for CoreShowChannels
This corrects some issues introduced in the responses to the
CoreShowChannels AMI command as well as adding documentation for the
responses. The command in Asterisk 12 was missing the following fields:
Duration, Application, ApplicationData, and BridgedChannel and
BridgedUniqueID (replaced with BridgeId).

ASTERISK-24262 #close
Reported by: Mitch Claborn
Review: https://reviewboard.asterisk.org/r/4040/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-10-03 13:33:11 +00:00
Richard Mudgett 9d2bc0675a threadpool.c: Minor cleanup fixes.
* Fix threadpool_alloc() prototype.

* Add missing off-nominal NULL check of pool in threadpool_alloc().

* searializer_create() does not need to create the object with a lock as
the lock is not used.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-29 20:28:24 +00:00
Walter Doekes e0abb82ab8 core: Ouch, forgot to undo a test free() in r423978.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-26 15:43:04 +00:00
Walter Doekes 37179a2b1f core: Don't allow free to mean ast_free (and malloc, etc..).
This gets rid of most old libc free/malloc/realloc and replaces them
with ast_free and friends. When compiling with MALLOC_DEBUG you'll
notice it when you're mistakenly using one of the libc variants. For
the legacy cases you can define WRAP_LIBC_MALLOC before including
asterisk.h.

Even better would be if the errors were also enabled when compiling
without MALLOC_DEBUG, but that's a slightly more invasive header
file change.

Those compiling addons/format_mp3 will need to rerun
./contrib/scripts/get_mp3_source.sh.

ASTERISK-24348 #related
Review: https://reviewboard.asterisk.org/r/4015/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-26 14:41:38 +00:00
Walter Doekes 63a4da4a0d cli.c: Fix tab completion "module load" when MALLOC_DEBUG is enabled.
r421600 conflicted with r155763.

ASTERISK-24348 #close
........

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-22 17:42:26 +00:00
Matthew Jordan 64a9e5f001 main/channel: Unlock channel in off-nominal path
In r423414 (13) / r423415 (trunk), an API call that determines if a format
capability structure is empty was added. This returns true if the format
capability structure is completely empty or "none". A check for this was added
in channel.c's set_format call. Unfortunately, when this check was true, it
returned from the function while still holding the channel lock. This caused
the CDR unit tests - which have a tendency to create channels with no formats -
to deadlock. Whoops.

This patch unlocks the channel on the off-nominal path.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423642 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-21 01:16:05 +00:00
Jonathan Rose 6dae345674 Stasis_channels: Resolve unfinished Dials when doing masquerades
Masquerades into channels that are in the dialing state don't end their dial
and this goes against the model for things like CDRs and generating Dial end
manager actions and such.

ASTERISK-24237 #close
Reported by: Richard Mudgett
Review: https://reviewboard.asterisk.org/r/3990/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-19 15:54:20 +00:00
Kinsey Moore 7f2623a26f PJSIP: Prevent T38 framehook being put on wrong channel
This change gives framehooks a reverse-direction masquerade callback in
addition to chan_fixup_cb similar to the callback added to datastores
to handle the same situation. The new callback provides the same
parameters as the fixup callback, but is called on the new channel's
framehooks before moving framehooks from the old channel to the new
channel. This gives the framehooks an oppurtunity to decide whether
they should remain on the new channel or be removed.

This new callback is used to prevent the PJSIP T.38 framehook from
remaining on a masqueraded channel if the new channel is not also a
PJSIP channel. This was causing a crash when a local channel was
masqueraded into a PJSIP channel and the framehook was executed on the
local channel since the channel's tech private data was not structured
as expected.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-19 12:50:08 +00:00
George Joseph ad8ef9175a utils: Create ast_strsep function that ignores separators inside quotes
This function acts like strsep with three exceptions...
* The separator is a single character instead of a string.
* Separators inside quotes are treated literally instead of like separators.
* You can elect to have leading and trailing whitespace and quotes
stripped from the result and have '\' sequences unescaped.

Like strsep, ast_strsep maintains no internal state and you can call it
recursively using different separators on the same storage.

Also like strsep, for consistent results, consecutive separators are not
collapsed so you may get an empty string as a valid result.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3989/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18 19:23:39 +00:00
Richard Mudgett a7add3a257 astobj2.c/refcounter.py: Fix to deal with invalid object refs.
* Make astob2 REF_DEBUG output an invalid object line when an invalid ao2
object ref/unref is attempted.  This is similar to the
constructor/destructor lines.

* Fixed refcounter.py to handle skewed objects that have
constructor/destructor states.

* Made refcounter.py highlight the invalid ao2 object refs by putting them
in their own section of the processed output file.

* Made refcounter.py highlight unreffing an object by more than one that
results in a negative ref count and the object being destroyed.  The
abnormally destroyed object is reported in the invalid and finalized
object sections of the output.

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

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18 16:56:40 +00:00
Mark Michelson fa6313ad29 Add API call to determine if format capability structure is "empty".
Empty here means that there are no formats in the format_cap structure
or the only format in it is the "none" format.

I've added calls to check the emptiness of a format_cap in a few places
in order to short-circuit operations that would otherwise be pointless
as well as to prevent some assertions from being triggered in cases
where channels with no formats are used.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18 16:38:26 +00:00
George Joseph d120e40309 config: bug: Fix SEGV in ast_category_insert when matching category isn't found
If you call ast_category_insert with a match category that doesn't exist, the
list traverse runs out of 'next' categories and you get a SEGV.  This patch
adds check for the end-of-list condition and changes the signature to return
an int for success/failure indication instead of a void.

The only consumer of this function is manager and it was also changed to use
the return value.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3993/
........

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-18 14:46:12 +00:00
Scott Griepentrog 662b687dbe Voicemail: get correct duration when copying file to vm
Changes made during format improvements resulted in the
recording to voicemail option 'm' of the MixMonitor app
writing a zero length duration in the msgXXXX.txt file.

This change introduces a new function ast_ratestream(),
which provides the sample rate of the format associated
with the stream, and updates the app_voicemail function
for ast_app_copy_recording_to_vm to calculate the right
duration.

Review: https://reviewboard.asterisk.org/r/3996/
ASTERISK-24328 #close
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423193 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-16 16:33:53 +00:00
Jonathan Rose dd6bdede7d Realtime: Fix a bug that caused realtime destroy command to crash
Also has could affect with anything that goes through ast_destroy_realtime.
If a CLI user used the command 'realtime destroy <family>' with only a single
column/value pair, Asterisk would crash when trying to create a variable list
from a NULL value.

ASTERISK-24231 #close
Reported by: Niklas Larsson
Review: https://reviewboard.asterisk.org/r/3985/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-12 16:19:19 +00:00
Mark Michelson c212a71f0b Remove undocumented default behavior of ast_play_and_record_full acceptdtmf.
ast_play_and_record_full() has a parameter called "acceptdtmf" that is a
string of acceptable DTMF digits that may be pressed by a caller to end
and accept the recording.

ARI uses this function in order to perform recording, and it provides
options for what is passed as acceptdtmf to ast_play_and_record_full().
By default, ARI passes an empty string, with the intention that no DTMF
can be used to end the recording.

The problem is that ast_play_and_record_full() attempts to be "helpful"
by setting "#" as the acceptdtmf if an empty string or NULL pointer
has been passed in. With ARI, this results in unexpected behavior
occurring if you have attempted to intercept "#" yourself in order
to perform some other manipulation of the live recording.

This change removes the "helpful" behavior by no longer accepting
"#" as a default acceptdtmf if none is specified by the caller of
ast_play_and_record_full(). This makes the ARI scenario work as
expected.

The other callers of ast_play_and_record_full() are app_voicemail
and app_minivm, and in both cases, they pass an explicit "#" to
ast_play_and_record_full() as acceptdtmf, so they are unaffected
by this change.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-11 22:17:39 +00:00
George Joseph 93894d53c4 config: bug: fix truncation of included config files on permissions error
ast_config_text_file_save() currently truncates include files as they
are processed.  If a subsequent include file or the main config file has
a permissions error that prevents writing, earlier include files are left
truncated resulting in a frantic search for backups.

This patch causes ast_config_text_file_save to check for write access
on all files before it truncates any of them.

Will be applied 1.8 > trunk.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3986/
........

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-10 16:07:04 +00:00
Matthew Jordan 71acca4de2 main/cdr: Copy over location information during a fork
When a CDR is forked, a new CDR is created and appended to the CDR chain for
the Party A. The forked CDR starts life off as a clone of the last
non-finalized for the particular Party A. In the past, merely copying over
the snapshots for Party A/Party B would be sufficient. However, as the CDRs
now contain cached information from Party A - specifically application/data,
context, and extension - we need to copy that over during a fork as well.

Huzzah for unit tests catching this when the context/extension were derived
from a cached value on the CDR instead of on Party A.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422771 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-09-06 22:50:24 +00:00