will just return immediately. Also, fix some logic so the thread's lock
isn't unlocked twice in the weird case of dynamic threads getting acquired
right after a timeout.
(pointed out by SteveK)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
during the first time it runs. This shouldn't ever happen, but we should
account for it anyway.
(pointed out by pete, who works with mihai)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Also rearrange messages to better fit with what a wireshark trace shows it should be.
Issue 10299, initial patch and solution by sbisker, modified by me to fit with wireshark trace.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77947 65c4cc65-6c06-0410-ace0-fbb531ad65f3
thread timed out waiting for something to do, but was acquired to perform an
action immediately afterwords, then wait on the condition again to give the
other thread a chance to finish setting up the data for what action this thread
should perform. Otherwise, if it immediately continues, it will perform the
wrong action.
(reported on IRC by mihai, patch by me)
(related to issue #10289)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The most notable problem is that people have been seeing storms of VNAK frames
being sent due to really old frames mysteriously being in the retransmission
queue and never getting removed.
It was possible that a dynamic thread got created, but did not acquire its lock
before the thread that created it signals it to perform an action. When this
happens, the thread will sleep until it hits a timeout, and then get destroyed.
So, the action never gets performed and in some cases, means a frame doesn't
get transmitted and never gets freed since the scheduler never gets a chance
to reschedule transmission.
Another less severe race condition is in the handling of a timeout for a dynamic
thread. It was possible for it to be acquired to perform at action at the same
time that it hit a timeout. When this occurs, whatever action it was acquired
for would never get performed.
(patch contributed by Mihai and SteveK)
(closes issue #10289)
(closes issue #10248)
(closes issue #10232)
(possibly related to issue #10359)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
due to sending packets in the wrong order during hangup.
Also make sure we clear tones/messages on the correct line/instance.
Issue 10291, patch by DEA, tested by sbisker and myself.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
servers between endpoints, the Asterisk servers will not keep retransmitting the re-invites.
(closes issue #10274, reported by cstadlmann, patched by me with approval from file)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
queue. In the network_thread() loop, it traverses the list using the
AST_LIST_TRAVERSE_SAFE macro. However, to remove an element of the list within
this loop, it used AST_LIST_REMOVE, instead of AST_LIST_REMOVE_CURRENT, which I
believe could leave some of the internal variables of the SAFE macro invalid.
Mihai says that he already made this change in his local copy and it didn't help
his VNAK storm issues, but I still think it's wrong. :)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Reported by: julianjm
Patches:
chan_sip_device_state_hold_fix.v1.diff.txt uploaded by julianjm (license 99)
Clear ONHOLD flag when decrementing the onHold peer count. If we did not do this the count may keep decreasing.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Reported by: mvanbaak
Patches:
chan_skinny_openbsd.diff uploaded by mvanbaak (license 7)
Add another OS that has to use the Macros for byte ordering.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
the network. Using an unsigned value here made it impossible to handle an
error returned from recvfrom(). Furthermore, in the case that recvfrom()
did return an error, this would cause a crash due to a heap overflow.
(closes issue #10265, reported by and fix suggested by timrobbins)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76485 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Cancel ringing if endpoint hangs up before answering.
Fixes were backported from trunk (there was apparently a bit of confusion during merge of a previous patch).
(closes issue #10241)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r75927 | russell | 2007-07-19 10:49:42 -0500 (Thu, 19 Jul 2007) | 6 lines
When processing full frames, take sequence number wraparound into account when
deciding whether or not we need to request retransmissions by sending a VNAK.
This code could cause VNAKs to be sent erroneously in some cases, and to not
be sent in other cases when it should have been.
(closes issue #10237, reported and patched by mihai)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75928 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r75757 | russell | 2007-07-18 16:09:13 -0500 (Wed, 18 Jul 2007) | 5 lines
When traversing the queue of frames for possible retransmission after
receiving a VNAK, handle sequence number wraparound so that all frames that
should be retransmitted actually do get retransmitted.
(issue #10227, reported and patched by mihai)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75759 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Reported by: elandivar
It is possible for hold status to exist without call limits set, so we need to ensure update_call_counter is executed regardless.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r75444 | russell | 2007-07-17 15:45:27 -0500 (Tue, 17 Jul 2007) | 5 lines
Ensure that when encoding the contents of an ast_frame into an iax_frame, that
the size of the destination buffer is known in the iax_frame so that code
won't write past the end of the allocated buffer when sending outgoing frames.
(ASA-2007-014)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r75052 | russell | 2007-07-13 14:10:00 -0500 (Fri, 13 Jul 2007) | 12 lines
(closes issue #9660)
Reported by: mmacvicar
Patches submitted by: bbryant, russell
Tested by: mmacvicar, marco, arcivanov, jmhunter, explidous
When using a TDM400P (and probably other analog cards) there was a chance that
you could hang up and pick the phone back up where it has been long enough to
be not considered a flash hook, but too soon such that the device reports that
it is busy and the person on the phone will only hear silence. This patch
makes chan_zap more tolerant of this and gives the device a couple of seconds
to succeed so the person on the phone happily gets their dialtone.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@75053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
since loginstart is used after logoff. Thanks to makoto for pointing this out and suggesting the fix.
(closes issue #10178, reported and patched by makoto, with modification by me)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r74766 | russell | 2007-07-11 17:53:26 -0500 (Wed, 11 Jul 2007) | 5 lines
The function make_trunk() can fail and return -1 instead of a valid new call
number. Fix the uses of this function to handle this instead of treating it
as the new call number. This would cause a deadlock and memory corruption.
(possible cause of issue #9614 and others, patch by me)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r74158 | qwell | 2007-07-09 15:18:15 -0500 (Mon, 09 Jul 2007) | 8 lines
Several chan_zap options were not working on reload because they were arbitrarily
disallowed when reloading some/most PRI options (such as signalling) was disallowed.
Options such as polarityonanswerdelay and answeronpolarityswitch can safely be changed on a reload.
This corrects that behavior.
Issue 9186, patch by tzafrir.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r73678 | russell | 2007-07-06 10:55:41 -0500 (Fri, 06 Jul 2007) | 7 lines
(closes issue #10125)
Reported by: makoto
Patches submitted by: makoto
This fixes a crash in chan_sip that happens when the bindaddr setting is not
valid on Asterisk startup, gets fixed, and then a reload gets issued.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
set to ease debugging
* When deferring a full frame for processing, stick it into the queue for the
thread that is processing frames for that call, not the one that read the
current frame and is about to go back into the idle list
(related to issue #9937)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@73551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r72585 | crichter | 2007-06-29 15:08:26 +0200 (Fr, 29 Jun 2007) | 1 line
check if the bchannel stack id is already used, if so don't use it a second time. Also added a release_chan lock, so that the same chan_list object cannot be freed twice. chan_misdn does not crash anymore on heavy load with these changes.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r72099 | crichter | 2007-06-27 15:22:37 +0200 (Mi, 27 Jun 2007) | 1 line
simplified generation for dummy bchannels, also we mark them as dummies, so they are not used later as real-bchannels, optimized the RESTART mechanisms, we block a channel now on cause:44, and send out a RESTART automatically, then on reception of RESTART_ACKNOWLEDGE we unblock the channel again.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
variable declarations in the middle of a block.
Fix the few instances of the above spotted out by the compiler.
All of this has been already done or is not applicable in trunk,
so the merge of this change will be blocked.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72462 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r72040 | crichter | 2007-06-27 09:49:27 +0200 (Mi, 27 Jun 2007) | 1 line
for inbound TE calls, we setup the bchannel when we get the CONNECT_ACKNOWLEDGE, to make sure mISDN has everything ready. removed some #if 0 areas which weren't used anymore.
........
r72041 | crichter | 2007-06-27 09:54:30 +0200 (Mi, 27 Jun 2007) | 1 line
isdn_lib.c didn't compile
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r70311 | crichter | 2007-06-20 16:47:59 +0200 (Mi, 20 Jun 2007) | 1 line
on receiption of cause:44 we mark the channel as in use and inform the user about the situation, we need to test the RESTART stuff then. Also shuffled the empty_chan_in_stack function after the bchannel cleaning functions, to avoid race conditions.
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@71121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
of handling a full frame for the same call, queue it up for processing by that
same thread later instead of dropping it.
(issue #9937, patch by me)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r70396 | russell | 2007-06-20 13:45:38 -0500 (Wed, 20 Jun 2007) | 5 lines
Fix a problem where an established call would not be properly disconnected
when a PRI disconnect is received depending on which cause code was received.
(issue #9588, original patch by softins, updated patch from jtexter3, and some
additional feedback from mhardeman)
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@70397 65c4cc65-6c06-0410-ace0-fbb531ad65f3