diff options
author | Tony Vroon <chainsaw@gentoo.org> | 2010-10-15 17:30:59 +0000 |
---|---|---|
committer | Tony Vroon <chainsaw@gentoo.org> | 2010-10-15 17:30:59 +0000 |
commit | 63b7e8d62a41337a74975a79c22c58721f13a6ac (patch) | |
tree | cba3fa32863e140624c06d117f7f8581ffc5482c /net-misc/asterisk | |
parent | Fix obvious typo, as reported by Andrey Grozin in bug #341119 (diff) | |
download | historical-63b7e8d62a41337a74975a79c22c58721f13a6ac.tar.gz historical-63b7e8d62a41337a74975a79c22c58721f13a6ac.tar.bz2 historical-63b7e8d62a41337a74975a79c22c58721f13a6ac.zip |
Log rotation fixes by Jaco Kroon, closes bug #339799. Scavenged fixes from upstream issue reports #17368, #17524 & #18010.
Package-Manager: portage-2.1.9.18/cvs/Linux x86_64
Diffstat (limited to 'net-misc/asterisk')
7 files changed, 496 insertions, 6 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog index b4f911dd757d..f002b7d1d916 100644 --- a/net-misc/asterisk/ChangeLog +++ b/net-misc/asterisk/ChangeLog @@ -1,6 +1,16 @@ \# ChangeLog for net-misc/asterisk # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.269 2010/09/16 17:31:54 chainsaw Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.270 2010/10/15 17:30:59 chainsaw Exp $ + +*asterisk-1.6.2.13-r2 (15 Oct 2010) + + 15 Oct 2010; <chainsaw@gentoo.org> +asterisk-1.6.2.13-r2.ebuild, + +files/1.6.2/asterisk-1.6.2.13-alarm-receiver-use-playtones.patch, + +files/1.6.2/asterisk-1.6.2.13-confbridge-menu-invocation.patch, + +files/1.6.2/asterisk-1.6.2.13-pbxstart-failed-spurious-bye.patch, + +files/1.6.2/asterisk.logrotate3: + Log rotation fixes by Jaco Kroon, closes bug #339799. Scavenged fixes from + upstream issue reports #17368, #17524 & #18010. *asterisk-1.6.2.13-r1 (16 Sep 2010) diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest index cc39ee593f08..7aa34e9aadc6 100644 --- a/net-misc/asterisk/Manifest +++ b/net-misc/asterisk/Manifest @@ -13,9 +13,12 @@ AUX 1.6.0/asterisk.confd 2204 RMD160 31bceebfa535e97cb2634e313678cc42186d4750 SH AUX 1.6.1/asterisk-1.6.1-uclibc.patch 373 RMD160 08f18dd2af3736497995ebcbea84939ae4c4cc98 SHA1 b10884d4b9123800f62b4aabac5a93b1a110e3da SHA256 b6fe54def0ab3f90058c2ed7bd288dd21c96aaf88b9028f12d223fb31d7e41c5 AUX 1.6.1/asterisk-1.6.1.6-fxsks-hookstate.patch 1074 RMD160 eaefb4ff9bb3f022c1d3ec0e2ef3dc3fd0b604b9 SHA1 6c4f233ddd4efd0471796b83813ba6e4aed15cdc SHA256 8c777f4e5e6a5dfcacb4534cf8c4f7cd81e4bedb16811abfbfcf96289cf6eb68 AUX 1.6.2/asterisk-1.6.2.11-strip-noapi.patch 742 RMD160 d9a176bc9bfed14adc3e59881c04932070cb98c3 SHA1 4d40de82f27bbeb8a0b62fa17d864b9629ba29a3 SHA256 c874f28eb895b0c87a0bbf9b60ec7cd7dfe2599faa1920d1f1a20c983be3bca8 +AUX 1.6.2/asterisk-1.6.2.13-alarm-receiver-use-playtones.patch 3989 RMD160 919d03d1d59517a4f7999b54a416e42d2e0f9e90 SHA1 80efe8e6b0421b8063a3419d760563af98caac5c SHA256 63f3fd50f923c6dd38e5c5f7d89bbfca5bb27d76e17a0bf1e679873349105e96 AUX 1.6.2/asterisk-1.6.2.13-backport-bri-net-ptmp.patch 1839 RMD160 3b2b6101ef65325609bbdd7249240869fe1389bf SHA1 c62ce68ca642b32ffdc67ab52159ddd7c7061840 SHA256 1afdcb99201d3f97e94bafcb74f5c0c97f7b6a37262bd0333e728392a3152cc3 +AUX 1.6.2/asterisk-1.6.2.13-confbridge-menu-invocation.patch 650 RMD160 b938f7183425cb33ba1df505322ff885be004ce5 SHA1 0a15a661400d175162b3181ae3a1baa4c3c59aa2 SHA256 dcfb933f5c3bd8f1545b83dd8c67cf3c8e336d81bcdf471c01c50f2b366a759f AUX 1.6.2/asterisk-1.6.2.13-dahdiras-without-root.patch 419 RMD160 c08f2a41cbc54dfee87ea4a11eef63bbb67c0f4a SHA1 ab066ac1b4fd2ab2942e9229c4d53575cc3a242d SHA256 577ad92c596eaa9df4aff90c73e485cf88ba072d9e2264b8d44535e22e4d3293 AUX 1.6.2/asterisk-1.6.2.13-iax2-peerstate.patch 1064 RMD160 dc65fe0f6acbf1c4def3458cbe316a11f665d9e2 SHA1 b02c13528184f603334ea440c2f1e05bf51aa754 SHA256 a92d24b968abcba8967d5584095a8b2b409248226fd8002e995e495289811f3d +AUX 1.6.2/asterisk-1.6.2.13-pbxstart-failed-spurious-bye.patch 444 RMD160 5badc5dc3539b9a388e53b7699769add0e32fd82 SHA1 a65215d253072817c353f61d2628177c7f0acc77 SHA256 632f7b4f842474273d451340eb59ece3cd852af3480d3e2282e8173245195aaf AUX 1.6.2/asterisk-1.6.2.2-nv-faxdetect.patch 21042 RMD160 fa31dbfa3828f60073d59d0262166436ef37c516 SHA1 50f6b7a917dac981df1adf0713b373410af4ec68 SHA256 9919af0de073fc6c68a926daf84164df3b506d8fe4687177e8f9d636111707af AUX 1.6.2/asterisk-1.6.2.8-inband-indications.patch 468 RMD160 590c9271486fa08c6408d68eea332ab8a7fa76a7 SHA1 f586944eade3d1e9f21705ac27c11e90bb9edff6 SHA256 ddfe757f4810964b8d48e7363068763fbf313db14e4f9205d926dc34b1a86ba6 AUX 1.6.2/asterisk-1.6.2.8-pri-missing-keyword.patch 547 RMD160 30deeb63ae09c316d5ada7597939adc8861a40d8 SHA1 722efddb5dde9238c0ee11cbfb58da25a5a2c95a SHA256 e3b98ee06015b062929613f41e430a93e571cf0920393f4480ebce256dd1e7fc @@ -24,6 +27,7 @@ AUX 1.6.2/asterisk.initd 6604 RMD160 a21972586bdd043a0a68380d46765b03616950f8 SH AUX 1.6.2/asterisk.initd2 6658 RMD160 b694da109e746e9a9e642ffa7f1d278f03543cea SHA1 63443d3066d4c47228fe1d852420d571ae6f8800 SHA256 f6fd2c229e61c12360b1d289a631f6a0a6f8638e7c6f6add6040ad988170bf70 AUX 1.6.2/asterisk.logrotate 476 RMD160 16defc611e332dcbbc49f88ec25b2ef1acbfab5e SHA1 86911eec273139f87b77148aeeeb0b1f6f434eb4 SHA256 6e6290515180e248746609cabbc89c0550ed5cc04f7d3916c409ef2565bcdd53 AUX 1.6.2/asterisk.logrotate2 473 RMD160 5b735d23d3072cd5d29dcac4aaf902b65bb9ea4e SHA1 36913a7c6abeb423484c1340cf99f84f42f437f8 SHA256 946375ddc5cb5adf94550e0a4b029210f4c67cc388ef7b6cb79bab6e8f6c571b +AUX 1.6.2/asterisk.logrotate3 436 RMD160 06a98d2a908464a951e3386a2681f5829dcb0220 SHA1 31331f8fabc643f722a1c12cee0557e0268019ea SHA256 675705506d1adf7ec8c278581412a7ed69eed2735fea6c5f2faf368fb4ad9a26 AUX 1.6.2/call_data.txt 1120 RMD160 cee46a6b1e11b19cd0f9ce78e550373f480731b0 SHA1 fd9520418c36cfc740043bfab51f39e22eb07313 SHA256 24a5b8dab0f46ffff6dddc50d4ab8d498ec90bc2a0977249f65471b3f0948a0b AUX 1.6.2/find_call_ids.sh 446 RMD160 e3e46295e7a4b7fdc2364c5ddfbe76290311a6fd SHA1 a1fd3e1a62e93c2cf41e9eb50ed0b95b6c666ba8 SHA256 742289cc719fbf0f119e05516b20da3fef78908f5dd08f56eaa49abe10104e77 AUX 1.6.2/find_call_sip_trace.sh 530 RMD160 a45c1710a159dd5e7f9dfba51e92981ebb2ab035 SHA1 1e221f910625ce47ad9c84937d8160fdeedb713d SHA256 6818f5cde5f99b7c9be35d20e2c84c61cf0d14f63aa1e3952d0dc91ecb93e3a4 @@ -40,14 +44,14 @@ EBUILD asterisk-1.6.2.10.ebuild 6545 RMD160 611f8636c5a0472ea165e06e6e5f4f8179f6 EBUILD asterisk-1.6.2.11-r1.ebuild 6871 RMD160 51af7664012e91d269d08ffbcfd45fd21be6afdb SHA1 20a8a34003a08d2f65e2a8e30c842615ef136e43 SHA256 f70f0c6a50b4be345b7aee880bbfba7c163e63ead8ab7ac41e15d1cea9f18063 EBUILD asterisk-1.6.2.11.ebuild 6437 RMD160 9ac8be976e444ce23fd8d30e3a593d8c09cf78c6 SHA1 cec95214edbd5e501094cb740445ede40befe4be SHA256 695a95f8e630bc8fa5a35a3f97ce97b93e452591f470f5691399b637506634b3 EBUILD asterisk-1.6.2.13-r1.ebuild 7196 RMD160 d3221cfedab5310159b25b323ab716dd7d35aef8 SHA1 2a0473f809211060631e657c05601863930a9cba SHA256 7ed79b0b458daa23990ecae9069ba3d65ab01521819928222b65eca99af40f87 +EBUILD asterisk-1.6.2.13-r2.ebuild 7377 RMD160 12c080a61d7c345fcebb6bc148baf0396f2db8f9 SHA1 4df6a0218d162724e759d9d11660d623a7c314ce SHA256 40a5be578f62de21c53f4d312d743796746705a5d27deccefb5e0504add00c75 EBUILD asterisk-1.6.2.13.ebuild 6868 RMD160 d889222a63df46edc27a70bffa0339a717acb889 SHA1 5d048c74b3a4f603f4d900a61263138b3ef2b518 SHA256 7727121819199291f91a485af0868df5790b6449fab6324e3f15863868c35115 -MISC ChangeLog 63397 RMD160 2baa3c8a064d3a8cc0b1189020f0b811032eedd0 SHA1 fcdb6e38d21b1ff793a3501e69dea398a3b832ab SHA256 d75d44076cc4b7168d9c38c62fd2c7c3362970b59bf56a3ae999bdde5d9d8b47 -MISC asterisk-1.6.2.13-r1.ebuild.orig 6916 RMD160 8b3099cae9d371024e0e17049bf0590e675e3ad5 SHA1 639fb8663ff79ed642fd0e7a3fba601469141b6c SHA256 c7dd98a6d5a93b5a7af60fea506b6f52e078b961070da3bf77c86ad5707b2b35 +MISC ChangeLog 63870 RMD160 50bddc3fab9fb962ba7474c29fe4cc97659ec453 SHA1 70e7384f0af4f92d1b0bd92d21b8ddefddf40d76 SHA256 804166cafe38e4544ce065d21c5966d6412eb64b4afdc2d578678bd6d361c001 MISC metadata.xml 1286 RMD160 e037505d2f85ed93050d173f62faa30fb36b59ae SHA1 cf8f219278a99dd36f6a9fe0a4fa8d6fb3ab54e7 SHA256 08bfe80f286c8d9823485c04df3b92c942c61fd42d61a93949a4cb8ac90dfe5f -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) -iEYEARECAAYFAkySVJMACgkQp5vW4rUFj5pRQgCfVHDvOW5XCNw5YIlfG/ju5+zj -/F4Anj2UERD+dvnQvDRkxzWtZF4THDsL -=mIWP +iEYEARECAAYFAky4j94ACgkQp5vW4rUFj5oLuwCfYAkie3Q+isCP1SYe15mkkN4Q +ea8An0b164WEe7XuekjBtI+hCjnbXpLZ +=HlY8 -----END PGP SIGNATURE----- diff --git a/net-misc/asterisk/asterisk-1.6.2.13-r2.ebuild b/net-misc/asterisk/asterisk-1.6.2.13-r2.ebuild new file mode 100644 index 000000000000..01bcbe596757 --- /dev/null +++ b/net-misc/asterisk/asterisk-1.6.2.13-r2.ebuild @@ -0,0 +1,270 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.6.2.13-r2.ebuild,v 1.1 2010/10/15 17:30:59 chainsaw Exp $ + +EAPI=3 +inherit autotools base eutils linux-info multilib + +MY_P="${PN}-${PV/_/-}" + +DESCRIPTION="Asterisk: A Modular Open Source PBX System" +HOMEPAGE="http://www.asterisk.org/" +SRC_URI="http://downloads.asterisk.org/pub/telephony/asterisk/releases/${MY_P}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="alsa +caps dahdi debug doc freetds iconv jabber ldap lua keepsrc logrotate misdn newt +samples oss postgres radius snmp span speex ssl sqlite static vorbis" + +RDEPEND="sys-libs/ncurses + dev-libs/popt + sys-libs/zlib + alsa? ( media-libs/alsa-lib ) + caps? ( sys-libs/libcap ) + dahdi? ( >=net-libs/libpri-1.4.7 + net-misc/dahdi-tools ) + freetds? ( dev-db/freetds ) + iconv? ( virtual/libiconv ) + jabber? ( dev-libs/iksemel ) + ldap? ( net-nds/openldap ) + lua? ( dev-lang/lua ) + misdn? ( net-dialup/misdnuser ) + newt? ( dev-libs/newt ) + postgres? ( dev-db/postgresql-base ) + radius? ( net-dialup/radiusclient-ng ) + snmp? ( net-analyzer/net-snmp ) + span? ( media-libs/spandsp ) + speex? ( media-libs/speex ) + sqlite? ( dev-db/sqlite ) + ssl? ( dev-libs/openssl ) + vorbis? ( media-libs/libvorbis )" + +DEPEND="${RDEPEND} + !<net-misc/asterisk-addons-1.6 + !net-misc/asterisk-chan_unistim + !net-misc/zaptel" + +PDEPEND="net-misc/asterisk-core-sounds + net-misc/asterisk-extra-sounds + net-misc/asterisk-moh-opsound" + +S="${WORKDIR}/${MY_P}" + +PATCHES=( + "${FILESDIR}/1.6.2/${PN}-1.6.2.9-gsm-pic.patch" + "${FILESDIR}/1.6.2/${PN}-1.6.2.8-pri-missing-keyword.patch" + "${FILESDIR}/1.6.2/${PN}-1.6.2.8-inband-indications.patch" + "${FILESDIR}/1.6.1/${PN}-1.6.1-uclibc.patch" + "${FILESDIR}/1.6.2/${PN}-1.6.2.2-nv-faxdetect.patch" + "${FILESDIR}/1.6.2/${PN}-1.6.2.11-strip-noapi.patch" + "${FILESDIR}/1.6.2/${P}-iax2-peerstate.patch" + "${FILESDIR}/1.6.2/${P}-dahdiras-without-root.patch" + "${FILESDIR}/1.6.2/${P}-backport-bri-net-ptmp.patch" + "${FILESDIR}/1.6.2/${P}-pbxstart-failed-spurious-bye.patch" + "${FILESDIR}/1.6.2/${P}-confbridge-menu-invocation.patch" + "${FILESDIR}/1.6.2/${P}-alarm-receiver-use-playtones.patch" +) + +pkg_setup() { + CONFIG_CHECK="~!NF_CONNTRACK_SIP" + local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users + have reported that this module dropped critical SIP packets in their deployments. You + may want to disable it if you see such problems." + check_extra_config +} + +src_prepare() { + base_src_prepare + AT_M4DIR=autoconf eautoreconf +} + +src_configure() { + econf \ + --libdir="/usr/$(get_libdir)" \ + --localstatedir="/var" \ + --with-gsm=internal \ + --with-popt \ + --with-z \ + $(use_with alsa asound) \ + $(use_with caps cap) \ + $(use_with dahdi pri) \ + $(use_with dahdi tonezone) \ + $(use_with dahdi) \ + $(use_with freetds tds) \ + $(use_with iconv) \ + $(use_with jabber iksemel) \ + $(use_with lua) \ + $(use_with misdn isdnnet) \ + $(use_with misdn suppserv) \ + $(use_with misdn) \ + $(use_with newt) \ + $(use_with oss) \ + $(use_with postgres) \ + $(use_with radius) \ + $(use_with snmp netsnmp) \ + $(use_with span spandsp) \ + $(use_with speex) \ + $(use_with speex speexdsp) \ + $(use_with sqlite sqlite3) \ + $(use_with ssl crypto) \ + $(use_with ssl) \ + $(use_with vorbis ogg) \ + $(use_with vorbis) || die "econf failed" + + # + # blank out sounds/sounds.xml file to prevent + # asterisk from installing sounds files (we pull them in via + # asterisk-{core,extra}-sounds and asterisk-moh-opsound. + # + >"${S}"/sounds/sounds.xml +} + +src_compile() { + ASTLDFLAGS="${LDFLAGS}" emake || die "emake failed" +} + +src_install() { + # setup directory structure + # + mkdir -p "${D}"usr/$(get_libdir)/pkgconfig + + emake DESTDIR="${D}" install || die "emake install failed" + + if use samples; then + emake DESTDIR="${D}" samples || die "emake samples failed" + for conffile in "${D}"etc/asterisk/*.* + do + chown asterisk:asterisk $conffile + chmod 0660 $conffile + done + einfo "Sample files have been installed" + else + einfo "Skipping installation of sample files..." + rm -f "${D}"var/lib/asterisk/mohmp3/* + rm -f "${D}"var/lib/asterisk/sounds/demo-* + rm -f "${D}"var/lib/asterisk/agi-bin/* + rm -f "${D}"etc/asterisk/* + fi + rm -rf "${D}"var/spool/asterisk/voicemail/default + + # keep directories + diropts -m 0770 -o asterisk -g asterisk + keepdir /etc/asterisk + keepdir /var/lib/asterisk + keepdir /var/run/asterisk + keepdir /var/spool/asterisk + keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail} + diropts -m 0750 -o asterisk -g asterisk + keepdir /var/log/asterisk/{cdr-csv,cdr-custom} + + newinitd "${FILESDIR}"/1.6.2/asterisk.initd2 asterisk + newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk + + # some people like to keep the sources around for custom patching + # copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there + if use keepsrc + then + dodir /usr/src + + ebegin "Copying sources into /usr/src" + cp -dPR "${S}" "${D}"/usr/src/${PF} || die "Unable to copy sources" + eend $? + + ebegin "Cleaning source tree" + emake -C "${D}"/usr/src/${PF} clean &>/dev/null || die "Unable to clean sources" + eend $? + + einfo "Clean sources are available in "${ROOT}"usr/src/${PF}" + fi + + # install the upgrade documentation + # + dodoc README UPGRADE* BUGS CREDITS + + # install extra documentation + # + if use doc + then + dodoc doc/*.txt + dodoc doc/*.pdf + dodoc doc/PEERING + dodoc doc/CODING-GUIDELINES + dodoc doc/tex/*.pdf + fi + + # install snmp mib files + # + if use snmp + then + insinto /usr/share/snmp/mibs/ + doins doc/digium-mib.txt doc/asterisk-mib.txt + fi + + # install SIP scripts; bug #300832 + # + dodoc "${FILESDIR}/1.6.2/sip_calc_auth" + dodoc "${FILESDIR}/1.6.2/find_call_sip_trace.sh" + dodoc "${FILESDIR}/1.6.2/find_call_ids.sh" + dodoc "${FILESDIR}/1.6.2/call_data.txt" + + # install logrotate snippet; bug #329281 + # + if use logrotate + then + insinto /etc/logrotate.d + newins "${FILESDIR}/1.6.2/asterisk.logrotate3" asterisk + fi +} + +pkg_preinst() { + enewgroup asterisk + enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout" +} + +pkg_postinst() { + # + # Announcements, warnings, reminders... + # + einfo "Asterisk has been installed" + echo + elog "If you want to know more about asterisk, visit these sites:" + elog "http://www.asteriskdocs.org/" + elog "http://www.voip-info.org/wiki-Asterisk" + echo + elog "http://www.automated.it/guidetoasterisk.htm" + echo + elog "Gentoo VoIP IRC Channel:" + elog "#gentoo-voip @ irc.freenode.net" + echo + echo + elog "1.6.1 -> 1.6.2 changes that you may care about:" + elog "canreinvite -> directmedia (sip.conf)" + elog "extensive T.38 (fax) changes" + elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt" + elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2" +} + +pkg_config() { + einfo "Do you want to reset file permissions and ownerships (y/N)?" + + read tmp + tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')" + + if [[ "$tmp" = "y" ]] ||\ + [[ "$tmp" = "yes" ]] + then + einfo "Resetting permissions to defaults..." + + for x in spool run lib log; do + chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk + chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk + done + + chown -R root:asterisk "${ROOT}"etc/asterisk + chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk + + einfo "done" + else + einfo "skipping" + fi +} diff --git a/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-alarm-receiver-use-playtones.patch b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-alarm-receiver-use-playtones.patch new file mode 100644 index 000000000000..e434a12aa1e9 --- /dev/null +++ b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-alarm-receiver-use-playtones.patch @@ -0,0 +1,151 @@ +diff -uNr asterisk-1.6.2.13.ORIG//apps/app_alarmreceiver.c asterisk-1.6.2.13/apps/app_alarmreceiver.c +--- asterisk-1.6.2.13.ORIG//apps/app_alarmreceiver.c 2010-10-15 18:17:49.000000000 +0100 ++++ asterisk-1.6.2.13/apps/app_alarmreceiver.c 2010-10-15 18:18:50.000000000 +0100 +@@ -51,6 +51,7 @@ + #include "asterisk/callerid.h" + #include "asterisk/astdb.h" + #include "asterisk/utils.h" ++#include "asterisk/indications.h" + + #define ALMRCV_CONFIG "alarmreceiver.conf" + #define ADEMCO_CONTACT_ID "ADEMCO_CONTACT_ID" +@@ -139,86 +140,6 @@ + return; + } + +- +-/* +-* Build a MuLaw data block for a single frequency tone +-*/ +-static void make_tone_burst(unsigned char *data, float freq, float loudness, int len, int *x) +-{ +- int i; +- float val; +- +- for (i = 0; i < len; i++) { +- val = loudness * sin((freq * 2.0 * M_PI * (*x)++)/8000.0); +- data[i] = AST_LIN2MU((int)val); +- } +- +- /* wrap back around from 8000 */ +- +- if (*x >= 8000) +- *x = 0; +- return; +-} +- +-/* +-* Send a single tone burst for a specifed duration and frequency. +-* Returns 0 if successful +-*/ +-static int send_tone_burst(struct ast_channel *chan, float freq, int duration, int tldn) +-{ +- int res = 0; +- int i = 0; +- int x = 0; +- struct ast_frame *f, wf; +- +- struct { +- unsigned char offset[AST_FRIENDLY_OFFSET]; +- unsigned char buf[640]; +- } tone_block; +- +- for (;;) { +- +- if (ast_waitfor(chan, -1) < 0) { +- res = -1; +- break; +- } +- +- f = ast_read(chan); +- if (!f) { +- res = -1; +- break; +- } +- +- if (f->frametype == AST_FRAME_VOICE) { +- wf.frametype = AST_FRAME_VOICE; +- wf.subclass = AST_FORMAT_ULAW; +- wf.offset = AST_FRIENDLY_OFFSET; +- wf.mallocd = 0; +- wf.data.ptr = tone_block.buf; +- wf.datalen = f->datalen; +- wf.samples = wf.datalen; +- +- make_tone_burst(tone_block.buf, freq, (float) tldn, wf.datalen, &x); +- +- i += wf.datalen / 8; +- if (i > duration) { +- ast_frfree(f); +- break; +- } +- if (ast_write(chan, &wf)) { +- ast_verb(4, "AlarmReceiver: Failed to write frame on %s\n", chan->name); +- ast_log(LOG_WARNING, "AlarmReceiver Failed to write frame on %s\n",chan->name); +- res = -1; +- ast_frfree(f); +- break; +- } +- } +- +- ast_frfree(f); +- } +- return res; +-} +- + /* + * Receive a string of DTMF digits where the length of the digit string is known in advance. Do not give preferential + * treatment to any digit value, and allow separate time out values to be specified for the first digit and all subsequent +@@ -433,19 +354,29 @@ + database_increment("calls-received"); + + /* Wait for first event */ +- ast_verb(4, "AlarmReceiver: Waiting for first event from panel\n"); ++ ast_verb(4, "AlarmReceiver: Waiting for first event from panel...\n"); + + while (res >= 0) { + if (got_some_digits == 0) { + /* Send ACK tone sequence */ + ast_verb(4, "AlarmReceiver: Sending 1400Hz 100ms burst (ACK)\n"); +- res = send_tone_burst(chan, 1400.0, 100, tldn); +- if (!res) +- res = ast_safe_sleep(chan, 100); ++ res = ast_playtones_start(chan, tldn, "1400", 0); + if (!res) { ++ ast_safe_sleep(chan, 100); ++ ast_playtones_stop(chan); ++ } ++ if (!res) { ++ ast_safe_sleep(chan, 100); + ast_verb(4, "AlarmReceiver: Sending 2300Hz 100ms burst (ACK)\n"); +- res = send_tone_burst(chan, 2300.0, 100, tldn); ++ res = ast_playtones_start(chan, tldn, "2300", 0); ++ if (!res) { ++ ast_safe_sleep(chan, 100); ++ ast_playtones_stop(chan); ++ } ++ } else { ++ ast_debug(1, "AlarmReceiver: Failed sending tones\n"); + } ++ + } + if ( res >= 0) + res = receive_dtmf_digits(chan, event, sizeof(event) - 1, fdto, sdto); +@@ -552,9 +483,14 @@ + if (res == 0) + res = ast_safe_sleep(chan, 200); + +- /* Send the kissoff tone */ +- if (res == 0) +- res = send_tone_burst(chan, 1400.0, 900, tldn); ++ /* Send the kissoff tone (1400 Hz, 900 ms) */ ++ if (res == 0) { ++ res = ast_playtones_start(chan, tldn, "1400", 0); ++ if (res == 0) { ++ ast_safe_sleep(chan, 900); ++ ast_playtones_stop(chan); ++ } ++ } + } + + return res; diff --git a/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-confbridge-menu-invocation.patch b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-confbridge-menu-invocation.patch new file mode 100644 index 000000000000..9685af91a53a --- /dev/null +++ b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-confbridge-menu-invocation.patch @@ -0,0 +1,13 @@ +Index: apps/app_confbridge.c +=================================================================== +--- apps/app_confbridge.c (revision 271056) ++++ apps/app_confbridge.c (working copy) +@@ -734,7 +734,7 @@ + + /* If the menu option is enabled provide a user or admin menu as a custom feature hook */ + if (ast_test_flag(&conference_bridge_user.flags, OPTION_MENU)) { +- ast_bridge_features_hook(&conference_bridge_user.features, "#", menu_callback, &conference_bridge_user); ++ ast_bridge_features_hook(&conference_bridge_user.features, "*", menu_callback, &conference_bridge_user); + } + + /* If the caller should be joined already muted, make it so */ diff --git a/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-pbxstart-failed-spurious-bye.patch b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-pbxstart-failed-spurious-bye.patch new file mode 100644 index 000000000000..1a47eff12cb5 --- /dev/null +++ b/net-misc/asterisk/files/1.6.2/asterisk-1.6.2.13-pbxstart-failed-spurious-bye.patch @@ -0,0 +1,17 @@ +--- + channels/chan_sip.c | 2 ++ + 1 file changed, 2 insertions(+) + +Index: b/channels/chan_sip.c +=================================================================== +--- a/channels/chan_sip.c ++++ b/channels/chan_sip.c +@@ -20871,6 +20871,8 @@ static int handle_request_invite(struct + + if (result) { + ++ sip_alreadygone(p); ++ + /* Unlock locks so ast_hangup can do its magic */ + ast_channel_unlock(c); + sip_pvt_unlock(p); diff --git a/net-misc/asterisk/files/1.6.2/asterisk.logrotate3 b/net-misc/asterisk/files/1.6.2/asterisk.logrotate3 new file mode 100644 index 000000000000..69296c99e66d --- /dev/null +++ b/net-misc/asterisk/files/1.6.2/asterisk.logrotate3 @@ -0,0 +1,25 @@ +/var/log/asterisk/messages /var/log/asterisk/queue_log { + missingok + notifempty + + postrotate + /usr/sbin/asterisk -rnx "logger reload" || /bin/true + endscript +} + +/var/log/asterisk/debug /var/log/asterisk/full { + missingok + notifempty + daily + + postrotate + /usr/sbin/asterisk -rnx "logger reload" || /bin/true + endscript +} + +/var/log/asterisk/cdr-csv/*.csv /var/log/asterisk/cdr-custom/*.csv { + missingok + notifempty + weekly + rotate 52 +} |