Commit Graph

269 Commits

Author SHA1 Message Date
Steve Murphy d0384ab3aa a small fix for a crash that occurs when compiling AEL with global vars
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-05 21:34:42 +00:00
Tilghman Lesher 12cf254253 MSet doesn't necessarily need chan to be set
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 20:34:52 +00:00
Tilghman Lesher 76506b7baa Move compatibility options into asterisk.conf, default them to on for upgrades,
and off for new installations.  This includes the translation from pipes to commas
for pbx_realtime and the EXEC command for AGI, as well as the change to the Set
application not to support multiple variables at once.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@120171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 22:05:16 +00:00
Tilghman Lesher 316e334751 Change space-zero to now evaluate to false, as is expected by a great many.
(Inspired by a post on the -users list)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-25 14:31:29 +00:00
Joshua Colp 0d85a0eff7 Add a missing context unlock.
(closes issue #12649)
Reported by: ys
Patches:
      pbx.c.diff uploaded by ys (license 281)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 21:11:49 +00:00
Jeff Peeler 4729632721 Fixed a few problems with multiparking: call not being parked in the correct parking spot, caller not being notified of parking spot position, and improperly hanging up the call during a transfer due to timing out (not providing the extension in which to transfer).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@116297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-14 16:52:30 +00:00
Russell Bryant e40c662a06 Merged revisions 115551 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r115551 | russell | 2008-05-08 10:24:54 -0500 (Thu, 08 May 2008) | 4 lines

Don't use a channel before checking for channel allocation failure.
(closes issue #12609)
Reported by: edantie

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-08 15:26:49 +00:00
Dwayne M. Hubbard ca4ae77c91 pbx uses a taskprocessor for device state changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-03 04:12:54 +00:00
Tilghman Lesher b5a127daac Modify TIMEOUT() to be accurate down to the millisecond.
(closes issue #10540)
 Reported by: spendergrass
 Patches: 
       20080417__bug10540.diff.txt uploaded by Corydon76 (license 14)
 Tested by: blitzrage


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-01 23:06:23 +00:00
Tilghman Lesher 6a81da594d Add incomplete matching to PBX code and app_dial
(closes issue #12351)
 Reported by: Corydon76
 Patches: 
       20080402__pbx_incomplete__3.diff.txt uploaded by Corydon76 (license 14)
       pbx_incomplete_with_timeout.diff uploaded by fabled (license 448)
 Tested by: Corydon76, fabled


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-28 16:37:45 +00:00
Joshua Colp c3dd5e3e27 Merged revisions 114579 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114579 | file | 2008-04-23 11:54:11 -0300 (Wed, 23 Apr 2008) | 4 lines

Instead of stopping dialplan execution when SayNumber attempts to say a large number that it can not print out a message informing the user and continue on.
(closes issue #12502)
Reported by: bcnit

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-23 14:55:03 +00:00
Steve Murphy 76155d60ce (closes issue #12469)
Reported by: triccyx

I had a bit a problem reproducing this in my setup (trying not to disturb my other stuff)
but finally, I got it. The problem appears to be that the extension is being added in
replace mode, which kinda assumes that the pattern trie has been formed, when in fact,
in this case, it was not. The checks being done are not nec. when the tree is not yet
formed, as changes like this will be summarized when the trie is formed in the future.

I tested the fix, and the crash no longer happens. Feel free to open the bug again if
this fix doesn't cure the problem.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 21:57:57 +00:00
Jason Parker 6f549bc324 Allow setqueuevar=yes (et al) to work, after changes to pbx_builtin_setvar()
(closes issue #12490)
Reported by: bcnit
Patches:
      12490-queuevars-3.diff uploaded by qwell (license 4)
Tested by: qwell


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-22 18:14:09 +00:00
Steve Murphy 5b4222c9de These changes:
a. fix a self-found problem with SPAWN-ing an extension,
      where matches were not being found
   b. correct some wording in a comment
   c. Add some debug for future debugging.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-15 19:59:50 +00:00
Mark Michelson 28bd5d88c1 There was a subtle logical difference between 1.4 and trunk with regards to how timeouts
were handled. In 1.4, if the absolute timeout were reached on a call, no matter what
the return value of ast_spawn_extension was, the pbx would attempt to go to the 'T'
extension or hangup otherwise. The rearrangement of this function in trunk made this check
only happen in the case that ast_spawn_extension returned 0. If ast_spawn_extension returned
1, then the fact that the timeout expired resulted in a no-op, and would cause an infinite
loop to occur in __ast_pbx_run. This change fixes this problem. Now timeouts will
behave as they did in 1.4

(closes issue #11550)
Reported by: pj
Tested by: putnopvut



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@113836 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-09 17:48:33 +00:00
Steve Murphy da41d47a83 Bumped across another test set for the new exten pattern matcher, which revealed a problem with the CANMATCH/MATCHMORE modes. Direct matches were getting in the way. Fixed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-01 22:45:10 +00:00
Steve Murphy 2fb0bfba35 (closes issue #12298)
Reported by: falves11
Patches:
      12298.patch1 uploaded by murf (license 17)
Tested by: murf

I have hopes that the changes made over the last few days will
finalize and solidify this code. While there are bound to be 
small tweaks still needed, I feel that the job (at last) is
somewhat completed. Finally, I had a chance to comprehend how
the scoring of extension patterns was done in the previous
version, and I've come very close to using the exact same
criteria in the new pattern matching code. The left-right
sorting is now replicated in the trie structure itself, such
that the first match found will the 'best' match. Compared
the results against 1.4 for several extensions. Replicated
falves11's setup and it works. Used some devious patterns
provided by jsmith, supplemented with a few of my own.
Looks good.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@112289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-01 20:02:19 +00:00
Steve Murphy 3d4cb09ae8 comment cleanup and iron out a really dumb mistake in handling the '.'-wildcard in the new exten pattern matcher.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-27 21:25:55 +00:00
Steve Murphy 6928ccfa02 Merged revisions 111391 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r111391 | murf | 2008-03-27 07:03:28 -0600 (Thu, 27 Mar 2008) | 9 lines

These small documentation updates made in response to a query in
asterisk-users, where a user was using Playback, but needed the
features of Background, and had no idea that Background existed,
or that it might provide the features he needed. I thought the
best way to avert these kinds of queries was to provide "See Also"
references in all three of "Background", "Playback", "WaitExten".
Perhaps a project to do this with all related apps is in order.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-27 13:29:41 +00:00
Joshua Colp e097cc7221 Add the ability to use a pattern match for a hint.
(closes issue #7767)
Reported by: Corydon76
Patches:
      20070314__simple_hint_lookup.diff.txt uploaded by Corydon76
      pbx-trunk-98436.diff uploaded by plack (license 365)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 16:54:12 +00:00
Russell Bryant 4c6486782f Fix some more breakage that I introduced when changing extension state callbacks to the list macros.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 15:45:49 +00:00
Russell Bryant 89ad4ace67 Remove an unneeded variable. This compiled, but I missed the uninitialized warning
because I always compile without optimizations turned on.  Sorry!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 15:22:13 +00:00
Russell Bryant b47eee2187 Convert handling of extension state callbacks to the list macros.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 04:32:13 +00:00
Russell Bryant e1bd198bc0 Minor coding style changes, including adding handling for memory allocation failure
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-19 04:14:12 +00:00
Steve Murphy 0af58d3f5c (closes issue #12238)
Reported by: mvanbaak
Tested by: murf, mvanbaak

Due to a bug that occurred when merge_contexts_and_delete scanned the "old" or existing contexts, and found a context
that doesn't exist in the new set, yet owned by a different registrar. The context is created in the new set, with the
old registrar, and and all the priorities and extens that have a different registrar are copied into it. But, not the
includes, ignorepats, and switches. I added code to do this immediately after the context is created.

This still leaves a logical hole in the code. If you define a context in two places, (eg. in extensions.conf and also 
in extensions.ael), and they both have includes, but different in composition, no new context will be generated, and
therefore the 'old' includes, switches, and ignorepats will not be copied. I'd have added code to simply add any non-duplicates
into the 'new' context that had a different registrar, but there is one big complication: includes, and switches are definitely
order dependent. (ignorepats I'm not sure about). And we'll have to develop some sort of policy about how we 
merge order dependent lists, especially if the intersection of the two sets is empty. (in other words, they do not have any
elements in common). Do the new go first, or the old? I've elected to punt this issue until a user complains. Hopefully,
this is pretty rare thing.




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-17 17:47:36 +00:00
Russell Bryant 072eb8a913 Remove a double write lock of the contexts lock in ast_wrlock_contexts().
How did this ever work?

(closes issue #12219)
Reported by: ys
Patches: 
      pbx.c.diff uploaded by ys (license 281)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-15 16:21:04 +00:00
Tilghman Lesher bdad3c9889 (closes issue #6019)
Reported by: ssokol
 Patches: 
       20080304__bug6019.diff.txt uploaded by Corydon76 (license 14)
 Tested by: putnopvut


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 21:48:20 +00:00
Russell Bryant 0ee1f43b4a Merged revisions 107161 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r107161 | russell | 2008-03-10 15:17:11 -0500 (Mon, 10 Mar 2008) | 8 lines

Fix another bug specifically related to asynchronous call origination.  Once the
PBX is started on the channel using ast_pbx_start(), then the ownership of the
channel has been passed on to another thread.  We can no longer access it in this
code.  If the channel gets hung up very quickly, it is possible that we could
access a channel that has been free'd.

(inspired by BE-386)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 20:17:37 +00:00
Russell Bryant 2d95fb33bd Merged revisions 107158 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r107158 | russell | 2008-03-10 15:04:27 -0500 (Mon, 10 Mar 2008) | 9 lines

Fix some bugs related to originating calls.  If the code failed to start a PBX
on the channel (such as if you set a call limit based on the system's load
average), then there were cases where a channel that has already been free'd
using ast_hangup() got accessed.  This caused weird memory corruption and
crashes to occur.

(fixes issue BE-386)
(much debugging credit goes to twilson, final patch written by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@107159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-10 20:05:12 +00:00
Steve Murphy 377e51c4d4 (closes issue #6002)
Reported by: rizzo
Tested by: murf

Proposal of the changes to be made, and then an announcement of how they were accomplished:

http://lists.digium.com/pipermail/asterisk-dev/2008-February/032065.html

and:

http://lists.digium.com/pipermail/asterisk-dev/2008-March/032124.html

Here is a recap, file by file, of what I have done:

pbx/pbx_config.c
pbx/pbx_ael.c

All funcs that were passed a ptr to the context list, now will ALSO be passed a hashtab ptr to the same set.
Why? because (for the time being), the dialplan is stored in both, to facilitate a quick, low-cost move to
hash-tables to speed up dialplan processing. If it was deemed necessary to pass the context LIST, well, it
is just as necessary to have the TABLE available. This is because the list/table in question might not be
the global one, but temporary ones we would use to stage the dialplan on, and then swap into the global
position when things are ready.

We now have one external function for apps to use, "ast_context_find_or_create()" instead of the pre-existing
"find" and "create", as all existing usages used both in tandem anyway.

pbx_config, and pbx_ael, will stage the reloaded dialplan into local lists and tables, and 
then call merge_contexts_and_delete, which will merge (now) existing contexts and 
priorities from other registrars into this local set by copying them. Then, merge_contexts_and_delete will
lock down the contexts, swap the lists and tables, and unlock (real quick), and then 
destroy the old dialplan.



chan_sip.c
chan_iax.c
chan_skinny.c

All the channel drivers that would add regcontexts now use the ast_context_find_or_create now.

chan_sip also includes a small fix to get rid of warnings about removing priorities that never got entered.


apps/app_meetme.c
apps/app_dial.c
apps/app_queue.c

All the apps that added a context/exten/priority were also modified to use ast_context_find_or_create instead.


include/asterisk/pbx.h

ast_context_create() is removed. Find_or_create_ is the new method.
ast_context_find_or_create()  interface gets the hashtab added.
ast_merge_contexts_and_delete() gets the local hashtab arg added.
ast_wrlock_contexts_version() is added so you can detect if someone else got a writelock between your readlocking and writelocking.
ast_hashtab_compare_contexts was made public for use in pbx_config/pbx_ael
ast_hashtab_hash_contexts was in like fashion make public.


include/asterisk/pval.h

ast_compile_ael2() interface changed to include the local hashtab table ptr.


main/features.c

For the sake of the parking context, we use ast_context_find_or_create().



main/pbx.c

I changed all the "tree" names to "table" instead. That's because the original
implementation was based on binary trees. (had a free library). Then I moved
to hashtabs. Now, the names move forward too.

refcount field added to contexts, so you can keep track of how many modules
wanted this context to exist.

Some log messages that are warnings were inflated from LOG_NOTICE to LOG_WARNING.

Added some calls to ast_verb(3,...) for debug messages

Lots of little mods to ast_context_remove_extension2, which is now excersized in ways
it was not previously; one definite bug fixed.

find_or_create was upgraded to handle both local lists/tables as well as the globals.

context_merge() was added to do the per-context merging of the old/present contexts/extens/prios into the new/proposed local list/tables

ast_merge_contexts_and_delete() was heavily modified.

ast_add_extension2() was also upgraded to handle changes. 

the context_destroy() code was re-engineered to handle the new way of doing things,
by exten/prio instead of by context.



res/ael/pval.c
res/ael/ael.tab.c
res/ael/ael.tab.h
res/ael/ael.y
res/ael/ael_lex.c
res/ael/ael.flex
utils/ael_main.c
utils/extconf.c
utils/conf2ael.c
utils/Makefile

Had to change the interface to ast_compile_ael2(), to include the hashtab ptr.
This ended up involving several external apps.  The main gotcha was I had to 
include lock.h and hashtab.h in several places.


As a side note, I tested this stuff pretty thoroughly, I replicated the problems
originally reported by Luigi, and made triply sure that reloads worked, and everything
worked thru "stop gracefully". I found a and fixed a few bugs as I was merging into
trunk, that did not appear in my tests of bug6002.

How's this for verbose commit messages?




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 18:57:57 +00:00
Mark Michelson 924b7d3636 Merged revisions 106437 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r106437 | mmichelson | 2008-03-06 16:10:07 -0600 (Thu, 06 Mar 2008) | 8 lines

Quell an annoying message that is likely to print every single time that 
ast_pbx_outgoing_app is called. The reason is that __ast_request_and_dial
allocates the cdr for the channel, so it should be expected that the channel
will have a cdr on it.

Thanks to joetester on IRC for pointing this out


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-06 22:11:26 +00:00
Tilghman Lesher cfc1df4c1a Whitespace changes only
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 23:04:29 +00:00
Russell Bryant 6d3b251588 - Add curly braces around the while loop
- Properly break out of the loop on error when an included context is not found


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 04:28:48 +00:00
Russell Bryant 71173779dc Use ast_copy_string() instead of strncpy(), and use sizeof() instead of
a magic number


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105589 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04 04:26:39 +00:00
Jason Parker 62c63a8412 Merged revisions 105005 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r105005 | qwell | 2008-02-28 13:20:10 -0600 (Thu, 28 Feb 2008) | 9 lines

Make pbx_exec pass an empty string into applications, if we get NULL.
This protects against possible segfaults in applications that may try
 to use data before checking length (ast_strdupa'ing it, for example)

(closes issue #12100)
Reported by: foxfire
Patches:
      12100-nullappargs.diff uploaded by qwell (license 4)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-28 19:21:15 +00:00
Joshua Colp 2a7eac9940 Add an 'e' option to ResetCDR which re-enables a CDR that has been disabled.
(closes issue #11170)
Reported by: kratzers
Patches:
      ResetCDR.1.diff uploaded by kratzers (license 307)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@104215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-26 19:14:04 +00:00
Joshua Colp e6a260c747 Add an API call (ast_async_parseable_goto) which parses a goto string and does an async goto instead of an explicit goto.
(closes issue #11753)
Reported by: johan


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103765 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 15:47:00 +00:00
Tilghman Lesher 26755e3882 Context tracing for channels
(closes issue #11268)
 Reported by: moy
 Patches: 
       chantrace-datastored-encapsulated-rev94934.patch uploaded by moy (license 222)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103754 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18 04:43:33 +00:00
Mark Michelson 566a005512 Add proper "false" case behavior to GotoIfTime
(closes issue #11719)
Reported by: kshumard
Patches:
      gotoiftime.twobranches.patch uploaded by kshumard (license 92)
	  Tested by: kshumard



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-15 23:07:12 +00:00
Joshua Colp c81350d6f6 Just some minor coding style cleanup...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-11 18:27:47 +00:00
Joshua Colp ef267cd838 Fix Manager Redirect while in an AGI.
(closes issue #10661)
Reported by: junky


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-11 17:25:04 +00:00
Russell Bryant 1ec8cb41a8 Merge changes from team/mvanbaak/cli-command-audit
(closes issue #8925)

About a year ago, as Leif Madsen and Jim van Meggelen were going over the CLI
commands in Asterisk 1.4 for the next version of their book, they documented
a lot of inconsistencies.  This set of changes addresses all of these issues
and has been reviewed by Leif.

While this does introduce even more changes to the CLI command structure, it
makes everything consistent, which is the most important thing.

Thanks to all that helped with this one!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-08 21:26:32 +00:00
Mark Michelson fe9821cc10 Get rid of any remaining ast_verbose calls in the code in favor of
ast_verb

(closes issue #11934)
Reported by: mvanbaak
Patches:
      20080205_astverb-2.diff.txt uploaded by mvanbaak (license 7)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-05 23:00:15 +00:00
Jason Parker dc6e5d6aae Change where priority of a goto is adjusted.
Partially reverts 102272.

Closes issue #11929
(credit to file for fix suggestion - we still <3 you)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-05 20:51:50 +00:00
Joshua Colp c6fc44f927 Update handling of asyncgoto so it properly works on channels that are currently executing a PBX.
(closes issue #11914)
Reported by: arnd
(closes issue #11753)
Reported by: johan


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-04 15:16:05 +00:00
Steve Murphy 671c08af6d Merged revisions 101480 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r101480 | murf | 2008-01-31 12:30:37 -0700 (Thu, 31 Jan 2008) | 1 line

closes issue #11845; that's the one where there's a 1004 byte cdr leak with every AMI Redirect to a zap channel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@101481 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-31 19:43:40 +00:00
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