Commit Graph

14300 Commits

Author SHA1 Message Date
Leif Madsen
3bf0d87c91 Use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.39-rc1@298183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4.39-rc1
2010-12-13 15:44:12 +00:00
Leif Madsen
f872771495 Importing release summary for 1.4.39-rc1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.39-rc1@298182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 15:44:09 +00:00
Leif Madsen
2d0334266b Importing files for 1.4.39-rc1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.39-rc1@298181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 15:44:07 +00:00
Leif Madsen
151c821088 Creating tag for the release of asterisk-1.4.39-rc1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.39-rc1@298180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 15:42:40 +00:00
Leif Madsen
c1ef773b1b Use autotagged externals
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.39-rc1@298178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 15:37:42 +00:00
Leif Madsen
abb64008e8 Importing release summary for 1.4.39-rc1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.39-rc1@298177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 15:37:32 +00:00
Leif Madsen
607347617b Importing files for 1.4.39-rc1 release.
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.39-rc1@298176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 15:37:30 +00:00
Leif Madsen
33673b499b Creating tag for the release of asterisk-1.4.39-rc1
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.4.39-rc1@298175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-13 15:35:47 +00:00
Terry Wilson
d7877331c0 Ignore spurious REGISTER requests
If a REGISTER request with a Call-ID matching an existing transaction is received
it was possible that the REGISTER request would overwrite the initreq of the
private structure. This info is used to generate messages for other responses in
the transaction. This patch ignores REGISTER requests that match non-REGISTER
transactions.

(closes issue #18051)
Reported by: eeman
Tested by: twilson

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-09 22:00:30 +00:00
Jeff Peeler
cd535276c1 Revert code that changed SSRC for DTMF.
Some previous behavior was attempted to be restored, but mistakingly I did
not realize that the previous behavior was incorrect. This fixes DTMF not
being detected since DTMF shouldn't cause the SSRC to change.

(related to issue #17404)
(closes issue #18189)
(closes issue #18352)
Reported by: marcbou
Tested by: cmbaker82


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-07 22:57:48 +00:00
Tilghman Lesher
f614a52b52 Use non-deprecated APIs for CoreAudio
Review: https://reviewboard.asterisk.org/r/1040/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297818 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-07 22:35:50 +00:00
Sean Bright
0135ff19ed Avoid a crash if we don't pass an argument to 'astobj2 test.'
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-07 15:23:18 +00:00
Tilghman Lesher
4369b3c4ae Don't create a Local channel if the target extension does not exist.
(closes issue #18126)
 Reported by: junky
 Patches: 
       followme.diff uploaded by junky (license 177)
       (partially restructured by me to avoid a possible memory leak)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-07 00:07:37 +00:00
Jeff Peeler
919ad38940 Improve handling of REGISTER requests with multiple contact headers.
The changes here attempt to more strictly follow RFC 3261 section 10.3.
Basically the following will now cause a 400 Bad Response to be returned, if:
- multiple Contact headers are present with one set to expire all bindings ("*")
- wildcard parameter is specified for Contact without Expires header or Expires
  header is not set to zero.

ABE-2442
ABE-2443



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-06 21:57:15 +00:00
Paul Belanger
449a5e22fb Resolve compile error under FreeBSD
We now set _ASTCFLAGS+=-march=i686 for i386 processors, still allowing ASTCFLAGS
to override the setting.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-02 20:01:08 +00:00
Terry Wilson
59db525cc0 Initialize offset for adaptive jitter buffer
When the adaptive jitter buffer is enabled in sip.conf, the first frame placed
in the jitter buffer fails with something like:

jb_warning_output: Resyncing the jb. last_delay 0, this delay -215886466,
threshold 1000, new offset 215886466

This happens because the offset is not initialized before calling jb_put(). This
patch modifies jb_put_first_adaptive() to set the offset to the frame's
timestamp.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-02 18:00:27 +00:00
Russell Bryant
92ea2179e5 Add "DAHDI" to a couple of app_meetme error messages.
This is in response to some questions on IRC.  To the user, there was nothing
that made it obvious that this error had anything to do with DAHDI not being
loaded.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297228 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-02 13:16:15 +00:00
Olle Johansson
8b2304108a If we get a NOTIFY from a non-existing subscription we should answer with 481, not bad event.
If we answer 481 the subscription that we don't want will be cancelled.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297185 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-02 08:37:17 +00:00
Jeff Peeler
046f56ce1c Fix not stopping MOH when transfered local channel queue member is answered.
The problem here is only present when local channels are used with the MOH
passthru option as well as no optimization (/nm). I will describe the slightly
bizarre scenario that was used to test, where phones B and C are queue members:

Phone A dials into a queue with two members using local channels and the above
options. Phone B answers. Phone A blind transfers phone B into the same queue.
Phone A hangs up. Phone C answers, but phone B didn't stop playing MOH.

In this scenario, the unhold frame that should have gotten to phone B never
arrived due to the masquerade from the blind transfer. This is usually fine
since app_queue manages the starting and stopping of MOH. However, with the
passthrough option enabled when app_queue attempts to stop MOH it tries to do
so on the local channel rather than the real channel. The easiest solution
was to just make sure to send an unhold frame during the transfer since it
wouldn't make sense to have MOH playing after a transfer anyway. This only
modifies SIP transfers, but the other transfers did not seem to be a problem.
If DTMF based transfers were a problem it might be okay to add ast_moh_stop
to finishup, but I didn't want to have to add that unless required.

ABE-2624


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@297072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-01 17:50:09 +00:00
Tilghman Lesher
415e95df9a Clarify documentation on how we store codec preference lists.
(closes issue #18397)
 Reported by: birgita


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@296990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-01 16:59:26 +00:00
Jeff Peeler
25c2ccaac3 Properly restore backup information file when hanging up during message prepending.
ABE-2654


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@296868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-01 00:23:19 +00:00
Tilghman Lesher
196032208f Get rid of the annoying startup and shutdown errors on OS X.
This mainly deals with the problem of constructors on platforms where an
explicit constructor order cannot be specified (any system with gcc 4.2
or less).  However, this is only a problem on those systems where we need
to initialize mutexes with a constructor, because we have other code that
also relies upon constructors, and we cannot specify that mutexes are
initialized first (and destroyed last).

There are two approaches to dealing with this issue, related to whether the
code exists in the core Asterisk binary or in a separate code module.  In the
core case, constructors are run immediately upon load, and the file_versions
list mutex needs to be already initialized, as it is referenced in the first
constructor within each core source file.  In this case, we use pthread_once
to ensure that the mutex is initialized immediately before it is used for the
first time.  The only caveat is that the mutex is not ever destroyed, but
because this is the core, it makes no real difference; the only time when
destruction is safe would be just prior to process destruction, which takes
care of that anyway.  And due to using pthread_once, the mutex will never be
reinitialized, which means only one structure has leaked at the end of the
process.  Hence, it is not a problematic leak.

The second approach is to use the load_module and unload_module routines,
which, for obvious reasons, exist only in loadable modules.  In this second
case, we don't have a problem with the constructors, but only with destructor
order, because mutexes can be destroyed before their final usage is employed.
However, we need the mutexes to still be destroyed, in certain scenarios:  if
the module is unloaded prior to the process ending, it should be clean, with
no allocations by the module hanging around after that point in time.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@296867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-01 00:20:05 +00:00
Paul Belanger
728bb5ac67 Make sure nothing else is needed before destroying the scheduler.
(closes issue #18398)
Reported by: pabelanger


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@296670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-29 22:49:39 +00:00
Olle Johansson
0876c9fbe1 Fix bugs in saying numbers using the Swedish language syntax
(closes issue #18355)
Reported by: oej
Patch by: oej

Much help from Peter Lindahl. Testing by the ClearIT team during a coffee break.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@296309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-26 09:53:31 +00:00
Russell Bryant
f95e212afc Make Asterisk less crashy.
Since we might not put a new translation path on the channel, go ahead and
set it to NULL right after destroying the old one to ensure we don't try
to free an invalid translation path later on.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@296213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-24 23:26:43 +00:00
Richard Mudgett
c98862958a Oneway audio to SIP phone from FXS port after FXS port gets a CallWaiting pip.
The FXS connected phone has to have CW/CID support to fail, as it will
send back a DTMF 'A' or 'D' when it's ready to receive CallerID.  A normal
phone with no CID never fails.  Also the SIP phone does not hear MOH when
the CW call is answered.

The DTMF end frame is suppressed when the phone acknowledges the CW signal
for CID.  The problem is the DTMF begin frame needs to be suppressed as
well.  The DTMF begin frame is causing SIP to start sending the DTMF RTP
frames.  Since the DTMF end frame is suppressed, SIP will not stop sending
those DTMF RTP packets.

* Suppress the DTMF begin and end frames when the channel driver is
looking for DTMF digits.

* Fixed a couple issues caused by not cleaning up the CID spill if you
answer the CW call while it is sending the CID spill.

* Fixed not sending CW/CID spill to the phone when the call is natively
bridged.  (Fixed by not using native bridge if CW/CID is possible.)

* Suppress received audio when sending CW/CID spills.  The other parties
involved do not need to hear the CW/CID spills and may be confused if the
CW call is for them.

(closes issue #18129)
Reported by: alecdavis
Patches:
      issue_18129_v1.8_v3.patch uploaded by rmudgett (license 664)
Tested by: alecdavis, rmudgett


NOTE:

* v1.4 does not have the main problem fixed by suppressing the DTMF start
frames.  The other three items fixed are relevant.

* If you really must restore native bridging between analog ports, you
need to disable CW/CID either by configuring chan_dahdi.conf
callwaitingcallerid=no or dialing *70 before dialing the number to
temporarily disable CW.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@296165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-24 22:41:07 +00:00
Russell Bryant
41656ad0bf Fix false reporting of an error by set_format().
In the case that the native format was able to be changed to match the
new requested format, the code proceeded to attempt to build a translation
path, anyway.  The result would be NULL, since no translation path is
necessary and resulted in this function thinking an error has occurred.
This case is now specifically caught and no attempt to build a translation
path is attempted.

Thanks to our automated tests and bamboo.asterisk.org for catching this problem
and making a whole lot of noise when things started failing.  :-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@296082 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-24 20:22:32 +00:00
Russell Bryant
72d3cd8b47 Handle failures building translation paths more effectively.
The problem scenario occurred on a heavily loaded system that was using the
codec_dahdi module and exceeded the hardware transcoding capacity.  The failure
mode at that point was not good.  The report came in to us as an Asterisk
lock-up.  The "core show locks" shows a ton of threads locked up (but no
obvious deadlock).  Upon deeper investigation, when the system is in this
state, the CPU was maxed out.  The CPU was being consumed by the Asterisk
logger spewing messages on every audio frame for calls set up after transcoder
capacity was reached.

The purpose of this patch is to make Asterisk handle failures to create a
translation path in a more graceful manner.  If we can't translate, then the
call just needs to be dropped, as it's not going to work.  These are the
changes:

1) In set_format() of channel.c (which is called by set_read_format() and
set_write_format()), it was ignoring if ast_translator_build_path() failed and
returned NULL.  It now pays attention to that case and returns a result
reflecting failure.  With this change in place, the bridging code will
immediately detect a failure and end the bridge instead of proceeding to try to
bridge frames that can't be translated and making channel drivers freak out by
sending them frames in a format they weren't expecting.

2) In ast_indicate_data() of channel.c, failure of ast_playtones_start() was
ignored.  It is now reflected in the return value of the function.  This didn't
turn out to have any affect on the bug, but seemed like a good change to leave
in.

3) In app_dial(), when only sending a call to a single endpoint, it will
attempt to do some bridging of its own of early audio.  It uses
make_compatible() when it's going to do this.  However, it ignored failure from
make compatible.  So, even with the fix from #1, if there was early audio going
through app_dial, there would still be a period of invalid frames passing
through.  After detecting failure here, Dial() exits.

ABE-2658


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@296000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-24 16:48:39 +00:00
Olle Johansson
74270307c9 Fix support of saynumber(1,n) in the Swedish language
(closes issue #18353)
Reported by: oej

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@295906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-23 09:28:14 +00:00
Richard Mudgett
d32582d42f The channel redirect function (CLI or AMI) hangs up the call instead of redirecting the call.
To recreate the problem:
1) Party A calls Party B
2) Invoke CLI "channel redirect" command to redirect channel call leg
associated with A.
3) All associated channels are hung up.

Note that if the CLI command were done on the channel call leg associated
with B it works.

This regression was a result of the fix for issue #16946
(https://reviewboard.asterisk.org/r/740/).

The regression affects all features that use an async goto to execute the
dialplan because of an external event: Channel redirect, AMI redirect, SIP
REFER, and FAX detection.

The struct ast_channel._softhangup code is a mess.  The variable is used
for several purposes that do not necessarily result in the call being hung
up.  I have added doxygen comments to describe how the various _softhangup
bits are used.  I have corrected all the places where the variable was
tested in a non-bit oriented manner.

The primary fix is the new AST_CONTROL_END_OF_Q frame.  It acts as a weak
hangup request so the soft hangup requests that do not normally result in
a hangup do not hangup.

JIRA SWP-2470
JIRA SWP-2489

(closes issue #18171)
Reported by: SantaFox
(closes issue #18185)
Reported by: kwemheuer
(closes issue #18211)
Reported by: zahir_koradia
(closes issue #18230)
Reported by: vmarrone
(closes issue #18299)
Reported by: mbrevda
(closes issue #18322)
Reported by: nerbos

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@295790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-22 18:46:26 +00:00
Terry Wilson
62d947a168 Discard responses with more than one Via
This is not a perfect solution as headers that are joined via commas are not
detected. This is a parsing issue that to fix "correctly" would necessitate 
a new SIP parser.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@295628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-19 20:53:36 +00:00
Erin Spiceland
28922df829 Revert a new feature which should have gone into trunk.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@295553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-19 19:32:04 +00:00
Erin Spiceland
fa62a9700a Add extra functionality to AGI command WAIT FOR DIGIT.
Add the ability to play a sound file, listen for more than just one digit, specify
escape characters. Backwards compatible (to work with only timeout specified).

(closes issue #15531)
Reported by: diLLec
Patches:
      asterisk-res_agi-203638-patched.patch uploaded by diLLec (license 839)
Tested by: diLLec, espiceland



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@295552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-19 19:24:05 +00:00
Richard Mudgett
b174c8f30e Dead code elimination in channel.c:ast_channel_bridge() variable who.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@295280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-16 22:52:06 +00:00
Jeff Peeler
3fc98d5530 Ensure original message duration is preserved when prepending a message.
It seems the fix to issue 17103 was a little overzealous and removed the code
that backed up the textfile containing the original message duration. This 
code has now been restored.

(related to issue #17103)
ABE-2654


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@295200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-16 21:29:29 +00:00
Tilghman Lesher
e36e50146a Err, oops. Made it const to verify that it wasn't altered, but forgot to revert before commit.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@295031 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-15 18:05:49 +00:00
Tilghman Lesher
0cab9a1db8 Create test verifying results of expression parser
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@295026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-15 17:58:37 +00:00
Jeff Peeler
fe1ca1a8da Fix regression causing abort in voicemail after opening a mailbox with no mesgs.
In order to be more safe, some error handling code was changed to respect more
error conditions including the potential memory allocation failure for deleted
and heard message tracking introduced in 293004. However, last_message_index
returns -1 for zero messages (perhaps as expected) and was triggering the
stricter error checking. Because last_message_index is only called directly
in one place, just return 0 from open_mailbox (for file based storage) when no
messages are detected unless a real error has occurred.

(closes issue #18240)
Reported by: leobrown
Patches: 
      bug18240.1-6-2.diff.txt uploaded by alecdavis (license 585)
Tested by: pabelanger


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@294903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-12 20:49:09 +00:00
Richard Mudgett
156f8c7d62 Asterisk is getting a "No D-channels available!" warning message every 4 seconds.
Asterisk is just whining too much with this message: "No D-channels
available!  Using Primary channel XXX as D-channel anyway!".

Filtered the message so it only comes out once if there is no D channel
available without an intervening D channel available period.

(closes issue #17270)
Reported by: jmls


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@294821 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-12 02:41:13 +00:00
Jeff Peeler
676cb0993b I didn't mean to merge this, sorry
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@294739 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-11 22:11:33 +00:00
Jeff Peeler
ae7edf9a55 Fix problem with qualify option packets for realtime peers never stopping.
The option packets not only never stopped, but if a realtime peer was not in
the peer list multiple options dialogs could accumulate over time. This
scenario has the potential to progress to the point of saturating a link just
from options packets. The fix was to ensure that the poke scheduler checks to
see if a peer is in the peer list before continuing to poke. The reason a peer
must be in the peer list to be able to properly manage an options dialog is
because otherwise the call pointer is lost when the peer is regenerated from
the database, which is how existing qualify dialogs are detected.

(closes issue #16382)
Reported by: lftsy
Patches: 
      bug16382-3.patch uploaded by jpeeler (license 325)
Tested by: zerohalo



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@294688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-11 21:12:27 +00:00
Jeff Peeler
80740e014d One small addition to 294384 found while very carefully merging to 1.6.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@294641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-11 19:52:14 +00:00
Jeff Peeler
7876a359ad Fix a deadlock in device state change processing.
Copied from some notes from the original author (Russell):

Deadlock scenario:
Thread 1: device state change thread
  Holds - rdlock on contexts
  Holds - hints lock
  Waiting on channels container lock

Thread 2: SIP monitor thread
  Holds the "iflock"
  Holds a sip_pvt lock
  Holds channel container lock
  Waiting for a channel lock

Thread 3: A channel thread (chan_local in this case)
  Holds 2 channel locks acquired within app_dial
  Holds a 3rd channel lock it got inside of chan_local
  Holds a local_pvt lock
  Waiting on a rdlock of the contexts lock

A bunch of other threads waiting on a wrlock of the contexts lock


To address this deadlock, some locking order rules must be put in place and
enforced. Existing relevant rules:

1) channel lock before a pvt lock
2) contexts lock before hints lock
3) channels container before a channel

What's missing is some enforcement of the order when you involve more than any
two. To fix this problem, I put in some code that ensures that (at least in the
code paths involved in this bug) the locks in (3) come before the locks in (2).
To change the operation of thread 1 to comply, I converted the storage of hints
to an astobj2 container. This allows processing of hints without holding the
hints container lock. So, in the code path that led to thread 1's state, it no
longer holds either the contexts or hints lock while it attempts to lock the
channels container.

(closes issue #18165)
Reported by: antonio

ABE-2583



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@294384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-09 17:37:59 +00:00
Matthew Nicholson
ea7e7cd8ed Modify our handling of 491 responses to drop any pending reinvite retry scheduler entries if we get a new 491.
This prevents a scheduler entry from leaking if we receive a 491 response when one is pending.  If a scheduler entry leaks, the pvt it is associated my get destroyed before the scheduler entry fires, and then memory corruption and crashes can occur when the scheduled reinvite attempts to access and modify the memory of the destroyed pvt.

ABE-2543


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@294163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-08 18:59:20 +00:00
Shaun Ruffell
bb88f0dcc5 codecs/codec_dahdi: Prevent "choppy" audio when receiving unexpected frame sizes.
dahdi-linux 2.4.0 (specifically commit 9034) added the capability for
the wctc4xxp to return more than a single packet of data in response to
a read.  However, when decoding packets, codec_dahdi was still assuming
that the default number of samples was in each read.

In other words, each packet your provider sent you, regardless of size,
would result in 20 ms of decoded data (30 ms if decoding G723). If your
provider was sending 60 ms packets then codec_dahdi would end up
stripping 40 ms of data from each transcoded frame resulting in "choppy"
audio.

This would only affect systems where G729 packets are arriving in sizes
greater than 20ms or G723 packets arriving in sizes greater than 30ms.

DAHDI-744.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@293968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-05 00:02:53 +00:00
David Vossel
279f66c25d Fixes ringback tone on feature semi-attended transfer
ABE-2168


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@293922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-04 21:28:12 +00:00
Richard Mudgett
1791cb12df Party A in an analog 3-way call would continue to hear ringback after party C answers.
All parties are analog FXS ports.
1) A calls B.
2) A flash hooks to call C.
3) A flash hooks to bring C into 3-way call before C answers.  (A and B hear ringback)
4) C answers
5) A continues to hear ringback during the 3-way call. (All parties can hear each other.)

* Fixed use of wrong variable in dahdi_bridge() that stopped ringback on
the wrong subchannel.

* Made several debug messages have more information.

A similar issue happens if B and C are SIP channels.  B continues to hear
ringback.  For some reason this only affects v1.8 and trunk.

* Don't start ringback on the real and 3-way subchannels when creating the
3-way conference.  Removing this code is benign on v1.6.2 and earlier.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@293805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-03 18:23:04 +00:00
Jeff Peeler
ab41baedbd Add enabled/disabled information for rtautoclear sip show settings output.
When setting to zero/"no", the numeric default was shown making it not obvious
the disabled setting was respected.

(closes issue #18123)
Reported by: zerohalo


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@293722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-02 23:02:51 +00:00
Richard Mudgett
eca91ef1f3 Make warning message have more useful information in it.
Change "Unable to get index, and nullok is not asserted" to "Unable to get
index for '<channel-name>' on channel <number> (<function>(), line
<number>)".


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@293639 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-02 21:24:13 +00:00
Richard Mudgett
0761ad1f97 Remove some more code that serves no purpose.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@293416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-30 01:45:49 +00:00