]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
13 years agoFix remotely exploitable stack overrun in Milliwatt 1.4
Matthew Jordan [Thu, 15 Mar 2012 18:20:49 +0000 (18:20 +0000)] 
Fix remotely exploitable stack overrun in Milliwatt

Milliwatt is vulnerable to a remotely exploitable stack overrun when using
the 'o' option.  This occurs due to the milliwatt_generate function not
accounting for AST_FRIENDLY_OFFSET when calculating the maximum number of
samples it can put in the output buffer.

This patch resolves this issue by taking into account AST_FRIENDLY_OFFSET
when determining the maximum number of samples allowed.  Note that at no
point is remote code execution possible.  The data that is written into the
buffer is the pre-defined Milliwatt data, and not custom data.

(issue ASTERISK-19541)
Reported by: Russell Bryant
Tested by: Matt Jordan
Patches:
  milliwatt_stack_overrun.rev1.txt by Russell Bryant (license 6283)
  Note that this patch was written by Russell, even though Matt uploaded it

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

13 years agoUpdate svn:externals to use menuselect from 1.4.42 and not later.
Leif Madsen [Thu, 8 Dec 2011 20:54:35 +0000 (20:54 +0000)] 
Update svn:externals to use menuselect from 1.4.42 and not later.
This change is required because when making security releases, if you pull from menuselect/trunk
you'll get changes meant for later versions of Asterisk.

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

13 years agoDefault to nat=yes; warn when nat in general and peer differ
Terry Wilson [Mon, 21 Nov 2011 19:54:07 +0000 (19:54 +0000)] 
Default to nat=yes; warn when nat in general and peer differ

It is possible to enumerate SIP usernames when the general and user/peer
nat settings differ in whether to respond to the port a request is sent
from or the port listed for responses in the Via header. In 1.4 and 1.6.2,
this would mean if one setting was nat=yes or nat=route and the other was
either nat=no or nat=never. In 1.8 and 10, this would mean when one was
nat=force_rport and the other was nat=no.

In order to address this problem, it was decided to switch the default
behavior to nat=yes/force_rport as it is the most commonly used option
and to strongly discourage setting nat per-peer/user when at all possible.

For more discussion of the issue, please see:
  http://lists.digium.com/pipermail/asterisk-dev/2011-November/052191.html

(closes issue ASTERISK-18862)
Review: https://reviewboard.asterisk.org/r/1591/

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

14 years agoAdd .o files to svn:ignore property, since it's only ignored if locally configured...
Jason Parker [Fri, 8 Jul 2011 22:26:16 +0000 (22:26 +0000)] 
Add .o files to svn:ignore property, since it's only ignored if locally configured to do so.

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

14 years agoDon't leak SIP username information
Terry Wilson [Tue, 28 Jun 2011 20:03:19 +0000 (20:03 +0000)] 
Don't leak SIP username information

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

14 years agoAddresses AST-2011-010, remote crash in IAX2 driver
David Vossel [Thu, 23 Jun 2011 18:16:52 +0000 (18:16 +0000)] 
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.4@324627 65c4cc65-6c06-0410-ace0-fbb531ad65f3

14 years agoFix DYNAMIC_FEATURES
Terry Wilson [Wed, 15 Jun 2011 18:06:24 +0000 (18:06 +0000)] 
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.4@323732 65c4cc65-6c06-0410-ace0-fbb531ad65f3

14 years agoResolve a segfault/bus error when we try to map memory that falls on a page
Sean Bright [Wed, 15 Jun 2011 15:15:30 +0000 (15:15 +0000)] 
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.4@323559 65c4cc65-6c06-0410-ace0-fbb531ad65f3

14 years agounlock pvt when we drop voice frames received in early media when in t.38 mode
Matthew Nicholson [Thu, 9 Jun 2011 15:36:05 +0000 (15:36 +0000)] 
unlock pvt when we drop voice frames received in early media when in t.38 mode

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

14 years agowhitespace
Matthew Nicholson [Thu, 9 Jun 2011 15:20:19 +0000 (15:20 +0000)] 
whitespace

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

14 years agodon't drop any voice frames when checking for T.38 during early media
Matthew Nicholson [Thu, 9 Jun 2011 15:10:30 +0000 (15:10 +0000)] 
don't drop any voice frames when checking for T.38 during early media

(closes issue ASTERISK-17705)
Review: https://reviewboard.asterisk.org/r/1186/
patch by oej
reported by oej

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

14 years agoSolaris compatibility fixes
Paul Belanger [Sat, 21 May 2011 05:09:09 +0000 (05:09 +0000)] 
Solaris compatibility fixes

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

14 years agoThe meetme CLI command completion leaves conferences mutex locked.
Richard Mudgett [Fri, 20 May 2011 20:38:22 +0000 (20:38 +0000)] 
The meetme CLI command completion leaves conferences mutex locked.

When issuing a meetme kick CLI command and an invalid (non-existent)
conference number is specified, pressing Tab leaves the conferences mutex
locked and, therefore, all conferences deadlock.

Add missing unlock.

(closes issue #19336)
Reported by: zvision
Patches:
      app_meetme.diff uploaded by zvision (license 798)

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

14 years agochan_sip: Destroy variables on a sip_pvt before copying vars from the sip_peer.
David Vossel [Fri, 20 May 2011 16:38:28 +0000 (16:38 +0000)] 
chan_sip: Destroy variables on a sip_pvt before copying vars from the sip_peer.

(closes issue #19202)
Reported by: wdoekes
Patches:
      issue19202_destroy_challenged_invite_chanvars.patch uploaded by wdoekes (license 717)

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

14 years agoMake sure everyone gets an unhold when a transfer succeeds
Terry Wilson [Wed, 18 May 2011 23:04:35 +0000 (23:04 +0000)] 
Make sure everyone gets an unhold when a transfer succeeds

Some phones, like the Snom phones, send a hold to the transfer target after
before sending the REFER. We need to make sure that we unhold the parties
that are being connected after the masquerade. If Local channels with the /nm
option are used when dialing the parties, hold music would still be playing on
the transfer target, even after being connected with the transferee.

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

14 years agoFix app_dial ring groups
Terry Wilson [Wed, 18 May 2011 19:56:08 +0000 (19:56 +0000)] 
Fix app_dial ring groups

Revert part of r315643. We need to remove the datastore here as well.
The code in bridging code will catch anything that app_dial might miss.

(closes issue #19311)
Reported by: mspuhler
Patches:
      issue_19311_no_answer.diff uploaded by elguero (license 37)

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

14 years agoMerged revisions 318671 via svnmerge from
Richard Mudgett [Fri, 13 May 2011 01:09:40 +0000 (01:09 +0000)] 
Merged revisions 318671 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

* The applicable fixes for v1.4 are the SIP deadlock and the in progress
masquerade check for multiple parties trying to pickup the same call.
      issue18654_v1.4.patch uploaded by rmudgett (license 664)

* Backported to v1.6.2.
      issue18654_v1.6.2.patch uploaded by rmudgett (license 664)

........
  r318671 | alecdavis | 2011-05-13 10:52:08 +1200 (Fri, 13 May 2011) | 30 lines

  Fix directed group pickup feature code *8 with pickupsounds enabled

  Since 1.6.2, the new pickupsound and pickupfailsound in features.conf cause many issues.

  1). chan_sip:handle_request_invite() shouldn't be playing out the fail/success audio, as it has 'netlock' locked.
  2). dialplan applications for directed_pickups shouldn't beep.
  3). feature code for directed pickup should beep on success/failure if configured.

  Created a sip_pickup() thread to handle the pickup and playout the audio, spawned from handle_request_invite.

  Moved app_directed:pickup_do() to features:ast_do_pickup().

  Functions below, all now use the new ast_do_pickup()
  app_directed_pickup.c:
     pickup_by_channel()
     pickup_by_exten()
     pickup_by_mark()
     pickup_by_part()
  features.c:
     ast_pickup_call()

  (closes issue #18654)
  Reported by: Docent
  Patches:
        ast_do_pickup_1.8_trunk.diff.txt uploaded by alecdavis (license 585)
  Tested by: lmadsen, francesco_r, amilcar, isis242, alecdavis, irroot, rymkus, loloski, rmudgett

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

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

14 years agoRegression after r297603 (Improve handling of REGISTER requests with multiple contact...
Richard Mudgett [Fri, 6 May 2011 17:59:05 +0000 (17:59 +0000)] 
Regression after r297603 (Improve handling of REGISTER requests with multiple contact headers.)

Uninitialized variable.

(issue #18640)

(closes issue #18785)
Reported by: pnlarsson
Patches:
      issue18785_enegaard.patch uploaded by enegaard (license 1197)

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

14 years agoRe-fix queue round-robin
Terry Wilson [Fri, 6 May 2011 07:55:21 +0000 (07:55 +0000)] 
Re-fix queue round-robin

This part of the change for r315596 was incorrect. No bridge occurs
when doing a roundrobin dial and no one answers, so this code shouldn't
have been removed.

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

14 years agochan_sip: fix broken realtime peer count, fix memory leak
Russell Bryant [Thu, 5 May 2011 18:20:29 +0000 (18:20 +0000)] 
chan_sip: fix broken realtime peer count, fix memory leak

This patch addresses two bugs in chan_sip:

1) The count of realtime peers and users was off.  The increment checked the
value of the caching option, while the decrement did not.

2) Add a missing regfree() for a regex.

(closes issue #19108)
Reported by: vrban
Patches:
      missing_regfree.patch uploaded by vrban (license 756)
      sip_object_counter.patch uploaded by vrban (license 756)

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

14 years agoDisable console colourization inside safe_asterisk checks.
Leif Madsen [Thu, 5 May 2011 14:54:46 +0000 (14:54 +0000)] 
Disable console colourization inside safe_asterisk checks.

(closes issue #19213)
Reported by: lefoyer
Patches:
      issue19213_strip_color_in_safe_asterisk-svn.patch uploaded by wdoekes (license 717)
Tested by: wdoekes, lefoyer

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

14 years agoIf sox fails when processing a voicemail, don't delete the original file.
Sean Bright [Wed, 4 May 2011 16:08:50 +0000 (16:08 +0000)] 
If sox fails when processing a voicemail, don't delete the original file.

(closes issue #18111)
Reported by: sysreq
Patches:
      issue18111_trunk.patch uploaded by seanbright (license 71)
Tested by: seanbright

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

14 years agoFixes chan_local crashs in local_fixup()
David Vossel [Tue, 3 May 2011 21:27:59 +0000 (21:27 +0000)] 
Fixes chan_local crashs in local_fixup()

Thanks OEJ for tracking down the issue and submitting the patch.

(closes issue #19053)
Reported by: oej
Tested by: oej

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

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

14 years agoBreakage from slightly before the outage; would have fixed sooner but for the outage.
Tilghman Lesher [Mon, 2 May 2011 18:25:07 +0000 (18:25 +0000)] 
Breakage from slightly before the outage; would have fixed sooner but for the outage.

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

14 years agoBackport the use of curl from 1.6.2 to make the 1.4 target work on Bamboo.
Tilghman Lesher [Wed, 27 Apr 2011 21:20:32 +0000 (21:20 +0000)] 
Backport the use of curl from 1.6.2 to make the 1.4 target work on Bamboo.

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

14 years agoPartial revert of r315671 which removed a logging statement and not a manager event.
Sean Bright [Wed, 27 Apr 2011 20:54:29 +0000 (20:54 +0000)] 
Partial revert of r315671 which removed a logging statement and not a manager event.

Reported by ibercom in #asterisk-bugs.

(issue #16033)

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

14 years agoFix our compliance with RFC 3261 section 18.2.2.
Matthew Nicholson [Wed, 27 Apr 2011 18:57:56 +0000 (18:57 +0000)] 
Fix our compliance with RFC 3261 section 18.2.2.

This change optimizes the free_via() function and removes some redundant null
checking. It also fixes compliance with RFC 3261 section 18.2.2 by always using
the port specified in the Via header for routing responses (even when maddr is
not set). Also the htons() function is now used when setting the port.
Additional documentation comments have been added in various places to make the
logic in the code clearer.

(closes issue #18951)
Reported by: jmls
Patches:
      issue18951_set_proper_port_from_via.patch uploaded by wdoekes (license 717) (modified)

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

14 years agoMake sure unregistering a peer unlinks it from the peer container
Terry Wilson [Tue, 26 Apr 2011 22:47:56 +0000 (22:47 +0000)] 
Make sure unregistering a peer unlinks it from the peer container

Instead of mostly copying the code from expire_register, just use the function
that "does the right thing".

(closes issue #16033)
Reported by: kkm
Patches:
      016033-tilgman-fixed-refcount.diff uploaded by kkm (license 888)
Tested by: kkm, tilghman, twilson

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

14 years agoAllow transfer loops without allowing forwarding loops
Terry Wilson [Tue, 26 Apr 2011 21:16:10 +0000 (21:16 +0000)] 
Allow transfer loops without allowing forwarding loops

We try to avoid the situation where two phones may be forwarded to each other
causing an infinite loop by storing each dialed interface in a channel
datastore and checking the list before dialing out. This works, but currently
breaks situations like A calls B, A transfers B to C, B transfers C to A, and A
transfers C to B. Since human interaction is happening here and not an
automated forwarding loop, it should be allowed.

This patch removes the dialed_interfaces datastore when a call is bridged (a
suggestion from the brilliant mmichelson). If a call is being bridged, it
should be safe to assume that we aren't stuck in a loop.

Since we are now handling this is the bridge code, the previous attempts at
handling it in app_dial and app_queue are removed.

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

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

14 years agoFix the bounds-checking code.
Tilghman Lesher [Tue, 26 Apr 2011 19:18:46 +0000 (19:18 +0000)] 
Fix the bounds-checking code.

The code that set the bit within the select bitfield was correct, but the
bounds-checking code was not.  The change to that line uses the new _bitsize
macro for clarity.  Also, FD_ZERO macro did not zero-out anything but the
first word of the bitfield, so this could have caused problems with modules
using that macro with the expanded bitfield.

(closes issue #18773)
 Reported by: jamicque
 Patches:
       20110423__issue18773.diff.txt uploaded by tilghman (license 14)
 Tested by: chris-mac

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

14 years agoBe more flexible with unknown chunks in wav files.
Russell Bryant [Mon, 25 Apr 2011 19:28:41 +0000 (19:28 +0000)] 
Be more flexible with unknown chunks in wav files.

This patch makes format_wav ignore unknown chunks instead of erroring
out on them.

(closes issue #18306)
Reported by: jhirsch
Patches:
      wav_skip_unknown_blocks.diff uploaded by jhirsch (license 1156)

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

14 years agoReverted part of r314607, as it can introduce a regression.
Matthew Nicholson [Mon, 25 Apr 2011 16:14:21 +0000 (16:14 +0000)] 
Reverted part of r314607, as it can introduce a regression.

Specifically, the security check for the "system" privilege was removed. If a user had the "call" privilege but not the "system" privilege, they would loose the ability to execute the system app and dialplan functions that run commands in a shell. This branch never used the "system" privilege for that purpose and did not need to be patched.

AST-2011-006

(related to issue 0018787)
Reported by: kobaz

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

14 years agochan_local:check_bridge() misplaced misplaced ast_mutex_unlock
Alec L Davis [Mon, 25 Apr 2011 07:06:29 +0000 (07:06 +0000)] 
chan_local:check_bridge() misplaced misplaced ast_mutex_unlock

if !p->chan->_bridge->_softhangup path isn't followed, brigde remains locked.

(closes issue #19176)
Reported by: alecdavis
Patches:
      bug19176.diff.txt uploaded by alecdavis (license 585)

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

14 years agoPrevent the login thread and the app threads from using the asterisk channel at the...
Matthew Nicholson [Fri, 22 Apr 2011 20:01:48 +0000 (20:01 +0000)] 
Prevent the login thread and the app threads from using the asterisk channel at the same time.

ABE-2756

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

14 years agoInitialize buffers in getvar and getvarfull.
Russell Bryant [Fri, 22 Apr 2011 14:34:23 +0000 (14:34 +0000)] 
Initialize buffers in getvar and getvarfull.

Initialize the buffers used to hold the result from GET VARIABLE or
GET VARIABLE FULL.  The bug report shows func_read returning garbage in
the result.  It assumed that the buffer passed in was initialized, like many
other functions do.  In the more common code path (through the dialplan), it
is initialized, so just initialize it here too.

(closes issue #19050)
Reported by: johnz

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

14 years agoAdded limits to the number of unauthenticated sessions TCP based protocols are allowe...
Matthew Nicholson [Thu, 21 Apr 2011 18:19:21 +0000 (18:19 +0000)] 
Added limits to the number of unauthenticated sessions TCP based protocols are allowed to have open simultaneously.  Also added timeouts for unauthenticated sessions where it made sense to do so.

Unrelated, the manager interface now properly checks if the user has the "system" privilege before executing shell commands via the Originate action.

AST-2011-005
AST-2011-006

(closes issue #18787)
Reported by: kobaz

(related to issue #18996)
Reported by: tzafrir

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

14 years agoapp_voicemail: Fix ODBC Storage compile
Alec L Davis [Tue, 19 Apr 2011 18:37:07 +0000 (18:37 +0000)] 
app_voicemail: Fix ODBC Storage compile

regression caused by me, from mantis bug #19032 / commit r312070

(closes issue #19142)
Reported by: vrban
Patches:
      app_voicemail_fix_for_312070.patch uploaded by vrban (license 756)
Tested by: vrban, alecdavis

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

14 years agoAsterisk does not hangup a channel after endpoint hangs up.
Richard Mudgett [Wed, 13 Apr 2011 16:21:24 +0000 (16:21 +0000)] 
Asterisk does not hangup a channel after endpoint hangs up.

If the call that the dialplan started an AGI script for is hungup while
the AGI script is in the middle of a command then the AGI script is not
notified of the hangup.  There are many AGI Exec commands that this can
happen with.  The reported applications have been: Background, Wait, Read,
and Dial.  Also the AGI Get Data command.

* Don't wait on the Asterisk channel after it has hung up.  The channel is
likely to never need servicing again.

* Restored the AGI script's ability to return the AGI_RESULT_HANGUP value
in run_agi().  It previously only could return AGI_RESULT_SUCCESS or
AGI_RESULT_FAILURE after the DeadAGI and AGI applications were merged.

(closes issue #17954)
Reported by: mn3250
Patches:
      issue17954_v1.8.patch uploaded by rmudgett (license 664)
      issue17954_v1.6.2.patch uploaded by rmudgett (license 664)
      issue17954_v1.4.patch uploaded by rmudgett (license 664)
Tested by: rmudgett
JIRA SWP-2171

(closes issue #18492)
Reported by: devmod
Tested by: rmudgett
JIRA SWP-2761

(closes issue #18935)
Reported by: nvitaly
Tested by: astmiv, rmudgett
JIRA SWP-3216

(closes issue #17393)
Reported by: siby
Tested by: rmudgett
JIRA SWP-2727

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

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

14 years agoFix detection of OpenSSL 1.0
Leif Madsen [Mon, 11 Apr 2011 19:30:20 +0000 (19:30 +0000)] 
Fix detection of OpenSSL 1.0

(closes issue #19093)
Reported by: tzafrir
Patches:
      detect_openssl_10.diff uploaded by tzafrir (license 46)

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

14 years agoStuck channel using FEATD_MF if caller hangs up at the right time.
Richard Mudgett [Mon, 11 Apr 2011 15:27:52 +0000 (15:27 +0000)] 
Stuck channel using FEATD_MF if caller hangs up at the right time.

The cause was actually a caller hanging up just at the end of the Feature
Group D DTMF tones that setup the call.  The reason for this is a "guard
timer" that's implemented using ast_safe_sleep(100).  If the caller
happens to hang up AFTER the final tone of the DTMF string but BEFORE the
end of that ast_safe_sleep(), then ast_safe_sleep() will return non-zero.
This causes the code to bounce to the end of ss_thread(), but it does NOT
tear down the call properly.

This should be a rare occurrence because the caller has to hang up at
EXACTLY the right time.  Nonetheless, it was happening quite regularly on
the reporter's system.  It's not easily reproducible, unless you purposely
increase the guard-time to 2000 or more.  Once you do that, you can
reproduce it every time by watching the DTMF debug and hanging up just as
it ends.

Simply add an ast_hangup() before goto quit.

(closes issue #15671)
Reported by: jcromes
Patches:
      issue15671.patch uploaded by pabelanger (license 224)
Tested by: jcromes

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

14 years agoLimit the number of unauthenticated manager sessions and also limit the time they...
Matthew Nicholson [Tue, 5 Apr 2011 14:10:34 +0000 (14:10 +0000)] 
Limit the number of unauthenticated manager sessions and also limit the time they have to authenticate.

AST-2011-005

(closes issue #18996)
Reported by: tzafrir
Tested by: mnicholson

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

14 years agoIssues with ISDN calls changing B channels during call negotiations.
Richard Mudgett [Mon, 4 Apr 2011 15:49:30 +0000 (15:49 +0000)] 
Issues with ISDN calls changing B channels during call negotiations.

The handling of the PROCEEDING message was not using the correct call
structure if the B channel was changed.  (The same for PROGRESS.) The call
was also not hungup if the new B channel is not provisioned or is busy.

* Made all call connection messages (SETUP_ACKNOWLEDGE, PROCEEDING,
PROGRESS, ALERTING, CONNECT, CONNECT_ACKNOWLEDGE) ensure that they are
using the correct structure and B channel.  If there is any problem with
the operations then the call is now hungup with an appropriate cause code.

* Made miscellaneous messages (INFORMATION, FACILITY, NOTIFY) find the
correct structure by looking for the call and not using the channel ID.
NOTIFY is an exception with versions of libpri before v1.4.11 because a
call pointer is not available for Asterisk to use.

* Made all hangup messages (DISCONNECT, RELEASE, RELEASE_COMPLETE) find
the correct structure by looking for the call and not using the channel
ID.

(closes issue #18313)
Reported by: destiny6628
Tested by: rmudgett
JIRA SWP-2620

(closes issue #18231)
Reported by: destiny6628
Tested by: rmudgett
JIRA SWP-2924

(closes issue #18488)
Reported by: jpokorny
JIRA SWP-2929

JIRA AST-437 (The issues fixed here are most likely causing this JIRA issue.)
JIRA DAHDI-406
JIRA LIBPRI-33 (Stuck resetting flag likely fixed)

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

14 years agoapp_voicemail: leave_vociemail doesn't use last_message_index to store next message
Alec L Davis [Fri, 1 Apr 2011 11:02:26 +0000 (11:02 +0000)] 
app_voicemail: leave_vociemail doesn't use last_message_index to store next message

trivial change to bring inline with 1.6.2 1.8 and trunk.
The symptom was if msg0000 was missing, and the last was msg0004,
the next msgnum would be msg0000 when it should have been msg0005

(issue #18998)
Reported by: tootai
Patches:
      bug18998.diff2.txt uploaded by alecdavis (license 585)
Tested by: alecdavis

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

14 years agoFound some leaking file descriptors while looking at ast_FD_SETSIZE dead code.
Tilghman Lesher [Fri, 1 Apr 2011 10:36:42 +0000 (10:36 +0000)] 
Found some leaking file descriptors while looking at ast_FD_SETSIZE dead code.

(issue #18969)
 Reported by: oej
 Patches:
       20110315__issue18969__14.diff.txt uploaded by tilghman (license 14)

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

14 years agovoicemail: get real last_message_index and count_messages, ODBC resequence
Alec L Davis [Fri, 1 Apr 2011 08:29:49 +0000 (08:29 +0000)] 
voicemail: get real last_message_index and count_messages, ODBC resequence

change last_message_index to read the max msgnum stored in the database
change count_messages to actually count the number of messages.

last_message_index change:
  This fixed overwriting of the last message if msgnum=0 was missing.
  Previously every incoming message would overwrite msgnum=1.
count_messages change:
  allows us to detect when requencing is required in opneA_mailbox.
resequence enabled for ODBC storage:
  Assists with fixing up corrupt databases with gaps, but only when
  a user actively opens there mailboxes.

(closes issue #18692,#18582,#19032)
Reported by: elguero
Patches:
      based on odbc_resequence_mailbox2.1.diff uploaded by elguero (license 37)
Tested by: elguero, nivek, alecdavis

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

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

14 years agoapp_voicemail:close_mailbox imap_storage doesn't use last_msg_index
Alec L Davis [Fri, 1 Apr 2011 07:47:23 +0000 (07:47 +0000)] 
app_voicemail:close_mailbox imap_storage doesn't use last_msg_index

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

14 years agoapp_voicemail: close_mailbox needs to respect additional messages while mailbox is...
Alec L Davis [Fri, 1 Apr 2011 06:46:56 +0000 (06:46 +0000)] 
app_voicemail: close_mailbox needs to respect additional messages while mailbox is open.

close_mailbox leave gaps in message sequence if messages are deleted and new messages
arrive during this time, this is because the shuffle down to slot 0, only shuffles
the number of pre-existing messages when mailbox is opened, ignoring new arrivals.

Fix: in close_mailbox re-evaluate number of messages before the shuffle, this then includes new arrivals.

Happens on filebased or ODBC storage.

(issues #19032,#18582,#18692,#18998)
Reported by: alecdavis,tootai,afosorio

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

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

14 years agoDon't hold the pvt lock while streaming a file.
Matthew Nicholson [Thu, 17 Mar 2011 19:14:37 +0000 (19:14 +0000)] 
Don't hold the pvt lock while streaming a file.

ABE-2756

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

14 years agoDon't dec the usecount of an eventqent then use it.
Matthew Nicholson [Thu, 17 Mar 2011 19:09:37 +0000 (19:09 +0000)] 
Don't dec the usecount of an eventqent then use it.

ABE-2756

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

14 years agoRemove the provisional keepalive scheduler entry's reference to the pvt when we remov...
Matthew Nicholson [Thu, 17 Mar 2011 19:06:24 +0000 (19:06 +0000)] 
Remove the provisional keepalive scheduler entry's reference to the pvt when we remove the scheduler entry.

ABE-2756

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

14 years agoRemove extra quote in indications.conf
Alec L Davis [Thu, 17 Mar 2011 10:43:35 +0000 (10:43 +0000)] 
Remove extra quote in indications.conf

Picking low hanging fruit.

(closes issue #18971)
Reported by: IgorG
Patches:
      based on indications.conf.sample.diff uploaded by IgorG (license 20)
Tested by: IgorG

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

14 years agoDon't delay DTMF in core bridge while listening for DTMF features
Terry Wilson [Wed, 16 Mar 2011 16:58:42 +0000 (16:58 +0000)] 
Don't delay DTMF in core bridge while listening for DTMF features

This patch is mostly the work of Olle Johansson. I did some cleanup and
added the silence generating code if transmit_silence is set.

When a channel listens for DTMF in the core bridge, the outbound DTMF is not
sent until we have received DTMF_END. For a long DTMF, this is a disaster. We
send 4 seconds of DTMF to Asterisk, which sends no audio for those 4 seconds.
Some products see this delay and the time skew on RTP packets that results and
start ignoring the audio that is sent afterward.

With this change, the DTMF_BEGIN frame is inspected and checked. If it matches
a feature code, we wait for DTMF_END and activate the feature as before. If
transmit_silence=yes in asterisk.conf, silence is sent if we paritally match a
multi-digit feature. If it doesn't match a feature, the frame is forwarded
along with the DTMF_END without delay. By doing it this way, DTMF is not delayed.

(closes issue #15642)
Reported by: jasonshugart
Patches:
      issue_15652_dtmf_ast-1.4.patch.txt uploaded by twilson (license 396)
Tested by: globalnetinc, jde

(closes issue #16625)
Reported by: sharvanek

Review: https://reviewboard.asterisk.org/r/1092/
Review: https://reviewboard.asterisk.org/r/1125/

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

14 years agocore show locks: display ThreadID in hexadecimal
Alec L Davis [Tue, 15 Mar 2011 00:26:09 +0000 (00:26 +0000)] 
core show locks: display ThreadID in hexadecimal

Allow easier cross referencing of thread ID's with GDB backtraces

(closes issue #18968)
Reported by: alecdavis
Patches:
      bug18968.diff.txt uploaded by alecdavis (license 585)

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

14 years ago"Caller*ID failed checksum" on Wildcard TDM2400P and TDM410
Richard Mudgett [Mon, 14 Mar 2011 16:38:24 +0000 (16:38 +0000)] 
"Caller*ID failed checksum" on Wildcard TDM2400P and TDM410

The last character in the caller id message is getting a framing error.

The checksum is the last character in the message.  A framing error in the
checksum could be because:
1) The sender did not send a full stop bit.
2) The sender cut off the FSK carrier too soon.
3) The sender opted to send zero of the specified zero to 10 trailing mark
bits and round-off errors in the code resulted in the code not being where
it thought it was in the demodulated bit stream.

Bit 8 of 'b' is set when parity error.
Bit 9 of 'b' is set when framing error.

Made ignore the framing and parity error bits if the errored character is
the checksum.  We can tolerate a framing/parity error there.  The checksum
character validates the message.

(closes issue #18474)
Reported by: nivek
Patches:
      callerid.c.1.patch uploaded by nivek (license 636) (with modifications)
Tested by: nivek

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

14 years agoAdd AELSub, which provides a stable entry point into AEL subroutines.
Tilghman Lesher [Sat, 12 Mar 2011 20:22:07 +0000 (20:22 +0000)] 
Add AELSub, which provides a stable entry point into AEL subroutines.

This commit needs some explanation, given that we're adding a new application
into an existing release branch.  This is generally a violation of our release
policy, except in very limited circumstances, and I believe this is one of
those circumstances.

The problem that this solves is one of the sanity of using multiple dialplan
languages to define a dialplan.  In the case of the reporter, he or she is
using AEL is define subroutines, while using Realtime extensions to invoke
those subroutines.  While you can do this, it's based upon the reality of AEL
using actual dialplan extensions; however, there is no guarantee that the
details of _how_ AEL is compiled into extensions will remain stable.  In fact,
at the time of this commit, it has already changed twice, once in a
fundamental way.

Now normally, a new application would only be added to trunk.  However, this
application is explicitly to create a stable user-level API between versions,
and adding it to trunk only will not solve the user's problem of switching
between 1.6.2 and 1.8, nor will it help anybody switching from 1.8 to 1.10.
Therefore, it needs to go into existing release branches.  For the sake of
consistency, and also because one of the changes was between 1.4 and 1.6.x,
I am also electing to commit this to 1.4.

(closes issue #18910)
 Reported by: alexandrekeller
 Patches:
       20110304__issue18919__1.6.2.diff.txt uploaded by tilghman (license 14)
       20110304__issue18919__1.4.diff.txt uploaded by tilghman (license 14)
 Tested by: alexandrekeller

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

14 years agoInitialize column size to 0 to deal with a potential UnixODBC bug on 64-bit systems.
Tilghman Lesher [Thu, 10 Mar 2011 05:38:44 +0000 (05:38 +0000)] 
Initialize column size to 0 to deal with a potential UnixODBC bug on 64-bit systems.

(closes issue #18295)
 Reported by: pruiz

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

14 years agoDon't try to free statically allocated memory.
Terry Wilson [Tue, 8 Mar 2011 02:42:00 +0000 (02:42 +0000)] 
Don't try to free statically allocated memory.

Note: compiling after ./configure --enable-dev-mode will keep these
kinds of mistakes from being committed.

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

14 years agoBug fix for MixMonitor involving filenames with '.' not in the extension
Jonathan Rose [Mon, 7 Mar 2011 22:02:12 +0000 (22:02 +0000)] 
Bug fix for MixMonitor involving filenames with '.' not in the extension

Closes issue #18391)
Reported by: pabelanger
Patches:
      bugfix.patch uploaded by jrose (license 1225)
Tested by: jrose

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

14 years agofix small memory leak
David Ruggles [Fri, 4 Mar 2011 00:34:13 +0000 (00:34 +0000)] 
fix small memory leak

fix small memory leak caused by a string allocation that wasn't freed

(closes issue #18907)
Reported by: andy11
Patches:
      asterisk_trunk-app_externalivr-leak.patch uploaded by andy11 (license 1224)

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

14 years agoDon't broadcast FullyBooted to every AMI connection
Terry Wilson [Thu, 24 Feb 2011 17:42:16 +0000 (17:42 +0000)] 
Don't broadcast FullyBooted to every AMI connection

The FullyBooted event should not be sent to every AMI connection every
time someone connects via AMI. It should only be sent to the user who
just connected.

(closes issue #18168)
Reported by: FeyFre
Patches:
      bug0018168.patch uploaded by FeyFre (license 1142)
Tested by: FeyFre, twilson

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

14 years agosilence gcc 4.2 compiler warning
Matthew Nicholson [Thu, 24 Feb 2011 14:54:56 +0000 (14:54 +0000)] 
silence gcc 4.2 compiler warning

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

14 years agoProperly check the bounds of arrays when decoding UDPTL packets. Also, remove broken...
Matthew Nicholson [Mon, 21 Feb 2011 14:57:15 +0000 (14:57 +0000)] 
Properly check the bounds of arrays when decoding UDPTL packets.  Also, remove broken support for receiving UDPTL packets larger than 16k.  That shouldn't ever happen anyway.

AST-2011-002
FAX-281

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

14 years agoFix regression that changed behavior of queues when ringing a queue member.
Jason Parker [Tue, 15 Feb 2011 23:32:20 +0000 (23:32 +0000)] 
Fix regression that changed behavior of queues when ringing a queue member.

This reverts r298596, which was to fix a highly bizarre and contrived issue
with a queue member that called into his own queue being transferred back
into his own queue.  I couldn't reproduce that issue in any way.  I think one
of the other recent transfer fixes actually fixed this.

(closes issue #18747)
Reported by: vrban

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

14 years agoReentrancy problem if outgoing call gets different B channel than requested.
Richard Mudgett [Fri, 11 Feb 2011 00:29:17 +0000 (00:29 +0000)] 
Reentrancy problem if outgoing call gets different B channel than requested.

The chan_dahdi pri_fixup_principle() routine needs to protect the Asterisk
channel with the channel lock when it changes the technology private
pointer to a new private structure.

* Added lock protection while pri_fixup_principle() moves a call from one
private structure to another.

* Made some pri_fixup_principle() messages more meaningful.

Partial backport from v1.8 -r300714.

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

14 years agoRemove color when executing commands via a remote console.
Jason Parker [Thu, 10 Feb 2011 22:33:09 +0000 (22:33 +0000)] 
Remove color when executing commands via a remote console.

Essentially this makes '-x' imply '-n' on rasterisk.  This was done in a
different and incomplete way previously, which I'll be reverting shortly.

(issue #18776)
Reported by: alecdavis

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

14 years agoFix comparison for REFER Replaces tags with pedantic=yes
Terry Wilson [Tue, 8 Feb 2011 20:05:13 +0000 (20:05 +0000)] 
Fix comparison for REFER Replaces tags with pedantic=yes

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

14 years agofix this line again
Jeff Peeler [Tue, 8 Feb 2011 19:40:58 +0000 (19:40 +0000)] 
fix this line again

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

14 years agoclean this up, sorry my brain is not really working
Jeff Peeler [Tue, 8 Feb 2011 19:28:58 +0000 (19:28 +0000)] 
clean this up, sorry my brain is not really working

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

14 years agoBackup file storing message duration is not used with IMAP_STORAGE, remove code.
Jeff Peeler [Tue, 8 Feb 2011 19:18:50 +0000 (19:18 +0000)] 
Backup file storing message duration is not used with IMAP_STORAGE, remove code.

The message duration is stored in the body of the email when using IMAP_STORAGE,
so nothing needs to happen with the backup file.

(closes issue #18718)
Reported by: kerframil

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

14 years agomake this safer and fully correct, pointed out by Steve Davis
Jeff Peeler [Tue, 8 Feb 2011 16:19:17 +0000 (16:19 +0000)] 
make this safer and fully correct, pointed out by Steve Davis

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

14 years agoDon't try to pickup a call in the middle of a masquerade
Terry Wilson [Mon, 7 Feb 2011 22:35:20 +0000 (22:35 +0000)] 
Don't try to pickup a call in the middle of a masquerade

If A calls B which doesn't answer and C & D both try to do a call pickup, it is
possible for ast_pickup_call to answer the call, then fail to masquerade one of
the calls because the other one is already in the process of masquerading. This
patch checks to see if the channel is in the process of masquerading before
call before selecting it for a pickup.

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

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

14 years agoDon't allow a REFER w/replaces to replace its own dialog
Terry Wilson [Mon, 7 Feb 2011 21:51:43 +0000 (21:51 +0000)] 
Don't allow a REFER w/replaces to replace its own dialog

Asterisk currently accepts a REFER with a Refer-To with an embedded Replaces
header that matches the dialog of the REFER. This would be a situation like A
calls B, A calls C, A transfers B to A, which is just silly. This patch makes
the transfer fail instead of making Asterisk freak out and forget to hang other
channels up.

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

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

14 years agoFix no MOH and frame queueing problem for parked calls.
Jeff Peeler [Thu, 3 Feb 2011 20:43:59 +0000 (20:43 +0000)] 
Fix no MOH and frame queueing problem for parked calls.

This was a regression introduced when select was changed to poll and was
just a conversion error: POLLPRI detects OOB data, not POLLERR.

(closes issue #18637)
Reported by: jvandal

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

14 years agoSet hangup cause in local_hangup
Terry Wilson [Thu, 3 Feb 2011 20:36:34 +0000 (20:36 +0000)] 
Set hangup cause in local_hangup

When a call involves a local channel (like SIP -> Local -> SIP), the hangup
cause was not being set. This resulted in SIP channels sometimes getting a
503 error instead of a 486 when the far side sent a busy. In Asterisk 1.8+
this also can cause issues with CCSS that involve a local channel. This patch
sets the hangupcause for one side of the local channel to the other in
local_hangup for outbound calls.

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

14 years agoMinor AST_FRAME_TEXT related issues.
Richard Mudgett [Thu, 3 Feb 2011 00:02:43 +0000 (00:02 +0000)] 
Minor AST_FRAME_TEXT related issues.

* Include the null terminator in the buffer length.  When the frame is
queued it is copied.  If the null terminator is not part of the frame
buffer length, the receiver could see garbage appended onto it.

* Add channel lock protection with ast_sendtext().

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

14 years agoClose file descriptor for timing source when a MOH class gets destroyed.
Jason Parker [Tue, 1 Feb 2011 17:00:55 +0000 (17:00 +0000)] 
Close file descriptor for timing source when a MOH class gets destroyed.

(closes issue #18457)
Reported by: mcallist
Patches:
      18457-closetimer.diff uploaded by qwell (license 4)
      18457-closetimer_trunk.diff uploaded by qwell (license 4)
Tested by: qwell, loloski

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

14 years agoObtain the pri lock for PRI queue counters.
Richard Mudgett [Mon, 31 Jan 2011 23:45:58 +0000 (23:45 +0000)] 
Obtain the pri lock for PRI queue counters.

Need to obtain the pri lock when calling pri_dump_info_str() to avoid a
reentrancy problem when calculating the Q.921 Q count statistic.

JIRA AST-484

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

14 years agoPrevent a crash when dialing a technology with no destination (ex: Dial(SIP/))
Jason Parker [Mon, 31 Jan 2011 22:56:54 +0000 (22:56 +0000)] 
Prevent a crash when dialing a technology with no destination (ex: Dial(SIP/))

chan_iax2 and other channel drivers already had code to prevent this.  The
attempt that app_dial was making to prevent it was not correct, so I fixed that.

(closes issue #18371)
Reported by: gbour
Patches:
      18371.patch uploaded by gbour (license 1162)

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

14 years agoSet file descriptors to -1 on creation, so that we don't see weirdness later.
Jason Parker [Mon, 31 Jan 2011 20:56:25 +0000 (20:56 +0000)] 
Set file descriptors to -1 on creation, so that we don't see weirdness later.

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

14 years agoFix compilation when ODBC_STORAGE is defined.
Tilghman Lesher [Mon, 31 Jan 2011 06:54:45 +0000 (06:54 +0000)] 
Fix compilation when ODBC_STORAGE is defined.

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

14 years agoBackport MeetMe related reference leaks fixes from 1.6.2/1.8/trunk.
Sean Bright [Sat, 29 Jan 2011 21:48:30 +0000 (21:48 +0000)] 
Backport MeetMe related reference leaks fixes from 1.6.2/1.8/trunk.

I had forgotten that MeetMe in 1.4 also used astobj2, so backport the fixes
where appropriate.

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

14 years agoFix default prefix=/usr regression on non-Linux systems.
Jason Parker [Thu, 27 Jan 2011 16:57:46 +0000 (16:57 +0000)] 
Fix default prefix=/usr regression on non-Linux systems.

This partially reverts a change made in branches/1.4/ r267759, which will
cause issue #17013 to be reopened.  This issue was pointed out by a user
on #asterisk, who helpfully discovered that paths were being set incorrectly.

To truly understand what was wrong, one should run:
    svn diff --force -c<this revision> configure

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

14 years agoRerun bootstrap.sh with no changes, so that it is more obvious what my next commit...
Jason Parker [Thu, 27 Jan 2011 16:47:03 +0000 (16:47 +0000)] 
Rerun bootstrap.sh with no changes, so that it is more obvious what my next commit changes.

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

14 years agoConvert from network to host byte ordering before checking if an IP is a multicast...
Matthew Nicholson [Wed, 26 Jan 2011 21:00:15 +0000 (21:00 +0000)] 
Convert from network to host byte ordering before checking if an IP is a multicast address.

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

14 years agoGet rid of unused 'verbose' field in ast_udptl
Mark Michelson [Wed, 26 Jan 2011 20:38:37 +0000 (20:38 +0000)] 
Get rid of unused 'verbose' field in ast_udptl

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

14 years agoThis patch modifies chan_sip to route responses to the address the request came from...
Matthew Nicholson [Wed, 26 Jan 2011 20:38:22 +0000 (20:38 +0000)] 
This patch modifies chan_sip to route responses to the address the request came from.  It also modifies chan_sip to respect the maddr parameter in the Via header.

ABE-2664

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

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

14 years agoMake sure the sample queues.conf is properly commented.
Sean Bright [Wed, 26 Jan 2011 20:18:29 +0000 (20:18 +0000)] 
Make sure the sample queues.conf is properly commented.

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

14 years agoDTMF attended transfers sometimes fail for no apparent reason.
Richard Mudgett [Tue, 25 Jan 2011 23:21:09 +0000 (23:21 +0000)] 
DTMF attended transfers sometimes fail for no apparent reason.

The loop in feature_request_and_dial() can exit when Party C has answered
without processing an AST_CONTROL_ANSWER.  Also sometimes an
AST_CONTROL_ANSWER never happens even though Party C has answered.

Don't hangup Party C if he is up or we receive an AST_CONTROL_ANSWER.

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

14 years agoGuard against retransmitting BYEs indefinitely
Terry Wilson [Tue, 25 Jan 2011 20:50:59 +0000 (20:50 +0000)] 
Guard against retransmitting BYEs indefinitely

In the case of an attended transfer (A calls B, A atxfers to C) where
A becomes unreachable before replying to Asterisk's BYE, Asterisk can
sometimes retransmit the BYE indefinitely. This is because
__sip_autodestruct tests p->refer && !ast_test_flag(&p->flags[0],
SIP_ALREADYGONE and will then transmit a BYE. When this BYE times out,
it will not ever be marked as ALREADYGONE, so when __sip_autodestruct
is called again, we end up starting the cycle over.

This patch adds a call to sip_alreadygone(pkt->owner) in retrans_pkt
in the case of a BYE that has timed out. This should prevent Asterisk
from trying to transmit new BYE messages in the future.

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

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

14 years agoSending out unnecessary PROCEEDING messages breaks overlap dialing.
Richard Mudgett [Tue, 25 Jan 2011 17:36:50 +0000 (17:36 +0000)] 
Sending out unnecessary PROCEEDING messages breaks overlap dialing.

Issue #16789 was a good idea.  Unfortunately, it breaks overlap dialing
through Asterisk.  There is not enough information available at this point
to know if dialing is complete.  The ast_exists_extension(),
ast_matchmore_extension(), and ast_canmatch_extension() calls are not
adequate to detect a dial through extension pattern of "_9!".

Workaround is to use the dialplan Proceeding() application early in
non-dial through extensions.

* Effectively revert issue #16789.

* Allow outgoing overlap dialing to hear dialtone and other early media.
A PROGRESS "inband-information is now available" message is now sent after
the SETUP_ACKNOWLEDGE message for non-digital calls.  An
AST_CONTROL_PROGRESS is now generated for incoming SETUP_ACKNOWLEDGE
messages for non-digital calls.

* Handling of the AST_CONTROL_CONGESTION in chan_dahdi/sig_pri was
inconsistent with the cause codes.

* Added better protection from sending out of sequence messages by
combining several flags into a single enum value representing call
progress level.

* Added diagnostic messages for deferred overlap digits handling corner
cases.

(closes issue #17085)
Reported by: shawkris

(closes issue #18509)
Reported by: wimpy
Patches:
      issue18509_early_media_v1.8_v3.patch uploaded by rmudgett (license 664)
      Expanded upon issue18509_early_media_v1.8_v3.patch to include analog
      and SS7 because of backporting requirements.
Tested by: wimpy, rmudgett

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

14 years agoBackport the Proceeding application.
Richard Mudgett [Tue, 25 Jan 2011 17:31:18 +0000 (17:31 +0000)] 
Backport the Proceeding application.

Added in trunk -r129399.

Enable the workaround for issue #17085 and #18509.

(issue #17085)
(issue #18509)

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

14 years agoFix voicemail sequencing for file based storage.
Jeff Peeler [Tue, 25 Jan 2011 16:58:29 +0000 (16:58 +0000)] 
Fix voicemail sequencing for file based storage.

A previous change was made to account for when the number of voicemail messages
exceeds the max limit to be handled properly, but it caused gaps in the messages
to not be properly handled. This has now been resolved.

In later non 1.4 branches, it appears that resequencing wasn't even occurring
due from what appears and accidental code removal.

(closes issue #18498)
Reported by: JJCinAZ
Patches:
      bug18498v2.patch uploaded by jpeeler (license 325)

(closes issue #18486)
Reported by: bluefox
Patches:
      bug18486.patch uploaded by jpeeler (license 325)

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

14 years agoFix a couple of mistakes in the backport of this patch to 1.4.
Russell Bryant [Mon, 24 Jan 2011 20:57:42 +0000 (20:57 +0000)] 
Fix a couple of mistakes in the backport of this patch to 1.4.

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

14 years agoFix channel redirect out of MeetMe() and other issues with channel softhangup.
Russell Bryant [Mon, 24 Jan 2011 20:32:21 +0000 (20:32 +0000)] 
Fix channel redirect out of MeetMe() and other issues with channel softhangup.

Mantis issue #18585 reports that a channel redirect out of MeetMe() stopped
working properly.  This issue includes a patch that resolves the issue by
removing a call to ast_check_hangup() from app_meetme.c.  I left that in my
patch, as it doesn't need to be there.  However, the rest of the patch fixes
this problem with or without the change to app_meetme.

The key difference between what happens before and after this patch is the
effect of the END_OF_Q control frame.  After END_OF_Q is hit in ast_read(),
ast_read() will return NULL.  With the ast_check_hangup() removed, app_meetme
sees this which causes it to exit as intended.  Checking ast_check_hangup()
caused app_meetme to exit earlier in the process, and the target of the
redirect saw the condition where ast_read() returned NULL.

Removing ast_check_hangup() works around the issue in app_meetme, but doesn't
solve the issue if another application did the same thing.  There are also
other edge cases where if an application finishes at the same time that a
redirect happens, the target of the redirect will think that the channel hung
up.  So, I made some changes in pbx.c to resolve it at a deeper level.  There
are already places that unset the SOFTHANGUP_ASYNCGOTO flag in an attempt to
abort the hangup process.  My patch extends this to remove the END_OF_Q frame
from the channel's read queue, making the "abort hangup" more complete.  This
same technique was used in every place where a softhangup flag was cleared.

(closes issue #18585)
Reported by: oej
Tested by: oej, wedhorn, russell

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

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

14 years agoReset configuration before parsing users.conf.
Jason Parker [Fri, 21 Jan 2011 21:45:34 +0000 (21:45 +0000)] 
Reset configuration before parsing users.conf.

Some values configured in chan_dahdi.conf were able to leak in to users.conf
configuration.  This was surprising users, and potentially setting non-sane
"defaults".

ASTNOW-125

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

14 years agoAdd new queue strategy to preserve behavior for when queue members moved to ao2.
Jeff Peeler [Thu, 20 Jan 2011 17:04:08 +0000 (17:04 +0000)] 
Add new queue strategy to preserve behavior for when queue members moved to ao2.

Add queue strategy called "rrordered" to mimic old behavior from when queue
members were stored in a linked list.

ABE-2707

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

14 years agoOption L() is milliseconds, not seconds.
Leif Madsen [Thu, 20 Jan 2011 15:38:33 +0000 (15:38 +0000)] 
Option L() is milliseconds, not seconds.
Change the verbose output of option L() to say milliseconds and not seconds
as the value is in milliseconds.

(closes issue #18264)
Reported by: jacco
Patches:
      app_dial_patch.txt uploaded by lmadsen (license 10)
Tested by: lmadsen, jacco

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

14 years agoDTMF transfer plays the wrong sounds for wrong number or other call failure.
Richard Mudgett [Wed, 19 Jan 2011 21:21:56 +0000 (21:21 +0000)] 
DTMF transfer plays the wrong sounds for wrong number or other call failure.

* Set the default for features.conf.sample xferfailsound option to "beeperr"
as documented instead of "pbx-invalid" and corrected the use of it in DTMF
blind transfer (#1).

* Improved DTMF blind transfer handling of wrong numbers.

Most of the concerns in this issue were taken care of by the patch for
issue 17999: Issues with DTMF triggered attended transfers.

(closes issue #18379)
Reported by: gincantalupo
Tested by: rmudgett

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

14 years agoAdd some API documentation
Tilghman Lesher [Wed, 19 Jan 2011 21:20:28 +0000 (21:20 +0000)] 
Add some API documentation

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

14 years agoURI encode the user part of the contact header.
Matthew Nicholson [Tue, 18 Jan 2011 21:35:03 +0000 (21:35 +0000)] 
URI encode the user part of the contact header.

ABE-2705

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