aboutsummaryrefslogtreecommitdiffstats
path: root/main
AgeCommit message (Collapse)AuthorFilesLines
2009-01-14Don't read into a buffer without first checking if a value is beyond the end.tilghman1-5/+3
(closes issue #13600) Reported by: atis Patches: 20090106__bug13600.diff.txt uploaded by Corydon76 (license 14) Tested by: atis git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@168603 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-13Revert unnecessary indications API change from rev 122314russell3-41/+41
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@168561 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-07Fix the last couple of places where free() was improperly used directly.russell1-7/+8
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167566 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-07Don't fclose() the file early, the filestream destructor will handle it.russell1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167554 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-07Only try to close the file if one was actually openedrussell1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167545 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-07Don't use free() directly. This caused a crash since ast_filestream is now ↵russell1-1/+1
an ao2 object. Reported by JunK-Y on IRC, #asterisk-dev git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167541 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-07Treat an empty string the same way as a NULL country argument.russell1-7/+4
In passing, simplify the handling of returning a default tone zone. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167432 f38db490-d61c-443f-a65b-d21fe96a405b
2009-01-06Use the correct variable when creating the format stringmmichelson1-1/+1
(closes issue #14177) Reported by: nic_bellamy Patches: asterisk-trunk-svn-r167242-ast_db_gettree.patch uploaded by nic (license 299) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@167299 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-23Compile, even if both DAHDI and Zaptel are not installed.tilghman1-0/+2
(Closes issue #14120) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@166592 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-23Fix a crash resulting from a datastore with inheritance but no duplicate ↵mmichelson1-1/+1
callback The fix for this is to simply set the newly created datastore's data pointer to NULL if it is inherited but has no duplicate callback. (closes issue #14113) Reported by: francesco_r Patches: 14113.patch uploaded by putnopvut (license 60) Tested by: francesco_r git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@166568 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-23Use the integer form of condition for integer comparisons.tilghman1-1/+4
(closes issue #14127) Reported by: andrew git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@166509 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-22Fix up timeout handling in ast_carefulwrite().russell1-1/+18
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@166297 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-19Backport of AUDIOHOOK_INHERIT for Asterisk 1.4mmichelson2-2/+57
(closes issue #13538) Reported by: mbit Patches: 13538.patch uploaded by putnopvut (license 60) Tested by: putnopvut git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@166157 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-19(closes issue #13480)jpeeler2-42/+18
Reported by: tzafrir Replace a bunch of if defined checks for Zaptel/DAHDI through several new defines in dahdi_compat.h. This removes a lot of code duplication. Example from bug: #ifdef HAVE_ZAPTEL fd = open("/dev/zap/pseudo", O_RDWR); #else fd = open("/dev/dahdi/pseudo", O_RDWR); #endif is replaced with: fd = open(DAHDI_FILE_PSEUDO, O_RDRW); git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@165991 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-18Make ast_carefulwrite() be more careful.russell1-13/+38
This patch handles some additional cases that could result in partial writes to the file description. This was done to address complaints about partial writes on AMI. (issue #13546) (more changes needed to address potential problems in 1.6) Reported by: srt Tested by: russell Review: http://reviewboard.digium.com/r/99/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@165796 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-18Only care about a compatible codec for early bridging if we are actually ↵file1-3/+2
bridging to another channel. If we are not we actually want to bring the audio back to us. (closes issue #13545) Reported by: davidw git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@165591 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-16Fix an issue where DEBUG_THREADS may erroneously report that a thread russell1-0/+6
is exiting while holding a lock. If the last lock attempt was a trylock, and it failed, it will still be in the list of locks so that it can be reported. (closes issue #13219) Reported by: pj git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164881 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-16Add "restart gracefully" to the AMI blacklist of CLI commands. russell1-0/+1
"module unload" was already identified as a command that can not be used from the AMI. "restart gracefully" effectively unloads all modules, and will run in to the same problems. (closes issue #13894) Reported by: kernelsensei git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164806 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-16Fix memory leak and invalid reporting issues with DEBUG_THREADLOCALS.russell1-11/+27
One issue was that the ast_mutex_* API was being used within the context of the thread local data destructors. We would go off and allocate more thread local data while the pthread lib was in the middle of destroying it all. This led to a memory leak. Another issue was an invalid argument being provided to the the object_add API call. (closes issue #13678) Reported by: ys Tested by: russell git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164736 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-16I added a sentence to clarify why - and ' ' are ignored in patternsmurf1-1/+2
as per bug 14076. Leif says he'll put some stuff about it in the extensions.conf sample, etc. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164634 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-15Handle a case where a call can be bridged to a channel that is still ringing.russell1-50/+119
The issue that was reported was about a case where a RINGING channel got redirected to an extension to pick up a call from parking. Once the parked call got taken out of parking, it heard silence until the other side answered. Ideally, the caller that was parked would get a ringing indication. This patch fixes this case so that the caller receives ringback once it comes out of parking until the other side answers. The fixes are: - Make sure we remember that a channel was an outgoing channel when doing a masquerade. This prevents an erroneous ast_answer() call on the channel, which causes a bogus 200 OK to be sent in the case of SIP. - Add some additional comments to explain related parts of code. - Update the handling of the ast_channel visible_indication field. Storing values that are not stateful is pointless. Control frames that are events or commands should be ignored. - When a bridge first starts, check to see if the peer channel needs to be given ringing indication because the calling side is still ringing. - Rework ast_indicate_data() a bit for the sake of readability. (closes issue #13747) Reported by: davidw Tested by: russell Review: http://reviewboard.digium.com/r/90/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@164201 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-12Simple fix for Ctrl-C not immediately exiting Asterisk, but also add atilghman2-0/+5
pointer inside editline to look back to asterisk.c, so others don't spend as much time as I did looking (in the wrong place) for the appropriate function. Reported by: ZX81, via the #asterisk-users channel Fixed by: me (license 14) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@163761 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-12Resolve issues that could cause DTMF to be processed out of order.russell2-43/+99
These changes come from team/russell/issue_12658 1) Change autoservice to put digits on the head of the channel's frame readq instead of the tail. If there were frames on the readq that autoservice had not yet read, the previous code would have resulted in out of order processing. This required a new API call to queue a frame to the head of the queue instead of the tail. 2) Change up the processing of DTMF in ast_read(). Some of the problems were the result of having two sources of pending DTMF frames. There was the dtmfq and the more generic readq. Both were used for pending DTMF in various scenarios. Simplifying things to only use the frame readq avoids some of the problems. 3) Fix a bug where a DTMF END frame could get passed through when it shouldn't have. If code set END_DTMF_ONLY in the middle of digit emulation, and a digit arrived before emulation was complete, digits would get processed out of order. (closes issue #12658) Reported by: dimas Tested by: russell, file Review: http://reviewboard.digium.com/r/85/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@163448 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-11When a Ctrl-C or Ctrl-D ends a remote console, on certain shells, the terminaltilghman1-0/+21
is messed up. By intercepting those events with a signal handler in the remote console, we can avoid those issues. (closes issue #13464) Reported by: tzafrir Patches: 20081110__bug13464.diff.txt uploaded by Corydon76 (license 14) Tested by: blitzrage git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@163383 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10Increment the sequence number on the end packets for RFC2833. After reading ↵file1-3/+3
the RFC some more and doing some testing I agree with this change. (closes issue #12983) Reported by: vt Patches: dtmf_inc_seqnum_on_end_pkts.diff uploaded by vt (license 520) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162653 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09Remove the test_for_thread_safety() function completely.russell2-66/+0
The test is not valid. Besides, if we actually suspected that recursive mutexes were not working, we would get a ton of LOG_ERROR messages when DEBUG_THREADS is turned on. (inspired by a discussion on the asterisk-dev list) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162413 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09If we fail to start a thread for the pbx to run in, we need tommichelson1-0/+1
be sure to decrease the number of active calls on the system. This fix may relate to ABE-1713, but it is not certain yet. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162265 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09Make sure that the timestamp for DTMF is not the same as the previous voice ↵file1-2/+6
frame and do not send audio when transmitting DTMF as this confuses some equipment. (closes issue #13209) Reported by: ip-rob Patches: 13209.diff uploaded by file (license 11) Tested by: ip-rob, bujones git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162204 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09Take video into account when early bridging RTP.file1-4/+4
(closes issue #13535) Reported by: davidw git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162188 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09Fix a problem with GROUP() settings on a masquerade.russell1-2/+7
The previous code carried over group settings from the old channel to the new one. However, it did nothing with the group settings that were already on the new channel. This patch removes all group settings that already existed on the new channel. I have a more complicated version of this patch which addresses only the most blatant problem with this, which is that a channel can end up with multiple group settings in the same category. However, I could not think of a use case for keeping any of the group settings from the old channel, so I went this route for now. (closes AST-152) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@161948 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-05Merged revisions 161421 via svnmerge from seanbright1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r161421 | seanbright | 2008-12-05 15:50:23 -0500 (Fri, 05 Dec 2008) | 8 lines Fix build errors on FreeBSD (uint -> unsigned int). (closes issue #14006) Reported by: alphaque Patches: astobj2.h-patch uploaded by alphaque (license 259) (Slightly modified by seanbright) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@161426 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-05Fix a NULL format string warning found by buildbot.russell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@161287 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-04(closes issue #13835)jpeeler1-1/+3
Reported by: matt_b Tested by: jpeeler This mirrors a check that was present in ast_rtp_read to also be in ast_rtp_raw_write to not schedule sending the receiver report if the remote RTCP endpoint address isn't present in the RTCP structure. Closes AST-142. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@161013 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-04Fix a callerid parsing issue. If someone formatted callerid like themmichelson1-1/+9
following: "name <number>" (including the quotation marks), then the parts would be parsed as name: "name number: number This is because the closing quotation mark was not discovered since the number and everything after was parsed out of the string earlier. Now, there is a check to see if the closing quote occurs after the number, so that we can know if we should strip off the opening quote on the name. Closes AST-158 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@160943 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-02Ensure that Asterisk builds with --enable-dev-mode, even on the latest gcctilghman2-3/+11
and glibc. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@160207 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-01Get rid of the useless format string and argument in the Bogus/ manager ↵mvanbaak1-1/+1
channelname. Noted by kpfleming and name Bogus/manager suggested by eliel git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@159976 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-01make manager compile on OpenBSD.mvanbaak1-1/+1
The last (10th) argument to ast_channel_alloc here should be a pointer and NULL is not really a pointer. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@159897 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-29update dev-mode compiler flags to match the ones used by default on Ubuntu ↵kpfleming6-6/+6
Intrepid, so all developers will see the same warnings and errors since this branch already had some printf format attributes, enable checking for them and tag functions that didn't have them format attributes in a consistent way git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@159808 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-25(closes issue #12694)murf1-0/+3
Reported by: yraber Patches: 12694.2nd.diff uploaded by murf (license 17) Tested by: murf, laurav Thanks to file (Joshua Colp) for his IAX fix. the change to cdr.c allows no-answer to percolate up into CDR's, and feels like the right place to locate this fix; if BUSY is done here, no-answer should be, too. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@159316 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-25Add ao2_trylock() to go along with ao2_lock() and ao2_unlock()russell1-0/+27
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@159158 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-21The passed extension may not be the same in the list as the current entry,tilghman1-1/+1
because we strip spaces when copying the extension into the structure. Therefore, use the copied item to place the item into the list. (found by lmadsen on -dev, fixed by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@158600 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-21When compiling with DEBUG_THREADS, report the real file/func/line for ↵russell1-0/+16
ao2_lock/ao2_unlock git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@158539 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-20There was an issue when attempting to reference an embeddedmmichelson2-41/+82
frame in a freed ast_filestream. This patch makes use of the ao2 functions to make sure that we do not free an ast_filestream structure until the embedded ast_frame has been "freed" as well. (closes issue #13496) Reported by: fst-onge Patches: filestream_frame_1_4.diff uploaded by putnopvut (license 60) Tested by: putnopvut Closes AST-89 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@158126 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-19the gcc optimizer frequently finds broken code (use of uninitalized ↵kpfleming2-2/+2
variables, unreachable code, etc.), which is good. however, developers usually compile with the optimizer turned off, because if they need to debug the resulting code, optimized code makes that process very difficult. this means that we get code changes committed that weren't adequately checked over for these sorts of problems. with this build system change, if (and only if) --enable-dev-mode was used and DONT_OPTIMIZE is turned on, when a source file is compiled it will actually be preprocessed (into a .i or .ii file), then compiled once with optimization (with the result sent to /dev/null) and again without optimization (but only if the first compile succeeded, of course). while making these changes, i did some cleanup work in Makefile.rules to move commonly-used combinations of flag variables into their own variables, to make the file easier to read and maintain git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@157859 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-13Provide more space for all the data which can appear in an originatingtilghman1-1/+2
channel name. (closes issue #13398) Reported by: bamby Patches: manager.c.diff uploaded by bamby (license 430) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@156688 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-12It turns out that the 0x0XX00 codes being returned formurf1-3/+3
N, X, and Z are off by one, as per conversation with jsmith on #asterisk-dev; he was teaching a class and disconcerted that this published rule was not being followed, with patterns _NXX, _[1-8]22 and _[2-9]22... and NXX was winning, but [1-8] should have been. This change, tested on these 3 patterns now picks the proper one. However, this change may surprise users who set up dialplans based on previous behavior, which has been there for what, 2 and half years or so now. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@156297 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-12Move the sanity check that makes sure "always fork" is not set along with the russell1-6/+8
console option to be after the code that reads options from asterisk.conf. This resolves a situation where Asterisk can start taking up 100% when misconfigured. (Thanks to Bryce Porter (x86 on IRC) for letting me log in to his system to figure out what was causing the 100% CPU problem.) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@156164 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-05This fix was prompted by communication from user, who was seeing thousands ↵murf1-1/+2
of error logs... looks like EAGAIN. Made such uninteresting. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@154685 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-03Remove the potential for a division by zero error.tilghman1-1/+1
(Closes issue #13810) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@154060 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-03somehow missed a bunch of gcc 4.3.x warnings in this branch on the first passkpfleming3-21/+34
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153823 f38db490-d61c-443f-a65b-d21fe96a405b