Commit Graph

536 Commits

Author SHA1 Message Date
Kevin P. Fleming
50a28e9853 improve header inclusion process in a few small ways:
- it is no longer necessary to forcibly include asterisk/autoconfig.h; every module already includes asterisk.h as its first header (even before system headers), which serves the same purpose
  - astmm.h is now included by asterisk.h when needed, instead of being forced by the Makefile; this means external modules will build properly against installed headers with MALLOC_DEBUG enabled
  - simplify the usage of some of these headers in the AEL-related stuff in the utils directory


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@144924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-27 15:00:48 +00:00
Doug Bailey
d4748ad3c3 Adjust for technology when generating user extension
(issue #13332)
Reported by: wizzy
Tested by: bkruse


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@143612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-19 16:17:14 +00:00
Steve Murphy
00256a00c2 (closes issue #13357)
Reported by: pj
Tested by: murf

(closes issue #13416)
Reported by: yarns
Tested by: murf

If you find this message overly verbose, relax, it's probably
not meant for you. This message is meant for probably only
two people in the whole world: me, or the poor schnook that
has to maintain this code because I'm either dead or unavailable
at the moment.

This fix solves two reports, both having to do with embedding
a function call in a ${} construct. It was tricky because the
funccall syntax has parenthesis () in it. And up till now,
the 'word' token in the flex stuff didn't allow that, because
it would tend to steal the LP and RP tokens. To be truthful,
the "word" token was the trickiest, most unstable thing in
the whole lexer. I was lucky it made this long without complaints.
I had to choose every character in the pattern with extreme
care, and I knew that someday I'd have to revisit it. Well,
the day has come.

So, my brilliant idea (and I'm being modest), was to use the 
surrounding ${} construct to make a state machine and capture 
everything in it, no matter what it contains. But, I have to now
treat the word token like I did with comments, in that I turn
the whole thing into a state-machine sort of spec, with new
contexts "curlystate", "wordstate", and "brackstate".

Wait a minute, "brackstate"? Yes, well, it didn't take very many
regression tests to point out if I do this for ${} constructs,
I also have to do it with the $[] constructs, too.

I had to create a separate pcbstack2 and pcbstack3 because
these constructs can occur inside macro argument lists, and
when we have two state machines operating on the same structures
we'd get problems otherwise. I guess I could have stopped at
pcbstack2 and had the brackstate stuff share it, but it doesn't
hurt to be safe. So, the pcbpush and pcbpop routines also now
have versions for "2" and "3".

I had to add the {KEYWORD} construct to the initial pattern for
"word", because previously word would match stuff like "default7",
because it was a longer match than the keyword "default". But,
not any more, because the word pattern only matches only one or
two characters now, and it will always lose. So, I made it the
winner again by making an optional match on any of the keywords
before it's normal pattern.

I added another regression test to make sure we don't
lose this in future edits, and had to fix just one regression,
where it no longer reports a 'cascaded' error, which I guess
is a plus.

I've given some thought as to whether to apply these fixes to
1.4 and the 1.6.x releases, vs trunk; I decided to put it in
1.4 because one of the bug reports was against 1.4; and it
is unexpected that AEL cannot handle this situation. It actually
reduced the amount of useless "cascade" error messages that
appeared in the regressions (by one line, ehhem). There is
a possible side-effect in that it does now do more careful
checking of what's in those ${} constructs, as far as matching
parens, and brackets are concerned. Some users may find a an
insidious problem and correct it this way. This should be 
exceedingly rare, I hope.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@141094 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-09-04 23:15:07 +00:00
Steve Murphy
195fe34304 (closes issue #13236)
Reported by: korihor

Wow, this one was a challenge!

I regrouped and ran a new strategy for
setting the ~~MACRO~~ value; I set it once
per extension, up near the top. It is only
set if there is a switch in the extension.

So, I had to put in a chunk of code to detect
a switch in the pval tree.

I moved the code to insert the set of ~~exten~~
up to the beginning of the gen_prios routine, 
instead of down in the switch code.

I learned that I have to push the detection
of the switches down into the code, so everywhere
I create a new exten in gen_prios, I make sure
to pass onto it the values of the mother_exten
first, and the exten next.

I had to add a couple fields to the exten
struct to accomplish this, in the ael_structs.h
file. The checked field makes it so we don't
repeat the switch search if it's been done.

I also updated the regressions.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@136726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-08 00:15:34 +00:00
Tilghman Lesher
da57d237e6 Specify codecs in callfiles and manager, to allow video calls to be set up
from callfiles and AMI.
(closes issue #9531)
 Reported by: Geisj
 Patches: 
       20080715__bug9531__1.4.diff.txt uploaded by Corydon76 (license 14)
       20080715__bug9531__1.6.0.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-31 21:53:19 +00:00
Steve Murphy
aaf314cf46 (closes issue #13197)
Reported by: pj

(closes issue #13051)
Reported by: pj

This patch substitutes commas in the expr 
supplied to the if () statement, as in
if ( expr ) ...

This solves both the bugs above, and makes
the source symmetric with switch statements,
which were earlier reported to need this sort
of treatment.

I tested this using the examples, both for
the compiler and at run time. Looks good.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 22:02:07 +00:00
Russell Bryant
a3bc8d9d7c Reduce stack consumption by 12.5% of the max stack size to fix a crash when
compiled with LOW_MEMORY.

(closes issue #13154)
Reported by: edantie


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@134595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30 20:37:17 +00:00
Steve Murphy
3fcfa47611 (closes issue #13090)
Reported by: murf

The problem was that, esoteric as it is, because the hangerupper
context immediately preceded the std-priv-extent macro, that 
the checking code accidentally would fall from traversing hangerupper
into the std-priv-exten macro, where it would hit the hangerupper
in the 'includes', and proceed into an infinite recursion.

A small fix to traverse into the statements of the context instead
of the context solves this issue.

I also added some commented out printfs for debug, which were pretty
handy in the face of a dorky gdb.

This was a problem around since the package was first written;
but evidently pretty rare in turning up in the field.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@131242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-16 17:53:43 +00:00
Michiel van Baak
32a392ae0c in 1.4 the functions still have | as argument seperator.
This commit fixes the use of RAND in the ael random function.

(closes issue #13061)
Reported by: danpwi


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@130373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-12 10:25:52 +00:00
Tilghman Lesher
7073477f44 Move the free down one
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@128029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-04 16:11:03 +00:00
Tilghman Lesher
e9d086a277 Fix the 'dialplan remove extension' logic, so that it a) works with cidmatch,
and b) completes contexts correctly when the extension is ambiguous.
(closes issue #12980)
 Reported by: licedey
 Patches: 
       20080703__bug12980.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@127973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-04 03:30:30 +00:00
Kevin P. Fleming
31a9e3085d ignore warnings for prototypes in GTK headers
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@126395 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-29 18:05:34 +00:00
Tilghman Lesher
29261555d4 Set the variables top-down, so that if a script sets a variable more than once,
the last one will take precedence.
(closes issue #12673)
 Reported by: phber
 Patches: 
       20080519__bug12673.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123710 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-18 20:22:42 +00:00
Jeff Peeler
f9818af8dd Adds DAHDI support alongside Zaptel. DAHDI usage favored, but all Zap stuff should continue working. Release announcement to follow.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@122314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-12 19:08:20 +00:00
Russell Bryant
be1dc4a3da Make the "dialplan remove include" CLI command actually work. Also, tweak
some formatting, and make the success message a little bit more clear.
(closes AST-52)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 16:26:43 +00:00
Joshua Colp
7b230ded04 Fix a log message and add a message for when the dialplan is done reloading.
(closes issue #12716)
Reported by: chappell
Patches:
      dialplan_reload_2.diff uploaded by chappell (license 8)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-04 13:31:09 +00:00
Tilghman Lesher
815951acdc Due to incorrect use of the AST_LIST_INSERT_HEAD() macro the loopback switch
cannot perform any translation on the extension number before searching for it
in the target context.
(closes issue #12473)
 Reported by: chappell
 Patches: 
       pbx_loopback.c.diff uploaded by chappell (license 8)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@120226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 22:41:04 +00:00
Steve Murphy
6f93af198e Updated the regressions on AEL. Hadn't updated
this for the changes I made to preserve ${EXTEN}
in switches, which affected several tests because
it adds extra priorities, and at least one needed to be updated
because of the removal of the empty extension warning
message.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119966 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 15:26:56 +00:00
Steve Murphy
bfd56d7f25 as per http://lists.digium.com/pipermail/asterisk-users/2008-June/212934.html,
which is a message from Philipp Kempgen, requesting that the WARNING
that an extension is empty be reduced to a NOTICE or less, as empty
extensions are syntactically possible, and no big deal.

With which I agree, and have removed that WARNING message entirely.
I think it is not necessary to see this message. It didn't 
state that a NoOp() was inserted automatically on your behalf,
and really, as users, who cares? Why freak out dialplan writers
with unnecessary warnings? The details of the machinations a compiler goes
thru to produce working assembly code is of little interest
to most programmers-- we will follow the unix principal of
doing our work silently.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-03 14:49:46 +00:00
Tilghman Lesher
7cf2eecaf6 Revert accidental commit of the last change
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:44:53 +00:00
Tilghman Lesher
0b0f6a1a58 Strip the preamble from the output also when -rx is not being used
(Related to issue #12702)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:40:14 +00:00
Russell Bryant
2c4b2d92dd 1) Don't print the verbose marker in front of every message from ast_verbose()
being sent to remote consoles.

2) Fix pbx_gtkconsole to filter out the verbose marker.

(related to issue #12702)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@117507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-21 18:19:34 +00:00
Steve Murphy
0ce3eb0e2a (closes issue #12302)
Reported by: pj
Tested by: murf

These changes will set a channel variable ~~EXTEN~~ just before generating code
for a switch, with the value of ${EXTEN}. The exten is marked as having a switch, 
and ever after that, till the end of the exten, we substitute any ${EXTEN} 
with ${~~EXTEN~~} instead in application arguments; (and the ${EXTEN: also). 
The reason for this, is that because switches are coded using 
separate extensions to provide pattern matching, and
jumping to/from these switch extensions messes up the ${EXTEN} value, 
which blows the minds of users.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@111341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-27 03:21:05 +00:00
Steve Murphy
7f77c58ed5 (closes issue #11903)
Reported by: atis

Many thanks to atis for spotting this problem and reporting it.
The fix was to straighten out how items are placed on and removed
from the file stack. Regressions as well as the provided test case
helped to straighten out all code paths. valgrind was used to make
sure all memory allocated was freed.

Sorry for not solving this earlier. I got distracted.

Added the ntest23 regression test, which is mainly a copy of ntest22, 
but with a few juicy errors thrown in, to replicate the kind of 
error that atis spotted.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@109309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18 06:37:15 +00:00
Kevin P. Fleming
553070456b fix up various compiler warnings found with gcc-4.3:
- the output of flex includes a static function called 'input' that is not used, so for the moment we'll stop having the compiler tell us about unused variables in the flex source files (a better fix would be to improve our flex post-processing to remove the unused function)

- main/stdtime/localtime.c makes assumptions about signed integer overflow, and gcc-4.3's improved optimizer tries to take advantage of handling potential overflow conditions at compile time; for now, suppress these optimizations until we can fiure out if the code needs improvement

- main/udptl.c has some references to uninitialized variables; in one case there was no bug, but in the other it was certainly possibly for unexpected behavior to occur

- main/editline/readline.c had an unused variable



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@107352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-11 11:04:29 +00:00
Kevin P. Fleming
5b8cef7ecb ensure that all remaining multi-object modules are built using their proper CFLAGS and include directory paths
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@102627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-06 11:48:48 +00:00
Tilghman Lesher
7060a6888d When deleting a task from the scheduler, ignoring the return value could
possibly cause memory to be accessed after it is freed, which causes all
sorts of random memory corruption.  Instead, if a deletion fails, wait a
bit and try again (noting that another thread could change our taskid
value).
(closes issue #11386)
 Reported by: flujan
 Patches: 
       20080124__bug11386.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, flujan, stuarth`


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@100465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-27 21:59:53 +00:00
Russell Bryant
665c498c52 Fix up setting the EID on BSD based systems.
(closes issue #11646)
Reported by: caio1982
Patches:
      dundi_osx_eid6.diff.txt uploaded by caio1982 (license 22)
      dundi_osx_eid6-1.4.diff uploaded by caio1982 (license 22)
Tested by: caio1982, mvanbaak


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@98390 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-11 22:46:21 +00:00
Steve Murphy
b04af32888 Applied the same fixes for ael.flex as was done in 97849 for ast_expr2.fl; overrode the normally generate yyfree func with our own version that checks the pointer for non-null before passing to free(). Also takes care of a little problem with 2.5.33 and the use of the __STDC_VERSION__ macro.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 21:37:10 +00:00
Russell Bryant
142e5dd457 Remove other remnants of pbx_kdeconsole
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97753 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 16:19:47 +00:00
Russell Bryant
742fd8127c Remove pbx_kdeconsole from the tree. It hasn't worked in ages, and nobody has
complained.
(closes issue #11706, reported by caio1982)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10 16:10:09 +00:00
Russell Bryant
3378ef39fd Strip terminal sequences from the verbose messages
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97645 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 23:01:48 +00:00
Russell Bryant
d8004449d5 Make pbx_gtkconsole build ... but doesn't actually load on my system still
(related to issue #11706)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@97640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09 22:26:33 +00:00
Russell Bryant
ec8a896935 Convert locks of the contexts list in pbx_config to the appropriate rdlock or wrlock
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02 22:14:28 +00:00
Russell Bryant
93748ccb9c pbx_dundi only needs a rdlock on the contexts list.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@96022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-02 22:04:47 +00:00
Kevin P. Fleming
fd1e942f53 fix some copy-and-paste leftovers
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 07:21:08 +00:00
Kevin P. Fleming
627f595c58 In http://lists.digium.com/pipermail/asterisk-dev/2007-December/031145.html,
rizzo brought up some issues related to the way that the metadata required
for menuselect and the rest of the build system is extracted from the source
files. Since I had a few hours to kill on an airplane today, I decided to
improve this situation... so now the system caches the extracted metadata
and uses it to build the menuselect 'tree' as much as it can. The result
of this is that when a single source file is changed, only the metadata for
that file needs to be extracted again, and the rest is used from the cache
files. I also reduced the number of forked processes required to do the
metadata extraction; it was actually possible to do most of what we needed
in the Makefiles themselves without using any shell scripts at all! On my
laptop, these changes resulted in an 80% decrease in the time required
for the 'menuselect.makeopts' automatic check to occur after editing a single
source file.

While doing this work I also cleaned up a few minor things in the Makefiles,
adding a check for 'awk' to the configure script and changed all remaining
places we use 'grep' or 'awk' to use the ones found by the configure script,
and changed the 'prep_tarball' script to build the menuselect metadata so
that tarballs of Asterisk will include it and won't require the user to
wait while it is extracted after unpacking.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@93180 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-17 06:44:51 +00:00
Joshua Colp
107209927a Use ast_free to free memory, or else we shall implode if MALLOC_DEBUG is enabled.
(closes issue #11347)
Reported by: ys
Patches:
      pbx.pbx_config.c.diff uploaded by ys (license 281)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26 17:36:45 +00:00
Steve Murphy
164d8a5e61 In response to 10578, I just ran 1.4 thru valgrind; some of the config leakage I've already fixed, but it doesn't hurt to double check. I found and fixed leaks in res_jabber, cdr_tds, pbx_ael. Nothing major, tho.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-07 21:40:28 +00:00
Steve Murphy
3176ba94c3 closes issue #11108 -- where the 'dialplan save' cli command saves a file where the semicolon is not escaped. Fixed this; User also wanted comments to be preserved across dialplan save, but this is impossible at this point in time, because comments are not stored in the dialplan. They are 'compiled' out of extensions.conf. The only way to preserve those comments is to use the config file reader/writer that the GUI uses to allow online user edits. extensions.conf is first and foremost, a config file, and is read in by the normal config-file reading routines. Then, it is processed into a dialplan (context/exten structs).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31 17:49:39 +00:00
Steve Murphy
6addd141d9 Included some verbage in the check_includes func, to inform the user that included contexts that have no match in the AEL, might be OK, as AEL cannot check in the extensions.conf or the in-memory contexts, as they may not be there at the time of the check.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31 03:51:52 +00:00
Steve Murphy
4c7393a6a4 closes issue #11086 where a user complains that references to following contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config,
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@87168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-26 16:34:02 +00:00
Steve Murphy
94aabf9844 closes issue #11037 -- unable to specify app:spec in hint arguments
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-24 04:14:28 +00:00
Joshua Colp
796cc69527 Fix tab completion for dundi show peer.
(closes issue #11041)
Reported by: jsmith
Patches:
      asterisk-dundicomplete.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@86661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 14:05:26 +00:00
Russell Bryant
ca69081253 Ensure the buffer passed to ast_canmatch_extension() is properly initialized so
that it is null terminated.

(issue #10977)
Reported by: dimas
Patches: 
      pbxdundi.patch uploaded by dimas (license 88)
	    - small mods by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 15:40:45 +00:00
Russell Bryant
91bfacc3ed Don't create the context for users in users.conf until we know at least one user exists.
(closes issue #10971)
Reported by: dimas
Patches: 
      pbxconfig.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-14 15:24:52 +00:00
Russell Bryant
c27db984f9 Fix the potential use of an uninitialized buffer in a log message.
(closes issue #10958)
Reported by: dimas
Patches: 
      realtime.patch uploaded by dimas (license 88)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85515 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-12 15:40:35 +00:00
Steve Murphy
563c9e74a2 closes issue #10870 ; where a CUT() function call in a switch expr doesn't execute correctly, because the commas in the function args are not converted to vertbars before the func is called. I modified just the switch code to convert the commas to vertbars if there, but if more of these sort of probs are found, I may have to resort to something a little more fundamental. We'll see, I guess.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-03 18:20:07 +00:00
Steve Murphy
ed75fa38e9 closes issue #10834 ; where a null input to a switch statement results in a hangup; since switch is implemented with extensions, and the default case is implemented with a '.', and the '.' matches 1 or more remaining characters, the case where 0 characters exist isn't matched, and the extension isn't matched, and the goto fails, and a hangup occurs. Now, when a default case is generated, it also generates a single fixed extension that will match a null input. That extension just does a goto to the default extension for that switch. I played with an alternate solution, where I just tack an extra char onto all the patterns and the goto, but not the default case's pattern. Then even a null input will still have at least one char in it. But it made me nervous, having that extra char in , even if that's a pretty secret and low-level issue.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-03 14:23:00 +00:00
Steve Murphy
8bf81e2bac Anything to keep gcc 4.2 happy...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 21:18:40 +00:00