Commit Graph

3199 Commits

Author SHA1 Message Date
Gregory Nietsky
c47fd8f774 Its possible to loose audio on ast_write when the channel is not transcoded correctly.
in the case of DAHDI the channel is hungup.

This patch tries to "fix" the problem and make the channel compatiable and warn the user of
this problem.

Please note there is a underlying problem with codec negotion this does not fix the problem
it does try to rectify it and prevent loss of service.

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

(closes issue ASTERISK-17541)
(closes issue ASTERISK-18063)
(issue ASTERISK-14384)
(issue ASTERISK-17502)
(issue ASTERISK-18325)
(issue ASTERISK-18422)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@337430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-22 06:18:33 +00:00
Matthew Jordan
f13c3b3fd2 Fix for incorrect voicemail duration in external notifications
This patch fixes an issue where the voicemail duration was being reported
with a duration significantly less than the actual sound file duration.
Voicemails that contained mostly silence were reporting the duration of
only the sound in the file, as opposed to the duration of the file with
the silence.  This patch fixes this by having two durations reported in
the __ast_play_and_record family of functions - the sound_duration and the
actual duration of the file.  The sound_duration, which is optional, now
reports the duration of the sound in the file, while the actual full duration
of the file is reported in the duration parameter.  This allows the voicemail
applications to use the sound_duration for minimum duration checking, while
reporting the full duration to external parties if the voicemail is kept.

(issue ASTERISK-2234)
(closes issue ASTERISK-16981)
Reported by: Mary Ciuciu, Byron Clark, Brad House, Karsten Wemheuer, KevinH
Tested by: Matt Jordan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@337118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20 22:38:54 +00:00
Kinsey Moore
8a0b9d39e5 Make CANMATCH with the new pattern match engine behave more like the old one
When checking an extension for E_CANMATCH using the new extension matching
algorithm, an exact match was not returned as a possible match resulting in the
queue failing to allow a caller to exit on DTMF.  This removes the requirement
that an extension be longer than acquired digits for an E_CANMATCH operation
to succeed.

(closes issue ASTERISK-18044)
Review: https://reviewboard.asterisk.org/r/1367/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@337061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20 21:04:11 +00:00
Tilghman Lesher
02795f190e Various changes to allow 1.8 to compile on Mac OS X Lion (10.7)
* Makefile workaround for 10.6 extended to work on 10.7 and later.
* Now uses the 'weak' symbol for Lion systems, which no longer support
  'weak_import'

Closes ASTERISK-17612.
Closes ASTERISK-18213.

Tested by: tilghman, oej.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 20:27:03 +00:00
Olle Johansson
02a28f4afe Make sure manager_debug option is reset at reload
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336440 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 12:06:48 +00:00
Jonathan Rose
21714a05b6 Fix bad RTP media bridges in directmedia calls on peers separated by multiple Asterisk nodes.
In a situation involving devices on separate Asterisk trunks, the remote RTP bridge would
break when starting a call with directmedia. This patch queues a new type of control frame
so that our RTP bridge loop can properly detect when these situations occur and check to see
if peers need to be updated in order to send their media to the proper location.

(Closes issue ASTERISK-18340)
Reported by: Thomas Arimont
(Closes issue ASTERISK-17725)
Reported by: kwk
Tested by: twilson, jrose


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 19:53:40 +00:00
Matthew Nicholson
454969d783 The tech and data members of fast_originate_helper are not string fields.
ASTERISK-17709


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-14 13:28:16 +00:00
Tzafrir Cohen
42840a2ef9 do parse defaultlanguage from asterisk.conf
Do parse the option "defaultlanguage" from the [options] section of
asterisk.conf, as in the sample config file. Otherwise the build-time
default language (normally "en") is always the default one.

Review: https://reviewboard.asterisk.org/r/1342/
Signed-off-by: Tzafrir Cohen (License #5035) <tzafrir.cohen@xorcom.com>

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 21:33:20 +00:00
Matthew Nicholson
ebb6110a13 Don't limit the size of appdata for manager originate actions.
ASTERISK-17709
Patch by: tilghman (with modifications)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335618 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 18:20:52 +00:00
Russell Bryant
5f1882731a Fix a crash in res_ais.
This patch resolves a crash observed in a load testing environment that
involved the use of the res_ais module.  I observed some crashes where
the event delivery callback would get called, but the length parameter
incidcating how much data there was to read was 0.  The code assumed
(with good reason I would think) that if this callback got called, there
was an event available to read.  However, if the rare case that there's
nothing there, catch it and return instead of blowing up.

More specifically, the change always ensure that the size of the received
event in the cluster is always big enough to be a real ast_event.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 07:11:36 +00:00
Matthew Nicholson
1aeb6f1242 Properly set caller_warning and callee_warning before we try to use them.
ASTERISK-18199
Patch by: elguero
Testing by: rtang


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-12 15:54:41 +00:00
Matthew Jordan
7dc49195d8 Updated SIP 484 handling; added Incomplete control frame
When a SIP phone uses the dial application and receives a 484 Address 
Incomplete response, if overlapped dialing is enabled for SIP, then
the 484 Address Incomplete is forwarded back to the SIP phone and the
HANGUPCAUSE channel variable is set to 28.  Previously, the Incomplete
application dialplan logic was automatically triggered; now, explicit
dialplan usage of the application is required.

Additionally, this patch adds a new AST_CONTOL_FRAME type called
AST_CONTROL_INCOMPLETE.  If a channel driver receives this control frame,
it is an indication that the dialplan expects more digits back from the
device.  If the device supports overlap dialing it should attempt to 
notify the device that the dialplan is waiting for more digits; otherwise,
it can handle the frame in a manner appropriate to the channel driver.

(closes issue ASTERISK-17288)
Reported by: Mikael Carlsson
Tested by: Matthew Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09 16:09:09 +00:00
Richard Mudgett
2fb25c3aea Fix crash with res_fax when MALLOC_DEBUG and "core stop gracefully" are used.
Asterisk crashes if MALLOC_DEBUG is enabled when res_fax tries to
unregister its logger level.

* Make ast_logger_unregister_level() use ast_free() instead of free().
When MALLOC_DEBUG is enabled, ast_free() does not degenerate into a call
to free().  Therefore, if you allocated memory with a form of ast_malloc
you must free it with ast_free.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-08 22:27:40 +00:00
Richard Mudgett
c6e7f17a68 Fix AMI action Park crash.
* Made AMI action Park not say anything to the parker channel (AMI header
Channel2) since the AMI action is a third party parking the call.  (This
is a change in behavior that cannot be preserved without a lot of effort.)

* Made not play pbx-parkingfailed if the Park 's' option is used.

JIRA AST-660


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07 19:31:44 +00:00
Stefan Schmidt
687e413fd8 Adding the Feature to sent a Reason Header in a SIP Cancel message by set the flag AST_FLAG_ANSWERED_ELSEWHERE before doing a masquerade in the pickup function.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07 13:26:50 +00:00
Alec L Davis
71f3dc01da Prevent segfault if call arrives before Asterisk is fully booted.
Prevent ast_pbx_start and ast_run_start from starting a new thread unless asterisk
is fully booted.
 
alecdavis (license 585)
Tested by: alecdavis
 
Review: https://reviewboard.asterisk.org/r/1407/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-07 07:33:39 +00:00
Richard Mudgett
6d49117675 Fix potential memory allocation failure crashes in config.c.
* Added required checks to the returned memory allocation pointers to
prevent crashes.

* Made ast_include_rename() create a replacement ast_variable list node if
the new filename is longer than the available space.  Fixes potential
crash and memory leak.

* Factored out ast_variable_move() from ast_variable_update() so
ast_include_rename() can also use it when creating a replacement
ast_variable list node.

* Made the filename stuffed at the end of the struct a minimum allocated
size in ast_variable_new() in case ast_include_rename() changes the stored
filename.

* Constify struct char pointers pointing to strings stuffed at the end of
the struct for: ast_variable, cache_file_mtime, and ast_config_map.

* Factored out cfmtime_new() to remove inlined code and allow some struct
pointers to become const.

* Removed the list lock from struct cache_file_mtime that was never used.

* Added doxygen comments to several structure elements and better
documented what strings are stuffed at the struct end char array.

* Reworked ast_config_text_file_save() and set_fn() to handle allocation
failure of the include file scratch pad object tracking blank lines.

* Made ast_config_text_file_save() fn[] declared with PATH_MAX to ensure
it is long enough for any filename with path.  Also reduced the number of
container fileset buckets from a rediculus 180,000 to 1023.

JIRA AST-618

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-02 17:10:58 +00:00
Tilghman Lesher
b178214e07 Remove 1.6 compatibility documentation from 1.8, as it no longer applies.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334234 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-01 17:38:33 +00:00
Richard Mudgett
9e99b1819e Call pickup race leaves orphaned channels or crashes.
Multiple users attempting to pickup a call that has been forked to
multiple extensions either crashes or fails a masquerade with a "bad
things may happen" message.

This is the scenario that is causing all the grief:
1) Pickup target is selected
2) target is marked as being picked up in ast_do_pickup()
3) target is unlocked by ast_do_pickup()
4) app dial or queue gets a chance to hang up losing calls and calls
ast_hangup() on target
5) SINCE A MASQUERADE HAS NOT BEEN SETUP YET BY ast_do_pickup() with
ast_channel_masquerade(), ast_hangup() completes successfully and the
channel is no longer in the channels container.
6) ast_do_pickup() then calls ast_channel_masquerade() to schedule the
masquerade on the dead channel.
7) ast_do_pickup() then calls ast_do_masquerade() on the dead channel
8) bad things happen while doing the masquerade and in the process
ast_do_masquerade() puts the dead channel back into the channels container
9) The "orphaned" channel is visible in the channels list if a crash does
not happen.

This patch does the following:

* Made ast_hangup() set AST_FLAG_ZOMBIE on a successfully hung-up channel
and not release the channel lock until that has happened.

* Made __ast_channel_masquerade() not setup a masquerade if either channel
has AST_FLAG_ZOMBIE set.

* Fix chan_agent misuse of AST_FLAG_ZOMBIE since it would no longer work.

(closes issue ASTERISK-18222)
Reported by: Alec Davis
Tested by: rmudgett, Alec Davis, irroot, Karsten Wemheuer

(closes issue ASTERISK-18273)
Reported by: Karsten Wemheuer
Tested by: rmudgett, Alec Davis, irroot, Karsten Wemheuer

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-31 15:20:31 +00:00
Richard Mudgett
b1f11e0df4 Revert previous commit. Not ready yet.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@332945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22 22:11:54 +00:00
Richard Mudgett
c0ce03d77f Signed
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@332943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22 22:02:52 +00:00
Richard Mudgett
b06b8acd20 Minor code optimizations.
* Simplify ast_category_browse() logic for easier understanding.

* Remove dead code in ast_variable_delete() and simplify some of its
logic.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@332939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22 21:22:24 +00:00
Matthew Jordan
56549c96ab Review: https://reviewboard.asterisk.org/r/1364/
This update adds a new AMI event, TestEvent, which is enabled when the TEST_FRAMEWORK compiler flag is defined.  It also adds initial usage of this event to app_voicemail.  The TestEvent AMI event is used extensively by the voicemail tests in the Asterisk Test Suite.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@332817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22 18:15:51 +00:00
Richard Mudgett
08b76290a2 Memory leak reading realtime database variable list.
Calling ast_load_realtime() can leak the last list node if the read list
only contains empty variable value items.

* Fixed list filter loop in ast_load_realtime() to delete the list node
immediately instead of the next time through the loop.  The next time
through the loop may not happen if the node to delete is the last in the
list.

(issue ASTERISK-18277)
(issue ASTERISK-18265)
Patches:
      jira_asterisk_18265_v1.8_config.patch (license #5621) patch uploaded by rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@332759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22 17:00:03 +00:00
Terry Wilson
5dd7370c32 Fix possible error on stringification of IPv4-mapped addrs
The FreeBSD netsock2 test has been failing for a while. We were
pasing sa->len to getnameinfo instead of sa_tmp->len.

ASTERISK-18289


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@332559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-18 21:26:01 +00:00
Richard Mudgett
422e191e03 Fix multiple parking issues.
JIRA ASTERISK-17183
Multi-parkinglot directs calls to wrong parkinglot.
JIRA ASTERISK-17870
Cannot retrieve parked calls.
JIRA ASTERISK-17430
ParkedCall() with no extension should pickup first available call and does not.
JIRA AST-576
Issues with parking lots

* Removed searching for parking lots by extension.  Parking lots can only
be found by the parking lot name since parking lot access extensions and
spaces are not guaranteed to be unique.

* Added parking_lot_name option to the Park and ParkedCall applications.
Updated documentation for Park and ParkedCall applications.

* Add parkext_exclusive configuration option to make parking entry
extensions specify which parking lot they access.

(closes issue ASTERISK-17183)
Reported by: David Cabrejos
Tested by: rmudgett, David Cabrejos

(closes issue ASTERISK-17870)
Reported by: Remi Quezada

(closes issue ASTERISK-17430)
Reported by: Philippe Lindheimer


JIRA ASTERISK-17452
Parking_offset not used
JIRA AST-624
'next' setting for findslot does nothing

* Reimplemented since findslot feature option broken by -r114655.

(closes issue ASTERISK-17452)
Reported by: David Woolley
Tested by: rmudgett


JIRA ASTERISK-15792
Dialplan continues execution after transfer to park.

This happens for DTMF attended transfer, DTMF blind transfer, and DTMF
one-touch-parking if the party initiating these features also initiated
the call.

* Fixed the return code from the affected builtin features when parking a
call.

(closes issue ASTERISK-15792)
Reported by: Mat Murdock
Tested by: rmudgett, twilson


JIRA AST-607
The courtesytone is not playing to the expected call when picking up a
parked call.

This is mostly a documentation problem.  However, the option is not reset
to the default when features.conf is reloaded.

* Updated features.conf.sample documentation for courtesytone and
parkedplay options.

* Reset the parkedplay option to default when features.conf is reloaded.


JIRA AST-615
AMI Park action followed by features reload results in orphaned channels
in parking lot.

* Reloading features.conf will not touch parking lots that have calls
still parked in them.  Reload again at a later time.


Misc additional fixes:

* Added unit test for parking lot dialplan usage checking.

* Made update connected line when a parked call is retrieved from a
parking lot.

* Made retrieved parked call stop ringing or MOH depending upon how the
call was waiting in the parking lot.

* Made CLI "features show" indicate if the parking lot is enabled for use.

* Added PARKINGDYNEXTEN channel variable to allow dynamic parking lots to
specify the parking lot access extension.

* Made AMI ParkedCalls action ParkedCall events have a Parkinglot header.

* Made AMI ParkedCalls action ParkedCallsComplete event have a Total
header.

* Fixed potential deadlock from AMI Park action holding channel locks
while calling masq_park_call().

* Fixed several places where ast_strdupa() were used inside of loops.
(Mostly fixed by refactoring the loop body into its own function.)

* Fixed copy_parkinglot() copying too much from the source parking lot.
Extracted the parking lot configuration settings into struct
parkinglot_cfg.

* Refactored courtesytone playing code to put the channel not playing the
tone in autoservice.

* Fix when pbx-parkingfailed is played that the other channel is put in
autoservice if it exists.

* Fixed parkinglot reference leak in parked_call_exec() error paths.

* Fixed parkinglot_unref() use of parkinglot after it was unreffed.

* Made destroy the struct ast_parkinglot parkings lock when done.

* Refactored the features.conf parking lot configuration code to eliminate
redundancy.

* Fixed feature reload to better protect parking lots.

* Fixed parking lot container reference leak in handle_parkedcalls().

* Fixed the total count in handle_parkedcalls().

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@332100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-16 16:31:36 +00:00
Paul Belanger
0281f945c0 Fix noisy message when briding channels
(closes issue ASTERISK-18270)
Reported by: Federico Alves


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@331886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-15 15:21:16 +00:00
Kinsey Moore
173818cf8f Logger does not warn of failure to open logging channels
Currently, logger only prints an error message to stderr when it fails to open
a logger channel where many users will not see it because the logger lock is
held.  The alternative provided by this patch is to log the error to all
attached consoles in the hopes that it will be easier to see.  Additionally,
this patch prevents the failed logger channel from being added to the list
where it would silently fail on each call to the Asterisk logger.

(closes issue ASTERISK-16231)
Review: https://reviewboard.asterisk.org/r/1338


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@331649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-12 16:20:25 +00:00
Richard Mudgett
e6b7737ef6 Output of queue log not started until logger reloaded.
ASTERISK-15863 caused a regression with queue logging.  The output of the
queue log is not started until the logger configuration is reloaded.

* Queue log initialization is completely delayed until the first message
is posted to the queue log system.  Including the initial opening of the
queue log file.

* Fixed rotate_file() ROTATE strategy to give the file just rotated out to
the configured exec function after rotate.  Just like the other strategies.

* Fixed logger reload to always post the queue reload entry instead of
just if there is a queue log file.

* Refactored some code to eliminate some redundancy and to reduce stack
utilization.

(closes issue ASTERISK-17036)
JIRA SWP-2952
Reported by: Juan Carlos Valero
Patches:
      jira_asterisk_17036_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: rmudgett

(closes issue ASTERISK-18208)
Reported by: Christian Pinedo

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@331461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-10 20:29:59 +00:00
Kinsey Moore
43a5273659 AMI action ModuleReload returns Error if Module: missing or empty
An empty string was not being checked for properly causing identification of
the module to be reloaded to fail and return an Error with message
"No such module."

(closes issue AST-616)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@331315 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-10 13:47:46 +00:00
Richard Mudgett
42b5040b71 Misc minor items found in code.
* Add some reentrancy protection in pbx.c when creating the contexts_table
hash table.

* Fix inverted test in chan_sip.c conditional code.

* Fix uninitialized variable and use of the wrong variable in chan_iax2.c.

* Fix test of return value in app_parkandannounce.c.  Explicitly testing
for -1 is bad if the function does not actually return that value when it
fails.

* Fixup some comments and add some curly braces in features.c.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@331248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-09 22:12:59 +00:00
Kinsey Moore
d0619b1217 editing files in main/editline does not ensure rebuild of libedit.a
When editing a source file in main/editline, the build system does not rebuild
libedit.a and uses the already existing one instead.  Adding a PHONY to
CHECK_SUBDIR fixes this problem.

(closes issue ASTERISK-16221)
Patch-by: Walter Doekes


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@330762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-03 15:14:36 +00:00
Kinsey Moore
ba0c95e491 Incorrect playback for Spanish in some circumstances
When you say the time in spanish and it is 01:00 - 01:59 or 13:00 - 13:59 you
must use female pronunciation "1F". The function "say_date_with_format_es" does
not take this in account.

(closes ASTERISK-15016)
Patch-by: Luis Jimenez


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@330433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-01 15:22:10 +00:00
Richard Mudgett
4bd9b75724 Remove some redundant locking code in ast_do_masquerade().
Also updated some comments.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@330368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-30 23:56:29 +00:00
Gregory Nietsky
842ab32ecc prevent double masqurading channels when one is been hung up and deadlock avoidance is used.
There is a race condition in ast_do_masquerade / ast_hangup (at least)

Reported by me signed off by schmidts with input from David Vossel

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@330311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-30 15:25:16 +00:00
Terry Wilson
659c320f5d Make console colors work for TERM=xterm-256color
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@330107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-28 21:42:41 +00:00
Jonathan Rose
31a1b94622 Fixes some voicemail forwarding behavior based around prepend mode.
Formerly, prepend forwarding would have the user record a message with no useful prompt
and an expectation for the user to push a button on the phone when finished recording.
If a length of silence was detected instead, the recording would be canceled and the user
would re-enter the voicemail forwarding menu. Subsequent time-outs in prepend recording
would also bug out in the sense that they would write over the original message and get
sent to the recipient regardless of whether they timed out or were accepted. This patch
fixes this issue and adds a prompt which will be played after a timeout informing the
user that they needed to press a button. Currently, the sound files that we have are
somewhat inadquate for this, so after the call we simply have Allison say "Please try
again. Then press pound." which actually relies on two separate sound files. Just one
would be more appropriate.

reporter: Vlad Povorozniuc
Review: https://reviewboard.asterisk.org/r/1327/ 


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@329527 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-26 13:25:35 +00:00
Paul Belanger
ba4e50a28a Decrease verbose messages to debug, to help clean up CLI.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@329471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-25 19:49:40 +00:00
Richard Mudgett
a55804ffda Fix memory leak in an allocation error path of handle_statechange().
* Make use buffer accessor function in handle_statechange() rather than
directly accessing the struct member.

* Make use less redundant loop construct for iterating over hints.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@329333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-22 21:10:40 +00:00
Richard Mudgett
a97d03e34a Deadlocks dealing with dialplan hints during reload.
There are two remaining different deadlocks reported dealing with dialplan
hints.

The deadlock in ASTERISK-17666 is caused by invalid locking order in
ast_remove_hint().  The hints container must be locked before the hint
object.

The deadlock in ASTERISK-17760 is caused by a catch-22 situation in
handle_statechange().  The deadlock is caused by not having the conlock
before calling the watcher callbacks.  Unfortunately, having that lock
causes a different deadlock as reported in ASTERISK-16961.

* Fixed ast_remove_hint() locking order.

* Made handle_statechange() no longer call the watcher callbacks holding
any locks that matter.

* Made hint ao2 destructor do the watcher callbacks for extension
deactivation to guarantee that they get called.

* Fixed hint reference leak in ast_add_hint() if the callback container
constructor failed.

* Fixed hint reference leak in complete_core_show_hint() for every hint it
found for CLI tab completion.

* Adjusted locking in ast_merge_contexts_and_delete() for safety.

* Added context_merge_lock to prevent ast_merge_contexts_and_delete() and
handle_statechange() from interfering with each other.

* Fixed ast_change_hint() not taking into account that the extension is
used for the hash key.

(closes issue ASTERISK-17666)
Reported by: irroot
Tested by: irroot
JIRA SWP-3318

(closes issue ASTERISK-17760)
Reported by: Byron Clark
Tested by: irroot
JIRA SWP-3393

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@329299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-22 15:44:58 +00:00
Richard Mudgett
6d145897bb Dialplan bridge() app mutex 'current_dest_chan' freed more times than we've locked!
This appears to be a leftover from when ast_channel was converted to ao2
objects.

Simply removed the extraneous unlock.

(closes issue ASTERISK-17772)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@329144 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-21 16:46:21 +00:00
Kinsey Moore
5905269669 RTP bridge away with inband DTMF and feature detection
When deciding whether Asterisk was allowed to bridge the call away from the
core, chan_sip did not take into account the usage of features on dialed
channels that require monitoring of DTMF on channels utilizing inband DTMF.
This would cause Asterisk to allow the call to be locally or remotely bridged, 
preventing access to the data required to detect activations of such features.

(closes 17237)
Review: https://reviewboard.asterisk.org/r/1302/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@328823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-19 17:57:18 +00:00
Mark Murawki
e739fd42fc Fixed invalid read and null pointer deref on asterisk shutdown.
In some cases when starting asterisk with -c and hitting control-c to shutdown, there will be an invalid read and null pointer deref causing a crash.

(closes issue ASTERISK-17927)
Reported by: Mark Murawski
Tested by: Mark Murawski, Kinsey Moore, Tilghman Lesher


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@328593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-18 12:06:50 +00:00
Leif Madsen
d4938a111e Introduce <support_level> tags in MODULEINFO.
This change introduces MODULEINFO into many modules in Asterisk in order to show
the community support level for those modules. This is used by changes committed
to menuselect by Russell Bryant recently (r917 in menuselect). More information about
the support level types and what they mean is available on the wiki at
https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@328209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14 20:13:06 +00:00
Kevin P. Fleming
feb182f802 Correct double-free situation in manager output processing.
The process_output() function calls ast_str_append() and xml_translate() on its
'out' parameter, which is a pointer to an ast_str buffer. If either of these
functions need to reallocate the ast_str so it will have more space, they will
free the existing buffer and allocate a new one, returning the address of the
new one. However, because process_output only receives a pointer to the ast_str,
not a pointer to its caller's variable holding the pointer, if the original
ast_str is freed, the caller will not know, and will continue to use it (and
later attempt to free it).

(reported by jkroon on #asterisk-dev)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@327950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-12 22:53:53 +00:00
Matthew Nicholson
0bc1f651c7 reset our buffer each iteration when doing variable substitution
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@327512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-11 13:53:59 +00:00
Tzafrir Cohen
5bff785fc6 Properly building the Debian armhf (HardFloat) port.
Remove the line that should have been removed in r327411.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@327412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-11 10:56:23 +00:00
Tzafrir Cohen
d004e5839a fix building the Debian armhf (HardFloat) port
Fixes http://buildd.debian-ports.org/status/fetch.php?pkg=asterisk&arch=armhf&ver=1%3A1.8.4.4~dfsg-2&stamp=1309935385
(Missing pthreads)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@327411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-11 10:46:34 +00:00
Matthew Nicholson
1fcdb0f58b Reset our ast_str before passing it on to dialplan function backends.
It is possible for a dialplan backend to not modify the given buffer or ast_str
and still return success. This causes any previous value stored in the buffer
to be used as if the new function call provided it. Some functions also append
to the given buffer assuming it is empty.

The test_substitution unit test has also been modified to detect this problem.

(closes issue ASTERISK-17878)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@327106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-08 19:52:51 +00:00
Richard Mudgett
d3bcf224b0 Some code cleanup in pbx.c
* Mostly comment and format changes.

* ast_context_remove_extension_callerid() and ast_add_extension_nolock()
will write lock the found specific context.

* ast_context_find() will now tolerate a NULL name.

* Eliminated some inlined versions of find_context() and
find_context_locked().


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@326985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-08 01:08:05 +00:00