Commit Graph

3176 Commits

Author SHA1 Message Date
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
Matthew Jordan
46289ce3a0 Updated filestream destructor to block until move is complete when cache is used
When a cache directory is used, the process is forked and a mv command is executed to move the temporary file to the permanent location.  This caused issues with voicemail, where a race condition occurred when the parent expected the file to be in the permanent location prior to the mv command completing.  The parent process is now blocked until the mv command completes.

(closes issue ASTERISK-17724)
Reported by: Adiren P.
Tested by: mjordan

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@326209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-05 13:23:57 +00:00
Matthew Nicholson
0bdbde0690 make framehooks prevent native bridging (for real this time)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@325545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-29 16:18:39 +00:00
Matthew Nicholson
3b216f2dc9 don't do native/remote bridging if a framehook is active on the channel
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@325537 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-29 15:34:47 +00:00
Tilghman Lesher
72d041e1b9 Save and restore errno from within signal handlers.
This is recommended by the POSIX standard, as well as by the sigaction(2) manpage
for various platforms that we support (e.g. Mac OS X).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@324955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-27 16:30:50 +00:00
David Vossel
e1adc7cefa Merged revisions 324634 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r324634 | dvossel | 2011-06-23 13:18:46 -0500 (Thu, 23 Jun 2011) | 13 lines
  
  Merged revisions 324627 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r324627 | dvossel | 2011-06-23 13:16:52 -0500 (Thu, 23 Jun 2011) | 7 lines
    
    Addresses AST-2011-010, remote crash in IAX2 driver
    
    Thanks to twilson for identifying the issue and providing the patches.
    
    AST-2011-010
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@324652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-23 18:23:21 +00:00
Terry Wilson
0ada0bfea3 Stop sending IPv6 link-local scope-ids in SIP messages
The idea behind the patch listed below was used, but in a more targeted manner.
There are now address stringification functions for addresses that are meant to
be sent to a remote party. Link-local scope-ids only make sense on the machine
from which they originate and so are stripped in the new functions.

There is also a host sanitization function added to chan_sip which is used
for when peer and dialog tohost fields or sip_registry hostnames are used to
craft a SIP message.

Also added are some basic unit tests for netsock2 address parsing.

(closes issue ASTERISK-17711)
Reported by: ch_djalel
Patches:
      asterisk-1.8.3.2-ipv6_ll_scope.patch uploaded by ch_djalel (license 1251)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@324484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-22 18:52:04 +00:00
David Vossel
87908a3f5d Fixes locking inversion issue in ast_async_goto()
During this function we can not hold the "chan" lock while
doing the masquerade, the explicit goto on the tmp chan, or
the channel alloc.  Instead we need to get the channel lock,
store off information about the channel that we need, and
then let the channel lock go for the remainder of the function.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@324364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-21 20:11:52 +00:00
Leif Madsen
557fe8bc24 Add Username and Secret fields to manager Login action.
Pointed out by Vlad Povorozniuc

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@324178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-17 18:51:16 +00:00
Leif Madsen
cfec9cdf0d Fix grammar in documentation for Goto() and GotoIf()
(closes issue ASTERISK-18023)
Reported by: Tim Osman

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@324115 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-17 15:14:54 +00:00
Terry Wilson
c84e7b911e Lock the channel before calling the setoption callback
The channel needs to be locked before calling these callback functions. Also,
sip_setoption needs to lock the pvt and a check p->rtp is non-null before using
it.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@324048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-16 22:35:41 +00:00
Terry Wilson
c24706ee9e Merged revisions 323733 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r323733 | twilson | 2011-06-15 13:13:00 -0500 (Wed, 15 Jun 2011) | 16 lines
  
  Merged revisions 323732 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r323732 | twilson | 2011-06-15 13:06:24 -0500 (Wed, 15 Jun 2011) | 9 lines
    
    Fix DYNAMIC_FEATURES
    
    DYNAMIC_FEATURES were broken by a recent DTMF change. This patch makes
    sure that dynamic features are also checked when deciding whether or not
    to pass DTMF through or store it for interpreting.
    
    (closes issue ASTERISK-17914)
    Reported by: vrban
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323754 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-15 18:21:52 +00:00
Richard Mudgett
9a19763a38 [regression] Voicemail MWI is no longer sent.
When leaving a voicemail, the MWI message is never sent.  The same thing
happens when checking a voicemail and marking it as read.

If you restart Asterisk, everything comes up at that state correctly, but
changes to the messages in voicemail causes the light to not be set
appropriately.  Very easy to reproduce.

* Made ast_event_check_subscriber() return TRUE if there are ANY
subscribers to an event type when there are no restricting ie values
passed.  This allows an event being queued to be queued.

(closes issue ASTERISK-18002)
Reported by: lmadsen
Tested by: lmadsen, irroot
Patches:
     jira_asterisk_18002_v1.8.patch uploaded by rmudgett (License #5621)

(closes issue ASTERISK-18019)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323669 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-15 16:43:18 +00:00
Sean Bright
0701feaa95 Merged revisions 323579 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r323579 | seanbright | 2011-06-15 11:22:50 -0400 (Wed, 15 Jun 2011) | 32 lines
  
  Merged revisions 323559 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r323559 | seanbright | 2011-06-15 11:15:30 -0400 (Wed, 15 Jun 2011) | 25 lines
    
    Resolve a segfault/bus error when we try to map memory that falls on a page
    boundary.
    
    The fix for ASTERISK-15359 was incorrect in that it added 1 to the length of the
    mmap'd region.  The problem with this is that reading/writing to that extra byte
    outside of the bounds of the underlying fd causes a bus error.
    
    The real issue is that we are working with both a FILE * and the raw fd
    underneath it and not synchronizing between them.  The code that was removed in
    ASTERISK-15359 was correct, but we weren't flushing the FILE * before mapping
    the fd.
    
    Looking at the manager code in 1.4 reveals that the FILE * in 'struct
    mansession' is never used except to create a temporary file that we immediately
    fdopen.  This means we just need to write a 0 byte to the fd and everything will
    just work.  The other branches require a call to fflush() which, while not a
    guaranteed fix, should reduce the likelihood of a crash.
    
    This all makes sense in my head.
    
    (closes issue ASTERISK-16460)
    Reported by: Ravelomanantsoa Hoby (hoby)
    Patches:
    		issue17747_1.4_svn_markII.patch uploaded by Sean Bright (license #5060)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-15 15:31:53 +00:00
Richard Mudgett
ba678e9c1b Add missing break in ast_event_get_cached().
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-15 00:50:20 +00:00
Richard Mudgett
0fe02d0183 Made ast_sockaddr_split_hostport() port warning msgs more meaningful.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-14 17:21:39 +00:00
Richard Mudgett
2b2aa6ba3e Add more strict hostname checking to ast_dnsmgr_lookup().
Change suggested in review.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-14 17:21:24 +00:00
Terry Wilson
ee2920afba Add rtpkeepalives back to 1.8
The RTP-engine conversion left out support for handling rtpkeepalives.
This patch adds them back.

(closes issue ASTERISK-17304)
Reported by: lmadsen

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-14 16:33:55 +00:00
Leif Madsen
a3c4818a51 Avoid dividing by zero with L() option to Dial()
Reported by: nicolasom
Patches:
    
issue-17995.patch - nicolasom (License #5994)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-13 19:51:52 +00:00
Terry Wilson
12cab256cc Avoid a DB1 infinite loop bug
Explicity check the last entry in the DB and make sure that we don't iterate
past it. Since there can be no duplicates, this just makes sure that we stop
after matching the last key.

This patch also refactors the code to get away from some code duplication. A
previous patch added many astdb tests and this patch passed them.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@322981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-10 15:29:00 +00:00
Richard Mudgett
aec1979e7f Remove potential deadlock in call pickup race.
Deadlock is possible in ast_do_pickup() when holding the target channel
lock and trying to get the chan channel lock.  Also, holding the target
lock when calling ast_channel_masquerade() is not a good idea because that
routine does deadlock avoidance.

* Removed the need to hold the target lock after marking the target with a
datastore and getting the connected line data off of the target channel.

* Moved can_pickup() to ast_can_pickup() in features.c.  Now all the call
pickup methods use the same basic call pickup availability check.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@322749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-09 16:31:53 +00:00
Jonathan Rose
5f46b994f4 Adds ast_escape_encoded utility to properly handle escaping of quoted field before uri.
This commit backports a feature in trunk affecting initreqprep so that display name won't
be encoded improperly. Also includes unit tests for the ast_escape_quoted function.
This patch gives 1.8 a much improved outlook in countries which don't use standard
ASCII characters.

(closes issue ASTERISK-16949)
Reported by: Örn Arnarson
Review: https://reviewboard.asterisk.org/r/1235/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@322585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-09 14:06:42 +00:00
Richard Mudgett
6b2172bea3 SRV lookup attempted for SIP peers listed as an IP address.
Asterisk attempts to SRV lookup a host name even if the host name is an IP
address.  Regression introduced when IPv6 support was added.

* Restored the check in ast_dnsmgr_lookup() to see if the given host name
is an IP address.  The IP address could be in either IPv4 or IPv6 formats.

(closes issue ASTERISK-17815)
Reported by: Byron Clark
Tested by: Byron Clark, Richard Mudgett
Patches:
     issue19248_v1.8.patch - uploaded by Richard Mudgett (License #5621)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@322425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-08 18:46:30 +00:00
Jonathan Rose
c728c8d56b Fixes level toggling for logger set levels since it was reversed
(closes issue ASTERISK-17850)
Reported by: Luke H
Tested by: jrose, Luke H
  
Review: https://reviewboard.asterisk.org/r/1244/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@322069 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-06 19:07:56 +00:00