Commit Graph

223 Commits

Author SHA1 Message Date
Tilghman Lesher 2f44f53ea4 Merged revisions 100675 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r100675 | tilghman | 2008-01-28 15:02:02 -0600 (Mon, 28 Jan 2008) | 2 lines

WaitExten didn't handle AbsoluteTimeout properly (went to 't' instead of 'T')

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-28 21:05:29 +00:00
Russell Bryant f877028d76 Clean up some formatting, and simplify a bit of code using ast_str
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-28 14:27:28 +00:00
Joshua Colp 3a37332880 Print out a warning when spaces are used in the variable name in Set and MSet. It is extremely hard to debug this issue so this should make it easier.
(closes issue #11759)
Reported by: caio1982
Patches:
      setvar_space_warning1.diff uploaded by caio1982 (license 22)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-14 15:07:30 +00:00
Russell Bryant d0c89ab7ed Add a new CLI command, "core set chanvar", which allows you to set a channel
variable (or function) on an active channel from the CLI.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-12 19:34:38 +00:00
Tilghman Lesher 857e3412f4 Several manager changes:
1) Add the Dialplan class, for NewExten and VarSet events, which should cut
down on the volume of traffic in the Call class.
2) Permit some commands to be run from multiple classes, such as allowing
DBGet to be run from either the System or the Reporting class.
3) Heavily document each class in the sample config, as there were several
that made no sense to be in the write= line, and two that made no sense to be
in the read= line (since they controlled no permissions there).

(Closes issue #10386)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 00:12:35 +00:00
Russell Bryant 3e28c57081 Print out the name of a function being registered in color, just like the name
of applications when they get registered.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-05 22:04:08 +00:00
Mark Michelson 3b830da053 Merged revisions 95577 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r95577 | mmichelson | 2007-12-31 17:43:13 -0600 (Mon, 31 Dec 2007) | 9 lines

Avoiding a potentially bad locking situation. ast_merge_contexts_and_delete 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: https://origsvn.digium.com/svn/asterisk/trunk@95578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-31 23:44:45 +00:00
Mark Michelson 74577dd091 I needed to increment the numbers used on the VERBOSITY_ATLEAST calls by 1.
Thanks to kpfleming for pointing this out.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 19:19:07 +00:00
Mark Michelson 83f152b95c Changed VERBOSITY_LEVEL to VERBOSITY_ATLEAST to be more accurate.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 18:54:48 +00:00
Mark Michelson 4f75e15665 After reading Russell's e-mail to the dev list stating that checking option_verbose is not
equivalent to the check done by ast_verb, I wrote a macro, VERBOSITY_LEVEL, which does this
check. I did a quick look in the source and used this macro in some places where option_verbose
was used.

I also converted some verbose messages in logger.c to use ast_verb instead of ast_verbose.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@93042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 18:47:44 +00:00
Tilghman Lesher d5b454bf8d Convert ast_verbose to ast_verb.
Reported by: snuffy
Patch by: snuffy
(Closes issue #11547)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-14 14:48:38 +00:00
Jason Parker 7dbfcdecae Merged revisions 92809 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r92809 | qwell | 2007-12-13 14:13:48 -0600 (Thu, 13 Dec 2007) | 1 line

Make application help text a little more clear about the use of extensions in a filename.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@92810 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-13 20:14:26 +00:00
Jason Parker 02ea9face7 Add count of total number of calls processed by asterisk during it's lifetime.
Add number of total calls and current calls to SNMP.

Closes issue #10057, patch by jcmoore.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07 16:11:05 +00:00
Russell Bryant f52c068605 Merged revisions 90967 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r90967 | russell | 2007-12-04 13:57:39 -0600 (Tue, 04 Dec 2007) | 7 lines

Make some changes to some additions I made recently for doing channel 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: https://origsvn.digium.com/svn/asterisk/trunk@91011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-04 22:07:35 +00:00
Olle Johansson 25cbb792b9 (closes issue #11422)
Reported by: eliel
Patches: 
      core.show.hint.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90853 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-04 15:07:53 +00:00
Mark Michelson e3c122863d Removing a pointless check of option_debug
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28 22:17:38 +00:00
Mark Michelson 0b3ab17bfa Merged revisions 90059 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r90059 | mmichelson | 2007-11-28 16:08:50 -0600 (Wed, 28 Nov 2007) | 13 lines

Removing some seemingly pointless code. This sets a channel variable for 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: https://origsvn.digium.com/svn/asterisk/trunk@90060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28 22:10:36 +00:00
Jason Parker aa0f63d65f Remove "old"-style CLI handler, since nothing uses it anymore.
Closes issue #11403, patch by eliel.  This also completes the janitor project.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28 20:27:40 +00:00
Russell Bryant 880fb1ece9 Merged revisions 89893 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89893 | russell | 2007-11-27 18:20:13 -0600 (Tue, 27 Nov 2007) | 4 lines

 - update documentation for some of the goto functions to note that they
   handle locking the channel as needed
 - update ast_explicit_goto() to lock the channel as needed

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28 00:24:19 +00:00
Russell Bryant 79bc5ede5f Merged revisions 89839 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89839 | russell | 2007-11-27 17:16:00 -0600 (Tue, 27 Nov 2007) | 2 lines

Don't start/stop autoservice in pbx_extension_helper() unless a channel exists

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 23:17:36 +00:00
Steve Murphy 1f792f1745 closes issue #11294; missed the conditional unlock of the contexts when the hash table is used instead; also, used the ast_free_ptr as advised.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 22:14:55 +00:00
Russell Bryant 21a22fa584 Merged revisions 89790 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89790 | russell | 2007-11-27 15:45:51 -0600 (Tue, 27 Nov 2007) | 41 lines

Merge changes from team/russell/autoservice_1.4

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: https://origsvn.digium.com/svn/asterisk/trunk@89791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-27 22:05:36 +00:00
Russell Bryant b11f846e7e Merged revisions 89594 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89594 | russell | 2007-11-26 11:41:04 -0600 (Mon, 26 Nov 2007) | 3 lines

Add channel locking to a function that needed to be doing it.  This is just a
little something I noticed while working on a completely unrelated issue.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 17:49:47 +00:00
Steve Murphy 2ec4b57622 Thanks to pnlarsson for noting the spelling error in the cli commands. Also, added some verbage about the new algorithm to CHANGES.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 16:24:27 +00:00
Steve Murphy a63f6be669 closes issue #11363; where the pattern _20x. buried in an included context, didn't match 2012; There were a small set of problems to fix: 1. I needed NOT to score patterns unless you are at the end of the data string. 2. Capital N,X,Z and small n,x,z are OK in patterns. I canonicalize the patterns in the trie to caps. 3. When a pattern ends with dot or exclamation, CANMATCH/MATCHMORE should always report this pattern, no matter the length. With this commit, I also supplied the wish of Luigi, where the user can select which pattern matching algorithm to use, the old (legacy) pattern matcher, or the new, trie based matcher. The OLD matcher is the default. A new [general] section variable, extenpatternmatchnew, is added to the extensions.conf, and the example config has it set to false. If true, the new matcher is used. In all other respects, the context/exten structs are the same; the tries and hashtabs are formed, but in the new mode the tries are not used. A new CLI command 'dialplan set extenpatternmatch true/false' is provided to allow switching at run time. I beg users that are forced to return to the old matcher to please report the reason in the bug tracker. Measured the speed benefit of the new matcher against an impossibly large context with 10,000 extensions: the new matcher is 374 times faster.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-24 21:00:26 +00:00
Luigi Rizzo e0ff5fef5c remove a bunch of useless #include "options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:09:02 +00:00
Steve Murphy 55e03ad681 closes issue #11290; the proposed patch was a good guess, and would solve the bug to some extent, but was really masking the real issue, that there were bad entries in the table. This fix removes the condition that the hashtab updates be done on exten removal only when the pattern_tree was present, which is silly. The operations that apply to the pattern tree are instead made conditional. Also, threw back in routines that kpfleming deleted because of probs in the 64-bit world. Tested on both 32 and 64-bit machines (compile). Tested the reload problem with over 20 reloads, and no problems. If you find more problems, please reopen 11290.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 20:38:00 +00:00
Mark Michelson 29ad24e37a I introduced a deadlock avoidance into 1.4, which I attempted to port to trunk as well.
Unfortunately, since trunk uses read/write locks for the context lock, it means that I have
actually *introduced* a deadlock condition since they are not recursive. Removing this change
for now and will look into introducing a different one.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 16:08:12 +00:00
Kevin P. Fleming 34ed13becd remove some debugging code that doesn't compile on 64-bit platforms
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 15:29:39 +00:00
Steve Murphy 8e90425a6c A free in add_pri was ultimately the source of the grief we were having with parking. This set of changes fixes that problem, and introduces some more error messages, and puts debugs into ifdefs for what could be short-term usage. Txs to Terry W. for his help, guidance, and especially patience.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 01:09:47 +00:00
Luigi Rizzo a23c055c3d move asterisk/paths.h outside asterisk.h and into those files
who really need it.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 23:16:15 +00:00
Luigi Rizzo 915b97d300 move internal function declarations to include/asterisk/_private.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 22:18:21 +00:00
Mark Michelson dda649ead2 Merged revisions 89457 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89457 | mmichelson | 2007-11-20 11:50:31 -0600 (Tue, 20 Nov 2007) | 9 lines

According to comments in main/pbx.c, it is essential that if we are going to 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: https://origsvn.digium.com/svn/asterisk/trunk@89458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 17:59:00 +00:00
Steve Murphy f62bf52e55 Get rid of some debug messages in pbx.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 00:17:15 +00:00
Steve Murphy 4ea5eced10 These changes were made in response to niklas@tese.se's letter of 11-17-2007, where he had 20 and 201 in two different contexts, included in the same context. In that particular case, we were behaving the same as 1.4, but after experimenting, I quickly found that if 20 and 201 were in the same extension, 1.4 would return 201, and this code returns 20. These changes now enable the current code to replicate the behavior of 1.4 in respect to MATCHMORE in cases like this.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 22:55:38 +00:00
Luigi Rizzo 9335ace850 another bunch of include removals (errno.h and asterisk/logger.h)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 19:09:03 +00:00
Steve Murphy 406f6f2909 a correction to code involved in an extension removal
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 17:18:26 +00:00
Steve Murphy 1a5cdeb138 a quick fix to pbx_dundi.c to make it so it will compile. Hope I did the right thing. And some additions to removal of extens to take care of hashtab pointers in all cases.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-17 17:46:36 +00:00
Steve Murphy 7953c2c46f My goodness, haven't handled an extension deletion. Add code to ast_context_remove_extension2() to remove an extension from the trie. Done by marking it deleted. The scoreboard won't update for it any more. Also, a couple of calls to insert hashtab had a spurious ->exten, which was removed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 23:33:32 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Steve Murphy ab32ff2ad8 This corrects a hashtab removal, given a bad argument
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89330 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 19:26:54 +00:00
Steve Murphy 542f29ea0e This fixes a problem with pattern ranges; and corrects a situation in res_features, where an extension would be created with the name Zap/51, as an example. THe / is bad because it would tend to mean that the 51 is to be cid matched.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 18:59:02 +00:00
Steve Murphy eee92d0881 Get rid of a previously missed ast_log call for debug, no longer nec.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 16:50:16 +00:00
Steve Murphy 0bad49b3dd Perhaps I went overboard on initializing things. I can remove unnecc. stuff later. A few bug fixes. Killing small bugs on the way to killing bigger ones. Removed locking on hashtabs; there's plenty of locks already being taken. A small bug in the root_tree hashtab compare func.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 16:30:13 +00:00
Steve Murphy 620e580ed6 Had trouble playing with parking; spent a long time trying to reason out MATCHMORE mode. made these updates and xfers on zaptel lines seem to work ok now
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 01:42:12 +00:00
Steve Murphy 20d24e1027 Rescaled the weights of the patterns to give something more independent of pattern length; and make . less likely to win. Question: which should win for 14102241145-- _1xxxxxxx. or _XXXXXXXXXXX -- right now, the pure X pattern will win.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14 18:05:50 +00:00
Steve Murphy 225c94d950 A further problem highlighted by 11233 has been resolved; a certain combination of patterns in a certain order, led to a malformed trie, due to a ptr not being initialized in the loop. Also, some tree printing prettifications.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14 15:43:30 +00:00
Kevin P. Fleming a34bbab643 use simpler technique for removing known entries from lists
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14 00:54:38 +00:00
Steve Murphy fd1f6df25f This hopefully will fix the re-opened 11233. Hadn't covered the case of a context with no patterns. (blush)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-13 23:43:41 +00:00
Steve Murphy f0a7e86177 closes issue #11233 -- where some fine points in the algorithm to build the tree needed to be corrected. Many thanks for the test case, jtodd
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89256 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-13 21:19:11 +00:00
Jason Parker 50879dcb1d Merged revisions 89194 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89194 | qwell | 2007-11-12 14:46:52 -0600 (Mon, 12 Nov 2007) | 1 line

Fix a typo pointed out by De_Mon on #asterisk-dev
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12 20:48:57 +00:00
Steve Murphy 98429d37b2 Based on a note in asterisk-dev by Brian Capouch, I determined I too agressive in not initializing arrays passed to pbx_substitute_variables_xxxx; I reviewed the code (again) and hopefully found every possible spot where substitute_variables is called conditionally, and made sure the char array involved was set to a null string.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-12 18:44:36 +00:00
Steve Murphy a897556f7f This is the perhaps the biggest, boldest, most daring change I've ever committed to trunk. Forgive me in advance any disruption this may cause, and please, report any problems via the bugtracker. The upside is that this can speed up large dialplans by 20 times (or more). Context, extension, and priority matching are all fairly constant-time searches. I introduce here my hashtables (hashtabs), and a regression for them. I would have used the ast_obj2 tables, but mine are resizeable, and don't need the object destruction capability. The hashtab stuff is well tested and stable. I introduce a data structure, a trie, for extension pattern matching, in which knowledge of all patterns is accumulated, and all matches can be found via a single traversal of the tree. This is per-context. The trie is formed on the first lookup attempt, and stored in the context for future lookups. Destruction routines are in place for hashtabs and the pattern match trie. You can see the contents of the pattern match trie by using the 'dialplan show' cli command when 'core set debug' has been done to put it in debug mode. The pattern tree traversal only traverses those parts of the tree that are interesting. It uses a scoreboard sort of approach to find the best match. The speed of the traversal is more a function of the length of the pattern than the number of patterns in the tree. The tree also contains the CID matching patterns. See the source code comments for details on how everything works. I believe the approach general enough that any issues that might come up involving fine points in the pattern matching algorithm, can be solved by just tweaking things. We shall see. The current pattern matcher is fairly involved, and replicating every nuance of it is difficult. If you find and report problems, I will try to resolve than as quickly as I can. The trie and hashtabs are added to the existing context and exten structs, and none of the old machinery has been removed for the sake of the multitude of functions that use them. In the future, we can (maybe) weed out the linked lists and save some space.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-09 16:00:22 +00:00
Kevin P. Fleming edc78d6023 improve linked-list macros in two ways:
- the *_CURRENT macros no longer need the list head pointer argument
  - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 05:28:47 +00:00
Joshua Colp f440f8ba48 Fix up some PBX logic that became broken. The code would exit prematurely when it should have been collecting more digits.
(closes issue #11175)
Reported by: pj


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 23:08:36 +00:00
Mark Michelson 5a4867543d "show application <foo>" changes for clarity.
(closes issue #11171, reported and patched by blitzrage)

Many thanks!



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 19:04:45 +00:00
Russell Bryant 9bfd82cec2 Merged revisions 88805 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r88805 | russell | 2007-11-05 16:07:54 -0600 (Mon, 05 Nov 2007) | 12 lines

After seeing crashes related to channel variables, I went looking around at the
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: https://origsvn.digium.com/svn/asterisk/trunk@88934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-06 14:08:54 +00:00
Luigi Rizzo 08b10da53b Simplify the implementation and the API for stringfields;
details and examples are in include/asterisk/stringfields.h.

Not applicable to older branches except for 1.4 which will
receive a fix for the routines that free memory pools.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-04 19:44:31 +00:00
Tilghman Lesher e8c781b215 Add pbx_lua as a method of doing extensions
Reported by: mnicholson
Patch by: mnicholson
Closes issue #11140


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88250 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-02 15:36:34 +00:00
Tilghman Lesher b5c2bcb169 'h' extension doesn't execute past first priority
Reported by: dimas
Patch by: dimas
Closes bug #11146


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88209 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-02 12:54:31 +00:00
Tilghman Lesher 90db1316ed Modify WaitExten to include an optional dialtone
Closes issue #10783


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01 23:26:35 +00:00
Steve Murphy 63f2f04cf4 This commits the performance mods that give the priority processing engine in the pbx, a 25-30% speed boost. The two updates used, are, first, to merge the ast_exists_extension() and the ast_spawn_extension() where they are called sequentially in a loop in the code, into a slightly upgraded version of ast_spawn_extension(), with a few extra args; and, second, I modified the substitute_variables_helper_full, so it zeroes out the byte after the evaluated string instead of demanding you pre-zero the buffer; I also went thru the code and removed the code that zeroed this buffer before every call to the substitute_variables_helper_full. The first fix provides about a 9% speedup, and the second the rest. These figures come from the 'PIPS' benchmark I describe in blogs, conf. reports, etc.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01 22:26:51 +00:00
Joshua Colp 284721fdb1 Drop any more references to type in the Exception dialplan function.
(closes issue #11134)
Reported by: blitzrage
Patches:
      exception_patch.txt uploaded by blitzrage (license 10)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01 00:04:43 +00:00
Tilghman Lesher b6ec350910 Optimize pbx_substitute_variables
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87811 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31 15:46:41 +00:00
Jason Parker e985a00a32 Update documentation to give an example of how to use the return status of RaiseException
Closes issue #11117, patch by blitzrage (yay blitzrage)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-30 18:28:55 +00:00
Mark Michelson e0d13e169c The priority gets incremented after raising an exception, so the priority should be set to 0
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-30 17:07:26 +00:00
Mark Michelson e5f87bbac3 Jumped the gun a bit in the RaiseException app. It would always return -1
since it checked for the existence of something that will never exist.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-30 16:36:29 +00:00
Jason Parker ebe4050128 Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former didn't make much sense
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 20:05:18 +00:00
Jason Parker b0f3e6097e Convert NEW_CLI to AST_CLI.
Closes issue #11039, as suggested by seanbright.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19 18:29:40 +00:00
Tilghman Lesher c0fcb59d38 Merged revisions 85356 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r85356 | tilghman | 2007-10-10 23:35:33 -0500 (Wed, 10 Oct 2007) | 2 lines

A dollar sign by itself, not indicating a start of a variable or expression prematurely ends substitution (closes issue #10939)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-11 04:40:56 +00:00
Joshua Colp 094e9d8397 Don't register the exception function with module information. Since it is in the core there is none and it will explode.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-04 02:01:43 +00:00
Tilghman Lesher c2f7cc4bd4 Create a universal exception handling extension, "e" (closes issue #9785)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-03 22:14:09 +00:00
Tilghman Lesher 5139a2f6f7 Add MSet for people who prefer the old, deprecated syntax of Set (Closes issue #10549)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-02 18:12:49 +00:00
Jason Parker c7a9ec1691 (issue #10724)
Reported by: eliel
Patches:
      res_features.c.patch uploaded by eliel (license 64)
      res_agi.c.patch uploaded by seanbright (license 71)
      res_musiconhold.c.patch uploaded by seanbright (license 71)
      pbx.c.patch uploaded by moy (license 222)
      logger.c.patch uploaded by moy (license 222)
      frame.c.patch uploaded by moy (license 222)
      manager.c.patch uploaded by moy (license 222)
      http.c.patch uploaded by moy (license 222)
      dnsmgr.c.patch uploaded by moy (license 222)
      res_realtime.c.patch uploaded by eliel (license 64)
      res_odbc.c.patch uploaded by seanbright (license 71)
      res_jabber.c.patch uploaded by eliel (license 64)
      chan_local.c.patch uploaded by eliel (license 64)
      chan_agent.c.patch uploaded by eliel (license 64)
      chan_alsa.c.patch uploaded by eliel (license 64)
      chan_features.c.patch uploaded by eliel (license 64)
      chan_sip.c.patch uploaded by eliel (license 64)
      RollUp.1.patch (includes all of the above patches) uploaded by seanbright (license 71)

Convert many CLI commands to the NEW_CLI format.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82930 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 22:43:45 +00:00
Joshua Colp abe84c029f Merged revisions 82514 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82514 | file | 2007-09-16 23:00:59 -0300 (Sun, 16 Sep 2007) | 4 lines

(closes issue #10734)
Reported by: asgaroth
Instead of passing a NULL pointer into snprintf pass "". It makes Solaris much happier.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 02:02:09 +00:00
Mark Michelson 3a6e79ad80 Fixes Solaris build warnings
(closes issue #10698, reported and patched by snuffy)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 16:24:45 +00:00
Joshua Colp 56e74f0dde (closes issue #10603)
Reported by: jmls
Patches:
      pbx.diff uploaded by jmls (license 141)
Add REASON dialplan variable for when an originated call fails and the failed extension is executed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-30 14:42:41 +00:00
Tilghman Lesher f8c93488d5 Fix documentation for Set (closes issue #10549)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 19:50:16 +00:00
Steve Murphy 9836efb5fb This commit closes bug 7605, and half-closes 7638. The AEL code has been redistributed/repartitioned to allow code re-use both inside and outside of Asterisk. This commit introduces the utils/conf2ael program, and an external config-file reader, for both normal config files, and for extensions.conf (context, exten, prio); It provides an API for programs outside of asterisk to use to play with the dialplan and config files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-15 19:21:27 +00:00
Russell Bryant 668a334f85 Add another big set of doxygen documentation improvements from snuffy.
(closes issue #9892)
(closes issue #10395)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-07 23:04:01 +00:00
Joshua Colp 1e4bd7a192 Instead of adding the SOLARIS check to each HAVE_SYSINFO check let's just make the sysinfo autoconf logic a bit pickier about what it considers a usable sysinfo.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77878 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 19:37:59 +00:00
Joshua Colp a7aaa0bbc2 Solaris does not have a sysinfo like we know of on Linux.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77876 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 19:12:36 +00:00
Russell Bryant 4e0947c5f1 Convert code that checks the _softhangup member of ast_channel directory to use
the ast_check_hangup() funciton.  This function takes scheduled hangups into
account.
(closes issue #10230, patch by Juggie)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 15:39:54 +00:00
Tilghman Lesher 55b1ee298e Merge the dialplan_aesthetics branch. Most of this patch simply converts applications
using old methods of parsing arguments to using the standard macros.  However, the big
change is that the really old way of specifying application and arguments separated by
a comma will no longer work (e.g. NoOp,foo|bar).  Instead, the way that has been
recommended since long before 1.0 will become the only method available (e.g. NoOp(foo,bar).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 19:51:41 +00:00
Russell Bryant f1f72312bb (closes issue #10192)
Reported by: bbryant
Patches:
      20070720__core_debug_by_file.patch uploaded by bbryant (license 36)
	  (with some modifications by me)
Tested by: russell, bbryant

This set of changes introduces the ability to set the core debug or verbose
levels on a per-file basis.  Interestingly enough, in 1.4, you have the ability
to set core debug for a single file, but that functionality was accidentally
lost in the conversion of the CLI commands to the new format.

This patch improves upon what was in 1.4 by letting you set it for more than 1
file, and by also supporting verbose.

*** Janitor Project ***

This patch also introduces a new macro, ast_verb(), which is similar
to ast_debug().  Setting the per file verbose value only works for messages that
use this macro.  Converting existing uses of ast_verbose() can be done like:

if (option_debug > 2)
   ast_verbose(VERBOSE_PREFIX_3 "Something useful\n");

...

ast_verb(3, "Something useful\n");



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 14:21:41 +00:00
Tilghman Lesher 81bc1d7af5 Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 19:47:20 +00:00
Russell Bryant 9ffd55b6f9 Merged revisions 75403 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r75403 | russell | 2007-07-17 15:01:12 -0500 (Tue, 17 Jul 2007) | 12 lines

(closes issue #10209)
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: https://origsvn.digium.com/svn/asterisk/trunk@75404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:01:54 +00:00
Joshua Colp 344e6fd016 Change the function name slightly... just for kpfleming!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 18:38:28 +00:00
Joshua Colp e498488bde For my next trick I will make it so dialplan functions no longer need to call ast_module_user_add and ast_module_user_remove. These are now called in the ast_func_read and ast_func_write functions outside of the module.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 18:24:29 +00:00
Joshua Colp b8cd949cce Applications no longer need to call ast_module_user_add and ast_module_user_remove. This is now taken care of in the pbx_exec function outside of the application.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-16 14:39:29 +00:00
Steve Murphy 6a4efe5d5a In regards to changes for 9508, expr2 system choking on floating point numbers, I'm adding this update to round out (no pun intended) and make this FP-capable version of the Expr2 stuff interoperate better with previous integer-only usage, by providing Functions syntax, with 20 builtin functions for floating pt to integer conversions, and some general floating point math routines that might commonly be used also. Along with this, I made it so if a function was not a builtin, it will try and find it in the ast_custom_function list, and if found, execute it and collect the results. Thus, you can call system functions like CDR(), CHANNEL(), etc, from within $\[..\] exprs, without having to wrap them in $\{...\} (curly brace) notation. Did a valgrind on the standalone and made sure there's no mem leaks. Looks good. Updated the docs, too.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 18:15:22 +00:00
Russell Bryant d2a85e5f64 After some discussion on the asterisk-dev list, we determined that this approach
for extracting application, function, manager, and agi documentation is the wrong
one to take.  The most severe problem is that the output depends on which modules
are loaded as well as compile time options, which both determine which parts are
available.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02 23:02:16 +00:00
Russell Bryant 9aa28d2d3d Add "core dump funcdocs" CLI command
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02 17:11:53 +00:00
Russell Bryant f1468915c7 change the "core dump appdocs" CLI command to use the new API for creating
CLI commands


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02 16:42:47 +00:00
Tilghman Lesher 396a37eba8 Fix trunk brokenness; also, optimize application registration
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 23:31:08 +00:00
Steve Murphy 2462d5ab4f Cleaning up a small disaster I created earlier
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70607 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-20 23:26:07 +00:00
Russell Bryant b179e2155f Convert uses of strdup() to ast_strdup()
(issue #9983, eliel)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 23:01:01 +00:00
Kevin P. Fleming 5fdba27ea2 Merged revisions 69392 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r69392 | kpfleming | 2007-06-14 16:50:40 -0500 (Thu, 14 Jun 2007) | 2 lines

use ast_localtime() in every place localtime_r() was being used

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 22:09:20 +00:00
Jason Parker 63535ada60 Fixes for ast_strlen_zero() janitor project.
Issue 9968, patch by eliel.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 17:06:53 +00:00
Russell Bryant ff4fc97911 Convert pbx.c to use ast_debug() for debug logging.
(issue #9925, dimas)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12 16:13:45 +00:00