aboutsummaryrefslogtreecommitdiffstats
path: root/main/pbx.c
AgeCommit message (Collapse)AuthorFilesLines
2008-01-31closes issue #11845; that's the one where there's a 1004 byte cdr leak with ↵murf1-1/+2
every AMI Redirect to a zap channel git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@101480 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-28WaitExten didn't handle AbsoluteTimeout properly (went to 't' instead of 'T')tilghman1-1/+5
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@100675 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-31Avoiding a potentially bad locking situation. ast_merge_contexts_and_delete ↵mmichelson1-1/+2
writelocks the conlock, then calls ast_hint_extension, which attempts to readlock the same lock. Recursion with read-write locks is dangerous, so the inner lock needs to be removed. I did this by copying the "guts" of ast_hint_extension into ast_merge_contexts_and_delete (sans the extra lock). (this change is inspired by the locking problems seen in issue #11080, but I have no idea if this is the problematic area experienced by the reporters of that issue) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@95577 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-27Now that the contexts lock is a read/write lock, it should not be locked hererussell1-2/+0
in ast_hint_state_changed(). This makes it get locked recursively which now causes a deadlock. (closes issue #11080, thanks to callguy for the access to a deadlocked machine) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@94831 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-21Convert the contexts lock to a read/write lock to resolve a deadlock. Thisrussell1-31/+48
has a nice side benefit of improving performance. :) (closes issue #11609) (closes issue #11080) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@94466 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-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-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 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.4russell1-3/+20
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-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-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-12Fix a typo pointed out by De_Mon on #asterisk-devqwell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@89194 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-05After seeing crashes related to channel variables, I went looking around at therussell1-11/+37
ways that channel variables are handled. In general, they were not handled in a thread-safe way. The channel _must_ be locked when reading or writing from/to the channel variable list. What I have done to improve this situation is to make pbx_builtin_setvar_helper() and friends lock the channel when doing their thing. Asterisk API calls almost all lock the channel for you as necessary, but this family of functions did not. (closes issue #10923, reported by atis) (closes issue #11159, reported by 850t) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@88805 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-11A dollar sign by itself, not indicating a start of a variable or expression ↵tilghman1-2/+3
prematurely ends substitution (closes issue #10939) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@85356 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-17(closes issue #10734)file1-1/+1
Reported by: asgaroth Instead of passing a NULL pointer into snprintf pass "". It makes Solaris much happier. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82514 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-30(closes issue #10603)file1-0/+3
Reported by: jmls Patches: pbx.diff uploaded by jmls (license 141) Backport changes from 81372. Add REASON dialplan variable for when an originated call fails and the failed extension is executed. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@81375 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-24Make the deprecation warning inline with the code, instead of only in ↵tilghman1-1/+6
documentation (closes issue #10549) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@80747 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-17(closes issue #10209)russell1-0/+2
Reported by: juggie Patches: 10209-trunk-2.patch uploaded by juggie Tested by: juggie, blitzrage In ast_pbx_run(), mark a channel as hung up after an application returned -1, or when it runs out of extensions to execute. This is so that code can detect that this channel has been hung up for things like making sure DeadAGI is used on actual dead channels, and is beneficial for other things, like making sure someone doesn't try to start spying on a channel that is about to go away. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@75403 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-14use ast_localtime() in every place localtime_r() was being usedkpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@69392 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-14As per 9570, worrisome CDR warnings have been removed, that are either not ↵murf1-15/+1
helpful, or not relevant. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@64193 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-02Merged revisions 62737 via svnmerge from murf1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r62737 | murf | 2007-05-02 14:10:32 -0600 (Wed, 02 May 2007) | 1 line Some tweaks to satisfy CDR bug 8796, where being in 'h' extension louses up the dst field ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@62738 f38db490-d61c-443f-a65b-d21fe96a405b
2007-05-02a)In chan_zap, set the clid, src fields in channel_alloc call. b)in the ↵murf1-1/+1
channel_alloc func, set the cid_num and name fields from the arglist[blush]. c) don't update the channel app & app data fields if you are in the 'h' extension. d)the load_module func in cdr_radius needs to return DECLINE, SUCCESS. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@62689 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-27If no variables were passed into pbx_substitute_variables_helper_full(), thenrussell1-1/+1
don't even bother creating a temporary bogus channel, since that is only for allowing certain functions to operate on the variables as if they were on a channel. Most importantly, this fixes a crash. (issue #9613, reported by callguy, fixed by me) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@62171 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-23Some dialplan functions, such as CUT(), expect to operate on variables on arussell1-1/+15
channel. So, this little hack lets them work in places where a channel doesn't exist, such as within DUNDi configuration. (issue #9465, reported and patched by Corydon76, testing by blitzrage) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@61765 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-09This is a big improvement over the current CDR fixes. It may still need ↵murf1-3/+3
refinement, but this won't have as many folks bothered. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@60989 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-30several changes via kpflemings reviewmurf1-5/+0
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59522 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-30These mods fix CDR issues from 8221, 8593, 8680, 8743, and perhaps others. ↵murf1-1/+7
Mainly with CDRs generated from transfer situations. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59486 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-16Making these documentation changes in the 1.4 branch upset various people, sorussell1-56/+0
these chanes will only be done in the trunk. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@58955 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-15Refashion dump command to match common syntax and update the resulting ↵tilghman1-4/+4
appdocs TeX file git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@58946 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-15Expand deprecation warnings from simply warning on use to the builtin ↵tilghman1-0/+4
documentation. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@58939 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-15Merge changes from svn/asterisk/team/russell/LaTeX_docs.russell1-0/+56
* Convert most of the doc directory into a single LaTeX formatted document so that we can generate a PDF, HTML, or other formats from this information. * Add a CLI command to dump the application documentation into LaTeX format which will only be include if the configure script is run with --enable-dev-mode. * The PDF turned out to be close to 1 MB, so it is not included. However, you can simply run "make asterisk.pdf" to generate it yourself. We may include it in release tarballs or have automatically generated ones on the web site, but that has yet to be decided. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@58931 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-05Merged revisions 57825 via svnmerge from murf1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r57825 | murf | 2007-03-05 07:53:57 -0700 (Mon, 05 Mar 2007) | 1 line Fixed a typo introduced via 9156 (either the gotos or their doc strings are wrong) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@57826 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-02Merged revisions 57458 via svnmerge from murf1-9/+20
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r57458 | murf | 2007-03-02 09:39:33 -0700 (Fri, 02 Mar 2007) | 1 line further refinement in wording of goto documentation, as per 9156, goto not proceeding to next instruction ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@57473 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-28Merged revisions 57118 via svnmerge from murf1-2/+13
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r57118 | murf | 2007-02-28 12:12:41 -0700 (Wed, 28 Feb 2007) | 1 line a small documentation update, to reflect reality in the goto doc strings, as per 9156, Goto does not proceed to next prio if jump fails ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@57139 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-26Use ast_strlen_zero to see if the language and/or context argument is not ↵file1-2/+2
present for Background instead of just checking if it is NULL. (issue #9141 reported by mjagdis) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@56805 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-01Merged revisions 53069 via svnmerge from tilghman1-2/+1
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r53069 | tilghman | 2007-02-01 13:13:53 -0600 (Thu, 01 Feb 2007) | 2 lines No wonder FIELDQTY doesn't work with functions... the documentation in pbx.c was wrong ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@53070 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-31Merged revisions 53045 via svnmerge from russell1-0/+7
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r53045 | russell | 2007-01-31 15:25:11 -0600 (Wed, 31 Jan 2007) | 3 lines Fix a bunch of places where pthread_attr_init() was called, but pthread_attr_destroy() was not. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@53046 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-18Add some more checks for option_debug before ast_log(LOG_DEBUG, ...) calls.qwell1-14/+25
Issue 8832, patch(es) by tgrman git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@51265 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-12Merged revisions 50561 via svnmerge from kpfleming1-1/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r50561 | kpfleming | 2007-01-12 08:34:15 -0600 (Fri, 12 Jan 2007) | 2 lines minor documentation clarification ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@50562 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-10Ensure data's existence before trying to access it. (issue #8774 reported by ↵file1-1/+1
rcourtna) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@50266 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-06Save 1 whopping byte of allocated memory!qwell1-8/+4
This looks like it may have been a chicken/egg scenario.. You had to call a cleanup func, because everything was allocated. Then since you had to call a cleanup func, you were forced to allocate - ie; strdup(""). git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49742 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-02Allow fractions of a second in the Wait() application, like it says it allows.qwell1-2/+3
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49189 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-27since these variables all have static duration, none of them need ↵kpfleming1-5/+5
initializers (they default to zero anyway) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49006 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-07These mods are to solve the problem in bug 7506. It's a lot of rework to ↵murf1-6/+3
solve a fairly small problem... such is life. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47303 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-02Reverse change of "show" to "list" and make several other commands more ↵tilghman1-11/+11
consistent with "category verb arguments" git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@47051 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-25WaitExten truncates decimals of times to wait, instead of accepting them ↵tilghman1-2/+3
(Bug 8208) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@46165 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-27Fix an issue with PLAYBACKSTATUS not being set under certain circumstances.qwell1-1/+3
Fix a minor issue, to make it use the filenames that were parsed, instead of the entire argument string. Fix Background() to return -1 like Playback(), if no args are specified. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43803 f38db490-d61c-443f-a65b-d21fe96a405b
2006-09-19similar patch for verbose vs debug with minor changesmogorman1-5/+6
bug 2617 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43272 f38db490-d61c-443f-a65b-d21fe96a405b