aboutsummaryrefslogtreecommitdiffstats
path: root/main
AgeCommit message (Collapse)AuthorFilesLines
2010-11-11I didn't mean to merge this, sorryjpeeler1-3/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@294739 f38db490-d61c-443f-a65b-d21fe96a405b
2010-11-11One small addition to 294384 found while very carefully merging to 1.6.jpeeler1-0/+6
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@294641 f38db490-d61c-443f-a65b-d21fe96a405b
2010-11-09Fix a deadlock in device state change processing.jpeeler2-107/+192
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: http://svn.digium.com/svn/asterisk/branches/1.4@294384 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-28"!00" evaluated as false, which is incorrect. Fixing.tilghman3-242/+369
Reported (though the reporter did not understand he was reporting a bug) on the asterisk-users list: http://lists.digium.com/pipermail/asterisk-users/2010-October/255505.html git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@293194 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-13Don't ignore frames that have been queued when softhangup'dtwilson1-1/+12
When an outgoing call is answered and hung up by the far end *very* quickly, we may not read any frames and therefor end up with a call that displays the wrong disposition/DIALSTATUS. The reason is because ast_queue_hangup() immediately sets the _softhangup flag on the channel and then queues the HANGUP control frame, but __ast_read refuses to read any frames if ast_check_hangup() indicates that a hangup request has been made (which it will if _softhangup is set). So, we end up losing control frames. This change makes __ast_read continue to read frames even if a soft hangup has been requested. It queues a hangup frame to make sure that __ast_read() will still eventually return NULL. Much thanks to David Vossel for all of the reviews, discussion, and help! (closes issue #16946) Reported by: davidw Review: https://reviewboard.asterisk.org/r/740/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@291577 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-12Oops, incorrect range (although unallocated at ARIN)tilghman1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@291263 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-08Ensure editline cleanup occurs when Ctrl-C is pressed at control console.jpeeler1-4/+5
A recent change was made to avoid a race condition on shutdown which only called the end functions from the console thread. However, when pressing Ctrl-C the quit handler is called from the signal handler thread. (closes issue #17698) Reported by: jmls git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@290862 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-02Add documentation for undocumented option to AMI action originateoej1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@289949 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-01Change RFC2833 DTMF event duration on end to report actual elapsed time.jpeeler1-1/+15
The scenario here is with a non P2P early media session. The reported time length of DTMF presses are coming up short when sending to the remote side. Currently the event duration is a running total that is incremented when sending continuation packets. These continuation packets are only triggered upon incoming media from the remote side, which means that the running total probably is not going to end up matching the actual length of time Asterisk received DTMF. This patch changes the end event duration to be lengthened if it is detected that the end event is going to come up short. Review: https://reviewboard.asterisk.org/r/957/ ABE-2476 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@289797 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-29Allow a manager originate to succeed on forwarded devices.qwell1-2/+7
The timeout to wait for an answer was being set to 0 when a device forwarded to another extension. We don't always need the timeout set like this, so make it an optional parameter, and don't use it in this case. ABE-2544 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@289338 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-29Set the caller id on CDRs when it is set on the parent channel.mnicholson1-0/+3
(closes issue #17569) Reported by: tbelder Patches: 17569.diff uploaded by tbelder (license 618) Tested by: tbelder git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@289177 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-28Fixes an issue with the Newchannel AMI event during the Masquerading process.bbryant1-3/+7
Fixes an issue with the Newchannel AMI event during the Masquerading process, where no Newchannel AMI event was generated for the psuedo channel used during the masquerading process. (closes issue #17987) Reported by: RadicAlish Patches: newchannel.patch.txt uploaded by RadicAlish (license 1122) Tested by: RadicAlish Review: https://reviewboard.asterisk.org/r/937/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@289094 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-24Solaris compatibility fixestilghman2-0/+14
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@288636 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-22Fix a 100% CPU consumption problem when setting console=yes in asterisk.conf.russell1-1/+1
The handling of -c and console=yes should be the same, but they were not. When you specify -c, it sets both a flag for console module and for asterisk not to fork() off into the background. The handling of console=yes only set console mode, so you would end up with a background process() trying to run the Asterisk console and freaking out since it didn't have anything to read input from. Thanks to beagles for reporting and helping debug the problem! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@288339 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-21Add a check to fix a rare segmentation fault you'd get if ast_frdup couldn't ↵bbryant1-1/+3
allocate memory on the first frame being queued in ast_queue_frame. (closes issue #17882) Reported by: seanbright Tested by: seanbright git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@288005 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-21Less than zero is an error, not any non-zero value.tilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@287933 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-20ast_channel_masquerade: remove extra else ifalecdavis1-2/+1
(closes issue #17363,#16057) Reported by: amorsen;davidw,alecdavis Patches: based on bug16057.diff4.txt uploaded by alecdavis (license 585) Tested by: ramonpeek, davidw, alecdavis git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@287684 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-20ast_channel_masquerade: Avoid recursive masquerades.alecdavis1-7/+17
Check all 4 combinations of (original/clonechan) * (masq/masqr). Initially original->masq and clonechan->masqr were only checked. It's possible with multiple masq's planned - and not yet executed, that the 'original' chan could already have another masq'd into it - thus original->masqr would be set, that masqr would lost. Likewise for the clonechan->masq. (closes issue #16057;#17363) Reported by: amorsen;davidw,alecdavis Patches: bug16057.diff4.txt uploaded by alecdavis (license 585) Tested by: ramonpeek, davidw, alecdavis git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@287682 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-20Use ast_dynamic_str when processing hint state changesmnicholson1-6/+10
(related to issue #17928) Reported by: mdu113 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@287555 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-19Make sure we always free variables properly in manager originate.oej1-1/+7
(closes issue #17891) reported, solved and tested by oej Review: https://reviewboard.asterisk.org/r/869/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@287469 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-17Use ast_strdup() instead of ast_strdupa() while processing in ↵mnicholson1-2/+7
ast_hint_state_changed(). (related to issue #17928) Reported by: mdu113 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@287307 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-16Don't limit hint processing in ast_hint_state_changed() to AST_MAX_EXTENSION ↵mnicholson1-3/+1
length strings. (closes issue #17928) Reported by: mdu113 Patches: 20100831__issue17928.diff.txt uploaded by tilghman (license 14) Tested by: mdu113 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@287118 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-16Don't stop printing cdr variables if we encounter one with a blank name or ↵mnicholson1-10/+10
value. (closes issue #17900) Reported by: under Patches: core-show-channel-cdr-fix1.diff uploaded by mnicholson (license 96) Tested by: mnicholson git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@287114 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-14Only drop duplicate answer frames if the channel is bridged.mnicholson1-1/+1
Back in r3710 ast_read() was modified to drop answer frames on channels that were in the UP state. This modification prevented bridges that were up before the answer from being broken and reestablished by an ANSWER control frame. That change also prevents pickup of channels called from the ast_dial framework from working properly. The ast_dial framework expects to see an ANSWER frame after dialing and the pickup code queues one but ast_read() drops it. This new change only drops ANSWER frames when the channel is bridged, allowing the answer queued by the pickup code to properly pass through ast_read() on to the ast_dial framework. ABE-2473 (related to issue #2342) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@286679 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-11Handle error response when we can't make file compatibleoej1-1/+4
Review: https://reviewboard.asterisk.org/r/911/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@286267 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-10Missing newlinetilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@286023 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-09Transmit silence when reading DTMF in ast_readstring.qwell6-193/+278
Otherwise, you could get issues with DTMF timeouts causing hangups. (closes issue #17370) Reported by: makoto Patches: channel-readstring-silence-generator.patch uploaded by makoto (license 38) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@285742 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-29fixes issue with translator frame not getting freeddvossel1-0/+3
A translator frame even if it local storage so the translation path can be freed. This issue prevented g729 licenses from being freed up. (closes issue #17630) Reported by: manvirr Patches: encoder_fix.diff uploaded by dvossel (license 671) Tested by: manvirr, dvossel git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@280448 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-27remove empty audiohook write list on channeldvossel2-1/+21
If a channel has an audiohook write list created on it, that list stays on the channel until the channel is destroyed. There is no reason to keep that list on the channel if it becomes empty. If it is empty that just means we are doing needless translating for every ast_read and ast_write. This patch removes the audiohook list from the channel once it is detected to be empty on either a read or write. If a audiohook is added back to the channel after this list is destroyed, the list just gets recreated as if it never existed to begin with. (closes issue #17630) Reported by: manvirr Review: https://reviewboard.asterisk.org/r/799/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@279945 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-23Avoid race with consolethread on shutdown (on parallel processors).tilghman1-6/+13
(closes issue #17080) Reported by: sybasesql Patches: 20100721__issue17080.diff.txt uploaded by tilghman (license 14) Tested by: sybasesql git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@278981 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-22Allow PLC to function properly when channels use SLIN for audio.mmichelson1-1/+3
If a channel involved in a bridge was using SLIN audio, then translation paths were not guaranteed to be set up properly since in all likelihood the number of translation steps was only 1. This patch enforces the transcode_via_slin behavior if transcode_via_slin or generic_plc is enabled and one of the formats to make compatible is SLIN. AST-352 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@278618 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-20Do not queue up DTMF frames while a call is on hold.tilghman1-1/+21
(Fixes ABE-2110) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@278167 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-20Off-by-one errortilghman1-5/+3
(closes issue #16506) Reported by: nik600 Patches: 20100629__issue16506.diff.txt uploaded by tilghman (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@278023 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-16Interpret device state AST_DEVICE_UNKNOWN as extension state ↵mnicholson1-1/+2
AST_EXTENSION_NOT_INUSE. (closes issue #16035) Reported by: francesco_r Patches: pbx.c.patch uploaded by viniciusfontes (license 978) Tested by: francesco_r, agx, lawbar git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@277327 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-16If variable gotten is not set, will segfault on Solaris.tilghman1-1/+1
(closes issue #17636) Reported by: bklang git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@277261 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-16For pass through DTMF tones, measure the actual duration between the begin ↵mnicholson1-0/+13
and end packets on the wire. If it is detected to be less than AST_MIN_DTMF_DURATION, trigger dtmf emulation. AST-362 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@277247 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-15In a perfect world, the frame source would never be NULL. In the meantime, ↵jpeeler1-1/+1
don't crash when it is. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@276652 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-12Change ast_write to not stop generator when called from ast_prod.jpeeler1-5/+5
For SIP channels configured with the progressinband option on, the ringback was being immediately stopped. This problem was due to ast_prod being moved for a deadlock fix in 259858. Prodding the channel after setting up the generator triggered the check in ast_write to stop the generator. The fix here should write the frame the same as was done before the call to ast_prod was moved. (closes issue #17372) Reported by: tech_admin git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@275665 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-09fix tab-completion for unload command.pabelanger1-1/+6
(closes issue #17536) Reported by: junky Patches: unload_vs_mod_unload.diff uploaded by junky (license 177) Tested by: pabelanger git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@275290 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-09give a better error message when attempting to unload a module that is not ↵mnicholson1-1/+3
loaded git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@275182 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-09don't unload modules that returned AST_MODULE_LOAD_DECLINE when they were loadedmnicholson1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@275143 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-09Document that a leading and trailing slash is expected for test categories.russell1-0/+5
Also, emit a warning if a test is registered without one of these. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@275021 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-06Ensure file.o is built correctly.jpeeler1-1/+1
(related to issue #15250) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@274359 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-06Fix problem with RFC 2833 DTMF not being accepted.mmichelson1-1/+5
A recent check was added to ensure that we did not erroneously detect duplicate DTMF when we received packets out of order. The problem was that the check did not account for the fact that the seqno of an RTP stream will roll over back to 0 after hitting 65535. Now, we have a secondary check that will ensure that the seqno rolling over will not cause us to stop accepting DTMF. (closes issue #17571) Reported by: mdeneen Patches: rtp_seqno_rollover.patch uploaded by mmichelson (license 60) Tested by: richardf, maxochoa, JJCinAZ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@274157 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-05Remove extra line breaks from 'core show config mappings'pabelanger1-3/+1
(closes issue #17583) Reported by: pabelanger Patches: issue17583.patch uploaded by pabelanger (license 224) Tested by: lmadsen git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@273884 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-02Autoservice loop optimization causes a busy loop, when channels are serviced ↵tilghman1-0/+5
while in hangup. (closes issue #17564) Reported by: ramonpeek Patches: 20100630__issue17564.diff.txt uploaded by tilghman (license 14) Tested by: ramonpeek git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@273717 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-01Don't return a partially initialized datastore.russell1-1/+4
If memory allocation fails in ast_strdup(), don't return a partially initialized datastore. Bad things may happen. (related to ABE-2415) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@273565 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-29_Really_ skip the channel... don't just retry for another 200 cycles.tilghman1-1/+1
(Closes issue SWP-1652, ABE-2240) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@273057 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-28Don't change ownership/group/permissions on run directory, if it already exists.tilghman1-4/+8
(closes issue #17076) Reported by: stuarth Patches: 20100324__issue17076.diff.txt uploaded by tilghman (license 14) Tested by: stuarth git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@272925 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-28Also trim trailing blanks on #includestilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@272922 f38db490-d61c-443f-a65b-d21fe96a405b