aboutsummaryrefslogtreecommitdiffstats
path: root/main
AgeCommit message (Collapse)AuthorFilesLines
2007-12-18Rework deadlock avoidance used in ast_write, since it meant that agent ↵mmichelson1-15/+14
channels which were being monitored had one audio file recorded and one empty audio file saved. (closes issue #11529, reported by atis patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@93625 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-17Missed a spot..qwell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@93420 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-17What was I thinking when I wrote this masterpiece?qwell1-7/+9
-1 + 1 = 0.. who woulda thunk it?. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@93381 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-17Do not try to access information about a lock when printing out a trylock ↵file1-1/+1
attempt. It is possible for the lock that it references to no longer be valid. This would have caused segfaults or deadlocks. (issue #BE-263) (closes issue #11080) Reported by: callguy (closes issue #11100) Reported by: callguy git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@93377 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-14There are a lot of existing systems that #include non-existent files. So, torussell1-2/+11
make the transition to treating this as an error a bit less painless, just issue a huge error message for now. Then, later, we can reinstate the code that treats it as a failure. (Thanks to philippel for the feedback) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@93000 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-13Make application help text a little more clear about the use of extensions ↵qwell1-7/+7
in a filename. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@92809 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-13If a typo is found in a config file, we previous continued on with what was ↵qwell1-1/+1
already loaded. We do not want to do this (see bug below for details). This makes it so that if a [ is found without a ], the entire config will fail, and nothing in it will be loaded. Isue #10690. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@92696 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-11Fix potential memory leak with the dialed interfaces list if another memory ↵file1-0/+1
allocation fails. (closes issue #11507) Reported by: eliel Patches: global_datastores.c.patch uploaded by eliel (license 64) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@92363 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-10Add G729A as another possible payload name for G729. Some devices use this ↵file1-0/+1
instead of G729, which is perfectly normal since the payload number itself is defined and can't be used by anything else so the name doesn't matter that much. (closes issue #11483) Reported by: revolution Patches: rtp.diff uploaded by revolution (license 346) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@92204 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07We need to make sure we free the input frame if we return a different frame ↵qwell1-0/+2
in ast_dsp_process. Issue 11273, pointed out by dimas, with a patch by eliel. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91890 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07Make the lock protecting each thread's list of locks it currently holdsrussell1-1/+6
recursive. I think that this will fix the situation where some people have said that "core show locks" locks up the CLI. (related to issue #11080) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91830 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07* Add a bit more of a verbose comment as to why a hangup frame needs to berussell1-16/+30
queued up if autoservice gets a NULL return from ast_read(). * Make the process of queueing the hangup frame more efficient by putting the frame where it is going to end up and avoiding some locking and extra memory allocations and freeing. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91777 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07Hangups that happen during autoservice were not processed appropriately. This ismmichelson1-1/+4
because a hangup actually causes a NULL frame to be received, not a hangup frame. Queueing a hangup if we receive a NULL frame during autoservice corrects this problem (closes issue #11467, reported by jmls, patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91737 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-07At the end of a call, when we're reporting, RTCP may already be partially ↵tilghman1-8/+22
torn down, so check for NULL dereference Reported by: blitzrage Patch by: tilghman (Closes issue #11450) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91637 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-06Add a new module flag to indicate that a build sum is present. Modules builtrussell1-2/+4
against older Asterisk 1.4 headers will now load properly with just a warning indicating that they are old and may cause problems. (patch by paravoid) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91501 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-06Fix various in the udptl implementation. It could return empty modem frames, ↵file1-26/+19
have an incorrect sequence number on packets, and display the wrong sequence number in the debug messages. (closes issue #11228) Reported by: Cache Patches: udptl-4.patch uploaded by dimas (license 88) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91450 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-06Make sure logger is reloaded at general reload in the cli.oej2-6/+15
(Discovered during Asterisk training in Portugal) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91366 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-05Make the lock in the threadstorage debugging code untracked to avoid a deadlockrussell1-11/+13
on thread destruction. (closes issue #11207) Reported by: ys Patches: threadstorage.c.diff uploaded by ys (license 281) Also fixes an open bug report: (closes issue #11446) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91192 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-05When DEBUG_THREADS is enabled, we only have the details about who is holdingrussell1-0/+4
a lock that we are waiting on for a mutex, not rwlocks. This should fix the problem where people have reported "core show locks" crashing sometimes. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@91074 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-04Make some changes to some additions I made recently for doing channel ↵russell1-19/+9
autoservice when looking up extensions. This code was added to handle the case where a dialplan switch was in use that could block for a long time. However, the way that I added it, it did this for all extension lookups. However, lookups in the in-memory tree of extensions should _not_ take long enough to matter. So, move the autoservice stuff to be only around executing a switch. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90967 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-04If we fail to create a channel after allocating a timing fd, we need to make ↵qwell1-0/+4
sure to close it. Issue 11454, patch by eliel. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90876 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-03A big one...mmichelson3-1/+96
This is the merge of the forward-loop branch. The main change here is that call-forwards can no longer loop. This is accomplished by creating a datastore on the calling channel which has a linked list of all devices dialed. If a forward happens, then the local channel which is created inherits the datastore. If, through this progression of forwards and datastore inheritance, a device is attempted to be dialed a second time, it will simply be skipped and a warning message will be printed to the CLI. After the dialing has been completed, the datastore is detached from the channel and destroyed. This change also introduces some side effects to the code which I shall enumerate here: 1. Datastore inheritance has been backported from trunk into 1.4 2. A large chunk of code has been removed from app_dial. This chunk is the section of code which handles the call forward case after the channel has been requested but before it has been called. This was removed because call-forwarding still works fine without it, it makes the code less error-prone should it need changing, and it made this set of changes much less painful to just have the forwarding handled in one place in each module. 3. Two new files, global_datastores.h and .c have been added. These are necessary since the datastore which is attached to the channel may be created and attached in either app_dial or app_queue, so they need a common place to find the datastore info. This approach was taken in case similar datastores are needed in the future, there will be a common place to add them. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90735 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-03Do not create a smoother for G723.1 frames, they need to be left alone to ↵file1-1/+1
their native 20/24 byte size. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90588 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-03Preserve the indication currently playing on a channel when a masquerade ↵file1-1/+9
operation happens. (issue #BE-88) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90548 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-02Clarify the return value on autoservice. Specifically, if you startedtilghman1-7/+11
autoservice and autoservice was already on, it would erroneously return an error. Reported by: adiemus Patch by: dimas (Closes issue #11433) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90432 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-30Change the behavior of ao2_link(). Previously, in inherited a reference.russell2-2/+1
Now, it automatically increases the reference count to reflect the reference that is now held by the container. This was done to be more consistent with ao2_unlink(), which automatically releases the reference held by the container. It also makes it so it is no longer possible for a pointer to be invalid after ao2_link() returns. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90348 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-29Use of "private" as a field name in a header file messes with C++ projectstilghman1-1/+1
Reported by: chewbacca Patch by: casper (Closes issue #11401) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90155 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-29This set of changes is to make some callerID handling thread-safe.russell1-0/+4
The ast_set_callerid() function needed to lock the channel. Also, the handlers for the CALLERID() dialplan function needed to lock the channel when reading or writing callerid values directly on the channel structure. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90145 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-29Merge a change from team/russell/chan_refcount ...russell1-0/+5
This makes ast_stopstream() thread-safe. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90142 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-28it is impossible to set permissions for manager accounts created by ↵kpfleming1-2/+9
users.conf (reported internally, patched by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90098 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-28Removing some seemingly pointless code. This sets a channel variable for ↵mmichelson1-6/+0
every priority executed in the dialplan if you have debug set to anything non-zero. This seems pointless due to the fact that these channel variables are not referenced anywhere else in the code and their names are esoteric enough that they would not be practical to reference in the dialplan. Plus the fact that this behavior isn't documented anywhere means that the change is not likely to cause any disruption. If anything, this may actually cause a slight performance increase if running with debug on. The motivating influence for this code change is the eventwhencalled option for queues. If set to vars, all channel variables will be output to the manager. These unnecessary channel variables make the output a lot more difficult to deal with. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@90059 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-28 - update documentation for some of the goto functions to note that theyrussell1-0/+4
handle locking the channel as needed - update ast_explicit_goto() to lock the channel as needed git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89893 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27Don't do frame processing if ast_read() returned NULL.russell1-0/+3
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89886 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27Don't start/stop autoservice in pbx_extension_helper() unless a channel existsrussell1-8/+16
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89839 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27Merge changes from team/russell/autoservice_1.4russell2-7/+90
This set of changes fixes an issue that was reported to me on IRC yesterday. The user, d1mas, was using chan_zap for incoming calls and was having DTMF recognition issues in some situations. Specifically, he noticed that the problem occurred when using DISA or WaitExten. He also noticed that when using Read, the problem did not occur. His system also used DUNDi for dialplan lookups. So, he theorized that if the DUNDi lookups blocked for some period of time, that audio from the zap channel could get lost. If the audio got lost, then it wouldn't be run through the DTMF detector, and digits could get lost. He was correct, and the following set of changes fixes the problem. However, the changes go a little bit further than what was necessary to fix this exact problem. 1) I updated pbx_extension_helper() to autoservice the associated channel to handle cases where extension lookups may take a long time. This would normally be a dialplan switch that does some lookup over the network, such as the DUNDi or IAX2 switches. This ensures that even while a DUNDi lookup is blocking, the channel will be continuously serviced. 2) I made a change to the autoservice code. This is actually something that has bothered me for a long time. When a channel is in autoservice, _all_ frames get thrown away. However, some frames really shouldn't be thrown away. The most notable examples are signalling (CONTROL) frames, and DTMF. So, this patch queues up important frames while a channel is in autoservice. When autoservice is stopped on the channel, the queued up frames get stuck back on the channel so that they can get processed instead of thrown away. 3) I made another change to the autoservice code to handle the case where autoservice is started on channels recursively. Previously, you could call ast_autoservice_start() multiple times on a channel, and it would stop the first time ast_autoservice_stop() gets called. Now, it will ensure that autoservice doesn't actually stop until the final call to ast_autoservice_stop(). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89790 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27on second thought... revert all the other changes i've made in app options ↵kpfleming1-5/+1
parsing leaving only one: if an empty argument is supplied for an option, set that argument pointer to point to an empty string rather than NULL, so that the application can do normal checks on it without worrying about it being NULL git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89709 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27generate a warning when an application option that requires an argument is ↵kpfleming1-2/+5
ignored due to lack of an argument git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89701 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27If we get a codec offer using a well-known payload type, but using it for ↵oej1-3/+16
another codec that we don't know, Asterisk did not remove that codec from the list. With this patch, we remove the codec from audio and video rtp objects and deny it ever existed. Thanks to lasse for testing. (closes issue #11376) Reported by: lasse Patches: bug11376.txt uploaded by oej (license 306) Tested by: lasse git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89630 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27closes issue #11379; OK, this is an attempt to make both sides happy. To the ↵murf1-2/+11
cdr.conf file, I added the option 'unanswered', which defaults to 'no'. In this mode, you will see a cdr for a call, whether it was answered or not. The disposition will be NO ANSWER or ANSWERED, as appropriate. The src is as you'd expect, the destination channel will be one of the channels from the Dial() call, usually the last in the list if more than one chan was specified. With unanswered set to 'yes', you will still see this cdr entry in both cases. But in the case where the dial timed out, you will also see a cdr for each line attempted, marked NO ANSWER, with no destination channel name. The new option defaults to 'no', so you don't see the pesky extra cdr's by default, and you will not see the irritating 'not posted' messages. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89622 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-26Fix issues with async dialing with an application executing. The application ↵file1-5/+24
has to be terminated and control returned to the thread before hanging things up. (issue #BE-252) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89610 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-26Add channel locking to a function that needed to be doing it. This is just arussell1-0/+2
little something I noticed while working on a completely unrelated issue. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89594 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-26when parsing application options that take arguments, don't indicate that ↵kpfleming1-1/+2
the option was supplied unless a non-zero-length argument was found for it git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89586 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-26If channel allocation fails because the alert pipe could not be created also ↵file1-0/+1
free the scheduler context. (closes issue #11355) Reported by: eliel Patches: main.channel.c.patch uploaded by eliel (license 64) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89577 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-24Currently, zero-length voicemail messages cause a hangup in VoicemailMain.tilghman1-3/+11
This change fixes the problem, with a multi-faceted approach. First, we do our best to avoid these messages from being created in the first place, and second, if that fails, we detect when the voicemail message is zero-length and avoid exiting at that point. Reported by: dtyoo Patch by: gkloepfer,tilghman (Closes issue #11083) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89540 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-23Up until this point, the XML output of the manager has been technicallytilghman1-3/+71
invalid, due to the repetition of certain parameters in a single event. This caused various issues for XML parsers, some of which refused to parse at all, given the invalidity of the rendered XML. So this commit fixes the XML output, ensuring that each entity parameter has a unique name, thus ensuring valid XML. Reported by: msetim Patch by: tilghman (Closes issue #10220) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89536 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-20bring back compile-option checking when loading modules, only this time use ↵kpfleming1-0/+9
a string-based storage and comparison mechanism because it is easier to support on other platforms git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89461 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-20According to comments in main/pbx.c, it is essential that if we are going to ↵mmichelson1-0/+2
lock the conlock as well as the hints lock, it must be locked in that respective order. In order to prevent a potential deadlock, we need to lock the conlock prior to locking the hints lock in ast_hint_state_changed (see the call stack example on issue #11323 for how this can happen). (closes issue #11323, reported by eelcob, suggestion for patch by eelcob, patch by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89457 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16Temporarily revert revision 89325, which added md5 magic for keeping track ofrussell1-11/+0
what build options were used. We agreed that we should remove this before making a 1.4 release, and then we can put it back in. Then, we can take a month or so to play around with it to get it how we want it. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89339 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16To help combat problems where people build external modules (asterisk-addons ↵kpfleming1-0/+11
or others) and then change the build options of the Asterisk build in a way that makes the incompatible without warning, this commit introduces an MD5 signature of the important build-time options and includes that signature into modules when they are built. When the loader loads one of these modules and notices the problem, it will emit a warning to console and refuse to initialize the module, as doing so could cause the system to be unstable or even crash. If you upgrade to this version of Asterisk, you must rebuild *all* of your modules that came from other sources before trying to run this version. If you are using Digium's G.729 binary codec module, you will need v33 or newer. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89325 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-15Undoing previous commit since I realize it was wrongmmichelson1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89288 f38db490-d61c-443f-a65b-d21fe96a405b