aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-01 21:18:14 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-01 21:18:14 +0000
commitcd372e32c76de742d9268f9cfc27fe47cfdd3e6a (patch)
tree9a6238e1a10bfecdf9204528fb9d3dd01c4a10d3
parent23d4b6f29c5684ecd10e8ebcb3da3a0534a12d7d (diff)
parent85bbd1354ca1a7d5d9c028fb7f2223b279696fe5 (diff)
Copy 1.6.0-rc6 -> 1.6.0
git-svn-id: http://svn.digium.com/svn/asterisk/tags/1.6.0@145555 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--.version2
-rw-r--r--CHANGES3
-rw-r--r--ChangeLog494
-rw-r--r--Makefile2
-rw-r--r--Makefile.moddir_rules6
-rw-r--r--acinclude.m42
-rw-r--r--agi/Makefile5
-rw-r--r--apps/app_dial.c3
-rw-r--r--apps/app_playback.c8
-rw-r--r--apps/app_queue.c19
-rw-r--r--apps/app_voicemail.c6
-rw-r--r--channels/chan_agent.c5
-rw-r--r--channels/chan_iax2.c99
-rw-r--r--channels/chan_local.c4
-rw-r--r--channels/chan_oss.c2
-rw-r--r--channels/chan_sip.c82
-rw-r--r--channels/chan_skinny.c18
-rw-r--r--channels/iax2-parser.c29
-rw-r--r--configs/extensions.lua.sample9
-rw-r--r--configs/jabber.conf.sample6
-rw-r--r--configs/rtp.conf.sample3
-rw-r--r--configs/sip.conf.sample14
-rwxr-xr-xconfigure18
-rw-r--r--contrib/scripts/vmail.cgi35
-rw-r--r--doc/tex/privacy.tex10
-rw-r--r--formats/format_pcm.c7
-rw-r--r--funcs/func_cut.c4
-rw-r--r--include/asterisk.h11
-rw-r--r--include/asterisk/astmm.h7
-rw-r--r--include/asterisk/channel.h5
-rw-r--r--include/asterisk/hashtab.h6
-rw-r--r--main/Makefile9
-rw-r--r--main/app.c5
-rw-r--r--main/ast_expr2.c66
-rw-r--r--main/ast_expr2.fl6
-rw-r--r--main/ast_expr2.y66
-rw-r--r--main/ast_expr2f.c8
-rw-r--r--main/astmm.c4
-rw-r--r--main/features.c209
-rw-r--r--main/file.c1
-rw-r--r--main/pbx.c10
-rw-r--r--main/sched.c8
-rw-r--r--main/stdtime/localtime.c1
-rw-r--r--pbx/pbx_ael.c4
-rw-r--r--pbx/pbx_lua.c165
-rw-r--r--res/res_config_pgsql.c86
-rw-r--r--res/res_jabber.c13
-rw-r--r--sounds/Makefile2
-rw-r--r--utils/Makefile49
-rw-r--r--utils/ael_main.c10
-rw-r--r--utils/astman.c2
-rwxr-xr-xutils/build-extensions-conf.lua81
-rw-r--r--utils/extconf.c73
53 files changed, 562 insertions, 1240 deletions
diff --git a/.version b/.version
index dc1e644a1..5bc725eba 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-1.6.0
+1.6.0-rc6
diff --git a/CHANGES b/CHANGES
index 3cadf8f8d..5d027a055 100644
--- a/CHANGES
+++ b/CHANGES
@@ -532,9 +532,6 @@ Miscellaneous New Modules
Miscellaneous
-------------
- * res_jabber: autoprune has been disabled by default, to avoid misconfiguration
- that would end up being interpreted as a bug once Asterisk started removing
- the contacts from a user list.
* Ability to use libcap to set high ToS bits when non-root
on Linux. If configure is unable to find libcap then you
can use --with-cap to specify the path.
diff --git a/ChangeLog b/ChangeLog
index 6f3fd2eee..e7b95ad72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,497 +1,3 @@
-2008-10-01 Russell Bryant <russell@digium.com>
-
- * Asterisk 1.6.0 released.
-
-2008-09-30 22:25 +0000 [r145255] Jeff Peeler <jpeeler@digium.com>
-
- * /, channels/chan_sip.c: Merged revisions 145249 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r145249 |
- jpeeler | 2008-09-30 17:21:19 -0500 (Tue, 30 Sep 2008) | 6 lines
- (closes issue #13337) Reported by: pj Tested by: pj Set transport
- to SIP_TRANSPORT_UDP mode if not specified which fixes calls to
- get_transport returning UNKNOWN. ........
-
-2008-09-29 00:13 +0000 [r145123] Tilghman Lesher <tlesher@digium.com>
-
- * res/res_config_pgsql.c, /: Merged revisions 145076 via svnmerge
- from https://origsvn.digium.com/svn/asterisk/trunk ........
- r145076 | tilghman | 2008-09-28 16:39:07 -0500 (Sun, 28 Sep 2008)
- | 4 lines Change several improper "sizeof" to "strlen", as sizeof
- in that context would incorrectly use the size of a pointer,
- rather than the length of a string. (Closes issue #13574)
- ........
-
-2008-09-27 16:36 +0000 [r144991] Kevin P. Fleming <kpfleming@digium.com>
-
- * main/ast_expr2.c, Makefile, agi/Makefile, utils/Makefile,
- include/asterisk/astmm.h, main/ast_expr2f.c, pbx/pbx_ael.c,
- utils/ael_main.c, main/astmm.c, main/stdtime/localtime.c,
- utils/extconf.c, main/ast_expr2.fl, include/asterisk.h, /,
- main/Makefile, main/ast_expr2.y, Makefile.moddir_rules,
- utils/astman.c: Merged revisions 144949-144951 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ................
- r144949 | kpfleming | 2008-09-27 10:52:56 -0500 (Sat, 27 Sep
- 2008) | 17 lines Merged revisions 144924-144925 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r144924 | kpfleming | 2008-09-27 10:00:48 -0500 (Sat, 27 Sep
- 2008) | 6 lines 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 ........
- r144925 | kpfleming | 2008-09-27 10:13:30 -0500 (Sat, 27 Sep
- 2008) | 2 lines fix some minor issues with rev 144924 ........
- ................ r144950 | kpfleming | 2008-09-27 11:10:33 -0500
- (Sat, 27 Sep 2008) | 2 lines fix bugs caused by r144949 when
- MALLOC_DEBUG is defined ................ r144951 | kpfleming |
- 2008-09-27 11:17:43 -0500 (Sat, 27 Sep 2008) | 1 line remove
- incorrect comment ................
-
-2008-09-26 23:14 +0000 [r144831] Joshua Colp <jcolp@digium.com>
-
- * /, configs/rtp.conf.sample: Merged revisions 144829 via svnmerge
- from https://origsvn.digium.com/svn/asterisk/trunk ........
- r144829 | file | 2008-09-26 20:12:13 -0300 (Fri, 26 Sep 2008) | 2
- lines Update documentation to include default setting. This is
- for you jtodd! ........
-
-2008-09-26 18:08 +0000 [r144483-144683] Steve Murphy <murf@digium.com>
-
- * /, pbx/pbx_lua.c: Merged revisions 144681 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r144681 |
- murf | 2008-09-26 12:02:06 -0600 (Fri, 26 Sep 2008) | 14 lines
- (closes issue #13564) Reported by: mnicholson Patches:
- pbx_lua9.diff uploaded by mnicholson (license 96) Many thanks to
- Matt for his upgrade to the lua dialplan option! the Description
- from the bug: This patch adds a stack trace to errors encountered
- while executing lua extensions. The patch also handles out of
- memory errors reported by lua. ........
-
- * main/pbx.c, /: Merged revisions 144678 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ................
- r144678 | murf | 2008-09-26 11:50:35 -0600 (Fri, 26 Sep 2008) |
- 20 lines Merged revisions 144677 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r144677 | murf | 2008-09-26 11:47:13 -0600 (Fri, 26 Sep 2008) |
- 12 lines (closes issue #13563) Reported by: mnicholson Patches:
- found1.diff uploaded by mnicholson (license 96) This patch was
- mainly meant to apply to trunk and 1.6.x, but I'm applying it to
- 1.4 also, which should be a perfectly harmless fix to the vast
- majority of users who are not using external switches, but the
- few who might be affected will not have to go to the pain of
- filing a bug report. ........ ................
-
- * utils/build-extensions-conf.lua (removed), /: Merged revisions
- 144635 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r144635 |
- murf | 2008-09-26 10:51:30 -0600 (Fri, 26 Sep 2008) | 1 line Matt
- suggests we remove utils/build-extensions-conf.lua, as per bug
- 12961, it is no longer necessary. ........
-
- * channels/chan_oss.c, apps/app_playback.c, main/pbx.c, /,
- funcs/func_cut.c: Merged revisions 144569 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r144569 |
- murf | 2008-09-25 16:21:28 -0600 (Thu, 25 Sep 2008) | 14 lines
- (closes issue #13557) Reported by: nickpeirson The user attached
- a patch, but the license is not yet recorded. I took the liberty
- of finding and replacing ALL index() calls with strchr() calls,
- and that involves more than just main/pbx.c; chan_oss,
- app_playback, func_cut also had calls to index(), and I changed
- them out. 1.4 had no references to index() at all. ........
-
- * /, pbx/pbx_lua.c: Merged revisions 144563 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r144563 |
- murf | 2008-09-25 15:54:11 -0600 (Thu, 25 Sep 2008) | 7 lines
- (closes issue #13559) Reported by: mnicholson Patches:
- pbx_lua8.diff uploaded by mnicholson (license 96) ........
-
- * /, pbx/pbx_lua.c, configs/extensions.lua.sample,
- include/asterisk/hashtab.h: Merged revisions 144523 via svnmerge
- from https://origsvn.digium.com/svn/asterisk/trunk ........
- r144523 | murf | 2008-09-25 15:18:12 -0600 (Thu, 25 Sep 2008) |
- 13 lines I added a little verbage to hashtab for the
- hashtab_destroy func. It was pretty sparsely documented. This
- update fleshes out the pbx_lua module, to add the switch
- statements to the extensions in the extensions.lua file, as well
- as removing them when the module is unloaded. Many thanks to Matt
- Nicholson for his fine contribution! ........
-
- * /, pbx/pbx_lua.c: Merged revisions 144482 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r144482 |
- murf | 2008-09-25 11:51:11 -0600 (Thu, 25 Sep 2008) | 14 lines
- (closes issue #13558) Reported by: mnicholson Considering that
- the example extensions.lua used nothing but ["12345"] notation,
- and that the resulting error message: [Sep 24 17:01:16]
- ERROR[12393]: pbx_lua.c:1204 exec: Error executing lua extension:
- attempt to call a nil value is not very informative as to the
- nature of the problem, I think this bug fix is a big win!
- ........
-
-2008-09-23 16:57 +0000 [r144068] Steve Murphy <murf@digium.com>
-
- * /, main/features.c: Merged revisions 144067 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ................
- r144067 | murf | 2008-09-23 10:52:32 -0600 (Tue, 23 Sep 2008) |
- 37 lines Merged revisions 144066 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r144066 | murf | 2008-09-23 10:41:49 -0600 (Tue, 23 Sep 2008) |
- 29 lines (closes issue #13489) Reported by: DougUDI Tested by:
- murf (closes issue #13490) Reported by: seanbright Tested by:
- murf (closes issue #13467) Reported by: edantie Tested by: murf,
- edantie, DougUDI This crash happens because we are unsafely
- handling old pointers. The channel whose cdr is being handled,
- has been hung up and destroyed already. I reorganized the code a
- bit, and tried not to lose the fork-cdr-chain concepts of the
- previous code. I now verify that the 'previous' channel (the
- channel we had when the bridge was started), still exists, by
- looking it up by name in the channel list. I also do not try to
- reset the CDR's of channels involved in bridges. Testing shows it
- solves the crash problem, and should not negatively impact
- previous fixes involving CDR's generated during/after blind
- transfers. (The reason we need to reset the CDR's on the
- "beginning" channels in the first place). ........
- ................
-
-2008-09-23 15:38 +0000 [r144026] Mark Michelson <mmichelson@digium.com>
-
- * /, channels/chan_sip.c: Merged revisions 144025 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r144025 |
- mmichelson | 2008-09-23 10:37:00 -0500 (Tue, 23 Sep 2008) | 16
- lines When a promiscuous redirect contained both a user and host
- portion in the Contact URI and specifies a transport, the parsing
- done in parse_moved_contact resulted in a malformed URI. This
- commit fixes the parsing so that a proper Dial string may be
- formed when the forwarded call is placed. (closes issue #13523)
- Reported by: mattdarnell Patches: 13523v2.patch uploaded by
- putnopvut (license 60) Tested by: mattdarnell ........
-
-2008-09-22 22:50 +0000 [r143905] Sean Bright <sean.bright@gmail.com>
-
- * /, formats/format_pcm.c: Merged revisions 143904 via svnmerge
- from https://origsvn.digium.com/svn/asterisk/trunk
- ................ r143904 | seanbright | 2008-09-22 18:50:07 -0400
- (Mon, 22 Sep 2008) | 16 lines Merged revisions 143903 via
- svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r143903 | seanbright | 2008-09-22 18:49:00 -0400 (Mon, 22 Sep
- 2008) | 8 lines Use the advertised header size in .au files
- instead of just assuming they are 24 bytes (the minimum). (closes
- issue #13450) Reported by: jamessan Patches: pcm-header.diff
- uploaded by jamessan (license 246) ........ ................
-
-2008-09-21 09:55 +0000 [r143800-143844] Michiel van Baak <michiel@vanbaak.info>
-
- * /, doc/tex/privacy.tex: Merged revisions 143843 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r143843 |
- mvanbaak | 2008-09-21 11:53:01 +0200 (Sun, 21 Sep 2008) | 3 lines
- fix privacymanager example so it shows how to use the
- PRIVACYMRGSTATUS variable ........
-
- * /, doc/tex/privacy.tex: Merged revisions 143837 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r143837 |
- mvanbaak | 2008-09-21 11:27:08 +0200 (Sun, 21 Sep 2008) | 2 lines
- fix privacy documentation. We no longer do priority jumping +101
- ........
-
-2008-09-20 00:54 +0000 [r143735-143738] Sean Bright <sean.bright@gmail.com>
-
- * /, contrib/scripts/vmail.cgi: Merged revisions 143737 via
- svnmerge from https://origsvn.digium.com/svn/asterisk/trunk
- ................ r143737 | seanbright | 2008-09-19 20:52:20 -0400
- (Fri, 19 Sep 2008) | 17 lines Merged revisions 143736 via
- svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r143736 | seanbright | 2008-09-19 20:50:10 -0400 (Fri, 19 Sep
- 2008) | 9 lines Make vmail.cgi work with mailboxes defined in
- users.conf, too. (closes issue #13187) Reported by: netvoice
- Patches: 20080911__bug13187.diff.txt uploaded by Corydon76
- (license 14) (Slightly modified to take alchamist's comments on
- mantis into account) Tested by: msales, alchamist, seanbright
- ........ ................
-
- * channels/chan_agent.c: ast_event_unsubscribe in 1.6.0 returns
- void, not NULL. Pointed out by Stefan Gofferje on the
- asterisk-users mailing list.
-
-2008-09-19 15:48 +0000 [r143610] Mark Michelson <mmichelson@digium.com>
-
- * /, channels/chan_agent.c: Merged revisions 143609 via svnmerge
- from https://origsvn.digium.com/svn/asterisk/trunk ........
- r143609 | mmichelson | 2008-09-19 10:43:28 -0500 (Fri, 19 Sep
- 2008) | 11 lines We should only unsubscribe to the device state
- event subscription if we have previously subscribed. Otherwise a
- segfault will occur. (closes issue #13476) Reported by: jonnt
- Patches: 13476.patch uploaded by putnopvut (license 60) Tested
- by: jonnt ........
-
-2008-09-18 23:50 +0000 [r143560] Steve Murphy <murf@digium.com>
-
- * /, channels/chan_sip.c: Merged revisions 143559 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ................
- r143559 | murf | 2008-09-18 17:41:33 -0600 (Thu, 18 Sep 2008) | 9
- lines Merged revisions 143534 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r143534 | murf | 2008-09-18 16:11:51 -0600 (Thu, 18 Sep 2008) | 1
- line A micro-fix, in sip_park_thread, where d is freed before the
- func is done using it. ........ ................
-
-2008-09-17 20:58 +0000 [r143406] Tilghman Lesher <tlesher@digium.com>
-
- * apps/app_voicemail.c, /: Merged revisions 143405 via svnmerge
- from https://origsvn.digium.com/svn/asterisk/trunk
- ................ r143405 | tilghman | 2008-09-17 15:57:58 -0500
- (Wed, 17 Sep 2008) | 13 lines Merged revisions 143404 via
- svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r143404 | tilghman | 2008-09-17 15:55:47 -0500 (Wed, 17 Sep 2008)
- | 6 lines When callerid is blank, we want to use "unknown caller"
- in those cases, too. (closes issue #13486) Reported by: tomo1657
- Patches: 20080917__bug13486.diff.txt uploaded by Corydon76
- (license 14) ........ ................
-
-2008-09-15 21:32 +0000 [r143142] Tilghman Lesher <tlesher@digium.com>
-
- * /, channels/chan_iax2.c: Merged revisions 143141 via svnmerge
- from https://origsvn.digium.com/svn/asterisk/trunk
- ................ r143141 | tilghman | 2008-09-15 16:31:36 -0500
- (Mon, 15 Sep 2008) | 13 lines Merged revisions 143140 via
- svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r143140 | tilghman | 2008-09-15 16:29:32 -0500 (Mon, 15 Sep 2008)
- | 6 lines Set the raw formats at the same time as the other
- formats. (closes issue #13240) Reported by: jvandal Patches:
- 20080813__bug13240.diff.txt uploaded by Corydon76 (license 14)
- ........ ................
-
-2008-09-14 22:22 +0000 [r143083] Michiel van Baak <michiel@vanbaak.info>
-
- * /, channels/chan_skinny.c: Merged revisions 143082 via svnmerge
- from https://origsvn.digium.com/svn/asterisk/trunk ........
- r143082 | mvanbaak | 2008-09-15 00:16:34 +0200 (Mon, 15 Sep 2008)
- | 11 lines plug a couple of memleaks in chan_skinny. (closes
- issue #13452) Reported by: pj Patches: memleak5.diff uploaded by
- wedhorn (license 30) Tested by: wedhorn, pj, mvanbaak (closes
- issue #13294) Reported by: pj ........
-
-2008-09-13 13:57 +0000 [r142993-143032] Tilghman Lesher <tlesher@digium.com>
-
- * channels/iax2-parser.c, apps/app_dial.c, /, channels/chan_iax2.c:
- Recorded merge of revisions 143031 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r143031 |
- tilghman | 2008-09-13 08:54:15 -0500 (Sat, 13 Sep 2008) | 8 lines
- Repair IAXVAR implementation so that it works again (regression?)
- (closes issue #13354) Reported by: adomjan Patches:
- 20080828__bug13354.diff.txt uploaded by Corydon76 (license 14)
- 20080829__bug13354__1.6.0.diff.txt uploaded by Corydon76 (license
- 14) Tested by: Corydon76, adomjan ........
-
-2008-09-12 22:25 +0000 [r142932] Jeff Peeler <jpeeler@digium.com>
-
- * channels/chan_local.c, /: Merged revisions 142929 via svnmerge
- from https://origsvn.digium.com/svn/asterisk/trunk
- ................ r142929 | jpeeler | 2008-09-12 17:24:13 -0500
- (Fri, 12 Sep 2008) | 14 lines Merged revisions 142927 via
- svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r142927 | jpeeler | 2008-09-12 17:22:28 -0500 (Fri, 12 Sep 2008)
- | 6 lines (closes issue #12965) Reported by: rlsutton2 Prevents
- local channels from playing MOH at each other which was causing
- ast_generic_bridge to loop much faster. ........ ................
-
-2008-09-12 20:51 +0000 [r142742-142867] Tilghman Lesher <tlesher@digium.com>
-
- * /, channels/chan_sip.c, configs/sip.conf.sample: Merged revisions
- 142866 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ................
- r142866 | tilghman | 2008-09-12 15:49:46 -0500 (Fri, 12 Sep 2008)
- | 18 lines Merged revisions 142865 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r142865 | tilghman | 2008-09-12 15:37:18 -0500 (Fri, 12 Sep 2008)
- | 11 lines Create rules for disallowing contacts at certain
- addresses, which may improve the security of various
- installations. As this does not change any default behavior, it
- is not classified as a direct security fix for anything within
- Asterisk, but may help PBX admins better secure their SIP
- servers. (closes issue #11776) Reported by: ibc Patches:
- 20080829__bug11776.diff.txt uploaded by Corydon76 (license 14)
- Tested by: Corydon76, blitzrage ........ ................
-
- * /, main/app.c: Merged revisions 142748 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r142748 |
- tilghman | 2008-09-12 11:54:44 -0500 (Fri, 12 Sep 2008) | 3 lines
- When checking for an encoded character, make sure the string
- isn't blank, first. (Closes issue #13470) ........
-
- * apps/app_voicemail.c, /: Merged revisions 142745 via svnmerge
- from https://origsvn.digium.com/svn/asterisk/trunk
- ................ r142745 | tilghman | 2008-09-12 11:38:55 -0500
- (Fri, 12 Sep 2008) | 12 lines Merged revisions 142744 via
- svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r142744 | tilghman | 2008-09-12 11:38:02 -0500 (Fri, 12 Sep 2008)
- | 4 lines Missing merge from 1.2 fixes errant exit on DTMF, only
- when language is Italian (cf commit 34242) (Closes issue #7353)
- ........ ................
-
- * /, main/file.c: Merged revisions 142741 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ................
- r142741 | tilghman | 2008-09-12 11:29:01 -0500 (Fri, 12 Sep 2008)
- | 12 lines Merged revisions 142740 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r142740 | tilghman | 2008-09-12 11:27:32 -0500 (Fri, 12 Sep 2008)
- | 4 lines Don't return a free'd pointer, when a file cannot be
- opened. (closes issue #13462) Reported by: wackysalut ........
- ................
-
-2008-09-12 04:58 +0000 [r142677] Steve Murphy <murf@digium.com>
-
- * apps/app_dial.c, main/pbx.c, /, main/features.c,
- include/asterisk/channel.h, apps/app_queue.c: Merged revisions
- 142676 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ................
- r142676 | murf | 2008-09-11 22:50:48 -0600 (Thu, 11 Sep 2008) |
- 40 lines Merged revisions 142675 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r142675 | murf | 2008-09-11 22:29:34 -0600 (Thu, 11 Sep 2008) |
- 29 lines Tested by: sergee, murf, chris-mac, andrew, KNK This is
- a "second attempt" to restore the previous "endbeforeh" behavior
- in 1.4 and up. In order to capture information concerning all the
- legs of transfers in all their infinite combinations, I was
- forced to this particular solution by a chain of logical
- necessities, the first being that I was not allowed to rewrite
- the CDR mechanism from the ground up! This change basically
- leaves the original machinery alone, which allows IVR and local
- channel type situations to generate CDR's as normal, but a
- channel flag can be set to suppress the normal running of the h
- exten. That flag would be set by the code that runs the h exten
- from the ast_bridge_call routine, to prevent the h exten from
- being run twice. Also, a flag in the ast_bridge_config struct
- passed into ast_bridge_call can be used to suppress the running
- of the h exten in that routine. This would happen, for instance,
- if you use the 'g' option in the Dial app. Running this routine
- 'early' allows not only the CDR() func to be used in the h
- extension for reading CDR variables, but also allows them to be
- modified before the CDR is posted to the backends. While I dearly
- hope that this patch overcomes all problems, and introduces no
- new problems, reality suggests that surely someone will have
- problems. In this case, please re-open 13251 (or 13289), and
- we'll see if we can't fix any remaining issues. ** trunk note:
- some code to suppress the h exten being run from app_queue was
- added; for the 'continue' option available only in trunk/1.6.x.
- ........ ................
-
-2008-09-11 23:49 +0000 [r142631] Steve Murphy <murf@digium.com>
-
- * /, main/features.c: Merged revisions 142576 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ................
- r142576 | murf | 2008-09-11 17:12:53 -0600 (Thu, 11 Sep 2008) |
- 28 lines Merged revisions 142575 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r142575 | murf | 2008-09-11 16:55:49 -0600 (Thu, 11 Sep 2008) |
- 20 lines (closes issue #13364) Reported by: mdu113 Well,
- fundamentally, the problems revealed in 13364 are because of the
- ForkCDR call that is done before the dial. When the bridge is in
- place, it's dealing with the first (and wrong) cdr in the list.
- So, I wrote a little func to zip down to the first non-locked cdr
- in the chain, and thru-out the ast_bridge_call, these results are
- used instead of raw chan->cdr and peer->cdr pointers. This
- shouldn't affect anyone who isn't forking cdrs before a dial, and
- should correct the cdr's of those that do. So, this change ends
- up correcting the dstchannel and userfield; the disposition was
- fixed by a previous patch, it was OK coming into this problem.
- ........ ................
-
-2008-09-10 22:14 +0000 [r142477] Steve Murphy <murf@digium.com>
-
- * /, main/features.c: Merged revisions 142475 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ................
- r142475 | murf | 2008-09-10 16:11:27 -0600 (Wed, 10 Sep 2008) |
- 38 lines Merged revisions 142474 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r142474 | murf | 2008-09-10 15:58:17 -0600 (Wed, 10 Sep 2008) |
- 30 lines (closes issue #12318) Reported by: krtorio I made a
- small change to the code that handles local channel situations.
- In that code, I copy the answer time from the peer cdr, to the
- bridge_cdr, but I wasn't also copying the disposition from the
- peer cdr. So, Now I copy the disposition, and I've tested against
- these cases: 1. phone 1 never answers the phone; no cdr is
- generated at all. this should show up as a manager command
- failure or something. 2. phone 2 never answers. CDR is generated,
- says NO ANSWER 3. phone 2 is busy. CDR is generated, says BUSY 4.
- phone 2 answers: CDR is generated, times are correct; disposition
- is ANSWERED, which is correct. The start time is the time that
- the manager dialed the first phone. The answer time is the time
- the second phone picks up. I purposely left the cid and src
- fields blank; since this call really originates from the manager,
- there is no 'easy' data to put in these fields. If you feel
- strongly that these fields should be filled in, re-open this bug
- and I'll dig further. ........ ................
-
-2008-09-10 19:12 +0000 [r142418] Sean Bright <sean.bright@gmail.com>
-
- * /, configure, acinclude.m4: Merged revisions 142417 via svnmerge
- from https://origsvn.digium.com/svn/asterisk/trunk
- ................ r142417 | seanbright | 2008-09-10 15:09:03 -0400
- (Wed, 10 Sep 2008) | 17 lines Merged revisions 142416 via
- svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r142416 | seanbright | 2008-09-10 15:05:46 -0400 (Wed, 10 Sep
- 2008) | 9 lines Fix detection of PWLIB and OpenH323 version when
- spacing in the headers isn't consistent. (closes issue #13426)
- Reported by: bamby Patches: detect_openh323.diff uploaded by
- bamby (license 430) (Modified by me to use sed instead of tr)
- ........ ................
-
-2008-09-10 16:57 +0000 [r142360] Tilghman Lesher <tlesher@digium.com>
-
- * /, sounds/Makefile: Merged revisions 142359 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ................
- r142359 | tilghman | 2008-09-10 11:55:31 -0500 (Wed, 10 Sep 2008)
- | 10 lines Merged revisions 142358 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r142358 | tilghman | 2008-09-10 11:54:29 -0500 (Wed, 10 Sep 2008)
- | 2 lines Publish new extra sounds version. ........
- ................
-
-2008-09-10 16:42 +0000 [r142356] Russell Bryant <russell@digium.com>
-
- * main/sched.c, /: Merged revisions 142355 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ................
- r142355 | russell | 2008-09-10 11:41:55 -0500 (Wed, 10 Sep 2008)
- | 15 lines Merged revisions 142354 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/branches/1.4 ........
- r142354 | russell | 2008-09-10 11:39:53 -0500 (Wed, 10 Sep 2008)
- | 7 lines It is a normal situation that a task gets put in the
- scheduler that should run as soon as possible. Accept "0" as an
- acceptable time to run, and also treat negative as "run now", and
- don't print a debug message about it. (inspired by a message
- asking about the "request to schedule in the past" debug message
- on the -dev list) ........ ................
-
-2008-09-09 22:14 +0000 [r142281] Philippe Sultan <philippe.sultan@gmail.com>
-
- * /, configs/jabber.conf.sample, CHANGES, res/res_jabber.c: Merged
- revisions 142280 via svnmerge from
- https://origsvn.digium.com/svn/asterisk/trunk ........ r142280 |
- phsultan | 2008-09-10 00:08:56 +0200 (Wed, 10 Sep 2008) | 6 lines
- Disable autoprune by default. (closes issue #13411) Reported by:
- caio1982 Patches: res_jabber_autoprune1.diff uploaded by caio1982
- (license 22) Tested by: caio1982 ........
-
-2008-09-09 19:17 +0000 [r142081-142220] Mark Michelson <mmichelson@digium.com>
-
- * apps/app_queue.c: Fix app_queue's device state callback so that
- it can correctly parse custom device states (and any other device
- which does not contain a '/'). 1.6.1 will be getting this patch
- as well, but trunk is going to get a much more massive patch by
- bbryant which does some very nice overhauling of some structures
- in app_queue. (closes issue #12979) Reported by: sigxcpu Patches:
- 12979.patch uploaded by putnopvut (license 60) Tested by: sigxcpu
-
2008-09-09 Russell Bryant <russell@digium.com>
* Asterisk 1.6.0-rc6 released.
diff --git a/Makefile b/Makefile
index f8bfcdf90..a874a7c1a 100644
--- a/Makefile
+++ b/Makefile
@@ -226,6 +226,8 @@ endif
ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
+ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h
+
ifeq ($(AST_DEVMODE),yes)
ASTCFLAGS+=-Werror -Wunused -Wundef $(AST_DECLARATION_AFTER_STATEMENT) -Wmissing-format-attribute -Wformat-security #-Wformat=2
endif
diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules
index 18670f9a5..9258e8d63 100644
--- a/Makefile.moddir_rules
+++ b/Makefile.moddir_rules
@@ -18,6 +18,12 @@
# Also note that we can only set one variable per rule, so we have to
# repeat the left hand side to set multiple variables.
+ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
+ ifeq ($(findstring astmm.h,$(ASTCFLAGS)),)
+ ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
+ endif
+endif
+
ifeq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
ASTCFLAGS+=${GC_CFLAGS}
endif
diff --git a/acinclude.m4 b/acinclude.m4
index 865285cc0..59566d075 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -555,7 +555,7 @@ fi
AC_DEFUN(
[AST_CHECK_PWLIB_VERSION], [
if test "${HAS_$2:-unset}" != "unset"; then
- $2_VERSION=`grep "$2_VERSION" ${$2_INCDIR}/$3 | sed -e 's/[[[:space:]]]\{1,\}/ /g' | cut -f3 -d ' ' | sed -e 's/"//g'`
+ $2_VERSION=`grep "$2_VERSION" ${$2_INCDIR}/$3 | cut -f2 -d ' ' | sed -e 's/"//g'`
$2_MAJOR_VERSION=`echo ${$2_VERSION} | cut -f1 -d.`
$2_MINOR_VERSION=`echo ${$2_VERSION} | cut -f2 -d.`
$2_BUILD_NUMBER=`echo ${$2_VERSION} | cut -f3 -d.`
diff --git a/agi/Makefile b/agi/Makefile
index d580a1632..0cb6f3f02 100644
--- a/agi/Makefile
+++ b/agi/Makefile
@@ -29,14 +29,9 @@ all: $(AGIS)
strcompat.c: ../main/strcompat.c
@cp $< $@
-strcompat.o: ASTCFLAGS+=-DSTANDALONE
-
-eagi-test.o: ASTCFLAGS+=-DSTANDALONE
eagi-test: eagi-test.o strcompat.o
-eagi-sphinx-test.o: ASTCFLAGS+=-DSTANDALONE
-
eagi-sphinx-test: eagi-sphinx-test.o
install: all
diff --git a/apps/app_dial.c b/apps/app_dial.c
index d3ba0522c..aa53e5c4c 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -1462,7 +1462,6 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
/* Inherit specially named variables from parent channel */
ast_channel_inherit_variables(chan, tc);
- ast_channel_datastore_inherit(chan, tc);
tc->appl = "AppDial";
tc->data = "(Outgoing Line)";
@@ -1862,8 +1861,6 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
ast_set_flag(&(config.features_callee), AST_FEATURE_AUTOMIXMON);
if (ast_test_flag64(peerflags, OPT_CALLER_MIXMONITOR))
ast_set_flag(&(config.features_caller), AST_FEATURE_AUTOMIXMON);
- if (ast_test_flag64(peerflags, OPT_GO_ON))
- ast_set_flag(&(config.features_caller), AST_FEATURE_NO_H_EXTEN);
if (moh) {
moh = 0;
diff --git a/apps/app_playback.c b/apps/app_playback.c
index cb30b7a9d..c7d8ff620 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -200,13 +200,13 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
ast_debug(2, "doing [%s]\n", fn);
/* locate prefix and data, if any */
- fmt = strchr(fn, ':');
+ fmt = index(fn, ':');
if (!fmt || fmt == fn) { /* regular filename */
ret = s_streamwait3(a, fn);
continue;
}
fmt++;
- data = strchr(fmt, ':'); /* colon before data */
+ data = index(fmt, ':'); /* colon before data */
if (!data || data == fmt) { /* simple prefix-fmt */
ret = do_say(a, fn, options, depth);
continue;
@@ -219,14 +219,14 @@ static int do_say(say_args_t *a, const char *s, const char *options, int depth)
if (*p == '\'') {/* file name - we trim them */
char *y;
strcpy(fn2, ast_skip_blanks(p+1)); /* make a full copy */
- y = strchr(fn2, '\'');
+ y = index(fn2, '\'');
if (!y) {
p = data; /* invalid. prepare to end */
break;
}
*y = '\0';
ast_trim_blanks(fn2);
- p = strchr(p+1, '\'');
+ p = index(p+1, '\'');
ret = s_streamwait3(a, fn2);
} else {
int l = fmt-fn;
diff --git a/apps/app_queue.c b/apps/app_queue.c
index bb83ea876..ba003911d 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -733,6 +733,16 @@ static int update_status(const char *interface, const int status)
static void *handle_statechange(struct statechange *sc)
{
struct member_interface *curint;
+ char *loc;
+ char *technology;
+
+ technology = ast_strdupa(sc->dev);
+ loc = strchr(technology, '/');
+ if (loc) {
+ *loc++ = '\0';
+ } else {
+ return NULL;
+ }
AST_LIST_LOCK(&interfaces);
AST_LIST_TRAVERSE(&interfaces, curint, list) {
@@ -749,11 +759,13 @@ static void *handle_statechange(struct statechange *sc)
AST_LIST_UNLOCK(&interfaces);
if (!curint) {
- ast_debug(3, "Device '%s' changed to state '%d' (%s) but we don't care because they're not a member of any queue.\n", sc->dev, sc->state, devstate2str(sc->state));
+ if (option_debug > 2)
+ ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s) but we don't care because they're not a member of any queue.\n", technology, loc, sc->state, devstate2str(sc->state));
return NULL;
}
- ast_debug(1, "Device '%s' changed to state '%d' (%s)\n", sc->dev, sc->state, devstate2str(sc->state));
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Device '%s/%s' changed to state '%d' (%s)\n", technology, loc, sc->state, devstate2str(sc->state));
update_status(sc->dev, sc->state);
@@ -3209,9 +3221,6 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
case 'W':
ast_set_flag(&(bridge_config.features_caller), AST_FEATURE_AUTOMON);
break;
- case 'c':
- ast_set_flag(&(bridge_config.features_caller), AST_FEATURE_NO_H_EXTEN);
- break;
case 'd':
nondataquality = 0;
break;
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 6146c58e9..5bef5b385 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -3232,8 +3232,8 @@ static void prep_email_sub_vars(struct ast_channel *ast, struct ast_vm_user *vmu
pbx_builtin_setvar_helper(ast, "VM_CONTEXT", context);
pbx_builtin_setvar_helper(ast, "VM_MAILBOX", mailbox);
pbx_builtin_setvar_helper(ast, "VM_CALLERID", ast_callerid_merge(callerid, sizeof(callerid), cidname, cidnum, "Unknown Caller"));
- pbx_builtin_setvar_helper(ast, "VM_CIDNAME", (!ast_strlen_zero(cidname) ? cidname : "an unknown caller"));
- pbx_builtin_setvar_helper(ast, "VM_CIDNUM", (!ast_strlen_zero(cidnum) ? cidnum : "an unknown caller"));
+ pbx_builtin_setvar_helper(ast, "VM_CIDNAME", (cidname ? cidname : "an unknown caller"));
+ pbx_builtin_setvar_helper(ast, "VM_CIDNUM", (cidnum ? cidnum : "an unknown caller"));
pbx_builtin_setvar_helper(ast, "VM_DATE", date);
pbx_builtin_setvar_helper(ast, "VM_CATEGORY", category ? ast_strdupa(category) : "no category");
}
@@ -6177,7 +6177,7 @@ static int vm_intro_it(struct ast_channel *chan, struct vm_state *vms)
ast_play_and_wait(chan, "vm-vecchi") ||
ast_play_and_wait(chan, "vm-messages");
}
- return res;
+ return res ? -1 : 0;
}
/* POLISH syntax */
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index f0d913ff3..f582b7287 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -2492,10 +2492,7 @@ static int unload_module(void)
/* First, take us out of the channel loop */
ast_channel_unregister(&agent_tech);
/* Delete devicestate subscription */
- if (agent_devicestate_sub) {
- ast_event_unsubscribe(agent_devicestate_sub);
- agent_devicestate_sub = NULL;
- }
+ ast_event_unsubscribe(agent_devicestate_sub);
/* Unregister dialplan functions */
ast_custom_function_unregister(&agent_function);
/* Unregister CLI commands */
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 0c6fa73ee..ea45d7a82 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -628,10 +628,7 @@ struct chan_iax2_pvt {
int calling_pres;
int amaflags;
AST_LIST_HEAD_NOLOCK(, iax2_dpcache) dpentries;
- /*! variables inherited from the user definition */
struct ast_variable *vars;
- /*! variables transmitted in a NEW packet */
- struct ast_variable *iaxvars;
/*! last received remote rr */
struct iax_rr remote_rr;
/*! Current base time: (just for stats) */
@@ -3685,12 +3682,10 @@ static int iax2_call(struct ast_channel *c, char *dest, int timeout)
/* Add remote vars */
if (variablestore) {
AST_LIST_HEAD(, ast_var_t) *variablelist = variablestore->data;
- ast_debug(1, "Found an IAX variable store on this channel\n");
AST_LIST_LOCK(variablelist);
AST_LIST_TRAVERSE(variablelist, var, entries) {
char tmp[256];
int i;
- ast_debug(1, "Found IAXVAR '%s' with value '%s' (to transmit)\n", ast_var_name(var), ast_var_value(var));
/* Automatically divide the value up into sized chunks */
for (i = 0; i < strlen(ast_var_value(var)); i += 255 - (strlen(ast_var_name(var)) + 1)) {
snprintf(tmp, sizeof(tmp), "%s=%s", ast_var_name(var), ast_var_value(var) + i);
@@ -4099,8 +4094,8 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
tmp->tech = &iax2_tech;
/* We can support any format by default, until we get restricted */
tmp->nativeformats = capability;
- tmp->readformat = tmp->rawreadformat = ast_best_codec(capability);
- tmp->writeformat = tmp->rawwriteformat = ast_best_codec(capability);
+ tmp->readformat = ast_best_codec(capability);
+ tmp->writeformat = ast_best_codec(capability);
tmp->tech_pvt = CALLNO_TO_PTR(i->callno);
/* Don't use ast_set_callerid() here because it will
@@ -4134,42 +4129,6 @@ static struct ast_channel *ast_iax2_new(int callno, int state, int capability)
for (v = i->vars ; v ; v = v->next)
pbx_builtin_setvar_helper(tmp, v->name, v->value);
}
- if (i->iaxvars) {
- struct ast_datastore *variablestore;
- struct ast_variable *var, *prev = NULL;
- AST_LIST_HEAD(, ast_var_t) *varlist;
- ast_debug(1, "Loading up the channel with IAXVARs\n");
- varlist = ast_calloc(1, sizeof(*varlist));
- variablestore = ast_channel_datastore_alloc(&iax2_variable_datastore_info, NULL);
- if (variablestore && varlist) {
- variablestore->data = varlist;
- variablestore->inheritance = DATASTORE_INHERIT_FOREVER;
- AST_LIST_HEAD_INIT(varlist);
- for (var = i->iaxvars; var; var = var->next) {
- struct ast_var_t *newvar = ast_var_assign(var->name, var->value);
- if (prev)
- ast_free(prev);
- prev = var;
- if (!newvar) {
- /* Don't abort list traversal, as this would leave i->iaxvars in an inconsistent state. */
- ast_log(LOG_ERROR, "Memory allocation error while processing IAX2 variables\n");
- } else {
- AST_LIST_INSERT_TAIL(varlist, newvar, entries);
- }
- }
- if (prev)
- ast_free(prev);
- i->iaxvars = NULL;
- ast_channel_datastore_add(i->owner, variablestore);
- } else {
- if (variablestore) {
- ast_channel_datastore_free(variablestore);
- }
- if (varlist) {
- ast_free(varlist);
- }
- }
- }
if (state != AST_STATE_DOWN) {
if (ast_pbx_start(tmp)) {
@@ -8290,10 +8249,8 @@ static int socket_process(struct iax2_thread *thread)
}
f.data = NULL;
f.datalen = 0;
- } else {
+ } else
f.data = thread->buf + sizeof(*fh);
- memset(&ies, 0, sizeof(ies));
- }
} else {
if (f.frametype == AST_FRAME_IAX)
f.data = NULL;
@@ -8313,26 +8270,20 @@ static int socket_process(struct iax2_thread *thread)
if (!ast_iax2_new(fr->callno, AST_STATE_RING, iaxs[fr->callno]->chosenformat)) {
ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
- }
- }
-
- if (ies.vars) {
- struct ast_datastore *variablestore;
- struct ast_variable *var, *prev = NULL;
- AST_LIST_HEAD(, ast_var_t) *varlist;
- if ((c = iaxs[fr->callno]->owner)) {
+ } else if (ies.vars) {
+ struct ast_datastore *variablestore;
+ struct ast_variable *var, *prev = NULL;
+ AST_LIST_HEAD(, ast_var_t) *varlist;
varlist = ast_calloc(1, sizeof(*varlist));
variablestore = ast_channel_datastore_alloc(&iax2_variable_datastore_info, NULL);
if (variablestore && varlist) {
variablestore->data = varlist;
variablestore->inheritance = DATASTORE_INHERIT_FOREVER;
AST_LIST_HEAD_INIT(varlist);
- ast_debug(1, "I can haz IAX vars?\n");
for (var = ies.vars; var; var = var->next) {
struct ast_var_t *newvar = ast_var_assign(var->name, var->value);
- if (prev) {
+ if (prev)
ast_free(prev);
- }
prev = var;
if (!newvar) {
/* Don't abort list traversal, as this would leave ies.vars in an inconsistent state. */
@@ -8341,38 +8292,21 @@ static int socket_process(struct iax2_thread *thread)
AST_LIST_INSERT_TAIL(varlist, newvar, entries);
}
}
- if (prev) {
+ if (prev)
ast_free(prev);
- }
ies.vars = NULL;
ast_channel_datastore_add(c, variablestore);
} else {
ast_log(LOG_ERROR, "Memory allocation error while processing IAX2 variables\n");
- if (variablestore) {
+ if (variablestore)
ast_channel_datastore_free(variablestore);
- }
- if (varlist) {
+ if (varlist)
ast_free(varlist);
- }
- }
- } else {
- /* No channel yet, so transfer the variables directly over to the pvt,
- * for later inheritance. */
- ast_debug(1, "No channel, so populating IAXVARs to the pvt, as an intermediate step.\n");
- for (var = ies.vars; var && var->next; var = var->next);
- if (var) {
- var->next = iaxs[fr->callno]->iaxvars;
- iaxs[fr->callno]->iaxvars = ies.vars;
- ies.vars = NULL;
}
}
}
}
- if (ies.vars) {
- ast_debug(1, "I have IAX variables, but they were not processed\n");
- }
-
if (f.frametype == AST_FRAME_VOICE) {
if (f.subclass != iaxs[fr->callno]->voiceformat) {
iaxs[fr->callno]->voiceformat = f.subclass;
@@ -8396,11 +8330,8 @@ retryowner:
} else {
ast_debug(1, "Neat, somebody took away the channel at a magical time but i found it!\n");
/* Free remote variables (if any) */
- if (ies.vars) {
+ if (ies.vars)
ast_variables_destroy(ies.vars);
- ast_debug(1, "I can haz iaxvars, but they is no good. :-(\n");
- ies.vars = NULL;
- }
ast_mutex_unlock(&iaxsl[fr->callno]);
return 1;
}
@@ -9124,7 +9055,6 @@ retryowner2:
variablestore->data = varlist;
variablestore->inheritance = DATASTORE_INHERIT_FOREVER;
AST_LIST_HEAD_INIT(varlist);
- ast_debug(1, "I can haz IAX vars? w00t\n");
for (var = ies.vars; var; var = var->next) {
struct ast_var_t *newvar = ast_var_assign(var->name, var->value);
if (prev)
@@ -9423,11 +9353,8 @@ retryowner2:
send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_UNSUPPORT, 0, ied0.buf, ied0.pos, -1);
}
/* Free remote variables (if any) */
- if (ies.vars) {
+ if (ies.vars)
ast_variables_destroy(ies.vars);
- ast_debug(1, "I can haz IAX vars, but they is no good :-(\n");
- ies.vars = NULL;
- }
/* Don't actually pass these frames along */
if ((f.subclass != IAX_COMMAND_ACK) &&
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 3dd9fff1a..f5a6ca142 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -175,10 +175,6 @@ static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_fra
/* Recalculate outbound channel */
other = isoutbound ? p->owner : p->chan;
- /* do not queue frame if generator is on both local channels */
- if (us && us->generator && other->generator)
- return 0;
-
/* Set glare detection */
ast_set_flag(p, LOCAL_GLARE_DETECT);
if (ast_test_flag(p, LOCAL_CANCEL_QUEUE)) {
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 9cfd6449e..12800d975 100644
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -1292,7 +1292,7 @@ static void store_mixer(struct chan_oss_pvt *o, const char *s)
int i;
for (i = 0; i < strlen(s); i++) {
- if (!isalnum(s[i]) && strchr(" \t-/", s[i]) == NULL) {
+ if (!isalnum(s[i]) && index(" \t-/", s[i]) == NULL) {
ast_log(LOG_WARNING, "Suspect char %c in mixer cmd, ignoring:\n\t%s\n", s[i], s);
return;
}
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index ae3f7b3aa..fb30e2baf 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -733,10 +733,6 @@ static int global_max_se; /*!< Highest threshold for session
/*@}*/
-/*! \brief Global list of addresses dynamic peers are not allowed to use */
-static struct ast_ha *global_contact_ha = NULL;
-static int global_dynamic_exclude_static = 0;
-
/*! \name Object counters @{
* \bug These counters are not handled in a thread-safe way ast_atomic_fetchadd_int()
* should be used to modify these values. */
@@ -1501,7 +1497,6 @@ struct sip_peer {
struct timeval ps; /*!< Time for sending SIP OPTION in sip_pke_peer() */
struct sockaddr_in defaddr; /*!< Default IP address, used until registration */
struct ast_ha *ha; /*!< Access control list */
- struct ast_ha *contactha; /*!< Restrict what IPs are allowed in the Contact header (for registration) */
struct ast_variable *chanvars; /*!< Variables to set for channel created by user */
struct sip_pvt *mwipvt; /*!< Subscription for MWI */
int autoframing;
@@ -9855,7 +9850,7 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
const char *useragent;
struct hostent *hp;
struct ast_hostent ahp;
- struct sockaddr_in oldsin, testsin;
+ struct sockaddr_in oldsin;
ast_copy_string(contact, get_header(req, "Contact"), sizeof(contact));
@@ -9929,26 +9924,13 @@ static enum parse_register_result parse_register_contact(struct sip_pvt *pvt, st
}
oldsin = peer->addr;
-
- /* Check that they're allowed to register at this IP */
- /* XXX This could block for a long time XXX */
- hp = ast_gethostbyname(host, &ahp);
- if (!hp) {
- ast_log(LOG_WARNING, "Invalid host '%s'\n", host);
- *peer->fullcontact = '\0';
- ast_string_field_set(pvt, our_contact, "");
- return PARSE_REGISTER_FAILED;
- }
- memcpy(&testsin.sin_addr, hp->h_addr, sizeof(testsin.sin_addr));
- if ( ast_apply_ha(global_contact_ha, &testsin) != AST_SENSE_ALLOW ||
- ast_apply_ha(peer->contactha, &testsin) != AST_SENSE_ALLOW) {
- ast_log(LOG_WARNING, "Host '%s' disallowed by rule\n", host);
- *peer->fullcontact = '\0';
- ast_string_field_set(pvt, our_contact, "");
- return PARSE_REGISTER_FAILED;
- }
-
if (!ast_test_flag(&peer->flags[0], SIP_NAT_ROUTE)) {
+ /* XXX This could block for a long time XXX */
+ hp = ast_gethostbyname(host, &ahp);
+ if (!hp) {
+ ast_log(LOG_WARNING, "Invalid host '%s'\n", host);
+ return PARSE_REGISTER_FAILED;
+ }
peer->addr.sin_family = AF_INET;
memcpy(&peer->addr.sin_addr, hp->h_addr, sizeof(peer->addr.sin_addr));
peer->addr.sin_port = htons(port);
@@ -14595,7 +14577,6 @@ static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req)
p->socket.type = transport;
if (ast_test_flag(&p->flags[0], SIP_PROMISCREDIR)) {
- char *host = NULL;
if (!strncasecmp(s, "sip:", 4))
s += 4;
else if (!strncasecmp(s, "sips:", 5))
@@ -14603,16 +14584,9 @@ static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req)
e = strchr(s, '/');
if (e)
*e = '\0';
- if ((host = strchr(s, '@'))) {
- *host++ = '\0';
- ast_debug(2, "Found promiscuous redirection to 'SIP/%s::::%s@%s'\n", s, get_transport(transport), host);
- if (p->owner)
- ast_string_field_build(p->owner, call_forward, "SIP/%s::::%s@%s", s, get_transport(transport), host);
- } else {
- ast_debug(2, "Found promiscuous redirection to 'SIP/::::%s@%s'\n", get_transport(transport), s);
- if (p->owner)
- ast_string_field_build(p->owner, call_forward, "SIP/::::%s@%s", get_transport(transport), s);
- }
+ ast_debug(2, "Found promiscuous redirection to 'SIP/::::%s@%s'\n", get_transport(transport), s);
+ if (p->owner)
+ ast_string_field_build(p->owner, call_forward, "SIP/::::%s@%s", get_transport(transport), s);
} else {
e = strchr(tmp, '@');
if (e) {
@@ -15718,12 +15692,10 @@ static void *sip_park_thread(void *stuff)
transferee = d->chan1;
transferer = d->chan2;
copy_request(&req, &d->req);
+ ast_free(d);
if (!transferee || !transferer) {
ast_log(LOG_ERROR, "Missing channels for parking! Transferer %s Transferee %s\n", transferer ? "<available>" : "<missing>", transferee ? "<available>" : "<missing>" );
- if (d->req.data)
- ast_free(d->req.data);
- free(d);
return NULL;
}
ast_debug(4, "SIP Park: Transferer channel %s, Transferee %s\n", transferer->name, transferee->name);
@@ -15733,9 +15705,6 @@ static void *sip_park_thread(void *stuff)
ast_log(LOG_WARNING, "Masquerade failed.\n");
transmit_response(transferer->tech_pvt, "503 Internal error", &req);
ast_channel_unlock(transferee);
- if (d->req.data)
- ast_free(d->req.data);
- free(d);
return NULL;
}
ast_channel_unlock(transferee);
@@ -15769,9 +15738,6 @@ static void *sip_park_thread(void *stuff)
ast_debug(1, "SIP Call parked failed \n");
/* Do not hangup call */
}
- if (d->req.data)
- ast_free(d->req.data);
- free(d);
return NULL;
}
@@ -19647,8 +19613,6 @@ static struct ast_channel *sip_request_call(const char *type, int format, void *
ast_log(LOG_WARNING, "'%s' is not a valid transport option to Dial() for SIP calls, using udp by default.\n", trans);
transport = SIP_TRANSPORT_UDP;
}
- } else { /* use default */
- transport = SIP_TRANSPORT_UDP;
}
if (!host) {
@@ -20438,13 +20402,6 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
AST_SCHED_DEL(sched, peer->expire);
peer->host_dynamic = FALSE;
srvlookup = v->value;
- if (global_dynamic_exclude_static) {
- int err = 0;
- global_contact_ha = ast_append_ha("deny", (char *)ast_inet_ntoa(peer->addr.sin_addr), global_contact_ha, &err);
- if (err) {
- ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
- }
- }
}
} else if (!strcasecmp(v->name, "defaultip")) {
if (ast_get_ip(&peer->defaddr, v->value)) {
@@ -20457,12 +20414,6 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
peer->ha = ast_append_ha(v->name, v->value, peer->ha, &ha_error);
if (ha_error)
ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
- } else if (!strcasecmp(v->name, "contactpermit") || !strcasecmp(v->name, "contactdeny")) {
- int ha_error = 0;
- peer->contactha = ast_append_ha(v->name + 7, v->value, peer->contactha, &ha_error);
- if (ha_error) {
- ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
- }
} else if (!strcasecmp(v->name, "port")) {
if (!realtime && peer->host_dynamic)
peer->defaddr.sin_port = htons(atoi(v->value));
@@ -20754,9 +20705,6 @@ static int reload_config(enum channelreloadreason reason)
memset(&sip_tcp_desc.sin, 0, sizeof(sip_tcp_desc.sin));
memset(&sip_tls_desc.sin, 0, sizeof(sip_tls_desc.sin));
- ast_free_ha(global_contact_ha);
- global_contact_ha = NULL;
-
default_tls_cfg.enabled = FALSE; /* Default: Disable TLS */
sip_tcp_desc.sin.sin_port = htons(STANDARD_SIP_PORT);
@@ -20991,14 +20939,6 @@ static int reload_config(enum channelreloadreason reason)
} else if (!strcasecmp(v->name, "tlsbindaddr")) {
if (ast_parse_arg(v->value, PARSE_INADDR, &sip_tls_desc.sin))
ast_log(LOG_WARNING, "Invalid %s '%s' at line %d of %s\n", v->name, v->value, v->lineno, config);
- } else if (!strcasecmp(v->name, "dynamic_exclude_static") || !strcasecmp(v->name, "dynamic_excludes_static")) {
- global_dynamic_exclude_static = ast_true(v->value);
- } else if (!strcasecmp(v->name, "contactpermit") || !strcasecmp(v->name, "contactdeny")) {
- int ha_error = 0;
- global_contact_ha = ast_append_ha(v->name + 7, v->value, global_contact_ha, &ha_error);
- if (ha_error) {
- ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
- }
} else if (!strcasecmp(v->name, "rtautoclear")) {
int i = atoi(v->value);
if (i > 0)
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index f415ad6ca..cf0838eec 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -1845,7 +1845,7 @@ static int transmit_response(struct skinnysession *s, struct skinny_req *req)
memcpy(s->outbuf+skinny_header_size, &req->data, letohl(req->len));
res = write(s->fd, s->outbuf, letohl(req->len)+8);
-
+
if (res != letohl(req->len)+8) {
ast_log(LOG_WARNING, "Transmit: write only sent %d out of %d bytes: %s\n", res, letohl(req->len)+8, strerror(errno));
if (res == -1) {
@@ -1856,7 +1856,6 @@ static int transmit_response(struct skinnysession *s, struct skinny_req *req)
}
- ast_free(req);
ast_mutex_unlock(&s->lock);
return 1;
}
@@ -1954,11 +1953,9 @@ static void transmit_tone(struct skinnysession *s, int tone, int instance, int r
req->data.stoptone.reference = htolel(reference);
}
- //Bad, tone is already set so this is redundant and a change to the if above
- //may lead to issues where we try to set a tone to a stop_tone_message
- //if (tone > 0) {
- // req->data.starttone.tone = htolel(tone);
- //}
+ if (tone > 0) {
+ req->data.starttone.tone = htolel(tone);
+ }
transmit_response(s, req);
}
@@ -2022,10 +2019,8 @@ static void transmit_displaymessage(struct skinnysession *s, const char *text, i
if (!(req = req_alloc(0, CLEAR_DISPLAY_MESSAGE)))
return;
- //what do we want hear CLEAR_DISPLAY_MESSAGE or CLEAR_PROMPT_STATUS???
- //if we are clearing the display, it appears there is no instance and refernece info (size 0)
- //req->data.clearpromptstatus.lineInstance = instance;
- //req->data.clearpromptstatus.callReference = reference;
+ req->data.clearpromptstatus.lineInstance = instance;
+ req->data.clearpromptstatus.callReference = reference;
if (skinnydebug)
ast_debug(1, "Clearing Display\n");
@@ -3449,7 +3444,6 @@ static int skinny_hangup(struct ast_channel *ast)
sub->rtp = NULL;
}
ast_mutex_unlock(&sub->lock);
- ast_free(sub);
return 0;
}
diff --git a/channels/iax2-parser.c b/channels/iax2-parser.c
index 127e205d4..cdd4bc31f 100644
--- a/channels/iax2-parser.c
+++ b/channels/iax2-parser.c
@@ -913,21 +913,20 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen)
*tmp2++ = '\0';
else
tmp2 = "";
- {
- struct ast_str *str = ast_str_create(16);
- /* Existing variable or new variable? */
- for (var2 = ies->vars, prev = NULL; var2; prev = var2, var2 = var2->next) {
- if (strcmp(tmp, var2->name) == 0) {
- ast_str_set(&str, 0, "%s%s", var2->value, tmp2);
- var = ast_variable_new(tmp, str->str, var2->file);
- var->next = var2->next;
- if (prev)
- prev->next = var;
- else
- ies->vars = var;
- ast_free(var2);
- break;
- }
+ /* Existing variable or new variable? */
+ for (var2 = ies->vars, prev = NULL; var2; prev = var2, var2 = var2->next) {
+ if (strcmp(tmp, var2->name) == 0) {
+ int len = strlen(var2->value) + strlen(tmp2) + 1;
+ char *tmp3 = alloca(len);
+ snprintf(tmp3, len, "%s%s", var2->value, tmp2);
+ var = ast_variable_new(tmp, tmp3, var2->file);
+ var->next = var2->next;
+ if (prev)
+ prev->next = var;
+ else
+ ies->vars = var;
+ ast_free(var2);
+ break;
}
}
if (!var2) {
diff --git a/configs/extensions.lua.sample b/configs/extensions.lua.sample
index 44b9b81b5..8aee734b4 100644
--- a/configs/extensions.lua.sample
+++ b/configs/extensions.lua.sample
@@ -18,6 +18,15 @@ TRUNKMSD = 1
-- representing a context. Extensions are defined in each context. See below
-- for examples.
--
+-- This file can be automatically included in the extensions.conf file using
+-- the 'utils/build-extensions-conf.lua' script and a #exec statement in
+-- extensions.conf.
+--
+-- #exec /usr/bin/utils/build-extensions.conf.lua -c
+--
+-- The 'execincludes' option must be set to 'yes' in the [options] section of
+-- asterisk.conf for this to work properly.
+--
-- Extension names may be numbers, letters, or combinations thereof. If
-- an extension name is prefixed by a '_' character, it is interpreted as
-- a pattern rather than a literal. In patterns, some characters have
diff --git a/configs/jabber.conf.sample b/configs/jabber.conf.sample
index 6cfb755bd..e817e48d0 100644
--- a/configs/jabber.conf.sample
+++ b/configs/jabber.conf.sample
@@ -1,9 +1,7 @@
[general]
;debug=yes ;;Turn on debugging by default.
-;autoprune=yes ;;Auto remove users from buddy list. Depending on your
- ;;setup (ie, using your personal Gtalk account for a test)
- ;;you might lose your contacts list. Default is 'no'.
-;autoregister=yes ;;Auto register users from buddy list.
+;autoprune=yes ;;Auto remove users from buddy list.
+;autoregister=yes ;;Auto register users from buddy list.
;[asterisk] ;;label
;type=client ;;Client or Component connection
diff --git a/configs/rtp.conf.sample b/configs/rtp.conf.sample
index f90ed890d..cf3b141c5 100644
--- a/configs/rtp.conf.sample
+++ b/configs/rtp.conf.sample
@@ -22,6 +22,5 @@ rtpend=20000
;(min 500, max 60000, default 5000)
;
; Enable strict RTP protection. This will drop RTP packets that
-; do not come from the source of the RTP stream. This option is
-; disabled by default.
+; do not come from the source of the RTP stream.
; strictrtp=yes
diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample
index 03206f0b9..c823f4111 100644
--- a/configs/sip.conf.sample
+++ b/configs/sip.conf.sample
@@ -238,16 +238,6 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; your localnet setting. Unless you have some sort of strange network
; setup you will not need to enable this.
-;dynamic_exclude_static = yes ; Disallow all dynamic hosts from registering
- ; as any IP address used for staticly defined
- ; hosts. This helps avoid the configuration
- ; error of allowing your users to register at
- ; the same address as a SIP provider.
-
-;contactdeny=0.0.0.0/0.0.0.0 ; Use contactpermit and contactdeny to
-;contactpermit=172.16.0.0/255.255.0.0 ; restrict at what IPs your users may
- ; register their phones.
-
;
; If regcontext is specified, Asterisk will dynamically create and destroy a
; NoOp priority 1 extension for a given peer who registers or unregisters with
@@ -731,10 +721,6 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; timerb
; qualifyfreq
; t38pt_usertpsource
-; contactpermit ; Limit what a host may register as (a neat trick
-; contactdeny ; is to register at the same IP as a SIP provider,
-; ; then call oneself, and get redirected to that
-; ; same location).
;[sip_proxy]
; For incoming calls only. Example: FWD (Free World Dialup)
diff --git a/configure b/configure
index b424ca6bd..27dc08442 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac Revision: 134651 .
+# From configure.ac Revision: 134539 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for asterisk 1.6.
#
@@ -12835,11 +12835,13 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <stdio.h>
+#include <sys/types.h> /* for off_t */
+ #include <stdio.h>
int
main ()
{
-return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
;
return 0;
}
@@ -12879,11 +12881,13 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define _LARGEFILE_SOURCE 1
-#include <stdio.h>
+#include <sys/types.h> /* for off_t */
+ #include <stdio.h>
int
main ()
{
-return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
+int (*fp) (FILE *, off_t, int) = fseeko;
+ return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
;
return 0;
}
@@ -40991,7 +40995,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "${HAS_PWLIB:-unset}" != "unset"; then
- PWLIB_VERSION=`grep "PWLIB_VERSION" ${PWLIB_INCDIR}/ptbuildopts.h | sed -e 's/[[:space:]]\{1,\}/ /g' | cut -f3 -d ' ' | sed -e 's/"//g'`
+ PWLIB_VERSION=`grep "PWLIB_VERSION" ${PWLIB_INCDIR}/ptbuildopts.h | cut -f2 -d ' ' | sed -e 's/"//g'`
PWLIB_MAJOR_VERSION=`echo ${PWLIB_VERSION} | cut -f1 -d.`
PWLIB_MINOR_VERSION=`echo ${PWLIB_VERSION} | cut -f2 -d.`
PWLIB_BUILD_NUMBER=`echo ${PWLIB_VERSION} | cut -f3 -d.`
@@ -41939,7 +41943,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "${HAS_OPENH323:-unset}" != "unset"; then
- OPENH323_VERSION=`grep "OPENH323_VERSION" ${OPENH323_INCDIR}/openh323buildopts.h | sed -e 's/[[:space:]]\{1,\}/ /g' | cut -f3 -d ' ' | sed -e 's/"//g'`
+ OPENH323_VERSION=`grep "OPENH323_VERSION" ${OPENH323_INCDIR}/openh323buildopts.h | cut -f2 -d ' ' | sed -e 's/"//g'`
OPENH323_MAJOR_VERSION=`echo ${OPENH323_VERSION} | cut -f1 -d.`
OPENH323_MINOR_VERSION=`echo ${OPENH323_VERSION} | cut -f2 -d.`
OPENH323_BUILD_NUMBER=`echo ${OPENH323_VERSION} | cut -f3 -d.`
diff --git a/contrib/scripts/vmail.cgi b/contrib/scripts/vmail.cgi
index de51a4dc7..95bb9bb77 100644
--- a/contrib/scripts/vmail.cgi
+++ b/contrib/scripts/vmail.cgi
@@ -193,40 +193,7 @@ sub check_login($$)
}
}
close(VMAIL);
- return check_login_users();
-}
-
-sub check_login_users {
- my ($mbox, $context) = split(/\@/, param('mailbox'));
- my $pass = param('password');
- my ($found, $fullname) = (0, "");
- open VMAIL, "</etc/asterisk/users.conf";
- while (<VMAIL>) {
- chomp;
- if (m/\[(.*)\]/) {
- if ($1 eq $mbox) {
- $found = 1;
- } elsif ($found == 2) {
- close VMAIL;
- return (($fullname ? $fullname : "Extension $mbox in $context"), $context);
- } else {
- $found = 0;
- }
- } elsif ($found) {
- my ($var, $value) = split /\s*=\s*/, $_, 2;
- if ($var eq 'vmsecret' and $value eq $pass) {
- $found = 2;
- } elsif ($var eq 'fullname') {
- $fullname = $value;
- if ($found == 2) {
- close VMAIL;
- return ($fullname, $context);
- }
- }
- }
- }
- close VMAIL;
- return ("", "");
+ return ("", $category);
}
sub validmailbox($$$$)
diff --git a/doc/tex/privacy.tex b/doc/tex/privacy.tex
index 81b2fac19..17cf6a12b 100644
--- a/doc/tex/privacy.tex
+++ b/doc/tex/privacy.tex
@@ -35,10 +35,8 @@ Null callerid's are a fact of life, and could be a friend with an
unlisted number, or some charity looking for a handout. The
PrivacyManager application can help here. It will ask the caller to
enter a 10-digit phone number. They get 3 tries(configurable), and this is
-configurable, with control being passed to next priority where you can
-check the channelvariable PRIVACYMGRSTATUS. If the callerid was valid this
-variable will have the value SUCCESS, otherwise it will have the value
-FAILED.
+configurable, with control being passed to priority+101 if they won't
+supply one.
PrivacyManager can't guarantee that the number they supply is any
good, tho, as there is no way to find out, short of hanging up and
@@ -76,15 +74,13 @@ exten => s,2,SetVar,repeatcount=0
exten => s,3,Zapateller,nocallerid
exten => s,4,PrivacyManager
;; do this if they don't enter a number to Privacy Manager
-exten => s,5,GotoIf($[ "${PRIVACYMGRSTATUS}" = "FAILED" ]?s,105)
-exten => s,6,GotoIf($[ "${CALLERID(num)}" = "7773334444" & "${CALLERID(name)}" : "Privacy Manager" ]?callerid-liar,s,1:s,7)
-exten => s,7,Dial(SIP/yourphone)
exten => s,105,Background(tt-allbusy)
exten => s,106,Background(tt-somethingwrong)
exten => s,107,Background(tt-monkeysintro)
exten => s,108,Background(tt-monkeys)
exten => s,109,Background(tt-weasels)
exten => s,110,Hangup
+exten => s,5,GotoIf($[ "${CALLERID(num)}" = "7773334444" & "${CALLERID(name)}" : "Privacy Manager" ]?callerid-liar,s,1:s,7)
\end{verbatim}
\end{astlisting}
diff --git a/formats/format_pcm.c b/formats/format_pcm.c
index a9c44d502..07b474469 100644
--- a/formats/format_pcm.c
+++ b/formats/format_pcm.c
@@ -271,10 +271,9 @@ static int check_header(FILE *f)
if (magic != (uint32_t) AU_MAGIC) {
ast_log(LOG_WARNING, "Bad magic: 0x%x\n", magic);
}
- hdr_size = ltohl(header[AU_HDR_HDR_SIZE_OFF]);
- if (hdr_size < AU_HEADER_SIZE) {
- hdr_size = AU_HEADER_SIZE;
- }
+/* hdr_size = ltohl(header[AU_HDR_HDR_SIZE_OFF]);
+ if (hdr_size < AU_HEADER_SIZE)*/
+ hdr_size = AU_HEADER_SIZE;
/* data_size = ltohl(header[AU_HDR_DATA_SIZE_OFF]); */
encoding = ltohl(header[AU_HDR_ENCODING_OFF]);
if (encoding != AU_ENC_8BIT_ULAW) {
diff --git a/funcs/func_cut.c b/funcs/func_cut.c
index 96779b661..169fed6b5 100644
--- a/funcs/func_cut.c
+++ b/funcs/func_cut.c
@@ -82,7 +82,7 @@ static int sort_internal(struct ast_channel *chan, char *data, char *buffer, siz
/* Parse each into a struct */
count2 = 0;
while ((ptrkey = strsep(&strings, ","))) {
- ptrvalue = strchr(ptrkey, ':');
+ ptrvalue = index(ptrkey, ':');
if (!ptrvalue) {
count--;
continue;
@@ -171,7 +171,7 @@ static int cut_internal(struct ast_channel *chan, char *data, char *buffer, size
/* Get to start, if any */
if (num1 > 0) {
while (tmp2 != (char *)NULL + 1 && curfieldnum < num1) {
- tmp2 = strchr(tmp2, d) + 1;
+ tmp2 = index(tmp2, d) + 1;
curfieldnum++;
}
}
diff --git a/include/asterisk.h b/include/asterisk.h
index f55d5bb0d..9d5c1ae8a 100644
--- a/include/asterisk.h
+++ b/include/asterisk.h
@@ -18,12 +18,15 @@
#ifndef _ASTERISK_H
#define _ASTERISK_H
+/* The include of 'autoconfig.h' is not necessary for any modules that
+ are part of the Asterisk source tree, because the top-level Makefile
+ will forcibly include that header in all compilations before all
+ other headers (even system headers). However, leaving this here will
+ help out-of-tree module builders, and doesn't cause any harm for the
+ in-tree modules.
+*/
#include "asterisk/autoconfig.h"
-#if !defined(NO_MALLOC_DEBUG) && !defined(STANDALONE) && defined(MALLOC_DEBUG)
-#include "asterisk/astmm.h"
-#endif
-
#include "asterisk/compat.h"
#include "asterisk/logger.h"
diff --git a/include/asterisk/astmm.h b/include/asterisk/astmm.h
index 5d0d47ff5..f2a632e3c 100644
--- a/include/asterisk/astmm.h
+++ b/include/asterisk/astmm.h
@@ -27,13 +27,6 @@
#include "asterisk.h"
-/* Include these now to prevent them from being needed later */
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
-
/* Undefine any macros */
#undef malloc
#undef calloc
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index a3d73c9da..cc733b344 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -588,10 +588,6 @@ enum {
/*! This flag indicates that on a masquerade, an active stream should not
* be carried over */
AST_FLAG_MASQ_NOSTREAM = (1 << 16),
- /*! This flag indicates that the hangup exten was run when the bridge terminated,
- * a message aimed at preventing a subsequent hangup exten being run at the pbx_run
- * level */
- AST_FLAG_BRIDGE_HANGUP_RUN = (1 << 17),
};
/*! \brief ast_bridge_config flags */
@@ -603,7 +599,6 @@ enum {
AST_FEATURE_AUTOMON = (1 << 4),
AST_FEATURE_PARKCALL = (1 << 5),
AST_FEATURE_AUTOMIXMON = (1 << 6),
- AST_FEATURE_NO_H_EXTEN = (1 << 7),
};
/*! \brief bridge configuration */
diff --git a/include/asterisk/hashtab.h b/include/asterisk/hashtab.h
index aa4dc59db..ed9a95e84 100644
--- a/include/asterisk/hashtab.h
+++ b/include/asterisk/hashtab.h
@@ -198,11 +198,7 @@ struct ast_hashtab * ast_hashtab_create(int initial_buckets,
/*!
* \brief This func will free the hash table and all its memory.
- * \note It doesn't touch the objects stored in it, unless you
- * specify a destroy func; it will call that func for each
- * object in the hashtab, remove all the objects, and then
- * free the hashtab itself. If no destroyfunc is specified
- * then the routine will assume you will free it yourself.
+ * \note It doesn't touch the objects stored in it
* \param tab
* \param objdestroyfunc
*/
diff --git a/main/Makefile b/main/Makefile
index fe9caa967..b3a53a39f 100644
--- a/main/Makefile
+++ b/main/Makefile
@@ -117,12 +117,9 @@ ast_expr2.c ast_expr2.h:
bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
ast_expr2f.c:
- flex -o $@ --full ast_expr2.fl
- sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' $@ > $@.fix
- echo "#include \"asterisk.h\"" > $@
- echo >> $@
- cat $@.fix >> $@
- rm $@.fix
+ flex -o $@ --full ast_expr2.fl # moved the correction of yyfree into the flex input file itself.
+ sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' ast_expr2f.c > zz
+ mv zz ast_expr2f.c
ast_expr2f.o: ASTCFLAGS+=-Wno-unused
diff --git a/main/app.c b/main/app.c
index bf3b248d4..2b63128af 100644
--- a/main/app.c
+++ b/main/app.c
@@ -1703,11 +1703,6 @@ int ast_get_encoded_char(const char *stream, char *result, size_t *consumed)
int i;
*consumed = 1;
*result = 0;
- if (ast_strlen_zero(stream)) {
- *consumed = 0;
- return -1;
- }
-
if (*stream == '\\') {
*consumed = 2;
switch (*(stream + 1)) {
diff --git a/main/ast_expr2.c b/main/ast_expr2.c
index 2534938b2..693a7896a 100644
--- a/main/ast_expr2.c
+++ b/main/ast_expr2.c
@@ -131,14 +131,11 @@
* $FreeBSD: src/bin/expr/expr.y,v 1.16 2000/07/22 10:59:36 se Exp $
*/
-#include "asterisk.h"
-
#include <sys/types.h>
#include <stdio.h>
-
-#if !defined(STANDALONE)
+#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#else
+#ifdef STANDALONE
#ifndef __USE_ISOC99
#define __USE_ISOC99 1
#endif
@@ -426,6 +423,7 @@ static int to_number __P((struct val *));
static void to_string __P((struct val *));
static struct expr_node *alloc_expr_node(enum node_type);
static void destroy_arglist(struct expr_node *arglist);
+static int is_really_num(char *str);
/* uh, if I want to predeclare yylex with a YYLTYPE, I have to predeclare the yyltype... sigh */
typedef struct yyltype
@@ -2475,6 +2473,61 @@ is_zero_or_null (struct val *vp)
/* NOTREACHED */
}
+#ifdef STANDALONE
+
+void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
+{
+ va_list vars;
+ va_start(vars,fmt);
+
+ printf("LOG: lev:%d file:%s line:%d func: %s ",
+ level, file, line, function);
+ vprintf(fmt, vars);
+ fflush(stdout);
+ va_end(vars);
+}
+
+
+int main(int argc,char **argv) {
+ char s[4096];
+ char out[4096];
+ FILE *infile;
+
+ if( !argv[1] )
+ exit(20);
+
+ if( access(argv[1],F_OK)== 0 )
+ {
+ int ret;
+
+ infile = fopen(argv[1],"r");
+ if( !infile )
+ {
+ printf("Sorry, couldn't open %s for reading!\n", argv[1]);
+ exit(10);
+ }
+ while( fgets(s,sizeof(s),infile) )
+ {
+ if( s[strlen(s)-1] == '\n' )
+ s[strlen(s)-1] = 0;
+
+ ret = ast_expr(s, out, sizeof(out),NULL);
+ printf("Expression: %s Result: [%d] '%s'\n",
+ s, ret, out);
+ }
+ fclose(infile);
+ }
+ else
+ {
+ if (ast_expr(argv[1], s, sizeof(s), NULL))
+ printf("=====%s======\n",s);
+ else
+ printf("No result\n");
+ }
+}
+
+#endif
+
#undef ast_yyerror
#define ast_yyerror(x) ast_yyerror(x, YYLTYPE *yylloc, struct parse_io *parseio)
@@ -2499,7 +2552,6 @@ static void destroy_arglist(struct expr_node *arglist)
}
}
-#if !defined(STANDALONE)
static char *compose_func_args(struct expr_node *arglist)
{
struct expr_node *t = arglist;
@@ -2549,7 +2601,7 @@ static int is_really_num(char *str)
else
return 0;
}
-#endif
+
static struct val *op_func(struct val *funcname, struct expr_node *arglist, struct ast_channel *chan)
{
diff --git a/main/ast_expr2.fl b/main/ast_expr2.fl
index a6b5dc1d4..0749686fa 100644
--- a/main/ast_expr2.fl
+++ b/main/ast_expr2.fl
@@ -22,10 +22,12 @@
* \brief Dialplan Expression Lexical Scanner
*/
+#include "asterisk.h"
+
#include <sys/types.h>
#include <stdio.h>
-#if !defined(STANDALONE)
+#ifndef STANDALONE
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#else
#ifndef __USE_ISOC99
@@ -273,7 +275,7 @@ int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan)
return_value = (res_length <= length) ? res_length : length;
} else {
if (io.val->u.s)
-#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE)
+#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
strncpy(buf, io.val->u.s, length - 1);
#else /* !STANDALONE && !LOW_MEMORY */
ast_copy_string(buf, io.val->u.s, length);
diff --git a/main/ast_expr2.y b/main/ast_expr2.y
index de7360020..7eba6d165 100644
--- a/main/ast_expr2.y
+++ b/main/ast_expr2.y
@@ -12,14 +12,11 @@
* $FreeBSD: src/bin/expr/expr.y,v 1.16 2000/07/22 10:59:36 se Exp $
*/
-#include "asterisk.h"
-
#include <sys/types.h>
#include <stdio.h>
-
-#if !defined(STANDALONE)
+#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#else
+#ifdef STANDALONE
#ifndef __USE_ISOC99
#define __USE_ISOC99 1
#endif
@@ -307,6 +304,7 @@ static int to_number __P((struct val *));
static void to_string __P((struct val *));
static struct expr_node *alloc_expr_node(enum node_type);
static void destroy_arglist(struct expr_node *arglist);
+static int is_really_num(char *str);
/* uh, if I want to predeclare yylex with a YYLTYPE, I have to predeclare the yyltype... sigh */
typedef struct yyltype
@@ -647,6 +645,61 @@ is_zero_or_null (struct val *vp)
/* NOTREACHED */
}
+#ifdef STANDALONE
+
+void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
+{
+ va_list vars;
+ va_start(vars,fmt);
+
+ printf("LOG: lev:%d file:%s line:%d func: %s ",
+ level, file, line, function);
+ vprintf(fmt, vars);
+ fflush(stdout);
+ va_end(vars);
+}
+
+
+int main(int argc,char **argv) {
+ char s[4096];
+ char out[4096];
+ FILE *infile;
+
+ if( !argv[1] )
+ exit(20);
+
+ if( access(argv[1],F_OK)== 0 )
+ {
+ int ret;
+
+ infile = fopen(argv[1],"r");
+ if( !infile )
+ {
+ printf("Sorry, couldn't open %s for reading!\n", argv[1]);
+ exit(10);
+ }
+ while( fgets(s,sizeof(s),infile) )
+ {
+ if( s[strlen(s)-1] == '\n' )
+ s[strlen(s)-1] = 0;
+
+ ret = ast_expr(s, out, sizeof(out),NULL);
+ printf("Expression: %s Result: [%d] '%s'\n",
+ s, ret, out);
+ }
+ fclose(infile);
+ }
+ else
+ {
+ if (ast_expr(argv[1], s, sizeof(s), NULL))
+ printf("=====%s======\n",s);
+ else
+ printf("No result\n");
+ }
+}
+
+#endif
+
#undef ast_yyerror
#define ast_yyerror(x) ast_yyerror(x, YYLTYPE *yylloc, struct parse_io *parseio)
@@ -671,7 +724,6 @@ static void destroy_arglist(struct expr_node *arglist)
}
}
-#if !defined(STANDALONE)
static char *compose_func_args(struct expr_node *arglist)
{
struct expr_node *t = arglist;
@@ -721,7 +773,7 @@ static int is_really_num(char *str)
else
return 0;
}
-#endif
+
static struct val *op_func(struct val *funcname, struct expr_node *arglist, struct ast_channel *chan)
{
diff --git a/main/ast_expr2f.c b/main/ast_expr2f.c
index 8046d6556..3d97d8b82 100644
--- a/main/ast_expr2f.c
+++ b/main/ast_expr2f.c
@@ -1,5 +1,3 @@
-#include "asterisk.h"
-
#line 2 "ast_expr2f.c"
#line 4 "ast_expr2f.c"
@@ -508,10 +506,12 @@ static yyconst flex_int16_t yy_chk[139] =
* \brief Dialplan Expression Lexical Scanner
*/
+#include "asterisk.h"
+
#include <sys/types.h>
#include <stdio.h>
-#if !defined(STANDALONE)
+#ifndef STANDALONE
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#else
#ifndef __USE_ISOC99
@@ -2369,7 +2369,7 @@ int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan)
return_value = (res_length <= length) ? res_length : length;
} else {
if (io.val->u.s)
-#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE)
+#if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
strncpy(buf, io.val->u.s, length - 1);
#else /* !STANDALONE && !LOW_MEMORY */
ast_copy_string(buf, io.val->u.s, length);
diff --git a/main/astmm.c b/main/astmm.c
index f5191c2e5..04a19037d 100644
--- a/main/astmm.c
+++ b/main/astmm.c
@@ -23,10 +23,10 @@
* \author Mark Spencer <markster@digium.com>
*/
-#include "asterisk.h"
-
#ifdef __AST_DEBUG_MALLOC
+#include "asterisk.h"
+
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/paths.h" /* use ast_config_AST_LOG_DIR */
diff --git a/main/features.c b/main/features.c
index 7f2dba854..f13c5d124 100644
--- a/main/features.c
+++ b/main/features.c
@@ -1871,20 +1871,6 @@ static struct ast_channel *ast_feature_request_and_dial(struct ast_channel *call
}
/*!
- * \brief return the first unlocked cdr in a possible chain
-*/
-static struct ast_cdr *pick_unlocked_cdr(struct ast_cdr *cdr)
-{
- struct ast_cdr *cdr_orig = cdr;
- while (cdr) {
- if (!ast_test_flag(cdr,AST_CDR_FLAG_LOCKED))
- return cdr;
- cdr = cdr->next;
- }
- return cdr_orig; /* everybody LOCKED or some other weirdness, like a NULL */
-}
-
-/*!
* \brief bridge the call and set CDR
* \param chan,peer,config
*
@@ -1911,10 +1897,6 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
struct ast_bridge_config backup_config;
struct ast_cdr *bridge_cdr = NULL;
struct ast_cdr *orig_peer_cdr = NULL;
- struct ast_cdr *chan_cdr = pick_unlocked_cdr(chan->cdr); /* the proper chan cdr, if there are forked cdrs */
- struct ast_cdr *peer_cdr = pick_unlocked_cdr(peer->cdr); /* the proper chan cdr, if there are forked cdrs */
- struct ast_cdr *new_chan_cdr = NULL; /* the proper chan cdr, if there are forked cdrs */
- struct ast_cdr *new_peer_cdr = NULL; /* the proper chan cdr, if there are forked cdrs */
memset(&backup_config, 0, sizeof(backup_config));
@@ -1952,14 +1934,14 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
ast_copy_string(orig_channame,chan->name,sizeof(orig_channame));
ast_copy_string(orig_peername,peer->name,sizeof(orig_peername));
- orig_peer_cdr = peer_cdr;
+ orig_peer_cdr = peer->cdr;
- if (!chan_cdr || (chan_cdr && !ast_test_flag(chan_cdr, AST_CDR_FLAG_POST_DISABLED))) {
+ if (!chan->cdr || (chan->cdr && !ast_test_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED))) {
- if (chan_cdr) {
- ast_set_flag(chan_cdr, AST_CDR_FLAG_MAIN);
+ if (chan->cdr) {
+ ast_set_flag(chan->cdr, AST_CDR_FLAG_MAIN);
ast_cdr_update(chan);
- bridge_cdr = ast_cdr_dup(chan_cdr);
+ bridge_cdr = ast_cdr_dup(chan->cdr);
ast_copy_string(bridge_cdr->lastapp, chan->appl, sizeof(bridge_cdr->lastapp));
ast_copy_string(bridge_cdr->lastdata, chan->data, sizeof(bridge_cdr->lastdata));
} else {
@@ -1977,32 +1959,30 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
/* Destination information */
ast_copy_string(bridge_cdr->dst, chan->exten, sizeof(bridge_cdr->dst));
ast_copy_string(bridge_cdr->dcontext, chan->context, sizeof(bridge_cdr->dcontext));
- if (peer_cdr) {
- bridge_cdr->start = peer_cdr->start;
- ast_copy_string(bridge_cdr->userfield, peer_cdr->userfield, sizeof(bridge_cdr->userfield));
+ if (peer->cdr) {
+ bridge_cdr->start = peer->cdr->start;
+ ast_copy_string(bridge_cdr->userfield, peer->cdr->userfield, sizeof(bridge_cdr->userfield));
} else {
ast_cdr_start(bridge_cdr);
}
}
ast_debug(4,"bridge answer set, chan answer set\n");
- /* peer_cdr->answer will be set when a macro runs on the peer;
+ /* peer->cdr->answer will be set when a macro runs on the peer;
in that case, the bridge answer will be delayed while the
macro plays on the peer channel. The peer answered the call
before the macro started playing. To the phone system,
this is billable time for the call, even tho the caller
hears nothing but ringing while the macro does its thing. */
- if (peer_cdr && !ast_tvzero(peer_cdr->answer)) {
- bridge_cdr->answer = peer_cdr->answer;
- chan_cdr->answer = peer_cdr->answer;
- bridge_cdr->disposition = peer_cdr->disposition;
- chan_cdr->disposition = peer_cdr->disposition;
+ if (peer->cdr && !ast_tvzero(peer->cdr->answer)) {
+ bridge_cdr->answer = peer->cdr->answer;
+ chan->cdr->answer = peer->cdr->answer;
} else {
ast_cdr_answer(bridge_cdr);
- ast_cdr_answer(chan_cdr); /* for the sake of cli status checks */
+ ast_cdr_answer(chan->cdr); /* for the sake of cli status checks */
}
- ast_set_flag(chan_cdr, AST_CDR_FLAG_BRIDGED);
- if (peer_cdr) {
- ast_set_flag(peer_cdr, AST_CDR_FLAG_BRIDGED);
+ ast_set_flag(chan->cdr, AST_CDR_FLAG_BRIDGED);
+ if (peer->cdr) {
+ ast_set_flag(peer->cdr, AST_CDR_FLAG_BRIDGED);
}
}
for (;;) {
@@ -2167,129 +2147,52 @@ int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast
}
before_you_go:
- new_chan_cdr = pick_unlocked_cdr(chan->cdr); /* the proper chan cdr, if there are forked cdrs */
- new_peer_cdr = pick_unlocked_cdr(peer->cdr); /* the proper chan cdr, if there are forked cdrs */
-
- if (!ast_test_flag(&(config->features_caller),AST_FEATURE_NO_H_EXTEN) && ast_exists_extension(chan, chan->context, "h", 1, chan->cid.cid_num)) {
- struct ast_cdr *swapper;
- char savelastapp[AST_MAX_EXTENSION];
- char savelastdata[AST_MAX_EXTENSION];
- char save_exten[AST_MAX_EXTENSION];
- int save_prio;
- int found = 0; /* set if we find at least one match */
-
- if (ast_opt_end_cdr_before_h_exten) {
- ast_cdr_end(bridge_cdr);
- }
- /* swap the bridge cdr and the chan cdr for a moment, and let the endbridge
- dialplan code operate on it */
- swapper = chan->cdr;
- ast_copy_string(savelastapp, bridge_cdr->lastapp, sizeof(bridge_cdr->lastapp));
- ast_copy_string(savelastdata, bridge_cdr->lastdata, sizeof(bridge_cdr->lastdata));
- ast_channel_lock(chan);
- chan->cdr = bridge_cdr;
- ast_copy_string(save_exten, chan->exten, sizeof(save_exten));
- save_prio = chan->priority;
- ast_copy_string(chan->exten, "h", sizeof(chan->exten));
- chan->priority = 1;
- ast_channel_unlock(chan);
- while ((res = ast_spawn_extension(chan, chan->context, chan->exten, chan->priority, chan->cid.cid_num, &found, 1)) == 0) {
- chan->priority++;
- }
- if (found && res)
- {
- /* Something bad happened, or a hangup has been requested. */
- ast_debug(1, "Spawn extension (%s,%s,%d) exited non-zero on '%s'\n", chan->context, chan->exten, chan->priority, chan->name);
- ast_verb(2, "Spawn extension (%s, %s, %d) exited non-zero on '%s'\n", chan->context, chan->exten, chan->priority, chan->name);
- }
- /* swap it back */
- ast_channel_lock(chan);
- ast_copy_string(chan->exten, save_exten, sizeof(chan->exten));
- chan->priority = save_prio;
- chan->cdr = swapper;
- ast_set_flag(chan, AST_FLAG_BRIDGE_HANGUP_RUN);
- ast_channel_unlock(chan);
- /* protect the lastapp/lastdata against the effects of the hangup/dialplan code */
- ast_copy_string(bridge_cdr->lastapp, savelastapp, sizeof(bridge_cdr->lastapp));
- ast_copy_string(bridge_cdr->lastdata, savelastdata, sizeof(bridge_cdr->lastdata));
- }
-
/* obey the NoCDR() wishes. */
- if (new_chan_cdr && ast_test_flag(new_chan_cdr, AST_CDR_FLAG_POST_DISABLED) && new_peer_cdr && !ast_test_flag(new_peer_cdr, AST_CDR_FLAG_POST_DISABLED))
- ast_set_flag(new_peer_cdr, AST_CDR_FLAG_POST_DISABLED); /* DISABLED is viral-- it will propagate across a bridge */
- if (!new_chan_cdr || (new_chan_cdr && !ast_test_flag(new_chan_cdr, AST_CDR_FLAG_POST_DISABLED))) {
- struct ast_channel *chan_ptr = NULL;
+ if (!chan->cdr || (chan->cdr && !ast_test_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED))) {
ast_cdr_end(bridge_cdr);
ast_cdr_detach(bridge_cdr);
- /* do a specialized reset on the beginning channel
- CDR's, if they still exist, so as not to mess up
- issues in future bridges;
-
- Here are the rules of the game:
- 1. The chan and peer channel pointers will not change
- during the life of the bridge.
- 2. But, in transfers, the channel names will change.
- between the time the bridge is started, and the
- time the channel ends.
- Usually, when a channel changes names, it will
- also change CDR pointers.
- 3. Usually, only one of the two channels (chan or peer)
- will change names.
- 4. Usually, if a channel changes names during a bridge,
- it is because of a transfer. Usually, in these situations,
- it is normal to see 2 bridges running simultaneously, and
- it is not unusual to see the two channels that change
- swapped between bridges.
- 5. After a bridge occurs, we have 2 or 3 channels' CDRs
- to attend to; if the chan or peer changed names,
- we have the before and after attached CDR's.
- */
-
- if (strcasecmp(orig_channame, chan->name) != 0) {
- /* old channel */
- chan_ptr = ast_get_channel_by_name_locked(orig_channame);
- if (chan_ptr) {
- if (!ast_bridged_channel(chan_ptr)) {
- struct ast_cdr *cur;
- for (cur = chan_ptr->cdr; cur; cur = cur->next) {
- if (cur == chan_cdr) {
- break;
- }
- }
- if (cur)
- ast_cdr_specialized_reset(chan_cdr,0);
- }
- ast_channel_unlock(chan_ptr);
- }
- /* new channel */
- ast_cdr_specialized_reset(new_chan_cdr,0);
- } else {
- ast_cdr_specialized_reset(chan_cdr,0); /* nothing changed, reset the chan_cdr */
- }
- if (strcasecmp(orig_peername, peer->name) != 0) {
- /* old channel */
- chan_ptr = ast_get_channel_by_name_locked(orig_peername);
- if (chan_ptr) {
- if (!ast_bridged_channel(chan_ptr)) {
- struct ast_cdr *cur;
- for (cur = chan_ptr->cdr; cur; cur = cur->next) {
- if (cur == peer_cdr) {
- break;
- }
- }
- if (cur)
- ast_cdr_specialized_reset(peer_cdr,0);
- }
- ast_channel_unlock(chan_ptr);
- }
- /* new channel */
- ast_cdr_specialized_reset(new_peer_cdr,0);
- } else {
- ast_cdr_specialized_reset(peer_cdr,0); /* nothing changed, reset the peer_cdr */
- }
+ /* just in case, these channels get bridged again before hangup */
+ if (chan->cdr) {
+ ast_cdr_specialized_reset(chan->cdr,0);
+ }
+ if (peer->cdr) {
+ struct ast_cdr *cur;
+
+ ast_channel_lock(peer);
+ for (cur = peer->cdr; cur; cur = cur->next) {
+ if (cur == orig_peer_cdr) {
+ break;
+ }
+ }
+
+ if (!cur) {
+ /* orig_peer_cdr is gone, probably because of a masquerade
+ * during the bridge. */
+ ast_channel_unlock(peer);
+ return res;
+ }
+
+ /* before resetting the peer cdr, throw a copy of it to the
+ backend, just in case the cdr.conf file is calling for
+ unanswered CDR's. */
+
+ /* When peer->cdr isn't the same addr as orig_peer_cdr,
+ this can only happen if there was a transfer, methinks;
+ at any rate, only pay attention to the original*/
+ if (ast_cdr_isset_unanswered()) {
+ struct ast_cdr *dupd = ast_cdr_dup(orig_peer_cdr);
+ if (dupd) {
+ if (ast_tvzero(dupd->end) && ast_cdr_isset_unanswered())
+ ast_cdr_end(dupd);
+ ast_cdr_detach(dupd);
+ }
+ }
+ ast_cdr_specialized_reset(orig_peer_cdr,0);
+ ast_channel_unlock(peer);
+ }
}
return res;
}
diff --git a/main/file.c b/main/file.c
index e88279a6f..ca38d187d 100644
--- a/main/file.c
+++ b/main/file.c
@@ -917,7 +917,6 @@ struct ast_filestream *ast_readfile(const char *filename, const char *type, cons
ast_log(LOG_WARNING, "Unable to open %s\n", fn);
if (fs)
ast_free(fs);
- fs = NULL;
if (bfile)
fclose(bfile);
ast_free(fn);
diff --git a/main/pbx.c b/main/pbx.c
index 70f1f0c50..5ff9396f5 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -1042,7 +1042,7 @@ static void pbx_destroy(struct ast_pbx *p)
* NULL
*
* In the above, I could easily turn "N" into "23456789", but I think that a quick "if( *z >= '2' && *z <= '9' )" might take
- * fewer CPU cycles than a call to strchr("23456789",*z), where *z is the char to match...
+ * fewer CPU cycles than a call to index("23456789",*z), where *z is the char to match...
*
* traversal is pretty simple: one routine merely traverses the alt list, and for each matching char in the pattern, it calls itself
* on the corresponding next pointer, incrementing also the pointer of the string to be matched, and passing the total specificity and length.
@@ -1340,7 +1340,7 @@ static void new_find_extension(const char *str, struct scoreboard *score, struct
return; /* the first match is all we need */
}
}
- } else if (strchr(p->x, *str)) {
+ } else if (index(p->x, *str)) {
ast_debug(4, "Nothing strange about this match\n");
NEW_MATCHER_CHK_MATCH;
NEW_MATCHER_RECURSE;
@@ -3113,8 +3113,6 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con,
return pbx_exec(c, app, passdata); /* 0 on success, -1 on failure */
}
} else if (q.swo) { /* not found here, but in another switch */
- if (found)
- *found = 1;
ast_unlock_contexts();
if (matching_action) {
return -1;
@@ -3847,7 +3845,7 @@ static int __ast_pbx_run(struct ast_channel *c)
ast_log(LOG_WARNING, "Don't know what to do with '%s'\n", c->name);
if (res != AST_PBX_KEEPALIVE)
ast_softhangup(c, c->hangupcause ? c->hangupcause : AST_CAUSE_NORMAL_CLEARING);
- if ((res != AST_PBX_KEEPALIVE) && !ast_test_flag(c, AST_FLAG_BRIDGE_HANGUP_RUN) && ast_exists_extension(c, c->context, "h", 1, c->cid.cid_num)) {
+ if ((res != AST_PBX_KEEPALIVE) && ast_exists_extension(c, c->context, "h", 1, c->cid.cid_num)) {
set_ext_pri(c, "h", 1);
while ((res = ast_spawn_extension(c, c->context, c->exten, c->priority, c->cid.cid_num, &found, 1)) == 0) {
c->priority++;
@@ -3859,7 +3857,7 @@ static int __ast_pbx_run(struct ast_channel *c)
}
}
ast_set2_flag(c, autoloopflag, AST_FLAG_IN_AUTOLOOP);
- ast_clear_flag(c, AST_FLAG_BRIDGE_HANGUP_RUN); /* from one round to the next, make sure this gets cleared */
+
pbx_destroy(c->pbx);
c->pbx = NULL;
if (res != AST_PBX_KEEPALIVE)
diff --git a/main/sched.c b/main/sched.c
index 0d5968954..88a259b40 100644
--- a/main/sched.c
+++ b/main/sched.c
@@ -195,6 +195,7 @@ static int sched_settime(struct timeval *tv, int when)
*tv = now;
*tv = ast_tvadd(*tv, ast_samp2tv(when, 1000));
if (ast_tvcmp(*tv, now) < 0) {
+ ast_debug(1, "Request to schedule in the past?!?!\n");
*tv = now;
}
return 0;
@@ -215,9 +216,11 @@ int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb cal
{
struct sched *tmp;
int res = -1;
-
DEBUG(ast_debug(1, "ast_sched_add()\n"));
-
+ if (!when) {
+ ast_log(LOG_NOTICE, "Scheduled event in 0 ms?\n");
+ return -1;
+ }
ast_mutex_lock(&con->lock);
if ((tmp = sched_alloc(con))) {
tmp->id = con->eventcnt++;
@@ -239,7 +242,6 @@ int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb cal
ast_sched_dump(con);
#endif
ast_mutex_unlock(&con->lock);
-
return res;
}
diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c
index b25b8ab14..445f93a55 100644
--- a/main/stdtime/localtime.c
+++ b/main/stdtime/localtime.c
@@ -44,6 +44,7 @@
/*LINTLIBRARY*/
+
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c
index 81801f1c9..22ec24105 100644
--- a/pbx/pbx_ael.c
+++ b/pbx/pbx_ael.c
@@ -28,9 +28,7 @@
#include "asterisk.h"
-#if !defined(STANDALONE)
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#endif
#include <ctype.h>
#include <regex.h>
@@ -264,7 +262,7 @@ static int reload(void)
return pbx_load_module();
}
-#ifdef STANDALONE
+#ifdef STANDALONE_AEL
#define AST_MODULE "ael"
int ael_external_load_module(void);
int ael_external_load_module(void)
diff --git a/pbx/pbx_lua.c b/pbx/pbx_lua.c
index b715a3b5f..704d811de 100644
--- a/pbx/pbx_lua.c
+++ b/pbx/pbx_lua.c
@@ -40,14 +40,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/utils.h"
#include "asterisk/term.h"
#include "asterisk/paths.h"
-#include "asterisk/hashtab.h"
#include <lua5.1/lua.h>
#include <lua5.1/lauxlib.h>
#include <lua5.1/lualib.h>
static char *config = "extensions.lua";
-static char *registrar = "pbx_lua";
#define LUA_EXT_DATA_SIZE 256
#define LUA_BUF_SIZE 4096
@@ -57,7 +55,6 @@ static int lua_load_extensions(lua_State *L, struct ast_channel *chan);
static int lua_reload_extensions(lua_State *L);
static void lua_free_extensions(void);
static int lua_sort_extensions(lua_State *L);
-static int lua_register_switches(lua_State *L);
static int lua_extension_cmp(lua_State *L);
static int lua_find_extension(lua_State *L, const char *context, const char *exten, int priority, ast_switch_f *func, int push_func);
static int lua_pbx_findapp(lua_State *L);
@@ -73,7 +70,6 @@ static int lua_autoservice_start(lua_State *L);
static int lua_autoservice_stop(lua_State *L);
static int lua_autoservice_status(lua_State *L);
static int lua_check_hangup(lua_State *L);
-static int lua_error_function(lua_State *L);
static void lua_update_registry(lua_State *L, const char *context, const char *exten, int priority);
static void lua_push_variable_table(lua_State *L, const char *name);
@@ -96,9 +92,6 @@ AST_MUTEX_DEFINE_STATIC(config_file_lock);
char *config_file_data = NULL;
long config_file_size = 0;
-static struct ast_context *local_contexts = NULL;
-static struct ast_hashtab *local_table = NULL;
-
static const struct ast_datastore_info lua_datastore = {
.type = "lua",
.destroy = lua_state_destroy,
@@ -718,39 +711,6 @@ static int lua_check_hangup(lua_State *L)
}
/*!
- * \brief [lua_CFunction] Handle lua errors (for access from lua, don't call
- * directly)
- *
- * \param L the lua_State to use
- */
-static int lua_error_function(lua_State *L)
-{
- int message_index;
-
- /* pass number arguments right through back to asterisk*/
- if (lua_isnumber(L, -1)) {
- return 1;
- }
-
- /* if we are here then we have a string error message, let's attach a
- * backtrace to it */
- message_index = lua_gettop(L);
-
- lua_getglobal(L, "debug");
- lua_getfield(L, -1, "traceback");
- lua_remove(L, -2); /* remove the 'debug' table */
-
- lua_pushvalue(L, message_index);
- lua_remove(L, message_index);
-
- lua_pushnumber(L, 2);
-
- lua_call(L, 2, 1);
-
- return 1;
-}
-
-/*!
* \brief Store the sort order of each context
* In the event of an error, an error string will be pushed onto the lua stack.
@@ -829,65 +789,6 @@ static int lua_sort_extensions(lua_State *L)
}
/*!
- * \brief Register dialplan switches for our pbx_lua contexs.
- *
- * In the event of an error, an error string will be pushed onto the lua stack.
- *
- * \retval 0 success
- * \retval 1 failure
- */
-static int lua_register_switches(lua_State *L)
-{
- int extensions;
- struct ast_context *con = NULL;
-
- /* create the hash table for our contexts */
- /* XXX do we ever need to destroy this? pbx_config does not */
- if (!local_table)
- local_table = ast_hashtab_create(17, ast_hashtab_compare_contexts, ast_hashtab_resize_java, ast_hashtab_newsize_java, ast_hashtab_hash_contexts, 0);
-
- /* load the 'extensions' table */
- lua_getglobal(L, "extensions");
- extensions = lua_gettop(L);
- if (lua_isnil(L, -1)) {
- lua_pop(L, 1);
- lua_pushstring(L, "Unable to find 'extensions' table in extensions.lua\n");
- return 1;
- }
-
- /* iterate through the extensions table and register a context and
- * dialplan switch for each lua context
- */
- for (lua_pushnil(L); lua_next(L, extensions); lua_pop(L, 1)) {
- int context = lua_gettop(L);
- int context_name = context - 1;
- const char *context_str = lua_tostring(L, context_name);
-
- /* find or create this context */
- con = ast_context_find_or_create(&local_contexts, local_table, context_str, registrar);
- if (!con) {
- /* remove extensions table and context key and value */
- lua_pop(L, 3);
- lua_pushstring(L, "Failed to find or create context\n");
- return 1;
- }
-
- /* register the switch */
- if (ast_context_add_switch2(con, "Lua", "", 0, registrar)) {
- /* remove extensions table and context key and value */
- lua_pop(L, 3);
- lua_pushstring(L, "Unable to create switch for context\n");
- return 1;
- }
- }
-
- /* remove the extensions table */
- lua_pop(L, 1);
- return 0;
-}
-
-
-/*!
* \brief [lua_CFunction] Compare two extensions (for access from lua, don't
* call directly)
*
@@ -951,8 +852,7 @@ static char *lua_read_extensions_file(lua_State *L, long *size)
if (luaL_loadbuffer(L, data, *size, "extensions.lua")
|| lua_pcall(L, 0, LUA_MULTRET, 0)
- || lua_sort_extensions(L)
- || lua_register_switches(L)) {
+ || lua_sort_extensions(L)) {
ast_free(data);
data = NULL;
*size = 0;
@@ -1033,15 +933,6 @@ static int lua_reload_extensions(lua_State *L)
config_file_data = data;
config_file_size = size;
-
- /* merge our new contexts */
- ast_merge_contexts_and_delete(&local_contexts, local_table, registrar);
- /* merge_contexts_and_delete will actually, at the correct moment,
- set the global dialplan pointers to your local_contexts and local_table.
- It then will free up the old tables itself. Just be sure not to
- hang onto the pointers. */
- local_table = NULL;
- local_contexts = NULL;
ast_mutex_unlock(&config_file_lock);
return 0;
@@ -1205,7 +1096,7 @@ static int matchmore(struct ast_channel *chan, const char *context, const char *
static int exec(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data)
{
- int res, error_func;
+ int res;
lua_State *L;
struct ast_module_user *u = ast_module_user_add(chan);
if (!u) {
@@ -1219,12 +1110,8 @@ static int exec(struct ast_channel *chan, const char *context, const char *exten
return -1;
}
- lua_pushcfunction(L, &lua_error_function);
- error_func = lua_gettop(L);
-
/* push the extension function onto the stack */
if (!lua_find_extension(L, context, exten, priority, &exists, 1)) {
- lua_pop(L, 1); /* pop the debug function */
ast_log(LOG_ERROR, "Could not find extension %s in context %s\n", exten, context);
if (!chan) lua_close(L);
ast_module_user_remove(u);
@@ -1236,26 +1123,20 @@ static int exec(struct ast_channel *chan, const char *context, const char *exten
lua_pushstring(L, context);
lua_pushstring(L, exten);
- res = lua_pcall(L, 2, 0, error_func);
+ res = lua_pcall(L, 2, 0, 0);
if (res) {
if (res == LUA_ERRRUN) {
- res = -1;
if (lua_isnumber(L, -1)) {
res = lua_tointeger(L, -1);
} else if (lua_isstring(L, -1)) {
const char *error = lua_tostring(L, -1);
ast_log(LOG_ERROR, "Error executing lua extension: %s\n", error);
+ res = -1;
}
- } else if (res == LUA_ERRERR) {
- res = -1;
- ast_log(LOG_ERROR, "Error in the lua error handler (this is probably a bug in pbx_lua)\n");
- } else if (res == LUA_ERRMEM) {
+ } else {
res = -1;
- ast_log(LOG_ERROR, "Memory allocation error\n");
}
- lua_pop(L, 1);
}
- lua_remove(L, error_func);
if (!chan) lua_close(L);
ast_module_user_remove(u);
return res;
@@ -1312,25 +1193,22 @@ static int lua_find_extension(lua_State *L, const char *context, const char *ext
/* step through the extensions looking for a match */
for (i = 1; i < lua_objlen(L, context_order_table) + 1; i++) {
- int e_index, e_index_copy, match = 0;
+ int e_index, isnumber, match = 0;
const char *e;
lua_pushinteger(L, i);
lua_gettable(L, context_order_table);
e_index = lua_gettop(L);
+ isnumber = lua_isnumber(L, e_index);
- /* copy the key at the top of the stack for use later */
- lua_pushvalue(L, -1);
- e_index_copy = lua_gettop(L);
-
- if (!(e = lua_tostring(L, e_index_copy))) {
- lua_pop(L, 2);
+ if (!(e = lua_tostring(L, e_index))) {
+ lua_pop(L, 1);
continue;
}
/* make sure this is not the 'include' extension */
if (!strcasecmp(e, "include")) {
- lua_pop(L, 2);
+ lua_pop(L, 1);
continue;
}
@@ -1345,28 +1223,34 @@ static int lua_find_extension(lua_State *L, const char *context, const char *ext
* match, 2 on earlymatch */
if (!match) {
- /* pop the copy and the extension */
- lua_pop(L, 2);
+ lua_pop(L, 1);
continue; /* keep trying */
}
if (func == &matchmore && match == 2) {
/* We match an extension ending in '!'. The decision in
* this case is final and counts as no match. */
- lua_pop(L, 4);
+ lua_pop(L, 3);
return 0;
}
- /* remove the context table, the context order table, the
- * extension, and the extension copy (or replace the extension
- * with the corresponding function) */
+ /* remove the context table, the context order table, and the
+ * extension (or replace the extension with the corisponding
+ * function) */
if (push_func) {
- lua_pop(L, 1); /* pop the copy */
+ /* here we must convert the exten back to an integer
+ * because lua_tostring will change the value on the
+ * stack to a string */
+ if (isnumber) {
+ int e_int = lua_tointeger(L, e_index);
+ lua_pop(L, 1); /* the exten should be the top of the stack */
+ lua_pushinteger(L, e_int);
+ }
lua_gettable(L, context_table);
lua_insert(L, -3);
lua_pop(L, 2);
} else {
- lua_pop(L, 4);
+ lua_pop(L, 3);
}
return 1;
@@ -1439,7 +1323,6 @@ static int load_or_reload_lua_stuff(void)
static int unload_module(void)
{
- ast_context_destroy(NULL, registrar);
ast_unregister_switch(&lua_switch);
lua_free_extensions();
return 0;
diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c
index e6e4c31de..10dcb1842 100644
--- a/res/res_config_pgsql.c
+++ b/res/res_config_pgsql.c
@@ -470,22 +470,14 @@ static int update_pgsql(const char *database, const char *table, const char *key
return -1;
}
-#define ESCAPE_STRING(buffer, stringname) \
- do { \
- int len; \
- if ((len = strlen(stringname)) > (buffer->len - 1) / 2) { \
- ast_str_make_space(&buffer, len * 2 + 1); \
- } \
- PQescapeStringConn(pgsqlConn, buffer->str, stringname, len, &pgresult); \
- } while (0)
-
static int store_pgsql(const char *database, const char *table, va_list ap)
{
PGresult *result = NULL;
Oid insertid;
- struct ast_str *buf = ast_str_create(256);
- struct ast_str *sql1 = ast_str_create(256);
- struct ast_str *sql2 = ast_str_create(256);
+ char sql[256];
+ char params[256];
+ char vals[256];
+ char buf[256];
int pgresult;
const char *newparam, *newval;
@@ -503,7 +495,7 @@ static int store_pgsql(const char *database, const char *table, va_list ap)
if (pgsqlConn) {
PQfinish(pgsqlConn);
pgsqlConn = NULL;
- }
+ };
return -1;
}
@@ -516,31 +508,28 @@ static int store_pgsql(const char *database, const char *table, va_list ap)
/* Create the first part of the query using the first parameter/value pairs we just extracted
If there is only 1 set, then we have our query. Otherwise, loop thru the list and concat */
- ESCAPE_STRING(buf, newparam);
- ast_str_set(&sql1, 0, "INSERT INTO %s (%s", table, buf->str);
- ESCAPE_STRING(buf, newval);
- ast_str_set(&sql2, 0, ") VALUES ('%s'", buf->str);
+ PQescapeStringConn(pgsqlConn, buf, newparam, sizeof(newparam), &pgresult);
+ snprintf(params, sizeof(params), "%s", buf);
+ PQescapeStringConn(pgsqlConn, buf, newval, sizeof(newval), &pgresult);
+ snprintf(vals, sizeof(vals), "'%s'", buf);
while ((newparam = va_arg(ap, const char *))) {
newval = va_arg(ap, const char *);
- ESCAPE_STRING(buf, newparam);
- ast_str_append(&sql1, 0, ", %s", buf->str);
- ESCAPE_STRING(buf, newval);
- ast_str_append(&sql2, 0, ", '%s'", buf->str);
+ PQescapeStringConn(pgsqlConn, buf, newparam, sizeof(newparam), &pgresult);
+ snprintf(params + strlen(params), sizeof(params) - strlen(params), ", %s", buf);
+ PQescapeStringConn(pgsqlConn, buf, newval, sizeof(newval), &pgresult);
+ snprintf(vals + strlen(vals), sizeof(vals) - strlen(vals), ", '%s'", buf);
}
va_end(ap);
- ast_str_append(&sql1, 0, "%s)", sql2->str);
+ snprintf(sql, sizeof(sql), "INSERT INTO (%s) VALUES (%s)", params, vals);
- ast_debug(1, "PostgreSQL RealTime: Insert SQL: %s\n", sql1->str);
+ ast_debug(1, "PostgreSQL RealTime: Insert SQL: %s\n", sql);
- if (!(result = PQexec(pgsqlConn, sql1->str))) {
+ if (!(result = PQexec(pgsqlConn, sql))) {
ast_log(LOG_WARNING,
"PostgreSQL RealTime: Failed to query database. Check debug for more info.\n");
- ast_debug(1, "PostgreSQL RealTime: Query: %s\n", sql1->str);
+ ast_debug(1, "PostgreSQL RealTime: Query: %s\n", sql);
ast_debug(1, "PostgreSQL RealTime: Query Failed because: %s\n", PQerrorMessage(pgsqlConn));
ast_mutex_unlock(&pgsql_lock);
- ast_free(sql1);
- ast_free(sql2);
- ast_free(buf);
return -1;
} else {
ExecStatusType result_status = PQresultStatus(result);
@@ -549,22 +538,16 @@ static int store_pgsql(const char *database, const char *table, va_list ap)
&& result_status != PGRES_NONFATAL_ERROR) {
ast_log(LOG_WARNING,
"PostgreSQL RealTime: Failed to query database. Check debug for more info.\n");
- ast_debug(1, "PostgreSQL RealTime: Query: %s\n", sql1->str);
+ ast_debug(1, "PostgreSQL RealTime: Query: %s\n", sql);
ast_debug(1, "PostgreSQL RealTime: Query Failed because: %s (%s)\n",
PQresultErrorMessage(result), PQresStatus(result_status));
ast_mutex_unlock(&pgsql_lock);
- ast_free(sql1);
- ast_free(sql2);
- ast_free(buf);
return -1;
}
}
insertid = PQoidValue(result);
ast_mutex_unlock(&pgsql_lock);
- ast_free(sql1);
- ast_free(sql2);
- ast_free(buf);
ast_debug(1, "PostgreSQL RealTime: row inserted on table: %s, id: %u\n", table, insertid);
@@ -585,8 +568,8 @@ static int destroy_pgsql(const char *database, const char *table, const char *ke
PGresult *result = NULL;
int numrows = 0;
int pgresult;
- struct ast_str *sql = ast_str_create(256);
- struct ast_str *buf1 = ast_str_create(60), *buf2 = ast_str_create(60);
+ char sql[256];
+ char buf[256], buf2[256];
const char *newparam, *newval;
if (!table) {
@@ -619,28 +602,25 @@ static int destroy_pgsql(const char *database, const char *table, const char *ke
/* Create the first part of the query using the first parameter/value pairs we just extracted
If there is only 1 set, then we have our query. Otherwise, loop thru the list and concat */
- ESCAPE_STRING(buf1, keyfield);
- ESCAPE_STRING(buf2, lookup);
- ast_str_set(&sql, 0, "DELETE FROM %s WHERE %s = '%s'", table, buf1->str, buf2->str);
+ PQescapeStringConn(pgsqlConn, buf, keyfield, sizeof(keyfield), &pgresult);
+ PQescapeStringConn(pgsqlConn, buf2, lookup, sizeof(lookup), &pgresult);
+ snprintf(sql, sizeof(sql), "DELETE FROM %s WHERE %s = '%s'", table, buf, buf2);
while ((newparam = va_arg(ap, const char *))) {
newval = va_arg(ap, const char *);
- ESCAPE_STRING(buf1, newparam);
- ESCAPE_STRING(buf2, newval);
- ast_str_append(&sql, 0, " AND %s = '%s'", buf1->str, buf2->str);
+ PQescapeStringConn(pgsqlConn, buf, newparam, sizeof(newparam), &pgresult);
+ PQescapeStringConn(pgsqlConn, buf2, newval, sizeof(newval), &pgresult);
+ snprintf(sql + strlen(sql), sizeof(sql) - strlen(sql), " AND %s = '%s'", buf, buf2);
}
va_end(ap);
- ast_debug(1, "PostgreSQL RealTime: Delete SQL: %s\n", sql->str);
+ ast_debug(1, "PostgreSQL RealTime: Delete SQL: %s\n", sql);
- if (!(result = PQexec(pgsqlConn, sql->str))) {
+ if (!(result = PQexec(pgsqlConn, sql))) {
ast_log(LOG_WARNING,
"PostgreSQL RealTime: Failed to query database. Check debug for more info.\n");
- ast_debug(1, "PostgreSQL RealTime: Query: %s\n", sql->str);
+ ast_debug(1, "PostgreSQL RealTime: Query: %s\n", sql);
ast_debug(1, "PostgreSQL RealTime: Query Failed because: %s\n", PQerrorMessage(pgsqlConn));
ast_mutex_unlock(&pgsql_lock);
- ast_free(buf1);
- ast_free(buf2);
- ast_free(sql);
return -1;
} else {
ExecStatusType result_status = PQresultStatus(result);
@@ -649,22 +629,16 @@ static int destroy_pgsql(const char *database, const char *table, const char *ke
&& result_status != PGRES_NONFATAL_ERROR) {
ast_log(LOG_WARNING,
"PostgreSQL RealTime: Failed to query database. Check debug for more info.\n");
- ast_debug(1, "PostgreSQL RealTime: Query: %s\n", sql->str);
+ ast_debug(1, "PostgreSQL RealTime: Query: %s\n", sql);
ast_debug(1, "PostgreSQL RealTime: Query Failed because: %s (%s)\n",
PQresultErrorMessage(result), PQresStatus(result_status));
ast_mutex_unlock(&pgsql_lock);
- ast_free(buf1);
- ast_free(buf2);
- ast_free(sql);
return -1;
}
}
numrows = atoi(PQcmdTuples(result));
ast_mutex_unlock(&pgsql_lock);
- ast_free(buf1);
- ast_free(buf2);
- ast_free(sql);
ast_debug(1, "PostgreSQL RealTime: Deleted %d rows on table: %s\n", numrows, table);
diff --git a/res/res_jabber.c b/res/res_jabber.c
index ae24d7545..04194de26 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -159,7 +159,7 @@ struct aji_client_container clients;
struct aji_capabilities *capabilities = NULL;
/*! \brief Global flags, initialized to default values */
-static struct ast_flags globalflags = { AJI_AUTOREGISTER };
+static struct ast_flags globalflags = { AJI_AUTOPRUNE | AJI_AUTOREGISTER };
/*!
* \brief Deletes the aji_client data structure.
@@ -2076,7 +2076,7 @@ static void aji_pruneregister(struct aji_client *client)
ASTOBJ_RDLOCK(iterator);
/* For an aji_buddy, both AUTOPRUNE and AUTOREGISTER will never
* be called at the same time */
- if (ast_test_flag(&iterator->flags, AJI_AUTOPRUNE)) { /* If autoprune is set on jabber.conf */
+ if (ast_test_flag(&iterator->flags, AJI_AUTOPRUNE)) {
res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBE, iterator->name,
"GoodBye. Your status is no longer needed by Asterisk the Open Source PBX"
" so I am no longer subscribing to your presence.\n"));
@@ -2881,7 +2881,7 @@ static int aji_load_config(int reload)
return -1;
/* Reset flags to default value */
- ast_set_flag(&globalflags, AJI_AUTOREGISTER);
+ ast_set_flag(&globalflags, AJI_AUTOPRUNE | AJI_AUTOREGISTER);
if (!cfg) {
ast_log(LOG_WARNING, "No such configuration file %s\n", JABBER_CONFIG);
@@ -2890,13 +2890,12 @@ static int aji_load_config(int reload)
cat = ast_category_browse(cfg, NULL);
for (var = ast_variable_browse(cfg, "general"); var; var = var->next) {
- if (!strcasecmp(var->name, "debug")) {
+ if (!strcasecmp(var->name, "debug"))
debug = (ast_false(ast_variable_retrieve(cfg, "general", "debug"))) ? 0 : 1;
- } else if (!strcasecmp(var->name, "autoprune")) {
+ else if (!strcasecmp(var->name, "autoprune"))
ast_set2_flag(&globalflags, ast_true(var->value), AJI_AUTOPRUNE);
- } else if (!strcasecmp(var->name, "autoregister")) {
+ else if (!strcasecmp(var->name, "autoregister"))
ast_set2_flag(&globalflags, ast_true(var->value), AJI_AUTOREGISTER);
- }
}
while (cat) {
diff --git a/sounds/Makefile b/sounds/Makefile
index 118987fd3..7caedc296 100644
--- a/sounds/Makefile
+++ b/sounds/Makefile
@@ -18,7 +18,7 @@
SOUNDS_DIR:=$(DESTDIR)$(ASTDATADIR)/sounds
MOH_DIR:=$(DESTDIR)$(ASTDATADIR)/moh
CORE_SOUNDS_VERSION:=1.4.11
-EXTRA_SOUNDS_VERSION:=1.4.8
+EXTRA_SOUNDS_VERSION:=1.4.7
SOUNDS_URL:=http://downloads.digium.com/pub/telephony/sounds/releases
MCS:=$(subst -EN-,-en-,$(MENUSELECT_CORE_SOUNDS))
MCS:=$(subst -FR-,-fr-,$(MCS))
diff --git a/utils/Makefile b/utils/Makefile
index 8af5b14b4..87b79302c 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -16,9 +16,8 @@ ASTTOPDIR?=..
.PHONY: clean all uninstall
-ALL_UTILS:=astman smsq stereorize streamplayer muted check_expr hashtest2 hashtest astcanary
-# aelparse and conf2ael currently not being built because they rely on extconf, which is horribly broken
-# ALL_UTILS:=aelparse conf2ael
+# to get check_expr, add it to the ALL_UTILS list
+ALL_UTILS:=astman smsq stereorize streamplayer aelparse muted check_expr conf2ael hashtest2 hashtest astcanary
UTILS:=$(ALL_UTILS)
LIBS += $(BKTR_LIB) # astobj2 with devmode uses backtrace
@@ -81,83 +80,85 @@ clean:
md5.c: $(ASTTOPDIR)/main/md5.c
@cp $< $@
-md5.o: ASTCFLAGS+=-DSTANDALONE
-
astman: astman.o md5.o
astman: LIBS+=$(NEWT_LIB)
-astman.o: ASTCFLAGS+=-DSTANDALONE
stereorize: stereorize.o frame.o
stereorize: LIBS+=-lm
hashtab.c: $(ASTTOPDIR)/main/hashtab.c
@cp $< $@
-hashtab.o: ASTCFLAGS+=-DSTANDALONE
strcompat.c: $(ASTTOPDIR)/main/strcompat.c
@cp $< $@
-strcompat.o: ASTCFLAGS+=-DSTANDALONE
+
+$(ASTTOPDIR)/main/ast_expr2.c:
+ @echo " [BISON] $(ASTTOPDIR)/main/ast_expr2.y -> $@"
+ @bison -o $@ -d --name-prefix=ast_yy $(ASTTOPDIR)/main/ast_expr2.y
+
+$(ASTTOPDIR)/main/ast_expr2f.c:
+ @echo " [FLEX] $(ASTTOPDIR)/main/ast_expr2.fl -> $@"
+ @flex -o $@ --full $(ASTTOPDIR)/main/ast_expr2.fl
pval.c: $(ASTTOPDIR)/res/ael/pval.c
@cp $< $@
-pval.o : ASTCFLAGS+=-DSTANDALONE
ast_expr2.c: $(ASTTOPDIR)/main/ast_expr2.c
@cp $< $@
-ast_expr2.o: ASTCFLAGS+=-DSTANDALONE
ast_expr2f.c: $(ASTTOPDIR)/main/ast_expr2f.c
@cp $< $@
-ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE -I$(ASTTOPDIR)/main -Wno-unused
+
+ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL -I$(ASTTOPDIR)/main -Wno-unused
+
+pval.o : ASTCFLAGS+=-DSTANDALONE
check_expr: check_expr.o ast_expr2.o ast_expr2f.o strcompat.o threadstorage.o clicompat.o
-check_expr.o: ASTCFLAGS+=-DSTANDALONE
aelbison.c: $(ASTTOPDIR)/res/ael/ael.tab.c
@cp $< $@
-aelbison.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res/ael -DYYENABLE_NLS=0 -DSTANDALONE
+
+aelbison.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res/ael -DYYENABLE_NLS=0
pbx_ael.c: $(ASTTOPDIR)/pbx/pbx_ael.c
@cp $< $@
-pbx_ael.o: ASTCFLAGS+=-DSTANDALONE
+
+pbx_ael.o: ASTCFLAGS+=-DSTANDALONE_AEL
aelparse.c: $(ASTTOPDIR)/res/ael/ael_lex.c
@cp $< $@
-ael_main.o: ASTCFLAGS+=-DSTANDALONE
+aelparse.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res -DSTANDALONE_AEL -Wno-unused
-aelparse.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res -DSTANDALONE -Wno-unused
aelparse: aelparse.o aelbison.o pbx_ael.o hashtab.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o
astobj2.c: $(ASTTOPDIR)/main/astobj2.c
@cp $< $@
-astobj2.o: ASTCFLAGS+=-DSTANDALONE
utils.c: $(ASTTOPDIR)/main/utils.c
@cp $< $@
-utils.o: ASTCFLAGS+=-DSTANDALONE
sha1.c: $(ASTTOPDIR)/main/sha1.c
@cp $< $@
-sha1.o: ASTCFLAGS+=-DSTANDALONE
threadstorage.c: $(ASTTOPDIR)/main/threadstorage.c
@cp $< $@
-threadstorage.o: ASTCFLAGS+=-DSTANDALONE
-hashtest2.o: ASTCFLAGS+=-O0 -DSTANDALONE
+hashtest2.o: ASTCFLAGS+=-O0
+
hashtest2: hashtest2.o md5.o utils.o astobj2.o sha1.o strcompat.o threadstorage.o clicompat.o
hashtest: hashtest.o md5.o hashtab.o utils.o sha1.o strcompat.o threadstorage.o clicompat.o
-hashtest.o: ASTCFLAGS+=-O0 -DSTANDALONE
+
+hashtest.o: ASTCFLAGS+=-O0
extconf.o: extconf.c
conf2ael: conf2ael.o ast_expr2f.o ast_expr2.o hashtab.o aelbison.o aelparse.o pbx_ael.o pval.o extconf.o strcompat.o
testexpr2s: $(ASTTOPDIR)/main/ast_expr2f.c $(ASTTOPDIR)/main/ast_expr2.c $(ASTTOPDIR)/main/ast_expr2.h
- $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE $(ASTTOPDIR)/main/ast_expr2f.c -o ast_expr2f.o
- $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE $(ASTTOPDIR)/main/ast_expr2.c -o ast_expr2.o
+ $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE_AEL $(ASTTOPDIR)/main/ast_expr2f.c -o ast_expr2f.o
+ $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE_AEL $(ASTTOPDIR)/main/ast_expr2.c -o ast_expr2.o
$(CC) -g -o testexpr2s ast_expr2f.o ast_expr2.o
rm ast_expr2.o ast_expr2f.o
./testexpr2s expr2.testinput
diff --git a/utils/ael_main.c b/utils/ael_main.c
index 74b023d66..55b640dba 100644
--- a/utils/ael_main.c
+++ b/utils/ael_main.c
@@ -169,6 +169,16 @@ struct ast_custom_function *ast_custom_function_find(const char *name)
return 0; /* in "standalone" mode, functions are just not avail */
}
+void ast_register_file_version(const char *file, const char *version);
+void ast_register_file_version(const char *file, const char *version)
+{
+}
+
+void ast_unregister_file_version(const char *file);
+void ast_unregister_file_version(const char *file)
+{
+}
+
#if !defined(LOW_MEMORY)
int ast_add_profile(const char *x, uint64_t scale)
{
diff --git a/utils/astman.c b/utils/astman.c
index 7e11d2565..3cfc27d81 100644
--- a/utils/astman.c
+++ b/utils/astman.c
@@ -24,8 +24,6 @@
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#include "asterisk.h"
-
#include <newt.h>
#include <stdio.h>
#include <sys/time.h>
diff --git a/utils/build-extensions-conf.lua b/utils/build-extensions-conf.lua
new file mode 100755
index 000000000..a3f159def
--- /dev/null
+++ b/utils/build-extensions-conf.lua
@@ -0,0 +1,81 @@
+#!/usr/bin/env lua
+--[[
+
+This utility can be used to generate an extensions.conf file to match an
+existing extensions.lua file. As an argument it takes the patch of the
+extensions.lua file to read from, otherwise it uses
+/etc/asterisk/extensions.lua.
+
+This script can also be used to automatically include extensions.lua in
+extensions.conf via a #exec as well.
+
+#exec /usr/bin/build-extensions-conf.lua -c
+
+--]]
+
+usage = [[
+
+Usage:
+ ]] .. arg[0] .. [[ [options] [extensions.lua path]
+
+This utility can generate an extensions.conf file with all of the contexts in
+your extensions.lua file defined as including the Lua switch. This is useful
+if you want to use your extensions.lua file exclusively. By using this utility
+you dont't have to create each extension in extensions.conf manually.
+
+The resulting extensions.conf file is printed to standard output.
+
+ --contexts-only, -c Don't print the [global] or [general] sections. This
+ is useful for including the generated file into an
+ existing extensions.conf via #include or #exec.
+
+ --help, -h Print this message.
+
+]]
+
+extensions_file = "/etc/asterisk/extensions.lua"
+
+options = {}
+
+for k, v in ipairs(arg) do
+ if v:sub(1, 1) == "-" then
+ if v == "-h" or v == "--help" then
+ print("match")
+ options["help"] = true
+ elseif v == "-c" or v == "--contexts-only" then
+ options["contexts-only"] = true
+ end
+ else
+ options["extensions-file"] = v
+ end
+end
+
+if options["help"] then
+ io.stderr:write(usage)
+ os.exit(0)
+end
+
+if options["extensions-file"] then
+ extensions_file = options["extensions-file"]
+end
+
+result, error_message = pcall(dofile, extensions_file)
+
+if not result then
+ io.stderr:write(error_message .. "\n")
+ os.exit(1)
+end
+
+if not extensions then
+ io.stderr:write("Error: extensions table not found in '" .. extensions_file .. "'\n")
+ os.exit(1)
+end
+
+if not options["contexts-only"] then
+ io.stdout:write("[general]\n\n[globals]\n\n")
+end
+
+for context, extens in pairs(extensions) do
+ io.stdout:write("[" .. tostring(context) .. "]\nswitch => Lua\n\n")
+end
+
diff --git a/utils/extconf.c b/utils/extconf.c
index 96be73fe8..d388586e0 100644
--- a/utils/extconf.c
+++ b/utils/extconf.c
@@ -23,8 +23,6 @@
* for operations outside of asterisk. A huge, awful hack.
*
*/
-#include "asterisk.h"
-
#undef DEBUG_THREADS
#include "asterisk/compat.h"
@@ -83,6 +81,12 @@ struct ast_channel
#define VERBOSE_PREFIX_3 " -- "
#define VERBOSE_PREFIX_4 " > "
+/* IN CONFLICT: void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
+ __attribute__ ((format (printf, 5, 6))); */
+
+static void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__ ((format (printf,5,6)));
+
+
void ast_backtrace(void);
void ast_queue_log(const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt, ...)
@@ -96,6 +100,9 @@ int ast_unregister_verbose(void (*verboser)(const char *string));
void ast_console_puts(const char *string);
+void ast_console_puts_mutable(const char *string);
+void ast_console_toggle_mute(int fd);
+
#define _A_ __FILE__, __LINE__, __PRETTY_FUNCTION__
#ifdef LOG_DEBUG
@@ -1760,6 +1767,56 @@ static void ast_config_destroy(struct ast_config *cfg)
#define AST_CACHE_DIR_LEN 512
#define AST_FILENAME_MAX 80
+/*! \ingroup main_options */
+enum ast_option_flags {
+ /*! Allow \#exec in config files */
+ AST_OPT_FLAG_EXEC_INCLUDES = (1 << 0),
+ /*! Do not fork() */
+ AST_OPT_FLAG_NO_FORK = (1 << 1),
+ /*! Keep quiet */
+ AST_OPT_FLAG_QUIET = (1 << 2),
+ /*! Console mode */
+ AST_OPT_FLAG_CONSOLE = (1 << 3),
+ /*! Run in realtime Linux priority */
+ AST_OPT_FLAG_HIGH_PRIORITY = (1 << 4),
+ /*! Initialize keys for RSA authentication */
+ AST_OPT_FLAG_INIT_KEYS = (1 << 5),
+ /*! Remote console */
+ AST_OPT_FLAG_REMOTE = (1 << 6),
+ /*! Execute an asterisk CLI command upon startup */
+ AST_OPT_FLAG_EXEC = (1 << 7),
+ /*! Don't use termcap colors */
+ AST_OPT_FLAG_NO_COLOR = (1 << 8),
+ /*! Are we fully started yet? */
+ AST_OPT_FLAG_FULLY_BOOTED = (1 << 9),
+ /*! Trascode via signed linear */
+ AST_OPT_FLAG_TRANSCODE_VIA_SLIN = (1 << 10),
+ /*! Enable priority jumping in applications */
+ AST_OPT_FLAG_PRIORITY_JUMPING = (1 << 11),
+ /*! Dump core on a seg fault */
+ AST_OPT_FLAG_DUMP_CORE = (1 << 12),
+ /*! Cache sound files */
+ AST_OPT_FLAG_CACHE_RECORD_FILES = (1 << 13),
+ /*! Display timestamp in CLI verbose output */
+ AST_OPT_FLAG_TIMESTAMP = (1 << 14),
+ /*! Override config */
+ AST_OPT_FLAG_OVERRIDE_CONFIG = (1 << 15),
+ /*! Reconnect */
+ AST_OPT_FLAG_RECONNECT = (1 << 16),
+ /*! Transmit Silence during Record() */
+ AST_OPT_FLAG_TRANSMIT_SILENCE = (1 << 17),
+ /*! Suppress some warnings */
+ AST_OPT_FLAG_DONT_WARN = (1 << 18),
+ /*! End CDRs before the 'h' extension */
+ AST_OPT_FLAG_END_CDR_BEFORE_H_EXTEN = (1 << 19),
+ /*! Use DAHDI Timing for generators if available */
+ AST_OPT_FLAG_INTERNAL_TIMING = (1 << 20),
+ /*! Always fork, even if verbose or debug settings are non-zero */
+ AST_OPT_FLAG_ALWAYS_FORK = (1 << 21),
+ /*! Disable log/verbose output to remote consoles */
+ AST_OPT_FLAG_MUTE = (1 << 22)
+};
+
/*! These are the options that set by default when Asterisk starts */
#define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN
@@ -1793,6 +1850,8 @@ extern int option_maxcalls; /*!< Maximum number of simultaneous channels */
extern double option_maxload;
extern char defaultlanguage[];
+extern time_t ast_startuptime;
+extern time_t ast_lastreloadtime;
extern pid_t ast_mainpid;
extern char record_cache_dir[AST_CACHE_DIR_LEN];
@@ -2647,6 +2706,14 @@ static const char *ast_var_name(const struct ast_var_t *var)
return name;
}
+
+/* stolen from asterisk.c */
+
+static struct ast_flags ast_options = { AST_DEFAULT_OPTIONS };
+static int option_verbose = 0; /*!< Verbosity level */
+static int option_debug = 0; /*!< Debug level */
+
+
/* experiment 1: see if it's easier just to use existing config code
* to read in the extensions.conf file. In this scenario,
I have to rip/copy code from other modules, because they
@@ -2668,7 +2735,7 @@ static void ast_log(int level, const char *file, int line, const char *function,
va_end(vars);
}
-void __attribute__((format (printf, 1, 2))) ast_verbose(const char *fmt, ...)
+static void __attribute__((format (printf, 1, 2))) ast_verbose(const char *fmt, ...)
{
va_list vars;
va_start(vars,fmt);