summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2006-01-17 22:27:45 +0000
committersobomax <sobomax@FreeBSD.org>2006-01-17 22:27:45 +0000
commit41ebb09a42e72a07d9cba26b5f2fc07ef7a520cf (patch)
treea50c0ed1c778d55dabd7993a379cce54313ae9dd
parenta8a010f61e1ec050cb77ee08e4118d27c11faa85 (diff)
downloadFreeBSD-ports-41ebb09a42e72a07d9cba26b5f2fc07ef7a520cf.zip
FreeBSD-ports-41ebb09a42e72a07d9cba26b5f2fc07ef7a520cf.tar.gz
Update to 1.2.1.
-rw-r--r--misc/libpri-bristuff/Makefile10
-rw-r--r--misc/libpri-bristuff/distinfo6
-rw-r--r--misc/libpri-bristuff/files/patch-Makefile92
-rw-r--r--misc/libpri-bristuff/files/patch-mkdep8
-rw-r--r--misc/libpri/Makefile10
-rw-r--r--misc/libpri/distinfo6
-rw-r--r--misc/libpri/files/patch-Makefile92
-rw-r--r--misc/libpri/files/patch-mkdep8
-rw-r--r--misc/libpri2/Makefile10
-rw-r--r--misc/libpri2/distinfo6
-rw-r--r--misc/libpri2/files/patch-Makefile92
-rw-r--r--misc/libpri2/files/patch-mkdep8
-rw-r--r--net/asterisk-bristuff/Makefile22
-rw-r--r--net/asterisk-bristuff/distinfo7
-rw-r--r--net/asterisk-bristuff/files/chan_oss.c1327
-rw-r--r--net/asterisk-bristuff/files/patch-Makefile525
-rw-r--r--net/asterisk-bristuff/files/patch-agi::Makefile11
-rw-r--r--net/asterisk-bristuff/files/patch-apps::Makefile74
-rw-r--r--net/asterisk-bristuff/files/patch-apps::app_rxfax.c10
-rw-r--r--net/asterisk-bristuff/files/patch-apps::app_txfax.c8
-rw-r--r--net/asterisk-bristuff/files/patch-astman::Makefile25
-rw-r--r--net/asterisk-bristuff/files/patch-cdr::Makefile80
-rw-r--r--net/asterisk-bristuff/files/patch-channels::Makefile132
-rw-r--r--net/asterisk-bristuff/files/patch-channels::chan_h323.c20
-rw-r--r--net/asterisk-bristuff/files/patch-channels::chan_sip.c233
-rw-r--r--net/asterisk-bristuff/files/patch-channels::chan_zap.c76
-rw-r--r--net/asterisk-bristuff/files/patch-channels::h323::Makefile39
-rw-r--r--net/asterisk-bristuff/files/patch-channels::h323::ast_h323.cpp16
-rw-r--r--net/asterisk-bristuff/files/patch-channels::h323::ast_h323.h16
-rw-r--r--net/asterisk-bristuff/files/patch-codecs::Makefile73
-rw-r--r--net/asterisk-bristuff/files/patch-codecs::codec_g723_1_dummy.c314
-rw-r--r--net/asterisk-bristuff/files/patch-codecs::codec_g729_dummy.c281
-rw-r--r--net/asterisk-bristuff/files/patch-codecs::g729_slin_ex.h20
-rw-r--r--net/asterisk-bristuff/files/patch-codecs::ilbc::Makefile17
-rw-r--r--net/asterisk-bristuff/files/patch-codecs::slin_g729_ex.h31
-rw-r--r--net/asterisk-bristuff/files/patch-configs::musiconhold.conf.sample14
-rw-r--r--net/asterisk-bristuff/files/patch-db.c23
-rw-r--r--net/asterisk-bristuff/files/patch-formats::Makefile18
-rw-r--r--net/asterisk-bristuff/files/patch-formats::format_g723_1.c47
-rw-r--r--net/asterisk-bristuff/files/patch-formats::format_g729.c25
-rw-r--r--net/asterisk-bristuff/files/patch-funcs::Makefile14
-rw-r--r--net/asterisk-bristuff/files/patch-pbx::Makefile20
-rw-r--r--net/asterisk-bristuff/files/patch-pbx::pbx_wilcalu.c14
-rw-r--r--net/asterisk-bristuff/files/patch-res-res_watchdog.c13
-rw-r--r--net/asterisk-bristuff/files/patch-res::Makefile50
-rw-r--r--net/asterisk-bristuff/files/patch-rtp.c22
-rw-r--r--net/asterisk-bristuff/files/patch-utils::Makefile34
-rw-r--r--net/asterisk-bristuff/pkg-plist159
-rw-r--r--net/asterisk-devel/Makefile22
-rw-r--r--net/asterisk-devel/distinfo7
-rw-r--r--net/asterisk-devel/files/chan_oss.c1327
-rw-r--r--net/asterisk-devel/files/patch-Makefile525
-rw-r--r--net/asterisk-devel/files/patch-agi::Makefile11
-rw-r--r--net/asterisk-devel/files/patch-apps::Makefile74
-rw-r--r--net/asterisk-devel/files/patch-apps::app_rxfax.c10
-rw-r--r--net/asterisk-devel/files/patch-apps::app_txfax.c8
-rw-r--r--net/asterisk-devel/files/patch-astman::Makefile25
-rw-r--r--net/asterisk-devel/files/patch-cdr::Makefile80
-rw-r--r--net/asterisk-devel/files/patch-channels::Makefile132
-rw-r--r--net/asterisk-devel/files/patch-channels::chan_h323.c20
-rw-r--r--net/asterisk-devel/files/patch-channels::chan_sip.c233
-rw-r--r--net/asterisk-devel/files/patch-channels::chan_zap.c76
-rw-r--r--net/asterisk-devel/files/patch-channels::h323::Makefile39
-rw-r--r--net/asterisk-devel/files/patch-channels::h323::ast_h323.cpp16
-rw-r--r--net/asterisk-devel/files/patch-channels::h323::ast_h323.h16
-rw-r--r--net/asterisk-devel/files/patch-codecs::Makefile73
-rw-r--r--net/asterisk-devel/files/patch-codecs::codec_g723_1_dummy.c314
-rw-r--r--net/asterisk-devel/files/patch-codecs::codec_g729_dummy.c281
-rw-r--r--net/asterisk-devel/files/patch-codecs::g729_slin_ex.h20
-rw-r--r--net/asterisk-devel/files/patch-codecs::ilbc::Makefile17
-rw-r--r--net/asterisk-devel/files/patch-codecs::slin_g729_ex.h31
-rw-r--r--net/asterisk-devel/files/patch-configs::musiconhold.conf.sample14
-rw-r--r--net/asterisk-devel/files/patch-db.c23
-rw-r--r--net/asterisk-devel/files/patch-formats::Makefile18
-rw-r--r--net/asterisk-devel/files/patch-formats::format_g723_1.c47
-rw-r--r--net/asterisk-devel/files/patch-formats::format_g729.c25
-rw-r--r--net/asterisk-devel/files/patch-funcs::Makefile14
-rw-r--r--net/asterisk-devel/files/patch-pbx::Makefile20
-rw-r--r--net/asterisk-devel/files/patch-pbx::pbx_wilcalu.c14
-rw-r--r--net/asterisk-devel/files/patch-res-res_watchdog.c13
-rw-r--r--net/asterisk-devel/files/patch-res::Makefile50
-rw-r--r--net/asterisk-devel/files/patch-rtp.c22
-rw-r--r--net/asterisk-devel/files/patch-utils::Makefile34
-rw-r--r--net/asterisk-devel/pkg-plist159
-rw-r--r--net/asterisk/Makefile22
-rw-r--r--net/asterisk/distinfo7
-rw-r--r--net/asterisk/files/chan_oss.c1327
-rw-r--r--net/asterisk/files/patch-Makefile525
-rw-r--r--net/asterisk/files/patch-agi::Makefile11
-rw-r--r--net/asterisk/files/patch-apps::Makefile74
-rw-r--r--net/asterisk/files/patch-apps::app_rxfax.c10
-rw-r--r--net/asterisk/files/patch-apps::app_txfax.c8
-rw-r--r--net/asterisk/files/patch-astman::Makefile25
-rw-r--r--net/asterisk/files/patch-cdr::Makefile80
-rw-r--r--net/asterisk/files/patch-channels::Makefile132
-rw-r--r--net/asterisk/files/patch-channels::chan_h323.c20
-rw-r--r--net/asterisk/files/patch-channels::chan_sip.c233
-rw-r--r--net/asterisk/files/patch-channels::chan_zap.c76
-rw-r--r--net/asterisk/files/patch-channels::h323::Makefile39
-rw-r--r--net/asterisk/files/patch-channels::h323::ast_h323.cpp16
-rw-r--r--net/asterisk/files/patch-channels::h323::ast_h323.h16
-rw-r--r--net/asterisk/files/patch-codecs::Makefile73
-rw-r--r--net/asterisk/files/patch-codecs::codec_g723_1_dummy.c314
-rw-r--r--net/asterisk/files/patch-codecs::codec_g729_dummy.c281
-rw-r--r--net/asterisk/files/patch-codecs::g729_slin_ex.h20
-rw-r--r--net/asterisk/files/patch-codecs::ilbc::Makefile17
-rw-r--r--net/asterisk/files/patch-codecs::slin_g729_ex.h31
-rw-r--r--net/asterisk/files/patch-configs::musiconhold.conf.sample14
-rw-r--r--net/asterisk/files/patch-db.c23
-rw-r--r--net/asterisk/files/patch-formats::Makefile18
-rw-r--r--net/asterisk/files/patch-formats::format_g723_1.c47
-rw-r--r--net/asterisk/files/patch-formats::format_g729.c25
-rw-r--r--net/asterisk/files/patch-funcs::Makefile14
-rw-r--r--net/asterisk/files/patch-pbx::Makefile20
-rw-r--r--net/asterisk/files/patch-pbx::pbx_wilcalu.c14
-rw-r--r--net/asterisk/files/patch-res-res_watchdog.c13
-rw-r--r--net/asterisk/files/patch-res::Makefile50
-rw-r--r--net/asterisk/files/patch-rtp.c22
-rw-r--r--net/asterisk/files/patch-utils::Makefile34
-rw-r--r--net/asterisk/pkg-plist159
-rw-r--r--net/asterisk10/Makefile22
-rw-r--r--net/asterisk10/distinfo7
-rw-r--r--net/asterisk10/files/chan_oss.c1327
-rw-r--r--net/asterisk10/files/patch-Makefile525
-rw-r--r--net/asterisk10/files/patch-agi::Makefile11
-rw-r--r--net/asterisk10/files/patch-apps::Makefile74
-rw-r--r--net/asterisk10/files/patch-apps::app_rxfax.c10
-rw-r--r--net/asterisk10/files/patch-apps::app_txfax.c8
-rw-r--r--net/asterisk10/files/patch-astman::Makefile25
-rw-r--r--net/asterisk10/files/patch-cdr::Makefile80
-rw-r--r--net/asterisk10/files/patch-channels::Makefile132
-rw-r--r--net/asterisk10/files/patch-channels::chan_h323.c20
-rw-r--r--net/asterisk10/files/patch-channels::chan_sip.c233
-rw-r--r--net/asterisk10/files/patch-channels::chan_zap.c76
-rw-r--r--net/asterisk10/files/patch-channels::h323::Makefile39
-rw-r--r--net/asterisk10/files/patch-channels::h323::ast_h323.cpp16
-rw-r--r--net/asterisk10/files/patch-channels::h323::ast_h323.h16
-rw-r--r--net/asterisk10/files/patch-codecs::Makefile73
-rw-r--r--net/asterisk10/files/patch-codecs::codec_g723_1_dummy.c314
-rw-r--r--net/asterisk10/files/patch-codecs::codec_g729_dummy.c281
-rw-r--r--net/asterisk10/files/patch-codecs::g729_slin_ex.h20
-rw-r--r--net/asterisk10/files/patch-codecs::ilbc::Makefile17
-rw-r--r--net/asterisk10/files/patch-codecs::slin_g729_ex.h31
-rw-r--r--net/asterisk10/files/patch-configs::musiconhold.conf.sample14
-rw-r--r--net/asterisk10/files/patch-db.c23
-rw-r--r--net/asterisk10/files/patch-formats::Makefile18
-rw-r--r--net/asterisk10/files/patch-formats::format_g723_1.c47
-rw-r--r--net/asterisk10/files/patch-formats::format_g729.c25
-rw-r--r--net/asterisk10/files/patch-funcs::Makefile14
-rw-r--r--net/asterisk10/files/patch-pbx::Makefile20
-rw-r--r--net/asterisk10/files/patch-pbx::pbx_wilcalu.c14
-rw-r--r--net/asterisk10/files/patch-res-res_watchdog.c13
-rw-r--r--net/asterisk10/files/patch-res::Makefile50
-rw-r--r--net/asterisk10/files/patch-rtp.c22
-rw-r--r--net/asterisk10/files/patch-utils::Makefile34
-rw-r--r--net/asterisk10/pkg-plist159
-rw-r--r--net/asterisk12/Makefile22
-rw-r--r--net/asterisk12/distinfo7
-rw-r--r--net/asterisk12/files/chan_oss.c1327
-rw-r--r--net/asterisk12/files/patch-Makefile525
-rw-r--r--net/asterisk12/files/patch-agi::Makefile11
-rw-r--r--net/asterisk12/files/patch-apps::Makefile74
-rw-r--r--net/asterisk12/files/patch-apps::app_rxfax.c10
-rw-r--r--net/asterisk12/files/patch-apps::app_txfax.c8
-rw-r--r--net/asterisk12/files/patch-astman::Makefile25
-rw-r--r--net/asterisk12/files/patch-cdr::Makefile80
-rw-r--r--net/asterisk12/files/patch-channels::Makefile132
-rw-r--r--net/asterisk12/files/patch-channels::chan_h323.c20
-rw-r--r--net/asterisk12/files/patch-channels::chan_sip.c233
-rw-r--r--net/asterisk12/files/patch-channels::chan_zap.c76
-rw-r--r--net/asterisk12/files/patch-channels::h323::Makefile39
-rw-r--r--net/asterisk12/files/patch-channels::h323::ast_h323.cpp16
-rw-r--r--net/asterisk12/files/patch-channels::h323::ast_h323.h16
-rw-r--r--net/asterisk12/files/patch-codecs::Makefile73
-rw-r--r--net/asterisk12/files/patch-codecs::codec_g723_1_dummy.c314
-rw-r--r--net/asterisk12/files/patch-codecs::codec_g729_dummy.c281
-rw-r--r--net/asterisk12/files/patch-codecs::g729_slin_ex.h20
-rw-r--r--net/asterisk12/files/patch-codecs::ilbc::Makefile17
-rw-r--r--net/asterisk12/files/patch-codecs::slin_g729_ex.h31
-rw-r--r--net/asterisk12/files/patch-configs::musiconhold.conf.sample14
-rw-r--r--net/asterisk12/files/patch-db.c23
-rw-r--r--net/asterisk12/files/patch-formats::Makefile18
-rw-r--r--net/asterisk12/files/patch-formats::format_g723_1.c47
-rw-r--r--net/asterisk12/files/patch-formats::format_g729.c25
-rw-r--r--net/asterisk12/files/patch-funcs::Makefile14
-rw-r--r--net/asterisk12/files/patch-pbx::Makefile20
-rw-r--r--net/asterisk12/files/patch-pbx::pbx_wilcalu.c14
-rw-r--r--net/asterisk12/files/patch-res-res_watchdog.c13
-rw-r--r--net/asterisk12/files/patch-res::Makefile50
-rw-r--r--net/asterisk12/files/patch-rtp.c22
-rw-r--r--net/asterisk12/files/patch-utils::Makefile34
-rw-r--r--net/asterisk12/pkg-plist159
-rw-r--r--net/asterisk14/Makefile22
-rw-r--r--net/asterisk14/distinfo7
-rw-r--r--net/asterisk14/files/chan_oss.c1327
-rw-r--r--net/asterisk14/files/patch-Makefile525
-rw-r--r--net/asterisk14/files/patch-agi::Makefile11
-rw-r--r--net/asterisk14/files/patch-apps::Makefile74
-rw-r--r--net/asterisk14/files/patch-apps::app_rxfax.c10
-rw-r--r--net/asterisk14/files/patch-apps::app_txfax.c8
-rw-r--r--net/asterisk14/files/patch-astman::Makefile25
-rw-r--r--net/asterisk14/files/patch-cdr::Makefile80
-rw-r--r--net/asterisk14/files/patch-channels::Makefile132
-rw-r--r--net/asterisk14/files/patch-channels::chan_h323.c20
-rw-r--r--net/asterisk14/files/patch-channels::chan_sip.c233
-rw-r--r--net/asterisk14/files/patch-channels::chan_zap.c76
-rw-r--r--net/asterisk14/files/patch-channels::h323::Makefile39
-rw-r--r--net/asterisk14/files/patch-channels::h323::ast_h323.cpp16
-rw-r--r--net/asterisk14/files/patch-channels::h323::ast_h323.h16
-rw-r--r--net/asterisk14/files/patch-codecs::Makefile73
-rw-r--r--net/asterisk14/files/patch-codecs::codec_g723_1_dummy.c314
-rw-r--r--net/asterisk14/files/patch-codecs::codec_g729_dummy.c281
-rw-r--r--net/asterisk14/files/patch-codecs::g729_slin_ex.h20
-rw-r--r--net/asterisk14/files/patch-codecs::ilbc::Makefile17
-rw-r--r--net/asterisk14/files/patch-codecs::slin_g729_ex.h31
-rw-r--r--net/asterisk14/files/patch-configs::musiconhold.conf.sample14
-rw-r--r--net/asterisk14/files/patch-db.c23
-rw-r--r--net/asterisk14/files/patch-formats::Makefile18
-rw-r--r--net/asterisk14/files/patch-formats::format_g723_1.c47
-rw-r--r--net/asterisk14/files/patch-formats::format_g729.c25
-rw-r--r--net/asterisk14/files/patch-funcs::Makefile14
-rw-r--r--net/asterisk14/files/patch-pbx::Makefile20
-rw-r--r--net/asterisk14/files/patch-pbx::pbx_wilcalu.c14
-rw-r--r--net/asterisk14/files/patch-res-res_watchdog.c13
-rw-r--r--net/asterisk14/files/patch-res::Makefile50
-rw-r--r--net/asterisk14/files/patch-rtp.c22
-rw-r--r--net/asterisk14/files/patch-utils::Makefile34
-rw-r--r--net/asterisk14/pkg-plist159
-rw-r--r--net/asterisk16/Makefile22
-rw-r--r--net/asterisk16/distinfo7
-rw-r--r--net/asterisk16/files/chan_oss.c1327
-rw-r--r--net/asterisk16/files/patch-Makefile525
-rw-r--r--net/asterisk16/files/patch-agi::Makefile11
-rw-r--r--net/asterisk16/files/patch-apps::Makefile74
-rw-r--r--net/asterisk16/files/patch-apps::app_rxfax.c10
-rw-r--r--net/asterisk16/files/patch-apps::app_txfax.c8
-rw-r--r--net/asterisk16/files/patch-astman::Makefile25
-rw-r--r--net/asterisk16/files/patch-cdr::Makefile80
-rw-r--r--net/asterisk16/files/patch-channels::Makefile132
-rw-r--r--net/asterisk16/files/patch-channels::chan_h323.c20
-rw-r--r--net/asterisk16/files/patch-channels::chan_sip.c233
-rw-r--r--net/asterisk16/files/patch-channels::chan_zap.c76
-rw-r--r--net/asterisk16/files/patch-channels::h323::Makefile39
-rw-r--r--net/asterisk16/files/patch-channels::h323::ast_h323.cpp16
-rw-r--r--net/asterisk16/files/patch-channels::h323::ast_h323.h16
-rw-r--r--net/asterisk16/files/patch-codecs::Makefile73
-rw-r--r--net/asterisk16/files/patch-codecs::codec_g723_1_dummy.c314
-rw-r--r--net/asterisk16/files/patch-codecs::codec_g729_dummy.c281
-rw-r--r--net/asterisk16/files/patch-codecs::g729_slin_ex.h20
-rw-r--r--net/asterisk16/files/patch-codecs::ilbc::Makefile17
-rw-r--r--net/asterisk16/files/patch-codecs::slin_g729_ex.h31
-rw-r--r--net/asterisk16/files/patch-configs::musiconhold.conf.sample14
-rw-r--r--net/asterisk16/files/patch-db.c23
-rw-r--r--net/asterisk16/files/patch-formats::Makefile18
-rw-r--r--net/asterisk16/files/patch-formats::format_g723_1.c47
-rw-r--r--net/asterisk16/files/patch-formats::format_g729.c25
-rw-r--r--net/asterisk16/files/patch-funcs::Makefile14
-rw-r--r--net/asterisk16/files/patch-pbx::Makefile20
-rw-r--r--net/asterisk16/files/patch-pbx::pbx_wilcalu.c14
-rw-r--r--net/asterisk16/files/patch-res-res_watchdog.c13
-rw-r--r--net/asterisk16/files/patch-res::Makefile50
-rw-r--r--net/asterisk16/files/patch-rtp.c22
-rw-r--r--net/asterisk16/files/patch-utils::Makefile34
-rw-r--r--net/asterisk16/pkg-plist159
264 files changed, 7248 insertions, 19770 deletions
diff --git a/misc/libpri-bristuff/Makefile b/misc/libpri-bristuff/Makefile
index 459202a..ffb4303 100644
--- a/misc/libpri-bristuff/Makefile
+++ b/misc/libpri-bristuff/Makefile
@@ -6,15 +6,15 @@
#
PORTNAME= libpri
-PORTVERSION= 1.0.9
+PORTVERSION= 1.2.1
CATEGORIES= misc
MASTER_SITES= ftp://ftp.digium.com/pub/libpri/ \
ftp://ftp.digium.com/pub/libpri/old/
-PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
-PATCH_SITES= ${MASTER_SITE_LOCAL}
-PATCH_SITE_SUBDIR= fjoe
-PATCH_DIST_STRIP= -p1
+#PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
+#PATCH_SITES= ${MASTER_SITE_LOCAL}
+#PATCH_SITE_SUBDIR= fjoe
+#PATCH_DIST_STRIP= -p1
MAINTAINER= gonzo@univ.kiev.ua
COMMENT= A C implementation of the Primary Rate ISDN specification
diff --git a/misc/libpri-bristuff/distinfo b/misc/libpri-bristuff/distinfo
index 9941df0..c5fa9a1 100644
--- a/misc/libpri-bristuff/distinfo
+++ b/misc/libpri-bristuff/distinfo
@@ -1,4 +1,2 @@
-MD5 (libpri-1.0.9.tar.gz) = c0652944376f6bbe035ec578ff445625
-SIZE (libpri-1.0.9.tar.gz) = 55801
-MD5 (libpri-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 681ad82dfc6565e61c11467199ab987b
-SIZE (libpri-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 30486
+MD5 (libpri-1.2.1.tar.gz) = d039b171514ec8b1a163b0875f76734e
+SIZE (libpri-1.2.1.tar.gz) = 75687
diff --git a/misc/libpri-bristuff/files/patch-Makefile b/misc/libpri-bristuff/files/patch-Makefile
index 6ab85c6..087b757 100644
--- a/misc/libpri-bristuff/files/patch-Makefile
+++ b/misc/libpri-bristuff/files/patch-Makefile
@@ -1,63 +1,69 @@
---- Makefile.orig Fri Feb 25 06:05:47 2005
-+++ Makefile Fri Feb 25 06:08:51 2005
-@@ -33,11 +33,11 @@
+
+$FreeBSD$
+
+--- Makefile.orig
++++ Makefile
+@@ -27,7 +27,7 @@
+ # Uncomment if you want libpri to count number of Q921/Q931 sent/received
+ #LIBPRI_COUNTERS=-DLIBPRI_COUNTERS
+
+-CC=gcc
++CC?=gcc
+
+ OSARCH=$(shell uname -s)
+ PROC?=$(shell uname -m)
+@@ -35,11 +35,11 @@
TOBJS=testpri.o
T2OBJS=testprilib.o
STATIC_LIBRARY=libpri.a
-DYNAMIC_LIBRARY=libpri.so.1.0
+DYNAMIC_LIBRARY=libpri.so.1
- STATIC_OBJS=pri.o q921.o prisched.o q931.o
- DYNAMIC_OBJS=pri.lo q921.lo prisched.lo q931.lo
--CFLAGS=-Wall -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
--INSTALL_PREFIX=
-+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes $(ALERTING) $(LIBPRI_COUNTERS)
+ STATIC_OBJS=copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o
+ DYNAMIC_OBJS=copy_string.lo pri.lo q921.lo prisched.lo q931.lo pri_facility.lo
+-CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
+-INSTALL_PREFIX?=
++CFLAGS+=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
+INSTALL_PREFIX=$(PREFIX)
- ifeq (${OSARCH},Linux)
- LDCONFIG_FLAGS=-n
- else
-@@ -62,21 +62,19 @@
- @cvs update -d
+ INSTALL_BASE=/usr
+ SOFLAGS = -Wl,-hlibpri.so.1
+ LDCONFIG = /sbin/ldconfig
+@@ -81,20 +81,19 @@
+ fi
install: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
-- mkdir -p $(INSTALL_PREFIX)/usr/lib
-- mkdir -p $(INSTALL_PREFIX)/usr/include
-- install -m 644 libpri.h $(INSTALL_PREFIX)/usr/include
-- install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)/usr/lib
-- if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then restorecon -v $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
-- ( cd $(INSTALL_PREFIX)/usr/lib ; ln -sf libpri.so.1 libpri.so )
-- install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)/usr/lib
-- /sbin/ldconfig
+- mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
+- mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/include
+ mkdir -p $(INSTALL_PREFIX)/lib
+ mkdir -p $(INSTALL_PREFIX)/include
+ ifneq (${OSARCH},SunOS)
+- install -m 644 libpri.h $(INSTALL_PREFIX)$(INSTALL_BASE)/include
+- install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
+- if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then restorecon -v $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
+- ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so )
+- install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
+- if test $$(id -u) = 0; then $(LDCONFIG); fi
++ echo installing libpri.h
+ $(BSD_INSTALL_DATA) libpri.h $(INSTALL_PREFIX)/include
+ $(BSD_INSTALL_PROGRAM) $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)/lib
+ ( cd $(INSTALL_PREFIX)/lib ; ln -sf libpri.so.1 libpri.so )
+ $(BSD_INSTALL_DATA) $(STATIC_LIBRARY) $(INSTALL_PREFIX)/lib
+ else
+- install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include -m 644 libpri.h
+- install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 755 $(DYNAMIC_LIBRARY)
+- ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so ; $(SOSLINK) )
+- install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 644 $(STATIC_LIBRARY)
++ install -f $(INSTALL_PREFIX)/include -m 644 libpri.h
++ install -f $(INSTALL_PREFIX)/lib -m 755 $(DYNAMIC_LIBRARY)
++ ( cd $(INSTALL_PREFIX)/lib ; ln -sf libpri.so.1 libpri.so ; $(SOSLINK) )
++ install -f $(INSTALL_PREFIX)/lib -m 644 $(STATIC_LIBRARY)
+ endif
uninstall:
- @echo "Removing Libpri"
-- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.so.1.0
-- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.so
-- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.a
-- rm -f $(INSTALL_PREFIX)/usr/include/libpri.h
-+ rm -f $(INSTALL_PREFIX)/lib/libpri.so.1
-+ rm -f $(INSTALL_PREFIX)/lib/libpri.so
-+ rm -f $(INSTALL_PREFIX)/lib/libpri.a
-+ rm -f $(INSTALL_PREFIX)/include/libpri.h
-
- pritest: pritest.o
- $(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS)
-@@ -101,11 +99,11 @@
+@@ -130,7 +129,6 @@
$(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
- $(CC) -shared -Wl,-soname,libpri.so.1 -o $@ $(DYNAMIC_OBJS)
-- /sbin/ldconfig $(LDCONFIG_FLAGS) .
-+ #/sbin/ldconfig $(LDCONFIG_FLAGS) .
+ $(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
+- $(LDCONFIG) $(LDCONFIG_FLAGS) .
ln -sf libpri.so.1 libpri.so
+ $(SOSLINK)
- clean:
-- rm -f *.o *.so *.lo *.so.1 *.so.1.0
-+ rm -f *.o *.so *.lo *.so.1
- rm -f testpri testprilib $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
- rm -f pritest pridump
- rm -f .depend
diff --git a/misc/libpri-bristuff/files/patch-mkdep b/misc/libpri-bristuff/files/patch-mkdep
new file mode 100644
index 0000000..3d8849b8
--- /dev/null
+++ b/misc/libpri-bristuff/files/patch-mkdep
@@ -0,0 +1,8 @@
+--- mkdep.orig Wed Nov 30 22:55:54 2005
++++ mkdep Wed Nov 30 22:56:00 2005
+@@ -1,4 +1,4 @@
+-#!/bin/bash -
++#!/bin/sh -
+ #
+ # $OpenBSD: mkdep.gcc.sh,v 1.8 1998/09/02 06:40:07 deraadt Exp $
+ # $NetBSD: mkdep.gcc.sh,v 1.9 1994/12/23 07:34:59 jtc Exp $
diff --git a/misc/libpri/Makefile b/misc/libpri/Makefile
index 459202a..ffb4303 100644
--- a/misc/libpri/Makefile
+++ b/misc/libpri/Makefile
@@ -6,15 +6,15 @@
#
PORTNAME= libpri
-PORTVERSION= 1.0.9
+PORTVERSION= 1.2.1
CATEGORIES= misc
MASTER_SITES= ftp://ftp.digium.com/pub/libpri/ \
ftp://ftp.digium.com/pub/libpri/old/
-PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
-PATCH_SITES= ${MASTER_SITE_LOCAL}
-PATCH_SITE_SUBDIR= fjoe
-PATCH_DIST_STRIP= -p1
+#PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
+#PATCH_SITES= ${MASTER_SITE_LOCAL}
+#PATCH_SITE_SUBDIR= fjoe
+#PATCH_DIST_STRIP= -p1
MAINTAINER= gonzo@univ.kiev.ua
COMMENT= A C implementation of the Primary Rate ISDN specification
diff --git a/misc/libpri/distinfo b/misc/libpri/distinfo
index 9941df0..c5fa9a1 100644
--- a/misc/libpri/distinfo
+++ b/misc/libpri/distinfo
@@ -1,4 +1,2 @@
-MD5 (libpri-1.0.9.tar.gz) = c0652944376f6bbe035ec578ff445625
-SIZE (libpri-1.0.9.tar.gz) = 55801
-MD5 (libpri-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 681ad82dfc6565e61c11467199ab987b
-SIZE (libpri-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 30486
+MD5 (libpri-1.2.1.tar.gz) = d039b171514ec8b1a163b0875f76734e
+SIZE (libpri-1.2.1.tar.gz) = 75687
diff --git a/misc/libpri/files/patch-Makefile b/misc/libpri/files/patch-Makefile
index 6ab85c6..087b757 100644
--- a/misc/libpri/files/patch-Makefile
+++ b/misc/libpri/files/patch-Makefile
@@ -1,63 +1,69 @@
---- Makefile.orig Fri Feb 25 06:05:47 2005
-+++ Makefile Fri Feb 25 06:08:51 2005
-@@ -33,11 +33,11 @@
+
+$FreeBSD$
+
+--- Makefile.orig
++++ Makefile
+@@ -27,7 +27,7 @@
+ # Uncomment if you want libpri to count number of Q921/Q931 sent/received
+ #LIBPRI_COUNTERS=-DLIBPRI_COUNTERS
+
+-CC=gcc
++CC?=gcc
+
+ OSARCH=$(shell uname -s)
+ PROC?=$(shell uname -m)
+@@ -35,11 +35,11 @@
TOBJS=testpri.o
T2OBJS=testprilib.o
STATIC_LIBRARY=libpri.a
-DYNAMIC_LIBRARY=libpri.so.1.0
+DYNAMIC_LIBRARY=libpri.so.1
- STATIC_OBJS=pri.o q921.o prisched.o q931.o
- DYNAMIC_OBJS=pri.lo q921.lo prisched.lo q931.lo
--CFLAGS=-Wall -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
--INSTALL_PREFIX=
-+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes $(ALERTING) $(LIBPRI_COUNTERS)
+ STATIC_OBJS=copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o
+ DYNAMIC_OBJS=copy_string.lo pri.lo q921.lo prisched.lo q931.lo pri_facility.lo
+-CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
+-INSTALL_PREFIX?=
++CFLAGS+=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
+INSTALL_PREFIX=$(PREFIX)
- ifeq (${OSARCH},Linux)
- LDCONFIG_FLAGS=-n
- else
-@@ -62,21 +62,19 @@
- @cvs update -d
+ INSTALL_BASE=/usr
+ SOFLAGS = -Wl,-hlibpri.so.1
+ LDCONFIG = /sbin/ldconfig
+@@ -81,20 +81,19 @@
+ fi
install: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
-- mkdir -p $(INSTALL_PREFIX)/usr/lib
-- mkdir -p $(INSTALL_PREFIX)/usr/include
-- install -m 644 libpri.h $(INSTALL_PREFIX)/usr/include
-- install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)/usr/lib
-- if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then restorecon -v $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
-- ( cd $(INSTALL_PREFIX)/usr/lib ; ln -sf libpri.so.1 libpri.so )
-- install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)/usr/lib
-- /sbin/ldconfig
+- mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
+- mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/include
+ mkdir -p $(INSTALL_PREFIX)/lib
+ mkdir -p $(INSTALL_PREFIX)/include
+ ifneq (${OSARCH},SunOS)
+- install -m 644 libpri.h $(INSTALL_PREFIX)$(INSTALL_BASE)/include
+- install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
+- if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then restorecon -v $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
+- ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so )
+- install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
+- if test $$(id -u) = 0; then $(LDCONFIG); fi
++ echo installing libpri.h
+ $(BSD_INSTALL_DATA) libpri.h $(INSTALL_PREFIX)/include
+ $(BSD_INSTALL_PROGRAM) $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)/lib
+ ( cd $(INSTALL_PREFIX)/lib ; ln -sf libpri.so.1 libpri.so )
+ $(BSD_INSTALL_DATA) $(STATIC_LIBRARY) $(INSTALL_PREFIX)/lib
+ else
+- install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include -m 644 libpri.h
+- install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 755 $(DYNAMIC_LIBRARY)
+- ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so ; $(SOSLINK) )
+- install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 644 $(STATIC_LIBRARY)
++ install -f $(INSTALL_PREFIX)/include -m 644 libpri.h
++ install -f $(INSTALL_PREFIX)/lib -m 755 $(DYNAMIC_LIBRARY)
++ ( cd $(INSTALL_PREFIX)/lib ; ln -sf libpri.so.1 libpri.so ; $(SOSLINK) )
++ install -f $(INSTALL_PREFIX)/lib -m 644 $(STATIC_LIBRARY)
+ endif
uninstall:
- @echo "Removing Libpri"
-- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.so.1.0
-- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.so
-- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.a
-- rm -f $(INSTALL_PREFIX)/usr/include/libpri.h
-+ rm -f $(INSTALL_PREFIX)/lib/libpri.so.1
-+ rm -f $(INSTALL_PREFIX)/lib/libpri.so
-+ rm -f $(INSTALL_PREFIX)/lib/libpri.a
-+ rm -f $(INSTALL_PREFIX)/include/libpri.h
-
- pritest: pritest.o
- $(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS)
-@@ -101,11 +99,11 @@
+@@ -130,7 +129,6 @@
$(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
- $(CC) -shared -Wl,-soname,libpri.so.1 -o $@ $(DYNAMIC_OBJS)
-- /sbin/ldconfig $(LDCONFIG_FLAGS) .
-+ #/sbin/ldconfig $(LDCONFIG_FLAGS) .
+ $(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
+- $(LDCONFIG) $(LDCONFIG_FLAGS) .
ln -sf libpri.so.1 libpri.so
+ $(SOSLINK)
- clean:
-- rm -f *.o *.so *.lo *.so.1 *.so.1.0
-+ rm -f *.o *.so *.lo *.so.1
- rm -f testpri testprilib $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
- rm -f pritest pridump
- rm -f .depend
diff --git a/misc/libpri/files/patch-mkdep b/misc/libpri/files/patch-mkdep
new file mode 100644
index 0000000..3d8849b8
--- /dev/null
+++ b/misc/libpri/files/patch-mkdep
@@ -0,0 +1,8 @@
+--- mkdep.orig Wed Nov 30 22:55:54 2005
++++ mkdep Wed Nov 30 22:56:00 2005
+@@ -1,4 +1,4 @@
+-#!/bin/bash -
++#!/bin/sh -
+ #
+ # $OpenBSD: mkdep.gcc.sh,v 1.8 1998/09/02 06:40:07 deraadt Exp $
+ # $NetBSD: mkdep.gcc.sh,v 1.9 1994/12/23 07:34:59 jtc Exp $
diff --git a/misc/libpri2/Makefile b/misc/libpri2/Makefile
index 459202a..ffb4303 100644
--- a/misc/libpri2/Makefile
+++ b/misc/libpri2/Makefile
@@ -6,15 +6,15 @@
#
PORTNAME= libpri
-PORTVERSION= 1.0.9
+PORTVERSION= 1.2.1
CATEGORIES= misc
MASTER_SITES= ftp://ftp.digium.com/pub/libpri/ \
ftp://ftp.digium.com/pub/libpri/old/
-PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
-PATCH_SITES= ${MASTER_SITE_LOCAL}
-PATCH_SITE_SUBDIR= fjoe
-PATCH_DIST_STRIP= -p1
+#PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
+#PATCH_SITES= ${MASTER_SITE_LOCAL}
+#PATCH_SITE_SUBDIR= fjoe
+#PATCH_DIST_STRIP= -p1
MAINTAINER= gonzo@univ.kiev.ua
COMMENT= A C implementation of the Primary Rate ISDN specification
diff --git a/misc/libpri2/distinfo b/misc/libpri2/distinfo
index 9941df0..c5fa9a1 100644
--- a/misc/libpri2/distinfo
+++ b/misc/libpri2/distinfo
@@ -1,4 +1,2 @@
-MD5 (libpri-1.0.9.tar.gz) = c0652944376f6bbe035ec578ff445625
-SIZE (libpri-1.0.9.tar.gz) = 55801
-MD5 (libpri-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 681ad82dfc6565e61c11467199ab987b
-SIZE (libpri-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 30486
+MD5 (libpri-1.2.1.tar.gz) = d039b171514ec8b1a163b0875f76734e
+SIZE (libpri-1.2.1.tar.gz) = 75687
diff --git a/misc/libpri2/files/patch-Makefile b/misc/libpri2/files/patch-Makefile
index 6ab85c6..087b757 100644
--- a/misc/libpri2/files/patch-Makefile
+++ b/misc/libpri2/files/patch-Makefile
@@ -1,63 +1,69 @@
---- Makefile.orig Fri Feb 25 06:05:47 2005
-+++ Makefile Fri Feb 25 06:08:51 2005
-@@ -33,11 +33,11 @@
+
+$FreeBSD$
+
+--- Makefile.orig
++++ Makefile
+@@ -27,7 +27,7 @@
+ # Uncomment if you want libpri to count number of Q921/Q931 sent/received
+ #LIBPRI_COUNTERS=-DLIBPRI_COUNTERS
+
+-CC=gcc
++CC?=gcc
+
+ OSARCH=$(shell uname -s)
+ PROC?=$(shell uname -m)
+@@ -35,11 +35,11 @@
TOBJS=testpri.o
T2OBJS=testprilib.o
STATIC_LIBRARY=libpri.a
-DYNAMIC_LIBRARY=libpri.so.1.0
+DYNAMIC_LIBRARY=libpri.so.1
- STATIC_OBJS=pri.o q921.o prisched.o q931.o
- DYNAMIC_OBJS=pri.lo q921.lo prisched.lo q931.lo
--CFLAGS=-Wall -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
--INSTALL_PREFIX=
-+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes $(ALERTING) $(LIBPRI_COUNTERS)
+ STATIC_OBJS=copy_string.o pri.o q921.o prisched.o q931.o pri_facility.o
+ DYNAMIC_OBJS=copy_string.lo pri.lo q921.lo prisched.lo q931.lo pri_facility.lo
+-CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
+-INSTALL_PREFIX?=
++CFLAGS+=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
+INSTALL_PREFIX=$(PREFIX)
- ifeq (${OSARCH},Linux)
- LDCONFIG_FLAGS=-n
- else
-@@ -62,21 +62,19 @@
- @cvs update -d
+ INSTALL_BASE=/usr
+ SOFLAGS = -Wl,-hlibpri.so.1
+ LDCONFIG = /sbin/ldconfig
+@@ -81,20 +81,19 @@
+ fi
install: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
-- mkdir -p $(INSTALL_PREFIX)/usr/lib
-- mkdir -p $(INSTALL_PREFIX)/usr/include
-- install -m 644 libpri.h $(INSTALL_PREFIX)/usr/include
-- install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)/usr/lib
-- if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then restorecon -v $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
-- ( cd $(INSTALL_PREFIX)/usr/lib ; ln -sf libpri.so.1 libpri.so )
-- install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)/usr/lib
-- /sbin/ldconfig
+- mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
+- mkdir -p $(INSTALL_PREFIX)$(INSTALL_BASE)/include
+ mkdir -p $(INSTALL_PREFIX)/lib
+ mkdir -p $(INSTALL_PREFIX)/include
+ ifneq (${OSARCH},SunOS)
+- install -m 644 libpri.h $(INSTALL_PREFIX)$(INSTALL_BASE)/include
+- install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
+- if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then restorecon -v $(INSTALL_PREFIX)$(INSTALL_BASE)/lib/$(DYNAMIC_LIBRARY); fi
+- ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so )
+- install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(INSTALL_BASE)/lib
+- if test $$(id -u) = 0; then $(LDCONFIG); fi
++ echo installing libpri.h
+ $(BSD_INSTALL_DATA) libpri.h $(INSTALL_PREFIX)/include
+ $(BSD_INSTALL_PROGRAM) $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)/lib
+ ( cd $(INSTALL_PREFIX)/lib ; ln -sf libpri.so.1 libpri.so )
+ $(BSD_INSTALL_DATA) $(STATIC_LIBRARY) $(INSTALL_PREFIX)/lib
+ else
+- install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include -m 644 libpri.h
+- install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 755 $(DYNAMIC_LIBRARY)
+- ( cd $(INSTALL_PREFIX)$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so ; $(SOSLINK) )
+- install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/lib -m 644 $(STATIC_LIBRARY)
++ install -f $(INSTALL_PREFIX)/include -m 644 libpri.h
++ install -f $(INSTALL_PREFIX)/lib -m 755 $(DYNAMIC_LIBRARY)
++ ( cd $(INSTALL_PREFIX)/lib ; ln -sf libpri.so.1 libpri.so ; $(SOSLINK) )
++ install -f $(INSTALL_PREFIX)/lib -m 644 $(STATIC_LIBRARY)
+ endif
uninstall:
- @echo "Removing Libpri"
-- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.so.1.0
-- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.so
-- rm -f $(INSTALL_PREFIX)/usr/lib/libpri.a
-- rm -f $(INSTALL_PREFIX)/usr/include/libpri.h
-+ rm -f $(INSTALL_PREFIX)/lib/libpri.so.1
-+ rm -f $(INSTALL_PREFIX)/lib/libpri.so
-+ rm -f $(INSTALL_PREFIX)/lib/libpri.a
-+ rm -f $(INSTALL_PREFIX)/include/libpri.h
-
- pritest: pritest.o
- $(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS)
-@@ -101,11 +99,11 @@
+@@ -130,7 +129,6 @@
$(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
- $(CC) -shared -Wl,-soname,libpri.so.1 -o $@ $(DYNAMIC_OBJS)
-- /sbin/ldconfig $(LDCONFIG_FLAGS) .
-+ #/sbin/ldconfig $(LDCONFIG_FLAGS) .
+ $(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
+- $(LDCONFIG) $(LDCONFIG_FLAGS) .
ln -sf libpri.so.1 libpri.so
+ $(SOSLINK)
- clean:
-- rm -f *.o *.so *.lo *.so.1 *.so.1.0
-+ rm -f *.o *.so *.lo *.so.1
- rm -f testpri testprilib $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
- rm -f pritest pridump
- rm -f .depend
diff --git a/misc/libpri2/files/patch-mkdep b/misc/libpri2/files/patch-mkdep
new file mode 100644
index 0000000..3d8849b8
--- /dev/null
+++ b/misc/libpri2/files/patch-mkdep
@@ -0,0 +1,8 @@
+--- mkdep.orig Wed Nov 30 22:55:54 2005
++++ mkdep Wed Nov 30 22:56:00 2005
+@@ -1,4 +1,4 @@
+-#!/bin/bash -
++#!/bin/sh -
+ #
+ # $OpenBSD: mkdep.gcc.sh,v 1.8 1998/09/02 06:40:07 deraadt Exp $
+ # $NetBSD: mkdep.gcc.sh,v 1.9 1994/12/23 07:34:59 jtc Exp $
diff --git a/net/asterisk-bristuff/Makefile b/net/asterisk-bristuff/Makefile
index 276aa57..3cfbf7e 100644
--- a/net/asterisk-bristuff/Makefile
+++ b/net/asterisk-bristuff/Makefile
@@ -6,30 +6,24 @@
#
PORTNAME= asterisk
-PORTVERSION= 1.0.9
-PORTREVISION= 2
+PORTVERSION= 1.2.1
CATEGORIES= net
MASTER_SITES= http://ftp.digium.com/pub/asterisk/ \
http://ftp.digium.com/pub/asterisk/old-releases/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/old-releases/
-PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
-PATCH_SITES= ${MASTER_SITE_LOCAL}
-PATCH_SITE_SUBDIR= fjoe
-PATCH_DIST_STRIP= -p1
-
MAINTAINER= sobomax@FreeBSD.org
COMMENT= An Open Source PBX and telephony toolkit
BUILD_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
LIB_DEPENDS= speex.3:${PORTSDIR}/audio/speex \
- newt.51:${PORTSDIR}/devel/newt
+ newt.51:${PORTSDIR}/devel/newt \
+ curl.3:${PORTSDIR}/ftp/curl
RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
ONLY_FOR_ARCHS= i386 sparc64 amd64
-BRIVER= bristuff-0.2.0-RC8h
GNU_CONFIGURE= yes
CONFIGURE_WRKSRC= ${WRKSRC}/editline
USE_GMAKE= yes
@@ -44,7 +38,7 @@ MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
OSVERSION=${OSVERSION} \
CXX="${CXX}"
-MAN8= asterisk.8
+MAN8= asterisk.8 astgenkey.8 autosupport.8 safe_asterisk.8
.include <bsd.port.pre.mk>
@@ -68,8 +62,9 @@ MAKE_ENV+= WITH_H323=1
.if defined(WITHOUT_ZAPTEL)
PLIST_SUB+= WITH_ZAPTEL="@comment "
.else
+BUILD_DEPENDS+= libpri>=1.2.0:${PORTSDIR}/misc/libpri \
+ ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
LIB_DEPENDS+= pri.1:${PORTSDIR}/misc/libpri
-BUILD_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
RUN_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
PLIST_SUB+= WITH_ZAPTEL=""
MAKE_ENV+= WITH_ZAPTEL=1
@@ -86,10 +81,6 @@ PLIST_SUB+= WITH_ODBC=""
MAKE_ENV+= WITH_ODBC=1
.endif
-.if !defined(WITHOUT_MYSQL)
-USE_MYSQL= yes
-.endif
-
.if defined(WITHOUT_FAX)
PLIST_SUB+= WITH_FAX="@comment "
.else
@@ -99,7 +90,6 @@ PLIST_SUB+= WITH_FAX=""
.endif
post-patch:
- ${CP} ${FILESDIR}/chan_oss.c ${WRKSRC}/channels
${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample
.include <bsd.port.post.mk>
diff --git a/net/asterisk-bristuff/distinfo b/net/asterisk-bristuff/distinfo
index 9ef6daa..9d56959 100644
--- a/net/asterisk-bristuff/distinfo
+++ b/net/asterisk-bristuff/distinfo
@@ -1,4 +1,3 @@
-MD5 (asterisk-1.0.9.tar.gz) = 0d7f1c680ae53a739f26a069ef8b580a
-SIZE (asterisk-1.0.9.tar.gz) = 9604582
-MD5 (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 42172c5b04af9080f22b883296c34002
-SIZE (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 56589
+MD5 (asterisk-1.2.1.tar.gz) = 04657086791e80f319c0d728af705001
+SHA256 (asterisk-1.2.1.tar.gz) = f0d3ed36353c1f5726225d2794bea7d1d1a92c9e58336b02b293f43dd4b97948
+SIZE (asterisk-1.2.1.tar.gz) = 10517194
diff --git a/net/asterisk-bristuff/files/chan_oss.c b/net/asterisk-bristuff/files/chan_oss.c
deleted file mode 100644
index 95a9236..0000000
--- a/net/asterisk-bristuff/files/chan_oss.c
+++ /dev/null
@@ -1,1327 +0,0 @@
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * Copyright (C) 1999, Mark Spencer
- *
- * Mark Spencer <markster@linux-support.net>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- *
- * FreeBSD changes and multiple device support by Luigi Rizzo, 2005.05.02
- * note-this code best seen with ts=8 (8-spaces tabs) in the editor
- */
-
-#include <asterisk/lock.h>
-#include <asterisk/frame.h>
-#include <asterisk/logger.h>
-#include <asterisk/channel.h>
-#include <asterisk/module.h>
-#include <asterisk/channel_pvt.h>
-#include <asterisk/options.h>
-#include <asterisk/pbx.h>
-#include <asterisk/config.h>
-#include <asterisk/cli.h>
-#include <asterisk/utils.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h> /* for isalnum */
-#ifdef __linux
-#include <linux/soundcard.h>
-#elif defined(__FreeBSD__)
-#include <sys/soundcard.h>
-#else
-#include <soundcard.h>
-#endif
-#include "busy.h"
-#include "ringtone.h"
-#include "ring10.h"
-#include "answer.h"
-
-/*
- * Helper macros to parse config arguments. They will go in a common
- * header file if their usage is globally accepted. In the meantime,
- * we define them here. Typical usage is as below, WITHOUT ; on each line.
- *
- * {
- * M_START(v->name, v->value)
- *
- * M_BOOL("dothis", x->flag1)
- * M_STR("name", x->somestring)
- * M_F("bar", some_c_code)
- * M_END(some_final_statement)
- */
-#define M_START(var, val) \
- char *__s = var; char *__val = val;
-#define M_END(x) x;
-#define M_F(tag, f) if (!strcasecmp((__s), tag)) { f; } else
-#define M_BOOL(tag, dst) M_F(tag, (dst) = ast_true(__val) )
-#define M_UINT(tag, dst) M_F(tag, (dst) = strtoul(__val, NULL, 0) )
-#define M_STR(tag, dst) M_F(tag, strncpy(dst, __val, sizeof(dst) - 1) )
-
-
-/* Which device to use */
-#if defined( __OpenBSD__ ) || defined( __NetBSD__ )
-#define DEV_DSP "/dev/audio"
-#else
-#define DEV_DSP "/dev/dsp"
-#endif
-
-/*
- * Basic mode of operation:
- *
- * we have one keyboard (which receives commands from the keyboard)
- * and multiple headset's connected to audio cards. Headsets are named as
- * the sections of oss.conf
- *
- * At any time, the keyboard is attached to one headset, and you
- * can switch among them using the 'console' command.
- *
- * The following parameters are important for the configuration of
- * the device:
- *
- * FRAME_SIZE the size of an audio frame, in samples.
- * 160 is used almost universally, so you should not change it.
- *
- * FRAGS the argument for the SETFRAGMENT ioctl.
- * Overridden by the 'frags' parameter in oss.conf
- *
- * Bits 0-7 are the base-2 log of the device's block size,
- * bits 16-31 are the number of blocks in the driver's queue.
- * There are a lot of differences in the way this parameter
- * is supported by different drivers, so you may need to
- * experiment a bit with the value.
- * A good default for linux is 30 blocks of 64 bytes, which
- * results in 6 frames of 320 bytes (160 samples).
- * FreeBSD works decently with blocks of 256 or 512 bytes,
- * leaving the number unspecified.
- * Note that this only refers to the device buffer size,
- * this module will then try to keep the lenght of audio
- * buffered within small constraints.
- *
- * QUEUE_SIZE The max number of blocks actually allowed in the device
- * driver's buffer, irrespective of the available number.
- * Overridden by the 'queuesize' parameter in oss.conf
- *
- * Should be >=2, and at most as large as the hw queue above
- * (otherwise it will never be full).
- */
-
-#define FRAME_SIZE 160
-#define QUEUE_SIZE 10
-
-#if defined(__FreeBSD__)
-#define FRAGS 0x8
-#else
-#define FRAGS ( ( (6 * 5) << 16 ) | 0x6 )
-#endif
-
-
-/* Don't switch between read/write modes faster than every 300 ms */
-#define MIN_SWITCH_TIME 300
-
-
-static int usecnt;
-AST_MUTEX_DEFINE_STATIC(usecnt_lock);
-
-static char *desc = "OSS Console Channel Driver";
-static char *tdesc = "OSS Console Channel Driver";
-static char *config = "oss.conf"; /* default config file */
-
-static int oss_debug;
-
-/*
- * Each sound is made of 'datalen' samples of sound, repeated as needed to
- * generate 'samplen' samples of data, then followed by 'silencelen' samples
- * of silence. The loop is repeated if 'repeat' is set.
- */
-struct sound {
- int ind;
- char *desc;
- short *data;
- int datalen;
- int samplen;
- int silencelen;
- int repeat;
-};
-
-static struct sound sounds[] = {
- { AST_CONTROL_RINGING, "RINGING", ringtone, sizeof(ringtone)/2, 16000, 32000, 1 },
- { AST_CONTROL_BUSY, "BUSY", busy, sizeof(busy)/2, 4000, 4000, 1 },
- { AST_CONTROL_CONGESTION, "CONGESTION", busy, sizeof(busy)/2, 2000, 2000, 1 },
- { AST_CONTROL_RING, "RING10", ring10, sizeof(ring10)/2, 16000, 32000, 1 },
- { AST_CONTROL_ANSWER, "ANSWER", answer, sizeof(answer)/2, 2200, 0, 0 },
- { -1, NULL, 0, 0, 0, 0 }, /* end marker */
-};
-
-
-/*
- * descriptor for one of our channels.
- * There is one used for 'default' values (from the [general] entry in
- * the configuration file, and then one instance for each device
- * (the default is cloned from [general], others are only created
- * if the relevant section exists.
- */
-struct chan_oss_pvt {
- struct chan_oss_pvt *next;
-
- char *type;
- char *name;
- /*
- * cursound indicates which in struct sound we play. -1 means nothing,
- * any other value is a valid sound, in which case sampsent indicates
- * the next sample to send in [0..samplen + silencelen]
- * nosound is set to disable the audio data from the channel
- * (so we can play the tones etc.).
- */
- int sndcmd[2]; /* Sound command pipe */
- int cursound; /* index of sound to send */
- int sampsent; /* # of sound samples sent */
- int nosound; /* set to block audio from the PBX */
-
- int total_blocks; /* total blocks in the output device */
- int sounddev;
- enum { M_UNSET, M_FULL, M_READ, M_WRITE } duplex;
- int autoanswer;
- int autohangup;
- int hookstate;
- struct timeval lasttime; /* last setformat */
- char *mixer_cmd; /* initial command to issue to the mixer */
- unsigned int queuesize; /* max fragments in queue */
- unsigned int frags; /* parameter for SETFRAGMENT */
-
- int warned; /* various flags used for warnings */
-#define WARN_used_blocks 1
-#define WARN_speed 2
-#define WARN_frag 4
- int w_errors; /* overfull in the write path */
-
- int silencesuppression;
- int silencethreshold;
- int playbackonly;
- char device[64]; /* device to open */
-
- pthread_t sthread;
-
- struct ast_channel *owner;
- char ext[AST_MAX_EXTENSION];
- char ctx[AST_MAX_EXTENSION];
- char language[MAX_LANGUAGE];
-
- /* buffers used in oss_write */
- char oss_write_buf[FRAME_SIZE*2];
- int oss_write_dst;
- /* buffers used in oss_read - AST_FRIENDLY_OFFSET space for headers
- * plus enough room for a full frame
- */
- char oss_read_buf[FRAME_SIZE * 2 + AST_FRIENDLY_OFFSET];
- int readpos; /* read position above */
- struct ast_frame read_f; /* returned by oss_read */
-};
-
-static struct chan_oss_pvt oss_default = {
- .type = "Console",
- .cursound = -1,
- .sounddev = -1,
- .duplex = M_UNSET, /* XXX check this */
- .autoanswer = 1,
- .autohangup = 1,
- .queuesize = QUEUE_SIZE,
- .frags = FRAGS,
- .silencethreshold = 1000, /* currently unused */
- .ext = "s",
- .ctx = "default",
- .readpos = AST_FRIENDLY_OFFSET, /* start here on reads */
-};
-
-static char *oss_active; /* the active device */
-
-/*
- * returns true if too early to switch
- */
-static int too_early(struct chan_oss_pvt *o)
-{
- struct timeval tv;
- int ms;
- gettimeofday(&tv, NULL);
- ms = (tv.tv_sec - o->lasttime.tv_sec) * 1000 +
- (tv.tv_usec - o->lasttime.tv_usec) / 1000;
- if (ms < MIN_SWITCH_TIME)
- return -1;
- return 0;
-}
-
-/*
- * Returns the number of blocks used in the audio output channel
- */
-static int used_blocks(struct chan_oss_pvt *o)
-{
- struct audio_buf_info info;
-
- if (ioctl(o->sounddev, SNDCTL_DSP_GETOSPACE, &info)) {
- if (! (o->warned & WARN_used_blocks)) {
- ast_log(LOG_WARNING, "Error reading output space\n");
- o->warned |= WARN_used_blocks;
- }
- return 1;
- }
- if (o->total_blocks == 0) {
- if (0) /* debugging */
- ast_log(LOG_WARNING, "fragtotal %d size %d avail %d\n",
- info.fragstotal,
- info.fragsize,
- info.fragments);
- o->total_blocks = info.fragments;
- }
- return o->total_blocks - info.fragments;
-}
-
-static int soundcard_writeframe(struct chan_oss_pvt *o, short *data)
-{
- /* Write an exactly FRAME_SIZE sized frame */
- int res;
-
- /*
- * Nothing complex to manage the audio device queue.
- * If the buffer is full just drop the extra, otherwise write.
- * XXX in some cases it might be useful to write anyways after
- * a number of failures, to restart the output chain.
- */
- res = used_blocks(o);
- if (res > o->queuesize) { /* no room to write a block */
- if (o->w_errors++ == 0 && (oss_debug & 0x4))
- ast_log(LOG_WARNING, "write: used %d blocks (%d)\n",
- res, o->w_errors);
- return 0;
- }
- o->w_errors = 0;
- res = write(o->sounddev, ((void *)data), FRAME_SIZE * 2);
- return res;
-}
-
-/*
- * handler for 'sound writable' events from the sound thread.
- * Builds a frame from the high level description of the sounds,
- * and passes it to the audio device.
- * The actual sound is made of 1 or more sequences of sound samples
- * (s->datalen, repeated to make s->samplen samples) followed by
- * s->silencelen samples of silence. The position in the sequence is stored
- * in o->sampsent, which goes between 0 .. s->samplen+s->silencelen.
- * In case we fail to write a frame, don't update o->sampsent.
- */
-static void send_sound(struct chan_oss_pvt *o)
-{
- short myframe[FRAME_SIZE];
- int ofs, l, start;
- int l_sampsent = o->sampsent;
- struct sound *s;
-
- if (o->cursound < 0) /* no sound to send */
- return;
- s = &sounds[o->cursound];
- for (ofs = 0; ofs < FRAME_SIZE; ofs += l) {
- l = s->samplen - l_sampsent; /* sound available */
- if (l > 0) {
- start = l_sampsent % s->datalen; /* source offset */
- if (l > FRAME_SIZE - ofs) /* don't overflow the frame */
- l = FRAME_SIZE - ofs;
- if (l > s->datalen - start) /* don't overflow the source */
- l = s->datalen - start;
- bcopy(s->data + start, myframe + ofs, l*2);
- if (0)
- ast_log(LOG_WARNING, "send_sound sound %d/%d of %d into %d\n",
- l_sampsent, l, s->samplen, ofs);
- l_sampsent += l;
- } else { /* no sound, maybe some silence */
- static short silence[FRAME_SIZE] = {0, };
-
- l += s->silencelen;
- if (l > 0) {
- if (l > FRAME_SIZE - ofs)
- l = FRAME_SIZE - ofs;
- bcopy(silence, myframe + ofs, l*2);
- l_sampsent += l;
- } else { /* silence is over, restart sound if loop */
- if (s->repeat == 0) { /* last block */
- o->cursound = -1;
- o->nosound = 0; /* allow audio data */
- if (ofs < FRAME_SIZE) /* pad with silence */
- bcopy(silence, myframe + ofs, (FRAME_SIZE - ofs)*2);
- }
- l_sampsent = 0;
- }
- }
- }
- l = soundcard_writeframe(o, myframe);
- if (l > 0)
- o->sampsent = l_sampsent; /* update status */
-}
-
-static void *sound_thread(void *arg)
-{
- char ign[4096];
- struct chan_oss_pvt *o = (struct chan_oss_pvt *)arg;
-
- /* kick the driver by trying to read from it. Ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- for(;;) {
- fd_set rfds, wfds;
- int maxfd, res;
-
- FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- maxfd = o->sndcmd[0]; /* pipe from the main process */
- FD_SET(o->sndcmd[0], &rfds);
- if (!o->owner) { /* no one owns the audio, so we must drain it */
- FD_SET(o->sounddev, &rfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- if (o->cursound > -1) {
- FD_SET(o->sounddev, &wfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- /* ast_select emulates linux behaviour in terms of timeout handling */
- res = ast_select(maxfd + 1, &rfds, &wfds, NULL, NULL);
- if (res < 1) {
- ast_log(LOG_WARNING, "select failed: %s\n",
- strerror(errno));
- continue;
- }
- if (FD_ISSET(o->sndcmd[0], &rfds)) {
- /* read which sound to play from the pipe */
- int i, what = -1;
-
- read(o->sndcmd[0], &what, sizeof(what));
- for (i = 0; sounds[i].ind != -1; i++) {
- if (sounds[i].ind == what) {
- o->cursound = i;
- o->sampsent = 0;
- o->nosound = 1; /* block audio from pbx */
- break;
- }
- }
- if (sounds[i].ind == -1)
- ast_log(LOG_WARNING, "invalid sound index: %d\n", what);
- }
- if (FD_ISSET(o->sounddev, &rfds)) { /* read and ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- }
- if (FD_ISSET(o->sounddev, &wfds))
- send_sound(o);
- }
- /* Never reached */
- return NULL;
-}
-
-/*
- * reset and close the device if opened,
- * then open and initialize it in the desired mode,
- * trigger reads and writes so we can start using it.
- */
-static int setformat(struct chan_oss_pvt *o, int mode)
-{
- int fmt, desired, res, fd;
-
- if (o->sounddev >= 0) {
- ioctl(o->sounddev, SNDCTL_DSP_RESET, 0);
- close(o->sounddev);
- o->duplex = M_UNSET;
- }
- fd = o->sounddev = open(o->device, mode |O_NONBLOCK);
- if (o->sounddev < 0) {
- ast_log(LOG_WARNING, "Unable to re-open DSP device: %s\n",
- strerror(errno));
- return -1;
- }
-
- gettimeofday(&o->lasttime, NULL);
- fmt = AFMT_S16_LE;
- res = ioctl(fd, SNDCTL_DSP_SETFMT, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set format to 16-bit signed\n");
- return -1;
- }
- switch (mode) {
- case O_RDWR:
- res = ioctl(fd, SNDCTL_DSP_SETDUPLEX, 0);
- /* Check to see if duplex set (FreeBSD Bug)*/
- res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt);
- if (res == 0 && (fmt & DSP_CAP_DUPLEX)) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Console is full duplex\n");
- o->duplex = M_FULL;
- };
- break;
- case O_WRONLY:
- o->duplex = M_WRITE;
- break;
- case O_RDONLY:
- o->duplex = M_READ;
- break;
- }
-
- fmt = 0;
- res = ioctl(fd, SNDCTL_DSP_STEREO, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- /* 8000 Hz desired */
- desired = 8000;
- fmt = desired;
- res = ioctl(fd, SNDCTL_DSP_SPEED, &fmt);
-
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- if (fmt != desired) {
- if (!(o->warned & WARN_speed)) {
- ast_log(LOG_WARNING,
- "Requested %d Hz, got %d Hz -- sound may be choppy\n",
- desired, fmt);
- o->warned |= WARN_speed;
- }
- }
- /*
- * on Freebsd, SETFRAGMENT does not work very well on some cards.
- * Default to use 256 bytes, let the user override
- */
- if (o->frags) {
- fmt = o->frags;
- res = ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &fmt);
- if (res < 0) {
- if (!(o->warned & WARN_frag)) {
- ast_log(LOG_WARNING,
- "Unable to set fragment size -- sound may be choppy\n");
- o->warned |= WARN_frag;
- }
- }
- }
- /* XXX on some cards, we need SNDCTL_DSP_SETTRIGGER to start outputting */
- res = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT;
- res = ioctl(fd, SNDCTL_DSP_SETTRIGGER, &res);
- /* it may fail if we are in half duplex, never mind */
- return 0;
-}
-
-/*
- * make sure output mode is available. Returns 0 if done,
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setoutput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_WRITE && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_WRONLY))
- return -1;
- return 0;
-}
-
-/*
- * make sure input mode is available. Returns 0 if done
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setinput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_READ && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_RDONLY))
- return -1;
- return 0;
-}
-
-/*
- * some of the standard methods supported by channels.
- */
-static int oss_digit(struct ast_channel *c, char digit)
-{
- /* no better use for received digits than print them */
- ast_verbose( " << Console Received digit %c >> \n", digit);
- return 0;
-}
-
-static int oss_text(struct ast_channel *c, char *text)
-{
- /* print received messages */
- ast_verbose( " << Console Received text %s >> \n", text);
- return 0;
-}
-
-/* Play ringtone 'x' on device 'o' */
-#define RING(o, x) { int what = x; write((o)->sndcmd[1], &what, sizeof(what)); }
-
-/*
- * handler for incoming calls. Either autoanswer, or start ringing
- */
-static int oss_call(struct ast_channel *c, char *dest, int timeout)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame f = { 0, };
-
- ast_verbose( " << Call placed to '%s' on console >> \n", dest);
- if (o->autoanswer) {
- ast_verbose( " << Auto-answered >> \n" );
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_ANSWER;
- ast_queue_frame(c, &f);
- } else {
- ast_verbose(" << Type 'answer' to answer, or use 'autoanswer' for future calls >> \n");
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_RINGING;
- ast_queue_frame(c, &f);
- RING(o, AST_CONTROL_RING);
- }
- return 0;
-}
-
-/*
- * remote side answered the phone
- */
-static int oss_answer(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- ast_verbose( " << Console call has been answered >> \n");
-#if 0
- /* play an answer tone (XXX do we really need it ?) */
- RING(o, AST_CONTROL_ANSWER);
-#endif
- ast_setstate(c, AST_STATE_UP);
- o->cursound = -1;
- o->nosound=0;
- return 0;
-}
-
-static int oss_hangup(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- o->cursound = -1;
- c->pvt->pvt = NULL;
- o->owner = NULL;
- ast_verbose( " << Hangup on console >> \n");
- ast_mutex_lock(&usecnt_lock); /* XXX not sure why */
- usecnt--;
- ast_mutex_unlock(&usecnt_lock);
- if (o->hookstate) {
- if (o->autoanswer || o->autohangup) {
- /* Assume auto-hangup too */
- o->hookstate = 0;
- } else {
- /* Make congestion noise */
- RING(o, AST_CONTROL_CONGESTION);
- }
- }
- return 0;
-}
-
-/* used for data coming from the network */
-static int oss_write(struct ast_channel *c, struct ast_frame *f)
-{
- int res;
- int src;
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- /* Immediately return if no sound is enabled */
- if (o->nosound)
- return 0;
- /* Stop any currently playing sound */
- o->cursound = -1;
- if (o->duplex != M_FULL && !o->playbackonly) {
- /* XXX check this, looks weird! */
- /* If we're half duplex, we have to switch to read mode
- to honor immediate needs if necessary */
- res = soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set device to input mode\n");
- return -1;
- }
- return 0;
- }
- res = soundcard_setoutput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set output device\n");
- return -1;
- } else if (res > 0) {
- /* The device is still in read mode, and it's too soon to change it,
- so just pretend we wrote it */
- return 0;
- }
- /*
- * we could receive a sample which is not a multiple of our FRAME_SIZE,
- * so we buffer it locally and write to the device in FRAME_SIZE
- * chunks, keeping the residue stored for future use.
- */
- src = 0; /* read position into f->data */
- while ( src < f->datalen ) {
- /* Compute spare room in the buffer */
- int l = sizeof(o->oss_write_buf) - o->oss_write_dst;
-
- if (f->datalen - src >= l) { /* enough to fill a frame */
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- soundcard_writeframe(o, (short *)o->oss_write_buf);
- src += l;
- o->oss_write_dst = 0;
- } else { /* copy residue */
- l = f->datalen - src;
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- src += l; /* but really, we are done */
- o->oss_write_dst += l;
- }
- }
- return 0;
-}
-
-static struct ast_frame *oss_read(struct ast_channel *c)
-{
- int res;
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame *f = &o->read_f;
-
- /* prepare a NULL frame in case we don't have enough data to return */
- bzero(f, sizeof(struct ast_frame));
- f->frametype = AST_FRAME_NULL;
- f->src = o->type;
-
- res = soundcard_setinput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set input mode\n");
- return NULL;
- } else if (res > 0) { /* too early to switch ? */
- /* Theoretically shouldn't happen, but anyway, return a NULL frame */
- return f;
- }
-
- res = read(o->sounddev, o->oss_read_buf + o->readpos,
- sizeof(o->oss_read_buf) - o->readpos);
- if (res < 0) /* audio data not ready, return a NULL frame */
- return f;
-
- o->readpos += res;
- if (o->readpos < sizeof(o->oss_read_buf)) /* not enough samples */
- return f;
-
- o->readpos = AST_FRIENDLY_OFFSET; /* reset read pointer for next frame */
- if (c->_state != AST_STATE_UP) /* drop data if frame is not up */
- return f;
- /* ok we can build and deliver the frame to the caller */
- f->frametype = AST_FRAME_VOICE;
- f->subclass = AST_FORMAT_SLINEAR;
- f->samples = FRAME_SIZE;
- f->datalen = FRAME_SIZE * 2;
- f->data = o->oss_read_buf + AST_FRIENDLY_OFFSET;
- f->offset = AST_FRIENDLY_OFFSET;
- return f;
-}
-
-static int oss_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
-{
- struct chan_oss_pvt *o = newchan->pvt->pvt;
- o->owner = newchan;
- return 0;
-}
-
-static int oss_indicate(struct ast_channel *c, int cond)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- int res;
-
- switch(cond) {
- case AST_CONTROL_BUSY:
- case AST_CONTROL_CONGESTION:
- case AST_CONTROL_RINGING:
- res = cond;
- break;
- case -1:
- o->cursound = -1;
- return 0;
- default:
- ast_log(LOG_WARNING,
- "Don't know how to display condition %d on %s\n",
- cond, c->name);
- return -1;
- }
- if (res > -1)
- RING(o, res);
- return 0;
-}
-
-static struct ast_channel *oss_new(struct chan_oss_pvt *o,
- char *ext, char *ctx, int state)
-{
- struct ast_channel *c;
- struct ast_channel_pvt *pvt;
-
- c = ast_channel_alloc(1);
- if (c == NULL)
- return NULL;
- snprintf(c->name, sizeof(c->name), "OSS/%s", o->device + 5);
- c->type = o->type;
- c->fds[0] = o->sounddev;
- c->nativeformats = AST_FORMAT_SLINEAR;
- pvt = c->pvt;
- pvt->pvt = o;
-
- /* relevant callbacks */
- pvt->send_digit = oss_digit;
- pvt->send_text = oss_text;
- pvt->hangup = oss_hangup;
- pvt->answer = oss_answer;
- pvt->read = oss_read;
- pvt->call = oss_call;
- pvt->write = oss_write;
- pvt->indicate = oss_indicate;
- pvt->fixup = oss_fixup;
-
-#define S_OVERRIDE(dst, src) \
- { if (src && src[0] != '\0') /* non-empty string */ \
- strncpy((dst), src, sizeof(dst)-1); }
- S_OVERRIDE(c->context, ctx);
- S_OVERRIDE(c->exten, ext);
- S_OVERRIDE(c->language, o->language);
- o->owner = c;
- ast_setstate(c, state);
- ast_mutex_lock(&usecnt_lock);
- usecnt++;
- ast_mutex_unlock(&usecnt_lock);
- ast_update_use_count();
- if (state != AST_STATE_DOWN) {
- if (ast_pbx_start(c)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", c->name);
- ast_hangup(c);
- o->owner = c = NULL;
- /* XXX what about the channel itself ? */
- /* XXX what about usecnt ? */
- }
- }
- return c;
-}
-
-/*
- * returns a pointer to the descriptor with the given name
- */
-static struct chan_oss_pvt *find_desc(char *dev)
-{
- struct chan_oss_pvt *o;
-
- for (o = oss_default.next; o && strcmp(o->name, dev) != 0; o = o->next)
- ;
- if (o == NULL)
- ast_log(LOG_WARNING, "%s could not find <%s>\n", __func__, dev);
- return o;
-}
-
-static struct ast_channel *oss_request(char *type, int format, void *data)
-{
- struct ast_channel *c;
- struct chan_oss_pvt *o = find_desc(data);
-
- ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n",
- type, data, (char *)data);
- if (o == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data);
- /* XXX we could default to 'dsp' perhaps ? */
- return NULL;
- }
- if ((format & AST_FORMAT_SLINEAR) == 0) {
- ast_log(LOG_NOTICE, "Format 0x%x unsupported\n", format);
- return NULL;
- }
- if (o->owner) {
- ast_log(LOG_NOTICE, "Already have a call on the OSS channel\n");
- return NULL;
- }
- c= oss_new(o, NULL, NULL, AST_STATE_DOWN);
- if (c == NULL) {
- ast_log(LOG_WARNING, "Unable to create new OSS channel\n");
- return NULL;
- }
- return c;
-}
-
-static int console_autoanswer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o == NULL) {
- ast_log(LOG_WARNING, "Cannot find device %s (should not happen!)\n",
- oss_active);
- return RESULT_FAILURE;
- }
- if (argc == 1) {
- ast_cli(fd, "Auto answer is %s.\n", o->autoanswer ? "on" : "off");
- return RESULT_SUCCESS;
- }
- if (!strcasecmp(argv[1], "on"))
- o->autoanswer = -1;
- else if (!strcasecmp(argv[1], "off"))
- o->autoanswer = 0;
- else
- return RESULT_SHOWUSAGE;
- return RESULT_SUCCESS;
-}
-
-static char *autoanswer_complete(char *line, char *word, int pos, int state)
-{
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
- int l = strlen(word);
-
- switch(state) {
- case 0:
- if (l && !strncasecmp(word, "on", MIN(l, 2)))
- return strdup("on");
- case 1:
- if (l && !strncasecmp(word, "off", MIN(l, 3)))
- return strdup("off");
- default:
- return NULL;
- }
- return NULL;
-}
-
-static char autoanswer_usage[] =
-"Usage: autoanswer [on|off]\n"
-" Enables or disables autoanswer feature. If used without\n"
-" argument, displays the current on/off status of autoanswer.\n"
-" The default value of autoanswer is in 'oss.conf'.\n";
-
-/*
- * answer command from the console
- */
-static int console_answer(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 1;
- o->cursound = -1;
- ast_queue_frame(o->owner, &f);
- RING(o, AST_CONTROL_ANSWER);
- return RESULT_SUCCESS;
-}
-
-static char sendtext_usage[] =
-"Usage: send text <message>\n"
-" Sends a text message for display on the remote terminal.\n";
-
-static int console_sendtext(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- int tmparg = 2;
- char text2send[256] = "";
- struct ast_frame f = { 0, };
-
- if (argc < 2)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- if (strlen(text2send))
- ast_cli(fd, "Warning: message already waiting to be sent, overwriting\n");
- text2send[0] = '\0';
- while(tmparg < argc) {
- strncat(text2send, argv[tmparg++], sizeof(text2send) - strlen(text2send) - 1);
- strncat(text2send, " ", sizeof(text2send) - strlen(text2send) - 1);
- }
- if (strlen(text2send)) {
- f.frametype = AST_FRAME_TEXT;
- f.subclass = 0;
- f.data = text2send;
- f.datalen = strlen(text2send);
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-static char answer_usage[] =
-"Usage: answer\n"
-" Answers an incoming call on the console (OSS) channel.\n";
-
-static int console_hangup(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner && !o->hookstate) {
- ast_cli(fd, "No call to hangup up\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) {
- ast_queue_hangup(o->owner);
- }
- return RESULT_SUCCESS;
-}
-
-static char hangup_usage[] =
-"Usage: hangup\n"
-" Hangs up any call currently placed on the console.\n";
-
-
-static int console_flash(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_FLASH };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner) { /* XXX maybe !o->hookstate too ? */
- ast_cli(fd, "No call to flash\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) { /* XXX must be true, right ? */
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-
-static char flash_usage[] =
-"Usage: flash\n"
-" Flashes the call currently placed on the console.\n";
-
-
-
-static int console_dial(int fd, int argc, char *argv[])
-{
- char *tmp = NULL, *mye = NULL, *myc = NULL;
- int i;
- struct ast_frame f = { AST_FRAME_DTMF, 0 };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o->owner) { /* already in a call */
- if (argc == 1) { /* argument is mandatory here */
- ast_cli(fd, "Already in a call. You can only dial digits until you hangup.\n");
- return RESULT_FAILURE;
- }
- mye = argv[1];
- /* send the string one char at a time */
- for (i=0; i<strlen(mye); i++) {
- f.subclass = mye[i];
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
- }
- /* if we have an argument split it into extension and context */
-
- if (argc == 2) {
- tmp = myc = strdup(argv[1]); /* make a writable copy */
- mye = strsep(&myc, "@"); /* set exten, advance to context */
- myc = strsep(&myc, "@"); /* set context */
- }
- /* supply default values if needed */
- if (mye == NULL)
- mye = o->ext;
- if (myc == NULL)
- myc = o->ctx;
- if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
- o->hookstate = 1;
- oss_new(o, mye, myc, AST_STATE_RINGING);
- } else
- ast_cli(fd, "No such extension '%s' in context '%s'\n", mye, myc);
- return RESULT_SUCCESS;
-}
-
-static char dial_usage[] =
-"Usage: dial [extension[@context]]\n"
-" Dials a given extensison (and context if specified)\n";
-
-static int console_transfer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- struct ast_channel *b = NULL;
- char *ext, *ctx;
-
- if (argc != 2)
- return RESULT_SHOWUSAGE;
- if (o == NULL)
- return RESULT_FAILURE;
- if (o->owner == NULL || (b = o->owner->bridge) == NULL) {
- ast_cli(fd, "There is no call to transfer\n");
- return RESULT_SUCCESS;
- }
-
- ext = ctx = strdup(argv[1]); /* make a writable copy */
- strsep(&ctx, "@"); /* set exten, advance to context */
- ctx = strsep(&ctx, "@"); /* strip trailing @ and the rest */
-
- if (ctx == NULL) /* supply default context if needed */
- ctx = o->owner->context;
- if (!ast_exists_extension(b, ctx, ext, 1, b->callerid)) {
- ast_cli(fd, "No such extension exists\n");
- } else {
- ast_cli(fd, "Whee, transferring %s to %s@%s.\n", b->name, ext, ctx);
- if (ast_async_goto(b, ctx, ext, 1))
- ast_cli(fd, "Failed to transfer :(\n");
- }
- free(ext);
- return RESULT_SUCCESS;
-}
-
-static char transfer_usage[] =
-"Usage: transfer <extension>[@context]\n"
-" Transfers the currently connected call to the given extension (and\n"
-"context if specified)\n";
-
-static int console_active(int fd, int argc, char *argv[])
-{
- if (argc == 1) {
- ast_cli(fd, "active console is [%s]\n", oss_active);
- } else if (argc != 2) {
- return RESULT_SHOWUSAGE;
- } else {
- struct chan_oss_pvt *o;
- if (strcmp(argv[1], "show") == 0) {
- for (o = oss_default.next; o ; o = o->next)
- ast_cli(fd, "device [%s] exists\n", o->name);
- return RESULT_SUCCESS;
- }
- o = find_desc(argv[1]);
- if (o == NULL)
- ast_cli(fd, "No device [%s] exists\n", argv[1]);
- else
- oss_active = o->name;
- }
- return RESULT_SUCCESS;
-}
-
-static struct ast_cli_entry myclis[] = {
- { { "answer", NULL }, console_answer, "Answer an incoming console call", answer_usage },
- { { "hangup", NULL }, console_hangup, "Hangup a call on the console", hangup_usage },
- { { "flash", NULL }, console_flash, "Flash a call on the console", flash_usage },
- { { "dial", NULL }, console_dial, "Dial an extension on the console", dial_usage },
- { { "transfer", NULL }, console_transfer, "Transfer a call to a different extension", transfer_usage },
- { { "send", "text", NULL }, console_sendtext, "Send text to the remote device", sendtext_usage },
- { { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete },
- { { "console", NULL }, console_active, "Sets/displays active console",
- "console foo sets foo as the console"}
-};
-
-/*
- * store the mixer argument from the config file, filtering possibly
- * invalid or dangerous values (the string is used as argument for
- * system("mixer %s")
- */
-static void store_mixer(struct chan_oss_pvt *o, char *s)
-{
- int i;
-
- for (i=0; i < strlen(s); i++) {
- 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;
- }
- }
- if (o->mixer_cmd)
- free(o->mixer_cmd);
- o->mixer_cmd = strdup(s);
- ast_log(LOG_WARNING, "setting mixer %s\n", s);
-}
-
-/*
- * grab fields from the config file, init the descriptor and open the device.
- */
-static struct chan_oss_pvt * store_config(struct ast_config *cfg,
- char *ctg)
-{
- struct ast_variable *v;
- struct chan_oss_pvt *o;
-
- if (ctg == NULL) {
- o = &oss_default;
- o->next = NULL; /* XXX needed ? */
- ctg = "general";
- } else {
- o = (struct chan_oss_pvt *)malloc(sizeof *o);
- if (o == NULL) /* fail */
- return NULL;
- *o = oss_default;
- /* "general" is also the default thing */
- if (strcmp(ctg, "general") == 0) {
- o->name = strdup("dsp");
- oss_active = o->name;
- goto openit;
- }
- o->name = strdup(ctg);
- }
- ast_log(LOG_WARNING, "found category [%s]\n", ctg);
-
- /* fill other fields from configuration */
- v = ast_variable_browse(cfg, ctg);
- while(v) {
- M_START(v->name, v->value);
-
- M_BOOL("autoanswer", o->autoanswer)
- M_BOOL("autohangup", o->autohangup)
- M_BOOL("playbackonly", o->playbackonly)
- M_BOOL("silencesuppression", o->silencesuppression)
- M_UINT("silencethreshold", o->silencethreshold )
- M_STR("device", o->device)
- M_UINT("frags", o->frags)
- M_UINT("debug", oss_debug)
- M_UINT("queuesize", o->queuesize)
- M_STR("context", o->ctx)
- M_STR("language", o->language)
- M_STR("extension", o->ext)
- M_F("mixer", store_mixer(o, v->value))
- M_END(;);
- v=v->next;
- }
- if (!strlen(o->device))
- strncpy(o->device, DEV_DSP, sizeof(o->device)-1);
- if (o->mixer_cmd) {
- char *cmd;
-
- asprintf(&cmd, "mixer %s", o->mixer_cmd);
- ast_log(LOG_WARNING, "running [%s]\n", cmd);
- system(cmd);
- free(cmd);
- }
- if (o == &oss_default) /* we are done with the default */
- return NULL;
-
-openit:
- if (setformat(o, O_RDWR) < 0) { /* open device */
- if (option_verbose > 0) {
- ast_verbose(VERBOSE_PREFIX_2 "Device %s not detected\n", ctg);
- ast_verbose(VERBOSE_PREFIX_2 "Turn off OSS support by adding "
- "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
- }
- goto error;
- }
- soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (o->duplex != M_FULL)
- ast_log(LOG_WARNING, "XXX I don't work right with non "
- "full-duplex sound cards XXX\n");
- if ( pipe(o->sndcmd) != 0 ) {
- ast_log(LOG_ERROR, "Unable to create pipe\n");
- goto error;
- }
- ast_pthread_create(&o->sthread, NULL, sound_thread, o);
- /* link into list of devices */
- if (o != &oss_default) {
- o->next = oss_default.next;
- oss_default.next = o;
- }
- return o;
-
-error:
- if (o != &oss_default)
- free(o);
- return NULL;
-}
-
-int load_module()
-{
- int i;
- struct ast_config *cfg;
-
- /* load config file */
- cfg = ast_load(config);
- if (cfg != NULL) {
- char *ctg;
-
- store_config(cfg, NULL); /* init general category */
- ctg = ast_category_browse(cfg, NULL); /* initial category */
- while (ctg != NULL) {
- store_config(cfg, ctg);
- ctg = ast_category_browse(cfg, ctg);
- }
- ast_destroy(cfg);
- }
- if (find_desc(oss_active) == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", oss_active);
- /* XXX we could default to 'dsp' perhaps ? */
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- i = ast_channel_register(oss_default.type, tdesc,
- AST_FORMAT_SLINEAR, oss_request);
- if (i < 0) {
- ast_log(LOG_ERROR, "Unable to register channel class '%s'\n",
- oss_default.type);
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- for (i=0; i<sizeof(myclis)/sizeof(struct ast_cli_entry); i++)
- ast_cli_register(myclis + i);
- return 0;
-}
-
-
-int unload_module()
-{
- int x;
- struct chan_oss_pvt *o;
-
- /* XXX do we need a ast_channel_unregister oss_request ? */
- for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++)
- ast_cli_unregister(myclis + x);
-
- for (o = oss_default.next; o ; o = o->next) {
- close(o->sounddev);
- if (o->sndcmd[0] > 0) {
- close(o->sndcmd[0]);
- close(o->sndcmd[1]);
- }
- if (o->owner)
- ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD);
- if (o->owner) /* XXX how ??? */
- return -1;
- /* XXX what about the thread ? */
- /* XXX what about the memory allocated ? */
- }
- return 0;
-}
-
-char *description()
-{
- return desc;
-}
-
-int usecount() /* XXX is this per-device or global for the module ? */
-{
- int res;
- ast_mutex_lock(&usecnt_lock);
- res = usecnt;
- ast_mutex_unlock(&usecnt_lock);
- return res;
-}
-
-char *key()
-{
- return ASTERISK_GPL_KEY;
-}
diff --git a/net/asterisk-bristuff/files/patch-Makefile b/net/asterisk-bristuff/files/patch-Makefile
index 49c66ed..16f6b03 100644
--- a/net/asterisk-bristuff/files/patch-Makefile
+++ b/net/asterisk-bristuff/files/patch-Makefile
@@ -3,128 +3,200 @@ $FreeBSD$
--- Makefile.orig
+++ Makefile
-@@ -45,6 +45,19 @@
- PROC=$(shell uname -m)
- endif
-
-+ifeq (${OSARCH},FreeBSD)
-+ifeq ($(PROC),sparc64)
-+PROC=ultrasparc
-+OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
-+OPTIONS+=$(shell if $(CC) -mcpu=v9 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v9"; fi)
-+OPTIONS+=-fomit-frame-pointer
-+endif
-+ifeq ($(PROC),amd64)
-+PROC=k8
-+OPTIONS+=-m64
-+endif
-+endif
-+
- # Pentium Pro Optimize
- #PROC=i686
-
-@@ -63,10 +76,10 @@
+@@ -19,8 +19,8 @@
+ # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
+ # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
+ # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
+-CC=$(CROSS_COMPILE)gcc
+-HOST_CC=gcc
++CC?=$(CROSS_COMPILE)gcc
++HOST_CC=${CC}
+ # CROSS_ARCH=Linux
+ # CROSS_PROC=arm
+ # SUB_PROC=xscale # or maverick
+@@ -44,14 +44,14 @@
#K6OPT = -DK6OPT
- #Tell gcc to optimize the asterisk's code
+ #Tell gcc to optimize the code
-OPTIMIZE+=-O6
+#OPTIMIZE+=-O6
+ endif
- #Include debug symbols in the executables (-g) and profiling info (-pg)
--DEBUG=-g #-pg
-+#DEBUG=-g #-pg
+ #Overwite config files on "make samples"
+-OVERWRITE=y
++OVERWRITE=n
- # If you are running a radio application, define RADIO_RELAX so that the DTMF
- # will be received more reliably
-@@ -91,7 +104,7 @@
+ #Include debug and macro symbols in the executables (-g) and profiling info (-pg)
+-DEBUG=-g3 #-pg
++#DEBUG=-g3 #-pg
+
+ #Set NOCRYPTO to yes if you do not want to have crypto support or
+ #dependencies
+@@ -83,7 +83,7 @@
# Where to install asterisk after compiling
# Default -> leave empty
--INSTALL_PREFIX=
+-INSTALL_PREFIX?=
+INSTALL_PREFIX=$(PREFIX)
# Staging directory
# Files are copied here temporarily during the install process
-@@ -111,23 +124,23 @@
- # Don't use together with -DBUSYDETECT_TONEONLY
+@@ -106,17 +106,17 @@
BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
--ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
--ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
-+ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
-+ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
- ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
--ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
--ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
--ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
-+ASTSPOOLDIR=/var/spool/asterisk
-+ASTLOGDIR=/var/log/asterisk
-+ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
- ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
--ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
--ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
--ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
--ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
-+ASTBINDIR=$(INSTALL_PREFIX)/bin
-+ASTSBINDIR=$(INSTALL_PREFIX)/sbin
-+ASTVARRUNDIR=/var/run
-+ASTMANDIR=$(INSTALL_PREFIX)/man
-
- MODULES_DIR=$(ASTLIBDIR)/modules
- AGI_DIR=$(ASTVARLIBDIR)/agi-bin
-
- INCLUDE=-Iinclude -I../include
--CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
-+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
- CFLAGS+=$(OPTIMIZE)
+ ifneq ($(OSARCH),SunOS)
+- ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
+ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+ MODULES_DIR=$(ASTLIBDIR)/modules
+ AGI_DIR=$(ASTVARLIBDIR)/agi-bin
+ else
+@@ -218,13 +218,13 @@
+ endif
+
+ INCLUDE+=-Iinclude -I../include
+-ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
+-ASTCFLAGS+=$(OPTIMIZE)
++ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
++#ASTCFLAGS+=$(OPTIMIZE)
+ ASTOBJ=-o asterisk
+
+ ifeq ($(findstring BSD,$(OSARCH)),BSD)
+ PROC=$(shell uname -m)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
ifneq ($(PROC),ultrasparc)
-@@ -138,12 +151,8 @@
- CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi)
-
- ifeq (${OSARCH},FreeBSD)
--OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
--CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
--LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
--INCLUDE+=-I/usr/local/include
--CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
--MPG123TARG=freebsd
-+CFLAGS+=$(PTHREAD_CFLAGS)
-+LIBS+=$(PTHREAD_LIBS)
+@@ -235,8 +235,8 @@
+ ASTCFLAGS+=-fsigned-char
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h),)
+- ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/local/include/osp
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h),)
++ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp
+ else
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp
+@@ -245,27 +245,24 @@
+
+ ifeq ($(OSARCH),FreeBSD)
+ BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
+- ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
+- LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
+- ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp
++ ASTCFLAGS+=$(PTHREAD_CFLAGS)
++ LIBS+=$(PTHREAD_LIBS)
++ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp),)
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp
+ endif
+ MPG123TARG=freebsd
+
+- # XXX FreeBSD paths
+- PREFIX?=/usr/local
+- ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
+- ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
++ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
+- # XXX end FreeBSD paths
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+
endif # FreeBSD
- ifeq (${OSARCH},NetBSD)
-@@ -160,7 +169,10 @@
- #CFLAGS+=-DOLD_DSP_ROUTINES
+@@ -281,7 +278,7 @@
- CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
--CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPTEL_OPTIMIZATIONS
-+endif
+ ifeq ($(OSARCH),SunOS)
+ ASTCFLAGS+=-Wcast-align -DSOLARIS
+- INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
++ INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/include
+ endif
- LIBEDIT=editline/libedit.a
+ ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN)
+@@ -296,7 +293,7 @@
-@@ -222,7 +234,7 @@
- SOLINK=-shared -Xlinker -x
+ ifndef WITHOUT_ZAPTEL
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS
+ endif
+
+@@ -323,7 +320,7 @@
+ ASTERISKVERSIONNUM=999999
+ ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name)
+ else
+- ASTERISKVERSIONNUM=000000
++ ASTERISKVERSIONNUM?=000000
+ endif
+ endif
+
+@@ -388,10 +385,10 @@
endif
--CC=gcc
-+CC?=gcc
- INSTALL=install
+ ifeq ($(OSARCH),SunOS)
+- LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ OBJS+=strcompat.o
+ ASTLINK=
+- SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ endif
+
+ ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
+@@ -399,7 +396,7 @@
+ endif
- _all: all
-@@ -234,7 +246,7 @@
+ # This is used when generating the doxygen documentation
+-ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),)
++ifneq ($(wildcard $(LOCALBASE)/bin/dot)$(wildcard /usr/bin/dot),)
+ HAVEDOT=yes
+ else
+ HAVEDOT=no
+@@ -418,7 +415,7 @@
@echo " + $(MAKE) install +"
@echo " +-------------------------------------------+"
--all: depend asterisk subdirs
-+all: depend asterisk subdirs manpage
+-all: cleantest depend asterisk subdirs
++all: cleantest depend asterisk subdirs manpage
- editline/config.h:
- cd editline && unset CFLAGS LIBS && ./configure ; \
-@@ -243,13 +255,13 @@
+ #ifneq ($(wildcard tags),)
+ ctags: tags
+@@ -437,13 +434,13 @@
cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
$(MAKE) -C editline libedit.a
@@ -144,55 +216,57 @@ $FreeBSD$
+# fi
ifneq ($(wildcard .depend),)
- include .depend
-@@ -271,13 +283,10 @@
-
- asterisk.o: asterisk.c build.h
-
--manpage: asterisk.8.gz
-+manpage: asterisk.8
-
--asterisk.8.gz: asterisk.sgml
-- rm -f asterisk.8
-- docbook2man asterisk.sgml
-- mv ./*.8 asterisk.8
-- gzip asterisk.8
-+asterisk.8: asterisk.8.gz
-+ gzcat asterisk.8.gz > asterisk.8
-
- ifneq ($(strip $(ASTERISKVERSION)),)
- build.h: .version
-@@ -295,8 +304,8 @@
- exit 1; \
+ include .depend
+@@ -510,14 +507,14 @@
+ cygwin_a:
+ $(MAKE) -C cygwin all
+
+-asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
++asterisk: $(CYGLOADER) editline/libedit.a stdtime/libtime.a $(OBJS)
+ build_tools/make_build_h > include/asterisk/build.h.tmp
+ if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
+ mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
fi
-
--asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
-- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
-+asterisk: editline/libedit.a stdtime/libtime.a $(OBJS)
-+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) stdtime/libtime.a $(LIBS)
+ rm -f include/asterisk/build.h.tmp
+ $(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
+- $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
++ $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) stdtime/libtime.a $(LIBS)
muted: muted.o
- $(CC) -o muted muted.o
-@@ -315,28 +324,28 @@
- $(MAKE) -C stdtime clean
+ $(CC) $(AUDIO_LIBS) -o muted muted.o
+@@ -539,38 +536,38 @@
datafiles: all
+ if [ x`whoami` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
for x in sounds/digits/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
+ for x in sounds/dictate/*.gsm; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
+ else \
+ echo "No description for $$x"; \
+ exit 1; \
+ fi; \
+ done
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
for x in sounds/letters/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
else \
echo "No description for $$x"; \
@@ -202,17 +276,17 @@ $FreeBSD$
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
for x in sounds/phonetic/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
else \
echo "No description for $$x"; \
exit 1; \
-@@ -344,18 +353,18 @@
+@@ -578,18 +575,18 @@
done
- for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
@@ -224,70 +298,80 @@ $FreeBSD$
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images
for x in images/*.jpg; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
done
- mkdir -p $(DESTDIR)$(AGI_DIR)
+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
update:
- @if [ -d CVS ]; then \
-@@ -367,127 +376,90 @@
- fi
+ @if [ -d .svn ]; then \
+@@ -618,75 +615,53 @@
+ OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
bininstall: all
- mkdir -p $(DESTDIR)$(MODULES_DIR)
- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTETCDIR)
- mkdir -p $(DESTDIR)$(ASTBINDIR)
-- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
-- install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
+- if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ $(MKDIR) $(DESTDIR)$(MODULES_DIR)
+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTBINDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR)
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/dictate
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/system
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/tmp
-+ $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/meetme
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/monitor
++ if [ -f asterisk ]; then $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f cygwin/asterisk.exe ]; then $(BSD_INSTALL_PROGRAM) cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f asterisk.dll ]; then $(BSD_INSTALL_PROGRAM) asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
+- $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
+- $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
++ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
-- install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
+ chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
fi
for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
-- install -d $(DESTDIR)$(ASTHEADERDIR)
-- install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm
-- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
-- if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \
-- mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- else \
-- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \
-- fi
-- ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+ if [ -n "$(OLDHEADERS)" ]; then \
+ rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
+ fi
+ rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
+- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
-- install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 asterisk.8.gz $(DESTDIR)$(ASTMANDIR)/man8
-+ ln -sf $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv
++ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
@@ -295,14 +379,16 @@ $FreeBSD$
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
if [ -d contrib/firmware/iax ]; then \
-- install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
else \
echo "You need to do cvs update -d not just cvs update" ; \
fi
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . )
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
- if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
- @echo " +---- Asterisk Installation Complete -------+"
- @echo " + +"
@@ -325,85 +411,74 @@ $FreeBSD$
- @echo " + **Note** This requires that you have +"
- @echo " + doxygen installed on your local system +"
- @echo " +-------------------------------------------+"
-- @echo " + +"
-- @echo " + ** NOTE FOR DOWNGRADING FROM CVS HEAD ** +"
-- @echo " + +"
-- @echo " + If you are downgrading from CVS HEAD to +"
-- @echo " + a stable release, remember to delete +"
-- @echo " + everything from your asterisk modules +"
-- @echo " + directory (/usr/lib/asterisk/modules/) +"
-- @echo " + and the asterisk header directory +"
-- @echo " + (/usr/include/asterisk/) +"
-- @echo " + before doing a '$(MAKE) install'. +"
-- @echo " + +"
-- @echo " +-------------------------------------------+"
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/vm . )
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/voicemail . )
+ @$(MAKE) -s oldmodcheck
+ NEWMODS=$(notdir $(wildcard */*.so))
+@@ -710,7 +685,7 @@
+ echo " WARNING WARNING WARNING" ;\
+ fi
-install: all datafiles bininstall
+install: all datafiles bininstall samples
-
+ @if [ -x /usr/sbin/asterisk-post-install ]; then \
+ /usr/sbin/asterisk-post-install $(DESTDIR) . ; \
+ fi
+@@ -718,16 +693,19 @@
upgrade: all bininstall
- adsi: all
+ adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x`-dist; \
- if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
fi ; \
done
- samples: all datafiles adsi
+ samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
-- for x in configs/*.sample; do \
-- if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
++ echo ADSI INSTALL $(BSD_INSTALL_DATA)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
-+ for x in configs/*.sample channels/h323/*.sample; do \
+ for x in configs/*.sample; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`-dist;\
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+ if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
+ if [ "$(OVERWRITE)" = "y" ]; then \
+ if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
+@@ -740,7 +718,7 @@
+ continue; \
+ fi ;\
fi ; \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
done
-- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-+ echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
-+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist $(DESTDIR)$(ASTETCDIR)/asterisk.conf; \
-+ fi
+ if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ ( \
+@@ -759,25 +737,25 @@
+ echo ";astctlowner = root" ; \
+ echo ";astctlgroup = apache" ; \
+ echo ";astctl = asterisk.ctl" ; \
+- ) > $(DESTDIR)$(ASTCONFPATH) ; \
++ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ else \
+ echo "Skipping asterisk.conf creation"; \
+ fi
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
for x in sounds/demo-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
for x in sounds/*.mp3; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
done
rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3
@@ -412,18 +487,18 @@ $FreeBSD$
:> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
-@@ -502,7 +474,7 @@
- @[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 )
- @[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 )
- install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi
-- mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk
-+ $(MKDIR) $(DESTDIR)$(HTTPDIR)/html/_asterisk
+@@ -791,7 +769,7 @@
+ @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
+ @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
+ $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
+- mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
++ $(MKDIR) $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
for x in images/*.gif; do \
- install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
done
-@@ -522,10 +494,10 @@
+@@ -820,10 +798,10 @@
- __rpm: _version
+ __rpm: include/asterisk/version.h spec
rm -rf /tmp/asterisk ; \
- mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
+ $(MKDIR) /tmp/asterisk/redhat/RPMS/i386 ; \
@@ -431,6 +506,6 @@ $FreeBSD$
$(MAKE) DESTDIR=/tmp/asterisk samples ; \
- mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
+ $(MKDIR) /tmp/asterisk/etc/rc.d/init.d ; \
- cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
- sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
+ cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
+
diff --git a/net/asterisk-bristuff/files/patch-agi::Makefile b/net/asterisk-bristuff/files/patch-agi::Makefile
index 32efb5d..b359765 100644
--- a/net/asterisk-bristuff/files/patch-agi::Makefile
+++ b/net/asterisk-bristuff/files/patch-agi::Makefile
@@ -1,9 +1,9 @@
$FreeBSD$
---- agi/Makefile.orig Tue Jun 22 20:42:13 2004
-+++ agi/Makefile Tue Oct 5 21:03:40 2004
-@@ -11,15 +11,18 @@
+--- agi/Makefile.orig Thu Jan 12 15:42:07 2006
++++ agi/Makefile Thu Jan 12 15:44:39 2006
+@@ -11,7 +11,9 @@
# the GNU General Public License
#
@@ -14,14 +14,15 @@ $FreeBSD$
CFLAGS+=
+@@ -27,8 +29,9 @@
all: depend $(AGIS)
install: all
- mkdir -p $(DESTDIR)$(AGI_DIR)
- for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
-+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
++ $(MKDIR) -p $(DESTDIR)$(AGI_DIR)
+ for x in $(AGIS_BIN); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(AGI_DIR) ; done
+ for x in $(AGIS_SCR); do $(BSD_INSTALL_SCRIPT) $$x $(DESTDIR)$(AGI_DIR) ; done
eagi-test: eagi-test.o
- $(CC) $(CFLAGS) -o eagi-test eagi-test.o
+ $(CC) $(CFLAGS) -o eagi-test eagi-test.o $(LIBS)
diff --git a/net/asterisk-bristuff/files/patch-apps::Makefile b/net/asterisk-bristuff/files/patch-apps::Makefile
index 44f8495..ee7d560 100644
--- a/net/asterisk-bristuff/files/patch-apps::Makefile
+++ b/net/asterisk-bristuff/files/patch-apps::Makefile
@@ -1,38 +1,56 @@
---- apps/Makefile.orig Wed Jun 22 14:40:11 2005
-+++ apps/Makefile Wed Jun 22 14:43:45 2005
-@@ -40,9 +40,13 @@
+
+$FreeBSD$
+
+--- apps/Makefile.orig
++++ apps/Makefile
+@@ -45,25 +45,27 @@
#APPS+=app_rpt.so
- APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
--APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
- APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi)
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h),)
+ APPS+=app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so
+ endif
+ endif # WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ifdef WITH_FAX
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/spandsp.h ]; then echo "app_rxfax.so app_txfax.so" ; fi)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp.h),)
++APPS+=app_rxfax.so app_txfax.so
++endif
+endif
+
- CFLAGS+=-fPIC
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ APPS+=app_osplookup.so
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+-CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+-CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
+-ifneq ($(shell if [[ 0x`$(CROSS_COMPILE_BIN)curl-config --vernum` -ge 0x70907 ]]; then echo "OK" ; fi),)
+- ifneq (${CURLLIBS},)
+- APPS+=app_curl.so
+- endif
+-endif
++CURLLIBS=$(shell $(CROSS_COMPILE_BIN)$(LOCALBASE)/bin/curl-config --libs)
++APPS+=app_curl.so
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
-@@ -65,12 +69,12 @@
- $(CC) $(SOLINK) -o $@ $< -ltonezone
+ ifeq (${OSARCH},CYGWIN)
+ CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
+@@ -95,24 +97,32 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -ltonezone
install: all
- for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(APPS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
+ rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
- app_voicemail.so : app_voicemail.o
- ifeq ($(USE_MYSQL_VM_INTERFACE),1)
-- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L/usr/lib/mysql -lmysqlclient -lz
-+ $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L$(LOCALBASE)/lib/mysql -lmysqlclient -lz
- else
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lpq
-@@ -79,17 +83,25 @@
- endif
- endif
+ app_curl.so: app_curl.o
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
+ifdef WITH_FAX
+app_rxfax.so : app_rxfax.o
@@ -47,15 +65,15 @@
+ $(CC) -I$(LOCALBASE)/include/pgsql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
app_sql_postgres.so: app_sql_postgres.o
-- $(CC) $(SOLINK) -o $@ $< -L/usr/local/pgsql/lib -lpq
-+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lpq
+- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
++ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L$(LOCALBASE)/lib -lpq
app_sql_odbc.so: app_sql_odbc.o
- $(CC) $(SOLINK) -o $@ $< -lodbc
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
look: look.c
- $(CC) -pipe -O6 -g look.c -o look -lncurses
-+ $(CC) $(CFLAGS) look.c -o look -lncurses
++ $(CC) look.c -o look -lncurses
- ifneq ($(wildcard .depend),)
- include .depend
+ ifeq (SunOS,$(shell uname))
+ app_chanspy.so: app_chanspy.o
diff --git a/net/asterisk-bristuff/files/patch-apps::app_rxfax.c b/net/asterisk-bristuff/files/patch-apps::app_rxfax.c
index 88362bfc..820208e 100644
--- a/net/asterisk-bristuff/files/patch-apps::app_rxfax.c
+++ b/net/asterisk-bristuff/files/patch-apps::app_rxfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_rxfax.c.orig
-+++ apps/app_rxfax.c
-@@ -0,0 +1,371 @@
+--- /dev/null Thu Jan 12 17:44:40 2006
++++ apps/app_rxfax.c Thu Jan 12 17:41:53 2006
+@@ -0,0 +1,373 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <asterisk/dsp.h>
+#include <asterisk/manager.h>
++#include <asterisk/version.h>
+#include <string.h>
+#include <stdlib.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
@@ -100,7 +102,7 @@ $FreeBSD$
+ "FaxReceived", "Channel: %s\nExten: %s\nCallerID: %s\nRemoteStationID: %s\nLocalStationID: %s\nPagesTransferred: %i\nResolution: %i\nTransferRate: %i\nFileName: %s\n",
+ chan->name,
+ chan->exten,
-+#if (ASTERISK_VERSION_NUM <= 011000)
++#if ASTERISK_VERSION_NUM <= 010010
+ chan->callerid,
+#else
+ (chan->cid.cid_num) ? chan->cid.cid_num : "",
diff --git a/net/asterisk-bristuff/files/patch-apps::app_txfax.c b/net/asterisk-bristuff/files/patch-apps::app_txfax.c
index 8daf0f9..15ad667 100644
--- a/net/asterisk-bristuff/files/patch-apps::app_txfax.c
+++ b/net/asterisk-bristuff/files/patch-apps::app_txfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_txfax.c.orig
-+++ apps/app_txfax.c
-@@ -0,0 +1,293 @@
+--- /dev/null Thu Jan 12 17:48:54 2006
++++ apps/app_txfax.c Thu Jan 12 17:48:36 2006
+@@ -0,0 +1,295 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <string.h>
+#include <stdlib.h>
++#include <math.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
+#include <inttypes.h>
+#else
diff --git a/net/asterisk-bristuff/files/patch-astman::Makefile b/net/asterisk-bristuff/files/patch-astman::Makefile
deleted file mode 100644
index 2745860..0000000
--- a/net/asterisk-bristuff/files/patch-astman::Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-
-$FreeBSD$
-
---- astman/Makefile.orig Sat Jun 26 22:25:39 2004
-+++ astman/Makefile Thu Oct 14 19:14:22 2004
-@@ -5,16 +5,16 @@
-
- OSARCH=$(shell uname -s)
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS+=-I/usr/local/include -L/usr/local/lib
-+CFLAGS+=-I$(LOCALBASE)/include -L$(LOCALBASE)/lib
- endif
-
--TARGET=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else if [ -f /usr/local/include/newt.h ]; then echo "astman"; else echo "none" ; fi ; fi)
-+TARGET=astman
- all: depend $(TARGET)
-
- install:
- if [ "$(TARGET)" != "none" ]; then \
- for x in $(TARGET); do \
-- install -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
-+ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
- done ; \
- fi
-
diff --git a/net/asterisk-bristuff/files/patch-cdr::Makefile b/net/asterisk-bristuff/files/patch-cdr::Makefile
index 1d0fb20..da16b60 100644
--- a/net/asterisk-bristuff/files/patch-cdr::Makefile
+++ b/net/asterisk-bristuff/files/patch-cdr::Makefile
@@ -1,51 +1,65 @@
---- cdr/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ cdr/Makefile Tue Aug 9 17:28:11 2005
-@@ -21,7 +21,7 @@
- OSARCH=$(shell uname -s)
-
- ifeq (${OSARCH},FreeBSD)
--SOLINK+=-L/usr/local/lib
-+SOLINK+=-L$(LOCALBASE)/lib
+
+$FreeBSD$
+
+--- cdr/Makefile.orig Tue Nov 29 20:24:39 2005
++++ cdr/Makefile Thu Jan 12 17:56:23 2006
+@@ -21,8 +21,8 @@
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
endif
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
-@@ -37,18 +37,23 @@
+@@ -38,18 +38,18 @@
#
# unixODBC stuff...
#
-+ifdef WITH_ODBC
- MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/odbcinst.h),)
+ MODS+=cdr_odbc.so
+ endif
#
# FreeTDS stuff...
#
-+ifdef WITH_FREETDS
- MODS+=$(shell if [ -f "/usr/include/tds.h" ]; then echo "cdr_tds.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/tds.h" ]; then echo "cdr_tds.so"; fi)
-+endif
-
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h),)
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.63),1)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tds.h),)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.63),1)
+ CFLAGS += -DFREETDS_0_63
+ else
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.62),1)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.62),1)
+ CFLAGS += -DFREETDS_0_62
+ else
+ CFLAGS += -DFREETDS_PRE_0_62
+@@ -61,7 +61,7 @@
#
# PGSQL stuff... Autoconf anyone??
#
-+ifdef WITH_PGSQL
- MODS+=$(shell if [ -d /usr/local/pgsql/include ] || [ -d /usr/include/pgsql ] || [ -d /usr/local/include/pgsql ] || [ -d /opt/pgsql/include ] || [ -f /usr/include/libpq-fe.h ] ; then echo "cdr_pgsql.so"; fi)
- CFLAGS+=$(shell if [ -d /usr/local/pgsql/include ]; then echo "-I/usr/local/pgsql/include"; fi)
- CFLAGS+=$(shell if [ -d /usr/include/pgsql ]; then echo "-I/usr/include/pgsql"; fi)
-@@ -62,16 +67,19 @@
- MLFLAGS+=$(shell if [ -d /usr/local/lib/pgsql ]; then echo "-L/usr/local/lib/pgsql"; fi)
- MLFLAGS+=$(shell if [ -d /opt/pgsql/lib ]; then echo "-L/opt/pgsql/lib"; fi)
- MLFLAGS+=$(shell if [ -f /usr/lib/libpq.so ]; then echo "-L/usr/lib"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
+ MODS+=cdr_pgsql.so
+ endif
- #
- # SQLIte stuff...
- #
-+ifdef WITH_SQLITE
- MODS+=$(shell if [ -f "/usr/include/sqlite.h" ]; then echo "cdr_sqlite.so"; fi)
-+endif
+@@ -82,9 +82,9 @@
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/pgsql
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql),)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/pgsql
+- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib/pgsql
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql),)
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql
++ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/pgsql
+ endif
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include),)
+@@ -110,7 +110,7 @@
all: depend $(MODS)
install: all
diff --git a/net/asterisk-bristuff/files/patch-channels::Makefile b/net/asterisk-bristuff/files/patch-channels::Makefile
index 7ecab67..edca9b1 100644
--- a/net/asterisk-bristuff/files/patch-channels::Makefile
+++ b/net/asterisk-bristuff/files/patch-channels::Makefile
@@ -1,97 +1,85 @@
---- channels/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ channels/Makefile Tue Aug 9 17:34:28 2005
-@@ -57,10 +57,10 @@
-
+
+$FreeBSD$
+
+--- channels/Makefile.orig
++++ channels/Makefile
+@@ -48,9 +48,9 @@
endif
+
ifeq (${OSARCH},FreeBSD)
--PTLIB=-lpt_FreeBSD_x86_r
--H323LIB=-lh323_FreeBSD_x86_r
--CHANH323LIB=-pthread
--SOLINK+=-L/usr/local/lib
-+PTLIB=-lpt_FreeBSD_x86_r_s
-+H323LIB=-lh323_FreeBSD_x86_r_s
-+CHANH323LIB=
-+SOLINK+=-L$(LOCALBASE)/lib
+- PTLIB=-lpt_FreeBSD_x86_r
+- H323LIB=-lh323_FreeBSD_x86_r
+- CHANH323LIB=-pthread
++ PTLIB=-lpt_FreeBSD_x86_r_s
++ H323LIB=-lh323_FreeBSD_x86_r_s
++ CHANH323LIB=
endif
+
ifeq (${OSARCH},NetBSD)
- PTLIB=-lpt_NetBSD_x86_r
-@@ -72,19 +72,23 @@
+@@ -73,11 +73,11 @@
+ SOLINK+=-lrt
endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/ixjuser.h ] && echo chan_phone.so)
-+ifdef WITH_H323
-+CHANNEL_LIBS+=chan_h323.so
-+endif
-
- CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
- CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
- CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
--CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
- CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
- CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
--ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
-+ZAPPRI=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo "-lpri")
- ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
-+ifdef WITH_ZAPTEL
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "-DIAX_TRUNKING -I$(LOCALBASE)/include")
-+endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
- CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX")
-
-@@ -106,8 +110,10 @@
-
- ZAPDIR=/usr/lib
-
-+ifdef WITH_ZAPTEL
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so")
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "chan_zap.so")
-+endif
-
- CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/ixjuser.h),)
+ CHANNEL_LIBS+=chan_phone.so
+ endif
-@@ -156,6 +162,8 @@
- chan_oss.so: chan_oss.o
- $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
+-ifneq ($(wildcard h323/libchanh323.a),)
++ifdef WITH_H323
+ CHANNEL_LIBS+=chan_h323.so
endif
-+chan_oss.so: chan_oss.o
-+ $(CC) $(SOLINK) -o $@ chan_oss.o
- chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o
- ifeq ($(USE_MYSQL_FRIENDS),1)
-@@ -175,7 +183,7 @@
- $(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c
+@@ -91,12 +91,12 @@
+ CHANNEL_LIBS+=chan_alsa.so
+ endif
- chan_zap.so: chan_zap.o
-- $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -ltonezone
-+ $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -L$(LOCALBASE)/lib -ltonezone
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libpri.so.1),)
+ CFLAGS+=-DZAPATA_PRI
+ ZAPPRI=-lpri
+ endif
- chan_sip.so: chan_sip.o
- ifeq ($(USE_SIP_MYSQL_FRIENDS),1)
-@@ -199,15 +207,17 @@
- chan_vpb.so: chan_vpb.o
- $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libmfcr2.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libmfcr2.so.1),)
+ CFLAGS+=-DZAPATA_R2
+ ZAPR2=-lmfcr2
+ endif
+@@ -109,12 +109,12 @@
+ endif
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ifeq (${OSARCH},NetBSD)
+ SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/pkg/lib
+ endif
+ ifeq (${OSARCH},FreeBSD)
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ CFLAGS+=-DIAX_TRUNKING
+ CHANNEL_LIBS+=chan_zap.so
+@@ -229,8 +229,10 @@
+ chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast
+ $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
+ else
-chan_h323.so: chan_h323.o h323/libchanh323.a
- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
+chan_h323.so: chan_h323.o h323/ast_h323.o
-+ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -lcrypto -lssl -L$(LOCALBASE)/lib -lexpat -llber -lldap -lldap_r
-
++ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o $(CHANH323LIB) -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L/usr/lib -lcrypto -lssl -lexpat -L$(LOCALBASE)/lib -llber -lldap -lldap_r
+h323/ast_h323.o:
+ $(MAKE) -C h323 ast_h323.o
+ endif
- #chan_modem.so : chan_modem.o
+ chan_misdn.so: chan_misdn.o chan_misdn_config.o misdn/chan_misdn_lib.a
+@@ -244,8 +246,7 @@
# $(CC) -rdynamic -shared -Xlinker -x -o $@ $<
install: all
- for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
+ for x in $(CHANNEL_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
depend: .depend
+
diff --git a/net/asterisk-bristuff/files/patch-channels::chan_h323.c b/net/asterisk-bristuff/files/patch-channels::chan_h323.c
index de2ed39..6498b97 100644
--- a/net/asterisk-bristuff/files/patch-channels::chan_h323.c
+++ b/net/asterisk-bristuff/files/patch-channels::chan_h323.c
@@ -1,14 +1,14 @@
$FreeBSD$
---- channels/chan_h323.c 2004/10/10 13:00:17 1.1
-+++ channels/chan_h323.c 2004/10/10 13:00:39
-@@ -26,7 +26,7 @@
- * Version Info: $Id: patch-channels::chan_h323.c,v 1.3.2.3 2004/10/14 14:30:13 sobomax Exp $
- */
+--- channels/chan_h323.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_h323.c Thu Jan 12 18:29:50 2006
+@@ -2281,7 +2281,7 @@ static char *convertcap(int cap)
+ }
+ }
--
-+#include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/signal.h>
- #include <sys/param.h>
+-static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs)
++static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active)
+ {
+ /* XXX Deal with Video */
+ struct oh323_pvt *pvt;
diff --git a/net/asterisk-bristuff/files/patch-channels::chan_sip.c b/net/asterisk-bristuff/files/patch-channels::chan_sip.c
index e634ce4..355c558 100644
--- a/net/asterisk-bristuff/files/patch-channels::chan_sip.c
+++ b/net/asterisk-bristuff/files/patch-channels::chan_sip.c
@@ -1,144 +1,131 @@
$FreeBSD$
---- channels/chan_sip.c.orig Sun Feb 17 18:01:43 2002
-+++ channels/chan_sip.c Sun Feb 17 18:10:52 2002
-@@ -141,7 +141,7 @@
+--- channels/chan_sip.c.orig Thu Jan 12 18:43:37 2006
++++ channels/chan_sip.c Thu Jan 12 18:50:11 2006
+@@ -336,7 +336,7 @@ static char global_vmexten[AST_MAX_EXTEN
static char default_language[MAX_LANGUAGE] = "";
--static char default_callerid[AST_MAX_EXTENSION] = "asterisk";
-+static char default_callerid[AST_MAX_EXTENSION] = "Unknown";
+-#define DEFAULT_CALLERID "asterisk"
++#define DEFAULT_CALLERID "Unknown"
+ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID;
static char default_fromdomain[AST_MAX_EXTENSION] = "";
+@@ -474,6 +474,7 @@ struct sip_invite_param {
-@@ -244,6 +244,7 @@
struct sip_route {
struct sip_route *next;
- char hop[0];
+ int lr;
+ char hop[0];
};
- struct sip_history {
-@@ -2218,7 +2219,7 @@
- if (p->owner) {
- /* We already hold the channel lock */
- if (f->frametype == AST_FRAME_VOICE) {
-- if (f->subclass != p->owner->nativeformats) {
-+ if (!(f->subclass & p->owner->nativeformats)) {
- ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
- p->owner->nativeformats = f->subclass;
- ast_set_read_format(p->owner, p->owner->readformat);
-@@ -4620,6 +4621,10 @@
+@@ -5993,6 +5994,7 @@ static void build_route(struct sip_pvt *
/* Make a struct route */
- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
+ thishop = malloc(sizeof(*thishop) + len);
if (thishop) {
-+ if (strnstr(rr, ";lr", len) != NULL)
-+ thishop->lr = 1;
-+ else
-+ thishop->lr = 0;
- strncpy(thishop->hop, rr, len); /* safe */
- thishop->hop[len] = '\0';
++ thishop->lr = (strnstr(rr, ";lr", len) != NULL ? 1 : 0);
+ ast_copy_string(thishop->hop, rr, len);
ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop);
-@@ -4643,31 +4648,41 @@
- rr += len+1;
- }
- }
-- /* 2nd append the Contact: if there is one */
-- /* Can be multiple Contact headers, comma separated values - we just take the first */
-- contact = get_header(req, "Contact");
-- if (!ast_strlen_zero(contact)) {
-- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-- /* Look for <: delimited address */
-- c = strchr(contact, '<');
-- if (c) {
-- /* Take to > */
-- ++c;
-- len = strcspn(c, ">");
-- } else {
-- /* No <> - just take the lot */
-- c = contact; len = strlen(contact);
-- }
-- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ /* Duplicate first route from the list */
-+ if (head && head->lr) {
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
- if (thishop) {
-- strncpy(thishop->hop, c, len); /* safe */
-- thishop->hop[len] = '\0';
-- thishop->next = NULL;
-- /* Goes at the end */
-- if (tail)
-- tail->next = thishop;
-- else
-- head = thishop;
-+ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
-+ thishop->next = head;
-+ head = thishop;
-+ }
-+ } else {
-+ /* Append the Contact: if there is one and first route is w/o `lr' param */
-+ /* Can be multiple Contact headers, comma separated values - we just take the first */
-+ contact = get_header(req, "Contact");
-+ if (!ast_strlen_zero(contact)) {
-+ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-+ /* Look for <: delimited address */
-+ c = strchr(contact, '<');
-+ if (c) {
-+ /* Take to > */
-+ ++c;
-+ len = strcspn(c, ">");
-+ } else {
-+ /* No <> - just take the lot */
-+ c = contact; len = strlen(contact);
-+ }
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ if (thishop) {
-+ strncpy(thishop->hop, c, len); /* safe */
-+ thishop->hop[len] = '\0';
-+ thishop->next = NULL;
-+ /* Goes at the end */
-+ if (tail)
-+ tail->next = thishop;
-+ else
-+ head = thishop;
+ /* Link in */
+@@ -6018,31 +6020,41 @@ static void build_route(struct sip_pvt *
+
+ /* Only append the contact if we are dealing with a strict router */
+ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) {
+- /* 2nd append the Contact: if there is one */
+- /* Can be multiple Contact headers, comma separated values - we just take the first */
+- contact = get_header(req, "Contact");
+- if (!ast_strlen_zero(contact)) {
+- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
+- /* Look for <: delimited address */
+- c = strchr(contact, '<');
+- if (c) {
+- /* Take to > */
+- ++c;
+- len = strcspn(c, ">") + 1;
+- } else {
+- /* No <> - just take the lot */
+- c = contact;
+- len = strlen(contact) + 1;
+- }
+- thishop = malloc(sizeof(*thishop) + len);
++ /* Duplicate first route from the list */
++ if (head && head->lr) {
++ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
+ if (thishop) {
+- ast_copy_string(thishop->hop, c, len);
+- thishop->next = NULL;
+- /* Goes at the end */
+- if (tail)
+- tail->next = thishop;
+- else
+- head = thishop;
++ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
++ thishop->next = head;
++ head = thishop;
+ }
++ } else {
++ /* Append the Contact: if there is one and first route is w/o `lr' param */
++ /* Can be multiple Contact headers, comma separated values - we just take the first */
++ contact = get_header(req, "Contact");
++ if (!ast_strlen_zero(contact)) {
++ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
++ /* Look for <: delimited address */
++ c = strchr(contact, '<');
++ if (c) {
++ /* Take to > */
++ ++c;
++ len = strcspn(c, ">") + 1;
++ } else {
++ /* No <> - just take the lot */
++ c = contact;
++ len = strlen(contact) + 1;
++ }
++ thishop = malloc(sizeof(*thishop) + len);
++ if (thishop) {
++ ast_copy_string(thishop->hop, c, len);
++ thishop->next = NULL;
++ /* Goes at the end */
++ if (tail)
++ tail->next = thishop;
++ else
++ head = thishop;
++ }
+ }
}
}
- /* Store as new route */
-@@ -7338,7 +7353,11 @@
- /* Get destination right away */
- gotdest = get_destination(p, NULL);
- get_rdnis(p, NULL);
-- extract_uri(p, req);
-+ build_route(p, req, 0);
-+ if (!p->route->lr)
-+ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
-+ else
-+ extract_uri(p, req);
- build_contact(p);
+@@ -10336,7 +10348,11 @@ static int handle_request_invite(struct
+ gotdest = get_destination(p, NULL);
- if (gotdest) {
-@@ -7366,7 +7385,6 @@
- c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
- *recount = 1;
- /* Save Record-Route for any later requests we make on this dialogue */
-- build_route(p, req, 0);
- if (c) {
- /* Pre-lock the call */
- ast_mutex_lock(&c->lock);
-@@ -7426,6 +7444,14 @@
- transmit_response(p, "180 Ringing", req);
- break;
- case AST_STATE_UP:
-+ /* Assuming this to be reinvite, process new SDP portion */
-+ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
-+ process_sdp(p, req);
-+ } else {
-+ p->jointcapability = p->capability;
-+ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
-+ }
-+
- transmit_response_with_sdp(p, "200 OK", req, 1);
- break;
- default:
+ get_rdnis(p, NULL);
+- extract_uri(p, req);
++ build_route(p, req, 0);
++ if (!p->route->lr)
++ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
++ else
++ extract_uri(p, req);
+ build_contact(p);
+
+ if (gotdest) {
+@@ -10364,7 +10380,6 @@ static int handle_request_invite(struct
+ c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
+ *recount = 1;
+ /* Save Record-Route for any later requests we make on this dialogue */
+- build_route(p, req, 0);
+ if (c) {
+ /* Pre-lock the call */
+ ast_mutex_lock(&c->lock);
+@@ -10450,6 +10465,13 @@ static int handle_request_invite(struct
+ transmit_response(p, "180 Ringing", req);
+ break;
+ case AST_STATE_UP:
++ /* Assuming this to be reinvite, process new SDP portion */
++ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
++ process_sdp(p, req);
++ } else {
++ p->jointcapability = p->capability;
++ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
++ }
+ transmit_response_with_sdp(p, "200 OK", req, 1);
+ break;
+ default:
diff --git a/net/asterisk-bristuff/files/patch-channels::chan_zap.c b/net/asterisk-bristuff/files/patch-channels::chan_zap.c
index 458a6147..ab02c02 100644
--- a/net/asterisk-bristuff/files/patch-channels::chan_zap.c
+++ b/net/asterisk-bristuff/files/patch-channels::chan_zap.c
@@ -1,85 +1,65 @@
$FreeBSD$
---- channels/chan_zap.c.orig Sun Feb 17 18:01:44 2002
-+++ channels/chan_zap.c Sun Feb 17 18:03:26 2002
-@@ -46,7 +46,9 @@
- #include <sys/signal.h>
- #include <errno.h>
- #include <stdlib.h>
-+#ifndef __FreeBSD__
- #include <stdint.h>
-+#endif
- #include <unistd.h>
- #include <sys/ioctl.h>
- #ifdef __linux__
-@@ -320,7 +322,7 @@
- #define CALLWAITING_REPEAT_SAMPLES ( (10000 * 8) / READ_SIZE) /* 300 ms */
- #define CIDCW_EXPIRE_SAMPLES ( (500 * 8) / READ_SIZE) /* 500 ms */
- #define MIN_MS_SINCE_FLASH ( (2000) ) /* 2000 ms */
--#define RINGT ( (8000 * 8) / READ_SIZE)
-+#define RINGT ( (8000 * 8) / READ_SIZE) /* 8000 ms */
-
- struct zt_pvt;
-
-@@ -535,6 +537,7 @@
- int cidpos;
+--- channels/chan_zap.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_zap.c Fri Jan 13 13:28:33 2006
+@@ -638,6 +638,7 @@ static struct zt_pvt {
int cidlen;
int ringt;
+ int ringt_base;
+ int waitnorings;
int stripmsd;
- int callwaiting;
int callwaitcas;
-@@ -2134,12 +2137,20 @@
-
- if (option_debug)
- ast_log(LOG_DEBUG, "zt_hangup(%s)\n", ast->name);
-+
- if (!ast->pvt->pvt) {
- ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
- return 0;
+ int callwaitrings;
+@@ -2308,6 +2309,19 @@ static int zt_hangup(struct ast_channel
}
ast_mutex_lock(&p->lock);
++ switch (p->sig) {
++ case SIG_FXSGS:
++ case SIG_FXSKS:
++ case SIG_FXSLS:
++ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
++ {
++ p->waitnorings = 1;
++ }
++ break;
++ default:
++ break;
++ };
+
-+
-+ if((p->sig == SIG_FXSGS) || (p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS))
-+ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
-+ {
-+ p->waitnorings = 1;
-+ }
index = zt_get_index(ast, p, 1);
-@@ -5717,7 +5728,37 @@
+@@ -6129,7 +6143,37 @@ static void *ss_thread(void *data)
ast_setstate(chan, AST_STATE_RING);
chan->rings = 1;
- p->ringt = RINGT;
+ p->ringt = p->ringt_base;
+ p->waitnorings = 0;
res = ast_pbx_run(chan);
+
+ if(p->waitnorings)
+ {
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+ for(;;)
+ {
+ int i,j=0;
+ i = ZT_IOMUX_SIGEVENT | ZT_IOMUX_NOWAIT;
-+ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
++ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
+ break;
-+
-+ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
++
++ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
+ break;
-+
++
+ if(j == ZT_EVENT_RINGOFFHOOK)
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+
+ usleep(20000);
+
+ if (p->ringt <= 0)
+ break;
+
-+ else if (p->ringt > 0)
++ else if (p->ringt > 0)
+ p->ringt--;
+ }
+ p->ringt = 0;
@@ -89,7 +69,7 @@ $FreeBSD$
if (res) {
ast_hangup(chan);
ast_log(LOG_WARNING, "PBX exited non-zero\n");
-@@ -6018,7 +6059,7 @@
+@@ -6431,7 +6475,7 @@ static void *do_monitor(void *data)
i = iflist;
while(i) {
if ((i->subs[SUB_REAL].zfd > -1) && i->sig && (!i->radio)) {
diff --git a/net/asterisk-bristuff/files/patch-channels::h323::Makefile b/net/asterisk-bristuff/files/patch-channels::h323::Makefile
deleted file mode 100644
index 779096b..0000000
--- a/net/asterisk-bristuff/files/patch-channels::h323::Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-
-$FreeBSD$
-
---- channels/h323/Makefile.orig
-+++ channels/h323/Makefile
-@@ -53,7 +53,7 @@
- LIBS+=-lpthread
- endif
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS += -pthread
-+CFLAGS += $(PTHREAD_LIBS)
- endif
- CFLAGS += -D_REENTRANT -D_GNU_SOURCE
- CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
-@@ -77,20 +77,20 @@
- ar cr libchanh323.a ast_h323.o
-
- ast_h323.o: ast_h323.cpp
-- $(CXX) -g -c -fno-rtti -o $@ $(CFLAGS) $<
-+ $(CXX) $(CXXFLAGS) -c -fno-rtti -o $@ $(CFLAGS) $<
-
- ifneq ($(wildcard .depend),)
- include .depend
- endif
-
- chan_h323.so:
-- $(CXX) -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_d.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_s.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
- clean:
- rm -f *.o *.so core.* libchanh323.a .depend
-
diff --git a/net/asterisk-bristuff/files/patch-channels::h323::ast_h323.cpp b/net/asterisk-bristuff/files/patch-channels::h323::ast_h323.cpp
new file mode 100644
index 0000000..feb79e5
--- /dev/null
+++ b/net/asterisk-bristuff/files/patch-channels::h323::ast_h323.cpp
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.cpp.orig Thu Jan 12 18:16:08 2006
++++ channels/h323/ast_h323.cpp Thu Jan 12 18:16:35 2006
+@@ -953,8 +953,8 @@ BOOL MyH323Connection::OnReceivedCapabil
+ H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capability & capability,
+ H323Channel::Directions dir,
+ unsigned sessionID,
+- const H245_H2250LogicalChannelParameters * /*param*/,
+- RTP_QOS * /*param*/ )
++ const H245_H2250LogicalChannelParameters * /*param*/ /*,
++ RTP_QOS * */ /*param*/ )
+ {
+ return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID);
+ }
diff --git a/net/asterisk-bristuff/files/patch-channels::h323::ast_h323.h b/net/asterisk-bristuff/files/patch-channels::h323::ast_h323.h
new file mode 100644
index 0000000..606bb01
--- /dev/null
+++ b/net/asterisk-bristuff/files/patch-channels::h323::ast_h323.h
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.h.orig Thu Jan 12 18:14:49 2006
++++ channels/h323/ast_h323.h Thu Jan 12 18:15:02 2006
+@@ -155,8 +155,8 @@ class MyH323Connection : public H323Conn
+ H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
+ H323Channel::Directions,
+ unsigned,
+- const H245_H2250LogicalChannelParameters *,
+- RTP_QOS *);
++ const H245_H2250LogicalChannelParameters * /* ,
++ RTP_QOS * */);
+ H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
+ const H323SignalPDU &,
+ H323SignalPDU &);
diff --git a/net/asterisk-bristuff/files/patch-codecs::Makefile b/net/asterisk-bristuff/files/patch-codecs::Makefile
index 325e590..ab5cbc4 100644
--- a/net/asterisk-bristuff/files/patch-codecs::Makefile
+++ b/net/asterisk-bristuff/files/patch-codecs::Makefile
@@ -1,39 +1,48 @@
---- codecs/Makefile.orig Thu Mar 17 20:43:51 2005
-+++ codecs/Makefile Thu Apr 14 00:09:04 2005
-@@ -17,25 +17,23 @@
- # g723.1b)
- #
- #MODG723=codec_g723_1.so codec_g723_1b.so
--MODG723=$(shell [ -f g723.1/coder.c ] && echo "codec_g723_1.so")
--MODG723+=$(shell [ -f g723.1b/coder2.c ] && echo "codec_g723_1b.so")
--MODSPEEX=$(shell [ -f /usr/include/speex.h ] || [ -f /usr/include/speex/speex.h ] || [ -f /usr/local/include/speex.h ] || [ -f /usr/local/include/speex/speex.h ] && echo "codec_speex.so")
--MODILBC=$(shell [ -f ilbc/iLBC_decode.h ] && echo "codec_ilbc.so")
-+MODG723=codec_g723_1_dummy.so
-+MODG729=codec_g729_dummy.so
-+MODSPEEX=codec_speex.so
-+MODILBC=codec_ilbc.so
- CFLAGS+=-fPIC
--CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include")
--CFLAGS+=$(shell [ -f /usr/local/include/speex/speex.h ] && echo "-I/usr/local/include/speex")
--CFLAGS+=$(shell [ -f /usr/include/speex/speex.h ] && echo "-I/usr/include/speex")
-+CFLAGS+=-I$(LOCALBASE)/include
+
+$FreeBSD$
+
+--- codecs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ codecs/Makefile Fri Jan 13 10:33:21 2006
+@@ -30,8 +30,8 @@
- LIBG723=g723.1/libg723.a
- LIBG723B=g723.1b/libg723b.a
- LIBGSM=gsm/lib/libgsm.a
- LIBGSMT=gsm/lib/libgsm.a
+ UI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex.h)
+ UIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex/speex.h)
+-ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex.h)
+-ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex/speex.h)
++ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex.h)
++ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex/speex.h)
+ ifneq (${UI_SPEEX},)
+ MODSPEEX=codec_speex.so
+ LIBSPEEX+=-lspeex -lm
+@@ -43,14 +43,14 @@
+ endif
+ ifneq (${ULI_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+ ifneq (${ULIS_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/speex
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+
+@@ -65,7 +65,7 @@
LIBLPC10=lpc10/liblpc10.a
--LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
-+LIBSPEEX=-L$(LOCALBASE)/lib
- LIBSPEEX+=-lspeex -lm
- LIBILBC=ilbc/libilbc.a
--CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
-+CODECS+=$(MODG723) $(MODG729) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
- codec_adpcm.so codec_ulaw.so codec_alaw.so codec_a_mu.so \
- codec_g726.so
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
-@@ -93,7 +91,7 @@
+ CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
+@@ -126,7 +126,7 @@
endif
install: all
diff --git a/net/asterisk-bristuff/files/patch-codecs::codec_g723_1_dummy.c b/net/asterisk-bristuff/files/patch-codecs::codec_g723_1_dummy.c
deleted file mode 100644
index 3ce9571..0000000
--- a/net/asterisk-bristuff/files/patch-codecs::codec_g723_1_dummy.c
+++ /dev/null
@@ -1,314 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g723_1_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g723_1_dummy.c Sun Oct 10 16:07:05 2004
-@@ -0,0 +1,308 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.723.1 (dummy!)
-+ *
-+ * The G.723.1 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#define TYPE_HIGH 0x0
-+#define TYPE_LOW 0x1
-+#define TYPE_SILENCE 0x2
-+#define TYPE_DONTSEND 0x3
-+#define TYPE_MASK 0x3
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g723_ex.h"
-+#include "g723_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.723.1/PCM16 Codec Translator";
-+
-+struct g723_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g723_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g723tolin_new()
-+{
-+ struct g723_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog723_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g723_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g723_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g723_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g723tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G723_1;
-+ f.datalen = sizeof(g723_slin_ex);
-+ /* All frames are 30 ms long */
-+ f.samples = 30;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g723_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog723_new()
-+{
-+ struct g723_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g723tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g723_len(unsigned char buf)
-+{
-+ switch(buf & TYPE_MASK) {
-+ case TYPE_DONTSEND:
-+ return 2;
-+ break;
-+ case TYPE_SILENCE:
-+ return 4;
-+ break;
-+ case TYPE_HIGH:
-+ return 24;
-+ break;
-+ case TYPE_LOW:
-+ return 20;
-+ break;
-+ default:
-+ ast_log(LOG_WARNING, "Badly encoded frame (%d)\n", buf & TYPE_MASK);
-+ }
-+ return -1;
-+}
-+
-+static int g723tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ int len = 0;
-+ int res;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ res = g723_len(((unsigned char *)f->data + len)[0]);
-+ if (res < 0) {
-+ ast_log(LOG_WARNING, "Invalid data\n");
-+ return -1;
-+ }
-+ if (res + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 480 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 480);
-+ tmp->tail+=480;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += res;
-+ }
-+ return 0;
-+}
-+
-+static int lintog723_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog723_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 480)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G723_1;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 480) {
-+ /* Encode a frame of data */
-+ if (cnt + 24 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 24);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 30;
-+ cnt += 24;
-+ tmp->tail -= 480;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 480, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g723_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g723tolin =
-+ { "g723tolin_dummy",
-+ AST_FORMAT_G723_1, AST_FORMAT_SLINEAR,
-+ g723tolin_new,
-+ g723tolin_framein,
-+ g723tolin_frameout,
-+ g723_destroy,
-+ g723tolin_sample
-+ };
-+
-+static struct ast_translator lintog723 =
-+ { "lintog723_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G723_1,
-+ lintog723_new,
-+ lintog723_framein,
-+ lintog723_frameout,
-+ g723_destroy,
-+ lintog723_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog723);
-+ if (!res)
-+ res = ast_unregister_translator(&g723tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g723tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog723);
-+ else
-+ ast_unregister_translator(&g723tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk-bristuff/files/patch-codecs::codec_g729_dummy.c b/net/asterisk-bristuff/files/patch-codecs::codec_g729_dummy.c
deleted file mode 100644
index 9fcc7b1..0000000
--- a/net/asterisk-bristuff/files/patch-codecs::codec_g729_dummy.c
+++ /dev/null
@@ -1,281 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g729_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g729_dummy.c Sun Oct 10 16:07:12 2004
-@@ -0,0 +1,275 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.729 (dummy!)
-+ *
-+ * The G.729 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g729_ex.h"
-+#include "g729_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.729/PCM16 Codec Translator";
-+
-+struct g729_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g729_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g729tolin_new()
-+{
-+ struct g729_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog729_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g729_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g729_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g729_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g729tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G729A;
-+ f.datalen = sizeof(g729_slin_ex);
-+ /* All frames are 10 ms long */
-+ f.samples = 10;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g729_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog729_new()
-+{
-+ struct g729_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g729tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g729tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ int len = 0;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ if (10 + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 160 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 160);
-+ tmp->tail+=160;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += 10;
-+ }
-+ return 0;
-+}
-+
-+static int lintog729_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog729_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 160)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G729A;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 160) {
-+ /* Encode a frame of data */
-+ if (cnt + 10 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 10);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 10;
-+ cnt += 10;
-+ tmp->tail -= 160;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 160, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g729_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g729tolin =
-+ { "g729tolin_dummy",
-+ AST_FORMAT_G729A, AST_FORMAT_SLINEAR,
-+ g729tolin_new,
-+ g729tolin_framein,
-+ g729tolin_frameout,
-+ g729_destroy,
-+ g729tolin_sample
-+ };
-+
-+static struct ast_translator lintog729 =
-+ { "lintog729_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G729A,
-+ lintog729_new,
-+ lintog729_framein,
-+ lintog729_frameout,
-+ g729_destroy,
-+ lintog729_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog729);
-+ if (!res)
-+ res = ast_unregister_translator(&g729tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g729tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog729);
-+ else
-+ ast_unregister_translator(&g729tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk-bristuff/files/patch-codecs::g729_slin_ex.h b/net/asterisk-bristuff/files/patch-codecs::g729_slin_ex.h
deleted file mode 100644
index 44e60f2..0000000
--- a/net/asterisk-bristuff/files/patch-codecs::g729_slin_ex.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/g729_slin_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,14 @@
-+/*
-+ * g729_slin_ex.h --
-+ *
-+ * 8-bit G.729 data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Copyright (C) 2004, Maxim Sobolev <sobomax@FreeBSD.org>
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static unsigned char g729_slin_ex[] = {
-+120,82,175,64,0,250,219,0,7,214
-+};
diff --git a/net/asterisk-bristuff/files/patch-codecs::ilbc::Makefile b/net/asterisk-bristuff/files/patch-codecs::ilbc::Makefile
index 7770e07..26a2f20 100644
--- a/net/asterisk-bristuff/files/patch-codecs::ilbc::Makefile
+++ b/net/asterisk-bristuff/files/patch-codecs::ilbc::Makefile
@@ -1,11 +1,12 @@
$FreeBSD$
---- codecs/ilbc/Makefile.orig Sun Apr 27 21:13:11 2003
-+++ codecs/ilbc/Makefile Fri Jan 30 01:47:34 2004
-@@ -1,4 +1,4 @@
--CFLAGS+= -fPIC -O3
-+CFLAGS+= -fPIC
- LIB=libilbc.a
-
- OBJS= anaFilter.o iCBSearch.o packing.o \
+--- codecs/ilbc/Makefile.orig Fri Jan 13 11:01:07 2006
++++ codecs/ilbc/Makefile Fri Jan 13 11:01:51 2006
+@@ -1,5 +1,5 @@
+ ARCH=$(PROC)
+-CFLAGS+=-Wall -O3 -funroll-loops
++CFLAGS+=-Wall -funroll-loops
+ ifneq (${OSARCH},CYGWIN)
+ CFLAGS += -fPIC
+ endif
diff --git a/net/asterisk-bristuff/files/patch-codecs::slin_g729_ex.h b/net/asterisk-bristuff/files/patch-codecs::slin_g729_ex.h
deleted file mode 100644
index e1236d2..0000000
--- a/net/asterisk-bristuff/files/patch-codecs::slin_g729_ex.h
+++ /dev/null
@@ -1,31 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/slin_g729_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,25 @@
-+/*
-+ * slin_g729_ex.h --
-+ *
-+ * Signed 16-bit audio data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Source: g723.example
-+ *
-+ * Copyright (C) 2001, Linux Support Services, Inc.
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static signed short slin_g729_ex[] = {
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-+};
diff --git a/net/asterisk-bristuff/files/patch-configs::musiconhold.conf.sample b/net/asterisk-bristuff/files/patch-configs::musiconhold.conf.sample
new file mode 100644
index 0000000..ff63cc9
--- /dev/null
+++ b/net/asterisk-bristuff/files/patch-configs::musiconhold.conf.sample
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- configs/musiconhold.conf.sample.orig Tue Nov 29 20:24:39 2005
++++ configs/musiconhold.conf.sample Fri Jan 13 11:38:39 2006
+@@ -4,7 +4,7 @@
+
+ [default]
+ mode=quietmp3
+-directory=/var/lib/asterisk/mohmp3
++directory=/usr/local/share/asterisk/mohmp3
+
+ ; valid mode options:
+ ; quietmp3 -- default
diff --git a/net/asterisk-bristuff/files/patch-db.c b/net/asterisk-bristuff/files/patch-db.c
index 6c2bdcd..ba7f3f2 100644
--- a/net/asterisk-bristuff/files/patch-db.c
+++ b/net/asterisk-bristuff/files/patch-db.c
@@ -1,14 +1,21 @@
$FreeBSD$
---- db.c.orig Fri Jul 9 13:08:09 2004
-+++ db.c Sun Oct 10 15:32:33 2004
-@@ -33,7 +33,7 @@
- #include <asterisk/cli.h>
- #include <asterisk/utils.h>
- #include <asterisk/lock.h>
--#include "db1-ast/include/db.h"
+--- db.c.orig Fri Jan 13 11:05:32 2006
++++ db.c Fri Jan 13 11:06:55 2006
+@@ -35,6 +35,7 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <dirent.h>
+#include <db.h>
+
#include "asterisk.h"
- #include "astconf.h"
+@@ -51,7 +52,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
+ #include "asterisk/utils.h"
+ #include "asterisk/lock.h"
+ #include "asterisk/manager.h"
+-#include "db1-ast/include/db.h"
+
+ #ifdef __CYGWIN__
+ #define dbopen __dbopen
diff --git a/net/asterisk-bristuff/files/patch-formats::Makefile b/net/asterisk-bristuff/files/patch-formats::Makefile
index dacfd7b..b2b1db5 100644
--- a/net/asterisk-bristuff/files/patch-formats::Makefile
+++ b/net/asterisk-bristuff/files/patch-formats::Makefile
@@ -1,19 +1,19 @@
$FreeBSD$
---- formats/Makefile.orig Tue Nov 4 04:40:09 2003
-+++ formats/Makefile Fri Jan 30 01:47:34 2004
-@@ -18,7 +18,7 @@
+--- formats/Makefile.orig Fri Jan 13 11:16:07 2006
++++ formats/Makefile Fri Jan 13 11:47:25 2006
+@@ -20,7 +20,7 @@
#
- # G723 simple frame is depricated
+ # G723 simple frame is deprecated
#
--#FORMAT_LIBS+=format_g723.so
+-FORMAT_LIBS+=format_g723.so
+FORMAT_LIBS+=format_g723_1.so
- GSMLIB=../codecs/gsm/lib/libgsm.a
-
-@@ -40,7 +40,7 @@
- $(CC) $(SOLINK) -o $@ $< -lm
+ #
+ # OGG/Vorbis format
+@@ -60,7 +60,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -logg -lvorbis -lvorbisenc -lm
install: all
- for x in $(FORMAT_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
diff --git a/net/asterisk-bristuff/files/patch-formats::format_g723_1.c b/net/asterisk-bristuff/files/patch-formats::format_g723_1.c
index fb5eb12..ae814f1 100644
--- a/net/asterisk-bristuff/files/patch-formats::format_g723_1.c
+++ b/net/asterisk-bristuff/files/patch-formats::format_g723_1.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- formats/format_g723_1.c.orig Sun Oct 10 15:59:18 2004
-+++ formats/format_g723_1.c Sun Oct 10 16:05:05 2004
-@@ -0,0 +1,345 @@
+--- /dev/null Fri Jan 13 12:18:51 2006
++++ formats/format_g723_1.c Fri Jan 13 12:18:41 2006
+@@ -0,0 +1,348 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -16,6 +16,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/channel.h>
+#include <asterisk/file.h>
@@ -26,7 +27,6 @@ $FreeBSD$
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <sys/time.h>
-+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
@@ -48,7 +48,7 @@ $FreeBSD$
+struct ast_filestream {
+ void *reserved[AST_RESERVED_POINTERS];
+ /* This is what a filestream means to us */
-+ int fd; /* Descriptor */
++ FILE *f; /* Descriptor */
+ struct ast_frame fr; /* Frame information */
+ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
+ char empty; /* Empty character */
@@ -85,7 +85,7 @@ $FreeBSD$
+ return -1;
+}
+
-+static struct ast_filestream *g723_open(int fd)
++static struct ast_filestream *g723_open(FILE *f)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -98,7 +98,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ tmp->fr.data = tmp->g723;
+ tmp->fr.frametype = AST_FRAME_VOICE;
+ tmp->fr.subclass = AST_FORMAT_G723_1;
@@ -112,7 +112,7 @@ $FreeBSD$
+ return tmp;
+}
+
-+static struct ast_filestream *g723_rewrite(int fd, char *comment)
++static struct ast_filestream *g723_rewrite(FILE *f, const char *comment)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -125,7 +125,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ glistcnt++;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
@@ -143,7 +143,7 @@ $FreeBSD$
+ glistcnt--;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
-+ close(s->fd);
++ fclose(s->f);
+ free(s);
+ s = NULL;
+}
@@ -158,7 +158,7 @@ $FreeBSD$
+ s->fr.samples = 240;
+ s->fr.mallocd = 0;
+ s->fr.data = s->g723;
-+ if ((res = read(s->fd, s->g723, 1)) != 1) {
++ if ((res = fread(s->g723, 1, 1, s->f)) != 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -168,7 +168,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 frame!\n");
+ return NULL;
+ }
-+ if (s->fr.datalen > 1 && (res = read(s->fd, s->g723 + 1, s->fr.datalen - 1)) != s->fr.datalen - 1) {
++ if (s->fr.datalen > 1 && (res = fread(s->g723 + 1, 1, s->fr.datalen - 1, s->f)) != s->fr.datalen - 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -200,7 +200,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 data length, %d\n", f->datalen);
+ return -1;
+ }
-+ if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
++ if ((res = fwrite(f->data, 1, f->datalen, fs->f)) != f->datalen) {
+ ast_log(LOG_WARNING, "Bad write %d: %s\n", res, strerror(errno));
+ return -1;
+ }
@@ -229,10 +229,13 @@ $FreeBSD$
+ }
+ offset = cur + sample_offset;
+ }
-+ if ((moffset = lseek(fs->fd, 0, SEEK_END)) == -1) {
++ if (fseeko(fs->f, 0, SEEK_END) == -1) {
+ ast_log(LOG_WARNING, "Can't seek stream to an end!\n");
+ return -1;
+ }
++ else {
++ moffset = ftello(fs->f);
++ }
+ if (whence == SEEK_END) {
+ if ((max = g723_tell(fs)) == -1) {
+ ast_log(LOG_WARNING, "Can't get maximum position!\n");
@@ -244,11 +247,11 @@ $FreeBSD$
+ offset = 0;
+ soffset = -1;
+ for (coffset = 0; coffset < moffset && offset > 0; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %lli!\n", coffset);
+ return -1;
+ }
@@ -260,7 +263,7 @@ $FreeBSD$
+ if (res > 1)
+ offset -= 240;
+ }
-+ if (soffset != -1 && lseek(fs->fd, soffset, SEEK_SET) != soffset) {
++ if (soffset != -1 && fseeko(fs->f, soffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", soffset);
+ return -1;
+ }
@@ -271,7 +274,7 @@ $FreeBSD$
+static int g723_trunc(struct ast_filestream *fs)
+{
+ /* Truncate file to current length */
-+ if (ftruncate(fs->fd, lseek(fs->fd, 0, SEEK_CUR)) < 0)
++ if (ftruncate(fileno(fs->f), ftello(fs->f)) < 0)
+ return -1;
+ return 0;
+}
@@ -283,14 +286,14 @@ $FreeBSD$
+ long rval;
+ unsigned char c;
+
-+ offset = lseek(fs->fd, 0, SEEK_CUR);
++ offset = ftello(fs->f);
+ rval = 0;
+ for (coffset = 0; coffset < offset; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %llu!\n", coffset);
+ return -1;
+ }
@@ -301,7 +304,7 @@ $FreeBSD$
+ if (res > 1)
+ rval += 240;
+ }
-+ if (lseek(fs->fd, offset, SEEK_SET) != offset) {
++ if (fseeko(fs->f, offset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", offset);
+ return -1;
+ }
diff --git a/net/asterisk-bristuff/files/patch-formats::format_g729.c b/net/asterisk-bristuff/files/patch-formats::format_g729.c
index 78899a3..11be528 100644
--- a/net/asterisk-bristuff/files/patch-formats::format_g729.c
+++ b/net/asterisk-bristuff/files/patch-formats::format_g729.c
@@ -1,6 +1,9 @@
---- formats/format_g729.c.orig Mon Feb 7 10:29:19 2005
-+++ formats/format_g729.c Wed Mar 9 06:26:36 2005
-@@ -44,7 +44,7 @@
+
+$FreeBSD$
+
+--- formats/format_g729.c.orig Fri Jan 13 12:20:53 2006
++++ formats/format_g729.c Fri Jan 13 12:23:33 2006
+@@ -60,7 +60,7 @@ struct ast_filestream {
struct ast_frame fr; /* Frame information */
char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
char empty; /* Empty character */
@@ -9,7 +12,7 @@
};
-@@ -125,11 +125,11 @@
+@@ -141,11 +141,11 @@ static struct ast_frame *g729_read(struc
s->fr.frametype = AST_FRAME_VOICE;
s->fr.subclass = AST_FORMAT_G729A;
s->fr.offset = AST_FRIENDLY_OFFSET;
@@ -19,24 +22,24 @@
+ s->fr.datalen = 10;
s->fr.mallocd = 0;
s->fr.data = s->g729;
-- if ((res = read(s->fd, s->g729, 20)) != 20) {
-+ if ((res = read(s->fd, s->g729, 10)) != 10) {
+- if ((res = fread(s->g729, 1, 20, s->f)) != 20) {
++ if ((res = fread(s->g729, 1, 10, s->f)) != 10) {
if (res && (res != 10))
ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
return NULL;
-@@ -173,7 +173,7 @@
- cur = lseek(fs->fd, 0, SEEK_CUR);
- max = lseek(fs->fd, 0, SEEK_END);
+@@ -190,7 +190,7 @@ static int g729_seek(struct ast_filestre
+ fseek(fs->f, 0, SEEK_END);
+ max = ftell(fs->f);
- bytes = 20 * (sample_offset / 160);
+ bytes = 10 * (sample_offset / 80);
if (whence == SEEK_SET)
offset = bytes;
else if (whence == SEEK_CUR || whence == SEEK_FORCECUR)
-@@ -202,7 +202,7 @@
+@@ -219,7 +219,7 @@ static long g729_tell(struct ast_filestr
{
off_t offset;
- offset = lseek(fs->fd, 0, SEEK_CUR);
+ offset = ftell(fs->f);
- return (offset/20)*160;
+ return (offset/10)*80;
}
diff --git a/net/asterisk-bristuff/files/patch-funcs::Makefile b/net/asterisk-bristuff/files/patch-funcs::Makefile
new file mode 100644
index 0000000..a14daee
--- /dev/null
+++ b/net/asterisk-bristuff/files/patch-funcs::Makefile
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- funcs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ funcs/Makefile Fri Jan 13 12:36:57 2006
+@@ -67,7 +67,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
+
+ install: all
+- for x in $(FUNCS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
++ for x in $(FUNCS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
+
+ ifneq ($(wildcard .depend),)
+ include .depend
diff --git a/net/asterisk-bristuff/files/patch-pbx::Makefile b/net/asterisk-bristuff/files/patch-pbx::Makefile
index dca6672..97d03e1 100644
--- a/net/asterisk-bristuff/files/patch-pbx::Makefile
+++ b/net/asterisk-bristuff/files/patch-pbx::Makefile
@@ -1,18 +1,20 @@
$FreeBSD$
---- pbx/Makefile.orig Sun Oct 26 20:50:49 2003
-+++ pbx/Makefile Fri Jan 30 01:47:34 2004
-@@ -16,7 +16,7 @@
- PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so # pbx_gtkconsole.so pbx_kdeconsole.so
-
- # Add GTK console if appropriate
--PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
-+#PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
+--- pbx/Makefile.orig
++++ pbx/Makefile
+@@ -23,8 +23,8 @@
# Add KDE Console if appropriate
#PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so")
-@@ -62,7 +62,7 @@
+-GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
+-GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
++#GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
++#GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
+ MOC=$(QTDIR)/bin/moc
+ KDE_FLAGS=-I$(KDEDIR)/include -I$(KDEDIR)/include/kde -I$(QTDIR)/include
+ KDE_LIBS=-L$(KDEDIR)/lib -L$(QTDIR)/lib -lqt -lkdecore -lkdeui
+@@ -72,7 +72,7 @@
endif
install: all
diff --git a/net/asterisk-bristuff/files/patch-pbx::pbx_wilcalu.c b/net/asterisk-bristuff/files/patch-pbx::pbx_wilcalu.c
deleted file mode 100644
index 41722c6..0000000
--- a/net/asterisk-bristuff/files/patch-pbx::pbx_wilcalu.c
+++ /dev/null
@@ -1,14 +0,0 @@
---- pbx/pbx_wilcalu.c.orig Tue Apr 26 10:00:28 2005
-+++ pbx/pbx_wilcalu.c Tue Apr 26 10:03:42 2005
-@@ -82,6 +82,11 @@
- fds[0].events = POLLIN;
- poll(fds, 1, -1);
- bytes=read(fd,buf,256);
-+ if (bytes <= 0) {
-+ /* XXX error on device, sleep a bit before retrying */
-+ sleep(1);
-+ continue;
-+ }
- buf[(int)bytes]=0;
-
- if(bytes>0){
diff --git a/net/asterisk-bristuff/files/patch-res-res_watchdog.c b/net/asterisk-bristuff/files/patch-res-res_watchdog.c
deleted file mode 100644
index 51e4b0a..0000000
--- a/net/asterisk-bristuff/files/patch-res-res_watchdog.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- res/res_watchdog.c.orig Fri Jul 15 13:24:24 2005
-+++ res/res_watchdog.c Fri Jul 15 13:24:42 2005
-@@ -40,6 +40,10 @@
-
- /* Registrar for operations */
-
-+#ifndef O_SYNC
-+#define O_SYNC O_FSYNC
-+#endif
-+
- static struct watchdog_pvt *watchdogs = NULL;
-
- STANDARD_LOCAL_USER;
diff --git a/net/asterisk-bristuff/files/patch-res::Makefile b/net/asterisk-bristuff/files/patch-res::Makefile
index 3e48e84..de5c365 100644
--- a/net/asterisk-bristuff/files/patch-res::Makefile
+++ b/net/asterisk-bristuff/files/patch-res::Makefile
@@ -1,33 +1,35 @@
---- res/Makefile.orig Tue Aug 9 17:18:55 2005
-+++ res/Makefile Tue Aug 9 17:33:36 2005
-@@ -13,15 +13,18 @@
+
+$FreeBSD$
+
+--- res/Makefile
++++ res/Makefile
+@@ -37,8 +37,8 @@
+ endif
- MODS=res_adsi.so res_features.so res_crypto.so res_musiconhold.so res_indications.so res_monitor.so \
- res_agi.so res_watchdog.so
--MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
--MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/include/osp/osp.h" ]; then echo "res_osp.so"; fi)
-
- CRYPTO_LIBS=-lssl -lcrypto
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ ifeq (${OSARCH},CYGWIN)
+@@ -55,9 +55,7 @@
CFLAGS+=
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH")
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPATA_MOH
-+endif
- #
- # Work around buggy RedHat 9.0
+
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
+ CFLAGS+=-DZAPATA_MOH
+-endif
+ endif # WITHOUT_ZAPTEL
+
#
-@@ -34,7 +37,7 @@
+@@ -75,7 +73,7 @@
rm -f $(DESTDIR)$(ASTHEADERDIR)/parking.h
rm -f $(DESTDIR)$(MODULES_DIR)/app_agi.so
rm -f $(DESTDIR)$(MODULES_DIR)/res_parking.so
- for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(MODS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- res_crypto.so: res_crypto.o
- $(CC) $(SOLINK) -o $@ $< $(CRYPTO_LIBS)
+ @if [ x`which mpg123 2>/dev/null | grep -v '^no'` != x ] ; then \
+ if mpg123 --longhelp 2>&1 | grep -q .59r 2>&1 >/dev/null ; then echo ; else \
+ echo "*************************************************************";\
diff --git a/net/asterisk-bristuff/files/patch-rtp.c b/net/asterisk-bristuff/files/patch-rtp.c
index c652add..bbc2649 100644
--- a/net/asterisk-bristuff/files/patch-rtp.c
+++ b/net/asterisk-bristuff/files/patch-rtp.c
@@ -1,23 +1,17 @@
---- rtp.c.orig Tue Apr 26 10:00:28 2005
-+++ rtp.c Tue Apr 26 10:06:35 2005
-@@ -127,7 +127,7 @@
- {
- switch(buf & TYPE_MASK) {
- case TYPE_DONTSEND:
-- return 0;
-+ return 2;
- break;
- case TYPE_SILENCE:
- return 4;
-@@ -862,8 +858,10 @@
- /* Must be an even port number by RTP spec */
+
+$FreeBSD$
+
+--- rtp.c.orig Fri Jan 13 13:38:01 2006
++++ rtp.c Fri Jan 13 13:40:50 2006
+@@ -950,8 +950,10 @@ struct ast_rtp *ast_rtp_new_with_bindadd
rtp->us.sin_port = htons(x);
rtp->us.sin_addr = addr;
+ /* If there's rtcp, initialize it as well. */
- if (rtp->rtcp)
+ if (rtp->rtcp) {
rtp->rtcp->us.sin_port = htons(x + 1);
+ rtp->rtcp->us.sin_addr = addr;
+ }
+ /* Try to bind it/them. */
if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) &&
(!rtp->rtcp || !bind(rtp->rtcp->s, (struct sockaddr *)&rtp->rtcp->us, sizeof(rtp->rtcp->us))))
- break;
diff --git a/net/asterisk-bristuff/files/patch-utils::Makefile b/net/asterisk-bristuff/files/patch-utils::Makefile
new file mode 100644
index 0000000..f3164c0
--- /dev/null
+++ b/net/asterisk-bristuff/files/patch-utils::Makefile
@@ -0,0 +1,34 @@
+
+$FreeBSD$
+
+--- utils/Makefile
++++ utils/Makefile
+@@ -17,16 +17,16 @@
+ CFLAGS+=-DNO_AST_MM
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+ TARGET=stereorize streamplayer
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/popt.h),)
+ TARGET+=smsq
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/newt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/newt.h),)
+ TARGET+=astman
+ endif
+
+@@ -40,7 +40,7 @@
+ install:
+ for x in $(TARGET); do \
+ if [ "$$x" != "none" ]; then \
+- $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
++ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
+ fi; \
+ done
+
diff --git a/net/asterisk-bristuff/pkg-plist b/net/asterisk-bristuff/pkg-plist
index 019b270..702370a 100644
--- a/net/asterisk-bristuff/pkg-plist
+++ b/net/asterisk-bristuff/pkg-plist
@@ -19,6 +19,12 @@ etc/asterisk/asterisk.adsi-dist
@unexec if cmp -s %D/etc/asterisk/asterisk.conf %D/etc/asterisk/asterisk.conf-dist; then rm -f %D/etc/asterisk/asterisk.conf; fi
etc/asterisk/asterisk.conf-dist
@exec [ -f %B/asterisk.conf ] || cp %B/%f %B/asterisk.conf
+@unexec if cmp -s %D/etc/asterisk/cdr.conf %D/etc/asterisk/cdr.conf-dist; then rm -f %D/etc/asterisk/cdr.conf; fi
+etc/asterisk/cdr.conf-dist
+@exec [ -f %B/cdr.conf ] || cp %B/%f %B/cdr.conf
+@unexec if cmp -s %D/etc/asterisk/cdr_custom.conf %D/etc/asterisk/cdr_custom.conf-dist; then rm -f %D/etc/asterisk/cdr_custom.conf; fi
+etc/asterisk/cdr_custom.conf-dist
+@exec [ -f %B/cdr_custom.conf ] || cp %B/%f %B/cdr_custom.conf
@unexec if cmp -s %D/etc/asterisk/cdr_manager.conf %D/etc/asterisk/cdr_manager.conf-dist; then rm -f %D/etc/asterisk/cdr_manager.conf; fi
etc/asterisk/cdr_manager.conf-dist
@exec [ -f %B/cdr_manager.conf ] || cp %B/%f %B/cdr_manager.conf
@@ -31,9 +37,21 @@ etc/asterisk/cdr_pgsql.conf-dist
@unexec if cmp -s %D/etc/asterisk/cdr_tds.conf %D/etc/asterisk/cdr_tds.conf-dist; then rm -f %D/etc/asterisk/cdr_tds.conf; fi
etc/asterisk/cdr_tds.conf-dist
@exec [ -f %B/cdr_tds.conf ] || cp %B/%f %B/cdr_tds.conf
+@unexec if cmp -s %D/etc/asterisk/codecs.conf %D/etc/asterisk/codecs.conf-dist; then rm -f %D/etc/asterisk/codecs.conf; fi
+etc/asterisk/codecs.conf-dist
+@exec [ -f %B/codecs.conf ] || cp %B/%f %B/codecs.conf
+@unexec if cmp -s %D/etc/asterisk/dnsmgr.conf %D/etc/asterisk/dnsmgr.conf-dist; then rm -f %D/etc/asterisk/dnsmgr.conf; fi
+etc/asterisk/dnsmgr.conf-dist
+@exec [ -f %B/dnsmgr.conf ] || cp %B/%f %B/dmsmgr.conf
+@unexec if cmp -s %D/etc/asterisk/dundi.conf %D/etc/asterisk/dundi.conf-dist; then rm -f %D/etc/asterisk/dundi.conf; fi
+etc/asterisk/dundi.conf-dist
+@exec [ -f %B/dundi.conf ] || cp %B/%f %B/dundi.conf
@unexec if cmp -s %D/etc/asterisk/enum.conf %D/etc/asterisk/enum.conf-dist; then rm -f %D/etc/asterisk/enum.conf; fi
etc/asterisk/enum.conf-dist
@exec [ -f %B/enum.conf ] || cp %B/%f %B/enum.conf
+@unexec if cmp -s %D/etc/asterisk/extensions.ael %D/etc/asterisk/extensions.ael-dist; then rm -f %D/etc/asterisk/extensions.ael; fi
+etc/asterisk/extensions.ael-dist
+@exec [ -f %B/extensions.ael ] || cp %B/%f %B/extensions.ael
@unexec if cmp -s %D/etc/asterisk/extconfig.conf %D/etc/asterisk/extconfig.conf-dist; then rm -f %D/etc/asterisk/extconfig.conf; fi
etc/asterisk/extconfig.conf-dist
@exec [ -f %B/extconfig.conf ] || cp %B/%f %B/extconfig.conf
@@ -46,9 +64,6 @@ etc/asterisk/features.conf-dist
@unexec if cmp -s %D/etc/asterisk/festival.conf %D/etc/asterisk/festival.conf-dist; then rm -f %D/etc/asterisk/festival.conf; fi
etc/asterisk/festival.conf-dist
@exec [ -f %B/festival.conf ] || cp %B/%f %B/festival.conf
-@unexec if cmp -s %D/etc/asterisk/h323.conf %D/etc/asterisk/h323.conf-dist; then rm -f %D/etc/asterisk/h323.conf; fi
-etc/asterisk/h323.conf-dist
-@exec [ -f %B/h323.conf ] || cp %B/%f %B/h323.conf
@unexec if cmp -s %D/etc/asterisk/iax.conf %D/etc/asterisk/iax.conf-dist; then rm -f %D/etc/asterisk/iax.conf; fi
etc/asterisk/iax.conf-dist
@exec [ -f %B/iax.conf ] || cp %B/%f %B/iax.conf
@@ -70,6 +85,9 @@ etc/asterisk/meetme.conf-dist
@unexec if cmp -s %D/etc/asterisk/mgcp.conf %D/etc/asterisk/mgcp.conf-dist; then rm -f %D/etc/asterisk/mgcp.conf; fi
etc/asterisk/mgcp.conf-dist
@exec [ -f %B/mgcp.conf ] || cp %B/%f %B/mgcp.conf
+@unexec if cmp -s %D/etc/asterisk/misdn.conf %D/etc/asterisk/misdn.conf-dist; then rm -f %D/etc/asterisk/misdn.conf; fi
+etc/asterisk/misdn.conf-dist
+@exec [ -f %B/misdn.conf ] || cp %B/%f %B/misdn.conf
@unexec if cmp -s %D/etc/asterisk/modem.conf %D/etc/asterisk/modem.conf-dist; then rm -f %D/etc/asterisk/modem.conf; fi
etc/asterisk/modem.conf-dist
@exec [ -f %B/modem.conf ] || cp %B/%f %B/modem.conf
@@ -94,9 +112,6 @@ etc/asterisk/privacy.conf-dist
@unexec if cmp -s %D/etc/asterisk/queues.conf %D/etc/asterisk/queues.conf-dist; then rm -f %D/etc/asterisk/queues.conf; fi
etc/asterisk/queues.conf-dist
@exec [ -f %B/queues.conf ] || cp %B/%f %B/queues.conf
-@unexec if cmp -s %D/etc/asterisk/res_config_odbc.conf %D/etc/asterisk/res_config_odbc.conf-dist; then rm -f %D/etc/asterisk/res_config_odbc.conf; fi
-etc/asterisk/res_config_odbc.conf-dist
-@exec [ -f %B/res_config_odbc.conf ] || cp %B/%f %B/res_config_odbc.conf
@unexec if cmp -s %D/etc/asterisk/res_odbc.conf %D/etc/asterisk/res_odbc.conf-dist; then rm -f %D/etc/asterisk/res_odbc.conf; fi
etc/asterisk/res_odbc.conf-dist
@exec [ -f %B/res_odbc.conf ] || cp %B/%f %B/res_odbc.conf
@@ -109,6 +124,9 @@ etc/asterisk/rtp.conf-dist
@unexec if cmp -s %D/etc/asterisk/sip.conf %D/etc/asterisk/sip.conf-dist; then rm -f %D/etc/asterisk/sip.conf; fi
etc/asterisk/sip.conf-dist
@exec [ -f %B/sip.conf ] || cp %B/%f %B/sip.conf
+@unexec if cmp -s %D/etc/asterisk/sip_notify.conf %D/etc/asterisk/sip_notify.conf-dist; then rm -f %D/etc/asterisk/sip_notify.conf; fi
+etc/asterisk/sip_notify.conf-dist
+@exec [ -f %B/sip_notify.conf ] || cp %B/%f %B/sip_notify.conf
@unexec if cmp -s %D/etc/asterisk/skinny.conf %D/etc/asterisk/skinny.conf-dist; then rm -f %D/etc/asterisk/skinny.conf; fi
etc/asterisk/skinny.conf-dist
@exec [ -f %B/skinny.conf ] || cp %B/%f %B/skinny.conf
@@ -121,9 +139,6 @@ etc/asterisk/voicemail.conf-dist
@unexec if cmp -s %D/etc/asterisk/vpb.conf %D/etc/asterisk/vpb.conf-dist; then rm -f %D/etc/asterisk/vpb.conf; fi
etc/asterisk/vpb.conf-dist
@exec [ -f %B/vpb.conf ] || cp %B/%f %B/vpb.conf
-@unexec if cmp -s %D/etc/asterisk/watchdog.conf %D/etc/asterisk/watchdog.conf-dist; then rm -f %D/etc/asterisk/watchdog.conf; fi
-etc/asterisk/watchdog.conf-dist
-@exec [ -f %B/watchdog.conf ] || cp %B/%f %B/watchdog.conf
@unexec if cmp -s %D/etc/asterisk/zapata.conf %D/etc/asterisk/zapata.conf-dist; then rm -f %D/etc/asterisk/zapata.conf; fi
etc/asterisk/zapata.conf-dist
@exec [ -f %B/zapata.conf ] || cp %B/%f %B/zapata.conf
@@ -136,28 +151,36 @@ include/asterisk/app.h
include/asterisk/ast_expr.h
include/asterisk/astdb.h
include/asterisk/astmm.h
+include/asterisk/astobj.h
include/asterisk/astosp.h
+include/asterisk/build.h
include/asterisk/callerid.h
include/asterisk/causes.h
include/asterisk/cdr.h
include/asterisk/channel.h
-include/asterisk/channel_pvt.h
+include/asterisk/chanspy.h
include/asterisk/chanvars.h
include/asterisk/cli.h
+include/asterisk/compat.h
include/asterisk/config.h
-include/asterisk/config_pvt.h
+include/asterisk/compiler.h
include/asterisk/crypto.h
-include/asterisk/cvsid.h
+include/asterisk/devicestate.h
include/asterisk/dlfcn-compat.h
include/asterisk/dns.h
+include/asterisk/dnsmgr.h
+include/asterisk/doxyref.h
include/asterisk/dsp.h
+include/asterisk/dundi.h
include/asterisk/enum.h
+include/asterisk/endian.h
include/asterisk/features.h
include/asterisk/file.h
include/asterisk/frame.h
include/asterisk/fskmodem.h
include/asterisk/image.h
include/asterisk/indications.h
+include/asterisk/inline_api.h
include/asterisk/io.h
include/asterisk/linkedlists.h
include/asterisk/localtime.h
@@ -168,38 +191,50 @@ include/asterisk/md5.h
include/asterisk/module.h
include/asterisk/monitor.h
include/asterisk/musiconhold.h
+include/asterisk/netsock.h
include/asterisk/options.h
include/asterisk/pbx.h
+include/asterisk/plc.h
include/asterisk/poll-compat.h
include/asterisk/privacy.h
include/asterisk/res_odbc.h
include/asterisk/rtp.h
include/asterisk/say.h
include/asterisk/sched.h
+include/asterisk/slinfactory.h
include/asterisk/srv.h
+include/asterisk/strings.h
include/asterisk/tdd.h
include/asterisk/term.h
+include/asterisk/time.h
include/asterisk/transcap.h
include/asterisk/translate.h
include/asterisk/ulaw.h
+include/asterisk/unaligned.h
include/asterisk/utils.h
+include/asterisk/version.h
include/asterisk/vmodem.h
lib/asterisk/modules/app_adsiprog.so
lib/asterisk/modules/app_alarmreceiver.so
lib/asterisk/modules/app_authenticate.so
lib/asterisk/modules/app_cdr.so
lib/asterisk/modules/app_chanisavail.so
+lib/asterisk/modules/app_chanspy.so
lib/asterisk/modules/app_controlplayback.so
+lib/asterisk/modules/app_curl.so
lib/asterisk/modules/app_cut.so
lib/asterisk/modules/app_db.so
-lib/asterisk/modules/app_devstate.so
lib/asterisk/modules/app_dial.so
+lib/asterisk/modules/app_dictate.so
+lib/asterisk/modules/app_directed_pickup.so
lib/asterisk/modules/app_directory.so
lib/asterisk/modules/app_disa.so
+lib/asterisk/modules/app_dumpchan.so
lib/asterisk/modules/app_echo.so
lib/asterisk/modules/app_enumlookup.so
lib/asterisk/modules/app_eval.so
lib/asterisk/modules/app_exec.so
+lib/asterisk/modules/app_externalivr.so
lib/asterisk/modules/app_festival.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_flash.so
lib/asterisk/modules/app_forkcdr.so
@@ -208,64 +243,66 @@ lib/asterisk/modules/app_groupcount.so
lib/asterisk/modules/app_hasnewvoicemail.so
lib/asterisk/modules/app_ices.so
lib/asterisk/modules/app_image.so
-lib/asterisk/modules/app_intercom.so
lib/asterisk/modules/app_lookupblacklist.so
lib/asterisk/modules/app_lookupcidname.so
lib/asterisk/modules/app_macro.so
+lib/asterisk/modules/app_math.so
+lib/asterisk/modules/app_md5.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_meetme.so
lib/asterisk/modules/app_milliwatt.so
+lib/asterisk/modules/app_mixmonitor.so
lib/asterisk/modules/app_mp3.so
lib/asterisk/modules/app_nbscat.so
+%%WITH_ZAPTEL%%lib/asterisk/modules/app_page.so
lib/asterisk/modules/app_parkandannounce.so
-lib/asterisk/modules/app_pickup.so
lib/asterisk/modules/app_playback.so
lib/asterisk/modules/app_privacy.so
-lib/asterisk/modules/app_qcall.so
lib/asterisk/modules/app_queue.so
lib/asterisk/modules/app_random.so
lib/asterisk/modules/app_read.so
+lib/asterisk/modules/app_readfile.so
+lib/asterisk/modules/app_realtime.so
lib/asterisk/modules/app_record.so
%%WITH_FAX%%lib/asterisk/modules/app_rxfax.so
lib/asterisk/modules/app_sayunixtime.so
-lib/asterisk/modules/app_segfault.so
lib/asterisk/modules/app_senddtmf.so
lib/asterisk/modules/app_sendtext.so
lib/asterisk/modules/app_setcallerid.so
lib/asterisk/modules/app_setcdruserfield.so
lib/asterisk/modules/app_setcidname.so
lib/asterisk/modules/app_setcidnum.so
+lib/asterisk/modules/app_setrdnis.so
lib/asterisk/modules/app_settransfercapability.so
lib/asterisk/modules/app_sms.so
lib/asterisk/modules/app_softhangup.so
-lib/asterisk/modules/app_striplsd.so
-lib/asterisk/modules/app_substring.so
+lib/asterisk/modules/app_stack.so
lib/asterisk/modules/app_system.so
lib/asterisk/modules/app_talkdetect.so
lib/asterisk/modules/app_test.so
lib/asterisk/modules/app_transfer.so
-lib/asterisk/modules/app_txtcidname.so
%%WITH_FAX%%lib/asterisk/modules/app_txfax.so
+lib/asterisk/modules/app_txtcidname.so
lib/asterisk/modules/app_url.so
lib/asterisk/modules/app_userevent.so
lib/asterisk/modules/app_verbose.so
lib/asterisk/modules/app_voicemail.so
lib/asterisk/modules/app_waitforring.so
+lib/asterisk/modules/app_waitforsilence.so
+lib/asterisk/modules/app_while.so
lib/asterisk/modules/app_zapateller.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapbarge.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapras.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapscan.so
lib/asterisk/modules/cdr_csv.so
+lib/asterisk/modules/cdr_custom.so
lib/asterisk/modules/cdr_manager.so
%%WITH_ODBC%%lib/asterisk/modules/cdr_odbc.so
lib/asterisk/modules/chan_agent.so
+lib/asterisk/modules/chan_features.so
%%WITH_H323%%lib/asterisk/modules/chan_h323.so
lib/asterisk/modules/chan_iax2.so
lib/asterisk/modules/chan_local.so
lib/asterisk/modules/chan_mgcp.so
-lib/asterisk/modules/chan_modem.so
-lib/asterisk/modules/chan_modem_aopen.so
-lib/asterisk/modules/chan_modem_bestdata.so
-lib/asterisk/modules/chan_modem_i4l.so
lib/asterisk/modules/chan_oss.so
lib/asterisk/modules/chan_sip.so
lib/asterisk/modules/chan_skinny.so
@@ -273,14 +310,13 @@ lib/asterisk/modules/chan_skinny.so
lib/asterisk/modules/codec_a_mu.so
lib/asterisk/modules/codec_adpcm.so
lib/asterisk/modules/codec_alaw.so
-lib/asterisk/modules/codec_g723_1_dummy.so
lib/asterisk/modules/codec_g726.so
-lib/asterisk/modules/codec_g729_dummy.so
lib/asterisk/modules/codec_gsm.so
lib/asterisk/modules/codec_ilbc.so
lib/asterisk/modules/codec_lpc10.so
lib/asterisk/modules/codec_speex.so
lib/asterisk/modules/codec_ulaw.so
+lib/asterisk/modules/format_au.so
lib/asterisk/modules/format_g723_1.so
lib/asterisk/modules/format_g726.so
lib/asterisk/modules/format_g729.so
@@ -294,22 +330,34 @@ lib/asterisk/modules/format_sln.so
lib/asterisk/modules/format_vox.so
lib/asterisk/modules/format_wav.so
lib/asterisk/modules/format_wav_gsm.so
+lib/asterisk/modules/func_callerid.so
+lib/asterisk/modules/func_enum.so
+lib/asterisk/modules/func_uri.so
+lib/asterisk/modules/pbx_ael.so
lib/asterisk/modules/pbx_config.so
+lib/asterisk/modules/pbx_dundi.so
+lib/asterisk/modules/pbx_functions.so
+lib/asterisk/modules/pbx_loopback.so
+lib/asterisk/modules/pbx_realtime.so
lib/asterisk/modules/pbx_spool.so
-lib/asterisk/modules/pbx_wilcalu.so
lib/asterisk/modules/res_adsi.so
lib/asterisk/modules/res_agi.so
+lib/asterisk/modules/res_config_odbc.so
lib/asterisk/modules/res_crypto.so
lib/asterisk/modules/res_features.so
lib/asterisk/modules/res_indications.so
lib/asterisk/modules/res_monitor.so
+lib/asterisk/modules/res_odbc.so
lib/asterisk/modules/res_musiconhold.so
-lib/asterisk/modules/res_watchdog.so
sbin/asterisk
sbin/astgenkey
sbin/astman
sbin/autosupport
+sbin/rasterisk
sbin/safe_asterisk
+sbin/smsq
+sbin/stereorize
+sbin/streamplayer
%%DATADIR%%/agi-bin/agi-test.agi
%%DATADIR%%/agi-bin/eagi-sphinx-test
%%DATADIR%%/agi-bin/eagi-test
@@ -330,23 +378,34 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/auth-incorrect.gsm
%%DATADIR%%/sounds/auth-thankyou.gsm
%%DATADIR%%/sounds/beep.gsm
+%%DATADIR%%/sounds/beeperr.gsm
%%DATADIR%%/sounds/conf-adminmenu.gsm
%%DATADIR%%/sounds/conf-enteringno.gsm
%%DATADIR%%/sounds/conf-errormenu.gsm
%%DATADIR%%/sounds/conf-getchannel.gsm
%%DATADIR%%/sounds/conf-getconfno.gsm
%%DATADIR%%/sounds/conf-getpin.gsm
+%%DATADIR%%/sounds/conf-hasjoin.gsm
+%%DATADIR%%/sounds/conf-hasleft.gsm
%%DATADIR%%/sounds/conf-invalid.gsm
%%DATADIR%%/sounds/conf-invalidpin.gsm
%%DATADIR%%/sounds/conf-kicked.gsm
+%%DATADIR%%/sounds/conf-leaderhasleft.gsm
%%DATADIR%%/sounds/conf-locked.gsm
%%DATADIR%%/sounds/conf-lockednow.gsm
%%DATADIR%%/sounds/conf-muted.gsm
%%DATADIR%%/sounds/conf-noempty.gsm
+%%DATADIR%%/sounds/conf-onlyone.gsm
%%DATADIR%%/sounds/conf-onlyperson.gsm
+%%DATADIR%%/sounds/conf-otherinparty.gsm
+%%DATADIR%%/sounds/conf-placeintoconf.gsm
+%%DATADIR%%/sounds/conf-thereare.gsm
%%DATADIR%%/sounds/conf-unlockednow.gsm
%%DATADIR%%/sounds/conf-unmuted.gsm
%%DATADIR%%/sounds/conf-usermenu.gsm
+%%DATADIR%%/sounds/conf-userswilljoin.gsm
+%%DATADIR%%/sounds/conf-userwilljoin.gsm
+%%DATADIR%%/sounds/conf-waitforleader.gsm
%%DATADIR%%/sounds/demo-abouttotry.gsm
%%DATADIR%%/sounds/demo-congrats.gsm
%%DATADIR%%/sounds/demo-echodone.gsm
@@ -357,6 +416,18 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/demo-nogo.gsm
%%DATADIR%%/sounds/demo-nomatch.gsm
%%DATADIR%%/sounds/demo-thanks.gsm
+%%DATADIR%%/sounds/dictate/both_help.gsm
+%%DATADIR%%/sounds/dictate/enter_filename.gsm
+%%DATADIR%%/sounds/dictate/forhelp.gsm
+%%DATADIR%%/sounds/dictate/pause.gsm
+%%DATADIR%%/sounds/dictate/paused.gsm
+%%DATADIR%%/sounds/dictate/play_help.gsm
+%%DATADIR%%/sounds/dictate/playback.gsm
+%%DATADIR%%/sounds/dictate/playback_mode.gsm
+%%DATADIR%%/sounds/dictate/record.gsm
+%%DATADIR%%/sounds/dictate/record_help.gsm
+%%DATADIR%%/sounds/dictate/record_mode.gsm
+%%DATADIR%%/sounds/dictate/truncating_audio.gsm
%%DATADIR%%/sounds/digits/0.gsm
%%DATADIR%%/sounds/digits/1.gsm
%%DATADIR%%/sounds/digits/10.gsm
@@ -445,6 +516,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/dir-intro.gsm
%%DATADIR%%/sounds/dir-nomatch.gsm
%%DATADIR%%/sounds/dir-nomore.gsm
+%%DATADIR%%/sounds/hello-world.gsm
%%DATADIR%%/sounds/invalid.gsm
%%DATADIR%%/sounds/letters/a.gsm
%%DATADIR%%/sounds/letters/at.gsm
@@ -512,6 +584,10 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/phonetic/x_p.gsm
%%DATADIR%%/sounds/phonetic/y_p.gsm
%%DATADIR%%/sounds/phonetic/z_p.gsm
+%%DATADIR%%/sounds/priv-callee-options.gsm
+%%DATADIR%%/sounds/priv-callpending.gsm
+%%DATADIR%%/sounds/priv-introsaved.gsm
+%%DATADIR%%/sounds/priv-recordintro.gsm
%%DATADIR%%/sounds/privacy-incorrect.gsm
%%DATADIR%%/sounds/privacy-prompt.gsm
%%DATADIR%%/sounds/privacy-thankyou.gsm
@@ -520,10 +596,21 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/queue-holdtime.gsm
%%DATADIR%%/sounds/queue-less-than.gsm
%%DATADIR%%/sounds/queue-minutes.gsm
+%%DATADIR%%/sounds/queue-periodic-announce.gsm
+%%DATADIR%%/sounds/queue-reporthold.gsm
%%DATADIR%%/sounds/queue-seconds.gsm
%%DATADIR%%/sounds/queue-thankyou.gsm
%%DATADIR%%/sounds/queue-thereare.gsm
%%DATADIR%%/sounds/queue-youarenext.gsm
+%%DATADIR%%/sounds/screen-callee-options.gsm
+%%DATADIR%%/sounds/spy-agent.gsm
+%%DATADIR%%/sounds/spy-h323.gsm
+%%DATADIR%%/sounds/spy-iax.gsm
+%%DATADIR%%/sounds/spy-iax2.gsm
+%%DATADIR%%/sounds/spy-mgcp.gsm
+%%DATADIR%%/sounds/spy-sip.gsm
+%%DATADIR%%/sounds/spy-skinny.gsm
+%%DATADIR%%/sounds/spy-zap.gsm
%%DATADIR%%/sounds/ss-noservice.gsm
%%DATADIR%%/sounds/transfer.gsm
%%DATADIR%%/sounds/tt-allbusy.gsm
@@ -531,7 +618,6 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/tt-monkeysintro.gsm
%%DATADIR%%/sounds/tt-somethingwrong.gsm
%%DATADIR%%/sounds/tt-weasels.gsm
-%%DATADIR%%/sounds/vm
%%DATADIR%%/sounds/vm-Cust1.gsm
%%DATADIR%%/sounds/vm-Cust2.gsm
%%DATADIR%%/sounds/vm-Cust3.gsm
@@ -553,6 +639,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-extension.gsm
%%DATADIR%%/sounds/vm-first.gsm
%%DATADIR%%/sounds/vm-for.gsm
+%%DATADIR%%/sounds/vm-forward.gsm
%%DATADIR%%/sounds/vm-forwardoptions.gsm
%%DATADIR%%/sounds/vm-from-extension.gsm
%%DATADIR%%/sounds/vm-from-phonenumber.gsm
@@ -571,10 +658,12 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-mailboxfull.gsm
%%DATADIR%%/sounds/vm-message.gsm
%%DATADIR%%/sounds/vm-messages.gsm
+%%DATADIR%%/sounds/vm-minutes.gsm
%%DATADIR%%/sounds/vm-mismatch.gsm
%%DATADIR%%/sounds/vm-msginstruct.gsm
%%DATADIR%%/sounds/vm-msgsaved.gsm
%%DATADIR%%/sounds/vm-newpassword.gsm
+%%DATADIR%%/sounds/vm-newuser.gsm
%%DATADIR%%/sounds/vm-next.gsm
%%DATADIR%%/sounds/vm-no.gsm
%%DATADIR%%/sounds/vm-nobodyavail.gsm
@@ -592,6 +681,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-reachoper.gsm
%%DATADIR%%/sounds/vm-rec-busy.gsm
%%DATADIR%%/sounds/vm-rec-name.gsm
+%%DATADIR%%/sounds/vm-rec-temp.gsm
%%DATADIR%%/sounds/vm-rec-unv.gsm
%%DATADIR%%/sounds/vm-received.gsm
%%DATADIR%%/sounds/vm-reenterpassword.gsm
@@ -605,6 +695,9 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-sorry.gsm
%%DATADIR%%/sounds/vm-star-cancel.gsm
%%DATADIR%%/sounds/vm-starmain.gsm
+%%DATADIR%%/sounds/vm-tempgreeting.gsm
+%%DATADIR%%/sounds/vm-tempgreeting2.gsm
+%%DATADIR%%/sounds/vm-tempremoved.gsm
%%DATADIR%%/sounds/vm-then-pound.gsm
%%DATADIR%%/sounds/vm-theperson.gsm
%%DATADIR%%/sounds/vm-tocallback.gsm
@@ -624,9 +717,11 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-whichbox.gsm
%%DATADIR%%/sounds/vm-youhave.gsm
%%DATADIR%%/sounds/voicemail
+@dirrm %%DATADIR%%/sounds/dictate
@dirrm %%DATADIR%%/sounds/phonetic
@dirrm %%DATADIR%%/sounds/letters
@dirrm %%DATADIR%%/sounds/digits
+@dirrm %%DATADIR%%/sounds/priv-callerintros
@dirrm %%DATADIR%%/sounds
@dirrm %%DATADIR%%/mohmp3
@dirrm %%DATADIR%%/keys
@@ -641,11 +736,14 @@ sbin/safe_asterisk
@dirrm etc/asterisk
@unexec rm -f %D/%%DATADIR%%/astdb
@cwd /var
-spool/asterisk/vm
spool/asterisk/voicemail/default/1234/busy.gsm
spool/asterisk/voicemail/default/1234/unavail.gsm
@exec mkdir -p %D/log/asterisk/cdr-csv
@exec mkdir -p %D/spool/asterisk/voicemail/default/1234/INBOX
+@dirrm spool/asterisk/dictate
+@dirrm spool/asterisk/meetme
+@dirrm spool/asterisk/monitor
+@dirrm spool/asterisk/system
@dirrm spool/asterisk/voicemail/default/1234/INBOX
@dirrm spool/asterisk/voicemail/default/1234
@dirrm spool/asterisk/voicemail/default
@@ -653,4 +751,5 @@ spool/asterisk/voicemail/default/1234/unavail.gsm
@dirrm spool/asterisk/tmp
@dirrm spool/asterisk
@dirrm log/asterisk/cdr-csv
+@dirrm log/asterisk/cdr-custom
@dirrm log/asterisk
diff --git a/net/asterisk-devel/Makefile b/net/asterisk-devel/Makefile
index 276aa57..3cfbf7e 100644
--- a/net/asterisk-devel/Makefile
+++ b/net/asterisk-devel/Makefile
@@ -6,30 +6,24 @@
#
PORTNAME= asterisk
-PORTVERSION= 1.0.9
-PORTREVISION= 2
+PORTVERSION= 1.2.1
CATEGORIES= net
MASTER_SITES= http://ftp.digium.com/pub/asterisk/ \
http://ftp.digium.com/pub/asterisk/old-releases/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/old-releases/
-PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
-PATCH_SITES= ${MASTER_SITE_LOCAL}
-PATCH_SITE_SUBDIR= fjoe
-PATCH_DIST_STRIP= -p1
-
MAINTAINER= sobomax@FreeBSD.org
COMMENT= An Open Source PBX and telephony toolkit
BUILD_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
LIB_DEPENDS= speex.3:${PORTSDIR}/audio/speex \
- newt.51:${PORTSDIR}/devel/newt
+ newt.51:${PORTSDIR}/devel/newt \
+ curl.3:${PORTSDIR}/ftp/curl
RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
ONLY_FOR_ARCHS= i386 sparc64 amd64
-BRIVER= bristuff-0.2.0-RC8h
GNU_CONFIGURE= yes
CONFIGURE_WRKSRC= ${WRKSRC}/editline
USE_GMAKE= yes
@@ -44,7 +38,7 @@ MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
OSVERSION=${OSVERSION} \
CXX="${CXX}"
-MAN8= asterisk.8
+MAN8= asterisk.8 astgenkey.8 autosupport.8 safe_asterisk.8
.include <bsd.port.pre.mk>
@@ -68,8 +62,9 @@ MAKE_ENV+= WITH_H323=1
.if defined(WITHOUT_ZAPTEL)
PLIST_SUB+= WITH_ZAPTEL="@comment "
.else
+BUILD_DEPENDS+= libpri>=1.2.0:${PORTSDIR}/misc/libpri \
+ ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
LIB_DEPENDS+= pri.1:${PORTSDIR}/misc/libpri
-BUILD_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
RUN_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
PLIST_SUB+= WITH_ZAPTEL=""
MAKE_ENV+= WITH_ZAPTEL=1
@@ -86,10 +81,6 @@ PLIST_SUB+= WITH_ODBC=""
MAKE_ENV+= WITH_ODBC=1
.endif
-.if !defined(WITHOUT_MYSQL)
-USE_MYSQL= yes
-.endif
-
.if defined(WITHOUT_FAX)
PLIST_SUB+= WITH_FAX="@comment "
.else
@@ -99,7 +90,6 @@ PLIST_SUB+= WITH_FAX=""
.endif
post-patch:
- ${CP} ${FILESDIR}/chan_oss.c ${WRKSRC}/channels
${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample
.include <bsd.port.post.mk>
diff --git a/net/asterisk-devel/distinfo b/net/asterisk-devel/distinfo
index 9ef6daa..9d56959 100644
--- a/net/asterisk-devel/distinfo
+++ b/net/asterisk-devel/distinfo
@@ -1,4 +1,3 @@
-MD5 (asterisk-1.0.9.tar.gz) = 0d7f1c680ae53a739f26a069ef8b580a
-SIZE (asterisk-1.0.9.tar.gz) = 9604582
-MD5 (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 42172c5b04af9080f22b883296c34002
-SIZE (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 56589
+MD5 (asterisk-1.2.1.tar.gz) = 04657086791e80f319c0d728af705001
+SHA256 (asterisk-1.2.1.tar.gz) = f0d3ed36353c1f5726225d2794bea7d1d1a92c9e58336b02b293f43dd4b97948
+SIZE (asterisk-1.2.1.tar.gz) = 10517194
diff --git a/net/asterisk-devel/files/chan_oss.c b/net/asterisk-devel/files/chan_oss.c
deleted file mode 100644
index 95a9236..0000000
--- a/net/asterisk-devel/files/chan_oss.c
+++ /dev/null
@@ -1,1327 +0,0 @@
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * Copyright (C) 1999, Mark Spencer
- *
- * Mark Spencer <markster@linux-support.net>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- *
- * FreeBSD changes and multiple device support by Luigi Rizzo, 2005.05.02
- * note-this code best seen with ts=8 (8-spaces tabs) in the editor
- */
-
-#include <asterisk/lock.h>
-#include <asterisk/frame.h>
-#include <asterisk/logger.h>
-#include <asterisk/channel.h>
-#include <asterisk/module.h>
-#include <asterisk/channel_pvt.h>
-#include <asterisk/options.h>
-#include <asterisk/pbx.h>
-#include <asterisk/config.h>
-#include <asterisk/cli.h>
-#include <asterisk/utils.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h> /* for isalnum */
-#ifdef __linux
-#include <linux/soundcard.h>
-#elif defined(__FreeBSD__)
-#include <sys/soundcard.h>
-#else
-#include <soundcard.h>
-#endif
-#include "busy.h"
-#include "ringtone.h"
-#include "ring10.h"
-#include "answer.h"
-
-/*
- * Helper macros to parse config arguments. They will go in a common
- * header file if their usage is globally accepted. In the meantime,
- * we define them here. Typical usage is as below, WITHOUT ; on each line.
- *
- * {
- * M_START(v->name, v->value)
- *
- * M_BOOL("dothis", x->flag1)
- * M_STR("name", x->somestring)
- * M_F("bar", some_c_code)
- * M_END(some_final_statement)
- */
-#define M_START(var, val) \
- char *__s = var; char *__val = val;
-#define M_END(x) x;
-#define M_F(tag, f) if (!strcasecmp((__s), tag)) { f; } else
-#define M_BOOL(tag, dst) M_F(tag, (dst) = ast_true(__val) )
-#define M_UINT(tag, dst) M_F(tag, (dst) = strtoul(__val, NULL, 0) )
-#define M_STR(tag, dst) M_F(tag, strncpy(dst, __val, sizeof(dst) - 1) )
-
-
-/* Which device to use */
-#if defined( __OpenBSD__ ) || defined( __NetBSD__ )
-#define DEV_DSP "/dev/audio"
-#else
-#define DEV_DSP "/dev/dsp"
-#endif
-
-/*
- * Basic mode of operation:
- *
- * we have one keyboard (which receives commands from the keyboard)
- * and multiple headset's connected to audio cards. Headsets are named as
- * the sections of oss.conf
- *
- * At any time, the keyboard is attached to one headset, and you
- * can switch among them using the 'console' command.
- *
- * The following parameters are important for the configuration of
- * the device:
- *
- * FRAME_SIZE the size of an audio frame, in samples.
- * 160 is used almost universally, so you should not change it.
- *
- * FRAGS the argument for the SETFRAGMENT ioctl.
- * Overridden by the 'frags' parameter in oss.conf
- *
- * Bits 0-7 are the base-2 log of the device's block size,
- * bits 16-31 are the number of blocks in the driver's queue.
- * There are a lot of differences in the way this parameter
- * is supported by different drivers, so you may need to
- * experiment a bit with the value.
- * A good default for linux is 30 blocks of 64 bytes, which
- * results in 6 frames of 320 bytes (160 samples).
- * FreeBSD works decently with blocks of 256 or 512 bytes,
- * leaving the number unspecified.
- * Note that this only refers to the device buffer size,
- * this module will then try to keep the lenght of audio
- * buffered within small constraints.
- *
- * QUEUE_SIZE The max number of blocks actually allowed in the device
- * driver's buffer, irrespective of the available number.
- * Overridden by the 'queuesize' parameter in oss.conf
- *
- * Should be >=2, and at most as large as the hw queue above
- * (otherwise it will never be full).
- */
-
-#define FRAME_SIZE 160
-#define QUEUE_SIZE 10
-
-#if defined(__FreeBSD__)
-#define FRAGS 0x8
-#else
-#define FRAGS ( ( (6 * 5) << 16 ) | 0x6 )
-#endif
-
-
-/* Don't switch between read/write modes faster than every 300 ms */
-#define MIN_SWITCH_TIME 300
-
-
-static int usecnt;
-AST_MUTEX_DEFINE_STATIC(usecnt_lock);
-
-static char *desc = "OSS Console Channel Driver";
-static char *tdesc = "OSS Console Channel Driver";
-static char *config = "oss.conf"; /* default config file */
-
-static int oss_debug;
-
-/*
- * Each sound is made of 'datalen' samples of sound, repeated as needed to
- * generate 'samplen' samples of data, then followed by 'silencelen' samples
- * of silence. The loop is repeated if 'repeat' is set.
- */
-struct sound {
- int ind;
- char *desc;
- short *data;
- int datalen;
- int samplen;
- int silencelen;
- int repeat;
-};
-
-static struct sound sounds[] = {
- { AST_CONTROL_RINGING, "RINGING", ringtone, sizeof(ringtone)/2, 16000, 32000, 1 },
- { AST_CONTROL_BUSY, "BUSY", busy, sizeof(busy)/2, 4000, 4000, 1 },
- { AST_CONTROL_CONGESTION, "CONGESTION", busy, sizeof(busy)/2, 2000, 2000, 1 },
- { AST_CONTROL_RING, "RING10", ring10, sizeof(ring10)/2, 16000, 32000, 1 },
- { AST_CONTROL_ANSWER, "ANSWER", answer, sizeof(answer)/2, 2200, 0, 0 },
- { -1, NULL, 0, 0, 0, 0 }, /* end marker */
-};
-
-
-/*
- * descriptor for one of our channels.
- * There is one used for 'default' values (from the [general] entry in
- * the configuration file, and then one instance for each device
- * (the default is cloned from [general], others are only created
- * if the relevant section exists.
- */
-struct chan_oss_pvt {
- struct chan_oss_pvt *next;
-
- char *type;
- char *name;
- /*
- * cursound indicates which in struct sound we play. -1 means nothing,
- * any other value is a valid sound, in which case sampsent indicates
- * the next sample to send in [0..samplen + silencelen]
- * nosound is set to disable the audio data from the channel
- * (so we can play the tones etc.).
- */
- int sndcmd[2]; /* Sound command pipe */
- int cursound; /* index of sound to send */
- int sampsent; /* # of sound samples sent */
- int nosound; /* set to block audio from the PBX */
-
- int total_blocks; /* total blocks in the output device */
- int sounddev;
- enum { M_UNSET, M_FULL, M_READ, M_WRITE } duplex;
- int autoanswer;
- int autohangup;
- int hookstate;
- struct timeval lasttime; /* last setformat */
- char *mixer_cmd; /* initial command to issue to the mixer */
- unsigned int queuesize; /* max fragments in queue */
- unsigned int frags; /* parameter for SETFRAGMENT */
-
- int warned; /* various flags used for warnings */
-#define WARN_used_blocks 1
-#define WARN_speed 2
-#define WARN_frag 4
- int w_errors; /* overfull in the write path */
-
- int silencesuppression;
- int silencethreshold;
- int playbackonly;
- char device[64]; /* device to open */
-
- pthread_t sthread;
-
- struct ast_channel *owner;
- char ext[AST_MAX_EXTENSION];
- char ctx[AST_MAX_EXTENSION];
- char language[MAX_LANGUAGE];
-
- /* buffers used in oss_write */
- char oss_write_buf[FRAME_SIZE*2];
- int oss_write_dst;
- /* buffers used in oss_read - AST_FRIENDLY_OFFSET space for headers
- * plus enough room for a full frame
- */
- char oss_read_buf[FRAME_SIZE * 2 + AST_FRIENDLY_OFFSET];
- int readpos; /* read position above */
- struct ast_frame read_f; /* returned by oss_read */
-};
-
-static struct chan_oss_pvt oss_default = {
- .type = "Console",
- .cursound = -1,
- .sounddev = -1,
- .duplex = M_UNSET, /* XXX check this */
- .autoanswer = 1,
- .autohangup = 1,
- .queuesize = QUEUE_SIZE,
- .frags = FRAGS,
- .silencethreshold = 1000, /* currently unused */
- .ext = "s",
- .ctx = "default",
- .readpos = AST_FRIENDLY_OFFSET, /* start here on reads */
-};
-
-static char *oss_active; /* the active device */
-
-/*
- * returns true if too early to switch
- */
-static int too_early(struct chan_oss_pvt *o)
-{
- struct timeval tv;
- int ms;
- gettimeofday(&tv, NULL);
- ms = (tv.tv_sec - o->lasttime.tv_sec) * 1000 +
- (tv.tv_usec - o->lasttime.tv_usec) / 1000;
- if (ms < MIN_SWITCH_TIME)
- return -1;
- return 0;
-}
-
-/*
- * Returns the number of blocks used in the audio output channel
- */
-static int used_blocks(struct chan_oss_pvt *o)
-{
- struct audio_buf_info info;
-
- if (ioctl(o->sounddev, SNDCTL_DSP_GETOSPACE, &info)) {
- if (! (o->warned & WARN_used_blocks)) {
- ast_log(LOG_WARNING, "Error reading output space\n");
- o->warned |= WARN_used_blocks;
- }
- return 1;
- }
- if (o->total_blocks == 0) {
- if (0) /* debugging */
- ast_log(LOG_WARNING, "fragtotal %d size %d avail %d\n",
- info.fragstotal,
- info.fragsize,
- info.fragments);
- o->total_blocks = info.fragments;
- }
- return o->total_blocks - info.fragments;
-}
-
-static int soundcard_writeframe(struct chan_oss_pvt *o, short *data)
-{
- /* Write an exactly FRAME_SIZE sized frame */
- int res;
-
- /*
- * Nothing complex to manage the audio device queue.
- * If the buffer is full just drop the extra, otherwise write.
- * XXX in some cases it might be useful to write anyways after
- * a number of failures, to restart the output chain.
- */
- res = used_blocks(o);
- if (res > o->queuesize) { /* no room to write a block */
- if (o->w_errors++ == 0 && (oss_debug & 0x4))
- ast_log(LOG_WARNING, "write: used %d blocks (%d)\n",
- res, o->w_errors);
- return 0;
- }
- o->w_errors = 0;
- res = write(o->sounddev, ((void *)data), FRAME_SIZE * 2);
- return res;
-}
-
-/*
- * handler for 'sound writable' events from the sound thread.
- * Builds a frame from the high level description of the sounds,
- * and passes it to the audio device.
- * The actual sound is made of 1 or more sequences of sound samples
- * (s->datalen, repeated to make s->samplen samples) followed by
- * s->silencelen samples of silence. The position in the sequence is stored
- * in o->sampsent, which goes between 0 .. s->samplen+s->silencelen.
- * In case we fail to write a frame, don't update o->sampsent.
- */
-static void send_sound(struct chan_oss_pvt *o)
-{
- short myframe[FRAME_SIZE];
- int ofs, l, start;
- int l_sampsent = o->sampsent;
- struct sound *s;
-
- if (o->cursound < 0) /* no sound to send */
- return;
- s = &sounds[o->cursound];
- for (ofs = 0; ofs < FRAME_SIZE; ofs += l) {
- l = s->samplen - l_sampsent; /* sound available */
- if (l > 0) {
- start = l_sampsent % s->datalen; /* source offset */
- if (l > FRAME_SIZE - ofs) /* don't overflow the frame */
- l = FRAME_SIZE - ofs;
- if (l > s->datalen - start) /* don't overflow the source */
- l = s->datalen - start;
- bcopy(s->data + start, myframe + ofs, l*2);
- if (0)
- ast_log(LOG_WARNING, "send_sound sound %d/%d of %d into %d\n",
- l_sampsent, l, s->samplen, ofs);
- l_sampsent += l;
- } else { /* no sound, maybe some silence */
- static short silence[FRAME_SIZE] = {0, };
-
- l += s->silencelen;
- if (l > 0) {
- if (l > FRAME_SIZE - ofs)
- l = FRAME_SIZE - ofs;
- bcopy(silence, myframe + ofs, l*2);
- l_sampsent += l;
- } else { /* silence is over, restart sound if loop */
- if (s->repeat == 0) { /* last block */
- o->cursound = -1;
- o->nosound = 0; /* allow audio data */
- if (ofs < FRAME_SIZE) /* pad with silence */
- bcopy(silence, myframe + ofs, (FRAME_SIZE - ofs)*2);
- }
- l_sampsent = 0;
- }
- }
- }
- l = soundcard_writeframe(o, myframe);
- if (l > 0)
- o->sampsent = l_sampsent; /* update status */
-}
-
-static void *sound_thread(void *arg)
-{
- char ign[4096];
- struct chan_oss_pvt *o = (struct chan_oss_pvt *)arg;
-
- /* kick the driver by trying to read from it. Ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- for(;;) {
- fd_set rfds, wfds;
- int maxfd, res;
-
- FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- maxfd = o->sndcmd[0]; /* pipe from the main process */
- FD_SET(o->sndcmd[0], &rfds);
- if (!o->owner) { /* no one owns the audio, so we must drain it */
- FD_SET(o->sounddev, &rfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- if (o->cursound > -1) {
- FD_SET(o->sounddev, &wfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- /* ast_select emulates linux behaviour in terms of timeout handling */
- res = ast_select(maxfd + 1, &rfds, &wfds, NULL, NULL);
- if (res < 1) {
- ast_log(LOG_WARNING, "select failed: %s\n",
- strerror(errno));
- continue;
- }
- if (FD_ISSET(o->sndcmd[0], &rfds)) {
- /* read which sound to play from the pipe */
- int i, what = -1;
-
- read(o->sndcmd[0], &what, sizeof(what));
- for (i = 0; sounds[i].ind != -1; i++) {
- if (sounds[i].ind == what) {
- o->cursound = i;
- o->sampsent = 0;
- o->nosound = 1; /* block audio from pbx */
- break;
- }
- }
- if (sounds[i].ind == -1)
- ast_log(LOG_WARNING, "invalid sound index: %d\n", what);
- }
- if (FD_ISSET(o->sounddev, &rfds)) { /* read and ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- }
- if (FD_ISSET(o->sounddev, &wfds))
- send_sound(o);
- }
- /* Never reached */
- return NULL;
-}
-
-/*
- * reset and close the device if opened,
- * then open and initialize it in the desired mode,
- * trigger reads and writes so we can start using it.
- */
-static int setformat(struct chan_oss_pvt *o, int mode)
-{
- int fmt, desired, res, fd;
-
- if (o->sounddev >= 0) {
- ioctl(o->sounddev, SNDCTL_DSP_RESET, 0);
- close(o->sounddev);
- o->duplex = M_UNSET;
- }
- fd = o->sounddev = open(o->device, mode |O_NONBLOCK);
- if (o->sounddev < 0) {
- ast_log(LOG_WARNING, "Unable to re-open DSP device: %s\n",
- strerror(errno));
- return -1;
- }
-
- gettimeofday(&o->lasttime, NULL);
- fmt = AFMT_S16_LE;
- res = ioctl(fd, SNDCTL_DSP_SETFMT, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set format to 16-bit signed\n");
- return -1;
- }
- switch (mode) {
- case O_RDWR:
- res = ioctl(fd, SNDCTL_DSP_SETDUPLEX, 0);
- /* Check to see if duplex set (FreeBSD Bug)*/
- res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt);
- if (res == 0 && (fmt & DSP_CAP_DUPLEX)) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Console is full duplex\n");
- o->duplex = M_FULL;
- };
- break;
- case O_WRONLY:
- o->duplex = M_WRITE;
- break;
- case O_RDONLY:
- o->duplex = M_READ;
- break;
- }
-
- fmt = 0;
- res = ioctl(fd, SNDCTL_DSP_STEREO, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- /* 8000 Hz desired */
- desired = 8000;
- fmt = desired;
- res = ioctl(fd, SNDCTL_DSP_SPEED, &fmt);
-
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- if (fmt != desired) {
- if (!(o->warned & WARN_speed)) {
- ast_log(LOG_WARNING,
- "Requested %d Hz, got %d Hz -- sound may be choppy\n",
- desired, fmt);
- o->warned |= WARN_speed;
- }
- }
- /*
- * on Freebsd, SETFRAGMENT does not work very well on some cards.
- * Default to use 256 bytes, let the user override
- */
- if (o->frags) {
- fmt = o->frags;
- res = ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &fmt);
- if (res < 0) {
- if (!(o->warned & WARN_frag)) {
- ast_log(LOG_WARNING,
- "Unable to set fragment size -- sound may be choppy\n");
- o->warned |= WARN_frag;
- }
- }
- }
- /* XXX on some cards, we need SNDCTL_DSP_SETTRIGGER to start outputting */
- res = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT;
- res = ioctl(fd, SNDCTL_DSP_SETTRIGGER, &res);
- /* it may fail if we are in half duplex, never mind */
- return 0;
-}
-
-/*
- * make sure output mode is available. Returns 0 if done,
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setoutput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_WRITE && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_WRONLY))
- return -1;
- return 0;
-}
-
-/*
- * make sure input mode is available. Returns 0 if done
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setinput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_READ && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_RDONLY))
- return -1;
- return 0;
-}
-
-/*
- * some of the standard methods supported by channels.
- */
-static int oss_digit(struct ast_channel *c, char digit)
-{
- /* no better use for received digits than print them */
- ast_verbose( " << Console Received digit %c >> \n", digit);
- return 0;
-}
-
-static int oss_text(struct ast_channel *c, char *text)
-{
- /* print received messages */
- ast_verbose( " << Console Received text %s >> \n", text);
- return 0;
-}
-
-/* Play ringtone 'x' on device 'o' */
-#define RING(o, x) { int what = x; write((o)->sndcmd[1], &what, sizeof(what)); }
-
-/*
- * handler for incoming calls. Either autoanswer, or start ringing
- */
-static int oss_call(struct ast_channel *c, char *dest, int timeout)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame f = { 0, };
-
- ast_verbose( " << Call placed to '%s' on console >> \n", dest);
- if (o->autoanswer) {
- ast_verbose( " << Auto-answered >> \n" );
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_ANSWER;
- ast_queue_frame(c, &f);
- } else {
- ast_verbose(" << Type 'answer' to answer, or use 'autoanswer' for future calls >> \n");
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_RINGING;
- ast_queue_frame(c, &f);
- RING(o, AST_CONTROL_RING);
- }
- return 0;
-}
-
-/*
- * remote side answered the phone
- */
-static int oss_answer(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- ast_verbose( " << Console call has been answered >> \n");
-#if 0
- /* play an answer tone (XXX do we really need it ?) */
- RING(o, AST_CONTROL_ANSWER);
-#endif
- ast_setstate(c, AST_STATE_UP);
- o->cursound = -1;
- o->nosound=0;
- return 0;
-}
-
-static int oss_hangup(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- o->cursound = -1;
- c->pvt->pvt = NULL;
- o->owner = NULL;
- ast_verbose( " << Hangup on console >> \n");
- ast_mutex_lock(&usecnt_lock); /* XXX not sure why */
- usecnt--;
- ast_mutex_unlock(&usecnt_lock);
- if (o->hookstate) {
- if (o->autoanswer || o->autohangup) {
- /* Assume auto-hangup too */
- o->hookstate = 0;
- } else {
- /* Make congestion noise */
- RING(o, AST_CONTROL_CONGESTION);
- }
- }
- return 0;
-}
-
-/* used for data coming from the network */
-static int oss_write(struct ast_channel *c, struct ast_frame *f)
-{
- int res;
- int src;
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- /* Immediately return if no sound is enabled */
- if (o->nosound)
- return 0;
- /* Stop any currently playing sound */
- o->cursound = -1;
- if (o->duplex != M_FULL && !o->playbackonly) {
- /* XXX check this, looks weird! */
- /* If we're half duplex, we have to switch to read mode
- to honor immediate needs if necessary */
- res = soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set device to input mode\n");
- return -1;
- }
- return 0;
- }
- res = soundcard_setoutput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set output device\n");
- return -1;
- } else if (res > 0) {
- /* The device is still in read mode, and it's too soon to change it,
- so just pretend we wrote it */
- return 0;
- }
- /*
- * we could receive a sample which is not a multiple of our FRAME_SIZE,
- * so we buffer it locally and write to the device in FRAME_SIZE
- * chunks, keeping the residue stored for future use.
- */
- src = 0; /* read position into f->data */
- while ( src < f->datalen ) {
- /* Compute spare room in the buffer */
- int l = sizeof(o->oss_write_buf) - o->oss_write_dst;
-
- if (f->datalen - src >= l) { /* enough to fill a frame */
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- soundcard_writeframe(o, (short *)o->oss_write_buf);
- src += l;
- o->oss_write_dst = 0;
- } else { /* copy residue */
- l = f->datalen - src;
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- src += l; /* but really, we are done */
- o->oss_write_dst += l;
- }
- }
- return 0;
-}
-
-static struct ast_frame *oss_read(struct ast_channel *c)
-{
- int res;
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame *f = &o->read_f;
-
- /* prepare a NULL frame in case we don't have enough data to return */
- bzero(f, sizeof(struct ast_frame));
- f->frametype = AST_FRAME_NULL;
- f->src = o->type;
-
- res = soundcard_setinput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set input mode\n");
- return NULL;
- } else if (res > 0) { /* too early to switch ? */
- /* Theoretically shouldn't happen, but anyway, return a NULL frame */
- return f;
- }
-
- res = read(o->sounddev, o->oss_read_buf + o->readpos,
- sizeof(o->oss_read_buf) - o->readpos);
- if (res < 0) /* audio data not ready, return a NULL frame */
- return f;
-
- o->readpos += res;
- if (o->readpos < sizeof(o->oss_read_buf)) /* not enough samples */
- return f;
-
- o->readpos = AST_FRIENDLY_OFFSET; /* reset read pointer for next frame */
- if (c->_state != AST_STATE_UP) /* drop data if frame is not up */
- return f;
- /* ok we can build and deliver the frame to the caller */
- f->frametype = AST_FRAME_VOICE;
- f->subclass = AST_FORMAT_SLINEAR;
- f->samples = FRAME_SIZE;
- f->datalen = FRAME_SIZE * 2;
- f->data = o->oss_read_buf + AST_FRIENDLY_OFFSET;
- f->offset = AST_FRIENDLY_OFFSET;
- return f;
-}
-
-static int oss_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
-{
- struct chan_oss_pvt *o = newchan->pvt->pvt;
- o->owner = newchan;
- return 0;
-}
-
-static int oss_indicate(struct ast_channel *c, int cond)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- int res;
-
- switch(cond) {
- case AST_CONTROL_BUSY:
- case AST_CONTROL_CONGESTION:
- case AST_CONTROL_RINGING:
- res = cond;
- break;
- case -1:
- o->cursound = -1;
- return 0;
- default:
- ast_log(LOG_WARNING,
- "Don't know how to display condition %d on %s\n",
- cond, c->name);
- return -1;
- }
- if (res > -1)
- RING(o, res);
- return 0;
-}
-
-static struct ast_channel *oss_new(struct chan_oss_pvt *o,
- char *ext, char *ctx, int state)
-{
- struct ast_channel *c;
- struct ast_channel_pvt *pvt;
-
- c = ast_channel_alloc(1);
- if (c == NULL)
- return NULL;
- snprintf(c->name, sizeof(c->name), "OSS/%s", o->device + 5);
- c->type = o->type;
- c->fds[0] = o->sounddev;
- c->nativeformats = AST_FORMAT_SLINEAR;
- pvt = c->pvt;
- pvt->pvt = o;
-
- /* relevant callbacks */
- pvt->send_digit = oss_digit;
- pvt->send_text = oss_text;
- pvt->hangup = oss_hangup;
- pvt->answer = oss_answer;
- pvt->read = oss_read;
- pvt->call = oss_call;
- pvt->write = oss_write;
- pvt->indicate = oss_indicate;
- pvt->fixup = oss_fixup;
-
-#define S_OVERRIDE(dst, src) \
- { if (src && src[0] != '\0') /* non-empty string */ \
- strncpy((dst), src, sizeof(dst)-1); }
- S_OVERRIDE(c->context, ctx);
- S_OVERRIDE(c->exten, ext);
- S_OVERRIDE(c->language, o->language);
- o->owner = c;
- ast_setstate(c, state);
- ast_mutex_lock(&usecnt_lock);
- usecnt++;
- ast_mutex_unlock(&usecnt_lock);
- ast_update_use_count();
- if (state != AST_STATE_DOWN) {
- if (ast_pbx_start(c)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", c->name);
- ast_hangup(c);
- o->owner = c = NULL;
- /* XXX what about the channel itself ? */
- /* XXX what about usecnt ? */
- }
- }
- return c;
-}
-
-/*
- * returns a pointer to the descriptor with the given name
- */
-static struct chan_oss_pvt *find_desc(char *dev)
-{
- struct chan_oss_pvt *o;
-
- for (o = oss_default.next; o && strcmp(o->name, dev) != 0; o = o->next)
- ;
- if (o == NULL)
- ast_log(LOG_WARNING, "%s could not find <%s>\n", __func__, dev);
- return o;
-}
-
-static struct ast_channel *oss_request(char *type, int format, void *data)
-{
- struct ast_channel *c;
- struct chan_oss_pvt *o = find_desc(data);
-
- ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n",
- type, data, (char *)data);
- if (o == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data);
- /* XXX we could default to 'dsp' perhaps ? */
- return NULL;
- }
- if ((format & AST_FORMAT_SLINEAR) == 0) {
- ast_log(LOG_NOTICE, "Format 0x%x unsupported\n", format);
- return NULL;
- }
- if (o->owner) {
- ast_log(LOG_NOTICE, "Already have a call on the OSS channel\n");
- return NULL;
- }
- c= oss_new(o, NULL, NULL, AST_STATE_DOWN);
- if (c == NULL) {
- ast_log(LOG_WARNING, "Unable to create new OSS channel\n");
- return NULL;
- }
- return c;
-}
-
-static int console_autoanswer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o == NULL) {
- ast_log(LOG_WARNING, "Cannot find device %s (should not happen!)\n",
- oss_active);
- return RESULT_FAILURE;
- }
- if (argc == 1) {
- ast_cli(fd, "Auto answer is %s.\n", o->autoanswer ? "on" : "off");
- return RESULT_SUCCESS;
- }
- if (!strcasecmp(argv[1], "on"))
- o->autoanswer = -1;
- else if (!strcasecmp(argv[1], "off"))
- o->autoanswer = 0;
- else
- return RESULT_SHOWUSAGE;
- return RESULT_SUCCESS;
-}
-
-static char *autoanswer_complete(char *line, char *word, int pos, int state)
-{
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
- int l = strlen(word);
-
- switch(state) {
- case 0:
- if (l && !strncasecmp(word, "on", MIN(l, 2)))
- return strdup("on");
- case 1:
- if (l && !strncasecmp(word, "off", MIN(l, 3)))
- return strdup("off");
- default:
- return NULL;
- }
- return NULL;
-}
-
-static char autoanswer_usage[] =
-"Usage: autoanswer [on|off]\n"
-" Enables or disables autoanswer feature. If used without\n"
-" argument, displays the current on/off status of autoanswer.\n"
-" The default value of autoanswer is in 'oss.conf'.\n";
-
-/*
- * answer command from the console
- */
-static int console_answer(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 1;
- o->cursound = -1;
- ast_queue_frame(o->owner, &f);
- RING(o, AST_CONTROL_ANSWER);
- return RESULT_SUCCESS;
-}
-
-static char sendtext_usage[] =
-"Usage: send text <message>\n"
-" Sends a text message for display on the remote terminal.\n";
-
-static int console_sendtext(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- int tmparg = 2;
- char text2send[256] = "";
- struct ast_frame f = { 0, };
-
- if (argc < 2)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- if (strlen(text2send))
- ast_cli(fd, "Warning: message already waiting to be sent, overwriting\n");
- text2send[0] = '\0';
- while(tmparg < argc) {
- strncat(text2send, argv[tmparg++], sizeof(text2send) - strlen(text2send) - 1);
- strncat(text2send, " ", sizeof(text2send) - strlen(text2send) - 1);
- }
- if (strlen(text2send)) {
- f.frametype = AST_FRAME_TEXT;
- f.subclass = 0;
- f.data = text2send;
- f.datalen = strlen(text2send);
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-static char answer_usage[] =
-"Usage: answer\n"
-" Answers an incoming call on the console (OSS) channel.\n";
-
-static int console_hangup(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner && !o->hookstate) {
- ast_cli(fd, "No call to hangup up\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) {
- ast_queue_hangup(o->owner);
- }
- return RESULT_SUCCESS;
-}
-
-static char hangup_usage[] =
-"Usage: hangup\n"
-" Hangs up any call currently placed on the console.\n";
-
-
-static int console_flash(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_FLASH };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner) { /* XXX maybe !o->hookstate too ? */
- ast_cli(fd, "No call to flash\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) { /* XXX must be true, right ? */
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-
-static char flash_usage[] =
-"Usage: flash\n"
-" Flashes the call currently placed on the console.\n";
-
-
-
-static int console_dial(int fd, int argc, char *argv[])
-{
- char *tmp = NULL, *mye = NULL, *myc = NULL;
- int i;
- struct ast_frame f = { AST_FRAME_DTMF, 0 };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o->owner) { /* already in a call */
- if (argc == 1) { /* argument is mandatory here */
- ast_cli(fd, "Already in a call. You can only dial digits until you hangup.\n");
- return RESULT_FAILURE;
- }
- mye = argv[1];
- /* send the string one char at a time */
- for (i=0; i<strlen(mye); i++) {
- f.subclass = mye[i];
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
- }
- /* if we have an argument split it into extension and context */
-
- if (argc == 2) {
- tmp = myc = strdup(argv[1]); /* make a writable copy */
- mye = strsep(&myc, "@"); /* set exten, advance to context */
- myc = strsep(&myc, "@"); /* set context */
- }
- /* supply default values if needed */
- if (mye == NULL)
- mye = o->ext;
- if (myc == NULL)
- myc = o->ctx;
- if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
- o->hookstate = 1;
- oss_new(o, mye, myc, AST_STATE_RINGING);
- } else
- ast_cli(fd, "No such extension '%s' in context '%s'\n", mye, myc);
- return RESULT_SUCCESS;
-}
-
-static char dial_usage[] =
-"Usage: dial [extension[@context]]\n"
-" Dials a given extensison (and context if specified)\n";
-
-static int console_transfer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- struct ast_channel *b = NULL;
- char *ext, *ctx;
-
- if (argc != 2)
- return RESULT_SHOWUSAGE;
- if (o == NULL)
- return RESULT_FAILURE;
- if (o->owner == NULL || (b = o->owner->bridge) == NULL) {
- ast_cli(fd, "There is no call to transfer\n");
- return RESULT_SUCCESS;
- }
-
- ext = ctx = strdup(argv[1]); /* make a writable copy */
- strsep(&ctx, "@"); /* set exten, advance to context */
- ctx = strsep(&ctx, "@"); /* strip trailing @ and the rest */
-
- if (ctx == NULL) /* supply default context if needed */
- ctx = o->owner->context;
- if (!ast_exists_extension(b, ctx, ext, 1, b->callerid)) {
- ast_cli(fd, "No such extension exists\n");
- } else {
- ast_cli(fd, "Whee, transferring %s to %s@%s.\n", b->name, ext, ctx);
- if (ast_async_goto(b, ctx, ext, 1))
- ast_cli(fd, "Failed to transfer :(\n");
- }
- free(ext);
- return RESULT_SUCCESS;
-}
-
-static char transfer_usage[] =
-"Usage: transfer <extension>[@context]\n"
-" Transfers the currently connected call to the given extension (and\n"
-"context if specified)\n";
-
-static int console_active(int fd, int argc, char *argv[])
-{
- if (argc == 1) {
- ast_cli(fd, "active console is [%s]\n", oss_active);
- } else if (argc != 2) {
- return RESULT_SHOWUSAGE;
- } else {
- struct chan_oss_pvt *o;
- if (strcmp(argv[1], "show") == 0) {
- for (o = oss_default.next; o ; o = o->next)
- ast_cli(fd, "device [%s] exists\n", o->name);
- return RESULT_SUCCESS;
- }
- o = find_desc(argv[1]);
- if (o == NULL)
- ast_cli(fd, "No device [%s] exists\n", argv[1]);
- else
- oss_active = o->name;
- }
- return RESULT_SUCCESS;
-}
-
-static struct ast_cli_entry myclis[] = {
- { { "answer", NULL }, console_answer, "Answer an incoming console call", answer_usage },
- { { "hangup", NULL }, console_hangup, "Hangup a call on the console", hangup_usage },
- { { "flash", NULL }, console_flash, "Flash a call on the console", flash_usage },
- { { "dial", NULL }, console_dial, "Dial an extension on the console", dial_usage },
- { { "transfer", NULL }, console_transfer, "Transfer a call to a different extension", transfer_usage },
- { { "send", "text", NULL }, console_sendtext, "Send text to the remote device", sendtext_usage },
- { { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete },
- { { "console", NULL }, console_active, "Sets/displays active console",
- "console foo sets foo as the console"}
-};
-
-/*
- * store the mixer argument from the config file, filtering possibly
- * invalid or dangerous values (the string is used as argument for
- * system("mixer %s")
- */
-static void store_mixer(struct chan_oss_pvt *o, char *s)
-{
- int i;
-
- for (i=0; i < strlen(s); i++) {
- 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;
- }
- }
- if (o->mixer_cmd)
- free(o->mixer_cmd);
- o->mixer_cmd = strdup(s);
- ast_log(LOG_WARNING, "setting mixer %s\n", s);
-}
-
-/*
- * grab fields from the config file, init the descriptor and open the device.
- */
-static struct chan_oss_pvt * store_config(struct ast_config *cfg,
- char *ctg)
-{
- struct ast_variable *v;
- struct chan_oss_pvt *o;
-
- if (ctg == NULL) {
- o = &oss_default;
- o->next = NULL; /* XXX needed ? */
- ctg = "general";
- } else {
- o = (struct chan_oss_pvt *)malloc(sizeof *o);
- if (o == NULL) /* fail */
- return NULL;
- *o = oss_default;
- /* "general" is also the default thing */
- if (strcmp(ctg, "general") == 0) {
- o->name = strdup("dsp");
- oss_active = o->name;
- goto openit;
- }
- o->name = strdup(ctg);
- }
- ast_log(LOG_WARNING, "found category [%s]\n", ctg);
-
- /* fill other fields from configuration */
- v = ast_variable_browse(cfg, ctg);
- while(v) {
- M_START(v->name, v->value);
-
- M_BOOL("autoanswer", o->autoanswer)
- M_BOOL("autohangup", o->autohangup)
- M_BOOL("playbackonly", o->playbackonly)
- M_BOOL("silencesuppression", o->silencesuppression)
- M_UINT("silencethreshold", o->silencethreshold )
- M_STR("device", o->device)
- M_UINT("frags", o->frags)
- M_UINT("debug", oss_debug)
- M_UINT("queuesize", o->queuesize)
- M_STR("context", o->ctx)
- M_STR("language", o->language)
- M_STR("extension", o->ext)
- M_F("mixer", store_mixer(o, v->value))
- M_END(;);
- v=v->next;
- }
- if (!strlen(o->device))
- strncpy(o->device, DEV_DSP, sizeof(o->device)-1);
- if (o->mixer_cmd) {
- char *cmd;
-
- asprintf(&cmd, "mixer %s", o->mixer_cmd);
- ast_log(LOG_WARNING, "running [%s]\n", cmd);
- system(cmd);
- free(cmd);
- }
- if (o == &oss_default) /* we are done with the default */
- return NULL;
-
-openit:
- if (setformat(o, O_RDWR) < 0) { /* open device */
- if (option_verbose > 0) {
- ast_verbose(VERBOSE_PREFIX_2 "Device %s not detected\n", ctg);
- ast_verbose(VERBOSE_PREFIX_2 "Turn off OSS support by adding "
- "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
- }
- goto error;
- }
- soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (o->duplex != M_FULL)
- ast_log(LOG_WARNING, "XXX I don't work right with non "
- "full-duplex sound cards XXX\n");
- if ( pipe(o->sndcmd) != 0 ) {
- ast_log(LOG_ERROR, "Unable to create pipe\n");
- goto error;
- }
- ast_pthread_create(&o->sthread, NULL, sound_thread, o);
- /* link into list of devices */
- if (o != &oss_default) {
- o->next = oss_default.next;
- oss_default.next = o;
- }
- return o;
-
-error:
- if (o != &oss_default)
- free(o);
- return NULL;
-}
-
-int load_module()
-{
- int i;
- struct ast_config *cfg;
-
- /* load config file */
- cfg = ast_load(config);
- if (cfg != NULL) {
- char *ctg;
-
- store_config(cfg, NULL); /* init general category */
- ctg = ast_category_browse(cfg, NULL); /* initial category */
- while (ctg != NULL) {
- store_config(cfg, ctg);
- ctg = ast_category_browse(cfg, ctg);
- }
- ast_destroy(cfg);
- }
- if (find_desc(oss_active) == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", oss_active);
- /* XXX we could default to 'dsp' perhaps ? */
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- i = ast_channel_register(oss_default.type, tdesc,
- AST_FORMAT_SLINEAR, oss_request);
- if (i < 0) {
- ast_log(LOG_ERROR, "Unable to register channel class '%s'\n",
- oss_default.type);
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- for (i=0; i<sizeof(myclis)/sizeof(struct ast_cli_entry); i++)
- ast_cli_register(myclis + i);
- return 0;
-}
-
-
-int unload_module()
-{
- int x;
- struct chan_oss_pvt *o;
-
- /* XXX do we need a ast_channel_unregister oss_request ? */
- for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++)
- ast_cli_unregister(myclis + x);
-
- for (o = oss_default.next; o ; o = o->next) {
- close(o->sounddev);
- if (o->sndcmd[0] > 0) {
- close(o->sndcmd[0]);
- close(o->sndcmd[1]);
- }
- if (o->owner)
- ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD);
- if (o->owner) /* XXX how ??? */
- return -1;
- /* XXX what about the thread ? */
- /* XXX what about the memory allocated ? */
- }
- return 0;
-}
-
-char *description()
-{
- return desc;
-}
-
-int usecount() /* XXX is this per-device or global for the module ? */
-{
- int res;
- ast_mutex_lock(&usecnt_lock);
- res = usecnt;
- ast_mutex_unlock(&usecnt_lock);
- return res;
-}
-
-char *key()
-{
- return ASTERISK_GPL_KEY;
-}
diff --git a/net/asterisk-devel/files/patch-Makefile b/net/asterisk-devel/files/patch-Makefile
index 49c66ed..16f6b03 100644
--- a/net/asterisk-devel/files/patch-Makefile
+++ b/net/asterisk-devel/files/patch-Makefile
@@ -3,128 +3,200 @@ $FreeBSD$
--- Makefile.orig
+++ Makefile
-@@ -45,6 +45,19 @@
- PROC=$(shell uname -m)
- endif
-
-+ifeq (${OSARCH},FreeBSD)
-+ifeq ($(PROC),sparc64)
-+PROC=ultrasparc
-+OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
-+OPTIONS+=$(shell if $(CC) -mcpu=v9 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v9"; fi)
-+OPTIONS+=-fomit-frame-pointer
-+endif
-+ifeq ($(PROC),amd64)
-+PROC=k8
-+OPTIONS+=-m64
-+endif
-+endif
-+
- # Pentium Pro Optimize
- #PROC=i686
-
-@@ -63,10 +76,10 @@
+@@ -19,8 +19,8 @@
+ # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
+ # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
+ # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
+-CC=$(CROSS_COMPILE)gcc
+-HOST_CC=gcc
++CC?=$(CROSS_COMPILE)gcc
++HOST_CC=${CC}
+ # CROSS_ARCH=Linux
+ # CROSS_PROC=arm
+ # SUB_PROC=xscale # or maverick
+@@ -44,14 +44,14 @@
#K6OPT = -DK6OPT
- #Tell gcc to optimize the asterisk's code
+ #Tell gcc to optimize the code
-OPTIMIZE+=-O6
+#OPTIMIZE+=-O6
+ endif
- #Include debug symbols in the executables (-g) and profiling info (-pg)
--DEBUG=-g #-pg
-+#DEBUG=-g #-pg
+ #Overwite config files on "make samples"
+-OVERWRITE=y
++OVERWRITE=n
- # If you are running a radio application, define RADIO_RELAX so that the DTMF
- # will be received more reliably
-@@ -91,7 +104,7 @@
+ #Include debug and macro symbols in the executables (-g) and profiling info (-pg)
+-DEBUG=-g3 #-pg
++#DEBUG=-g3 #-pg
+
+ #Set NOCRYPTO to yes if you do not want to have crypto support or
+ #dependencies
+@@ -83,7 +83,7 @@
# Where to install asterisk after compiling
# Default -> leave empty
--INSTALL_PREFIX=
+-INSTALL_PREFIX?=
+INSTALL_PREFIX=$(PREFIX)
# Staging directory
# Files are copied here temporarily during the install process
-@@ -111,23 +124,23 @@
- # Don't use together with -DBUSYDETECT_TONEONLY
+@@ -106,17 +106,17 @@
BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
--ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
--ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
-+ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
-+ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
- ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
--ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
--ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
--ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
-+ASTSPOOLDIR=/var/spool/asterisk
-+ASTLOGDIR=/var/log/asterisk
-+ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
- ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
--ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
--ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
--ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
--ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
-+ASTBINDIR=$(INSTALL_PREFIX)/bin
-+ASTSBINDIR=$(INSTALL_PREFIX)/sbin
-+ASTVARRUNDIR=/var/run
-+ASTMANDIR=$(INSTALL_PREFIX)/man
-
- MODULES_DIR=$(ASTLIBDIR)/modules
- AGI_DIR=$(ASTVARLIBDIR)/agi-bin
-
- INCLUDE=-Iinclude -I../include
--CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
-+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
- CFLAGS+=$(OPTIMIZE)
+ ifneq ($(OSARCH),SunOS)
+- ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
+ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+ MODULES_DIR=$(ASTLIBDIR)/modules
+ AGI_DIR=$(ASTVARLIBDIR)/agi-bin
+ else
+@@ -218,13 +218,13 @@
+ endif
+
+ INCLUDE+=-Iinclude -I../include
+-ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
+-ASTCFLAGS+=$(OPTIMIZE)
++ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
++#ASTCFLAGS+=$(OPTIMIZE)
+ ASTOBJ=-o asterisk
+
+ ifeq ($(findstring BSD,$(OSARCH)),BSD)
+ PROC=$(shell uname -m)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
ifneq ($(PROC),ultrasparc)
-@@ -138,12 +151,8 @@
- CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi)
-
- ifeq (${OSARCH},FreeBSD)
--OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
--CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
--LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
--INCLUDE+=-I/usr/local/include
--CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
--MPG123TARG=freebsd
-+CFLAGS+=$(PTHREAD_CFLAGS)
-+LIBS+=$(PTHREAD_LIBS)
+@@ -235,8 +235,8 @@
+ ASTCFLAGS+=-fsigned-char
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h),)
+- ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/local/include/osp
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h),)
++ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp
+ else
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp
+@@ -245,27 +245,24 @@
+
+ ifeq ($(OSARCH),FreeBSD)
+ BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
+- ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
+- LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
+- ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp
++ ASTCFLAGS+=$(PTHREAD_CFLAGS)
++ LIBS+=$(PTHREAD_LIBS)
++ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp),)
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp
+ endif
+ MPG123TARG=freebsd
+
+- # XXX FreeBSD paths
+- PREFIX?=/usr/local
+- ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
+- ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
++ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
+- # XXX end FreeBSD paths
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+
endif # FreeBSD
- ifeq (${OSARCH},NetBSD)
-@@ -160,7 +169,10 @@
- #CFLAGS+=-DOLD_DSP_ROUTINES
+@@ -281,7 +278,7 @@
- CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
--CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPTEL_OPTIMIZATIONS
-+endif
+ ifeq ($(OSARCH),SunOS)
+ ASTCFLAGS+=-Wcast-align -DSOLARIS
+- INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
++ INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/include
+ endif
- LIBEDIT=editline/libedit.a
+ ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN)
+@@ -296,7 +293,7 @@
-@@ -222,7 +234,7 @@
- SOLINK=-shared -Xlinker -x
+ ifndef WITHOUT_ZAPTEL
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS
+ endif
+
+@@ -323,7 +320,7 @@
+ ASTERISKVERSIONNUM=999999
+ ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name)
+ else
+- ASTERISKVERSIONNUM=000000
++ ASTERISKVERSIONNUM?=000000
+ endif
+ endif
+
+@@ -388,10 +385,10 @@
endif
--CC=gcc
-+CC?=gcc
- INSTALL=install
+ ifeq ($(OSARCH),SunOS)
+- LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ OBJS+=strcompat.o
+ ASTLINK=
+- SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ endif
+
+ ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
+@@ -399,7 +396,7 @@
+ endif
- _all: all
-@@ -234,7 +246,7 @@
+ # This is used when generating the doxygen documentation
+-ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),)
++ifneq ($(wildcard $(LOCALBASE)/bin/dot)$(wildcard /usr/bin/dot),)
+ HAVEDOT=yes
+ else
+ HAVEDOT=no
+@@ -418,7 +415,7 @@
@echo " + $(MAKE) install +"
@echo " +-------------------------------------------+"
--all: depend asterisk subdirs
-+all: depend asterisk subdirs manpage
+-all: cleantest depend asterisk subdirs
++all: cleantest depend asterisk subdirs manpage
- editline/config.h:
- cd editline && unset CFLAGS LIBS && ./configure ; \
-@@ -243,13 +255,13 @@
+ #ifneq ($(wildcard tags),)
+ ctags: tags
+@@ -437,13 +434,13 @@
cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
$(MAKE) -C editline libedit.a
@@ -144,55 +216,57 @@ $FreeBSD$
+# fi
ifneq ($(wildcard .depend),)
- include .depend
-@@ -271,13 +283,10 @@
-
- asterisk.o: asterisk.c build.h
-
--manpage: asterisk.8.gz
-+manpage: asterisk.8
-
--asterisk.8.gz: asterisk.sgml
-- rm -f asterisk.8
-- docbook2man asterisk.sgml
-- mv ./*.8 asterisk.8
-- gzip asterisk.8
-+asterisk.8: asterisk.8.gz
-+ gzcat asterisk.8.gz > asterisk.8
-
- ifneq ($(strip $(ASTERISKVERSION)),)
- build.h: .version
-@@ -295,8 +304,8 @@
- exit 1; \
+ include .depend
+@@ -510,14 +507,14 @@
+ cygwin_a:
+ $(MAKE) -C cygwin all
+
+-asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
++asterisk: $(CYGLOADER) editline/libedit.a stdtime/libtime.a $(OBJS)
+ build_tools/make_build_h > include/asterisk/build.h.tmp
+ if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
+ mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
fi
-
--asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
-- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
-+asterisk: editline/libedit.a stdtime/libtime.a $(OBJS)
-+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) stdtime/libtime.a $(LIBS)
+ rm -f include/asterisk/build.h.tmp
+ $(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
+- $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
++ $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) stdtime/libtime.a $(LIBS)
muted: muted.o
- $(CC) -o muted muted.o
-@@ -315,28 +324,28 @@
- $(MAKE) -C stdtime clean
+ $(CC) $(AUDIO_LIBS) -o muted muted.o
+@@ -539,38 +536,38 @@
datafiles: all
+ if [ x`whoami` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
for x in sounds/digits/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
+ for x in sounds/dictate/*.gsm; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
+ else \
+ echo "No description for $$x"; \
+ exit 1; \
+ fi; \
+ done
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
for x in sounds/letters/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
else \
echo "No description for $$x"; \
@@ -202,17 +276,17 @@ $FreeBSD$
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
for x in sounds/phonetic/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
else \
echo "No description for $$x"; \
exit 1; \
-@@ -344,18 +353,18 @@
+@@ -578,18 +575,18 @@
done
- for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
@@ -224,70 +298,80 @@ $FreeBSD$
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images
for x in images/*.jpg; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
done
- mkdir -p $(DESTDIR)$(AGI_DIR)
+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
update:
- @if [ -d CVS ]; then \
-@@ -367,127 +376,90 @@
- fi
+ @if [ -d .svn ]; then \
+@@ -618,75 +615,53 @@
+ OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
bininstall: all
- mkdir -p $(DESTDIR)$(MODULES_DIR)
- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTETCDIR)
- mkdir -p $(DESTDIR)$(ASTBINDIR)
-- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
-- install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
+- if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ $(MKDIR) $(DESTDIR)$(MODULES_DIR)
+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTBINDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR)
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/dictate
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/system
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/tmp
-+ $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/meetme
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/monitor
++ if [ -f asterisk ]; then $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f cygwin/asterisk.exe ]; then $(BSD_INSTALL_PROGRAM) cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f asterisk.dll ]; then $(BSD_INSTALL_PROGRAM) asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
+- $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
+- $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
++ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
-- install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
+ chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
fi
for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
-- install -d $(DESTDIR)$(ASTHEADERDIR)
-- install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm
-- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
-- if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \
-- mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- else \
-- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \
-- fi
-- ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+ if [ -n "$(OLDHEADERS)" ]; then \
+ rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
+ fi
+ rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
+- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
-- install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 asterisk.8.gz $(DESTDIR)$(ASTMANDIR)/man8
-+ ln -sf $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv
++ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
@@ -295,14 +379,16 @@ $FreeBSD$
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
if [ -d contrib/firmware/iax ]; then \
-- install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
else \
echo "You need to do cvs update -d not just cvs update" ; \
fi
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . )
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
- if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
- @echo " +---- Asterisk Installation Complete -------+"
- @echo " + +"
@@ -325,85 +411,74 @@ $FreeBSD$
- @echo " + **Note** This requires that you have +"
- @echo " + doxygen installed on your local system +"
- @echo " +-------------------------------------------+"
-- @echo " + +"
-- @echo " + ** NOTE FOR DOWNGRADING FROM CVS HEAD ** +"
-- @echo " + +"
-- @echo " + If you are downgrading from CVS HEAD to +"
-- @echo " + a stable release, remember to delete +"
-- @echo " + everything from your asterisk modules +"
-- @echo " + directory (/usr/lib/asterisk/modules/) +"
-- @echo " + and the asterisk header directory +"
-- @echo " + (/usr/include/asterisk/) +"
-- @echo " + before doing a '$(MAKE) install'. +"
-- @echo " + +"
-- @echo " +-------------------------------------------+"
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/vm . )
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/voicemail . )
+ @$(MAKE) -s oldmodcheck
+ NEWMODS=$(notdir $(wildcard */*.so))
+@@ -710,7 +685,7 @@
+ echo " WARNING WARNING WARNING" ;\
+ fi
-install: all datafiles bininstall
+install: all datafiles bininstall samples
-
+ @if [ -x /usr/sbin/asterisk-post-install ]; then \
+ /usr/sbin/asterisk-post-install $(DESTDIR) . ; \
+ fi
+@@ -718,16 +693,19 @@
upgrade: all bininstall
- adsi: all
+ adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x`-dist; \
- if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
fi ; \
done
- samples: all datafiles adsi
+ samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
-- for x in configs/*.sample; do \
-- if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
++ echo ADSI INSTALL $(BSD_INSTALL_DATA)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
-+ for x in configs/*.sample channels/h323/*.sample; do \
+ for x in configs/*.sample; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`-dist;\
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+ if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
+ if [ "$(OVERWRITE)" = "y" ]; then \
+ if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
+@@ -740,7 +718,7 @@
+ continue; \
+ fi ;\
fi ; \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
done
-- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-+ echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
-+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist $(DESTDIR)$(ASTETCDIR)/asterisk.conf; \
-+ fi
+ if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ ( \
+@@ -759,25 +737,25 @@
+ echo ";astctlowner = root" ; \
+ echo ";astctlgroup = apache" ; \
+ echo ";astctl = asterisk.ctl" ; \
+- ) > $(DESTDIR)$(ASTCONFPATH) ; \
++ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ else \
+ echo "Skipping asterisk.conf creation"; \
+ fi
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
for x in sounds/demo-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
for x in sounds/*.mp3; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
done
rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3
@@ -412,18 +487,18 @@ $FreeBSD$
:> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
-@@ -502,7 +474,7 @@
- @[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 )
- @[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 )
- install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi
-- mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk
-+ $(MKDIR) $(DESTDIR)$(HTTPDIR)/html/_asterisk
+@@ -791,7 +769,7 @@
+ @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
+ @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
+ $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
+- mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
++ $(MKDIR) $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
for x in images/*.gif; do \
- install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
done
-@@ -522,10 +494,10 @@
+@@ -820,10 +798,10 @@
- __rpm: _version
+ __rpm: include/asterisk/version.h spec
rm -rf /tmp/asterisk ; \
- mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
+ $(MKDIR) /tmp/asterisk/redhat/RPMS/i386 ; \
@@ -431,6 +506,6 @@ $FreeBSD$
$(MAKE) DESTDIR=/tmp/asterisk samples ; \
- mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
+ $(MKDIR) /tmp/asterisk/etc/rc.d/init.d ; \
- cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
- sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
+ cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
+
diff --git a/net/asterisk-devel/files/patch-agi::Makefile b/net/asterisk-devel/files/patch-agi::Makefile
index 32efb5d..b359765 100644
--- a/net/asterisk-devel/files/patch-agi::Makefile
+++ b/net/asterisk-devel/files/patch-agi::Makefile
@@ -1,9 +1,9 @@
$FreeBSD$
---- agi/Makefile.orig Tue Jun 22 20:42:13 2004
-+++ agi/Makefile Tue Oct 5 21:03:40 2004
-@@ -11,15 +11,18 @@
+--- agi/Makefile.orig Thu Jan 12 15:42:07 2006
++++ agi/Makefile Thu Jan 12 15:44:39 2006
+@@ -11,7 +11,9 @@
# the GNU General Public License
#
@@ -14,14 +14,15 @@ $FreeBSD$
CFLAGS+=
+@@ -27,8 +29,9 @@
all: depend $(AGIS)
install: all
- mkdir -p $(DESTDIR)$(AGI_DIR)
- for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
-+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
++ $(MKDIR) -p $(DESTDIR)$(AGI_DIR)
+ for x in $(AGIS_BIN); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(AGI_DIR) ; done
+ for x in $(AGIS_SCR); do $(BSD_INSTALL_SCRIPT) $$x $(DESTDIR)$(AGI_DIR) ; done
eagi-test: eagi-test.o
- $(CC) $(CFLAGS) -o eagi-test eagi-test.o
+ $(CC) $(CFLAGS) -o eagi-test eagi-test.o $(LIBS)
diff --git a/net/asterisk-devel/files/patch-apps::Makefile b/net/asterisk-devel/files/patch-apps::Makefile
index 44f8495..ee7d560 100644
--- a/net/asterisk-devel/files/patch-apps::Makefile
+++ b/net/asterisk-devel/files/patch-apps::Makefile
@@ -1,38 +1,56 @@
---- apps/Makefile.orig Wed Jun 22 14:40:11 2005
-+++ apps/Makefile Wed Jun 22 14:43:45 2005
-@@ -40,9 +40,13 @@
+
+$FreeBSD$
+
+--- apps/Makefile.orig
++++ apps/Makefile
+@@ -45,25 +45,27 @@
#APPS+=app_rpt.so
- APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
--APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
- APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi)
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h),)
+ APPS+=app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so
+ endif
+ endif # WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ifdef WITH_FAX
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/spandsp.h ]; then echo "app_rxfax.so app_txfax.so" ; fi)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp.h),)
++APPS+=app_rxfax.so app_txfax.so
++endif
+endif
+
- CFLAGS+=-fPIC
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ APPS+=app_osplookup.so
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+-CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+-CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
+-ifneq ($(shell if [[ 0x`$(CROSS_COMPILE_BIN)curl-config --vernum` -ge 0x70907 ]]; then echo "OK" ; fi),)
+- ifneq (${CURLLIBS},)
+- APPS+=app_curl.so
+- endif
+-endif
++CURLLIBS=$(shell $(CROSS_COMPILE_BIN)$(LOCALBASE)/bin/curl-config --libs)
++APPS+=app_curl.so
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
-@@ -65,12 +69,12 @@
- $(CC) $(SOLINK) -o $@ $< -ltonezone
+ ifeq (${OSARCH},CYGWIN)
+ CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
+@@ -95,24 +97,32 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -ltonezone
install: all
- for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(APPS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
+ rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
- app_voicemail.so : app_voicemail.o
- ifeq ($(USE_MYSQL_VM_INTERFACE),1)
-- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L/usr/lib/mysql -lmysqlclient -lz
-+ $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L$(LOCALBASE)/lib/mysql -lmysqlclient -lz
- else
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lpq
-@@ -79,17 +83,25 @@
- endif
- endif
+ app_curl.so: app_curl.o
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
+ifdef WITH_FAX
+app_rxfax.so : app_rxfax.o
@@ -47,15 +65,15 @@
+ $(CC) -I$(LOCALBASE)/include/pgsql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
app_sql_postgres.so: app_sql_postgres.o
-- $(CC) $(SOLINK) -o $@ $< -L/usr/local/pgsql/lib -lpq
-+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lpq
+- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
++ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L$(LOCALBASE)/lib -lpq
app_sql_odbc.so: app_sql_odbc.o
- $(CC) $(SOLINK) -o $@ $< -lodbc
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
look: look.c
- $(CC) -pipe -O6 -g look.c -o look -lncurses
-+ $(CC) $(CFLAGS) look.c -o look -lncurses
++ $(CC) look.c -o look -lncurses
- ifneq ($(wildcard .depend),)
- include .depend
+ ifeq (SunOS,$(shell uname))
+ app_chanspy.so: app_chanspy.o
diff --git a/net/asterisk-devel/files/patch-apps::app_rxfax.c b/net/asterisk-devel/files/patch-apps::app_rxfax.c
index 88362bfc..820208e 100644
--- a/net/asterisk-devel/files/patch-apps::app_rxfax.c
+++ b/net/asterisk-devel/files/patch-apps::app_rxfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_rxfax.c.orig
-+++ apps/app_rxfax.c
-@@ -0,0 +1,371 @@
+--- /dev/null Thu Jan 12 17:44:40 2006
++++ apps/app_rxfax.c Thu Jan 12 17:41:53 2006
+@@ -0,0 +1,373 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <asterisk/dsp.h>
+#include <asterisk/manager.h>
++#include <asterisk/version.h>
+#include <string.h>
+#include <stdlib.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
@@ -100,7 +102,7 @@ $FreeBSD$
+ "FaxReceived", "Channel: %s\nExten: %s\nCallerID: %s\nRemoteStationID: %s\nLocalStationID: %s\nPagesTransferred: %i\nResolution: %i\nTransferRate: %i\nFileName: %s\n",
+ chan->name,
+ chan->exten,
-+#if (ASTERISK_VERSION_NUM <= 011000)
++#if ASTERISK_VERSION_NUM <= 010010
+ chan->callerid,
+#else
+ (chan->cid.cid_num) ? chan->cid.cid_num : "",
diff --git a/net/asterisk-devel/files/patch-apps::app_txfax.c b/net/asterisk-devel/files/patch-apps::app_txfax.c
index 8daf0f9..15ad667 100644
--- a/net/asterisk-devel/files/patch-apps::app_txfax.c
+++ b/net/asterisk-devel/files/patch-apps::app_txfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_txfax.c.orig
-+++ apps/app_txfax.c
-@@ -0,0 +1,293 @@
+--- /dev/null Thu Jan 12 17:48:54 2006
++++ apps/app_txfax.c Thu Jan 12 17:48:36 2006
+@@ -0,0 +1,295 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <string.h>
+#include <stdlib.h>
++#include <math.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
+#include <inttypes.h>
+#else
diff --git a/net/asterisk-devel/files/patch-astman::Makefile b/net/asterisk-devel/files/patch-astman::Makefile
deleted file mode 100644
index 2745860..0000000
--- a/net/asterisk-devel/files/patch-astman::Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-
-$FreeBSD$
-
---- astman/Makefile.orig Sat Jun 26 22:25:39 2004
-+++ astman/Makefile Thu Oct 14 19:14:22 2004
-@@ -5,16 +5,16 @@
-
- OSARCH=$(shell uname -s)
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS+=-I/usr/local/include -L/usr/local/lib
-+CFLAGS+=-I$(LOCALBASE)/include -L$(LOCALBASE)/lib
- endif
-
--TARGET=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else if [ -f /usr/local/include/newt.h ]; then echo "astman"; else echo "none" ; fi ; fi)
-+TARGET=astman
- all: depend $(TARGET)
-
- install:
- if [ "$(TARGET)" != "none" ]; then \
- for x in $(TARGET); do \
-- install -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
-+ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
- done ; \
- fi
-
diff --git a/net/asterisk-devel/files/patch-cdr::Makefile b/net/asterisk-devel/files/patch-cdr::Makefile
index 1d0fb20..da16b60 100644
--- a/net/asterisk-devel/files/patch-cdr::Makefile
+++ b/net/asterisk-devel/files/patch-cdr::Makefile
@@ -1,51 +1,65 @@
---- cdr/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ cdr/Makefile Tue Aug 9 17:28:11 2005
-@@ -21,7 +21,7 @@
- OSARCH=$(shell uname -s)
-
- ifeq (${OSARCH},FreeBSD)
--SOLINK+=-L/usr/local/lib
-+SOLINK+=-L$(LOCALBASE)/lib
+
+$FreeBSD$
+
+--- cdr/Makefile.orig Tue Nov 29 20:24:39 2005
++++ cdr/Makefile Thu Jan 12 17:56:23 2006
+@@ -21,8 +21,8 @@
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
endif
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
-@@ -37,18 +37,23 @@
+@@ -38,18 +38,18 @@
#
# unixODBC stuff...
#
-+ifdef WITH_ODBC
- MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/odbcinst.h),)
+ MODS+=cdr_odbc.so
+ endif
#
# FreeTDS stuff...
#
-+ifdef WITH_FREETDS
- MODS+=$(shell if [ -f "/usr/include/tds.h" ]; then echo "cdr_tds.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/tds.h" ]; then echo "cdr_tds.so"; fi)
-+endif
-
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h),)
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.63),1)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tds.h),)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.63),1)
+ CFLAGS += -DFREETDS_0_63
+ else
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.62),1)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.62),1)
+ CFLAGS += -DFREETDS_0_62
+ else
+ CFLAGS += -DFREETDS_PRE_0_62
+@@ -61,7 +61,7 @@
#
# PGSQL stuff... Autoconf anyone??
#
-+ifdef WITH_PGSQL
- MODS+=$(shell if [ -d /usr/local/pgsql/include ] || [ -d /usr/include/pgsql ] || [ -d /usr/local/include/pgsql ] || [ -d /opt/pgsql/include ] || [ -f /usr/include/libpq-fe.h ] ; then echo "cdr_pgsql.so"; fi)
- CFLAGS+=$(shell if [ -d /usr/local/pgsql/include ]; then echo "-I/usr/local/pgsql/include"; fi)
- CFLAGS+=$(shell if [ -d /usr/include/pgsql ]; then echo "-I/usr/include/pgsql"; fi)
-@@ -62,16 +67,19 @@
- MLFLAGS+=$(shell if [ -d /usr/local/lib/pgsql ]; then echo "-L/usr/local/lib/pgsql"; fi)
- MLFLAGS+=$(shell if [ -d /opt/pgsql/lib ]; then echo "-L/opt/pgsql/lib"; fi)
- MLFLAGS+=$(shell if [ -f /usr/lib/libpq.so ]; then echo "-L/usr/lib"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
+ MODS+=cdr_pgsql.so
+ endif
- #
- # SQLIte stuff...
- #
-+ifdef WITH_SQLITE
- MODS+=$(shell if [ -f "/usr/include/sqlite.h" ]; then echo "cdr_sqlite.so"; fi)
-+endif
+@@ -82,9 +82,9 @@
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/pgsql
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql),)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/pgsql
+- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib/pgsql
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql),)
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql
++ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/pgsql
+ endif
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include),)
+@@ -110,7 +110,7 @@
all: depend $(MODS)
install: all
diff --git a/net/asterisk-devel/files/patch-channels::Makefile b/net/asterisk-devel/files/patch-channels::Makefile
index 7ecab67..edca9b1 100644
--- a/net/asterisk-devel/files/patch-channels::Makefile
+++ b/net/asterisk-devel/files/patch-channels::Makefile
@@ -1,97 +1,85 @@
---- channels/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ channels/Makefile Tue Aug 9 17:34:28 2005
-@@ -57,10 +57,10 @@
-
+
+$FreeBSD$
+
+--- channels/Makefile.orig
++++ channels/Makefile
+@@ -48,9 +48,9 @@
endif
+
ifeq (${OSARCH},FreeBSD)
--PTLIB=-lpt_FreeBSD_x86_r
--H323LIB=-lh323_FreeBSD_x86_r
--CHANH323LIB=-pthread
--SOLINK+=-L/usr/local/lib
-+PTLIB=-lpt_FreeBSD_x86_r_s
-+H323LIB=-lh323_FreeBSD_x86_r_s
-+CHANH323LIB=
-+SOLINK+=-L$(LOCALBASE)/lib
+- PTLIB=-lpt_FreeBSD_x86_r
+- H323LIB=-lh323_FreeBSD_x86_r
+- CHANH323LIB=-pthread
++ PTLIB=-lpt_FreeBSD_x86_r_s
++ H323LIB=-lh323_FreeBSD_x86_r_s
++ CHANH323LIB=
endif
+
ifeq (${OSARCH},NetBSD)
- PTLIB=-lpt_NetBSD_x86_r
-@@ -72,19 +72,23 @@
+@@ -73,11 +73,11 @@
+ SOLINK+=-lrt
endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/ixjuser.h ] && echo chan_phone.so)
-+ifdef WITH_H323
-+CHANNEL_LIBS+=chan_h323.so
-+endif
-
- CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
- CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
- CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
--CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
- CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
- CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
--ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
-+ZAPPRI=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo "-lpri")
- ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
-+ifdef WITH_ZAPTEL
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "-DIAX_TRUNKING -I$(LOCALBASE)/include")
-+endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
- CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX")
-
-@@ -106,8 +110,10 @@
-
- ZAPDIR=/usr/lib
-
-+ifdef WITH_ZAPTEL
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so")
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "chan_zap.so")
-+endif
-
- CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/ixjuser.h),)
+ CHANNEL_LIBS+=chan_phone.so
+ endif
-@@ -156,6 +162,8 @@
- chan_oss.so: chan_oss.o
- $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
+-ifneq ($(wildcard h323/libchanh323.a),)
++ifdef WITH_H323
+ CHANNEL_LIBS+=chan_h323.so
endif
-+chan_oss.so: chan_oss.o
-+ $(CC) $(SOLINK) -o $@ chan_oss.o
- chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o
- ifeq ($(USE_MYSQL_FRIENDS),1)
-@@ -175,7 +183,7 @@
- $(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c
+@@ -91,12 +91,12 @@
+ CHANNEL_LIBS+=chan_alsa.so
+ endif
- chan_zap.so: chan_zap.o
-- $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -ltonezone
-+ $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -L$(LOCALBASE)/lib -ltonezone
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libpri.so.1),)
+ CFLAGS+=-DZAPATA_PRI
+ ZAPPRI=-lpri
+ endif
- chan_sip.so: chan_sip.o
- ifeq ($(USE_SIP_MYSQL_FRIENDS),1)
-@@ -199,15 +207,17 @@
- chan_vpb.so: chan_vpb.o
- $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libmfcr2.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libmfcr2.so.1),)
+ CFLAGS+=-DZAPATA_R2
+ ZAPR2=-lmfcr2
+ endif
+@@ -109,12 +109,12 @@
+ endif
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ifeq (${OSARCH},NetBSD)
+ SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/pkg/lib
+ endif
+ ifeq (${OSARCH},FreeBSD)
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ CFLAGS+=-DIAX_TRUNKING
+ CHANNEL_LIBS+=chan_zap.so
+@@ -229,8 +229,10 @@
+ chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast
+ $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
+ else
-chan_h323.so: chan_h323.o h323/libchanh323.a
- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
+chan_h323.so: chan_h323.o h323/ast_h323.o
-+ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -lcrypto -lssl -L$(LOCALBASE)/lib -lexpat -llber -lldap -lldap_r
-
++ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o $(CHANH323LIB) -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L/usr/lib -lcrypto -lssl -lexpat -L$(LOCALBASE)/lib -llber -lldap -lldap_r
+h323/ast_h323.o:
+ $(MAKE) -C h323 ast_h323.o
+ endif
- #chan_modem.so : chan_modem.o
+ chan_misdn.so: chan_misdn.o chan_misdn_config.o misdn/chan_misdn_lib.a
+@@ -244,8 +246,7 @@
# $(CC) -rdynamic -shared -Xlinker -x -o $@ $<
install: all
- for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
+ for x in $(CHANNEL_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
depend: .depend
+
diff --git a/net/asterisk-devel/files/patch-channels::chan_h323.c b/net/asterisk-devel/files/patch-channels::chan_h323.c
index de2ed39..6498b97 100644
--- a/net/asterisk-devel/files/patch-channels::chan_h323.c
+++ b/net/asterisk-devel/files/patch-channels::chan_h323.c
@@ -1,14 +1,14 @@
$FreeBSD$
---- channels/chan_h323.c 2004/10/10 13:00:17 1.1
-+++ channels/chan_h323.c 2004/10/10 13:00:39
-@@ -26,7 +26,7 @@
- * Version Info: $Id: patch-channels::chan_h323.c,v 1.3.2.3 2004/10/14 14:30:13 sobomax Exp $
- */
+--- channels/chan_h323.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_h323.c Thu Jan 12 18:29:50 2006
+@@ -2281,7 +2281,7 @@ static char *convertcap(int cap)
+ }
+ }
--
-+#include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/signal.h>
- #include <sys/param.h>
+-static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs)
++static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active)
+ {
+ /* XXX Deal with Video */
+ struct oh323_pvt *pvt;
diff --git a/net/asterisk-devel/files/patch-channels::chan_sip.c b/net/asterisk-devel/files/patch-channels::chan_sip.c
index e634ce4..355c558 100644
--- a/net/asterisk-devel/files/patch-channels::chan_sip.c
+++ b/net/asterisk-devel/files/patch-channels::chan_sip.c
@@ -1,144 +1,131 @@
$FreeBSD$
---- channels/chan_sip.c.orig Sun Feb 17 18:01:43 2002
-+++ channels/chan_sip.c Sun Feb 17 18:10:52 2002
-@@ -141,7 +141,7 @@
+--- channels/chan_sip.c.orig Thu Jan 12 18:43:37 2006
++++ channels/chan_sip.c Thu Jan 12 18:50:11 2006
+@@ -336,7 +336,7 @@ static char global_vmexten[AST_MAX_EXTEN
static char default_language[MAX_LANGUAGE] = "";
--static char default_callerid[AST_MAX_EXTENSION] = "asterisk";
-+static char default_callerid[AST_MAX_EXTENSION] = "Unknown";
+-#define DEFAULT_CALLERID "asterisk"
++#define DEFAULT_CALLERID "Unknown"
+ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID;
static char default_fromdomain[AST_MAX_EXTENSION] = "";
+@@ -474,6 +474,7 @@ struct sip_invite_param {
-@@ -244,6 +244,7 @@
struct sip_route {
struct sip_route *next;
- char hop[0];
+ int lr;
+ char hop[0];
};
- struct sip_history {
-@@ -2218,7 +2219,7 @@
- if (p->owner) {
- /* We already hold the channel lock */
- if (f->frametype == AST_FRAME_VOICE) {
-- if (f->subclass != p->owner->nativeformats) {
-+ if (!(f->subclass & p->owner->nativeformats)) {
- ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
- p->owner->nativeformats = f->subclass;
- ast_set_read_format(p->owner, p->owner->readformat);
-@@ -4620,6 +4621,10 @@
+@@ -5993,6 +5994,7 @@ static void build_route(struct sip_pvt *
/* Make a struct route */
- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
+ thishop = malloc(sizeof(*thishop) + len);
if (thishop) {
-+ if (strnstr(rr, ";lr", len) != NULL)
-+ thishop->lr = 1;
-+ else
-+ thishop->lr = 0;
- strncpy(thishop->hop, rr, len); /* safe */
- thishop->hop[len] = '\0';
++ thishop->lr = (strnstr(rr, ";lr", len) != NULL ? 1 : 0);
+ ast_copy_string(thishop->hop, rr, len);
ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop);
-@@ -4643,31 +4648,41 @@
- rr += len+1;
- }
- }
-- /* 2nd append the Contact: if there is one */
-- /* Can be multiple Contact headers, comma separated values - we just take the first */
-- contact = get_header(req, "Contact");
-- if (!ast_strlen_zero(contact)) {
-- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-- /* Look for <: delimited address */
-- c = strchr(contact, '<');
-- if (c) {
-- /* Take to > */
-- ++c;
-- len = strcspn(c, ">");
-- } else {
-- /* No <> - just take the lot */
-- c = contact; len = strlen(contact);
-- }
-- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ /* Duplicate first route from the list */
-+ if (head && head->lr) {
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
- if (thishop) {
-- strncpy(thishop->hop, c, len); /* safe */
-- thishop->hop[len] = '\0';
-- thishop->next = NULL;
-- /* Goes at the end */
-- if (tail)
-- tail->next = thishop;
-- else
-- head = thishop;
-+ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
-+ thishop->next = head;
-+ head = thishop;
-+ }
-+ } else {
-+ /* Append the Contact: if there is one and first route is w/o `lr' param */
-+ /* Can be multiple Contact headers, comma separated values - we just take the first */
-+ contact = get_header(req, "Contact");
-+ if (!ast_strlen_zero(contact)) {
-+ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-+ /* Look for <: delimited address */
-+ c = strchr(contact, '<');
-+ if (c) {
-+ /* Take to > */
-+ ++c;
-+ len = strcspn(c, ">");
-+ } else {
-+ /* No <> - just take the lot */
-+ c = contact; len = strlen(contact);
-+ }
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ if (thishop) {
-+ strncpy(thishop->hop, c, len); /* safe */
-+ thishop->hop[len] = '\0';
-+ thishop->next = NULL;
-+ /* Goes at the end */
-+ if (tail)
-+ tail->next = thishop;
-+ else
-+ head = thishop;
+ /* Link in */
+@@ -6018,31 +6020,41 @@ static void build_route(struct sip_pvt *
+
+ /* Only append the contact if we are dealing with a strict router */
+ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) {
+- /* 2nd append the Contact: if there is one */
+- /* Can be multiple Contact headers, comma separated values - we just take the first */
+- contact = get_header(req, "Contact");
+- if (!ast_strlen_zero(contact)) {
+- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
+- /* Look for <: delimited address */
+- c = strchr(contact, '<');
+- if (c) {
+- /* Take to > */
+- ++c;
+- len = strcspn(c, ">") + 1;
+- } else {
+- /* No <> - just take the lot */
+- c = contact;
+- len = strlen(contact) + 1;
+- }
+- thishop = malloc(sizeof(*thishop) + len);
++ /* Duplicate first route from the list */
++ if (head && head->lr) {
++ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
+ if (thishop) {
+- ast_copy_string(thishop->hop, c, len);
+- thishop->next = NULL;
+- /* Goes at the end */
+- if (tail)
+- tail->next = thishop;
+- else
+- head = thishop;
++ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
++ thishop->next = head;
++ head = thishop;
+ }
++ } else {
++ /* Append the Contact: if there is one and first route is w/o `lr' param */
++ /* Can be multiple Contact headers, comma separated values - we just take the first */
++ contact = get_header(req, "Contact");
++ if (!ast_strlen_zero(contact)) {
++ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
++ /* Look for <: delimited address */
++ c = strchr(contact, '<');
++ if (c) {
++ /* Take to > */
++ ++c;
++ len = strcspn(c, ">") + 1;
++ } else {
++ /* No <> - just take the lot */
++ c = contact;
++ len = strlen(contact) + 1;
++ }
++ thishop = malloc(sizeof(*thishop) + len);
++ if (thishop) {
++ ast_copy_string(thishop->hop, c, len);
++ thishop->next = NULL;
++ /* Goes at the end */
++ if (tail)
++ tail->next = thishop;
++ else
++ head = thishop;
++ }
+ }
}
}
- /* Store as new route */
-@@ -7338,7 +7353,11 @@
- /* Get destination right away */
- gotdest = get_destination(p, NULL);
- get_rdnis(p, NULL);
-- extract_uri(p, req);
-+ build_route(p, req, 0);
-+ if (!p->route->lr)
-+ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
-+ else
-+ extract_uri(p, req);
- build_contact(p);
+@@ -10336,7 +10348,11 @@ static int handle_request_invite(struct
+ gotdest = get_destination(p, NULL);
- if (gotdest) {
-@@ -7366,7 +7385,6 @@
- c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
- *recount = 1;
- /* Save Record-Route for any later requests we make on this dialogue */
-- build_route(p, req, 0);
- if (c) {
- /* Pre-lock the call */
- ast_mutex_lock(&c->lock);
-@@ -7426,6 +7444,14 @@
- transmit_response(p, "180 Ringing", req);
- break;
- case AST_STATE_UP:
-+ /* Assuming this to be reinvite, process new SDP portion */
-+ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
-+ process_sdp(p, req);
-+ } else {
-+ p->jointcapability = p->capability;
-+ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
-+ }
-+
- transmit_response_with_sdp(p, "200 OK", req, 1);
- break;
- default:
+ get_rdnis(p, NULL);
+- extract_uri(p, req);
++ build_route(p, req, 0);
++ if (!p->route->lr)
++ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
++ else
++ extract_uri(p, req);
+ build_contact(p);
+
+ if (gotdest) {
+@@ -10364,7 +10380,6 @@ static int handle_request_invite(struct
+ c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
+ *recount = 1;
+ /* Save Record-Route for any later requests we make on this dialogue */
+- build_route(p, req, 0);
+ if (c) {
+ /* Pre-lock the call */
+ ast_mutex_lock(&c->lock);
+@@ -10450,6 +10465,13 @@ static int handle_request_invite(struct
+ transmit_response(p, "180 Ringing", req);
+ break;
+ case AST_STATE_UP:
++ /* Assuming this to be reinvite, process new SDP portion */
++ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
++ process_sdp(p, req);
++ } else {
++ p->jointcapability = p->capability;
++ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
++ }
+ transmit_response_with_sdp(p, "200 OK", req, 1);
+ break;
+ default:
diff --git a/net/asterisk-devel/files/patch-channels::chan_zap.c b/net/asterisk-devel/files/patch-channels::chan_zap.c
index 458a6147..ab02c02 100644
--- a/net/asterisk-devel/files/patch-channels::chan_zap.c
+++ b/net/asterisk-devel/files/patch-channels::chan_zap.c
@@ -1,85 +1,65 @@
$FreeBSD$
---- channels/chan_zap.c.orig Sun Feb 17 18:01:44 2002
-+++ channels/chan_zap.c Sun Feb 17 18:03:26 2002
-@@ -46,7 +46,9 @@
- #include <sys/signal.h>
- #include <errno.h>
- #include <stdlib.h>
-+#ifndef __FreeBSD__
- #include <stdint.h>
-+#endif
- #include <unistd.h>
- #include <sys/ioctl.h>
- #ifdef __linux__
-@@ -320,7 +322,7 @@
- #define CALLWAITING_REPEAT_SAMPLES ( (10000 * 8) / READ_SIZE) /* 300 ms */
- #define CIDCW_EXPIRE_SAMPLES ( (500 * 8) / READ_SIZE) /* 500 ms */
- #define MIN_MS_SINCE_FLASH ( (2000) ) /* 2000 ms */
--#define RINGT ( (8000 * 8) / READ_SIZE)
-+#define RINGT ( (8000 * 8) / READ_SIZE) /* 8000 ms */
-
- struct zt_pvt;
-
-@@ -535,6 +537,7 @@
- int cidpos;
+--- channels/chan_zap.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_zap.c Fri Jan 13 13:28:33 2006
+@@ -638,6 +638,7 @@ static struct zt_pvt {
int cidlen;
int ringt;
+ int ringt_base;
+ int waitnorings;
int stripmsd;
- int callwaiting;
int callwaitcas;
-@@ -2134,12 +2137,20 @@
-
- if (option_debug)
- ast_log(LOG_DEBUG, "zt_hangup(%s)\n", ast->name);
-+
- if (!ast->pvt->pvt) {
- ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
- return 0;
+ int callwaitrings;
+@@ -2308,6 +2309,19 @@ static int zt_hangup(struct ast_channel
}
ast_mutex_lock(&p->lock);
++ switch (p->sig) {
++ case SIG_FXSGS:
++ case SIG_FXSKS:
++ case SIG_FXSLS:
++ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
++ {
++ p->waitnorings = 1;
++ }
++ break;
++ default:
++ break;
++ };
+
-+
-+ if((p->sig == SIG_FXSGS) || (p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS))
-+ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
-+ {
-+ p->waitnorings = 1;
-+ }
index = zt_get_index(ast, p, 1);
-@@ -5717,7 +5728,37 @@
+@@ -6129,7 +6143,37 @@ static void *ss_thread(void *data)
ast_setstate(chan, AST_STATE_RING);
chan->rings = 1;
- p->ringt = RINGT;
+ p->ringt = p->ringt_base;
+ p->waitnorings = 0;
res = ast_pbx_run(chan);
+
+ if(p->waitnorings)
+ {
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+ for(;;)
+ {
+ int i,j=0;
+ i = ZT_IOMUX_SIGEVENT | ZT_IOMUX_NOWAIT;
-+ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
++ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
+ break;
-+
-+ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
++
++ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
+ break;
-+
++
+ if(j == ZT_EVENT_RINGOFFHOOK)
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+
+ usleep(20000);
+
+ if (p->ringt <= 0)
+ break;
+
-+ else if (p->ringt > 0)
++ else if (p->ringt > 0)
+ p->ringt--;
+ }
+ p->ringt = 0;
@@ -89,7 +69,7 @@ $FreeBSD$
if (res) {
ast_hangup(chan);
ast_log(LOG_WARNING, "PBX exited non-zero\n");
-@@ -6018,7 +6059,7 @@
+@@ -6431,7 +6475,7 @@ static void *do_monitor(void *data)
i = iflist;
while(i) {
if ((i->subs[SUB_REAL].zfd > -1) && i->sig && (!i->radio)) {
diff --git a/net/asterisk-devel/files/patch-channels::h323::Makefile b/net/asterisk-devel/files/patch-channels::h323::Makefile
deleted file mode 100644
index 779096b..0000000
--- a/net/asterisk-devel/files/patch-channels::h323::Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-
-$FreeBSD$
-
---- channels/h323/Makefile.orig
-+++ channels/h323/Makefile
-@@ -53,7 +53,7 @@
- LIBS+=-lpthread
- endif
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS += -pthread
-+CFLAGS += $(PTHREAD_LIBS)
- endif
- CFLAGS += -D_REENTRANT -D_GNU_SOURCE
- CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
-@@ -77,20 +77,20 @@
- ar cr libchanh323.a ast_h323.o
-
- ast_h323.o: ast_h323.cpp
-- $(CXX) -g -c -fno-rtti -o $@ $(CFLAGS) $<
-+ $(CXX) $(CXXFLAGS) -c -fno-rtti -o $@ $(CFLAGS) $<
-
- ifneq ($(wildcard .depend),)
- include .depend
- endif
-
- chan_h323.so:
-- $(CXX) -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_d.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_s.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
- clean:
- rm -f *.o *.so core.* libchanh323.a .depend
-
diff --git a/net/asterisk-devel/files/patch-channels::h323::ast_h323.cpp b/net/asterisk-devel/files/patch-channels::h323::ast_h323.cpp
new file mode 100644
index 0000000..feb79e5
--- /dev/null
+++ b/net/asterisk-devel/files/patch-channels::h323::ast_h323.cpp
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.cpp.orig Thu Jan 12 18:16:08 2006
++++ channels/h323/ast_h323.cpp Thu Jan 12 18:16:35 2006
+@@ -953,8 +953,8 @@ BOOL MyH323Connection::OnReceivedCapabil
+ H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capability & capability,
+ H323Channel::Directions dir,
+ unsigned sessionID,
+- const H245_H2250LogicalChannelParameters * /*param*/,
+- RTP_QOS * /*param*/ )
++ const H245_H2250LogicalChannelParameters * /*param*/ /*,
++ RTP_QOS * */ /*param*/ )
+ {
+ return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID);
+ }
diff --git a/net/asterisk-devel/files/patch-channels::h323::ast_h323.h b/net/asterisk-devel/files/patch-channels::h323::ast_h323.h
new file mode 100644
index 0000000..606bb01
--- /dev/null
+++ b/net/asterisk-devel/files/patch-channels::h323::ast_h323.h
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.h.orig Thu Jan 12 18:14:49 2006
++++ channels/h323/ast_h323.h Thu Jan 12 18:15:02 2006
+@@ -155,8 +155,8 @@ class MyH323Connection : public H323Conn
+ H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
+ H323Channel::Directions,
+ unsigned,
+- const H245_H2250LogicalChannelParameters *,
+- RTP_QOS *);
++ const H245_H2250LogicalChannelParameters * /* ,
++ RTP_QOS * */);
+ H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
+ const H323SignalPDU &,
+ H323SignalPDU &);
diff --git a/net/asterisk-devel/files/patch-codecs::Makefile b/net/asterisk-devel/files/patch-codecs::Makefile
index 325e590..ab5cbc4 100644
--- a/net/asterisk-devel/files/patch-codecs::Makefile
+++ b/net/asterisk-devel/files/patch-codecs::Makefile
@@ -1,39 +1,48 @@
---- codecs/Makefile.orig Thu Mar 17 20:43:51 2005
-+++ codecs/Makefile Thu Apr 14 00:09:04 2005
-@@ -17,25 +17,23 @@
- # g723.1b)
- #
- #MODG723=codec_g723_1.so codec_g723_1b.so
--MODG723=$(shell [ -f g723.1/coder.c ] && echo "codec_g723_1.so")
--MODG723+=$(shell [ -f g723.1b/coder2.c ] && echo "codec_g723_1b.so")
--MODSPEEX=$(shell [ -f /usr/include/speex.h ] || [ -f /usr/include/speex/speex.h ] || [ -f /usr/local/include/speex.h ] || [ -f /usr/local/include/speex/speex.h ] && echo "codec_speex.so")
--MODILBC=$(shell [ -f ilbc/iLBC_decode.h ] && echo "codec_ilbc.so")
-+MODG723=codec_g723_1_dummy.so
-+MODG729=codec_g729_dummy.so
-+MODSPEEX=codec_speex.so
-+MODILBC=codec_ilbc.so
- CFLAGS+=-fPIC
--CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include")
--CFLAGS+=$(shell [ -f /usr/local/include/speex/speex.h ] && echo "-I/usr/local/include/speex")
--CFLAGS+=$(shell [ -f /usr/include/speex/speex.h ] && echo "-I/usr/include/speex")
-+CFLAGS+=-I$(LOCALBASE)/include
+
+$FreeBSD$
+
+--- codecs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ codecs/Makefile Fri Jan 13 10:33:21 2006
+@@ -30,8 +30,8 @@
- LIBG723=g723.1/libg723.a
- LIBG723B=g723.1b/libg723b.a
- LIBGSM=gsm/lib/libgsm.a
- LIBGSMT=gsm/lib/libgsm.a
+ UI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex.h)
+ UIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex/speex.h)
+-ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex.h)
+-ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex/speex.h)
++ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex.h)
++ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex/speex.h)
+ ifneq (${UI_SPEEX},)
+ MODSPEEX=codec_speex.so
+ LIBSPEEX+=-lspeex -lm
+@@ -43,14 +43,14 @@
+ endif
+ ifneq (${ULI_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+ ifneq (${ULIS_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/speex
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+
+@@ -65,7 +65,7 @@
LIBLPC10=lpc10/liblpc10.a
--LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
-+LIBSPEEX=-L$(LOCALBASE)/lib
- LIBSPEEX+=-lspeex -lm
- LIBILBC=ilbc/libilbc.a
--CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
-+CODECS+=$(MODG723) $(MODG729) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
- codec_adpcm.so codec_ulaw.so codec_alaw.so codec_a_mu.so \
- codec_g726.so
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
-@@ -93,7 +91,7 @@
+ CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
+@@ -126,7 +126,7 @@
endif
install: all
diff --git a/net/asterisk-devel/files/patch-codecs::codec_g723_1_dummy.c b/net/asterisk-devel/files/patch-codecs::codec_g723_1_dummy.c
deleted file mode 100644
index 3ce9571..0000000
--- a/net/asterisk-devel/files/patch-codecs::codec_g723_1_dummy.c
+++ /dev/null
@@ -1,314 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g723_1_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g723_1_dummy.c Sun Oct 10 16:07:05 2004
-@@ -0,0 +1,308 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.723.1 (dummy!)
-+ *
-+ * The G.723.1 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#define TYPE_HIGH 0x0
-+#define TYPE_LOW 0x1
-+#define TYPE_SILENCE 0x2
-+#define TYPE_DONTSEND 0x3
-+#define TYPE_MASK 0x3
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g723_ex.h"
-+#include "g723_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.723.1/PCM16 Codec Translator";
-+
-+struct g723_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g723_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g723tolin_new()
-+{
-+ struct g723_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog723_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g723_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g723_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g723_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g723tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G723_1;
-+ f.datalen = sizeof(g723_slin_ex);
-+ /* All frames are 30 ms long */
-+ f.samples = 30;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g723_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog723_new()
-+{
-+ struct g723_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g723tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g723_len(unsigned char buf)
-+{
-+ switch(buf & TYPE_MASK) {
-+ case TYPE_DONTSEND:
-+ return 2;
-+ break;
-+ case TYPE_SILENCE:
-+ return 4;
-+ break;
-+ case TYPE_HIGH:
-+ return 24;
-+ break;
-+ case TYPE_LOW:
-+ return 20;
-+ break;
-+ default:
-+ ast_log(LOG_WARNING, "Badly encoded frame (%d)\n", buf & TYPE_MASK);
-+ }
-+ return -1;
-+}
-+
-+static int g723tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ int len = 0;
-+ int res;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ res = g723_len(((unsigned char *)f->data + len)[0]);
-+ if (res < 0) {
-+ ast_log(LOG_WARNING, "Invalid data\n");
-+ return -1;
-+ }
-+ if (res + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 480 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 480);
-+ tmp->tail+=480;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += res;
-+ }
-+ return 0;
-+}
-+
-+static int lintog723_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog723_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 480)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G723_1;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 480) {
-+ /* Encode a frame of data */
-+ if (cnt + 24 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 24);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 30;
-+ cnt += 24;
-+ tmp->tail -= 480;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 480, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g723_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g723tolin =
-+ { "g723tolin_dummy",
-+ AST_FORMAT_G723_1, AST_FORMAT_SLINEAR,
-+ g723tolin_new,
-+ g723tolin_framein,
-+ g723tolin_frameout,
-+ g723_destroy,
-+ g723tolin_sample
-+ };
-+
-+static struct ast_translator lintog723 =
-+ { "lintog723_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G723_1,
-+ lintog723_new,
-+ lintog723_framein,
-+ lintog723_frameout,
-+ g723_destroy,
-+ lintog723_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog723);
-+ if (!res)
-+ res = ast_unregister_translator(&g723tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g723tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog723);
-+ else
-+ ast_unregister_translator(&g723tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk-devel/files/patch-codecs::codec_g729_dummy.c b/net/asterisk-devel/files/patch-codecs::codec_g729_dummy.c
deleted file mode 100644
index 9fcc7b1..0000000
--- a/net/asterisk-devel/files/patch-codecs::codec_g729_dummy.c
+++ /dev/null
@@ -1,281 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g729_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g729_dummy.c Sun Oct 10 16:07:12 2004
-@@ -0,0 +1,275 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.729 (dummy!)
-+ *
-+ * The G.729 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g729_ex.h"
-+#include "g729_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.729/PCM16 Codec Translator";
-+
-+struct g729_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g729_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g729tolin_new()
-+{
-+ struct g729_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog729_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g729_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g729_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g729_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g729tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G729A;
-+ f.datalen = sizeof(g729_slin_ex);
-+ /* All frames are 10 ms long */
-+ f.samples = 10;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g729_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog729_new()
-+{
-+ struct g729_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g729tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g729tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ int len = 0;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ if (10 + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 160 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 160);
-+ tmp->tail+=160;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += 10;
-+ }
-+ return 0;
-+}
-+
-+static int lintog729_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog729_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 160)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G729A;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 160) {
-+ /* Encode a frame of data */
-+ if (cnt + 10 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 10);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 10;
-+ cnt += 10;
-+ tmp->tail -= 160;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 160, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g729_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g729tolin =
-+ { "g729tolin_dummy",
-+ AST_FORMAT_G729A, AST_FORMAT_SLINEAR,
-+ g729tolin_new,
-+ g729tolin_framein,
-+ g729tolin_frameout,
-+ g729_destroy,
-+ g729tolin_sample
-+ };
-+
-+static struct ast_translator lintog729 =
-+ { "lintog729_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G729A,
-+ lintog729_new,
-+ lintog729_framein,
-+ lintog729_frameout,
-+ g729_destroy,
-+ lintog729_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog729);
-+ if (!res)
-+ res = ast_unregister_translator(&g729tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g729tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog729);
-+ else
-+ ast_unregister_translator(&g729tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk-devel/files/patch-codecs::g729_slin_ex.h b/net/asterisk-devel/files/patch-codecs::g729_slin_ex.h
deleted file mode 100644
index 44e60f2..0000000
--- a/net/asterisk-devel/files/patch-codecs::g729_slin_ex.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/g729_slin_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,14 @@
-+/*
-+ * g729_slin_ex.h --
-+ *
-+ * 8-bit G.729 data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Copyright (C) 2004, Maxim Sobolev <sobomax@FreeBSD.org>
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static unsigned char g729_slin_ex[] = {
-+120,82,175,64,0,250,219,0,7,214
-+};
diff --git a/net/asterisk-devel/files/patch-codecs::ilbc::Makefile b/net/asterisk-devel/files/patch-codecs::ilbc::Makefile
index 7770e07..26a2f20 100644
--- a/net/asterisk-devel/files/patch-codecs::ilbc::Makefile
+++ b/net/asterisk-devel/files/patch-codecs::ilbc::Makefile
@@ -1,11 +1,12 @@
$FreeBSD$
---- codecs/ilbc/Makefile.orig Sun Apr 27 21:13:11 2003
-+++ codecs/ilbc/Makefile Fri Jan 30 01:47:34 2004
-@@ -1,4 +1,4 @@
--CFLAGS+= -fPIC -O3
-+CFLAGS+= -fPIC
- LIB=libilbc.a
-
- OBJS= anaFilter.o iCBSearch.o packing.o \
+--- codecs/ilbc/Makefile.orig Fri Jan 13 11:01:07 2006
++++ codecs/ilbc/Makefile Fri Jan 13 11:01:51 2006
+@@ -1,5 +1,5 @@
+ ARCH=$(PROC)
+-CFLAGS+=-Wall -O3 -funroll-loops
++CFLAGS+=-Wall -funroll-loops
+ ifneq (${OSARCH},CYGWIN)
+ CFLAGS += -fPIC
+ endif
diff --git a/net/asterisk-devel/files/patch-codecs::slin_g729_ex.h b/net/asterisk-devel/files/patch-codecs::slin_g729_ex.h
deleted file mode 100644
index e1236d2..0000000
--- a/net/asterisk-devel/files/patch-codecs::slin_g729_ex.h
+++ /dev/null
@@ -1,31 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/slin_g729_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,25 @@
-+/*
-+ * slin_g729_ex.h --
-+ *
-+ * Signed 16-bit audio data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Source: g723.example
-+ *
-+ * Copyright (C) 2001, Linux Support Services, Inc.
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static signed short slin_g729_ex[] = {
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-+};
diff --git a/net/asterisk-devel/files/patch-configs::musiconhold.conf.sample b/net/asterisk-devel/files/patch-configs::musiconhold.conf.sample
new file mode 100644
index 0000000..ff63cc9
--- /dev/null
+++ b/net/asterisk-devel/files/patch-configs::musiconhold.conf.sample
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- configs/musiconhold.conf.sample.orig Tue Nov 29 20:24:39 2005
++++ configs/musiconhold.conf.sample Fri Jan 13 11:38:39 2006
+@@ -4,7 +4,7 @@
+
+ [default]
+ mode=quietmp3
+-directory=/var/lib/asterisk/mohmp3
++directory=/usr/local/share/asterisk/mohmp3
+
+ ; valid mode options:
+ ; quietmp3 -- default
diff --git a/net/asterisk-devel/files/patch-db.c b/net/asterisk-devel/files/patch-db.c
index 6c2bdcd..ba7f3f2 100644
--- a/net/asterisk-devel/files/patch-db.c
+++ b/net/asterisk-devel/files/patch-db.c
@@ -1,14 +1,21 @@
$FreeBSD$
---- db.c.orig Fri Jul 9 13:08:09 2004
-+++ db.c Sun Oct 10 15:32:33 2004
-@@ -33,7 +33,7 @@
- #include <asterisk/cli.h>
- #include <asterisk/utils.h>
- #include <asterisk/lock.h>
--#include "db1-ast/include/db.h"
+--- db.c.orig Fri Jan 13 11:05:32 2006
++++ db.c Fri Jan 13 11:06:55 2006
+@@ -35,6 +35,7 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <dirent.h>
+#include <db.h>
+
#include "asterisk.h"
- #include "astconf.h"
+@@ -51,7 +52,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
+ #include "asterisk/utils.h"
+ #include "asterisk/lock.h"
+ #include "asterisk/manager.h"
+-#include "db1-ast/include/db.h"
+
+ #ifdef __CYGWIN__
+ #define dbopen __dbopen
diff --git a/net/asterisk-devel/files/patch-formats::Makefile b/net/asterisk-devel/files/patch-formats::Makefile
index dacfd7b..b2b1db5 100644
--- a/net/asterisk-devel/files/patch-formats::Makefile
+++ b/net/asterisk-devel/files/patch-formats::Makefile
@@ -1,19 +1,19 @@
$FreeBSD$
---- formats/Makefile.orig Tue Nov 4 04:40:09 2003
-+++ formats/Makefile Fri Jan 30 01:47:34 2004
-@@ -18,7 +18,7 @@
+--- formats/Makefile.orig Fri Jan 13 11:16:07 2006
++++ formats/Makefile Fri Jan 13 11:47:25 2006
+@@ -20,7 +20,7 @@
#
- # G723 simple frame is depricated
+ # G723 simple frame is deprecated
#
--#FORMAT_LIBS+=format_g723.so
+-FORMAT_LIBS+=format_g723.so
+FORMAT_LIBS+=format_g723_1.so
- GSMLIB=../codecs/gsm/lib/libgsm.a
-
-@@ -40,7 +40,7 @@
- $(CC) $(SOLINK) -o $@ $< -lm
+ #
+ # OGG/Vorbis format
+@@ -60,7 +60,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -logg -lvorbis -lvorbisenc -lm
install: all
- for x in $(FORMAT_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
diff --git a/net/asterisk-devel/files/patch-formats::format_g723_1.c b/net/asterisk-devel/files/patch-formats::format_g723_1.c
index fb5eb12..ae814f1 100644
--- a/net/asterisk-devel/files/patch-formats::format_g723_1.c
+++ b/net/asterisk-devel/files/patch-formats::format_g723_1.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- formats/format_g723_1.c.orig Sun Oct 10 15:59:18 2004
-+++ formats/format_g723_1.c Sun Oct 10 16:05:05 2004
-@@ -0,0 +1,345 @@
+--- /dev/null Fri Jan 13 12:18:51 2006
++++ formats/format_g723_1.c Fri Jan 13 12:18:41 2006
+@@ -0,0 +1,348 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -16,6 +16,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/channel.h>
+#include <asterisk/file.h>
@@ -26,7 +27,6 @@ $FreeBSD$
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <sys/time.h>
-+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
@@ -48,7 +48,7 @@ $FreeBSD$
+struct ast_filestream {
+ void *reserved[AST_RESERVED_POINTERS];
+ /* This is what a filestream means to us */
-+ int fd; /* Descriptor */
++ FILE *f; /* Descriptor */
+ struct ast_frame fr; /* Frame information */
+ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
+ char empty; /* Empty character */
@@ -85,7 +85,7 @@ $FreeBSD$
+ return -1;
+}
+
-+static struct ast_filestream *g723_open(int fd)
++static struct ast_filestream *g723_open(FILE *f)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -98,7 +98,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ tmp->fr.data = tmp->g723;
+ tmp->fr.frametype = AST_FRAME_VOICE;
+ tmp->fr.subclass = AST_FORMAT_G723_1;
@@ -112,7 +112,7 @@ $FreeBSD$
+ return tmp;
+}
+
-+static struct ast_filestream *g723_rewrite(int fd, char *comment)
++static struct ast_filestream *g723_rewrite(FILE *f, const char *comment)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -125,7 +125,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ glistcnt++;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
@@ -143,7 +143,7 @@ $FreeBSD$
+ glistcnt--;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
-+ close(s->fd);
++ fclose(s->f);
+ free(s);
+ s = NULL;
+}
@@ -158,7 +158,7 @@ $FreeBSD$
+ s->fr.samples = 240;
+ s->fr.mallocd = 0;
+ s->fr.data = s->g723;
-+ if ((res = read(s->fd, s->g723, 1)) != 1) {
++ if ((res = fread(s->g723, 1, 1, s->f)) != 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -168,7 +168,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 frame!\n");
+ return NULL;
+ }
-+ if (s->fr.datalen > 1 && (res = read(s->fd, s->g723 + 1, s->fr.datalen - 1)) != s->fr.datalen - 1) {
++ if (s->fr.datalen > 1 && (res = fread(s->g723 + 1, 1, s->fr.datalen - 1, s->f)) != s->fr.datalen - 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -200,7 +200,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 data length, %d\n", f->datalen);
+ return -1;
+ }
-+ if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
++ if ((res = fwrite(f->data, 1, f->datalen, fs->f)) != f->datalen) {
+ ast_log(LOG_WARNING, "Bad write %d: %s\n", res, strerror(errno));
+ return -1;
+ }
@@ -229,10 +229,13 @@ $FreeBSD$
+ }
+ offset = cur + sample_offset;
+ }
-+ if ((moffset = lseek(fs->fd, 0, SEEK_END)) == -1) {
++ if (fseeko(fs->f, 0, SEEK_END) == -1) {
+ ast_log(LOG_WARNING, "Can't seek stream to an end!\n");
+ return -1;
+ }
++ else {
++ moffset = ftello(fs->f);
++ }
+ if (whence == SEEK_END) {
+ if ((max = g723_tell(fs)) == -1) {
+ ast_log(LOG_WARNING, "Can't get maximum position!\n");
@@ -244,11 +247,11 @@ $FreeBSD$
+ offset = 0;
+ soffset = -1;
+ for (coffset = 0; coffset < moffset && offset > 0; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %lli!\n", coffset);
+ return -1;
+ }
@@ -260,7 +263,7 @@ $FreeBSD$
+ if (res > 1)
+ offset -= 240;
+ }
-+ if (soffset != -1 && lseek(fs->fd, soffset, SEEK_SET) != soffset) {
++ if (soffset != -1 && fseeko(fs->f, soffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", soffset);
+ return -1;
+ }
@@ -271,7 +274,7 @@ $FreeBSD$
+static int g723_trunc(struct ast_filestream *fs)
+{
+ /* Truncate file to current length */
-+ if (ftruncate(fs->fd, lseek(fs->fd, 0, SEEK_CUR)) < 0)
++ if (ftruncate(fileno(fs->f), ftello(fs->f)) < 0)
+ return -1;
+ return 0;
+}
@@ -283,14 +286,14 @@ $FreeBSD$
+ long rval;
+ unsigned char c;
+
-+ offset = lseek(fs->fd, 0, SEEK_CUR);
++ offset = ftello(fs->f);
+ rval = 0;
+ for (coffset = 0; coffset < offset; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %llu!\n", coffset);
+ return -1;
+ }
@@ -301,7 +304,7 @@ $FreeBSD$
+ if (res > 1)
+ rval += 240;
+ }
-+ if (lseek(fs->fd, offset, SEEK_SET) != offset) {
++ if (fseeko(fs->f, offset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", offset);
+ return -1;
+ }
diff --git a/net/asterisk-devel/files/patch-formats::format_g729.c b/net/asterisk-devel/files/patch-formats::format_g729.c
index 78899a3..11be528 100644
--- a/net/asterisk-devel/files/patch-formats::format_g729.c
+++ b/net/asterisk-devel/files/patch-formats::format_g729.c
@@ -1,6 +1,9 @@
---- formats/format_g729.c.orig Mon Feb 7 10:29:19 2005
-+++ formats/format_g729.c Wed Mar 9 06:26:36 2005
-@@ -44,7 +44,7 @@
+
+$FreeBSD$
+
+--- formats/format_g729.c.orig Fri Jan 13 12:20:53 2006
++++ formats/format_g729.c Fri Jan 13 12:23:33 2006
+@@ -60,7 +60,7 @@ struct ast_filestream {
struct ast_frame fr; /* Frame information */
char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
char empty; /* Empty character */
@@ -9,7 +12,7 @@
};
-@@ -125,11 +125,11 @@
+@@ -141,11 +141,11 @@ static struct ast_frame *g729_read(struc
s->fr.frametype = AST_FRAME_VOICE;
s->fr.subclass = AST_FORMAT_G729A;
s->fr.offset = AST_FRIENDLY_OFFSET;
@@ -19,24 +22,24 @@
+ s->fr.datalen = 10;
s->fr.mallocd = 0;
s->fr.data = s->g729;
-- if ((res = read(s->fd, s->g729, 20)) != 20) {
-+ if ((res = read(s->fd, s->g729, 10)) != 10) {
+- if ((res = fread(s->g729, 1, 20, s->f)) != 20) {
++ if ((res = fread(s->g729, 1, 10, s->f)) != 10) {
if (res && (res != 10))
ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
return NULL;
-@@ -173,7 +173,7 @@
- cur = lseek(fs->fd, 0, SEEK_CUR);
- max = lseek(fs->fd, 0, SEEK_END);
+@@ -190,7 +190,7 @@ static int g729_seek(struct ast_filestre
+ fseek(fs->f, 0, SEEK_END);
+ max = ftell(fs->f);
- bytes = 20 * (sample_offset / 160);
+ bytes = 10 * (sample_offset / 80);
if (whence == SEEK_SET)
offset = bytes;
else if (whence == SEEK_CUR || whence == SEEK_FORCECUR)
-@@ -202,7 +202,7 @@
+@@ -219,7 +219,7 @@ static long g729_tell(struct ast_filestr
{
off_t offset;
- offset = lseek(fs->fd, 0, SEEK_CUR);
+ offset = ftell(fs->f);
- return (offset/20)*160;
+ return (offset/10)*80;
}
diff --git a/net/asterisk-devel/files/patch-funcs::Makefile b/net/asterisk-devel/files/patch-funcs::Makefile
new file mode 100644
index 0000000..a14daee
--- /dev/null
+++ b/net/asterisk-devel/files/patch-funcs::Makefile
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- funcs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ funcs/Makefile Fri Jan 13 12:36:57 2006
+@@ -67,7 +67,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
+
+ install: all
+- for x in $(FUNCS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
++ for x in $(FUNCS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
+
+ ifneq ($(wildcard .depend),)
+ include .depend
diff --git a/net/asterisk-devel/files/patch-pbx::Makefile b/net/asterisk-devel/files/patch-pbx::Makefile
index dca6672..97d03e1 100644
--- a/net/asterisk-devel/files/patch-pbx::Makefile
+++ b/net/asterisk-devel/files/patch-pbx::Makefile
@@ -1,18 +1,20 @@
$FreeBSD$
---- pbx/Makefile.orig Sun Oct 26 20:50:49 2003
-+++ pbx/Makefile Fri Jan 30 01:47:34 2004
-@@ -16,7 +16,7 @@
- PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so # pbx_gtkconsole.so pbx_kdeconsole.so
-
- # Add GTK console if appropriate
--PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
-+#PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
+--- pbx/Makefile.orig
++++ pbx/Makefile
+@@ -23,8 +23,8 @@
# Add KDE Console if appropriate
#PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so")
-@@ -62,7 +62,7 @@
+-GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
+-GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
++#GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
++#GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
+ MOC=$(QTDIR)/bin/moc
+ KDE_FLAGS=-I$(KDEDIR)/include -I$(KDEDIR)/include/kde -I$(QTDIR)/include
+ KDE_LIBS=-L$(KDEDIR)/lib -L$(QTDIR)/lib -lqt -lkdecore -lkdeui
+@@ -72,7 +72,7 @@
endif
install: all
diff --git a/net/asterisk-devel/files/patch-pbx::pbx_wilcalu.c b/net/asterisk-devel/files/patch-pbx::pbx_wilcalu.c
deleted file mode 100644
index 41722c6..0000000
--- a/net/asterisk-devel/files/patch-pbx::pbx_wilcalu.c
+++ /dev/null
@@ -1,14 +0,0 @@
---- pbx/pbx_wilcalu.c.orig Tue Apr 26 10:00:28 2005
-+++ pbx/pbx_wilcalu.c Tue Apr 26 10:03:42 2005
-@@ -82,6 +82,11 @@
- fds[0].events = POLLIN;
- poll(fds, 1, -1);
- bytes=read(fd,buf,256);
-+ if (bytes <= 0) {
-+ /* XXX error on device, sleep a bit before retrying */
-+ sleep(1);
-+ continue;
-+ }
- buf[(int)bytes]=0;
-
- if(bytes>0){
diff --git a/net/asterisk-devel/files/patch-res-res_watchdog.c b/net/asterisk-devel/files/patch-res-res_watchdog.c
deleted file mode 100644
index 51e4b0a..0000000
--- a/net/asterisk-devel/files/patch-res-res_watchdog.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- res/res_watchdog.c.orig Fri Jul 15 13:24:24 2005
-+++ res/res_watchdog.c Fri Jul 15 13:24:42 2005
-@@ -40,6 +40,10 @@
-
- /* Registrar for operations */
-
-+#ifndef O_SYNC
-+#define O_SYNC O_FSYNC
-+#endif
-+
- static struct watchdog_pvt *watchdogs = NULL;
-
- STANDARD_LOCAL_USER;
diff --git a/net/asterisk-devel/files/patch-res::Makefile b/net/asterisk-devel/files/patch-res::Makefile
index 3e48e84..de5c365 100644
--- a/net/asterisk-devel/files/patch-res::Makefile
+++ b/net/asterisk-devel/files/patch-res::Makefile
@@ -1,33 +1,35 @@
---- res/Makefile.orig Tue Aug 9 17:18:55 2005
-+++ res/Makefile Tue Aug 9 17:33:36 2005
-@@ -13,15 +13,18 @@
+
+$FreeBSD$
+
+--- res/Makefile
++++ res/Makefile
+@@ -37,8 +37,8 @@
+ endif
- MODS=res_adsi.so res_features.so res_crypto.so res_musiconhold.so res_indications.so res_monitor.so \
- res_agi.so res_watchdog.so
--MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
--MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/include/osp/osp.h" ]; then echo "res_osp.so"; fi)
-
- CRYPTO_LIBS=-lssl -lcrypto
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ ifeq (${OSARCH},CYGWIN)
+@@ -55,9 +55,7 @@
CFLAGS+=
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH")
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPATA_MOH
-+endif
- #
- # Work around buggy RedHat 9.0
+
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
+ CFLAGS+=-DZAPATA_MOH
+-endif
+ endif # WITHOUT_ZAPTEL
+
#
-@@ -34,7 +37,7 @@
+@@ -75,7 +73,7 @@
rm -f $(DESTDIR)$(ASTHEADERDIR)/parking.h
rm -f $(DESTDIR)$(MODULES_DIR)/app_agi.so
rm -f $(DESTDIR)$(MODULES_DIR)/res_parking.so
- for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(MODS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- res_crypto.so: res_crypto.o
- $(CC) $(SOLINK) -o $@ $< $(CRYPTO_LIBS)
+ @if [ x`which mpg123 2>/dev/null | grep -v '^no'` != x ] ; then \
+ if mpg123 --longhelp 2>&1 | grep -q .59r 2>&1 >/dev/null ; then echo ; else \
+ echo "*************************************************************";\
diff --git a/net/asterisk-devel/files/patch-rtp.c b/net/asterisk-devel/files/patch-rtp.c
index c652add..bbc2649 100644
--- a/net/asterisk-devel/files/patch-rtp.c
+++ b/net/asterisk-devel/files/patch-rtp.c
@@ -1,23 +1,17 @@
---- rtp.c.orig Tue Apr 26 10:00:28 2005
-+++ rtp.c Tue Apr 26 10:06:35 2005
-@@ -127,7 +127,7 @@
- {
- switch(buf & TYPE_MASK) {
- case TYPE_DONTSEND:
-- return 0;
-+ return 2;
- break;
- case TYPE_SILENCE:
- return 4;
-@@ -862,8 +858,10 @@
- /* Must be an even port number by RTP spec */
+
+$FreeBSD$
+
+--- rtp.c.orig Fri Jan 13 13:38:01 2006
++++ rtp.c Fri Jan 13 13:40:50 2006
+@@ -950,8 +950,10 @@ struct ast_rtp *ast_rtp_new_with_bindadd
rtp->us.sin_port = htons(x);
rtp->us.sin_addr = addr;
+ /* If there's rtcp, initialize it as well. */
- if (rtp->rtcp)
+ if (rtp->rtcp) {
rtp->rtcp->us.sin_port = htons(x + 1);
+ rtp->rtcp->us.sin_addr = addr;
+ }
+ /* Try to bind it/them. */
if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) &&
(!rtp->rtcp || !bind(rtp->rtcp->s, (struct sockaddr *)&rtp->rtcp->us, sizeof(rtp->rtcp->us))))
- break;
diff --git a/net/asterisk-devel/files/patch-utils::Makefile b/net/asterisk-devel/files/patch-utils::Makefile
new file mode 100644
index 0000000..f3164c0
--- /dev/null
+++ b/net/asterisk-devel/files/patch-utils::Makefile
@@ -0,0 +1,34 @@
+
+$FreeBSD$
+
+--- utils/Makefile
++++ utils/Makefile
+@@ -17,16 +17,16 @@
+ CFLAGS+=-DNO_AST_MM
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+ TARGET=stereorize streamplayer
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/popt.h),)
+ TARGET+=smsq
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/newt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/newt.h),)
+ TARGET+=astman
+ endif
+
+@@ -40,7 +40,7 @@
+ install:
+ for x in $(TARGET); do \
+ if [ "$$x" != "none" ]; then \
+- $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
++ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
+ fi; \
+ done
+
diff --git a/net/asterisk-devel/pkg-plist b/net/asterisk-devel/pkg-plist
index 019b270..702370a 100644
--- a/net/asterisk-devel/pkg-plist
+++ b/net/asterisk-devel/pkg-plist
@@ -19,6 +19,12 @@ etc/asterisk/asterisk.adsi-dist
@unexec if cmp -s %D/etc/asterisk/asterisk.conf %D/etc/asterisk/asterisk.conf-dist; then rm -f %D/etc/asterisk/asterisk.conf; fi
etc/asterisk/asterisk.conf-dist
@exec [ -f %B/asterisk.conf ] || cp %B/%f %B/asterisk.conf
+@unexec if cmp -s %D/etc/asterisk/cdr.conf %D/etc/asterisk/cdr.conf-dist; then rm -f %D/etc/asterisk/cdr.conf; fi
+etc/asterisk/cdr.conf-dist
+@exec [ -f %B/cdr.conf ] || cp %B/%f %B/cdr.conf
+@unexec if cmp -s %D/etc/asterisk/cdr_custom.conf %D/etc/asterisk/cdr_custom.conf-dist; then rm -f %D/etc/asterisk/cdr_custom.conf; fi
+etc/asterisk/cdr_custom.conf-dist
+@exec [ -f %B/cdr_custom.conf ] || cp %B/%f %B/cdr_custom.conf
@unexec if cmp -s %D/etc/asterisk/cdr_manager.conf %D/etc/asterisk/cdr_manager.conf-dist; then rm -f %D/etc/asterisk/cdr_manager.conf; fi
etc/asterisk/cdr_manager.conf-dist
@exec [ -f %B/cdr_manager.conf ] || cp %B/%f %B/cdr_manager.conf
@@ -31,9 +37,21 @@ etc/asterisk/cdr_pgsql.conf-dist
@unexec if cmp -s %D/etc/asterisk/cdr_tds.conf %D/etc/asterisk/cdr_tds.conf-dist; then rm -f %D/etc/asterisk/cdr_tds.conf; fi
etc/asterisk/cdr_tds.conf-dist
@exec [ -f %B/cdr_tds.conf ] || cp %B/%f %B/cdr_tds.conf
+@unexec if cmp -s %D/etc/asterisk/codecs.conf %D/etc/asterisk/codecs.conf-dist; then rm -f %D/etc/asterisk/codecs.conf; fi
+etc/asterisk/codecs.conf-dist
+@exec [ -f %B/codecs.conf ] || cp %B/%f %B/codecs.conf
+@unexec if cmp -s %D/etc/asterisk/dnsmgr.conf %D/etc/asterisk/dnsmgr.conf-dist; then rm -f %D/etc/asterisk/dnsmgr.conf; fi
+etc/asterisk/dnsmgr.conf-dist
+@exec [ -f %B/dnsmgr.conf ] || cp %B/%f %B/dmsmgr.conf
+@unexec if cmp -s %D/etc/asterisk/dundi.conf %D/etc/asterisk/dundi.conf-dist; then rm -f %D/etc/asterisk/dundi.conf; fi
+etc/asterisk/dundi.conf-dist
+@exec [ -f %B/dundi.conf ] || cp %B/%f %B/dundi.conf
@unexec if cmp -s %D/etc/asterisk/enum.conf %D/etc/asterisk/enum.conf-dist; then rm -f %D/etc/asterisk/enum.conf; fi
etc/asterisk/enum.conf-dist
@exec [ -f %B/enum.conf ] || cp %B/%f %B/enum.conf
+@unexec if cmp -s %D/etc/asterisk/extensions.ael %D/etc/asterisk/extensions.ael-dist; then rm -f %D/etc/asterisk/extensions.ael; fi
+etc/asterisk/extensions.ael-dist
+@exec [ -f %B/extensions.ael ] || cp %B/%f %B/extensions.ael
@unexec if cmp -s %D/etc/asterisk/extconfig.conf %D/etc/asterisk/extconfig.conf-dist; then rm -f %D/etc/asterisk/extconfig.conf; fi
etc/asterisk/extconfig.conf-dist
@exec [ -f %B/extconfig.conf ] || cp %B/%f %B/extconfig.conf
@@ -46,9 +64,6 @@ etc/asterisk/features.conf-dist
@unexec if cmp -s %D/etc/asterisk/festival.conf %D/etc/asterisk/festival.conf-dist; then rm -f %D/etc/asterisk/festival.conf; fi
etc/asterisk/festival.conf-dist
@exec [ -f %B/festival.conf ] || cp %B/%f %B/festival.conf
-@unexec if cmp -s %D/etc/asterisk/h323.conf %D/etc/asterisk/h323.conf-dist; then rm -f %D/etc/asterisk/h323.conf; fi
-etc/asterisk/h323.conf-dist
-@exec [ -f %B/h323.conf ] || cp %B/%f %B/h323.conf
@unexec if cmp -s %D/etc/asterisk/iax.conf %D/etc/asterisk/iax.conf-dist; then rm -f %D/etc/asterisk/iax.conf; fi
etc/asterisk/iax.conf-dist
@exec [ -f %B/iax.conf ] || cp %B/%f %B/iax.conf
@@ -70,6 +85,9 @@ etc/asterisk/meetme.conf-dist
@unexec if cmp -s %D/etc/asterisk/mgcp.conf %D/etc/asterisk/mgcp.conf-dist; then rm -f %D/etc/asterisk/mgcp.conf; fi
etc/asterisk/mgcp.conf-dist
@exec [ -f %B/mgcp.conf ] || cp %B/%f %B/mgcp.conf
+@unexec if cmp -s %D/etc/asterisk/misdn.conf %D/etc/asterisk/misdn.conf-dist; then rm -f %D/etc/asterisk/misdn.conf; fi
+etc/asterisk/misdn.conf-dist
+@exec [ -f %B/misdn.conf ] || cp %B/%f %B/misdn.conf
@unexec if cmp -s %D/etc/asterisk/modem.conf %D/etc/asterisk/modem.conf-dist; then rm -f %D/etc/asterisk/modem.conf; fi
etc/asterisk/modem.conf-dist
@exec [ -f %B/modem.conf ] || cp %B/%f %B/modem.conf
@@ -94,9 +112,6 @@ etc/asterisk/privacy.conf-dist
@unexec if cmp -s %D/etc/asterisk/queues.conf %D/etc/asterisk/queues.conf-dist; then rm -f %D/etc/asterisk/queues.conf; fi
etc/asterisk/queues.conf-dist
@exec [ -f %B/queues.conf ] || cp %B/%f %B/queues.conf
-@unexec if cmp -s %D/etc/asterisk/res_config_odbc.conf %D/etc/asterisk/res_config_odbc.conf-dist; then rm -f %D/etc/asterisk/res_config_odbc.conf; fi
-etc/asterisk/res_config_odbc.conf-dist
-@exec [ -f %B/res_config_odbc.conf ] || cp %B/%f %B/res_config_odbc.conf
@unexec if cmp -s %D/etc/asterisk/res_odbc.conf %D/etc/asterisk/res_odbc.conf-dist; then rm -f %D/etc/asterisk/res_odbc.conf; fi
etc/asterisk/res_odbc.conf-dist
@exec [ -f %B/res_odbc.conf ] || cp %B/%f %B/res_odbc.conf
@@ -109,6 +124,9 @@ etc/asterisk/rtp.conf-dist
@unexec if cmp -s %D/etc/asterisk/sip.conf %D/etc/asterisk/sip.conf-dist; then rm -f %D/etc/asterisk/sip.conf; fi
etc/asterisk/sip.conf-dist
@exec [ -f %B/sip.conf ] || cp %B/%f %B/sip.conf
+@unexec if cmp -s %D/etc/asterisk/sip_notify.conf %D/etc/asterisk/sip_notify.conf-dist; then rm -f %D/etc/asterisk/sip_notify.conf; fi
+etc/asterisk/sip_notify.conf-dist
+@exec [ -f %B/sip_notify.conf ] || cp %B/%f %B/sip_notify.conf
@unexec if cmp -s %D/etc/asterisk/skinny.conf %D/etc/asterisk/skinny.conf-dist; then rm -f %D/etc/asterisk/skinny.conf; fi
etc/asterisk/skinny.conf-dist
@exec [ -f %B/skinny.conf ] || cp %B/%f %B/skinny.conf
@@ -121,9 +139,6 @@ etc/asterisk/voicemail.conf-dist
@unexec if cmp -s %D/etc/asterisk/vpb.conf %D/etc/asterisk/vpb.conf-dist; then rm -f %D/etc/asterisk/vpb.conf; fi
etc/asterisk/vpb.conf-dist
@exec [ -f %B/vpb.conf ] || cp %B/%f %B/vpb.conf
-@unexec if cmp -s %D/etc/asterisk/watchdog.conf %D/etc/asterisk/watchdog.conf-dist; then rm -f %D/etc/asterisk/watchdog.conf; fi
-etc/asterisk/watchdog.conf-dist
-@exec [ -f %B/watchdog.conf ] || cp %B/%f %B/watchdog.conf
@unexec if cmp -s %D/etc/asterisk/zapata.conf %D/etc/asterisk/zapata.conf-dist; then rm -f %D/etc/asterisk/zapata.conf; fi
etc/asterisk/zapata.conf-dist
@exec [ -f %B/zapata.conf ] || cp %B/%f %B/zapata.conf
@@ -136,28 +151,36 @@ include/asterisk/app.h
include/asterisk/ast_expr.h
include/asterisk/astdb.h
include/asterisk/astmm.h
+include/asterisk/astobj.h
include/asterisk/astosp.h
+include/asterisk/build.h
include/asterisk/callerid.h
include/asterisk/causes.h
include/asterisk/cdr.h
include/asterisk/channel.h
-include/asterisk/channel_pvt.h
+include/asterisk/chanspy.h
include/asterisk/chanvars.h
include/asterisk/cli.h
+include/asterisk/compat.h
include/asterisk/config.h
-include/asterisk/config_pvt.h
+include/asterisk/compiler.h
include/asterisk/crypto.h
-include/asterisk/cvsid.h
+include/asterisk/devicestate.h
include/asterisk/dlfcn-compat.h
include/asterisk/dns.h
+include/asterisk/dnsmgr.h
+include/asterisk/doxyref.h
include/asterisk/dsp.h
+include/asterisk/dundi.h
include/asterisk/enum.h
+include/asterisk/endian.h
include/asterisk/features.h
include/asterisk/file.h
include/asterisk/frame.h
include/asterisk/fskmodem.h
include/asterisk/image.h
include/asterisk/indications.h
+include/asterisk/inline_api.h
include/asterisk/io.h
include/asterisk/linkedlists.h
include/asterisk/localtime.h
@@ -168,38 +191,50 @@ include/asterisk/md5.h
include/asterisk/module.h
include/asterisk/monitor.h
include/asterisk/musiconhold.h
+include/asterisk/netsock.h
include/asterisk/options.h
include/asterisk/pbx.h
+include/asterisk/plc.h
include/asterisk/poll-compat.h
include/asterisk/privacy.h
include/asterisk/res_odbc.h
include/asterisk/rtp.h
include/asterisk/say.h
include/asterisk/sched.h
+include/asterisk/slinfactory.h
include/asterisk/srv.h
+include/asterisk/strings.h
include/asterisk/tdd.h
include/asterisk/term.h
+include/asterisk/time.h
include/asterisk/transcap.h
include/asterisk/translate.h
include/asterisk/ulaw.h
+include/asterisk/unaligned.h
include/asterisk/utils.h
+include/asterisk/version.h
include/asterisk/vmodem.h
lib/asterisk/modules/app_adsiprog.so
lib/asterisk/modules/app_alarmreceiver.so
lib/asterisk/modules/app_authenticate.so
lib/asterisk/modules/app_cdr.so
lib/asterisk/modules/app_chanisavail.so
+lib/asterisk/modules/app_chanspy.so
lib/asterisk/modules/app_controlplayback.so
+lib/asterisk/modules/app_curl.so
lib/asterisk/modules/app_cut.so
lib/asterisk/modules/app_db.so
-lib/asterisk/modules/app_devstate.so
lib/asterisk/modules/app_dial.so
+lib/asterisk/modules/app_dictate.so
+lib/asterisk/modules/app_directed_pickup.so
lib/asterisk/modules/app_directory.so
lib/asterisk/modules/app_disa.so
+lib/asterisk/modules/app_dumpchan.so
lib/asterisk/modules/app_echo.so
lib/asterisk/modules/app_enumlookup.so
lib/asterisk/modules/app_eval.so
lib/asterisk/modules/app_exec.so
+lib/asterisk/modules/app_externalivr.so
lib/asterisk/modules/app_festival.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_flash.so
lib/asterisk/modules/app_forkcdr.so
@@ -208,64 +243,66 @@ lib/asterisk/modules/app_groupcount.so
lib/asterisk/modules/app_hasnewvoicemail.so
lib/asterisk/modules/app_ices.so
lib/asterisk/modules/app_image.so
-lib/asterisk/modules/app_intercom.so
lib/asterisk/modules/app_lookupblacklist.so
lib/asterisk/modules/app_lookupcidname.so
lib/asterisk/modules/app_macro.so
+lib/asterisk/modules/app_math.so
+lib/asterisk/modules/app_md5.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_meetme.so
lib/asterisk/modules/app_milliwatt.so
+lib/asterisk/modules/app_mixmonitor.so
lib/asterisk/modules/app_mp3.so
lib/asterisk/modules/app_nbscat.so
+%%WITH_ZAPTEL%%lib/asterisk/modules/app_page.so
lib/asterisk/modules/app_parkandannounce.so
-lib/asterisk/modules/app_pickup.so
lib/asterisk/modules/app_playback.so
lib/asterisk/modules/app_privacy.so
-lib/asterisk/modules/app_qcall.so
lib/asterisk/modules/app_queue.so
lib/asterisk/modules/app_random.so
lib/asterisk/modules/app_read.so
+lib/asterisk/modules/app_readfile.so
+lib/asterisk/modules/app_realtime.so
lib/asterisk/modules/app_record.so
%%WITH_FAX%%lib/asterisk/modules/app_rxfax.so
lib/asterisk/modules/app_sayunixtime.so
-lib/asterisk/modules/app_segfault.so
lib/asterisk/modules/app_senddtmf.so
lib/asterisk/modules/app_sendtext.so
lib/asterisk/modules/app_setcallerid.so
lib/asterisk/modules/app_setcdruserfield.so
lib/asterisk/modules/app_setcidname.so
lib/asterisk/modules/app_setcidnum.so
+lib/asterisk/modules/app_setrdnis.so
lib/asterisk/modules/app_settransfercapability.so
lib/asterisk/modules/app_sms.so
lib/asterisk/modules/app_softhangup.so
-lib/asterisk/modules/app_striplsd.so
-lib/asterisk/modules/app_substring.so
+lib/asterisk/modules/app_stack.so
lib/asterisk/modules/app_system.so
lib/asterisk/modules/app_talkdetect.so
lib/asterisk/modules/app_test.so
lib/asterisk/modules/app_transfer.so
-lib/asterisk/modules/app_txtcidname.so
%%WITH_FAX%%lib/asterisk/modules/app_txfax.so
+lib/asterisk/modules/app_txtcidname.so
lib/asterisk/modules/app_url.so
lib/asterisk/modules/app_userevent.so
lib/asterisk/modules/app_verbose.so
lib/asterisk/modules/app_voicemail.so
lib/asterisk/modules/app_waitforring.so
+lib/asterisk/modules/app_waitforsilence.so
+lib/asterisk/modules/app_while.so
lib/asterisk/modules/app_zapateller.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapbarge.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapras.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapscan.so
lib/asterisk/modules/cdr_csv.so
+lib/asterisk/modules/cdr_custom.so
lib/asterisk/modules/cdr_manager.so
%%WITH_ODBC%%lib/asterisk/modules/cdr_odbc.so
lib/asterisk/modules/chan_agent.so
+lib/asterisk/modules/chan_features.so
%%WITH_H323%%lib/asterisk/modules/chan_h323.so
lib/asterisk/modules/chan_iax2.so
lib/asterisk/modules/chan_local.so
lib/asterisk/modules/chan_mgcp.so
-lib/asterisk/modules/chan_modem.so
-lib/asterisk/modules/chan_modem_aopen.so
-lib/asterisk/modules/chan_modem_bestdata.so
-lib/asterisk/modules/chan_modem_i4l.so
lib/asterisk/modules/chan_oss.so
lib/asterisk/modules/chan_sip.so
lib/asterisk/modules/chan_skinny.so
@@ -273,14 +310,13 @@ lib/asterisk/modules/chan_skinny.so
lib/asterisk/modules/codec_a_mu.so
lib/asterisk/modules/codec_adpcm.so
lib/asterisk/modules/codec_alaw.so
-lib/asterisk/modules/codec_g723_1_dummy.so
lib/asterisk/modules/codec_g726.so
-lib/asterisk/modules/codec_g729_dummy.so
lib/asterisk/modules/codec_gsm.so
lib/asterisk/modules/codec_ilbc.so
lib/asterisk/modules/codec_lpc10.so
lib/asterisk/modules/codec_speex.so
lib/asterisk/modules/codec_ulaw.so
+lib/asterisk/modules/format_au.so
lib/asterisk/modules/format_g723_1.so
lib/asterisk/modules/format_g726.so
lib/asterisk/modules/format_g729.so
@@ -294,22 +330,34 @@ lib/asterisk/modules/format_sln.so
lib/asterisk/modules/format_vox.so
lib/asterisk/modules/format_wav.so
lib/asterisk/modules/format_wav_gsm.so
+lib/asterisk/modules/func_callerid.so
+lib/asterisk/modules/func_enum.so
+lib/asterisk/modules/func_uri.so
+lib/asterisk/modules/pbx_ael.so
lib/asterisk/modules/pbx_config.so
+lib/asterisk/modules/pbx_dundi.so
+lib/asterisk/modules/pbx_functions.so
+lib/asterisk/modules/pbx_loopback.so
+lib/asterisk/modules/pbx_realtime.so
lib/asterisk/modules/pbx_spool.so
-lib/asterisk/modules/pbx_wilcalu.so
lib/asterisk/modules/res_adsi.so
lib/asterisk/modules/res_agi.so
+lib/asterisk/modules/res_config_odbc.so
lib/asterisk/modules/res_crypto.so
lib/asterisk/modules/res_features.so
lib/asterisk/modules/res_indications.so
lib/asterisk/modules/res_monitor.so
+lib/asterisk/modules/res_odbc.so
lib/asterisk/modules/res_musiconhold.so
-lib/asterisk/modules/res_watchdog.so
sbin/asterisk
sbin/astgenkey
sbin/astman
sbin/autosupport
+sbin/rasterisk
sbin/safe_asterisk
+sbin/smsq
+sbin/stereorize
+sbin/streamplayer
%%DATADIR%%/agi-bin/agi-test.agi
%%DATADIR%%/agi-bin/eagi-sphinx-test
%%DATADIR%%/agi-bin/eagi-test
@@ -330,23 +378,34 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/auth-incorrect.gsm
%%DATADIR%%/sounds/auth-thankyou.gsm
%%DATADIR%%/sounds/beep.gsm
+%%DATADIR%%/sounds/beeperr.gsm
%%DATADIR%%/sounds/conf-adminmenu.gsm
%%DATADIR%%/sounds/conf-enteringno.gsm
%%DATADIR%%/sounds/conf-errormenu.gsm
%%DATADIR%%/sounds/conf-getchannel.gsm
%%DATADIR%%/sounds/conf-getconfno.gsm
%%DATADIR%%/sounds/conf-getpin.gsm
+%%DATADIR%%/sounds/conf-hasjoin.gsm
+%%DATADIR%%/sounds/conf-hasleft.gsm
%%DATADIR%%/sounds/conf-invalid.gsm
%%DATADIR%%/sounds/conf-invalidpin.gsm
%%DATADIR%%/sounds/conf-kicked.gsm
+%%DATADIR%%/sounds/conf-leaderhasleft.gsm
%%DATADIR%%/sounds/conf-locked.gsm
%%DATADIR%%/sounds/conf-lockednow.gsm
%%DATADIR%%/sounds/conf-muted.gsm
%%DATADIR%%/sounds/conf-noempty.gsm
+%%DATADIR%%/sounds/conf-onlyone.gsm
%%DATADIR%%/sounds/conf-onlyperson.gsm
+%%DATADIR%%/sounds/conf-otherinparty.gsm
+%%DATADIR%%/sounds/conf-placeintoconf.gsm
+%%DATADIR%%/sounds/conf-thereare.gsm
%%DATADIR%%/sounds/conf-unlockednow.gsm
%%DATADIR%%/sounds/conf-unmuted.gsm
%%DATADIR%%/sounds/conf-usermenu.gsm
+%%DATADIR%%/sounds/conf-userswilljoin.gsm
+%%DATADIR%%/sounds/conf-userwilljoin.gsm
+%%DATADIR%%/sounds/conf-waitforleader.gsm
%%DATADIR%%/sounds/demo-abouttotry.gsm
%%DATADIR%%/sounds/demo-congrats.gsm
%%DATADIR%%/sounds/demo-echodone.gsm
@@ -357,6 +416,18 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/demo-nogo.gsm
%%DATADIR%%/sounds/demo-nomatch.gsm
%%DATADIR%%/sounds/demo-thanks.gsm
+%%DATADIR%%/sounds/dictate/both_help.gsm
+%%DATADIR%%/sounds/dictate/enter_filename.gsm
+%%DATADIR%%/sounds/dictate/forhelp.gsm
+%%DATADIR%%/sounds/dictate/pause.gsm
+%%DATADIR%%/sounds/dictate/paused.gsm
+%%DATADIR%%/sounds/dictate/play_help.gsm
+%%DATADIR%%/sounds/dictate/playback.gsm
+%%DATADIR%%/sounds/dictate/playback_mode.gsm
+%%DATADIR%%/sounds/dictate/record.gsm
+%%DATADIR%%/sounds/dictate/record_help.gsm
+%%DATADIR%%/sounds/dictate/record_mode.gsm
+%%DATADIR%%/sounds/dictate/truncating_audio.gsm
%%DATADIR%%/sounds/digits/0.gsm
%%DATADIR%%/sounds/digits/1.gsm
%%DATADIR%%/sounds/digits/10.gsm
@@ -445,6 +516,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/dir-intro.gsm
%%DATADIR%%/sounds/dir-nomatch.gsm
%%DATADIR%%/sounds/dir-nomore.gsm
+%%DATADIR%%/sounds/hello-world.gsm
%%DATADIR%%/sounds/invalid.gsm
%%DATADIR%%/sounds/letters/a.gsm
%%DATADIR%%/sounds/letters/at.gsm
@@ -512,6 +584,10 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/phonetic/x_p.gsm
%%DATADIR%%/sounds/phonetic/y_p.gsm
%%DATADIR%%/sounds/phonetic/z_p.gsm
+%%DATADIR%%/sounds/priv-callee-options.gsm
+%%DATADIR%%/sounds/priv-callpending.gsm
+%%DATADIR%%/sounds/priv-introsaved.gsm
+%%DATADIR%%/sounds/priv-recordintro.gsm
%%DATADIR%%/sounds/privacy-incorrect.gsm
%%DATADIR%%/sounds/privacy-prompt.gsm
%%DATADIR%%/sounds/privacy-thankyou.gsm
@@ -520,10 +596,21 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/queue-holdtime.gsm
%%DATADIR%%/sounds/queue-less-than.gsm
%%DATADIR%%/sounds/queue-minutes.gsm
+%%DATADIR%%/sounds/queue-periodic-announce.gsm
+%%DATADIR%%/sounds/queue-reporthold.gsm
%%DATADIR%%/sounds/queue-seconds.gsm
%%DATADIR%%/sounds/queue-thankyou.gsm
%%DATADIR%%/sounds/queue-thereare.gsm
%%DATADIR%%/sounds/queue-youarenext.gsm
+%%DATADIR%%/sounds/screen-callee-options.gsm
+%%DATADIR%%/sounds/spy-agent.gsm
+%%DATADIR%%/sounds/spy-h323.gsm
+%%DATADIR%%/sounds/spy-iax.gsm
+%%DATADIR%%/sounds/spy-iax2.gsm
+%%DATADIR%%/sounds/spy-mgcp.gsm
+%%DATADIR%%/sounds/spy-sip.gsm
+%%DATADIR%%/sounds/spy-skinny.gsm
+%%DATADIR%%/sounds/spy-zap.gsm
%%DATADIR%%/sounds/ss-noservice.gsm
%%DATADIR%%/sounds/transfer.gsm
%%DATADIR%%/sounds/tt-allbusy.gsm
@@ -531,7 +618,6 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/tt-monkeysintro.gsm
%%DATADIR%%/sounds/tt-somethingwrong.gsm
%%DATADIR%%/sounds/tt-weasels.gsm
-%%DATADIR%%/sounds/vm
%%DATADIR%%/sounds/vm-Cust1.gsm
%%DATADIR%%/sounds/vm-Cust2.gsm
%%DATADIR%%/sounds/vm-Cust3.gsm
@@ -553,6 +639,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-extension.gsm
%%DATADIR%%/sounds/vm-first.gsm
%%DATADIR%%/sounds/vm-for.gsm
+%%DATADIR%%/sounds/vm-forward.gsm
%%DATADIR%%/sounds/vm-forwardoptions.gsm
%%DATADIR%%/sounds/vm-from-extension.gsm
%%DATADIR%%/sounds/vm-from-phonenumber.gsm
@@ -571,10 +658,12 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-mailboxfull.gsm
%%DATADIR%%/sounds/vm-message.gsm
%%DATADIR%%/sounds/vm-messages.gsm
+%%DATADIR%%/sounds/vm-minutes.gsm
%%DATADIR%%/sounds/vm-mismatch.gsm
%%DATADIR%%/sounds/vm-msginstruct.gsm
%%DATADIR%%/sounds/vm-msgsaved.gsm
%%DATADIR%%/sounds/vm-newpassword.gsm
+%%DATADIR%%/sounds/vm-newuser.gsm
%%DATADIR%%/sounds/vm-next.gsm
%%DATADIR%%/sounds/vm-no.gsm
%%DATADIR%%/sounds/vm-nobodyavail.gsm
@@ -592,6 +681,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-reachoper.gsm
%%DATADIR%%/sounds/vm-rec-busy.gsm
%%DATADIR%%/sounds/vm-rec-name.gsm
+%%DATADIR%%/sounds/vm-rec-temp.gsm
%%DATADIR%%/sounds/vm-rec-unv.gsm
%%DATADIR%%/sounds/vm-received.gsm
%%DATADIR%%/sounds/vm-reenterpassword.gsm
@@ -605,6 +695,9 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-sorry.gsm
%%DATADIR%%/sounds/vm-star-cancel.gsm
%%DATADIR%%/sounds/vm-starmain.gsm
+%%DATADIR%%/sounds/vm-tempgreeting.gsm
+%%DATADIR%%/sounds/vm-tempgreeting2.gsm
+%%DATADIR%%/sounds/vm-tempremoved.gsm
%%DATADIR%%/sounds/vm-then-pound.gsm
%%DATADIR%%/sounds/vm-theperson.gsm
%%DATADIR%%/sounds/vm-tocallback.gsm
@@ -624,9 +717,11 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-whichbox.gsm
%%DATADIR%%/sounds/vm-youhave.gsm
%%DATADIR%%/sounds/voicemail
+@dirrm %%DATADIR%%/sounds/dictate
@dirrm %%DATADIR%%/sounds/phonetic
@dirrm %%DATADIR%%/sounds/letters
@dirrm %%DATADIR%%/sounds/digits
+@dirrm %%DATADIR%%/sounds/priv-callerintros
@dirrm %%DATADIR%%/sounds
@dirrm %%DATADIR%%/mohmp3
@dirrm %%DATADIR%%/keys
@@ -641,11 +736,14 @@ sbin/safe_asterisk
@dirrm etc/asterisk
@unexec rm -f %D/%%DATADIR%%/astdb
@cwd /var
-spool/asterisk/vm
spool/asterisk/voicemail/default/1234/busy.gsm
spool/asterisk/voicemail/default/1234/unavail.gsm
@exec mkdir -p %D/log/asterisk/cdr-csv
@exec mkdir -p %D/spool/asterisk/voicemail/default/1234/INBOX
+@dirrm spool/asterisk/dictate
+@dirrm spool/asterisk/meetme
+@dirrm spool/asterisk/monitor
+@dirrm spool/asterisk/system
@dirrm spool/asterisk/voicemail/default/1234/INBOX
@dirrm spool/asterisk/voicemail/default/1234
@dirrm spool/asterisk/voicemail/default
@@ -653,4 +751,5 @@ spool/asterisk/voicemail/default/1234/unavail.gsm
@dirrm spool/asterisk/tmp
@dirrm spool/asterisk
@dirrm log/asterisk/cdr-csv
+@dirrm log/asterisk/cdr-custom
@dirrm log/asterisk
diff --git a/net/asterisk/Makefile b/net/asterisk/Makefile
index 276aa57..3cfbf7e 100644
--- a/net/asterisk/Makefile
+++ b/net/asterisk/Makefile
@@ -6,30 +6,24 @@
#
PORTNAME= asterisk
-PORTVERSION= 1.0.9
-PORTREVISION= 2
+PORTVERSION= 1.2.1
CATEGORIES= net
MASTER_SITES= http://ftp.digium.com/pub/asterisk/ \
http://ftp.digium.com/pub/asterisk/old-releases/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/old-releases/
-PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
-PATCH_SITES= ${MASTER_SITE_LOCAL}
-PATCH_SITE_SUBDIR= fjoe
-PATCH_DIST_STRIP= -p1
-
MAINTAINER= sobomax@FreeBSD.org
COMMENT= An Open Source PBX and telephony toolkit
BUILD_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
LIB_DEPENDS= speex.3:${PORTSDIR}/audio/speex \
- newt.51:${PORTSDIR}/devel/newt
+ newt.51:${PORTSDIR}/devel/newt \
+ curl.3:${PORTSDIR}/ftp/curl
RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
ONLY_FOR_ARCHS= i386 sparc64 amd64
-BRIVER= bristuff-0.2.0-RC8h
GNU_CONFIGURE= yes
CONFIGURE_WRKSRC= ${WRKSRC}/editline
USE_GMAKE= yes
@@ -44,7 +38,7 @@ MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
OSVERSION=${OSVERSION} \
CXX="${CXX}"
-MAN8= asterisk.8
+MAN8= asterisk.8 astgenkey.8 autosupport.8 safe_asterisk.8
.include <bsd.port.pre.mk>
@@ -68,8 +62,9 @@ MAKE_ENV+= WITH_H323=1
.if defined(WITHOUT_ZAPTEL)
PLIST_SUB+= WITH_ZAPTEL="@comment "
.else
+BUILD_DEPENDS+= libpri>=1.2.0:${PORTSDIR}/misc/libpri \
+ ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
LIB_DEPENDS+= pri.1:${PORTSDIR}/misc/libpri
-BUILD_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
RUN_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
PLIST_SUB+= WITH_ZAPTEL=""
MAKE_ENV+= WITH_ZAPTEL=1
@@ -86,10 +81,6 @@ PLIST_SUB+= WITH_ODBC=""
MAKE_ENV+= WITH_ODBC=1
.endif
-.if !defined(WITHOUT_MYSQL)
-USE_MYSQL= yes
-.endif
-
.if defined(WITHOUT_FAX)
PLIST_SUB+= WITH_FAX="@comment "
.else
@@ -99,7 +90,6 @@ PLIST_SUB+= WITH_FAX=""
.endif
post-patch:
- ${CP} ${FILESDIR}/chan_oss.c ${WRKSRC}/channels
${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample
.include <bsd.port.post.mk>
diff --git a/net/asterisk/distinfo b/net/asterisk/distinfo
index 9ef6daa..9d56959 100644
--- a/net/asterisk/distinfo
+++ b/net/asterisk/distinfo
@@ -1,4 +1,3 @@
-MD5 (asterisk-1.0.9.tar.gz) = 0d7f1c680ae53a739f26a069ef8b580a
-SIZE (asterisk-1.0.9.tar.gz) = 9604582
-MD5 (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 42172c5b04af9080f22b883296c34002
-SIZE (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 56589
+MD5 (asterisk-1.2.1.tar.gz) = 04657086791e80f319c0d728af705001
+SHA256 (asterisk-1.2.1.tar.gz) = f0d3ed36353c1f5726225d2794bea7d1d1a92c9e58336b02b293f43dd4b97948
+SIZE (asterisk-1.2.1.tar.gz) = 10517194
diff --git a/net/asterisk/files/chan_oss.c b/net/asterisk/files/chan_oss.c
deleted file mode 100644
index 95a9236..0000000
--- a/net/asterisk/files/chan_oss.c
+++ /dev/null
@@ -1,1327 +0,0 @@
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * Copyright (C) 1999, Mark Spencer
- *
- * Mark Spencer <markster@linux-support.net>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- *
- * FreeBSD changes and multiple device support by Luigi Rizzo, 2005.05.02
- * note-this code best seen with ts=8 (8-spaces tabs) in the editor
- */
-
-#include <asterisk/lock.h>
-#include <asterisk/frame.h>
-#include <asterisk/logger.h>
-#include <asterisk/channel.h>
-#include <asterisk/module.h>
-#include <asterisk/channel_pvt.h>
-#include <asterisk/options.h>
-#include <asterisk/pbx.h>
-#include <asterisk/config.h>
-#include <asterisk/cli.h>
-#include <asterisk/utils.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h> /* for isalnum */
-#ifdef __linux
-#include <linux/soundcard.h>
-#elif defined(__FreeBSD__)
-#include <sys/soundcard.h>
-#else
-#include <soundcard.h>
-#endif
-#include "busy.h"
-#include "ringtone.h"
-#include "ring10.h"
-#include "answer.h"
-
-/*
- * Helper macros to parse config arguments. They will go in a common
- * header file if their usage is globally accepted. In the meantime,
- * we define them here. Typical usage is as below, WITHOUT ; on each line.
- *
- * {
- * M_START(v->name, v->value)
- *
- * M_BOOL("dothis", x->flag1)
- * M_STR("name", x->somestring)
- * M_F("bar", some_c_code)
- * M_END(some_final_statement)
- */
-#define M_START(var, val) \
- char *__s = var; char *__val = val;
-#define M_END(x) x;
-#define M_F(tag, f) if (!strcasecmp((__s), tag)) { f; } else
-#define M_BOOL(tag, dst) M_F(tag, (dst) = ast_true(__val) )
-#define M_UINT(tag, dst) M_F(tag, (dst) = strtoul(__val, NULL, 0) )
-#define M_STR(tag, dst) M_F(tag, strncpy(dst, __val, sizeof(dst) - 1) )
-
-
-/* Which device to use */
-#if defined( __OpenBSD__ ) || defined( __NetBSD__ )
-#define DEV_DSP "/dev/audio"
-#else
-#define DEV_DSP "/dev/dsp"
-#endif
-
-/*
- * Basic mode of operation:
- *
- * we have one keyboard (which receives commands from the keyboard)
- * and multiple headset's connected to audio cards. Headsets are named as
- * the sections of oss.conf
- *
- * At any time, the keyboard is attached to one headset, and you
- * can switch among them using the 'console' command.
- *
- * The following parameters are important for the configuration of
- * the device:
- *
- * FRAME_SIZE the size of an audio frame, in samples.
- * 160 is used almost universally, so you should not change it.
- *
- * FRAGS the argument for the SETFRAGMENT ioctl.
- * Overridden by the 'frags' parameter in oss.conf
- *
- * Bits 0-7 are the base-2 log of the device's block size,
- * bits 16-31 are the number of blocks in the driver's queue.
- * There are a lot of differences in the way this parameter
- * is supported by different drivers, so you may need to
- * experiment a bit with the value.
- * A good default for linux is 30 blocks of 64 bytes, which
- * results in 6 frames of 320 bytes (160 samples).
- * FreeBSD works decently with blocks of 256 or 512 bytes,
- * leaving the number unspecified.
- * Note that this only refers to the device buffer size,
- * this module will then try to keep the lenght of audio
- * buffered within small constraints.
- *
- * QUEUE_SIZE The max number of blocks actually allowed in the device
- * driver's buffer, irrespective of the available number.
- * Overridden by the 'queuesize' parameter in oss.conf
- *
- * Should be >=2, and at most as large as the hw queue above
- * (otherwise it will never be full).
- */
-
-#define FRAME_SIZE 160
-#define QUEUE_SIZE 10
-
-#if defined(__FreeBSD__)
-#define FRAGS 0x8
-#else
-#define FRAGS ( ( (6 * 5) << 16 ) | 0x6 )
-#endif
-
-
-/* Don't switch between read/write modes faster than every 300 ms */
-#define MIN_SWITCH_TIME 300
-
-
-static int usecnt;
-AST_MUTEX_DEFINE_STATIC(usecnt_lock);
-
-static char *desc = "OSS Console Channel Driver";
-static char *tdesc = "OSS Console Channel Driver";
-static char *config = "oss.conf"; /* default config file */
-
-static int oss_debug;
-
-/*
- * Each sound is made of 'datalen' samples of sound, repeated as needed to
- * generate 'samplen' samples of data, then followed by 'silencelen' samples
- * of silence. The loop is repeated if 'repeat' is set.
- */
-struct sound {
- int ind;
- char *desc;
- short *data;
- int datalen;
- int samplen;
- int silencelen;
- int repeat;
-};
-
-static struct sound sounds[] = {
- { AST_CONTROL_RINGING, "RINGING", ringtone, sizeof(ringtone)/2, 16000, 32000, 1 },
- { AST_CONTROL_BUSY, "BUSY", busy, sizeof(busy)/2, 4000, 4000, 1 },
- { AST_CONTROL_CONGESTION, "CONGESTION", busy, sizeof(busy)/2, 2000, 2000, 1 },
- { AST_CONTROL_RING, "RING10", ring10, sizeof(ring10)/2, 16000, 32000, 1 },
- { AST_CONTROL_ANSWER, "ANSWER", answer, sizeof(answer)/2, 2200, 0, 0 },
- { -1, NULL, 0, 0, 0, 0 }, /* end marker */
-};
-
-
-/*
- * descriptor for one of our channels.
- * There is one used for 'default' values (from the [general] entry in
- * the configuration file, and then one instance for each device
- * (the default is cloned from [general], others are only created
- * if the relevant section exists.
- */
-struct chan_oss_pvt {
- struct chan_oss_pvt *next;
-
- char *type;
- char *name;
- /*
- * cursound indicates which in struct sound we play. -1 means nothing,
- * any other value is a valid sound, in which case sampsent indicates
- * the next sample to send in [0..samplen + silencelen]
- * nosound is set to disable the audio data from the channel
- * (so we can play the tones etc.).
- */
- int sndcmd[2]; /* Sound command pipe */
- int cursound; /* index of sound to send */
- int sampsent; /* # of sound samples sent */
- int nosound; /* set to block audio from the PBX */
-
- int total_blocks; /* total blocks in the output device */
- int sounddev;
- enum { M_UNSET, M_FULL, M_READ, M_WRITE } duplex;
- int autoanswer;
- int autohangup;
- int hookstate;
- struct timeval lasttime; /* last setformat */
- char *mixer_cmd; /* initial command to issue to the mixer */
- unsigned int queuesize; /* max fragments in queue */
- unsigned int frags; /* parameter for SETFRAGMENT */
-
- int warned; /* various flags used for warnings */
-#define WARN_used_blocks 1
-#define WARN_speed 2
-#define WARN_frag 4
- int w_errors; /* overfull in the write path */
-
- int silencesuppression;
- int silencethreshold;
- int playbackonly;
- char device[64]; /* device to open */
-
- pthread_t sthread;
-
- struct ast_channel *owner;
- char ext[AST_MAX_EXTENSION];
- char ctx[AST_MAX_EXTENSION];
- char language[MAX_LANGUAGE];
-
- /* buffers used in oss_write */
- char oss_write_buf[FRAME_SIZE*2];
- int oss_write_dst;
- /* buffers used in oss_read - AST_FRIENDLY_OFFSET space for headers
- * plus enough room for a full frame
- */
- char oss_read_buf[FRAME_SIZE * 2 + AST_FRIENDLY_OFFSET];
- int readpos; /* read position above */
- struct ast_frame read_f; /* returned by oss_read */
-};
-
-static struct chan_oss_pvt oss_default = {
- .type = "Console",
- .cursound = -1,
- .sounddev = -1,
- .duplex = M_UNSET, /* XXX check this */
- .autoanswer = 1,
- .autohangup = 1,
- .queuesize = QUEUE_SIZE,
- .frags = FRAGS,
- .silencethreshold = 1000, /* currently unused */
- .ext = "s",
- .ctx = "default",
- .readpos = AST_FRIENDLY_OFFSET, /* start here on reads */
-};
-
-static char *oss_active; /* the active device */
-
-/*
- * returns true if too early to switch
- */
-static int too_early(struct chan_oss_pvt *o)
-{
- struct timeval tv;
- int ms;
- gettimeofday(&tv, NULL);
- ms = (tv.tv_sec - o->lasttime.tv_sec) * 1000 +
- (tv.tv_usec - o->lasttime.tv_usec) / 1000;
- if (ms < MIN_SWITCH_TIME)
- return -1;
- return 0;
-}
-
-/*
- * Returns the number of blocks used in the audio output channel
- */
-static int used_blocks(struct chan_oss_pvt *o)
-{
- struct audio_buf_info info;
-
- if (ioctl(o->sounddev, SNDCTL_DSP_GETOSPACE, &info)) {
- if (! (o->warned & WARN_used_blocks)) {
- ast_log(LOG_WARNING, "Error reading output space\n");
- o->warned |= WARN_used_blocks;
- }
- return 1;
- }
- if (o->total_blocks == 0) {
- if (0) /* debugging */
- ast_log(LOG_WARNING, "fragtotal %d size %d avail %d\n",
- info.fragstotal,
- info.fragsize,
- info.fragments);
- o->total_blocks = info.fragments;
- }
- return o->total_blocks - info.fragments;
-}
-
-static int soundcard_writeframe(struct chan_oss_pvt *o, short *data)
-{
- /* Write an exactly FRAME_SIZE sized frame */
- int res;
-
- /*
- * Nothing complex to manage the audio device queue.
- * If the buffer is full just drop the extra, otherwise write.
- * XXX in some cases it might be useful to write anyways after
- * a number of failures, to restart the output chain.
- */
- res = used_blocks(o);
- if (res > o->queuesize) { /* no room to write a block */
- if (o->w_errors++ == 0 && (oss_debug & 0x4))
- ast_log(LOG_WARNING, "write: used %d blocks (%d)\n",
- res, o->w_errors);
- return 0;
- }
- o->w_errors = 0;
- res = write(o->sounddev, ((void *)data), FRAME_SIZE * 2);
- return res;
-}
-
-/*
- * handler for 'sound writable' events from the sound thread.
- * Builds a frame from the high level description of the sounds,
- * and passes it to the audio device.
- * The actual sound is made of 1 or more sequences of sound samples
- * (s->datalen, repeated to make s->samplen samples) followed by
- * s->silencelen samples of silence. The position in the sequence is stored
- * in o->sampsent, which goes between 0 .. s->samplen+s->silencelen.
- * In case we fail to write a frame, don't update o->sampsent.
- */
-static void send_sound(struct chan_oss_pvt *o)
-{
- short myframe[FRAME_SIZE];
- int ofs, l, start;
- int l_sampsent = o->sampsent;
- struct sound *s;
-
- if (o->cursound < 0) /* no sound to send */
- return;
- s = &sounds[o->cursound];
- for (ofs = 0; ofs < FRAME_SIZE; ofs += l) {
- l = s->samplen - l_sampsent; /* sound available */
- if (l > 0) {
- start = l_sampsent % s->datalen; /* source offset */
- if (l > FRAME_SIZE - ofs) /* don't overflow the frame */
- l = FRAME_SIZE - ofs;
- if (l > s->datalen - start) /* don't overflow the source */
- l = s->datalen - start;
- bcopy(s->data + start, myframe + ofs, l*2);
- if (0)
- ast_log(LOG_WARNING, "send_sound sound %d/%d of %d into %d\n",
- l_sampsent, l, s->samplen, ofs);
- l_sampsent += l;
- } else { /* no sound, maybe some silence */
- static short silence[FRAME_SIZE] = {0, };
-
- l += s->silencelen;
- if (l > 0) {
- if (l > FRAME_SIZE - ofs)
- l = FRAME_SIZE - ofs;
- bcopy(silence, myframe + ofs, l*2);
- l_sampsent += l;
- } else { /* silence is over, restart sound if loop */
- if (s->repeat == 0) { /* last block */
- o->cursound = -1;
- o->nosound = 0; /* allow audio data */
- if (ofs < FRAME_SIZE) /* pad with silence */
- bcopy(silence, myframe + ofs, (FRAME_SIZE - ofs)*2);
- }
- l_sampsent = 0;
- }
- }
- }
- l = soundcard_writeframe(o, myframe);
- if (l > 0)
- o->sampsent = l_sampsent; /* update status */
-}
-
-static void *sound_thread(void *arg)
-{
- char ign[4096];
- struct chan_oss_pvt *o = (struct chan_oss_pvt *)arg;
-
- /* kick the driver by trying to read from it. Ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- for(;;) {
- fd_set rfds, wfds;
- int maxfd, res;
-
- FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- maxfd = o->sndcmd[0]; /* pipe from the main process */
- FD_SET(o->sndcmd[0], &rfds);
- if (!o->owner) { /* no one owns the audio, so we must drain it */
- FD_SET(o->sounddev, &rfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- if (o->cursound > -1) {
- FD_SET(o->sounddev, &wfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- /* ast_select emulates linux behaviour in terms of timeout handling */
- res = ast_select(maxfd + 1, &rfds, &wfds, NULL, NULL);
- if (res < 1) {
- ast_log(LOG_WARNING, "select failed: %s\n",
- strerror(errno));
- continue;
- }
- if (FD_ISSET(o->sndcmd[0], &rfds)) {
- /* read which sound to play from the pipe */
- int i, what = -1;
-
- read(o->sndcmd[0], &what, sizeof(what));
- for (i = 0; sounds[i].ind != -1; i++) {
- if (sounds[i].ind == what) {
- o->cursound = i;
- o->sampsent = 0;
- o->nosound = 1; /* block audio from pbx */
- break;
- }
- }
- if (sounds[i].ind == -1)
- ast_log(LOG_WARNING, "invalid sound index: %d\n", what);
- }
- if (FD_ISSET(o->sounddev, &rfds)) { /* read and ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- }
- if (FD_ISSET(o->sounddev, &wfds))
- send_sound(o);
- }
- /* Never reached */
- return NULL;
-}
-
-/*
- * reset and close the device if opened,
- * then open and initialize it in the desired mode,
- * trigger reads and writes so we can start using it.
- */
-static int setformat(struct chan_oss_pvt *o, int mode)
-{
- int fmt, desired, res, fd;
-
- if (o->sounddev >= 0) {
- ioctl(o->sounddev, SNDCTL_DSP_RESET, 0);
- close(o->sounddev);
- o->duplex = M_UNSET;
- }
- fd = o->sounddev = open(o->device, mode |O_NONBLOCK);
- if (o->sounddev < 0) {
- ast_log(LOG_WARNING, "Unable to re-open DSP device: %s\n",
- strerror(errno));
- return -1;
- }
-
- gettimeofday(&o->lasttime, NULL);
- fmt = AFMT_S16_LE;
- res = ioctl(fd, SNDCTL_DSP_SETFMT, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set format to 16-bit signed\n");
- return -1;
- }
- switch (mode) {
- case O_RDWR:
- res = ioctl(fd, SNDCTL_DSP_SETDUPLEX, 0);
- /* Check to see if duplex set (FreeBSD Bug)*/
- res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt);
- if (res == 0 && (fmt & DSP_CAP_DUPLEX)) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Console is full duplex\n");
- o->duplex = M_FULL;
- };
- break;
- case O_WRONLY:
- o->duplex = M_WRITE;
- break;
- case O_RDONLY:
- o->duplex = M_READ;
- break;
- }
-
- fmt = 0;
- res = ioctl(fd, SNDCTL_DSP_STEREO, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- /* 8000 Hz desired */
- desired = 8000;
- fmt = desired;
- res = ioctl(fd, SNDCTL_DSP_SPEED, &fmt);
-
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- if (fmt != desired) {
- if (!(o->warned & WARN_speed)) {
- ast_log(LOG_WARNING,
- "Requested %d Hz, got %d Hz -- sound may be choppy\n",
- desired, fmt);
- o->warned |= WARN_speed;
- }
- }
- /*
- * on Freebsd, SETFRAGMENT does not work very well on some cards.
- * Default to use 256 bytes, let the user override
- */
- if (o->frags) {
- fmt = o->frags;
- res = ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &fmt);
- if (res < 0) {
- if (!(o->warned & WARN_frag)) {
- ast_log(LOG_WARNING,
- "Unable to set fragment size -- sound may be choppy\n");
- o->warned |= WARN_frag;
- }
- }
- }
- /* XXX on some cards, we need SNDCTL_DSP_SETTRIGGER to start outputting */
- res = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT;
- res = ioctl(fd, SNDCTL_DSP_SETTRIGGER, &res);
- /* it may fail if we are in half duplex, never mind */
- return 0;
-}
-
-/*
- * make sure output mode is available. Returns 0 if done,
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setoutput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_WRITE && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_WRONLY))
- return -1;
- return 0;
-}
-
-/*
- * make sure input mode is available. Returns 0 if done
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setinput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_READ && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_RDONLY))
- return -1;
- return 0;
-}
-
-/*
- * some of the standard methods supported by channels.
- */
-static int oss_digit(struct ast_channel *c, char digit)
-{
- /* no better use for received digits than print them */
- ast_verbose( " << Console Received digit %c >> \n", digit);
- return 0;
-}
-
-static int oss_text(struct ast_channel *c, char *text)
-{
- /* print received messages */
- ast_verbose( " << Console Received text %s >> \n", text);
- return 0;
-}
-
-/* Play ringtone 'x' on device 'o' */
-#define RING(o, x) { int what = x; write((o)->sndcmd[1], &what, sizeof(what)); }
-
-/*
- * handler for incoming calls. Either autoanswer, or start ringing
- */
-static int oss_call(struct ast_channel *c, char *dest, int timeout)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame f = { 0, };
-
- ast_verbose( " << Call placed to '%s' on console >> \n", dest);
- if (o->autoanswer) {
- ast_verbose( " << Auto-answered >> \n" );
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_ANSWER;
- ast_queue_frame(c, &f);
- } else {
- ast_verbose(" << Type 'answer' to answer, or use 'autoanswer' for future calls >> \n");
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_RINGING;
- ast_queue_frame(c, &f);
- RING(o, AST_CONTROL_RING);
- }
- return 0;
-}
-
-/*
- * remote side answered the phone
- */
-static int oss_answer(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- ast_verbose( " << Console call has been answered >> \n");
-#if 0
- /* play an answer tone (XXX do we really need it ?) */
- RING(o, AST_CONTROL_ANSWER);
-#endif
- ast_setstate(c, AST_STATE_UP);
- o->cursound = -1;
- o->nosound=0;
- return 0;
-}
-
-static int oss_hangup(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- o->cursound = -1;
- c->pvt->pvt = NULL;
- o->owner = NULL;
- ast_verbose( " << Hangup on console >> \n");
- ast_mutex_lock(&usecnt_lock); /* XXX not sure why */
- usecnt--;
- ast_mutex_unlock(&usecnt_lock);
- if (o->hookstate) {
- if (o->autoanswer || o->autohangup) {
- /* Assume auto-hangup too */
- o->hookstate = 0;
- } else {
- /* Make congestion noise */
- RING(o, AST_CONTROL_CONGESTION);
- }
- }
- return 0;
-}
-
-/* used for data coming from the network */
-static int oss_write(struct ast_channel *c, struct ast_frame *f)
-{
- int res;
- int src;
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- /* Immediately return if no sound is enabled */
- if (o->nosound)
- return 0;
- /* Stop any currently playing sound */
- o->cursound = -1;
- if (o->duplex != M_FULL && !o->playbackonly) {
- /* XXX check this, looks weird! */
- /* If we're half duplex, we have to switch to read mode
- to honor immediate needs if necessary */
- res = soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set device to input mode\n");
- return -1;
- }
- return 0;
- }
- res = soundcard_setoutput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set output device\n");
- return -1;
- } else if (res > 0) {
- /* The device is still in read mode, and it's too soon to change it,
- so just pretend we wrote it */
- return 0;
- }
- /*
- * we could receive a sample which is not a multiple of our FRAME_SIZE,
- * so we buffer it locally and write to the device in FRAME_SIZE
- * chunks, keeping the residue stored for future use.
- */
- src = 0; /* read position into f->data */
- while ( src < f->datalen ) {
- /* Compute spare room in the buffer */
- int l = sizeof(o->oss_write_buf) - o->oss_write_dst;
-
- if (f->datalen - src >= l) { /* enough to fill a frame */
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- soundcard_writeframe(o, (short *)o->oss_write_buf);
- src += l;
- o->oss_write_dst = 0;
- } else { /* copy residue */
- l = f->datalen - src;
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- src += l; /* but really, we are done */
- o->oss_write_dst += l;
- }
- }
- return 0;
-}
-
-static struct ast_frame *oss_read(struct ast_channel *c)
-{
- int res;
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame *f = &o->read_f;
-
- /* prepare a NULL frame in case we don't have enough data to return */
- bzero(f, sizeof(struct ast_frame));
- f->frametype = AST_FRAME_NULL;
- f->src = o->type;
-
- res = soundcard_setinput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set input mode\n");
- return NULL;
- } else if (res > 0) { /* too early to switch ? */
- /* Theoretically shouldn't happen, but anyway, return a NULL frame */
- return f;
- }
-
- res = read(o->sounddev, o->oss_read_buf + o->readpos,
- sizeof(o->oss_read_buf) - o->readpos);
- if (res < 0) /* audio data not ready, return a NULL frame */
- return f;
-
- o->readpos += res;
- if (o->readpos < sizeof(o->oss_read_buf)) /* not enough samples */
- return f;
-
- o->readpos = AST_FRIENDLY_OFFSET; /* reset read pointer for next frame */
- if (c->_state != AST_STATE_UP) /* drop data if frame is not up */
- return f;
- /* ok we can build and deliver the frame to the caller */
- f->frametype = AST_FRAME_VOICE;
- f->subclass = AST_FORMAT_SLINEAR;
- f->samples = FRAME_SIZE;
- f->datalen = FRAME_SIZE * 2;
- f->data = o->oss_read_buf + AST_FRIENDLY_OFFSET;
- f->offset = AST_FRIENDLY_OFFSET;
- return f;
-}
-
-static int oss_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
-{
- struct chan_oss_pvt *o = newchan->pvt->pvt;
- o->owner = newchan;
- return 0;
-}
-
-static int oss_indicate(struct ast_channel *c, int cond)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- int res;
-
- switch(cond) {
- case AST_CONTROL_BUSY:
- case AST_CONTROL_CONGESTION:
- case AST_CONTROL_RINGING:
- res = cond;
- break;
- case -1:
- o->cursound = -1;
- return 0;
- default:
- ast_log(LOG_WARNING,
- "Don't know how to display condition %d on %s\n",
- cond, c->name);
- return -1;
- }
- if (res > -1)
- RING(o, res);
- return 0;
-}
-
-static struct ast_channel *oss_new(struct chan_oss_pvt *o,
- char *ext, char *ctx, int state)
-{
- struct ast_channel *c;
- struct ast_channel_pvt *pvt;
-
- c = ast_channel_alloc(1);
- if (c == NULL)
- return NULL;
- snprintf(c->name, sizeof(c->name), "OSS/%s", o->device + 5);
- c->type = o->type;
- c->fds[0] = o->sounddev;
- c->nativeformats = AST_FORMAT_SLINEAR;
- pvt = c->pvt;
- pvt->pvt = o;
-
- /* relevant callbacks */
- pvt->send_digit = oss_digit;
- pvt->send_text = oss_text;
- pvt->hangup = oss_hangup;
- pvt->answer = oss_answer;
- pvt->read = oss_read;
- pvt->call = oss_call;
- pvt->write = oss_write;
- pvt->indicate = oss_indicate;
- pvt->fixup = oss_fixup;
-
-#define S_OVERRIDE(dst, src) \
- { if (src && src[0] != '\0') /* non-empty string */ \
- strncpy((dst), src, sizeof(dst)-1); }
- S_OVERRIDE(c->context, ctx);
- S_OVERRIDE(c->exten, ext);
- S_OVERRIDE(c->language, o->language);
- o->owner = c;
- ast_setstate(c, state);
- ast_mutex_lock(&usecnt_lock);
- usecnt++;
- ast_mutex_unlock(&usecnt_lock);
- ast_update_use_count();
- if (state != AST_STATE_DOWN) {
- if (ast_pbx_start(c)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", c->name);
- ast_hangup(c);
- o->owner = c = NULL;
- /* XXX what about the channel itself ? */
- /* XXX what about usecnt ? */
- }
- }
- return c;
-}
-
-/*
- * returns a pointer to the descriptor with the given name
- */
-static struct chan_oss_pvt *find_desc(char *dev)
-{
- struct chan_oss_pvt *o;
-
- for (o = oss_default.next; o && strcmp(o->name, dev) != 0; o = o->next)
- ;
- if (o == NULL)
- ast_log(LOG_WARNING, "%s could not find <%s>\n", __func__, dev);
- return o;
-}
-
-static struct ast_channel *oss_request(char *type, int format, void *data)
-{
- struct ast_channel *c;
- struct chan_oss_pvt *o = find_desc(data);
-
- ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n",
- type, data, (char *)data);
- if (o == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data);
- /* XXX we could default to 'dsp' perhaps ? */
- return NULL;
- }
- if ((format & AST_FORMAT_SLINEAR) == 0) {
- ast_log(LOG_NOTICE, "Format 0x%x unsupported\n", format);
- return NULL;
- }
- if (o->owner) {
- ast_log(LOG_NOTICE, "Already have a call on the OSS channel\n");
- return NULL;
- }
- c= oss_new(o, NULL, NULL, AST_STATE_DOWN);
- if (c == NULL) {
- ast_log(LOG_WARNING, "Unable to create new OSS channel\n");
- return NULL;
- }
- return c;
-}
-
-static int console_autoanswer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o == NULL) {
- ast_log(LOG_WARNING, "Cannot find device %s (should not happen!)\n",
- oss_active);
- return RESULT_FAILURE;
- }
- if (argc == 1) {
- ast_cli(fd, "Auto answer is %s.\n", o->autoanswer ? "on" : "off");
- return RESULT_SUCCESS;
- }
- if (!strcasecmp(argv[1], "on"))
- o->autoanswer = -1;
- else if (!strcasecmp(argv[1], "off"))
- o->autoanswer = 0;
- else
- return RESULT_SHOWUSAGE;
- return RESULT_SUCCESS;
-}
-
-static char *autoanswer_complete(char *line, char *word, int pos, int state)
-{
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
- int l = strlen(word);
-
- switch(state) {
- case 0:
- if (l && !strncasecmp(word, "on", MIN(l, 2)))
- return strdup("on");
- case 1:
- if (l && !strncasecmp(word, "off", MIN(l, 3)))
- return strdup("off");
- default:
- return NULL;
- }
- return NULL;
-}
-
-static char autoanswer_usage[] =
-"Usage: autoanswer [on|off]\n"
-" Enables or disables autoanswer feature. If used without\n"
-" argument, displays the current on/off status of autoanswer.\n"
-" The default value of autoanswer is in 'oss.conf'.\n";
-
-/*
- * answer command from the console
- */
-static int console_answer(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 1;
- o->cursound = -1;
- ast_queue_frame(o->owner, &f);
- RING(o, AST_CONTROL_ANSWER);
- return RESULT_SUCCESS;
-}
-
-static char sendtext_usage[] =
-"Usage: send text <message>\n"
-" Sends a text message for display on the remote terminal.\n";
-
-static int console_sendtext(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- int tmparg = 2;
- char text2send[256] = "";
- struct ast_frame f = { 0, };
-
- if (argc < 2)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- if (strlen(text2send))
- ast_cli(fd, "Warning: message already waiting to be sent, overwriting\n");
- text2send[0] = '\0';
- while(tmparg < argc) {
- strncat(text2send, argv[tmparg++], sizeof(text2send) - strlen(text2send) - 1);
- strncat(text2send, " ", sizeof(text2send) - strlen(text2send) - 1);
- }
- if (strlen(text2send)) {
- f.frametype = AST_FRAME_TEXT;
- f.subclass = 0;
- f.data = text2send;
- f.datalen = strlen(text2send);
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-static char answer_usage[] =
-"Usage: answer\n"
-" Answers an incoming call on the console (OSS) channel.\n";
-
-static int console_hangup(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner && !o->hookstate) {
- ast_cli(fd, "No call to hangup up\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) {
- ast_queue_hangup(o->owner);
- }
- return RESULT_SUCCESS;
-}
-
-static char hangup_usage[] =
-"Usage: hangup\n"
-" Hangs up any call currently placed on the console.\n";
-
-
-static int console_flash(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_FLASH };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner) { /* XXX maybe !o->hookstate too ? */
- ast_cli(fd, "No call to flash\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) { /* XXX must be true, right ? */
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-
-static char flash_usage[] =
-"Usage: flash\n"
-" Flashes the call currently placed on the console.\n";
-
-
-
-static int console_dial(int fd, int argc, char *argv[])
-{
- char *tmp = NULL, *mye = NULL, *myc = NULL;
- int i;
- struct ast_frame f = { AST_FRAME_DTMF, 0 };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o->owner) { /* already in a call */
- if (argc == 1) { /* argument is mandatory here */
- ast_cli(fd, "Already in a call. You can only dial digits until you hangup.\n");
- return RESULT_FAILURE;
- }
- mye = argv[1];
- /* send the string one char at a time */
- for (i=0; i<strlen(mye); i++) {
- f.subclass = mye[i];
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
- }
- /* if we have an argument split it into extension and context */
-
- if (argc == 2) {
- tmp = myc = strdup(argv[1]); /* make a writable copy */
- mye = strsep(&myc, "@"); /* set exten, advance to context */
- myc = strsep(&myc, "@"); /* set context */
- }
- /* supply default values if needed */
- if (mye == NULL)
- mye = o->ext;
- if (myc == NULL)
- myc = o->ctx;
- if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
- o->hookstate = 1;
- oss_new(o, mye, myc, AST_STATE_RINGING);
- } else
- ast_cli(fd, "No such extension '%s' in context '%s'\n", mye, myc);
- return RESULT_SUCCESS;
-}
-
-static char dial_usage[] =
-"Usage: dial [extension[@context]]\n"
-" Dials a given extensison (and context if specified)\n";
-
-static int console_transfer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- struct ast_channel *b = NULL;
- char *ext, *ctx;
-
- if (argc != 2)
- return RESULT_SHOWUSAGE;
- if (o == NULL)
- return RESULT_FAILURE;
- if (o->owner == NULL || (b = o->owner->bridge) == NULL) {
- ast_cli(fd, "There is no call to transfer\n");
- return RESULT_SUCCESS;
- }
-
- ext = ctx = strdup(argv[1]); /* make a writable copy */
- strsep(&ctx, "@"); /* set exten, advance to context */
- ctx = strsep(&ctx, "@"); /* strip trailing @ and the rest */
-
- if (ctx == NULL) /* supply default context if needed */
- ctx = o->owner->context;
- if (!ast_exists_extension(b, ctx, ext, 1, b->callerid)) {
- ast_cli(fd, "No such extension exists\n");
- } else {
- ast_cli(fd, "Whee, transferring %s to %s@%s.\n", b->name, ext, ctx);
- if (ast_async_goto(b, ctx, ext, 1))
- ast_cli(fd, "Failed to transfer :(\n");
- }
- free(ext);
- return RESULT_SUCCESS;
-}
-
-static char transfer_usage[] =
-"Usage: transfer <extension>[@context]\n"
-" Transfers the currently connected call to the given extension (and\n"
-"context if specified)\n";
-
-static int console_active(int fd, int argc, char *argv[])
-{
- if (argc == 1) {
- ast_cli(fd, "active console is [%s]\n", oss_active);
- } else if (argc != 2) {
- return RESULT_SHOWUSAGE;
- } else {
- struct chan_oss_pvt *o;
- if (strcmp(argv[1], "show") == 0) {
- for (o = oss_default.next; o ; o = o->next)
- ast_cli(fd, "device [%s] exists\n", o->name);
- return RESULT_SUCCESS;
- }
- o = find_desc(argv[1]);
- if (o == NULL)
- ast_cli(fd, "No device [%s] exists\n", argv[1]);
- else
- oss_active = o->name;
- }
- return RESULT_SUCCESS;
-}
-
-static struct ast_cli_entry myclis[] = {
- { { "answer", NULL }, console_answer, "Answer an incoming console call", answer_usage },
- { { "hangup", NULL }, console_hangup, "Hangup a call on the console", hangup_usage },
- { { "flash", NULL }, console_flash, "Flash a call on the console", flash_usage },
- { { "dial", NULL }, console_dial, "Dial an extension on the console", dial_usage },
- { { "transfer", NULL }, console_transfer, "Transfer a call to a different extension", transfer_usage },
- { { "send", "text", NULL }, console_sendtext, "Send text to the remote device", sendtext_usage },
- { { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete },
- { { "console", NULL }, console_active, "Sets/displays active console",
- "console foo sets foo as the console"}
-};
-
-/*
- * store the mixer argument from the config file, filtering possibly
- * invalid or dangerous values (the string is used as argument for
- * system("mixer %s")
- */
-static void store_mixer(struct chan_oss_pvt *o, char *s)
-{
- int i;
-
- for (i=0; i < strlen(s); i++) {
- 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;
- }
- }
- if (o->mixer_cmd)
- free(o->mixer_cmd);
- o->mixer_cmd = strdup(s);
- ast_log(LOG_WARNING, "setting mixer %s\n", s);
-}
-
-/*
- * grab fields from the config file, init the descriptor and open the device.
- */
-static struct chan_oss_pvt * store_config(struct ast_config *cfg,
- char *ctg)
-{
- struct ast_variable *v;
- struct chan_oss_pvt *o;
-
- if (ctg == NULL) {
- o = &oss_default;
- o->next = NULL; /* XXX needed ? */
- ctg = "general";
- } else {
- o = (struct chan_oss_pvt *)malloc(sizeof *o);
- if (o == NULL) /* fail */
- return NULL;
- *o = oss_default;
- /* "general" is also the default thing */
- if (strcmp(ctg, "general") == 0) {
- o->name = strdup("dsp");
- oss_active = o->name;
- goto openit;
- }
- o->name = strdup(ctg);
- }
- ast_log(LOG_WARNING, "found category [%s]\n", ctg);
-
- /* fill other fields from configuration */
- v = ast_variable_browse(cfg, ctg);
- while(v) {
- M_START(v->name, v->value);
-
- M_BOOL("autoanswer", o->autoanswer)
- M_BOOL("autohangup", o->autohangup)
- M_BOOL("playbackonly", o->playbackonly)
- M_BOOL("silencesuppression", o->silencesuppression)
- M_UINT("silencethreshold", o->silencethreshold )
- M_STR("device", o->device)
- M_UINT("frags", o->frags)
- M_UINT("debug", oss_debug)
- M_UINT("queuesize", o->queuesize)
- M_STR("context", o->ctx)
- M_STR("language", o->language)
- M_STR("extension", o->ext)
- M_F("mixer", store_mixer(o, v->value))
- M_END(;);
- v=v->next;
- }
- if (!strlen(o->device))
- strncpy(o->device, DEV_DSP, sizeof(o->device)-1);
- if (o->mixer_cmd) {
- char *cmd;
-
- asprintf(&cmd, "mixer %s", o->mixer_cmd);
- ast_log(LOG_WARNING, "running [%s]\n", cmd);
- system(cmd);
- free(cmd);
- }
- if (o == &oss_default) /* we are done with the default */
- return NULL;
-
-openit:
- if (setformat(o, O_RDWR) < 0) { /* open device */
- if (option_verbose > 0) {
- ast_verbose(VERBOSE_PREFIX_2 "Device %s not detected\n", ctg);
- ast_verbose(VERBOSE_PREFIX_2 "Turn off OSS support by adding "
- "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
- }
- goto error;
- }
- soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (o->duplex != M_FULL)
- ast_log(LOG_WARNING, "XXX I don't work right with non "
- "full-duplex sound cards XXX\n");
- if ( pipe(o->sndcmd) != 0 ) {
- ast_log(LOG_ERROR, "Unable to create pipe\n");
- goto error;
- }
- ast_pthread_create(&o->sthread, NULL, sound_thread, o);
- /* link into list of devices */
- if (o != &oss_default) {
- o->next = oss_default.next;
- oss_default.next = o;
- }
- return o;
-
-error:
- if (o != &oss_default)
- free(o);
- return NULL;
-}
-
-int load_module()
-{
- int i;
- struct ast_config *cfg;
-
- /* load config file */
- cfg = ast_load(config);
- if (cfg != NULL) {
- char *ctg;
-
- store_config(cfg, NULL); /* init general category */
- ctg = ast_category_browse(cfg, NULL); /* initial category */
- while (ctg != NULL) {
- store_config(cfg, ctg);
- ctg = ast_category_browse(cfg, ctg);
- }
- ast_destroy(cfg);
- }
- if (find_desc(oss_active) == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", oss_active);
- /* XXX we could default to 'dsp' perhaps ? */
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- i = ast_channel_register(oss_default.type, tdesc,
- AST_FORMAT_SLINEAR, oss_request);
- if (i < 0) {
- ast_log(LOG_ERROR, "Unable to register channel class '%s'\n",
- oss_default.type);
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- for (i=0; i<sizeof(myclis)/sizeof(struct ast_cli_entry); i++)
- ast_cli_register(myclis + i);
- return 0;
-}
-
-
-int unload_module()
-{
- int x;
- struct chan_oss_pvt *o;
-
- /* XXX do we need a ast_channel_unregister oss_request ? */
- for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++)
- ast_cli_unregister(myclis + x);
-
- for (o = oss_default.next; o ; o = o->next) {
- close(o->sounddev);
- if (o->sndcmd[0] > 0) {
- close(o->sndcmd[0]);
- close(o->sndcmd[1]);
- }
- if (o->owner)
- ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD);
- if (o->owner) /* XXX how ??? */
- return -1;
- /* XXX what about the thread ? */
- /* XXX what about the memory allocated ? */
- }
- return 0;
-}
-
-char *description()
-{
- return desc;
-}
-
-int usecount() /* XXX is this per-device or global for the module ? */
-{
- int res;
- ast_mutex_lock(&usecnt_lock);
- res = usecnt;
- ast_mutex_unlock(&usecnt_lock);
- return res;
-}
-
-char *key()
-{
- return ASTERISK_GPL_KEY;
-}
diff --git a/net/asterisk/files/patch-Makefile b/net/asterisk/files/patch-Makefile
index 49c66ed..16f6b03 100644
--- a/net/asterisk/files/patch-Makefile
+++ b/net/asterisk/files/patch-Makefile
@@ -3,128 +3,200 @@ $FreeBSD$
--- Makefile.orig
+++ Makefile
-@@ -45,6 +45,19 @@
- PROC=$(shell uname -m)
- endif
-
-+ifeq (${OSARCH},FreeBSD)
-+ifeq ($(PROC),sparc64)
-+PROC=ultrasparc
-+OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
-+OPTIONS+=$(shell if $(CC) -mcpu=v9 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v9"; fi)
-+OPTIONS+=-fomit-frame-pointer
-+endif
-+ifeq ($(PROC),amd64)
-+PROC=k8
-+OPTIONS+=-m64
-+endif
-+endif
-+
- # Pentium Pro Optimize
- #PROC=i686
-
-@@ -63,10 +76,10 @@
+@@ -19,8 +19,8 @@
+ # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
+ # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
+ # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
+-CC=$(CROSS_COMPILE)gcc
+-HOST_CC=gcc
++CC?=$(CROSS_COMPILE)gcc
++HOST_CC=${CC}
+ # CROSS_ARCH=Linux
+ # CROSS_PROC=arm
+ # SUB_PROC=xscale # or maverick
+@@ -44,14 +44,14 @@
#K6OPT = -DK6OPT
- #Tell gcc to optimize the asterisk's code
+ #Tell gcc to optimize the code
-OPTIMIZE+=-O6
+#OPTIMIZE+=-O6
+ endif
- #Include debug symbols in the executables (-g) and profiling info (-pg)
--DEBUG=-g #-pg
-+#DEBUG=-g #-pg
+ #Overwite config files on "make samples"
+-OVERWRITE=y
++OVERWRITE=n
- # If you are running a radio application, define RADIO_RELAX so that the DTMF
- # will be received more reliably
-@@ -91,7 +104,7 @@
+ #Include debug and macro symbols in the executables (-g) and profiling info (-pg)
+-DEBUG=-g3 #-pg
++#DEBUG=-g3 #-pg
+
+ #Set NOCRYPTO to yes if you do not want to have crypto support or
+ #dependencies
+@@ -83,7 +83,7 @@
# Where to install asterisk after compiling
# Default -> leave empty
--INSTALL_PREFIX=
+-INSTALL_PREFIX?=
+INSTALL_PREFIX=$(PREFIX)
# Staging directory
# Files are copied here temporarily during the install process
-@@ -111,23 +124,23 @@
- # Don't use together with -DBUSYDETECT_TONEONLY
+@@ -106,17 +106,17 @@
BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
--ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
--ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
-+ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
-+ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
- ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
--ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
--ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
--ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
-+ASTSPOOLDIR=/var/spool/asterisk
-+ASTLOGDIR=/var/log/asterisk
-+ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
- ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
--ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
--ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
--ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
--ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
-+ASTBINDIR=$(INSTALL_PREFIX)/bin
-+ASTSBINDIR=$(INSTALL_PREFIX)/sbin
-+ASTVARRUNDIR=/var/run
-+ASTMANDIR=$(INSTALL_PREFIX)/man
-
- MODULES_DIR=$(ASTLIBDIR)/modules
- AGI_DIR=$(ASTVARLIBDIR)/agi-bin
-
- INCLUDE=-Iinclude -I../include
--CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
-+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
- CFLAGS+=$(OPTIMIZE)
+ ifneq ($(OSARCH),SunOS)
+- ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
+ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+ MODULES_DIR=$(ASTLIBDIR)/modules
+ AGI_DIR=$(ASTVARLIBDIR)/agi-bin
+ else
+@@ -218,13 +218,13 @@
+ endif
+
+ INCLUDE+=-Iinclude -I../include
+-ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
+-ASTCFLAGS+=$(OPTIMIZE)
++ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
++#ASTCFLAGS+=$(OPTIMIZE)
+ ASTOBJ=-o asterisk
+
+ ifeq ($(findstring BSD,$(OSARCH)),BSD)
+ PROC=$(shell uname -m)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
ifneq ($(PROC),ultrasparc)
-@@ -138,12 +151,8 @@
- CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi)
-
- ifeq (${OSARCH},FreeBSD)
--OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
--CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
--LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
--INCLUDE+=-I/usr/local/include
--CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
--MPG123TARG=freebsd
-+CFLAGS+=$(PTHREAD_CFLAGS)
-+LIBS+=$(PTHREAD_LIBS)
+@@ -235,8 +235,8 @@
+ ASTCFLAGS+=-fsigned-char
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h),)
+- ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/local/include/osp
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h),)
++ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp
+ else
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp
+@@ -245,27 +245,24 @@
+
+ ifeq ($(OSARCH),FreeBSD)
+ BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
+- ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
+- LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
+- ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp
++ ASTCFLAGS+=$(PTHREAD_CFLAGS)
++ LIBS+=$(PTHREAD_LIBS)
++ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp),)
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp
+ endif
+ MPG123TARG=freebsd
+
+- # XXX FreeBSD paths
+- PREFIX?=/usr/local
+- ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
+- ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
++ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
+- # XXX end FreeBSD paths
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+
endif # FreeBSD
- ifeq (${OSARCH},NetBSD)
-@@ -160,7 +169,10 @@
- #CFLAGS+=-DOLD_DSP_ROUTINES
+@@ -281,7 +278,7 @@
- CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
--CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPTEL_OPTIMIZATIONS
-+endif
+ ifeq ($(OSARCH),SunOS)
+ ASTCFLAGS+=-Wcast-align -DSOLARIS
+- INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
++ INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/include
+ endif
- LIBEDIT=editline/libedit.a
+ ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN)
+@@ -296,7 +293,7 @@
-@@ -222,7 +234,7 @@
- SOLINK=-shared -Xlinker -x
+ ifndef WITHOUT_ZAPTEL
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS
+ endif
+
+@@ -323,7 +320,7 @@
+ ASTERISKVERSIONNUM=999999
+ ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name)
+ else
+- ASTERISKVERSIONNUM=000000
++ ASTERISKVERSIONNUM?=000000
+ endif
+ endif
+
+@@ -388,10 +385,10 @@
endif
--CC=gcc
-+CC?=gcc
- INSTALL=install
+ ifeq ($(OSARCH),SunOS)
+- LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ OBJS+=strcompat.o
+ ASTLINK=
+- SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ endif
+
+ ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
+@@ -399,7 +396,7 @@
+ endif
- _all: all
-@@ -234,7 +246,7 @@
+ # This is used when generating the doxygen documentation
+-ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),)
++ifneq ($(wildcard $(LOCALBASE)/bin/dot)$(wildcard /usr/bin/dot),)
+ HAVEDOT=yes
+ else
+ HAVEDOT=no
+@@ -418,7 +415,7 @@
@echo " + $(MAKE) install +"
@echo " +-------------------------------------------+"
--all: depend asterisk subdirs
-+all: depend asterisk subdirs manpage
+-all: cleantest depend asterisk subdirs
++all: cleantest depend asterisk subdirs manpage
- editline/config.h:
- cd editline && unset CFLAGS LIBS && ./configure ; \
-@@ -243,13 +255,13 @@
+ #ifneq ($(wildcard tags),)
+ ctags: tags
+@@ -437,13 +434,13 @@
cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
$(MAKE) -C editline libedit.a
@@ -144,55 +216,57 @@ $FreeBSD$
+# fi
ifneq ($(wildcard .depend),)
- include .depend
-@@ -271,13 +283,10 @@
-
- asterisk.o: asterisk.c build.h
-
--manpage: asterisk.8.gz
-+manpage: asterisk.8
-
--asterisk.8.gz: asterisk.sgml
-- rm -f asterisk.8
-- docbook2man asterisk.sgml
-- mv ./*.8 asterisk.8
-- gzip asterisk.8
-+asterisk.8: asterisk.8.gz
-+ gzcat asterisk.8.gz > asterisk.8
-
- ifneq ($(strip $(ASTERISKVERSION)),)
- build.h: .version
-@@ -295,8 +304,8 @@
- exit 1; \
+ include .depend
+@@ -510,14 +507,14 @@
+ cygwin_a:
+ $(MAKE) -C cygwin all
+
+-asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
++asterisk: $(CYGLOADER) editline/libedit.a stdtime/libtime.a $(OBJS)
+ build_tools/make_build_h > include/asterisk/build.h.tmp
+ if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
+ mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
fi
-
--asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
-- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
-+asterisk: editline/libedit.a stdtime/libtime.a $(OBJS)
-+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) stdtime/libtime.a $(LIBS)
+ rm -f include/asterisk/build.h.tmp
+ $(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
+- $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
++ $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) stdtime/libtime.a $(LIBS)
muted: muted.o
- $(CC) -o muted muted.o
-@@ -315,28 +324,28 @@
- $(MAKE) -C stdtime clean
+ $(CC) $(AUDIO_LIBS) -o muted muted.o
+@@ -539,38 +536,38 @@
datafiles: all
+ if [ x`whoami` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
for x in sounds/digits/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
+ for x in sounds/dictate/*.gsm; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
+ else \
+ echo "No description for $$x"; \
+ exit 1; \
+ fi; \
+ done
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
for x in sounds/letters/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
else \
echo "No description for $$x"; \
@@ -202,17 +276,17 @@ $FreeBSD$
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
for x in sounds/phonetic/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
else \
echo "No description for $$x"; \
exit 1; \
-@@ -344,18 +353,18 @@
+@@ -578,18 +575,18 @@
done
- for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
@@ -224,70 +298,80 @@ $FreeBSD$
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images
for x in images/*.jpg; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
done
- mkdir -p $(DESTDIR)$(AGI_DIR)
+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
update:
- @if [ -d CVS ]; then \
-@@ -367,127 +376,90 @@
- fi
+ @if [ -d .svn ]; then \
+@@ -618,75 +615,53 @@
+ OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
bininstall: all
- mkdir -p $(DESTDIR)$(MODULES_DIR)
- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTETCDIR)
- mkdir -p $(DESTDIR)$(ASTBINDIR)
-- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
-- install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
+- if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ $(MKDIR) $(DESTDIR)$(MODULES_DIR)
+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTBINDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR)
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/dictate
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/system
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/tmp
-+ $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/meetme
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/monitor
++ if [ -f asterisk ]; then $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f cygwin/asterisk.exe ]; then $(BSD_INSTALL_PROGRAM) cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f asterisk.dll ]; then $(BSD_INSTALL_PROGRAM) asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
+- $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
+- $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
++ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
-- install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
+ chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
fi
for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
-- install -d $(DESTDIR)$(ASTHEADERDIR)
-- install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm
-- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
-- if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \
-- mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- else \
-- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \
-- fi
-- ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+ if [ -n "$(OLDHEADERS)" ]; then \
+ rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
+ fi
+ rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
+- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
-- install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 asterisk.8.gz $(DESTDIR)$(ASTMANDIR)/man8
-+ ln -sf $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv
++ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
@@ -295,14 +379,16 @@ $FreeBSD$
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
if [ -d contrib/firmware/iax ]; then \
-- install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
else \
echo "You need to do cvs update -d not just cvs update" ; \
fi
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . )
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
- if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
- @echo " +---- Asterisk Installation Complete -------+"
- @echo " + +"
@@ -325,85 +411,74 @@ $FreeBSD$
- @echo " + **Note** This requires that you have +"
- @echo " + doxygen installed on your local system +"
- @echo " +-------------------------------------------+"
-- @echo " + +"
-- @echo " + ** NOTE FOR DOWNGRADING FROM CVS HEAD ** +"
-- @echo " + +"
-- @echo " + If you are downgrading from CVS HEAD to +"
-- @echo " + a stable release, remember to delete +"
-- @echo " + everything from your asterisk modules +"
-- @echo " + directory (/usr/lib/asterisk/modules/) +"
-- @echo " + and the asterisk header directory +"
-- @echo " + (/usr/include/asterisk/) +"
-- @echo " + before doing a '$(MAKE) install'. +"
-- @echo " + +"
-- @echo " +-------------------------------------------+"
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/vm . )
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/voicemail . )
+ @$(MAKE) -s oldmodcheck
+ NEWMODS=$(notdir $(wildcard */*.so))
+@@ -710,7 +685,7 @@
+ echo " WARNING WARNING WARNING" ;\
+ fi
-install: all datafiles bininstall
+install: all datafiles bininstall samples
-
+ @if [ -x /usr/sbin/asterisk-post-install ]; then \
+ /usr/sbin/asterisk-post-install $(DESTDIR) . ; \
+ fi
+@@ -718,16 +693,19 @@
upgrade: all bininstall
- adsi: all
+ adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x`-dist; \
- if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
fi ; \
done
- samples: all datafiles adsi
+ samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
-- for x in configs/*.sample; do \
-- if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
++ echo ADSI INSTALL $(BSD_INSTALL_DATA)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
-+ for x in configs/*.sample channels/h323/*.sample; do \
+ for x in configs/*.sample; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`-dist;\
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+ if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
+ if [ "$(OVERWRITE)" = "y" ]; then \
+ if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
+@@ -740,7 +718,7 @@
+ continue; \
+ fi ;\
fi ; \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
done
-- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-+ echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
-+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist $(DESTDIR)$(ASTETCDIR)/asterisk.conf; \
-+ fi
+ if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ ( \
+@@ -759,25 +737,25 @@
+ echo ";astctlowner = root" ; \
+ echo ";astctlgroup = apache" ; \
+ echo ";astctl = asterisk.ctl" ; \
+- ) > $(DESTDIR)$(ASTCONFPATH) ; \
++ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ else \
+ echo "Skipping asterisk.conf creation"; \
+ fi
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
for x in sounds/demo-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
for x in sounds/*.mp3; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
done
rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3
@@ -412,18 +487,18 @@ $FreeBSD$
:> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
-@@ -502,7 +474,7 @@
- @[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 )
- @[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 )
- install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi
-- mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk
-+ $(MKDIR) $(DESTDIR)$(HTTPDIR)/html/_asterisk
+@@ -791,7 +769,7 @@
+ @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
+ @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
+ $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
+- mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
++ $(MKDIR) $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
for x in images/*.gif; do \
- install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
done
-@@ -522,10 +494,10 @@
+@@ -820,10 +798,10 @@
- __rpm: _version
+ __rpm: include/asterisk/version.h spec
rm -rf /tmp/asterisk ; \
- mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
+ $(MKDIR) /tmp/asterisk/redhat/RPMS/i386 ; \
@@ -431,6 +506,6 @@ $FreeBSD$
$(MAKE) DESTDIR=/tmp/asterisk samples ; \
- mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
+ $(MKDIR) /tmp/asterisk/etc/rc.d/init.d ; \
- cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
- sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
+ cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
+
diff --git a/net/asterisk/files/patch-agi::Makefile b/net/asterisk/files/patch-agi::Makefile
index 32efb5d..b359765 100644
--- a/net/asterisk/files/patch-agi::Makefile
+++ b/net/asterisk/files/patch-agi::Makefile
@@ -1,9 +1,9 @@
$FreeBSD$
---- agi/Makefile.orig Tue Jun 22 20:42:13 2004
-+++ agi/Makefile Tue Oct 5 21:03:40 2004
-@@ -11,15 +11,18 @@
+--- agi/Makefile.orig Thu Jan 12 15:42:07 2006
++++ agi/Makefile Thu Jan 12 15:44:39 2006
+@@ -11,7 +11,9 @@
# the GNU General Public License
#
@@ -14,14 +14,15 @@ $FreeBSD$
CFLAGS+=
+@@ -27,8 +29,9 @@
all: depend $(AGIS)
install: all
- mkdir -p $(DESTDIR)$(AGI_DIR)
- for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
-+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
++ $(MKDIR) -p $(DESTDIR)$(AGI_DIR)
+ for x in $(AGIS_BIN); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(AGI_DIR) ; done
+ for x in $(AGIS_SCR); do $(BSD_INSTALL_SCRIPT) $$x $(DESTDIR)$(AGI_DIR) ; done
eagi-test: eagi-test.o
- $(CC) $(CFLAGS) -o eagi-test eagi-test.o
+ $(CC) $(CFLAGS) -o eagi-test eagi-test.o $(LIBS)
diff --git a/net/asterisk/files/patch-apps::Makefile b/net/asterisk/files/patch-apps::Makefile
index 44f8495..ee7d560 100644
--- a/net/asterisk/files/patch-apps::Makefile
+++ b/net/asterisk/files/patch-apps::Makefile
@@ -1,38 +1,56 @@
---- apps/Makefile.orig Wed Jun 22 14:40:11 2005
-+++ apps/Makefile Wed Jun 22 14:43:45 2005
-@@ -40,9 +40,13 @@
+
+$FreeBSD$
+
+--- apps/Makefile.orig
++++ apps/Makefile
+@@ -45,25 +45,27 @@
#APPS+=app_rpt.so
- APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
--APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
- APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi)
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h),)
+ APPS+=app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so
+ endif
+ endif # WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ifdef WITH_FAX
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/spandsp.h ]; then echo "app_rxfax.so app_txfax.so" ; fi)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp.h),)
++APPS+=app_rxfax.so app_txfax.so
++endif
+endif
+
- CFLAGS+=-fPIC
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ APPS+=app_osplookup.so
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+-CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+-CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
+-ifneq ($(shell if [[ 0x`$(CROSS_COMPILE_BIN)curl-config --vernum` -ge 0x70907 ]]; then echo "OK" ; fi),)
+- ifneq (${CURLLIBS},)
+- APPS+=app_curl.so
+- endif
+-endif
++CURLLIBS=$(shell $(CROSS_COMPILE_BIN)$(LOCALBASE)/bin/curl-config --libs)
++APPS+=app_curl.so
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
-@@ -65,12 +69,12 @@
- $(CC) $(SOLINK) -o $@ $< -ltonezone
+ ifeq (${OSARCH},CYGWIN)
+ CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
+@@ -95,24 +97,32 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -ltonezone
install: all
- for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(APPS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
+ rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
- app_voicemail.so : app_voicemail.o
- ifeq ($(USE_MYSQL_VM_INTERFACE),1)
-- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L/usr/lib/mysql -lmysqlclient -lz
-+ $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L$(LOCALBASE)/lib/mysql -lmysqlclient -lz
- else
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lpq
-@@ -79,17 +83,25 @@
- endif
- endif
+ app_curl.so: app_curl.o
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
+ifdef WITH_FAX
+app_rxfax.so : app_rxfax.o
@@ -47,15 +65,15 @@
+ $(CC) -I$(LOCALBASE)/include/pgsql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
app_sql_postgres.so: app_sql_postgres.o
-- $(CC) $(SOLINK) -o $@ $< -L/usr/local/pgsql/lib -lpq
-+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lpq
+- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
++ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L$(LOCALBASE)/lib -lpq
app_sql_odbc.so: app_sql_odbc.o
- $(CC) $(SOLINK) -o $@ $< -lodbc
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
look: look.c
- $(CC) -pipe -O6 -g look.c -o look -lncurses
-+ $(CC) $(CFLAGS) look.c -o look -lncurses
++ $(CC) look.c -o look -lncurses
- ifneq ($(wildcard .depend),)
- include .depend
+ ifeq (SunOS,$(shell uname))
+ app_chanspy.so: app_chanspy.o
diff --git a/net/asterisk/files/patch-apps::app_rxfax.c b/net/asterisk/files/patch-apps::app_rxfax.c
index 88362bfc..820208e 100644
--- a/net/asterisk/files/patch-apps::app_rxfax.c
+++ b/net/asterisk/files/patch-apps::app_rxfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_rxfax.c.orig
-+++ apps/app_rxfax.c
-@@ -0,0 +1,371 @@
+--- /dev/null Thu Jan 12 17:44:40 2006
++++ apps/app_rxfax.c Thu Jan 12 17:41:53 2006
+@@ -0,0 +1,373 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <asterisk/dsp.h>
+#include <asterisk/manager.h>
++#include <asterisk/version.h>
+#include <string.h>
+#include <stdlib.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
@@ -100,7 +102,7 @@ $FreeBSD$
+ "FaxReceived", "Channel: %s\nExten: %s\nCallerID: %s\nRemoteStationID: %s\nLocalStationID: %s\nPagesTransferred: %i\nResolution: %i\nTransferRate: %i\nFileName: %s\n",
+ chan->name,
+ chan->exten,
-+#if (ASTERISK_VERSION_NUM <= 011000)
++#if ASTERISK_VERSION_NUM <= 010010
+ chan->callerid,
+#else
+ (chan->cid.cid_num) ? chan->cid.cid_num : "",
diff --git a/net/asterisk/files/patch-apps::app_txfax.c b/net/asterisk/files/patch-apps::app_txfax.c
index 8daf0f9..15ad667 100644
--- a/net/asterisk/files/patch-apps::app_txfax.c
+++ b/net/asterisk/files/patch-apps::app_txfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_txfax.c.orig
-+++ apps/app_txfax.c
-@@ -0,0 +1,293 @@
+--- /dev/null Thu Jan 12 17:48:54 2006
++++ apps/app_txfax.c Thu Jan 12 17:48:36 2006
+@@ -0,0 +1,295 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <string.h>
+#include <stdlib.h>
++#include <math.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
+#include <inttypes.h>
+#else
diff --git a/net/asterisk/files/patch-astman::Makefile b/net/asterisk/files/patch-astman::Makefile
deleted file mode 100644
index 2745860..0000000
--- a/net/asterisk/files/patch-astman::Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-
-$FreeBSD$
-
---- astman/Makefile.orig Sat Jun 26 22:25:39 2004
-+++ astman/Makefile Thu Oct 14 19:14:22 2004
-@@ -5,16 +5,16 @@
-
- OSARCH=$(shell uname -s)
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS+=-I/usr/local/include -L/usr/local/lib
-+CFLAGS+=-I$(LOCALBASE)/include -L$(LOCALBASE)/lib
- endif
-
--TARGET=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else if [ -f /usr/local/include/newt.h ]; then echo "astman"; else echo "none" ; fi ; fi)
-+TARGET=astman
- all: depend $(TARGET)
-
- install:
- if [ "$(TARGET)" != "none" ]; then \
- for x in $(TARGET); do \
-- install -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
-+ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
- done ; \
- fi
-
diff --git a/net/asterisk/files/patch-cdr::Makefile b/net/asterisk/files/patch-cdr::Makefile
index 1d0fb20..da16b60 100644
--- a/net/asterisk/files/patch-cdr::Makefile
+++ b/net/asterisk/files/patch-cdr::Makefile
@@ -1,51 +1,65 @@
---- cdr/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ cdr/Makefile Tue Aug 9 17:28:11 2005
-@@ -21,7 +21,7 @@
- OSARCH=$(shell uname -s)
-
- ifeq (${OSARCH},FreeBSD)
--SOLINK+=-L/usr/local/lib
-+SOLINK+=-L$(LOCALBASE)/lib
+
+$FreeBSD$
+
+--- cdr/Makefile.orig Tue Nov 29 20:24:39 2005
++++ cdr/Makefile Thu Jan 12 17:56:23 2006
+@@ -21,8 +21,8 @@
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
endif
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
-@@ -37,18 +37,23 @@
+@@ -38,18 +38,18 @@
#
# unixODBC stuff...
#
-+ifdef WITH_ODBC
- MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/odbcinst.h),)
+ MODS+=cdr_odbc.so
+ endif
#
# FreeTDS stuff...
#
-+ifdef WITH_FREETDS
- MODS+=$(shell if [ -f "/usr/include/tds.h" ]; then echo "cdr_tds.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/tds.h" ]; then echo "cdr_tds.so"; fi)
-+endif
-
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h),)
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.63),1)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tds.h),)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.63),1)
+ CFLAGS += -DFREETDS_0_63
+ else
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.62),1)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.62),1)
+ CFLAGS += -DFREETDS_0_62
+ else
+ CFLAGS += -DFREETDS_PRE_0_62
+@@ -61,7 +61,7 @@
#
# PGSQL stuff... Autoconf anyone??
#
-+ifdef WITH_PGSQL
- MODS+=$(shell if [ -d /usr/local/pgsql/include ] || [ -d /usr/include/pgsql ] || [ -d /usr/local/include/pgsql ] || [ -d /opt/pgsql/include ] || [ -f /usr/include/libpq-fe.h ] ; then echo "cdr_pgsql.so"; fi)
- CFLAGS+=$(shell if [ -d /usr/local/pgsql/include ]; then echo "-I/usr/local/pgsql/include"; fi)
- CFLAGS+=$(shell if [ -d /usr/include/pgsql ]; then echo "-I/usr/include/pgsql"; fi)
-@@ -62,16 +67,19 @@
- MLFLAGS+=$(shell if [ -d /usr/local/lib/pgsql ]; then echo "-L/usr/local/lib/pgsql"; fi)
- MLFLAGS+=$(shell if [ -d /opt/pgsql/lib ]; then echo "-L/opt/pgsql/lib"; fi)
- MLFLAGS+=$(shell if [ -f /usr/lib/libpq.so ]; then echo "-L/usr/lib"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
+ MODS+=cdr_pgsql.so
+ endif
- #
- # SQLIte stuff...
- #
-+ifdef WITH_SQLITE
- MODS+=$(shell if [ -f "/usr/include/sqlite.h" ]; then echo "cdr_sqlite.so"; fi)
-+endif
+@@ -82,9 +82,9 @@
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/pgsql
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql),)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/pgsql
+- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib/pgsql
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql),)
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql
++ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/pgsql
+ endif
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include),)
+@@ -110,7 +110,7 @@
all: depend $(MODS)
install: all
diff --git a/net/asterisk/files/patch-channels::Makefile b/net/asterisk/files/patch-channels::Makefile
index 7ecab67..edca9b1 100644
--- a/net/asterisk/files/patch-channels::Makefile
+++ b/net/asterisk/files/patch-channels::Makefile
@@ -1,97 +1,85 @@
---- channels/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ channels/Makefile Tue Aug 9 17:34:28 2005
-@@ -57,10 +57,10 @@
-
+
+$FreeBSD$
+
+--- channels/Makefile.orig
++++ channels/Makefile
+@@ -48,9 +48,9 @@
endif
+
ifeq (${OSARCH},FreeBSD)
--PTLIB=-lpt_FreeBSD_x86_r
--H323LIB=-lh323_FreeBSD_x86_r
--CHANH323LIB=-pthread
--SOLINK+=-L/usr/local/lib
-+PTLIB=-lpt_FreeBSD_x86_r_s
-+H323LIB=-lh323_FreeBSD_x86_r_s
-+CHANH323LIB=
-+SOLINK+=-L$(LOCALBASE)/lib
+- PTLIB=-lpt_FreeBSD_x86_r
+- H323LIB=-lh323_FreeBSD_x86_r
+- CHANH323LIB=-pthread
++ PTLIB=-lpt_FreeBSD_x86_r_s
++ H323LIB=-lh323_FreeBSD_x86_r_s
++ CHANH323LIB=
endif
+
ifeq (${OSARCH},NetBSD)
- PTLIB=-lpt_NetBSD_x86_r
-@@ -72,19 +72,23 @@
+@@ -73,11 +73,11 @@
+ SOLINK+=-lrt
endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/ixjuser.h ] && echo chan_phone.so)
-+ifdef WITH_H323
-+CHANNEL_LIBS+=chan_h323.so
-+endif
-
- CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
- CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
- CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
--CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
- CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
- CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
--ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
-+ZAPPRI=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo "-lpri")
- ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
-+ifdef WITH_ZAPTEL
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "-DIAX_TRUNKING -I$(LOCALBASE)/include")
-+endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
- CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX")
-
-@@ -106,8 +110,10 @@
-
- ZAPDIR=/usr/lib
-
-+ifdef WITH_ZAPTEL
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so")
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "chan_zap.so")
-+endif
-
- CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/ixjuser.h),)
+ CHANNEL_LIBS+=chan_phone.so
+ endif
-@@ -156,6 +162,8 @@
- chan_oss.so: chan_oss.o
- $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
+-ifneq ($(wildcard h323/libchanh323.a),)
++ifdef WITH_H323
+ CHANNEL_LIBS+=chan_h323.so
endif
-+chan_oss.so: chan_oss.o
-+ $(CC) $(SOLINK) -o $@ chan_oss.o
- chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o
- ifeq ($(USE_MYSQL_FRIENDS),1)
-@@ -175,7 +183,7 @@
- $(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c
+@@ -91,12 +91,12 @@
+ CHANNEL_LIBS+=chan_alsa.so
+ endif
- chan_zap.so: chan_zap.o
-- $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -ltonezone
-+ $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -L$(LOCALBASE)/lib -ltonezone
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libpri.so.1),)
+ CFLAGS+=-DZAPATA_PRI
+ ZAPPRI=-lpri
+ endif
- chan_sip.so: chan_sip.o
- ifeq ($(USE_SIP_MYSQL_FRIENDS),1)
-@@ -199,15 +207,17 @@
- chan_vpb.so: chan_vpb.o
- $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libmfcr2.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libmfcr2.so.1),)
+ CFLAGS+=-DZAPATA_R2
+ ZAPR2=-lmfcr2
+ endif
+@@ -109,12 +109,12 @@
+ endif
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ifeq (${OSARCH},NetBSD)
+ SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/pkg/lib
+ endif
+ ifeq (${OSARCH},FreeBSD)
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ CFLAGS+=-DIAX_TRUNKING
+ CHANNEL_LIBS+=chan_zap.so
+@@ -229,8 +229,10 @@
+ chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast
+ $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
+ else
-chan_h323.so: chan_h323.o h323/libchanh323.a
- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
+chan_h323.so: chan_h323.o h323/ast_h323.o
-+ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -lcrypto -lssl -L$(LOCALBASE)/lib -lexpat -llber -lldap -lldap_r
-
++ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o $(CHANH323LIB) -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L/usr/lib -lcrypto -lssl -lexpat -L$(LOCALBASE)/lib -llber -lldap -lldap_r
+h323/ast_h323.o:
+ $(MAKE) -C h323 ast_h323.o
+ endif
- #chan_modem.so : chan_modem.o
+ chan_misdn.so: chan_misdn.o chan_misdn_config.o misdn/chan_misdn_lib.a
+@@ -244,8 +246,7 @@
# $(CC) -rdynamic -shared -Xlinker -x -o $@ $<
install: all
- for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
+ for x in $(CHANNEL_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
depend: .depend
+
diff --git a/net/asterisk/files/patch-channels::chan_h323.c b/net/asterisk/files/patch-channels::chan_h323.c
index de2ed39..6498b97 100644
--- a/net/asterisk/files/patch-channels::chan_h323.c
+++ b/net/asterisk/files/patch-channels::chan_h323.c
@@ -1,14 +1,14 @@
$FreeBSD$
---- channels/chan_h323.c 2004/10/10 13:00:17 1.1
-+++ channels/chan_h323.c 2004/10/10 13:00:39
-@@ -26,7 +26,7 @@
- * Version Info: $Id: patch-channels::chan_h323.c,v 1.3.2.3 2004/10/14 14:30:13 sobomax Exp $
- */
+--- channels/chan_h323.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_h323.c Thu Jan 12 18:29:50 2006
+@@ -2281,7 +2281,7 @@ static char *convertcap(int cap)
+ }
+ }
--
-+#include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/signal.h>
- #include <sys/param.h>
+-static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs)
++static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active)
+ {
+ /* XXX Deal with Video */
+ struct oh323_pvt *pvt;
diff --git a/net/asterisk/files/patch-channels::chan_sip.c b/net/asterisk/files/patch-channels::chan_sip.c
index e634ce4..355c558 100644
--- a/net/asterisk/files/patch-channels::chan_sip.c
+++ b/net/asterisk/files/patch-channels::chan_sip.c
@@ -1,144 +1,131 @@
$FreeBSD$
---- channels/chan_sip.c.orig Sun Feb 17 18:01:43 2002
-+++ channels/chan_sip.c Sun Feb 17 18:10:52 2002
-@@ -141,7 +141,7 @@
+--- channels/chan_sip.c.orig Thu Jan 12 18:43:37 2006
++++ channels/chan_sip.c Thu Jan 12 18:50:11 2006
+@@ -336,7 +336,7 @@ static char global_vmexten[AST_MAX_EXTEN
static char default_language[MAX_LANGUAGE] = "";
--static char default_callerid[AST_MAX_EXTENSION] = "asterisk";
-+static char default_callerid[AST_MAX_EXTENSION] = "Unknown";
+-#define DEFAULT_CALLERID "asterisk"
++#define DEFAULT_CALLERID "Unknown"
+ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID;
static char default_fromdomain[AST_MAX_EXTENSION] = "";
+@@ -474,6 +474,7 @@ struct sip_invite_param {
-@@ -244,6 +244,7 @@
struct sip_route {
struct sip_route *next;
- char hop[0];
+ int lr;
+ char hop[0];
};
- struct sip_history {
-@@ -2218,7 +2219,7 @@
- if (p->owner) {
- /* We already hold the channel lock */
- if (f->frametype == AST_FRAME_VOICE) {
-- if (f->subclass != p->owner->nativeformats) {
-+ if (!(f->subclass & p->owner->nativeformats)) {
- ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
- p->owner->nativeformats = f->subclass;
- ast_set_read_format(p->owner, p->owner->readformat);
-@@ -4620,6 +4621,10 @@
+@@ -5993,6 +5994,7 @@ static void build_route(struct sip_pvt *
/* Make a struct route */
- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
+ thishop = malloc(sizeof(*thishop) + len);
if (thishop) {
-+ if (strnstr(rr, ";lr", len) != NULL)
-+ thishop->lr = 1;
-+ else
-+ thishop->lr = 0;
- strncpy(thishop->hop, rr, len); /* safe */
- thishop->hop[len] = '\0';
++ thishop->lr = (strnstr(rr, ";lr", len) != NULL ? 1 : 0);
+ ast_copy_string(thishop->hop, rr, len);
ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop);
-@@ -4643,31 +4648,41 @@
- rr += len+1;
- }
- }
-- /* 2nd append the Contact: if there is one */
-- /* Can be multiple Contact headers, comma separated values - we just take the first */
-- contact = get_header(req, "Contact");
-- if (!ast_strlen_zero(contact)) {
-- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-- /* Look for <: delimited address */
-- c = strchr(contact, '<');
-- if (c) {
-- /* Take to > */
-- ++c;
-- len = strcspn(c, ">");
-- } else {
-- /* No <> - just take the lot */
-- c = contact; len = strlen(contact);
-- }
-- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ /* Duplicate first route from the list */
-+ if (head && head->lr) {
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
- if (thishop) {
-- strncpy(thishop->hop, c, len); /* safe */
-- thishop->hop[len] = '\0';
-- thishop->next = NULL;
-- /* Goes at the end */
-- if (tail)
-- tail->next = thishop;
-- else
-- head = thishop;
-+ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
-+ thishop->next = head;
-+ head = thishop;
-+ }
-+ } else {
-+ /* Append the Contact: if there is one and first route is w/o `lr' param */
-+ /* Can be multiple Contact headers, comma separated values - we just take the first */
-+ contact = get_header(req, "Contact");
-+ if (!ast_strlen_zero(contact)) {
-+ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-+ /* Look for <: delimited address */
-+ c = strchr(contact, '<');
-+ if (c) {
-+ /* Take to > */
-+ ++c;
-+ len = strcspn(c, ">");
-+ } else {
-+ /* No <> - just take the lot */
-+ c = contact; len = strlen(contact);
-+ }
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ if (thishop) {
-+ strncpy(thishop->hop, c, len); /* safe */
-+ thishop->hop[len] = '\0';
-+ thishop->next = NULL;
-+ /* Goes at the end */
-+ if (tail)
-+ tail->next = thishop;
-+ else
-+ head = thishop;
+ /* Link in */
+@@ -6018,31 +6020,41 @@ static void build_route(struct sip_pvt *
+
+ /* Only append the contact if we are dealing with a strict router */
+ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) {
+- /* 2nd append the Contact: if there is one */
+- /* Can be multiple Contact headers, comma separated values - we just take the first */
+- contact = get_header(req, "Contact");
+- if (!ast_strlen_zero(contact)) {
+- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
+- /* Look for <: delimited address */
+- c = strchr(contact, '<');
+- if (c) {
+- /* Take to > */
+- ++c;
+- len = strcspn(c, ">") + 1;
+- } else {
+- /* No <> - just take the lot */
+- c = contact;
+- len = strlen(contact) + 1;
+- }
+- thishop = malloc(sizeof(*thishop) + len);
++ /* Duplicate first route from the list */
++ if (head && head->lr) {
++ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
+ if (thishop) {
+- ast_copy_string(thishop->hop, c, len);
+- thishop->next = NULL;
+- /* Goes at the end */
+- if (tail)
+- tail->next = thishop;
+- else
+- head = thishop;
++ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
++ thishop->next = head;
++ head = thishop;
+ }
++ } else {
++ /* Append the Contact: if there is one and first route is w/o `lr' param */
++ /* Can be multiple Contact headers, comma separated values - we just take the first */
++ contact = get_header(req, "Contact");
++ if (!ast_strlen_zero(contact)) {
++ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
++ /* Look for <: delimited address */
++ c = strchr(contact, '<');
++ if (c) {
++ /* Take to > */
++ ++c;
++ len = strcspn(c, ">") + 1;
++ } else {
++ /* No <> - just take the lot */
++ c = contact;
++ len = strlen(contact) + 1;
++ }
++ thishop = malloc(sizeof(*thishop) + len);
++ if (thishop) {
++ ast_copy_string(thishop->hop, c, len);
++ thishop->next = NULL;
++ /* Goes at the end */
++ if (tail)
++ tail->next = thishop;
++ else
++ head = thishop;
++ }
+ }
}
}
- /* Store as new route */
-@@ -7338,7 +7353,11 @@
- /* Get destination right away */
- gotdest = get_destination(p, NULL);
- get_rdnis(p, NULL);
-- extract_uri(p, req);
-+ build_route(p, req, 0);
-+ if (!p->route->lr)
-+ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
-+ else
-+ extract_uri(p, req);
- build_contact(p);
+@@ -10336,7 +10348,11 @@ static int handle_request_invite(struct
+ gotdest = get_destination(p, NULL);
- if (gotdest) {
-@@ -7366,7 +7385,6 @@
- c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
- *recount = 1;
- /* Save Record-Route for any later requests we make on this dialogue */
-- build_route(p, req, 0);
- if (c) {
- /* Pre-lock the call */
- ast_mutex_lock(&c->lock);
-@@ -7426,6 +7444,14 @@
- transmit_response(p, "180 Ringing", req);
- break;
- case AST_STATE_UP:
-+ /* Assuming this to be reinvite, process new SDP portion */
-+ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
-+ process_sdp(p, req);
-+ } else {
-+ p->jointcapability = p->capability;
-+ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
-+ }
-+
- transmit_response_with_sdp(p, "200 OK", req, 1);
- break;
- default:
+ get_rdnis(p, NULL);
+- extract_uri(p, req);
++ build_route(p, req, 0);
++ if (!p->route->lr)
++ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
++ else
++ extract_uri(p, req);
+ build_contact(p);
+
+ if (gotdest) {
+@@ -10364,7 +10380,6 @@ static int handle_request_invite(struct
+ c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
+ *recount = 1;
+ /* Save Record-Route for any later requests we make on this dialogue */
+- build_route(p, req, 0);
+ if (c) {
+ /* Pre-lock the call */
+ ast_mutex_lock(&c->lock);
+@@ -10450,6 +10465,13 @@ static int handle_request_invite(struct
+ transmit_response(p, "180 Ringing", req);
+ break;
+ case AST_STATE_UP:
++ /* Assuming this to be reinvite, process new SDP portion */
++ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
++ process_sdp(p, req);
++ } else {
++ p->jointcapability = p->capability;
++ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
++ }
+ transmit_response_with_sdp(p, "200 OK", req, 1);
+ break;
+ default:
diff --git a/net/asterisk/files/patch-channels::chan_zap.c b/net/asterisk/files/patch-channels::chan_zap.c
index 458a6147..ab02c02 100644
--- a/net/asterisk/files/patch-channels::chan_zap.c
+++ b/net/asterisk/files/patch-channels::chan_zap.c
@@ -1,85 +1,65 @@
$FreeBSD$
---- channels/chan_zap.c.orig Sun Feb 17 18:01:44 2002
-+++ channels/chan_zap.c Sun Feb 17 18:03:26 2002
-@@ -46,7 +46,9 @@
- #include <sys/signal.h>
- #include <errno.h>
- #include <stdlib.h>
-+#ifndef __FreeBSD__
- #include <stdint.h>
-+#endif
- #include <unistd.h>
- #include <sys/ioctl.h>
- #ifdef __linux__
-@@ -320,7 +322,7 @@
- #define CALLWAITING_REPEAT_SAMPLES ( (10000 * 8) / READ_SIZE) /* 300 ms */
- #define CIDCW_EXPIRE_SAMPLES ( (500 * 8) / READ_SIZE) /* 500 ms */
- #define MIN_MS_SINCE_FLASH ( (2000) ) /* 2000 ms */
--#define RINGT ( (8000 * 8) / READ_SIZE)
-+#define RINGT ( (8000 * 8) / READ_SIZE) /* 8000 ms */
-
- struct zt_pvt;
-
-@@ -535,6 +537,7 @@
- int cidpos;
+--- channels/chan_zap.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_zap.c Fri Jan 13 13:28:33 2006
+@@ -638,6 +638,7 @@ static struct zt_pvt {
int cidlen;
int ringt;
+ int ringt_base;
+ int waitnorings;
int stripmsd;
- int callwaiting;
int callwaitcas;
-@@ -2134,12 +2137,20 @@
-
- if (option_debug)
- ast_log(LOG_DEBUG, "zt_hangup(%s)\n", ast->name);
-+
- if (!ast->pvt->pvt) {
- ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
- return 0;
+ int callwaitrings;
+@@ -2308,6 +2309,19 @@ static int zt_hangup(struct ast_channel
}
ast_mutex_lock(&p->lock);
++ switch (p->sig) {
++ case SIG_FXSGS:
++ case SIG_FXSKS:
++ case SIG_FXSLS:
++ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
++ {
++ p->waitnorings = 1;
++ }
++ break;
++ default:
++ break;
++ };
+
-+
-+ if((p->sig == SIG_FXSGS) || (p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS))
-+ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
-+ {
-+ p->waitnorings = 1;
-+ }
index = zt_get_index(ast, p, 1);
-@@ -5717,7 +5728,37 @@
+@@ -6129,7 +6143,37 @@ static void *ss_thread(void *data)
ast_setstate(chan, AST_STATE_RING);
chan->rings = 1;
- p->ringt = RINGT;
+ p->ringt = p->ringt_base;
+ p->waitnorings = 0;
res = ast_pbx_run(chan);
+
+ if(p->waitnorings)
+ {
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+ for(;;)
+ {
+ int i,j=0;
+ i = ZT_IOMUX_SIGEVENT | ZT_IOMUX_NOWAIT;
-+ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
++ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
+ break;
-+
-+ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
++
++ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
+ break;
-+
++
+ if(j == ZT_EVENT_RINGOFFHOOK)
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+
+ usleep(20000);
+
+ if (p->ringt <= 0)
+ break;
+
-+ else if (p->ringt > 0)
++ else if (p->ringt > 0)
+ p->ringt--;
+ }
+ p->ringt = 0;
@@ -89,7 +69,7 @@ $FreeBSD$
if (res) {
ast_hangup(chan);
ast_log(LOG_WARNING, "PBX exited non-zero\n");
-@@ -6018,7 +6059,7 @@
+@@ -6431,7 +6475,7 @@ static void *do_monitor(void *data)
i = iflist;
while(i) {
if ((i->subs[SUB_REAL].zfd > -1) && i->sig && (!i->radio)) {
diff --git a/net/asterisk/files/patch-channels::h323::Makefile b/net/asterisk/files/patch-channels::h323::Makefile
deleted file mode 100644
index 779096b..0000000
--- a/net/asterisk/files/patch-channels::h323::Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-
-$FreeBSD$
-
---- channels/h323/Makefile.orig
-+++ channels/h323/Makefile
-@@ -53,7 +53,7 @@
- LIBS+=-lpthread
- endif
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS += -pthread
-+CFLAGS += $(PTHREAD_LIBS)
- endif
- CFLAGS += -D_REENTRANT -D_GNU_SOURCE
- CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
-@@ -77,20 +77,20 @@
- ar cr libchanh323.a ast_h323.o
-
- ast_h323.o: ast_h323.cpp
-- $(CXX) -g -c -fno-rtti -o $@ $(CFLAGS) $<
-+ $(CXX) $(CXXFLAGS) -c -fno-rtti -o $@ $(CFLAGS) $<
-
- ifneq ($(wildcard .depend),)
- include .depend
- endif
-
- chan_h323.so:
-- $(CXX) -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_d.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_s.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
- clean:
- rm -f *.o *.so core.* libchanh323.a .depend
-
diff --git a/net/asterisk/files/patch-channels::h323::ast_h323.cpp b/net/asterisk/files/patch-channels::h323::ast_h323.cpp
new file mode 100644
index 0000000..feb79e5
--- /dev/null
+++ b/net/asterisk/files/patch-channels::h323::ast_h323.cpp
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.cpp.orig Thu Jan 12 18:16:08 2006
++++ channels/h323/ast_h323.cpp Thu Jan 12 18:16:35 2006
+@@ -953,8 +953,8 @@ BOOL MyH323Connection::OnReceivedCapabil
+ H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capability & capability,
+ H323Channel::Directions dir,
+ unsigned sessionID,
+- const H245_H2250LogicalChannelParameters * /*param*/,
+- RTP_QOS * /*param*/ )
++ const H245_H2250LogicalChannelParameters * /*param*/ /*,
++ RTP_QOS * */ /*param*/ )
+ {
+ return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID);
+ }
diff --git a/net/asterisk/files/patch-channels::h323::ast_h323.h b/net/asterisk/files/patch-channels::h323::ast_h323.h
new file mode 100644
index 0000000..606bb01
--- /dev/null
+++ b/net/asterisk/files/patch-channels::h323::ast_h323.h
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.h.orig Thu Jan 12 18:14:49 2006
++++ channels/h323/ast_h323.h Thu Jan 12 18:15:02 2006
+@@ -155,8 +155,8 @@ class MyH323Connection : public H323Conn
+ H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
+ H323Channel::Directions,
+ unsigned,
+- const H245_H2250LogicalChannelParameters *,
+- RTP_QOS *);
++ const H245_H2250LogicalChannelParameters * /* ,
++ RTP_QOS * */);
+ H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
+ const H323SignalPDU &,
+ H323SignalPDU &);
diff --git a/net/asterisk/files/patch-codecs::Makefile b/net/asterisk/files/patch-codecs::Makefile
index 325e590..ab5cbc4 100644
--- a/net/asterisk/files/patch-codecs::Makefile
+++ b/net/asterisk/files/patch-codecs::Makefile
@@ -1,39 +1,48 @@
---- codecs/Makefile.orig Thu Mar 17 20:43:51 2005
-+++ codecs/Makefile Thu Apr 14 00:09:04 2005
-@@ -17,25 +17,23 @@
- # g723.1b)
- #
- #MODG723=codec_g723_1.so codec_g723_1b.so
--MODG723=$(shell [ -f g723.1/coder.c ] && echo "codec_g723_1.so")
--MODG723+=$(shell [ -f g723.1b/coder2.c ] && echo "codec_g723_1b.so")
--MODSPEEX=$(shell [ -f /usr/include/speex.h ] || [ -f /usr/include/speex/speex.h ] || [ -f /usr/local/include/speex.h ] || [ -f /usr/local/include/speex/speex.h ] && echo "codec_speex.so")
--MODILBC=$(shell [ -f ilbc/iLBC_decode.h ] && echo "codec_ilbc.so")
-+MODG723=codec_g723_1_dummy.so
-+MODG729=codec_g729_dummy.so
-+MODSPEEX=codec_speex.so
-+MODILBC=codec_ilbc.so
- CFLAGS+=-fPIC
--CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include")
--CFLAGS+=$(shell [ -f /usr/local/include/speex/speex.h ] && echo "-I/usr/local/include/speex")
--CFLAGS+=$(shell [ -f /usr/include/speex/speex.h ] && echo "-I/usr/include/speex")
-+CFLAGS+=-I$(LOCALBASE)/include
+
+$FreeBSD$
+
+--- codecs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ codecs/Makefile Fri Jan 13 10:33:21 2006
+@@ -30,8 +30,8 @@
- LIBG723=g723.1/libg723.a
- LIBG723B=g723.1b/libg723b.a
- LIBGSM=gsm/lib/libgsm.a
- LIBGSMT=gsm/lib/libgsm.a
+ UI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex.h)
+ UIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex/speex.h)
+-ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex.h)
+-ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex/speex.h)
++ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex.h)
++ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex/speex.h)
+ ifneq (${UI_SPEEX},)
+ MODSPEEX=codec_speex.so
+ LIBSPEEX+=-lspeex -lm
+@@ -43,14 +43,14 @@
+ endif
+ ifneq (${ULI_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+ ifneq (${ULIS_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/speex
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+
+@@ -65,7 +65,7 @@
LIBLPC10=lpc10/liblpc10.a
--LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
-+LIBSPEEX=-L$(LOCALBASE)/lib
- LIBSPEEX+=-lspeex -lm
- LIBILBC=ilbc/libilbc.a
--CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
-+CODECS+=$(MODG723) $(MODG729) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
- codec_adpcm.so codec_ulaw.so codec_alaw.so codec_a_mu.so \
- codec_g726.so
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
-@@ -93,7 +91,7 @@
+ CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
+@@ -126,7 +126,7 @@
endif
install: all
diff --git a/net/asterisk/files/patch-codecs::codec_g723_1_dummy.c b/net/asterisk/files/patch-codecs::codec_g723_1_dummy.c
deleted file mode 100644
index 3ce9571..0000000
--- a/net/asterisk/files/patch-codecs::codec_g723_1_dummy.c
+++ /dev/null
@@ -1,314 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g723_1_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g723_1_dummy.c Sun Oct 10 16:07:05 2004
-@@ -0,0 +1,308 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.723.1 (dummy!)
-+ *
-+ * The G.723.1 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#define TYPE_HIGH 0x0
-+#define TYPE_LOW 0x1
-+#define TYPE_SILENCE 0x2
-+#define TYPE_DONTSEND 0x3
-+#define TYPE_MASK 0x3
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g723_ex.h"
-+#include "g723_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.723.1/PCM16 Codec Translator";
-+
-+struct g723_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g723_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g723tolin_new()
-+{
-+ struct g723_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog723_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g723_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g723_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g723_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g723tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G723_1;
-+ f.datalen = sizeof(g723_slin_ex);
-+ /* All frames are 30 ms long */
-+ f.samples = 30;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g723_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog723_new()
-+{
-+ struct g723_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g723tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g723_len(unsigned char buf)
-+{
-+ switch(buf & TYPE_MASK) {
-+ case TYPE_DONTSEND:
-+ return 2;
-+ break;
-+ case TYPE_SILENCE:
-+ return 4;
-+ break;
-+ case TYPE_HIGH:
-+ return 24;
-+ break;
-+ case TYPE_LOW:
-+ return 20;
-+ break;
-+ default:
-+ ast_log(LOG_WARNING, "Badly encoded frame (%d)\n", buf & TYPE_MASK);
-+ }
-+ return -1;
-+}
-+
-+static int g723tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ int len = 0;
-+ int res;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ res = g723_len(((unsigned char *)f->data + len)[0]);
-+ if (res < 0) {
-+ ast_log(LOG_WARNING, "Invalid data\n");
-+ return -1;
-+ }
-+ if (res + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 480 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 480);
-+ tmp->tail+=480;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += res;
-+ }
-+ return 0;
-+}
-+
-+static int lintog723_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog723_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 480)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G723_1;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 480) {
-+ /* Encode a frame of data */
-+ if (cnt + 24 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 24);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 30;
-+ cnt += 24;
-+ tmp->tail -= 480;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 480, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g723_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g723tolin =
-+ { "g723tolin_dummy",
-+ AST_FORMAT_G723_1, AST_FORMAT_SLINEAR,
-+ g723tolin_new,
-+ g723tolin_framein,
-+ g723tolin_frameout,
-+ g723_destroy,
-+ g723tolin_sample
-+ };
-+
-+static struct ast_translator lintog723 =
-+ { "lintog723_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G723_1,
-+ lintog723_new,
-+ lintog723_framein,
-+ lintog723_frameout,
-+ g723_destroy,
-+ lintog723_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog723);
-+ if (!res)
-+ res = ast_unregister_translator(&g723tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g723tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog723);
-+ else
-+ ast_unregister_translator(&g723tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk/files/patch-codecs::codec_g729_dummy.c b/net/asterisk/files/patch-codecs::codec_g729_dummy.c
deleted file mode 100644
index 9fcc7b1..0000000
--- a/net/asterisk/files/patch-codecs::codec_g729_dummy.c
+++ /dev/null
@@ -1,281 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g729_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g729_dummy.c Sun Oct 10 16:07:12 2004
-@@ -0,0 +1,275 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.729 (dummy!)
-+ *
-+ * The G.729 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g729_ex.h"
-+#include "g729_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.729/PCM16 Codec Translator";
-+
-+struct g729_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g729_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g729tolin_new()
-+{
-+ struct g729_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog729_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g729_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g729_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g729_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g729tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G729A;
-+ f.datalen = sizeof(g729_slin_ex);
-+ /* All frames are 10 ms long */
-+ f.samples = 10;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g729_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog729_new()
-+{
-+ struct g729_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g729tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g729tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ int len = 0;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ if (10 + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 160 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 160);
-+ tmp->tail+=160;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += 10;
-+ }
-+ return 0;
-+}
-+
-+static int lintog729_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog729_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 160)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G729A;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 160) {
-+ /* Encode a frame of data */
-+ if (cnt + 10 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 10);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 10;
-+ cnt += 10;
-+ tmp->tail -= 160;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 160, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g729_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g729tolin =
-+ { "g729tolin_dummy",
-+ AST_FORMAT_G729A, AST_FORMAT_SLINEAR,
-+ g729tolin_new,
-+ g729tolin_framein,
-+ g729tolin_frameout,
-+ g729_destroy,
-+ g729tolin_sample
-+ };
-+
-+static struct ast_translator lintog729 =
-+ { "lintog729_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G729A,
-+ lintog729_new,
-+ lintog729_framein,
-+ lintog729_frameout,
-+ g729_destroy,
-+ lintog729_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog729);
-+ if (!res)
-+ res = ast_unregister_translator(&g729tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g729tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog729);
-+ else
-+ ast_unregister_translator(&g729tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk/files/patch-codecs::g729_slin_ex.h b/net/asterisk/files/patch-codecs::g729_slin_ex.h
deleted file mode 100644
index 44e60f2..0000000
--- a/net/asterisk/files/patch-codecs::g729_slin_ex.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/g729_slin_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,14 @@
-+/*
-+ * g729_slin_ex.h --
-+ *
-+ * 8-bit G.729 data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Copyright (C) 2004, Maxim Sobolev <sobomax@FreeBSD.org>
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static unsigned char g729_slin_ex[] = {
-+120,82,175,64,0,250,219,0,7,214
-+};
diff --git a/net/asterisk/files/patch-codecs::ilbc::Makefile b/net/asterisk/files/patch-codecs::ilbc::Makefile
index 7770e07..26a2f20 100644
--- a/net/asterisk/files/patch-codecs::ilbc::Makefile
+++ b/net/asterisk/files/patch-codecs::ilbc::Makefile
@@ -1,11 +1,12 @@
$FreeBSD$
---- codecs/ilbc/Makefile.orig Sun Apr 27 21:13:11 2003
-+++ codecs/ilbc/Makefile Fri Jan 30 01:47:34 2004
-@@ -1,4 +1,4 @@
--CFLAGS+= -fPIC -O3
-+CFLAGS+= -fPIC
- LIB=libilbc.a
-
- OBJS= anaFilter.o iCBSearch.o packing.o \
+--- codecs/ilbc/Makefile.orig Fri Jan 13 11:01:07 2006
++++ codecs/ilbc/Makefile Fri Jan 13 11:01:51 2006
+@@ -1,5 +1,5 @@
+ ARCH=$(PROC)
+-CFLAGS+=-Wall -O3 -funroll-loops
++CFLAGS+=-Wall -funroll-loops
+ ifneq (${OSARCH},CYGWIN)
+ CFLAGS += -fPIC
+ endif
diff --git a/net/asterisk/files/patch-codecs::slin_g729_ex.h b/net/asterisk/files/patch-codecs::slin_g729_ex.h
deleted file mode 100644
index e1236d2..0000000
--- a/net/asterisk/files/patch-codecs::slin_g729_ex.h
+++ /dev/null
@@ -1,31 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/slin_g729_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,25 @@
-+/*
-+ * slin_g729_ex.h --
-+ *
-+ * Signed 16-bit audio data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Source: g723.example
-+ *
-+ * Copyright (C) 2001, Linux Support Services, Inc.
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static signed short slin_g729_ex[] = {
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-+};
diff --git a/net/asterisk/files/patch-configs::musiconhold.conf.sample b/net/asterisk/files/patch-configs::musiconhold.conf.sample
new file mode 100644
index 0000000..ff63cc9
--- /dev/null
+++ b/net/asterisk/files/patch-configs::musiconhold.conf.sample
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- configs/musiconhold.conf.sample.orig Tue Nov 29 20:24:39 2005
++++ configs/musiconhold.conf.sample Fri Jan 13 11:38:39 2006
+@@ -4,7 +4,7 @@
+
+ [default]
+ mode=quietmp3
+-directory=/var/lib/asterisk/mohmp3
++directory=/usr/local/share/asterisk/mohmp3
+
+ ; valid mode options:
+ ; quietmp3 -- default
diff --git a/net/asterisk/files/patch-db.c b/net/asterisk/files/patch-db.c
index 6c2bdcd..ba7f3f2 100644
--- a/net/asterisk/files/patch-db.c
+++ b/net/asterisk/files/patch-db.c
@@ -1,14 +1,21 @@
$FreeBSD$
---- db.c.orig Fri Jul 9 13:08:09 2004
-+++ db.c Sun Oct 10 15:32:33 2004
-@@ -33,7 +33,7 @@
- #include <asterisk/cli.h>
- #include <asterisk/utils.h>
- #include <asterisk/lock.h>
--#include "db1-ast/include/db.h"
+--- db.c.orig Fri Jan 13 11:05:32 2006
++++ db.c Fri Jan 13 11:06:55 2006
+@@ -35,6 +35,7 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <dirent.h>
+#include <db.h>
+
#include "asterisk.h"
- #include "astconf.h"
+@@ -51,7 +52,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
+ #include "asterisk/utils.h"
+ #include "asterisk/lock.h"
+ #include "asterisk/manager.h"
+-#include "db1-ast/include/db.h"
+
+ #ifdef __CYGWIN__
+ #define dbopen __dbopen
diff --git a/net/asterisk/files/patch-formats::Makefile b/net/asterisk/files/patch-formats::Makefile
index dacfd7b..b2b1db5 100644
--- a/net/asterisk/files/patch-formats::Makefile
+++ b/net/asterisk/files/patch-formats::Makefile
@@ -1,19 +1,19 @@
$FreeBSD$
---- formats/Makefile.orig Tue Nov 4 04:40:09 2003
-+++ formats/Makefile Fri Jan 30 01:47:34 2004
-@@ -18,7 +18,7 @@
+--- formats/Makefile.orig Fri Jan 13 11:16:07 2006
++++ formats/Makefile Fri Jan 13 11:47:25 2006
+@@ -20,7 +20,7 @@
#
- # G723 simple frame is depricated
+ # G723 simple frame is deprecated
#
--#FORMAT_LIBS+=format_g723.so
+-FORMAT_LIBS+=format_g723.so
+FORMAT_LIBS+=format_g723_1.so
- GSMLIB=../codecs/gsm/lib/libgsm.a
-
-@@ -40,7 +40,7 @@
- $(CC) $(SOLINK) -o $@ $< -lm
+ #
+ # OGG/Vorbis format
+@@ -60,7 +60,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -logg -lvorbis -lvorbisenc -lm
install: all
- for x in $(FORMAT_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
diff --git a/net/asterisk/files/patch-formats::format_g723_1.c b/net/asterisk/files/patch-formats::format_g723_1.c
index fb5eb12..ae814f1 100644
--- a/net/asterisk/files/patch-formats::format_g723_1.c
+++ b/net/asterisk/files/patch-formats::format_g723_1.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- formats/format_g723_1.c.orig Sun Oct 10 15:59:18 2004
-+++ formats/format_g723_1.c Sun Oct 10 16:05:05 2004
-@@ -0,0 +1,345 @@
+--- /dev/null Fri Jan 13 12:18:51 2006
++++ formats/format_g723_1.c Fri Jan 13 12:18:41 2006
+@@ -0,0 +1,348 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -16,6 +16,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/channel.h>
+#include <asterisk/file.h>
@@ -26,7 +27,6 @@ $FreeBSD$
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <sys/time.h>
-+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
@@ -48,7 +48,7 @@ $FreeBSD$
+struct ast_filestream {
+ void *reserved[AST_RESERVED_POINTERS];
+ /* This is what a filestream means to us */
-+ int fd; /* Descriptor */
++ FILE *f; /* Descriptor */
+ struct ast_frame fr; /* Frame information */
+ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
+ char empty; /* Empty character */
@@ -85,7 +85,7 @@ $FreeBSD$
+ return -1;
+}
+
-+static struct ast_filestream *g723_open(int fd)
++static struct ast_filestream *g723_open(FILE *f)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -98,7 +98,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ tmp->fr.data = tmp->g723;
+ tmp->fr.frametype = AST_FRAME_VOICE;
+ tmp->fr.subclass = AST_FORMAT_G723_1;
@@ -112,7 +112,7 @@ $FreeBSD$
+ return tmp;
+}
+
-+static struct ast_filestream *g723_rewrite(int fd, char *comment)
++static struct ast_filestream *g723_rewrite(FILE *f, const char *comment)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -125,7 +125,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ glistcnt++;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
@@ -143,7 +143,7 @@ $FreeBSD$
+ glistcnt--;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
-+ close(s->fd);
++ fclose(s->f);
+ free(s);
+ s = NULL;
+}
@@ -158,7 +158,7 @@ $FreeBSD$
+ s->fr.samples = 240;
+ s->fr.mallocd = 0;
+ s->fr.data = s->g723;
-+ if ((res = read(s->fd, s->g723, 1)) != 1) {
++ if ((res = fread(s->g723, 1, 1, s->f)) != 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -168,7 +168,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 frame!\n");
+ return NULL;
+ }
-+ if (s->fr.datalen > 1 && (res = read(s->fd, s->g723 + 1, s->fr.datalen - 1)) != s->fr.datalen - 1) {
++ if (s->fr.datalen > 1 && (res = fread(s->g723 + 1, 1, s->fr.datalen - 1, s->f)) != s->fr.datalen - 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -200,7 +200,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 data length, %d\n", f->datalen);
+ return -1;
+ }
-+ if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
++ if ((res = fwrite(f->data, 1, f->datalen, fs->f)) != f->datalen) {
+ ast_log(LOG_WARNING, "Bad write %d: %s\n", res, strerror(errno));
+ return -1;
+ }
@@ -229,10 +229,13 @@ $FreeBSD$
+ }
+ offset = cur + sample_offset;
+ }
-+ if ((moffset = lseek(fs->fd, 0, SEEK_END)) == -1) {
++ if (fseeko(fs->f, 0, SEEK_END) == -1) {
+ ast_log(LOG_WARNING, "Can't seek stream to an end!\n");
+ return -1;
+ }
++ else {
++ moffset = ftello(fs->f);
++ }
+ if (whence == SEEK_END) {
+ if ((max = g723_tell(fs)) == -1) {
+ ast_log(LOG_WARNING, "Can't get maximum position!\n");
@@ -244,11 +247,11 @@ $FreeBSD$
+ offset = 0;
+ soffset = -1;
+ for (coffset = 0; coffset < moffset && offset > 0; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %lli!\n", coffset);
+ return -1;
+ }
@@ -260,7 +263,7 @@ $FreeBSD$
+ if (res > 1)
+ offset -= 240;
+ }
-+ if (soffset != -1 && lseek(fs->fd, soffset, SEEK_SET) != soffset) {
++ if (soffset != -1 && fseeko(fs->f, soffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", soffset);
+ return -1;
+ }
@@ -271,7 +274,7 @@ $FreeBSD$
+static int g723_trunc(struct ast_filestream *fs)
+{
+ /* Truncate file to current length */
-+ if (ftruncate(fs->fd, lseek(fs->fd, 0, SEEK_CUR)) < 0)
++ if (ftruncate(fileno(fs->f), ftello(fs->f)) < 0)
+ return -1;
+ return 0;
+}
@@ -283,14 +286,14 @@ $FreeBSD$
+ long rval;
+ unsigned char c;
+
-+ offset = lseek(fs->fd, 0, SEEK_CUR);
++ offset = ftello(fs->f);
+ rval = 0;
+ for (coffset = 0; coffset < offset; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %llu!\n", coffset);
+ return -1;
+ }
@@ -301,7 +304,7 @@ $FreeBSD$
+ if (res > 1)
+ rval += 240;
+ }
-+ if (lseek(fs->fd, offset, SEEK_SET) != offset) {
++ if (fseeko(fs->f, offset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", offset);
+ return -1;
+ }
diff --git a/net/asterisk/files/patch-formats::format_g729.c b/net/asterisk/files/patch-formats::format_g729.c
index 78899a3..11be528 100644
--- a/net/asterisk/files/patch-formats::format_g729.c
+++ b/net/asterisk/files/patch-formats::format_g729.c
@@ -1,6 +1,9 @@
---- formats/format_g729.c.orig Mon Feb 7 10:29:19 2005
-+++ formats/format_g729.c Wed Mar 9 06:26:36 2005
-@@ -44,7 +44,7 @@
+
+$FreeBSD$
+
+--- formats/format_g729.c.orig Fri Jan 13 12:20:53 2006
++++ formats/format_g729.c Fri Jan 13 12:23:33 2006
+@@ -60,7 +60,7 @@ struct ast_filestream {
struct ast_frame fr; /* Frame information */
char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
char empty; /* Empty character */
@@ -9,7 +12,7 @@
};
-@@ -125,11 +125,11 @@
+@@ -141,11 +141,11 @@ static struct ast_frame *g729_read(struc
s->fr.frametype = AST_FRAME_VOICE;
s->fr.subclass = AST_FORMAT_G729A;
s->fr.offset = AST_FRIENDLY_OFFSET;
@@ -19,24 +22,24 @@
+ s->fr.datalen = 10;
s->fr.mallocd = 0;
s->fr.data = s->g729;
-- if ((res = read(s->fd, s->g729, 20)) != 20) {
-+ if ((res = read(s->fd, s->g729, 10)) != 10) {
+- if ((res = fread(s->g729, 1, 20, s->f)) != 20) {
++ if ((res = fread(s->g729, 1, 10, s->f)) != 10) {
if (res && (res != 10))
ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
return NULL;
-@@ -173,7 +173,7 @@
- cur = lseek(fs->fd, 0, SEEK_CUR);
- max = lseek(fs->fd, 0, SEEK_END);
+@@ -190,7 +190,7 @@ static int g729_seek(struct ast_filestre
+ fseek(fs->f, 0, SEEK_END);
+ max = ftell(fs->f);
- bytes = 20 * (sample_offset / 160);
+ bytes = 10 * (sample_offset / 80);
if (whence == SEEK_SET)
offset = bytes;
else if (whence == SEEK_CUR || whence == SEEK_FORCECUR)
-@@ -202,7 +202,7 @@
+@@ -219,7 +219,7 @@ static long g729_tell(struct ast_filestr
{
off_t offset;
- offset = lseek(fs->fd, 0, SEEK_CUR);
+ offset = ftell(fs->f);
- return (offset/20)*160;
+ return (offset/10)*80;
}
diff --git a/net/asterisk/files/patch-funcs::Makefile b/net/asterisk/files/patch-funcs::Makefile
new file mode 100644
index 0000000..a14daee
--- /dev/null
+++ b/net/asterisk/files/patch-funcs::Makefile
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- funcs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ funcs/Makefile Fri Jan 13 12:36:57 2006
+@@ -67,7 +67,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
+
+ install: all
+- for x in $(FUNCS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
++ for x in $(FUNCS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
+
+ ifneq ($(wildcard .depend),)
+ include .depend
diff --git a/net/asterisk/files/patch-pbx::Makefile b/net/asterisk/files/patch-pbx::Makefile
index dca6672..97d03e1 100644
--- a/net/asterisk/files/patch-pbx::Makefile
+++ b/net/asterisk/files/patch-pbx::Makefile
@@ -1,18 +1,20 @@
$FreeBSD$
---- pbx/Makefile.orig Sun Oct 26 20:50:49 2003
-+++ pbx/Makefile Fri Jan 30 01:47:34 2004
-@@ -16,7 +16,7 @@
- PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so # pbx_gtkconsole.so pbx_kdeconsole.so
-
- # Add GTK console if appropriate
--PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
-+#PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
+--- pbx/Makefile.orig
++++ pbx/Makefile
+@@ -23,8 +23,8 @@
# Add KDE Console if appropriate
#PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so")
-@@ -62,7 +62,7 @@
+-GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
+-GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
++#GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
++#GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
+ MOC=$(QTDIR)/bin/moc
+ KDE_FLAGS=-I$(KDEDIR)/include -I$(KDEDIR)/include/kde -I$(QTDIR)/include
+ KDE_LIBS=-L$(KDEDIR)/lib -L$(QTDIR)/lib -lqt -lkdecore -lkdeui
+@@ -72,7 +72,7 @@
endif
install: all
diff --git a/net/asterisk/files/patch-pbx::pbx_wilcalu.c b/net/asterisk/files/patch-pbx::pbx_wilcalu.c
deleted file mode 100644
index 41722c6..0000000
--- a/net/asterisk/files/patch-pbx::pbx_wilcalu.c
+++ /dev/null
@@ -1,14 +0,0 @@
---- pbx/pbx_wilcalu.c.orig Tue Apr 26 10:00:28 2005
-+++ pbx/pbx_wilcalu.c Tue Apr 26 10:03:42 2005
-@@ -82,6 +82,11 @@
- fds[0].events = POLLIN;
- poll(fds, 1, -1);
- bytes=read(fd,buf,256);
-+ if (bytes <= 0) {
-+ /* XXX error on device, sleep a bit before retrying */
-+ sleep(1);
-+ continue;
-+ }
- buf[(int)bytes]=0;
-
- if(bytes>0){
diff --git a/net/asterisk/files/patch-res-res_watchdog.c b/net/asterisk/files/patch-res-res_watchdog.c
deleted file mode 100644
index 51e4b0a..0000000
--- a/net/asterisk/files/patch-res-res_watchdog.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- res/res_watchdog.c.orig Fri Jul 15 13:24:24 2005
-+++ res/res_watchdog.c Fri Jul 15 13:24:42 2005
-@@ -40,6 +40,10 @@
-
- /* Registrar for operations */
-
-+#ifndef O_SYNC
-+#define O_SYNC O_FSYNC
-+#endif
-+
- static struct watchdog_pvt *watchdogs = NULL;
-
- STANDARD_LOCAL_USER;
diff --git a/net/asterisk/files/patch-res::Makefile b/net/asterisk/files/patch-res::Makefile
index 3e48e84..de5c365 100644
--- a/net/asterisk/files/patch-res::Makefile
+++ b/net/asterisk/files/patch-res::Makefile
@@ -1,33 +1,35 @@
---- res/Makefile.orig Tue Aug 9 17:18:55 2005
-+++ res/Makefile Tue Aug 9 17:33:36 2005
-@@ -13,15 +13,18 @@
+
+$FreeBSD$
+
+--- res/Makefile
++++ res/Makefile
+@@ -37,8 +37,8 @@
+ endif
- MODS=res_adsi.so res_features.so res_crypto.so res_musiconhold.so res_indications.so res_monitor.so \
- res_agi.so res_watchdog.so
--MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
--MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/include/osp/osp.h" ]; then echo "res_osp.so"; fi)
-
- CRYPTO_LIBS=-lssl -lcrypto
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ ifeq (${OSARCH},CYGWIN)
+@@ -55,9 +55,7 @@
CFLAGS+=
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH")
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPATA_MOH
-+endif
- #
- # Work around buggy RedHat 9.0
+
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
+ CFLAGS+=-DZAPATA_MOH
+-endif
+ endif # WITHOUT_ZAPTEL
+
#
-@@ -34,7 +37,7 @@
+@@ -75,7 +73,7 @@
rm -f $(DESTDIR)$(ASTHEADERDIR)/parking.h
rm -f $(DESTDIR)$(MODULES_DIR)/app_agi.so
rm -f $(DESTDIR)$(MODULES_DIR)/res_parking.so
- for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(MODS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- res_crypto.so: res_crypto.o
- $(CC) $(SOLINK) -o $@ $< $(CRYPTO_LIBS)
+ @if [ x`which mpg123 2>/dev/null | grep -v '^no'` != x ] ; then \
+ if mpg123 --longhelp 2>&1 | grep -q .59r 2>&1 >/dev/null ; then echo ; else \
+ echo "*************************************************************";\
diff --git a/net/asterisk/files/patch-rtp.c b/net/asterisk/files/patch-rtp.c
index c652add..bbc2649 100644
--- a/net/asterisk/files/patch-rtp.c
+++ b/net/asterisk/files/patch-rtp.c
@@ -1,23 +1,17 @@
---- rtp.c.orig Tue Apr 26 10:00:28 2005
-+++ rtp.c Tue Apr 26 10:06:35 2005
-@@ -127,7 +127,7 @@
- {
- switch(buf & TYPE_MASK) {
- case TYPE_DONTSEND:
-- return 0;
-+ return 2;
- break;
- case TYPE_SILENCE:
- return 4;
-@@ -862,8 +858,10 @@
- /* Must be an even port number by RTP spec */
+
+$FreeBSD$
+
+--- rtp.c.orig Fri Jan 13 13:38:01 2006
++++ rtp.c Fri Jan 13 13:40:50 2006
+@@ -950,8 +950,10 @@ struct ast_rtp *ast_rtp_new_with_bindadd
rtp->us.sin_port = htons(x);
rtp->us.sin_addr = addr;
+ /* If there's rtcp, initialize it as well. */
- if (rtp->rtcp)
+ if (rtp->rtcp) {
rtp->rtcp->us.sin_port = htons(x + 1);
+ rtp->rtcp->us.sin_addr = addr;
+ }
+ /* Try to bind it/them. */
if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) &&
(!rtp->rtcp || !bind(rtp->rtcp->s, (struct sockaddr *)&rtp->rtcp->us, sizeof(rtp->rtcp->us))))
- break;
diff --git a/net/asterisk/files/patch-utils::Makefile b/net/asterisk/files/patch-utils::Makefile
new file mode 100644
index 0000000..f3164c0
--- /dev/null
+++ b/net/asterisk/files/patch-utils::Makefile
@@ -0,0 +1,34 @@
+
+$FreeBSD$
+
+--- utils/Makefile
++++ utils/Makefile
+@@ -17,16 +17,16 @@
+ CFLAGS+=-DNO_AST_MM
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+ TARGET=stereorize streamplayer
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/popt.h),)
+ TARGET+=smsq
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/newt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/newt.h),)
+ TARGET+=astman
+ endif
+
+@@ -40,7 +40,7 @@
+ install:
+ for x in $(TARGET); do \
+ if [ "$$x" != "none" ]; then \
+- $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
++ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
+ fi; \
+ done
+
diff --git a/net/asterisk/pkg-plist b/net/asterisk/pkg-plist
index 019b270..702370a 100644
--- a/net/asterisk/pkg-plist
+++ b/net/asterisk/pkg-plist
@@ -19,6 +19,12 @@ etc/asterisk/asterisk.adsi-dist
@unexec if cmp -s %D/etc/asterisk/asterisk.conf %D/etc/asterisk/asterisk.conf-dist; then rm -f %D/etc/asterisk/asterisk.conf; fi
etc/asterisk/asterisk.conf-dist
@exec [ -f %B/asterisk.conf ] || cp %B/%f %B/asterisk.conf
+@unexec if cmp -s %D/etc/asterisk/cdr.conf %D/etc/asterisk/cdr.conf-dist; then rm -f %D/etc/asterisk/cdr.conf; fi
+etc/asterisk/cdr.conf-dist
+@exec [ -f %B/cdr.conf ] || cp %B/%f %B/cdr.conf
+@unexec if cmp -s %D/etc/asterisk/cdr_custom.conf %D/etc/asterisk/cdr_custom.conf-dist; then rm -f %D/etc/asterisk/cdr_custom.conf; fi
+etc/asterisk/cdr_custom.conf-dist
+@exec [ -f %B/cdr_custom.conf ] || cp %B/%f %B/cdr_custom.conf
@unexec if cmp -s %D/etc/asterisk/cdr_manager.conf %D/etc/asterisk/cdr_manager.conf-dist; then rm -f %D/etc/asterisk/cdr_manager.conf; fi
etc/asterisk/cdr_manager.conf-dist
@exec [ -f %B/cdr_manager.conf ] || cp %B/%f %B/cdr_manager.conf
@@ -31,9 +37,21 @@ etc/asterisk/cdr_pgsql.conf-dist
@unexec if cmp -s %D/etc/asterisk/cdr_tds.conf %D/etc/asterisk/cdr_tds.conf-dist; then rm -f %D/etc/asterisk/cdr_tds.conf; fi
etc/asterisk/cdr_tds.conf-dist
@exec [ -f %B/cdr_tds.conf ] || cp %B/%f %B/cdr_tds.conf
+@unexec if cmp -s %D/etc/asterisk/codecs.conf %D/etc/asterisk/codecs.conf-dist; then rm -f %D/etc/asterisk/codecs.conf; fi
+etc/asterisk/codecs.conf-dist
+@exec [ -f %B/codecs.conf ] || cp %B/%f %B/codecs.conf
+@unexec if cmp -s %D/etc/asterisk/dnsmgr.conf %D/etc/asterisk/dnsmgr.conf-dist; then rm -f %D/etc/asterisk/dnsmgr.conf; fi
+etc/asterisk/dnsmgr.conf-dist
+@exec [ -f %B/dnsmgr.conf ] || cp %B/%f %B/dmsmgr.conf
+@unexec if cmp -s %D/etc/asterisk/dundi.conf %D/etc/asterisk/dundi.conf-dist; then rm -f %D/etc/asterisk/dundi.conf; fi
+etc/asterisk/dundi.conf-dist
+@exec [ -f %B/dundi.conf ] || cp %B/%f %B/dundi.conf
@unexec if cmp -s %D/etc/asterisk/enum.conf %D/etc/asterisk/enum.conf-dist; then rm -f %D/etc/asterisk/enum.conf; fi
etc/asterisk/enum.conf-dist
@exec [ -f %B/enum.conf ] || cp %B/%f %B/enum.conf
+@unexec if cmp -s %D/etc/asterisk/extensions.ael %D/etc/asterisk/extensions.ael-dist; then rm -f %D/etc/asterisk/extensions.ael; fi
+etc/asterisk/extensions.ael-dist
+@exec [ -f %B/extensions.ael ] || cp %B/%f %B/extensions.ael
@unexec if cmp -s %D/etc/asterisk/extconfig.conf %D/etc/asterisk/extconfig.conf-dist; then rm -f %D/etc/asterisk/extconfig.conf; fi
etc/asterisk/extconfig.conf-dist
@exec [ -f %B/extconfig.conf ] || cp %B/%f %B/extconfig.conf
@@ -46,9 +64,6 @@ etc/asterisk/features.conf-dist
@unexec if cmp -s %D/etc/asterisk/festival.conf %D/etc/asterisk/festival.conf-dist; then rm -f %D/etc/asterisk/festival.conf; fi
etc/asterisk/festival.conf-dist
@exec [ -f %B/festival.conf ] || cp %B/%f %B/festival.conf
-@unexec if cmp -s %D/etc/asterisk/h323.conf %D/etc/asterisk/h323.conf-dist; then rm -f %D/etc/asterisk/h323.conf; fi
-etc/asterisk/h323.conf-dist
-@exec [ -f %B/h323.conf ] || cp %B/%f %B/h323.conf
@unexec if cmp -s %D/etc/asterisk/iax.conf %D/etc/asterisk/iax.conf-dist; then rm -f %D/etc/asterisk/iax.conf; fi
etc/asterisk/iax.conf-dist
@exec [ -f %B/iax.conf ] || cp %B/%f %B/iax.conf
@@ -70,6 +85,9 @@ etc/asterisk/meetme.conf-dist
@unexec if cmp -s %D/etc/asterisk/mgcp.conf %D/etc/asterisk/mgcp.conf-dist; then rm -f %D/etc/asterisk/mgcp.conf; fi
etc/asterisk/mgcp.conf-dist
@exec [ -f %B/mgcp.conf ] || cp %B/%f %B/mgcp.conf
+@unexec if cmp -s %D/etc/asterisk/misdn.conf %D/etc/asterisk/misdn.conf-dist; then rm -f %D/etc/asterisk/misdn.conf; fi
+etc/asterisk/misdn.conf-dist
+@exec [ -f %B/misdn.conf ] || cp %B/%f %B/misdn.conf
@unexec if cmp -s %D/etc/asterisk/modem.conf %D/etc/asterisk/modem.conf-dist; then rm -f %D/etc/asterisk/modem.conf; fi
etc/asterisk/modem.conf-dist
@exec [ -f %B/modem.conf ] || cp %B/%f %B/modem.conf
@@ -94,9 +112,6 @@ etc/asterisk/privacy.conf-dist
@unexec if cmp -s %D/etc/asterisk/queues.conf %D/etc/asterisk/queues.conf-dist; then rm -f %D/etc/asterisk/queues.conf; fi
etc/asterisk/queues.conf-dist
@exec [ -f %B/queues.conf ] || cp %B/%f %B/queues.conf
-@unexec if cmp -s %D/etc/asterisk/res_config_odbc.conf %D/etc/asterisk/res_config_odbc.conf-dist; then rm -f %D/etc/asterisk/res_config_odbc.conf; fi
-etc/asterisk/res_config_odbc.conf-dist
-@exec [ -f %B/res_config_odbc.conf ] || cp %B/%f %B/res_config_odbc.conf
@unexec if cmp -s %D/etc/asterisk/res_odbc.conf %D/etc/asterisk/res_odbc.conf-dist; then rm -f %D/etc/asterisk/res_odbc.conf; fi
etc/asterisk/res_odbc.conf-dist
@exec [ -f %B/res_odbc.conf ] || cp %B/%f %B/res_odbc.conf
@@ -109,6 +124,9 @@ etc/asterisk/rtp.conf-dist
@unexec if cmp -s %D/etc/asterisk/sip.conf %D/etc/asterisk/sip.conf-dist; then rm -f %D/etc/asterisk/sip.conf; fi
etc/asterisk/sip.conf-dist
@exec [ -f %B/sip.conf ] || cp %B/%f %B/sip.conf
+@unexec if cmp -s %D/etc/asterisk/sip_notify.conf %D/etc/asterisk/sip_notify.conf-dist; then rm -f %D/etc/asterisk/sip_notify.conf; fi
+etc/asterisk/sip_notify.conf-dist
+@exec [ -f %B/sip_notify.conf ] || cp %B/%f %B/sip_notify.conf
@unexec if cmp -s %D/etc/asterisk/skinny.conf %D/etc/asterisk/skinny.conf-dist; then rm -f %D/etc/asterisk/skinny.conf; fi
etc/asterisk/skinny.conf-dist
@exec [ -f %B/skinny.conf ] || cp %B/%f %B/skinny.conf
@@ -121,9 +139,6 @@ etc/asterisk/voicemail.conf-dist
@unexec if cmp -s %D/etc/asterisk/vpb.conf %D/etc/asterisk/vpb.conf-dist; then rm -f %D/etc/asterisk/vpb.conf; fi
etc/asterisk/vpb.conf-dist
@exec [ -f %B/vpb.conf ] || cp %B/%f %B/vpb.conf
-@unexec if cmp -s %D/etc/asterisk/watchdog.conf %D/etc/asterisk/watchdog.conf-dist; then rm -f %D/etc/asterisk/watchdog.conf; fi
-etc/asterisk/watchdog.conf-dist
-@exec [ -f %B/watchdog.conf ] || cp %B/%f %B/watchdog.conf
@unexec if cmp -s %D/etc/asterisk/zapata.conf %D/etc/asterisk/zapata.conf-dist; then rm -f %D/etc/asterisk/zapata.conf; fi
etc/asterisk/zapata.conf-dist
@exec [ -f %B/zapata.conf ] || cp %B/%f %B/zapata.conf
@@ -136,28 +151,36 @@ include/asterisk/app.h
include/asterisk/ast_expr.h
include/asterisk/astdb.h
include/asterisk/astmm.h
+include/asterisk/astobj.h
include/asterisk/astosp.h
+include/asterisk/build.h
include/asterisk/callerid.h
include/asterisk/causes.h
include/asterisk/cdr.h
include/asterisk/channel.h
-include/asterisk/channel_pvt.h
+include/asterisk/chanspy.h
include/asterisk/chanvars.h
include/asterisk/cli.h
+include/asterisk/compat.h
include/asterisk/config.h
-include/asterisk/config_pvt.h
+include/asterisk/compiler.h
include/asterisk/crypto.h
-include/asterisk/cvsid.h
+include/asterisk/devicestate.h
include/asterisk/dlfcn-compat.h
include/asterisk/dns.h
+include/asterisk/dnsmgr.h
+include/asterisk/doxyref.h
include/asterisk/dsp.h
+include/asterisk/dundi.h
include/asterisk/enum.h
+include/asterisk/endian.h
include/asterisk/features.h
include/asterisk/file.h
include/asterisk/frame.h
include/asterisk/fskmodem.h
include/asterisk/image.h
include/asterisk/indications.h
+include/asterisk/inline_api.h
include/asterisk/io.h
include/asterisk/linkedlists.h
include/asterisk/localtime.h
@@ -168,38 +191,50 @@ include/asterisk/md5.h
include/asterisk/module.h
include/asterisk/monitor.h
include/asterisk/musiconhold.h
+include/asterisk/netsock.h
include/asterisk/options.h
include/asterisk/pbx.h
+include/asterisk/plc.h
include/asterisk/poll-compat.h
include/asterisk/privacy.h
include/asterisk/res_odbc.h
include/asterisk/rtp.h
include/asterisk/say.h
include/asterisk/sched.h
+include/asterisk/slinfactory.h
include/asterisk/srv.h
+include/asterisk/strings.h
include/asterisk/tdd.h
include/asterisk/term.h
+include/asterisk/time.h
include/asterisk/transcap.h
include/asterisk/translate.h
include/asterisk/ulaw.h
+include/asterisk/unaligned.h
include/asterisk/utils.h
+include/asterisk/version.h
include/asterisk/vmodem.h
lib/asterisk/modules/app_adsiprog.so
lib/asterisk/modules/app_alarmreceiver.so
lib/asterisk/modules/app_authenticate.so
lib/asterisk/modules/app_cdr.so
lib/asterisk/modules/app_chanisavail.so
+lib/asterisk/modules/app_chanspy.so
lib/asterisk/modules/app_controlplayback.so
+lib/asterisk/modules/app_curl.so
lib/asterisk/modules/app_cut.so
lib/asterisk/modules/app_db.so
-lib/asterisk/modules/app_devstate.so
lib/asterisk/modules/app_dial.so
+lib/asterisk/modules/app_dictate.so
+lib/asterisk/modules/app_directed_pickup.so
lib/asterisk/modules/app_directory.so
lib/asterisk/modules/app_disa.so
+lib/asterisk/modules/app_dumpchan.so
lib/asterisk/modules/app_echo.so
lib/asterisk/modules/app_enumlookup.so
lib/asterisk/modules/app_eval.so
lib/asterisk/modules/app_exec.so
+lib/asterisk/modules/app_externalivr.so
lib/asterisk/modules/app_festival.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_flash.so
lib/asterisk/modules/app_forkcdr.so
@@ -208,64 +243,66 @@ lib/asterisk/modules/app_groupcount.so
lib/asterisk/modules/app_hasnewvoicemail.so
lib/asterisk/modules/app_ices.so
lib/asterisk/modules/app_image.so
-lib/asterisk/modules/app_intercom.so
lib/asterisk/modules/app_lookupblacklist.so
lib/asterisk/modules/app_lookupcidname.so
lib/asterisk/modules/app_macro.so
+lib/asterisk/modules/app_math.so
+lib/asterisk/modules/app_md5.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_meetme.so
lib/asterisk/modules/app_milliwatt.so
+lib/asterisk/modules/app_mixmonitor.so
lib/asterisk/modules/app_mp3.so
lib/asterisk/modules/app_nbscat.so
+%%WITH_ZAPTEL%%lib/asterisk/modules/app_page.so
lib/asterisk/modules/app_parkandannounce.so
-lib/asterisk/modules/app_pickup.so
lib/asterisk/modules/app_playback.so
lib/asterisk/modules/app_privacy.so
-lib/asterisk/modules/app_qcall.so
lib/asterisk/modules/app_queue.so
lib/asterisk/modules/app_random.so
lib/asterisk/modules/app_read.so
+lib/asterisk/modules/app_readfile.so
+lib/asterisk/modules/app_realtime.so
lib/asterisk/modules/app_record.so
%%WITH_FAX%%lib/asterisk/modules/app_rxfax.so
lib/asterisk/modules/app_sayunixtime.so
-lib/asterisk/modules/app_segfault.so
lib/asterisk/modules/app_senddtmf.so
lib/asterisk/modules/app_sendtext.so
lib/asterisk/modules/app_setcallerid.so
lib/asterisk/modules/app_setcdruserfield.so
lib/asterisk/modules/app_setcidname.so
lib/asterisk/modules/app_setcidnum.so
+lib/asterisk/modules/app_setrdnis.so
lib/asterisk/modules/app_settransfercapability.so
lib/asterisk/modules/app_sms.so
lib/asterisk/modules/app_softhangup.so
-lib/asterisk/modules/app_striplsd.so
-lib/asterisk/modules/app_substring.so
+lib/asterisk/modules/app_stack.so
lib/asterisk/modules/app_system.so
lib/asterisk/modules/app_talkdetect.so
lib/asterisk/modules/app_test.so
lib/asterisk/modules/app_transfer.so
-lib/asterisk/modules/app_txtcidname.so
%%WITH_FAX%%lib/asterisk/modules/app_txfax.so
+lib/asterisk/modules/app_txtcidname.so
lib/asterisk/modules/app_url.so
lib/asterisk/modules/app_userevent.so
lib/asterisk/modules/app_verbose.so
lib/asterisk/modules/app_voicemail.so
lib/asterisk/modules/app_waitforring.so
+lib/asterisk/modules/app_waitforsilence.so
+lib/asterisk/modules/app_while.so
lib/asterisk/modules/app_zapateller.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapbarge.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapras.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapscan.so
lib/asterisk/modules/cdr_csv.so
+lib/asterisk/modules/cdr_custom.so
lib/asterisk/modules/cdr_manager.so
%%WITH_ODBC%%lib/asterisk/modules/cdr_odbc.so
lib/asterisk/modules/chan_agent.so
+lib/asterisk/modules/chan_features.so
%%WITH_H323%%lib/asterisk/modules/chan_h323.so
lib/asterisk/modules/chan_iax2.so
lib/asterisk/modules/chan_local.so
lib/asterisk/modules/chan_mgcp.so
-lib/asterisk/modules/chan_modem.so
-lib/asterisk/modules/chan_modem_aopen.so
-lib/asterisk/modules/chan_modem_bestdata.so
-lib/asterisk/modules/chan_modem_i4l.so
lib/asterisk/modules/chan_oss.so
lib/asterisk/modules/chan_sip.so
lib/asterisk/modules/chan_skinny.so
@@ -273,14 +310,13 @@ lib/asterisk/modules/chan_skinny.so
lib/asterisk/modules/codec_a_mu.so
lib/asterisk/modules/codec_adpcm.so
lib/asterisk/modules/codec_alaw.so
-lib/asterisk/modules/codec_g723_1_dummy.so
lib/asterisk/modules/codec_g726.so
-lib/asterisk/modules/codec_g729_dummy.so
lib/asterisk/modules/codec_gsm.so
lib/asterisk/modules/codec_ilbc.so
lib/asterisk/modules/codec_lpc10.so
lib/asterisk/modules/codec_speex.so
lib/asterisk/modules/codec_ulaw.so
+lib/asterisk/modules/format_au.so
lib/asterisk/modules/format_g723_1.so
lib/asterisk/modules/format_g726.so
lib/asterisk/modules/format_g729.so
@@ -294,22 +330,34 @@ lib/asterisk/modules/format_sln.so
lib/asterisk/modules/format_vox.so
lib/asterisk/modules/format_wav.so
lib/asterisk/modules/format_wav_gsm.so
+lib/asterisk/modules/func_callerid.so
+lib/asterisk/modules/func_enum.so
+lib/asterisk/modules/func_uri.so
+lib/asterisk/modules/pbx_ael.so
lib/asterisk/modules/pbx_config.so
+lib/asterisk/modules/pbx_dundi.so
+lib/asterisk/modules/pbx_functions.so
+lib/asterisk/modules/pbx_loopback.so
+lib/asterisk/modules/pbx_realtime.so
lib/asterisk/modules/pbx_spool.so
-lib/asterisk/modules/pbx_wilcalu.so
lib/asterisk/modules/res_adsi.so
lib/asterisk/modules/res_agi.so
+lib/asterisk/modules/res_config_odbc.so
lib/asterisk/modules/res_crypto.so
lib/asterisk/modules/res_features.so
lib/asterisk/modules/res_indications.so
lib/asterisk/modules/res_monitor.so
+lib/asterisk/modules/res_odbc.so
lib/asterisk/modules/res_musiconhold.so
-lib/asterisk/modules/res_watchdog.so
sbin/asterisk
sbin/astgenkey
sbin/astman
sbin/autosupport
+sbin/rasterisk
sbin/safe_asterisk
+sbin/smsq
+sbin/stereorize
+sbin/streamplayer
%%DATADIR%%/agi-bin/agi-test.agi
%%DATADIR%%/agi-bin/eagi-sphinx-test
%%DATADIR%%/agi-bin/eagi-test
@@ -330,23 +378,34 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/auth-incorrect.gsm
%%DATADIR%%/sounds/auth-thankyou.gsm
%%DATADIR%%/sounds/beep.gsm
+%%DATADIR%%/sounds/beeperr.gsm
%%DATADIR%%/sounds/conf-adminmenu.gsm
%%DATADIR%%/sounds/conf-enteringno.gsm
%%DATADIR%%/sounds/conf-errormenu.gsm
%%DATADIR%%/sounds/conf-getchannel.gsm
%%DATADIR%%/sounds/conf-getconfno.gsm
%%DATADIR%%/sounds/conf-getpin.gsm
+%%DATADIR%%/sounds/conf-hasjoin.gsm
+%%DATADIR%%/sounds/conf-hasleft.gsm
%%DATADIR%%/sounds/conf-invalid.gsm
%%DATADIR%%/sounds/conf-invalidpin.gsm
%%DATADIR%%/sounds/conf-kicked.gsm
+%%DATADIR%%/sounds/conf-leaderhasleft.gsm
%%DATADIR%%/sounds/conf-locked.gsm
%%DATADIR%%/sounds/conf-lockednow.gsm
%%DATADIR%%/sounds/conf-muted.gsm
%%DATADIR%%/sounds/conf-noempty.gsm
+%%DATADIR%%/sounds/conf-onlyone.gsm
%%DATADIR%%/sounds/conf-onlyperson.gsm
+%%DATADIR%%/sounds/conf-otherinparty.gsm
+%%DATADIR%%/sounds/conf-placeintoconf.gsm
+%%DATADIR%%/sounds/conf-thereare.gsm
%%DATADIR%%/sounds/conf-unlockednow.gsm
%%DATADIR%%/sounds/conf-unmuted.gsm
%%DATADIR%%/sounds/conf-usermenu.gsm
+%%DATADIR%%/sounds/conf-userswilljoin.gsm
+%%DATADIR%%/sounds/conf-userwilljoin.gsm
+%%DATADIR%%/sounds/conf-waitforleader.gsm
%%DATADIR%%/sounds/demo-abouttotry.gsm
%%DATADIR%%/sounds/demo-congrats.gsm
%%DATADIR%%/sounds/demo-echodone.gsm
@@ -357,6 +416,18 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/demo-nogo.gsm
%%DATADIR%%/sounds/demo-nomatch.gsm
%%DATADIR%%/sounds/demo-thanks.gsm
+%%DATADIR%%/sounds/dictate/both_help.gsm
+%%DATADIR%%/sounds/dictate/enter_filename.gsm
+%%DATADIR%%/sounds/dictate/forhelp.gsm
+%%DATADIR%%/sounds/dictate/pause.gsm
+%%DATADIR%%/sounds/dictate/paused.gsm
+%%DATADIR%%/sounds/dictate/play_help.gsm
+%%DATADIR%%/sounds/dictate/playback.gsm
+%%DATADIR%%/sounds/dictate/playback_mode.gsm
+%%DATADIR%%/sounds/dictate/record.gsm
+%%DATADIR%%/sounds/dictate/record_help.gsm
+%%DATADIR%%/sounds/dictate/record_mode.gsm
+%%DATADIR%%/sounds/dictate/truncating_audio.gsm
%%DATADIR%%/sounds/digits/0.gsm
%%DATADIR%%/sounds/digits/1.gsm
%%DATADIR%%/sounds/digits/10.gsm
@@ -445,6 +516,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/dir-intro.gsm
%%DATADIR%%/sounds/dir-nomatch.gsm
%%DATADIR%%/sounds/dir-nomore.gsm
+%%DATADIR%%/sounds/hello-world.gsm
%%DATADIR%%/sounds/invalid.gsm
%%DATADIR%%/sounds/letters/a.gsm
%%DATADIR%%/sounds/letters/at.gsm
@@ -512,6 +584,10 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/phonetic/x_p.gsm
%%DATADIR%%/sounds/phonetic/y_p.gsm
%%DATADIR%%/sounds/phonetic/z_p.gsm
+%%DATADIR%%/sounds/priv-callee-options.gsm
+%%DATADIR%%/sounds/priv-callpending.gsm
+%%DATADIR%%/sounds/priv-introsaved.gsm
+%%DATADIR%%/sounds/priv-recordintro.gsm
%%DATADIR%%/sounds/privacy-incorrect.gsm
%%DATADIR%%/sounds/privacy-prompt.gsm
%%DATADIR%%/sounds/privacy-thankyou.gsm
@@ -520,10 +596,21 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/queue-holdtime.gsm
%%DATADIR%%/sounds/queue-less-than.gsm
%%DATADIR%%/sounds/queue-minutes.gsm
+%%DATADIR%%/sounds/queue-periodic-announce.gsm
+%%DATADIR%%/sounds/queue-reporthold.gsm
%%DATADIR%%/sounds/queue-seconds.gsm
%%DATADIR%%/sounds/queue-thankyou.gsm
%%DATADIR%%/sounds/queue-thereare.gsm
%%DATADIR%%/sounds/queue-youarenext.gsm
+%%DATADIR%%/sounds/screen-callee-options.gsm
+%%DATADIR%%/sounds/spy-agent.gsm
+%%DATADIR%%/sounds/spy-h323.gsm
+%%DATADIR%%/sounds/spy-iax.gsm
+%%DATADIR%%/sounds/spy-iax2.gsm
+%%DATADIR%%/sounds/spy-mgcp.gsm
+%%DATADIR%%/sounds/spy-sip.gsm
+%%DATADIR%%/sounds/spy-skinny.gsm
+%%DATADIR%%/sounds/spy-zap.gsm
%%DATADIR%%/sounds/ss-noservice.gsm
%%DATADIR%%/sounds/transfer.gsm
%%DATADIR%%/sounds/tt-allbusy.gsm
@@ -531,7 +618,6 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/tt-monkeysintro.gsm
%%DATADIR%%/sounds/tt-somethingwrong.gsm
%%DATADIR%%/sounds/tt-weasels.gsm
-%%DATADIR%%/sounds/vm
%%DATADIR%%/sounds/vm-Cust1.gsm
%%DATADIR%%/sounds/vm-Cust2.gsm
%%DATADIR%%/sounds/vm-Cust3.gsm
@@ -553,6 +639,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-extension.gsm
%%DATADIR%%/sounds/vm-first.gsm
%%DATADIR%%/sounds/vm-for.gsm
+%%DATADIR%%/sounds/vm-forward.gsm
%%DATADIR%%/sounds/vm-forwardoptions.gsm
%%DATADIR%%/sounds/vm-from-extension.gsm
%%DATADIR%%/sounds/vm-from-phonenumber.gsm
@@ -571,10 +658,12 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-mailboxfull.gsm
%%DATADIR%%/sounds/vm-message.gsm
%%DATADIR%%/sounds/vm-messages.gsm
+%%DATADIR%%/sounds/vm-minutes.gsm
%%DATADIR%%/sounds/vm-mismatch.gsm
%%DATADIR%%/sounds/vm-msginstruct.gsm
%%DATADIR%%/sounds/vm-msgsaved.gsm
%%DATADIR%%/sounds/vm-newpassword.gsm
+%%DATADIR%%/sounds/vm-newuser.gsm
%%DATADIR%%/sounds/vm-next.gsm
%%DATADIR%%/sounds/vm-no.gsm
%%DATADIR%%/sounds/vm-nobodyavail.gsm
@@ -592,6 +681,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-reachoper.gsm
%%DATADIR%%/sounds/vm-rec-busy.gsm
%%DATADIR%%/sounds/vm-rec-name.gsm
+%%DATADIR%%/sounds/vm-rec-temp.gsm
%%DATADIR%%/sounds/vm-rec-unv.gsm
%%DATADIR%%/sounds/vm-received.gsm
%%DATADIR%%/sounds/vm-reenterpassword.gsm
@@ -605,6 +695,9 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-sorry.gsm
%%DATADIR%%/sounds/vm-star-cancel.gsm
%%DATADIR%%/sounds/vm-starmain.gsm
+%%DATADIR%%/sounds/vm-tempgreeting.gsm
+%%DATADIR%%/sounds/vm-tempgreeting2.gsm
+%%DATADIR%%/sounds/vm-tempremoved.gsm
%%DATADIR%%/sounds/vm-then-pound.gsm
%%DATADIR%%/sounds/vm-theperson.gsm
%%DATADIR%%/sounds/vm-tocallback.gsm
@@ -624,9 +717,11 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-whichbox.gsm
%%DATADIR%%/sounds/vm-youhave.gsm
%%DATADIR%%/sounds/voicemail
+@dirrm %%DATADIR%%/sounds/dictate
@dirrm %%DATADIR%%/sounds/phonetic
@dirrm %%DATADIR%%/sounds/letters
@dirrm %%DATADIR%%/sounds/digits
+@dirrm %%DATADIR%%/sounds/priv-callerintros
@dirrm %%DATADIR%%/sounds
@dirrm %%DATADIR%%/mohmp3
@dirrm %%DATADIR%%/keys
@@ -641,11 +736,14 @@ sbin/safe_asterisk
@dirrm etc/asterisk
@unexec rm -f %D/%%DATADIR%%/astdb
@cwd /var
-spool/asterisk/vm
spool/asterisk/voicemail/default/1234/busy.gsm
spool/asterisk/voicemail/default/1234/unavail.gsm
@exec mkdir -p %D/log/asterisk/cdr-csv
@exec mkdir -p %D/spool/asterisk/voicemail/default/1234/INBOX
+@dirrm spool/asterisk/dictate
+@dirrm spool/asterisk/meetme
+@dirrm spool/asterisk/monitor
+@dirrm spool/asterisk/system
@dirrm spool/asterisk/voicemail/default/1234/INBOX
@dirrm spool/asterisk/voicemail/default/1234
@dirrm spool/asterisk/voicemail/default
@@ -653,4 +751,5 @@ spool/asterisk/voicemail/default/1234/unavail.gsm
@dirrm spool/asterisk/tmp
@dirrm spool/asterisk
@dirrm log/asterisk/cdr-csv
+@dirrm log/asterisk/cdr-custom
@dirrm log/asterisk
diff --git a/net/asterisk10/Makefile b/net/asterisk10/Makefile
index 276aa57..3cfbf7e 100644
--- a/net/asterisk10/Makefile
+++ b/net/asterisk10/Makefile
@@ -6,30 +6,24 @@
#
PORTNAME= asterisk
-PORTVERSION= 1.0.9
-PORTREVISION= 2
+PORTVERSION= 1.2.1
CATEGORIES= net
MASTER_SITES= http://ftp.digium.com/pub/asterisk/ \
http://ftp.digium.com/pub/asterisk/old-releases/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/old-releases/
-PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
-PATCH_SITES= ${MASTER_SITE_LOCAL}
-PATCH_SITE_SUBDIR= fjoe
-PATCH_DIST_STRIP= -p1
-
MAINTAINER= sobomax@FreeBSD.org
COMMENT= An Open Source PBX and telephony toolkit
BUILD_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
LIB_DEPENDS= speex.3:${PORTSDIR}/audio/speex \
- newt.51:${PORTSDIR}/devel/newt
+ newt.51:${PORTSDIR}/devel/newt \
+ curl.3:${PORTSDIR}/ftp/curl
RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
ONLY_FOR_ARCHS= i386 sparc64 amd64
-BRIVER= bristuff-0.2.0-RC8h
GNU_CONFIGURE= yes
CONFIGURE_WRKSRC= ${WRKSRC}/editline
USE_GMAKE= yes
@@ -44,7 +38,7 @@ MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
OSVERSION=${OSVERSION} \
CXX="${CXX}"
-MAN8= asterisk.8
+MAN8= asterisk.8 astgenkey.8 autosupport.8 safe_asterisk.8
.include <bsd.port.pre.mk>
@@ -68,8 +62,9 @@ MAKE_ENV+= WITH_H323=1
.if defined(WITHOUT_ZAPTEL)
PLIST_SUB+= WITH_ZAPTEL="@comment "
.else
+BUILD_DEPENDS+= libpri>=1.2.0:${PORTSDIR}/misc/libpri \
+ ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
LIB_DEPENDS+= pri.1:${PORTSDIR}/misc/libpri
-BUILD_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
RUN_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
PLIST_SUB+= WITH_ZAPTEL=""
MAKE_ENV+= WITH_ZAPTEL=1
@@ -86,10 +81,6 @@ PLIST_SUB+= WITH_ODBC=""
MAKE_ENV+= WITH_ODBC=1
.endif
-.if !defined(WITHOUT_MYSQL)
-USE_MYSQL= yes
-.endif
-
.if defined(WITHOUT_FAX)
PLIST_SUB+= WITH_FAX="@comment "
.else
@@ -99,7 +90,6 @@ PLIST_SUB+= WITH_FAX=""
.endif
post-patch:
- ${CP} ${FILESDIR}/chan_oss.c ${WRKSRC}/channels
${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample
.include <bsd.port.post.mk>
diff --git a/net/asterisk10/distinfo b/net/asterisk10/distinfo
index 9ef6daa..9d56959 100644
--- a/net/asterisk10/distinfo
+++ b/net/asterisk10/distinfo
@@ -1,4 +1,3 @@
-MD5 (asterisk-1.0.9.tar.gz) = 0d7f1c680ae53a739f26a069ef8b580a
-SIZE (asterisk-1.0.9.tar.gz) = 9604582
-MD5 (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 42172c5b04af9080f22b883296c34002
-SIZE (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 56589
+MD5 (asterisk-1.2.1.tar.gz) = 04657086791e80f319c0d728af705001
+SHA256 (asterisk-1.2.1.tar.gz) = f0d3ed36353c1f5726225d2794bea7d1d1a92c9e58336b02b293f43dd4b97948
+SIZE (asterisk-1.2.1.tar.gz) = 10517194
diff --git a/net/asterisk10/files/chan_oss.c b/net/asterisk10/files/chan_oss.c
deleted file mode 100644
index 95a9236..0000000
--- a/net/asterisk10/files/chan_oss.c
+++ /dev/null
@@ -1,1327 +0,0 @@
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * Copyright (C) 1999, Mark Spencer
- *
- * Mark Spencer <markster@linux-support.net>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- *
- * FreeBSD changes and multiple device support by Luigi Rizzo, 2005.05.02
- * note-this code best seen with ts=8 (8-spaces tabs) in the editor
- */
-
-#include <asterisk/lock.h>
-#include <asterisk/frame.h>
-#include <asterisk/logger.h>
-#include <asterisk/channel.h>
-#include <asterisk/module.h>
-#include <asterisk/channel_pvt.h>
-#include <asterisk/options.h>
-#include <asterisk/pbx.h>
-#include <asterisk/config.h>
-#include <asterisk/cli.h>
-#include <asterisk/utils.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h> /* for isalnum */
-#ifdef __linux
-#include <linux/soundcard.h>
-#elif defined(__FreeBSD__)
-#include <sys/soundcard.h>
-#else
-#include <soundcard.h>
-#endif
-#include "busy.h"
-#include "ringtone.h"
-#include "ring10.h"
-#include "answer.h"
-
-/*
- * Helper macros to parse config arguments. They will go in a common
- * header file if their usage is globally accepted. In the meantime,
- * we define them here. Typical usage is as below, WITHOUT ; on each line.
- *
- * {
- * M_START(v->name, v->value)
- *
- * M_BOOL("dothis", x->flag1)
- * M_STR("name", x->somestring)
- * M_F("bar", some_c_code)
- * M_END(some_final_statement)
- */
-#define M_START(var, val) \
- char *__s = var; char *__val = val;
-#define M_END(x) x;
-#define M_F(tag, f) if (!strcasecmp((__s), tag)) { f; } else
-#define M_BOOL(tag, dst) M_F(tag, (dst) = ast_true(__val) )
-#define M_UINT(tag, dst) M_F(tag, (dst) = strtoul(__val, NULL, 0) )
-#define M_STR(tag, dst) M_F(tag, strncpy(dst, __val, sizeof(dst) - 1) )
-
-
-/* Which device to use */
-#if defined( __OpenBSD__ ) || defined( __NetBSD__ )
-#define DEV_DSP "/dev/audio"
-#else
-#define DEV_DSP "/dev/dsp"
-#endif
-
-/*
- * Basic mode of operation:
- *
- * we have one keyboard (which receives commands from the keyboard)
- * and multiple headset's connected to audio cards. Headsets are named as
- * the sections of oss.conf
- *
- * At any time, the keyboard is attached to one headset, and you
- * can switch among them using the 'console' command.
- *
- * The following parameters are important for the configuration of
- * the device:
- *
- * FRAME_SIZE the size of an audio frame, in samples.
- * 160 is used almost universally, so you should not change it.
- *
- * FRAGS the argument for the SETFRAGMENT ioctl.
- * Overridden by the 'frags' parameter in oss.conf
- *
- * Bits 0-7 are the base-2 log of the device's block size,
- * bits 16-31 are the number of blocks in the driver's queue.
- * There are a lot of differences in the way this parameter
- * is supported by different drivers, so you may need to
- * experiment a bit with the value.
- * A good default for linux is 30 blocks of 64 bytes, which
- * results in 6 frames of 320 bytes (160 samples).
- * FreeBSD works decently with blocks of 256 or 512 bytes,
- * leaving the number unspecified.
- * Note that this only refers to the device buffer size,
- * this module will then try to keep the lenght of audio
- * buffered within small constraints.
- *
- * QUEUE_SIZE The max number of blocks actually allowed in the device
- * driver's buffer, irrespective of the available number.
- * Overridden by the 'queuesize' parameter in oss.conf
- *
- * Should be >=2, and at most as large as the hw queue above
- * (otherwise it will never be full).
- */
-
-#define FRAME_SIZE 160
-#define QUEUE_SIZE 10
-
-#if defined(__FreeBSD__)
-#define FRAGS 0x8
-#else
-#define FRAGS ( ( (6 * 5) << 16 ) | 0x6 )
-#endif
-
-
-/* Don't switch between read/write modes faster than every 300 ms */
-#define MIN_SWITCH_TIME 300
-
-
-static int usecnt;
-AST_MUTEX_DEFINE_STATIC(usecnt_lock);
-
-static char *desc = "OSS Console Channel Driver";
-static char *tdesc = "OSS Console Channel Driver";
-static char *config = "oss.conf"; /* default config file */
-
-static int oss_debug;
-
-/*
- * Each sound is made of 'datalen' samples of sound, repeated as needed to
- * generate 'samplen' samples of data, then followed by 'silencelen' samples
- * of silence. The loop is repeated if 'repeat' is set.
- */
-struct sound {
- int ind;
- char *desc;
- short *data;
- int datalen;
- int samplen;
- int silencelen;
- int repeat;
-};
-
-static struct sound sounds[] = {
- { AST_CONTROL_RINGING, "RINGING", ringtone, sizeof(ringtone)/2, 16000, 32000, 1 },
- { AST_CONTROL_BUSY, "BUSY", busy, sizeof(busy)/2, 4000, 4000, 1 },
- { AST_CONTROL_CONGESTION, "CONGESTION", busy, sizeof(busy)/2, 2000, 2000, 1 },
- { AST_CONTROL_RING, "RING10", ring10, sizeof(ring10)/2, 16000, 32000, 1 },
- { AST_CONTROL_ANSWER, "ANSWER", answer, sizeof(answer)/2, 2200, 0, 0 },
- { -1, NULL, 0, 0, 0, 0 }, /* end marker */
-};
-
-
-/*
- * descriptor for one of our channels.
- * There is one used for 'default' values (from the [general] entry in
- * the configuration file, and then one instance for each device
- * (the default is cloned from [general], others are only created
- * if the relevant section exists.
- */
-struct chan_oss_pvt {
- struct chan_oss_pvt *next;
-
- char *type;
- char *name;
- /*
- * cursound indicates which in struct sound we play. -1 means nothing,
- * any other value is a valid sound, in which case sampsent indicates
- * the next sample to send in [0..samplen + silencelen]
- * nosound is set to disable the audio data from the channel
- * (so we can play the tones etc.).
- */
- int sndcmd[2]; /* Sound command pipe */
- int cursound; /* index of sound to send */
- int sampsent; /* # of sound samples sent */
- int nosound; /* set to block audio from the PBX */
-
- int total_blocks; /* total blocks in the output device */
- int sounddev;
- enum { M_UNSET, M_FULL, M_READ, M_WRITE } duplex;
- int autoanswer;
- int autohangup;
- int hookstate;
- struct timeval lasttime; /* last setformat */
- char *mixer_cmd; /* initial command to issue to the mixer */
- unsigned int queuesize; /* max fragments in queue */
- unsigned int frags; /* parameter for SETFRAGMENT */
-
- int warned; /* various flags used for warnings */
-#define WARN_used_blocks 1
-#define WARN_speed 2
-#define WARN_frag 4
- int w_errors; /* overfull in the write path */
-
- int silencesuppression;
- int silencethreshold;
- int playbackonly;
- char device[64]; /* device to open */
-
- pthread_t sthread;
-
- struct ast_channel *owner;
- char ext[AST_MAX_EXTENSION];
- char ctx[AST_MAX_EXTENSION];
- char language[MAX_LANGUAGE];
-
- /* buffers used in oss_write */
- char oss_write_buf[FRAME_SIZE*2];
- int oss_write_dst;
- /* buffers used in oss_read - AST_FRIENDLY_OFFSET space for headers
- * plus enough room for a full frame
- */
- char oss_read_buf[FRAME_SIZE * 2 + AST_FRIENDLY_OFFSET];
- int readpos; /* read position above */
- struct ast_frame read_f; /* returned by oss_read */
-};
-
-static struct chan_oss_pvt oss_default = {
- .type = "Console",
- .cursound = -1,
- .sounddev = -1,
- .duplex = M_UNSET, /* XXX check this */
- .autoanswer = 1,
- .autohangup = 1,
- .queuesize = QUEUE_SIZE,
- .frags = FRAGS,
- .silencethreshold = 1000, /* currently unused */
- .ext = "s",
- .ctx = "default",
- .readpos = AST_FRIENDLY_OFFSET, /* start here on reads */
-};
-
-static char *oss_active; /* the active device */
-
-/*
- * returns true if too early to switch
- */
-static int too_early(struct chan_oss_pvt *o)
-{
- struct timeval tv;
- int ms;
- gettimeofday(&tv, NULL);
- ms = (tv.tv_sec - o->lasttime.tv_sec) * 1000 +
- (tv.tv_usec - o->lasttime.tv_usec) / 1000;
- if (ms < MIN_SWITCH_TIME)
- return -1;
- return 0;
-}
-
-/*
- * Returns the number of blocks used in the audio output channel
- */
-static int used_blocks(struct chan_oss_pvt *o)
-{
- struct audio_buf_info info;
-
- if (ioctl(o->sounddev, SNDCTL_DSP_GETOSPACE, &info)) {
- if (! (o->warned & WARN_used_blocks)) {
- ast_log(LOG_WARNING, "Error reading output space\n");
- o->warned |= WARN_used_blocks;
- }
- return 1;
- }
- if (o->total_blocks == 0) {
- if (0) /* debugging */
- ast_log(LOG_WARNING, "fragtotal %d size %d avail %d\n",
- info.fragstotal,
- info.fragsize,
- info.fragments);
- o->total_blocks = info.fragments;
- }
- return o->total_blocks - info.fragments;
-}
-
-static int soundcard_writeframe(struct chan_oss_pvt *o, short *data)
-{
- /* Write an exactly FRAME_SIZE sized frame */
- int res;
-
- /*
- * Nothing complex to manage the audio device queue.
- * If the buffer is full just drop the extra, otherwise write.
- * XXX in some cases it might be useful to write anyways after
- * a number of failures, to restart the output chain.
- */
- res = used_blocks(o);
- if (res > o->queuesize) { /* no room to write a block */
- if (o->w_errors++ == 0 && (oss_debug & 0x4))
- ast_log(LOG_WARNING, "write: used %d blocks (%d)\n",
- res, o->w_errors);
- return 0;
- }
- o->w_errors = 0;
- res = write(o->sounddev, ((void *)data), FRAME_SIZE * 2);
- return res;
-}
-
-/*
- * handler for 'sound writable' events from the sound thread.
- * Builds a frame from the high level description of the sounds,
- * and passes it to the audio device.
- * The actual sound is made of 1 or more sequences of sound samples
- * (s->datalen, repeated to make s->samplen samples) followed by
- * s->silencelen samples of silence. The position in the sequence is stored
- * in o->sampsent, which goes between 0 .. s->samplen+s->silencelen.
- * In case we fail to write a frame, don't update o->sampsent.
- */
-static void send_sound(struct chan_oss_pvt *o)
-{
- short myframe[FRAME_SIZE];
- int ofs, l, start;
- int l_sampsent = o->sampsent;
- struct sound *s;
-
- if (o->cursound < 0) /* no sound to send */
- return;
- s = &sounds[o->cursound];
- for (ofs = 0; ofs < FRAME_SIZE; ofs += l) {
- l = s->samplen - l_sampsent; /* sound available */
- if (l > 0) {
- start = l_sampsent % s->datalen; /* source offset */
- if (l > FRAME_SIZE - ofs) /* don't overflow the frame */
- l = FRAME_SIZE - ofs;
- if (l > s->datalen - start) /* don't overflow the source */
- l = s->datalen - start;
- bcopy(s->data + start, myframe + ofs, l*2);
- if (0)
- ast_log(LOG_WARNING, "send_sound sound %d/%d of %d into %d\n",
- l_sampsent, l, s->samplen, ofs);
- l_sampsent += l;
- } else { /* no sound, maybe some silence */
- static short silence[FRAME_SIZE] = {0, };
-
- l += s->silencelen;
- if (l > 0) {
- if (l > FRAME_SIZE - ofs)
- l = FRAME_SIZE - ofs;
- bcopy(silence, myframe + ofs, l*2);
- l_sampsent += l;
- } else { /* silence is over, restart sound if loop */
- if (s->repeat == 0) { /* last block */
- o->cursound = -1;
- o->nosound = 0; /* allow audio data */
- if (ofs < FRAME_SIZE) /* pad with silence */
- bcopy(silence, myframe + ofs, (FRAME_SIZE - ofs)*2);
- }
- l_sampsent = 0;
- }
- }
- }
- l = soundcard_writeframe(o, myframe);
- if (l > 0)
- o->sampsent = l_sampsent; /* update status */
-}
-
-static void *sound_thread(void *arg)
-{
- char ign[4096];
- struct chan_oss_pvt *o = (struct chan_oss_pvt *)arg;
-
- /* kick the driver by trying to read from it. Ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- for(;;) {
- fd_set rfds, wfds;
- int maxfd, res;
-
- FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- maxfd = o->sndcmd[0]; /* pipe from the main process */
- FD_SET(o->sndcmd[0], &rfds);
- if (!o->owner) { /* no one owns the audio, so we must drain it */
- FD_SET(o->sounddev, &rfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- if (o->cursound > -1) {
- FD_SET(o->sounddev, &wfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- /* ast_select emulates linux behaviour in terms of timeout handling */
- res = ast_select(maxfd + 1, &rfds, &wfds, NULL, NULL);
- if (res < 1) {
- ast_log(LOG_WARNING, "select failed: %s\n",
- strerror(errno));
- continue;
- }
- if (FD_ISSET(o->sndcmd[0], &rfds)) {
- /* read which sound to play from the pipe */
- int i, what = -1;
-
- read(o->sndcmd[0], &what, sizeof(what));
- for (i = 0; sounds[i].ind != -1; i++) {
- if (sounds[i].ind == what) {
- o->cursound = i;
- o->sampsent = 0;
- o->nosound = 1; /* block audio from pbx */
- break;
- }
- }
- if (sounds[i].ind == -1)
- ast_log(LOG_WARNING, "invalid sound index: %d\n", what);
- }
- if (FD_ISSET(o->sounddev, &rfds)) { /* read and ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- }
- if (FD_ISSET(o->sounddev, &wfds))
- send_sound(o);
- }
- /* Never reached */
- return NULL;
-}
-
-/*
- * reset and close the device if opened,
- * then open and initialize it in the desired mode,
- * trigger reads and writes so we can start using it.
- */
-static int setformat(struct chan_oss_pvt *o, int mode)
-{
- int fmt, desired, res, fd;
-
- if (o->sounddev >= 0) {
- ioctl(o->sounddev, SNDCTL_DSP_RESET, 0);
- close(o->sounddev);
- o->duplex = M_UNSET;
- }
- fd = o->sounddev = open(o->device, mode |O_NONBLOCK);
- if (o->sounddev < 0) {
- ast_log(LOG_WARNING, "Unable to re-open DSP device: %s\n",
- strerror(errno));
- return -1;
- }
-
- gettimeofday(&o->lasttime, NULL);
- fmt = AFMT_S16_LE;
- res = ioctl(fd, SNDCTL_DSP_SETFMT, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set format to 16-bit signed\n");
- return -1;
- }
- switch (mode) {
- case O_RDWR:
- res = ioctl(fd, SNDCTL_DSP_SETDUPLEX, 0);
- /* Check to see if duplex set (FreeBSD Bug)*/
- res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt);
- if (res == 0 && (fmt & DSP_CAP_DUPLEX)) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Console is full duplex\n");
- o->duplex = M_FULL;
- };
- break;
- case O_WRONLY:
- o->duplex = M_WRITE;
- break;
- case O_RDONLY:
- o->duplex = M_READ;
- break;
- }
-
- fmt = 0;
- res = ioctl(fd, SNDCTL_DSP_STEREO, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- /* 8000 Hz desired */
- desired = 8000;
- fmt = desired;
- res = ioctl(fd, SNDCTL_DSP_SPEED, &fmt);
-
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- if (fmt != desired) {
- if (!(o->warned & WARN_speed)) {
- ast_log(LOG_WARNING,
- "Requested %d Hz, got %d Hz -- sound may be choppy\n",
- desired, fmt);
- o->warned |= WARN_speed;
- }
- }
- /*
- * on Freebsd, SETFRAGMENT does not work very well on some cards.
- * Default to use 256 bytes, let the user override
- */
- if (o->frags) {
- fmt = o->frags;
- res = ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &fmt);
- if (res < 0) {
- if (!(o->warned & WARN_frag)) {
- ast_log(LOG_WARNING,
- "Unable to set fragment size -- sound may be choppy\n");
- o->warned |= WARN_frag;
- }
- }
- }
- /* XXX on some cards, we need SNDCTL_DSP_SETTRIGGER to start outputting */
- res = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT;
- res = ioctl(fd, SNDCTL_DSP_SETTRIGGER, &res);
- /* it may fail if we are in half duplex, never mind */
- return 0;
-}
-
-/*
- * make sure output mode is available. Returns 0 if done,
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setoutput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_WRITE && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_WRONLY))
- return -1;
- return 0;
-}
-
-/*
- * make sure input mode is available. Returns 0 if done
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setinput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_READ && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_RDONLY))
- return -1;
- return 0;
-}
-
-/*
- * some of the standard methods supported by channels.
- */
-static int oss_digit(struct ast_channel *c, char digit)
-{
- /* no better use for received digits than print them */
- ast_verbose( " << Console Received digit %c >> \n", digit);
- return 0;
-}
-
-static int oss_text(struct ast_channel *c, char *text)
-{
- /* print received messages */
- ast_verbose( " << Console Received text %s >> \n", text);
- return 0;
-}
-
-/* Play ringtone 'x' on device 'o' */
-#define RING(o, x) { int what = x; write((o)->sndcmd[1], &what, sizeof(what)); }
-
-/*
- * handler for incoming calls. Either autoanswer, or start ringing
- */
-static int oss_call(struct ast_channel *c, char *dest, int timeout)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame f = { 0, };
-
- ast_verbose( " << Call placed to '%s' on console >> \n", dest);
- if (o->autoanswer) {
- ast_verbose( " << Auto-answered >> \n" );
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_ANSWER;
- ast_queue_frame(c, &f);
- } else {
- ast_verbose(" << Type 'answer' to answer, or use 'autoanswer' for future calls >> \n");
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_RINGING;
- ast_queue_frame(c, &f);
- RING(o, AST_CONTROL_RING);
- }
- return 0;
-}
-
-/*
- * remote side answered the phone
- */
-static int oss_answer(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- ast_verbose( " << Console call has been answered >> \n");
-#if 0
- /* play an answer tone (XXX do we really need it ?) */
- RING(o, AST_CONTROL_ANSWER);
-#endif
- ast_setstate(c, AST_STATE_UP);
- o->cursound = -1;
- o->nosound=0;
- return 0;
-}
-
-static int oss_hangup(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- o->cursound = -1;
- c->pvt->pvt = NULL;
- o->owner = NULL;
- ast_verbose( " << Hangup on console >> \n");
- ast_mutex_lock(&usecnt_lock); /* XXX not sure why */
- usecnt--;
- ast_mutex_unlock(&usecnt_lock);
- if (o->hookstate) {
- if (o->autoanswer || o->autohangup) {
- /* Assume auto-hangup too */
- o->hookstate = 0;
- } else {
- /* Make congestion noise */
- RING(o, AST_CONTROL_CONGESTION);
- }
- }
- return 0;
-}
-
-/* used for data coming from the network */
-static int oss_write(struct ast_channel *c, struct ast_frame *f)
-{
- int res;
- int src;
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- /* Immediately return if no sound is enabled */
- if (o->nosound)
- return 0;
- /* Stop any currently playing sound */
- o->cursound = -1;
- if (o->duplex != M_FULL && !o->playbackonly) {
- /* XXX check this, looks weird! */
- /* If we're half duplex, we have to switch to read mode
- to honor immediate needs if necessary */
- res = soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set device to input mode\n");
- return -1;
- }
- return 0;
- }
- res = soundcard_setoutput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set output device\n");
- return -1;
- } else if (res > 0) {
- /* The device is still in read mode, and it's too soon to change it,
- so just pretend we wrote it */
- return 0;
- }
- /*
- * we could receive a sample which is not a multiple of our FRAME_SIZE,
- * so we buffer it locally and write to the device in FRAME_SIZE
- * chunks, keeping the residue stored for future use.
- */
- src = 0; /* read position into f->data */
- while ( src < f->datalen ) {
- /* Compute spare room in the buffer */
- int l = sizeof(o->oss_write_buf) - o->oss_write_dst;
-
- if (f->datalen - src >= l) { /* enough to fill a frame */
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- soundcard_writeframe(o, (short *)o->oss_write_buf);
- src += l;
- o->oss_write_dst = 0;
- } else { /* copy residue */
- l = f->datalen - src;
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- src += l; /* but really, we are done */
- o->oss_write_dst += l;
- }
- }
- return 0;
-}
-
-static struct ast_frame *oss_read(struct ast_channel *c)
-{
- int res;
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame *f = &o->read_f;
-
- /* prepare a NULL frame in case we don't have enough data to return */
- bzero(f, sizeof(struct ast_frame));
- f->frametype = AST_FRAME_NULL;
- f->src = o->type;
-
- res = soundcard_setinput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set input mode\n");
- return NULL;
- } else if (res > 0) { /* too early to switch ? */
- /* Theoretically shouldn't happen, but anyway, return a NULL frame */
- return f;
- }
-
- res = read(o->sounddev, o->oss_read_buf + o->readpos,
- sizeof(o->oss_read_buf) - o->readpos);
- if (res < 0) /* audio data not ready, return a NULL frame */
- return f;
-
- o->readpos += res;
- if (o->readpos < sizeof(o->oss_read_buf)) /* not enough samples */
- return f;
-
- o->readpos = AST_FRIENDLY_OFFSET; /* reset read pointer for next frame */
- if (c->_state != AST_STATE_UP) /* drop data if frame is not up */
- return f;
- /* ok we can build and deliver the frame to the caller */
- f->frametype = AST_FRAME_VOICE;
- f->subclass = AST_FORMAT_SLINEAR;
- f->samples = FRAME_SIZE;
- f->datalen = FRAME_SIZE * 2;
- f->data = o->oss_read_buf + AST_FRIENDLY_OFFSET;
- f->offset = AST_FRIENDLY_OFFSET;
- return f;
-}
-
-static int oss_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
-{
- struct chan_oss_pvt *o = newchan->pvt->pvt;
- o->owner = newchan;
- return 0;
-}
-
-static int oss_indicate(struct ast_channel *c, int cond)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- int res;
-
- switch(cond) {
- case AST_CONTROL_BUSY:
- case AST_CONTROL_CONGESTION:
- case AST_CONTROL_RINGING:
- res = cond;
- break;
- case -1:
- o->cursound = -1;
- return 0;
- default:
- ast_log(LOG_WARNING,
- "Don't know how to display condition %d on %s\n",
- cond, c->name);
- return -1;
- }
- if (res > -1)
- RING(o, res);
- return 0;
-}
-
-static struct ast_channel *oss_new(struct chan_oss_pvt *o,
- char *ext, char *ctx, int state)
-{
- struct ast_channel *c;
- struct ast_channel_pvt *pvt;
-
- c = ast_channel_alloc(1);
- if (c == NULL)
- return NULL;
- snprintf(c->name, sizeof(c->name), "OSS/%s", o->device + 5);
- c->type = o->type;
- c->fds[0] = o->sounddev;
- c->nativeformats = AST_FORMAT_SLINEAR;
- pvt = c->pvt;
- pvt->pvt = o;
-
- /* relevant callbacks */
- pvt->send_digit = oss_digit;
- pvt->send_text = oss_text;
- pvt->hangup = oss_hangup;
- pvt->answer = oss_answer;
- pvt->read = oss_read;
- pvt->call = oss_call;
- pvt->write = oss_write;
- pvt->indicate = oss_indicate;
- pvt->fixup = oss_fixup;
-
-#define S_OVERRIDE(dst, src) \
- { if (src && src[0] != '\0') /* non-empty string */ \
- strncpy((dst), src, sizeof(dst)-1); }
- S_OVERRIDE(c->context, ctx);
- S_OVERRIDE(c->exten, ext);
- S_OVERRIDE(c->language, o->language);
- o->owner = c;
- ast_setstate(c, state);
- ast_mutex_lock(&usecnt_lock);
- usecnt++;
- ast_mutex_unlock(&usecnt_lock);
- ast_update_use_count();
- if (state != AST_STATE_DOWN) {
- if (ast_pbx_start(c)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", c->name);
- ast_hangup(c);
- o->owner = c = NULL;
- /* XXX what about the channel itself ? */
- /* XXX what about usecnt ? */
- }
- }
- return c;
-}
-
-/*
- * returns a pointer to the descriptor with the given name
- */
-static struct chan_oss_pvt *find_desc(char *dev)
-{
- struct chan_oss_pvt *o;
-
- for (o = oss_default.next; o && strcmp(o->name, dev) != 0; o = o->next)
- ;
- if (o == NULL)
- ast_log(LOG_WARNING, "%s could not find <%s>\n", __func__, dev);
- return o;
-}
-
-static struct ast_channel *oss_request(char *type, int format, void *data)
-{
- struct ast_channel *c;
- struct chan_oss_pvt *o = find_desc(data);
-
- ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n",
- type, data, (char *)data);
- if (o == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data);
- /* XXX we could default to 'dsp' perhaps ? */
- return NULL;
- }
- if ((format & AST_FORMAT_SLINEAR) == 0) {
- ast_log(LOG_NOTICE, "Format 0x%x unsupported\n", format);
- return NULL;
- }
- if (o->owner) {
- ast_log(LOG_NOTICE, "Already have a call on the OSS channel\n");
- return NULL;
- }
- c= oss_new(o, NULL, NULL, AST_STATE_DOWN);
- if (c == NULL) {
- ast_log(LOG_WARNING, "Unable to create new OSS channel\n");
- return NULL;
- }
- return c;
-}
-
-static int console_autoanswer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o == NULL) {
- ast_log(LOG_WARNING, "Cannot find device %s (should not happen!)\n",
- oss_active);
- return RESULT_FAILURE;
- }
- if (argc == 1) {
- ast_cli(fd, "Auto answer is %s.\n", o->autoanswer ? "on" : "off");
- return RESULT_SUCCESS;
- }
- if (!strcasecmp(argv[1], "on"))
- o->autoanswer = -1;
- else if (!strcasecmp(argv[1], "off"))
- o->autoanswer = 0;
- else
- return RESULT_SHOWUSAGE;
- return RESULT_SUCCESS;
-}
-
-static char *autoanswer_complete(char *line, char *word, int pos, int state)
-{
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
- int l = strlen(word);
-
- switch(state) {
- case 0:
- if (l && !strncasecmp(word, "on", MIN(l, 2)))
- return strdup("on");
- case 1:
- if (l && !strncasecmp(word, "off", MIN(l, 3)))
- return strdup("off");
- default:
- return NULL;
- }
- return NULL;
-}
-
-static char autoanswer_usage[] =
-"Usage: autoanswer [on|off]\n"
-" Enables or disables autoanswer feature. If used without\n"
-" argument, displays the current on/off status of autoanswer.\n"
-" The default value of autoanswer is in 'oss.conf'.\n";
-
-/*
- * answer command from the console
- */
-static int console_answer(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 1;
- o->cursound = -1;
- ast_queue_frame(o->owner, &f);
- RING(o, AST_CONTROL_ANSWER);
- return RESULT_SUCCESS;
-}
-
-static char sendtext_usage[] =
-"Usage: send text <message>\n"
-" Sends a text message for display on the remote terminal.\n";
-
-static int console_sendtext(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- int tmparg = 2;
- char text2send[256] = "";
- struct ast_frame f = { 0, };
-
- if (argc < 2)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- if (strlen(text2send))
- ast_cli(fd, "Warning: message already waiting to be sent, overwriting\n");
- text2send[0] = '\0';
- while(tmparg < argc) {
- strncat(text2send, argv[tmparg++], sizeof(text2send) - strlen(text2send) - 1);
- strncat(text2send, " ", sizeof(text2send) - strlen(text2send) - 1);
- }
- if (strlen(text2send)) {
- f.frametype = AST_FRAME_TEXT;
- f.subclass = 0;
- f.data = text2send;
- f.datalen = strlen(text2send);
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-static char answer_usage[] =
-"Usage: answer\n"
-" Answers an incoming call on the console (OSS) channel.\n";
-
-static int console_hangup(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner && !o->hookstate) {
- ast_cli(fd, "No call to hangup up\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) {
- ast_queue_hangup(o->owner);
- }
- return RESULT_SUCCESS;
-}
-
-static char hangup_usage[] =
-"Usage: hangup\n"
-" Hangs up any call currently placed on the console.\n";
-
-
-static int console_flash(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_FLASH };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner) { /* XXX maybe !o->hookstate too ? */
- ast_cli(fd, "No call to flash\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) { /* XXX must be true, right ? */
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-
-static char flash_usage[] =
-"Usage: flash\n"
-" Flashes the call currently placed on the console.\n";
-
-
-
-static int console_dial(int fd, int argc, char *argv[])
-{
- char *tmp = NULL, *mye = NULL, *myc = NULL;
- int i;
- struct ast_frame f = { AST_FRAME_DTMF, 0 };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o->owner) { /* already in a call */
- if (argc == 1) { /* argument is mandatory here */
- ast_cli(fd, "Already in a call. You can only dial digits until you hangup.\n");
- return RESULT_FAILURE;
- }
- mye = argv[1];
- /* send the string one char at a time */
- for (i=0; i<strlen(mye); i++) {
- f.subclass = mye[i];
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
- }
- /* if we have an argument split it into extension and context */
-
- if (argc == 2) {
- tmp = myc = strdup(argv[1]); /* make a writable copy */
- mye = strsep(&myc, "@"); /* set exten, advance to context */
- myc = strsep(&myc, "@"); /* set context */
- }
- /* supply default values if needed */
- if (mye == NULL)
- mye = o->ext;
- if (myc == NULL)
- myc = o->ctx;
- if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
- o->hookstate = 1;
- oss_new(o, mye, myc, AST_STATE_RINGING);
- } else
- ast_cli(fd, "No such extension '%s' in context '%s'\n", mye, myc);
- return RESULT_SUCCESS;
-}
-
-static char dial_usage[] =
-"Usage: dial [extension[@context]]\n"
-" Dials a given extensison (and context if specified)\n";
-
-static int console_transfer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- struct ast_channel *b = NULL;
- char *ext, *ctx;
-
- if (argc != 2)
- return RESULT_SHOWUSAGE;
- if (o == NULL)
- return RESULT_FAILURE;
- if (o->owner == NULL || (b = o->owner->bridge) == NULL) {
- ast_cli(fd, "There is no call to transfer\n");
- return RESULT_SUCCESS;
- }
-
- ext = ctx = strdup(argv[1]); /* make a writable copy */
- strsep(&ctx, "@"); /* set exten, advance to context */
- ctx = strsep(&ctx, "@"); /* strip trailing @ and the rest */
-
- if (ctx == NULL) /* supply default context if needed */
- ctx = o->owner->context;
- if (!ast_exists_extension(b, ctx, ext, 1, b->callerid)) {
- ast_cli(fd, "No such extension exists\n");
- } else {
- ast_cli(fd, "Whee, transferring %s to %s@%s.\n", b->name, ext, ctx);
- if (ast_async_goto(b, ctx, ext, 1))
- ast_cli(fd, "Failed to transfer :(\n");
- }
- free(ext);
- return RESULT_SUCCESS;
-}
-
-static char transfer_usage[] =
-"Usage: transfer <extension>[@context]\n"
-" Transfers the currently connected call to the given extension (and\n"
-"context if specified)\n";
-
-static int console_active(int fd, int argc, char *argv[])
-{
- if (argc == 1) {
- ast_cli(fd, "active console is [%s]\n", oss_active);
- } else if (argc != 2) {
- return RESULT_SHOWUSAGE;
- } else {
- struct chan_oss_pvt *o;
- if (strcmp(argv[1], "show") == 0) {
- for (o = oss_default.next; o ; o = o->next)
- ast_cli(fd, "device [%s] exists\n", o->name);
- return RESULT_SUCCESS;
- }
- o = find_desc(argv[1]);
- if (o == NULL)
- ast_cli(fd, "No device [%s] exists\n", argv[1]);
- else
- oss_active = o->name;
- }
- return RESULT_SUCCESS;
-}
-
-static struct ast_cli_entry myclis[] = {
- { { "answer", NULL }, console_answer, "Answer an incoming console call", answer_usage },
- { { "hangup", NULL }, console_hangup, "Hangup a call on the console", hangup_usage },
- { { "flash", NULL }, console_flash, "Flash a call on the console", flash_usage },
- { { "dial", NULL }, console_dial, "Dial an extension on the console", dial_usage },
- { { "transfer", NULL }, console_transfer, "Transfer a call to a different extension", transfer_usage },
- { { "send", "text", NULL }, console_sendtext, "Send text to the remote device", sendtext_usage },
- { { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete },
- { { "console", NULL }, console_active, "Sets/displays active console",
- "console foo sets foo as the console"}
-};
-
-/*
- * store the mixer argument from the config file, filtering possibly
- * invalid or dangerous values (the string is used as argument for
- * system("mixer %s")
- */
-static void store_mixer(struct chan_oss_pvt *o, char *s)
-{
- int i;
-
- for (i=0; i < strlen(s); i++) {
- 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;
- }
- }
- if (o->mixer_cmd)
- free(o->mixer_cmd);
- o->mixer_cmd = strdup(s);
- ast_log(LOG_WARNING, "setting mixer %s\n", s);
-}
-
-/*
- * grab fields from the config file, init the descriptor and open the device.
- */
-static struct chan_oss_pvt * store_config(struct ast_config *cfg,
- char *ctg)
-{
- struct ast_variable *v;
- struct chan_oss_pvt *o;
-
- if (ctg == NULL) {
- o = &oss_default;
- o->next = NULL; /* XXX needed ? */
- ctg = "general";
- } else {
- o = (struct chan_oss_pvt *)malloc(sizeof *o);
- if (o == NULL) /* fail */
- return NULL;
- *o = oss_default;
- /* "general" is also the default thing */
- if (strcmp(ctg, "general") == 0) {
- o->name = strdup("dsp");
- oss_active = o->name;
- goto openit;
- }
- o->name = strdup(ctg);
- }
- ast_log(LOG_WARNING, "found category [%s]\n", ctg);
-
- /* fill other fields from configuration */
- v = ast_variable_browse(cfg, ctg);
- while(v) {
- M_START(v->name, v->value);
-
- M_BOOL("autoanswer", o->autoanswer)
- M_BOOL("autohangup", o->autohangup)
- M_BOOL("playbackonly", o->playbackonly)
- M_BOOL("silencesuppression", o->silencesuppression)
- M_UINT("silencethreshold", o->silencethreshold )
- M_STR("device", o->device)
- M_UINT("frags", o->frags)
- M_UINT("debug", oss_debug)
- M_UINT("queuesize", o->queuesize)
- M_STR("context", o->ctx)
- M_STR("language", o->language)
- M_STR("extension", o->ext)
- M_F("mixer", store_mixer(o, v->value))
- M_END(;);
- v=v->next;
- }
- if (!strlen(o->device))
- strncpy(o->device, DEV_DSP, sizeof(o->device)-1);
- if (o->mixer_cmd) {
- char *cmd;
-
- asprintf(&cmd, "mixer %s", o->mixer_cmd);
- ast_log(LOG_WARNING, "running [%s]\n", cmd);
- system(cmd);
- free(cmd);
- }
- if (o == &oss_default) /* we are done with the default */
- return NULL;
-
-openit:
- if (setformat(o, O_RDWR) < 0) { /* open device */
- if (option_verbose > 0) {
- ast_verbose(VERBOSE_PREFIX_2 "Device %s not detected\n", ctg);
- ast_verbose(VERBOSE_PREFIX_2 "Turn off OSS support by adding "
- "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
- }
- goto error;
- }
- soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (o->duplex != M_FULL)
- ast_log(LOG_WARNING, "XXX I don't work right with non "
- "full-duplex sound cards XXX\n");
- if ( pipe(o->sndcmd) != 0 ) {
- ast_log(LOG_ERROR, "Unable to create pipe\n");
- goto error;
- }
- ast_pthread_create(&o->sthread, NULL, sound_thread, o);
- /* link into list of devices */
- if (o != &oss_default) {
- o->next = oss_default.next;
- oss_default.next = o;
- }
- return o;
-
-error:
- if (o != &oss_default)
- free(o);
- return NULL;
-}
-
-int load_module()
-{
- int i;
- struct ast_config *cfg;
-
- /* load config file */
- cfg = ast_load(config);
- if (cfg != NULL) {
- char *ctg;
-
- store_config(cfg, NULL); /* init general category */
- ctg = ast_category_browse(cfg, NULL); /* initial category */
- while (ctg != NULL) {
- store_config(cfg, ctg);
- ctg = ast_category_browse(cfg, ctg);
- }
- ast_destroy(cfg);
- }
- if (find_desc(oss_active) == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", oss_active);
- /* XXX we could default to 'dsp' perhaps ? */
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- i = ast_channel_register(oss_default.type, tdesc,
- AST_FORMAT_SLINEAR, oss_request);
- if (i < 0) {
- ast_log(LOG_ERROR, "Unable to register channel class '%s'\n",
- oss_default.type);
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- for (i=0; i<sizeof(myclis)/sizeof(struct ast_cli_entry); i++)
- ast_cli_register(myclis + i);
- return 0;
-}
-
-
-int unload_module()
-{
- int x;
- struct chan_oss_pvt *o;
-
- /* XXX do we need a ast_channel_unregister oss_request ? */
- for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++)
- ast_cli_unregister(myclis + x);
-
- for (o = oss_default.next; o ; o = o->next) {
- close(o->sounddev);
- if (o->sndcmd[0] > 0) {
- close(o->sndcmd[0]);
- close(o->sndcmd[1]);
- }
- if (o->owner)
- ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD);
- if (o->owner) /* XXX how ??? */
- return -1;
- /* XXX what about the thread ? */
- /* XXX what about the memory allocated ? */
- }
- return 0;
-}
-
-char *description()
-{
- return desc;
-}
-
-int usecount() /* XXX is this per-device or global for the module ? */
-{
- int res;
- ast_mutex_lock(&usecnt_lock);
- res = usecnt;
- ast_mutex_unlock(&usecnt_lock);
- return res;
-}
-
-char *key()
-{
- return ASTERISK_GPL_KEY;
-}
diff --git a/net/asterisk10/files/patch-Makefile b/net/asterisk10/files/patch-Makefile
index 49c66ed..16f6b03 100644
--- a/net/asterisk10/files/patch-Makefile
+++ b/net/asterisk10/files/patch-Makefile
@@ -3,128 +3,200 @@ $FreeBSD$
--- Makefile.orig
+++ Makefile
-@@ -45,6 +45,19 @@
- PROC=$(shell uname -m)
- endif
-
-+ifeq (${OSARCH},FreeBSD)
-+ifeq ($(PROC),sparc64)
-+PROC=ultrasparc
-+OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
-+OPTIONS+=$(shell if $(CC) -mcpu=v9 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v9"; fi)
-+OPTIONS+=-fomit-frame-pointer
-+endif
-+ifeq ($(PROC),amd64)
-+PROC=k8
-+OPTIONS+=-m64
-+endif
-+endif
-+
- # Pentium Pro Optimize
- #PROC=i686
-
-@@ -63,10 +76,10 @@
+@@ -19,8 +19,8 @@
+ # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
+ # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
+ # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
+-CC=$(CROSS_COMPILE)gcc
+-HOST_CC=gcc
++CC?=$(CROSS_COMPILE)gcc
++HOST_CC=${CC}
+ # CROSS_ARCH=Linux
+ # CROSS_PROC=arm
+ # SUB_PROC=xscale # or maverick
+@@ -44,14 +44,14 @@
#K6OPT = -DK6OPT
- #Tell gcc to optimize the asterisk's code
+ #Tell gcc to optimize the code
-OPTIMIZE+=-O6
+#OPTIMIZE+=-O6
+ endif
- #Include debug symbols in the executables (-g) and profiling info (-pg)
--DEBUG=-g #-pg
-+#DEBUG=-g #-pg
+ #Overwite config files on "make samples"
+-OVERWRITE=y
++OVERWRITE=n
- # If you are running a radio application, define RADIO_RELAX so that the DTMF
- # will be received more reliably
-@@ -91,7 +104,7 @@
+ #Include debug and macro symbols in the executables (-g) and profiling info (-pg)
+-DEBUG=-g3 #-pg
++#DEBUG=-g3 #-pg
+
+ #Set NOCRYPTO to yes if you do not want to have crypto support or
+ #dependencies
+@@ -83,7 +83,7 @@
# Where to install asterisk after compiling
# Default -> leave empty
--INSTALL_PREFIX=
+-INSTALL_PREFIX?=
+INSTALL_PREFIX=$(PREFIX)
# Staging directory
# Files are copied here temporarily during the install process
-@@ -111,23 +124,23 @@
- # Don't use together with -DBUSYDETECT_TONEONLY
+@@ -106,17 +106,17 @@
BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
--ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
--ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
-+ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
-+ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
- ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
--ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
--ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
--ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
-+ASTSPOOLDIR=/var/spool/asterisk
-+ASTLOGDIR=/var/log/asterisk
-+ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
- ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
--ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
--ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
--ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
--ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
-+ASTBINDIR=$(INSTALL_PREFIX)/bin
-+ASTSBINDIR=$(INSTALL_PREFIX)/sbin
-+ASTVARRUNDIR=/var/run
-+ASTMANDIR=$(INSTALL_PREFIX)/man
-
- MODULES_DIR=$(ASTLIBDIR)/modules
- AGI_DIR=$(ASTVARLIBDIR)/agi-bin
-
- INCLUDE=-Iinclude -I../include
--CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
-+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
- CFLAGS+=$(OPTIMIZE)
+ ifneq ($(OSARCH),SunOS)
+- ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
+ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+ MODULES_DIR=$(ASTLIBDIR)/modules
+ AGI_DIR=$(ASTVARLIBDIR)/agi-bin
+ else
+@@ -218,13 +218,13 @@
+ endif
+
+ INCLUDE+=-Iinclude -I../include
+-ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
+-ASTCFLAGS+=$(OPTIMIZE)
++ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
++#ASTCFLAGS+=$(OPTIMIZE)
+ ASTOBJ=-o asterisk
+
+ ifeq ($(findstring BSD,$(OSARCH)),BSD)
+ PROC=$(shell uname -m)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
ifneq ($(PROC),ultrasparc)
-@@ -138,12 +151,8 @@
- CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi)
-
- ifeq (${OSARCH},FreeBSD)
--OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
--CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
--LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
--INCLUDE+=-I/usr/local/include
--CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
--MPG123TARG=freebsd
-+CFLAGS+=$(PTHREAD_CFLAGS)
-+LIBS+=$(PTHREAD_LIBS)
+@@ -235,8 +235,8 @@
+ ASTCFLAGS+=-fsigned-char
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h),)
+- ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/local/include/osp
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h),)
++ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp
+ else
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp
+@@ -245,27 +245,24 @@
+
+ ifeq ($(OSARCH),FreeBSD)
+ BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
+- ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
+- LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
+- ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp
++ ASTCFLAGS+=$(PTHREAD_CFLAGS)
++ LIBS+=$(PTHREAD_LIBS)
++ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp),)
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp
+ endif
+ MPG123TARG=freebsd
+
+- # XXX FreeBSD paths
+- PREFIX?=/usr/local
+- ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
+- ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
++ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
+- # XXX end FreeBSD paths
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+
endif # FreeBSD
- ifeq (${OSARCH},NetBSD)
-@@ -160,7 +169,10 @@
- #CFLAGS+=-DOLD_DSP_ROUTINES
+@@ -281,7 +278,7 @@
- CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
--CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPTEL_OPTIMIZATIONS
-+endif
+ ifeq ($(OSARCH),SunOS)
+ ASTCFLAGS+=-Wcast-align -DSOLARIS
+- INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
++ INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/include
+ endif
- LIBEDIT=editline/libedit.a
+ ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN)
+@@ -296,7 +293,7 @@
-@@ -222,7 +234,7 @@
- SOLINK=-shared -Xlinker -x
+ ifndef WITHOUT_ZAPTEL
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS
+ endif
+
+@@ -323,7 +320,7 @@
+ ASTERISKVERSIONNUM=999999
+ ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name)
+ else
+- ASTERISKVERSIONNUM=000000
++ ASTERISKVERSIONNUM?=000000
+ endif
+ endif
+
+@@ -388,10 +385,10 @@
endif
--CC=gcc
-+CC?=gcc
- INSTALL=install
+ ifeq ($(OSARCH),SunOS)
+- LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ OBJS+=strcompat.o
+ ASTLINK=
+- SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ endif
+
+ ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
+@@ -399,7 +396,7 @@
+ endif
- _all: all
-@@ -234,7 +246,7 @@
+ # This is used when generating the doxygen documentation
+-ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),)
++ifneq ($(wildcard $(LOCALBASE)/bin/dot)$(wildcard /usr/bin/dot),)
+ HAVEDOT=yes
+ else
+ HAVEDOT=no
+@@ -418,7 +415,7 @@
@echo " + $(MAKE) install +"
@echo " +-------------------------------------------+"
--all: depend asterisk subdirs
-+all: depend asterisk subdirs manpage
+-all: cleantest depend asterisk subdirs
++all: cleantest depend asterisk subdirs manpage
- editline/config.h:
- cd editline && unset CFLAGS LIBS && ./configure ; \
-@@ -243,13 +255,13 @@
+ #ifneq ($(wildcard tags),)
+ ctags: tags
+@@ -437,13 +434,13 @@
cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
$(MAKE) -C editline libedit.a
@@ -144,55 +216,57 @@ $FreeBSD$
+# fi
ifneq ($(wildcard .depend),)
- include .depend
-@@ -271,13 +283,10 @@
-
- asterisk.o: asterisk.c build.h
-
--manpage: asterisk.8.gz
-+manpage: asterisk.8
-
--asterisk.8.gz: asterisk.sgml
-- rm -f asterisk.8
-- docbook2man asterisk.sgml
-- mv ./*.8 asterisk.8
-- gzip asterisk.8
-+asterisk.8: asterisk.8.gz
-+ gzcat asterisk.8.gz > asterisk.8
-
- ifneq ($(strip $(ASTERISKVERSION)),)
- build.h: .version
-@@ -295,8 +304,8 @@
- exit 1; \
+ include .depend
+@@ -510,14 +507,14 @@
+ cygwin_a:
+ $(MAKE) -C cygwin all
+
+-asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
++asterisk: $(CYGLOADER) editline/libedit.a stdtime/libtime.a $(OBJS)
+ build_tools/make_build_h > include/asterisk/build.h.tmp
+ if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
+ mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
fi
-
--asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
-- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
-+asterisk: editline/libedit.a stdtime/libtime.a $(OBJS)
-+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) stdtime/libtime.a $(LIBS)
+ rm -f include/asterisk/build.h.tmp
+ $(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
+- $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
++ $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) stdtime/libtime.a $(LIBS)
muted: muted.o
- $(CC) -o muted muted.o
-@@ -315,28 +324,28 @@
- $(MAKE) -C stdtime clean
+ $(CC) $(AUDIO_LIBS) -o muted muted.o
+@@ -539,38 +536,38 @@
datafiles: all
+ if [ x`whoami` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
for x in sounds/digits/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
+ for x in sounds/dictate/*.gsm; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
+ else \
+ echo "No description for $$x"; \
+ exit 1; \
+ fi; \
+ done
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
for x in sounds/letters/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
else \
echo "No description for $$x"; \
@@ -202,17 +276,17 @@ $FreeBSD$
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
for x in sounds/phonetic/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
else \
echo "No description for $$x"; \
exit 1; \
-@@ -344,18 +353,18 @@
+@@ -578,18 +575,18 @@
done
- for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
@@ -224,70 +298,80 @@ $FreeBSD$
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images
for x in images/*.jpg; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
done
- mkdir -p $(DESTDIR)$(AGI_DIR)
+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
update:
- @if [ -d CVS ]; then \
-@@ -367,127 +376,90 @@
- fi
+ @if [ -d .svn ]; then \
+@@ -618,75 +615,53 @@
+ OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
bininstall: all
- mkdir -p $(DESTDIR)$(MODULES_DIR)
- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTETCDIR)
- mkdir -p $(DESTDIR)$(ASTBINDIR)
-- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
-- install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
+- if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ $(MKDIR) $(DESTDIR)$(MODULES_DIR)
+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTBINDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR)
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/dictate
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/system
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/tmp
-+ $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/meetme
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/monitor
++ if [ -f asterisk ]; then $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f cygwin/asterisk.exe ]; then $(BSD_INSTALL_PROGRAM) cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f asterisk.dll ]; then $(BSD_INSTALL_PROGRAM) asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
+- $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
+- $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
++ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
-- install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
+ chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
fi
for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
-- install -d $(DESTDIR)$(ASTHEADERDIR)
-- install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm
-- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
-- if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \
-- mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- else \
-- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \
-- fi
-- ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+ if [ -n "$(OLDHEADERS)" ]; then \
+ rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
+ fi
+ rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
+- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
-- install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 asterisk.8.gz $(DESTDIR)$(ASTMANDIR)/man8
-+ ln -sf $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv
++ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
@@ -295,14 +379,16 @@ $FreeBSD$
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
if [ -d contrib/firmware/iax ]; then \
-- install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
else \
echo "You need to do cvs update -d not just cvs update" ; \
fi
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . )
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
- if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
- @echo " +---- Asterisk Installation Complete -------+"
- @echo " + +"
@@ -325,85 +411,74 @@ $FreeBSD$
- @echo " + **Note** This requires that you have +"
- @echo " + doxygen installed on your local system +"
- @echo " +-------------------------------------------+"
-- @echo " + +"
-- @echo " + ** NOTE FOR DOWNGRADING FROM CVS HEAD ** +"
-- @echo " + +"
-- @echo " + If you are downgrading from CVS HEAD to +"
-- @echo " + a stable release, remember to delete +"
-- @echo " + everything from your asterisk modules +"
-- @echo " + directory (/usr/lib/asterisk/modules/) +"
-- @echo " + and the asterisk header directory +"
-- @echo " + (/usr/include/asterisk/) +"
-- @echo " + before doing a '$(MAKE) install'. +"
-- @echo " + +"
-- @echo " +-------------------------------------------+"
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/vm . )
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/voicemail . )
+ @$(MAKE) -s oldmodcheck
+ NEWMODS=$(notdir $(wildcard */*.so))
+@@ -710,7 +685,7 @@
+ echo " WARNING WARNING WARNING" ;\
+ fi
-install: all datafiles bininstall
+install: all datafiles bininstall samples
-
+ @if [ -x /usr/sbin/asterisk-post-install ]; then \
+ /usr/sbin/asterisk-post-install $(DESTDIR) . ; \
+ fi
+@@ -718,16 +693,19 @@
upgrade: all bininstall
- adsi: all
+ adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x`-dist; \
- if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
fi ; \
done
- samples: all datafiles adsi
+ samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
-- for x in configs/*.sample; do \
-- if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
++ echo ADSI INSTALL $(BSD_INSTALL_DATA)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
-+ for x in configs/*.sample channels/h323/*.sample; do \
+ for x in configs/*.sample; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`-dist;\
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+ if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
+ if [ "$(OVERWRITE)" = "y" ]; then \
+ if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
+@@ -740,7 +718,7 @@
+ continue; \
+ fi ;\
fi ; \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
done
-- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-+ echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
-+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist $(DESTDIR)$(ASTETCDIR)/asterisk.conf; \
-+ fi
+ if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ ( \
+@@ -759,25 +737,25 @@
+ echo ";astctlowner = root" ; \
+ echo ";astctlgroup = apache" ; \
+ echo ";astctl = asterisk.ctl" ; \
+- ) > $(DESTDIR)$(ASTCONFPATH) ; \
++ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ else \
+ echo "Skipping asterisk.conf creation"; \
+ fi
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
for x in sounds/demo-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
for x in sounds/*.mp3; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
done
rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3
@@ -412,18 +487,18 @@ $FreeBSD$
:> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
-@@ -502,7 +474,7 @@
- @[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 )
- @[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 )
- install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi
-- mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk
-+ $(MKDIR) $(DESTDIR)$(HTTPDIR)/html/_asterisk
+@@ -791,7 +769,7 @@
+ @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
+ @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
+ $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
+- mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
++ $(MKDIR) $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
for x in images/*.gif; do \
- install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
done
-@@ -522,10 +494,10 @@
+@@ -820,10 +798,10 @@
- __rpm: _version
+ __rpm: include/asterisk/version.h spec
rm -rf /tmp/asterisk ; \
- mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
+ $(MKDIR) /tmp/asterisk/redhat/RPMS/i386 ; \
@@ -431,6 +506,6 @@ $FreeBSD$
$(MAKE) DESTDIR=/tmp/asterisk samples ; \
- mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
+ $(MKDIR) /tmp/asterisk/etc/rc.d/init.d ; \
- cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
- sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
+ cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
+
diff --git a/net/asterisk10/files/patch-agi::Makefile b/net/asterisk10/files/patch-agi::Makefile
index 32efb5d..b359765 100644
--- a/net/asterisk10/files/patch-agi::Makefile
+++ b/net/asterisk10/files/patch-agi::Makefile
@@ -1,9 +1,9 @@
$FreeBSD$
---- agi/Makefile.orig Tue Jun 22 20:42:13 2004
-+++ agi/Makefile Tue Oct 5 21:03:40 2004
-@@ -11,15 +11,18 @@
+--- agi/Makefile.orig Thu Jan 12 15:42:07 2006
++++ agi/Makefile Thu Jan 12 15:44:39 2006
+@@ -11,7 +11,9 @@
# the GNU General Public License
#
@@ -14,14 +14,15 @@ $FreeBSD$
CFLAGS+=
+@@ -27,8 +29,9 @@
all: depend $(AGIS)
install: all
- mkdir -p $(DESTDIR)$(AGI_DIR)
- for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
-+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
++ $(MKDIR) -p $(DESTDIR)$(AGI_DIR)
+ for x in $(AGIS_BIN); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(AGI_DIR) ; done
+ for x in $(AGIS_SCR); do $(BSD_INSTALL_SCRIPT) $$x $(DESTDIR)$(AGI_DIR) ; done
eagi-test: eagi-test.o
- $(CC) $(CFLAGS) -o eagi-test eagi-test.o
+ $(CC) $(CFLAGS) -o eagi-test eagi-test.o $(LIBS)
diff --git a/net/asterisk10/files/patch-apps::Makefile b/net/asterisk10/files/patch-apps::Makefile
index 44f8495..ee7d560 100644
--- a/net/asterisk10/files/patch-apps::Makefile
+++ b/net/asterisk10/files/patch-apps::Makefile
@@ -1,38 +1,56 @@
---- apps/Makefile.orig Wed Jun 22 14:40:11 2005
-+++ apps/Makefile Wed Jun 22 14:43:45 2005
-@@ -40,9 +40,13 @@
+
+$FreeBSD$
+
+--- apps/Makefile.orig
++++ apps/Makefile
+@@ -45,25 +45,27 @@
#APPS+=app_rpt.so
- APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
--APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
- APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi)
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h),)
+ APPS+=app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so
+ endif
+ endif # WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ifdef WITH_FAX
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/spandsp.h ]; then echo "app_rxfax.so app_txfax.so" ; fi)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp.h),)
++APPS+=app_rxfax.so app_txfax.so
++endif
+endif
+
- CFLAGS+=-fPIC
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ APPS+=app_osplookup.so
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+-CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+-CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
+-ifneq ($(shell if [[ 0x`$(CROSS_COMPILE_BIN)curl-config --vernum` -ge 0x70907 ]]; then echo "OK" ; fi),)
+- ifneq (${CURLLIBS},)
+- APPS+=app_curl.so
+- endif
+-endif
++CURLLIBS=$(shell $(CROSS_COMPILE_BIN)$(LOCALBASE)/bin/curl-config --libs)
++APPS+=app_curl.so
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
-@@ -65,12 +69,12 @@
- $(CC) $(SOLINK) -o $@ $< -ltonezone
+ ifeq (${OSARCH},CYGWIN)
+ CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
+@@ -95,24 +97,32 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -ltonezone
install: all
- for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(APPS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
+ rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
- app_voicemail.so : app_voicemail.o
- ifeq ($(USE_MYSQL_VM_INTERFACE),1)
-- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L/usr/lib/mysql -lmysqlclient -lz
-+ $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L$(LOCALBASE)/lib/mysql -lmysqlclient -lz
- else
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lpq
-@@ -79,17 +83,25 @@
- endif
- endif
+ app_curl.so: app_curl.o
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
+ifdef WITH_FAX
+app_rxfax.so : app_rxfax.o
@@ -47,15 +65,15 @@
+ $(CC) -I$(LOCALBASE)/include/pgsql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
app_sql_postgres.so: app_sql_postgres.o
-- $(CC) $(SOLINK) -o $@ $< -L/usr/local/pgsql/lib -lpq
-+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lpq
+- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
++ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L$(LOCALBASE)/lib -lpq
app_sql_odbc.so: app_sql_odbc.o
- $(CC) $(SOLINK) -o $@ $< -lodbc
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
look: look.c
- $(CC) -pipe -O6 -g look.c -o look -lncurses
-+ $(CC) $(CFLAGS) look.c -o look -lncurses
++ $(CC) look.c -o look -lncurses
- ifneq ($(wildcard .depend),)
- include .depend
+ ifeq (SunOS,$(shell uname))
+ app_chanspy.so: app_chanspy.o
diff --git a/net/asterisk10/files/patch-apps::app_rxfax.c b/net/asterisk10/files/patch-apps::app_rxfax.c
index 88362bfc..820208e 100644
--- a/net/asterisk10/files/patch-apps::app_rxfax.c
+++ b/net/asterisk10/files/patch-apps::app_rxfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_rxfax.c.orig
-+++ apps/app_rxfax.c
-@@ -0,0 +1,371 @@
+--- /dev/null Thu Jan 12 17:44:40 2006
++++ apps/app_rxfax.c Thu Jan 12 17:41:53 2006
+@@ -0,0 +1,373 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <asterisk/dsp.h>
+#include <asterisk/manager.h>
++#include <asterisk/version.h>
+#include <string.h>
+#include <stdlib.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
@@ -100,7 +102,7 @@ $FreeBSD$
+ "FaxReceived", "Channel: %s\nExten: %s\nCallerID: %s\nRemoteStationID: %s\nLocalStationID: %s\nPagesTransferred: %i\nResolution: %i\nTransferRate: %i\nFileName: %s\n",
+ chan->name,
+ chan->exten,
-+#if (ASTERISK_VERSION_NUM <= 011000)
++#if ASTERISK_VERSION_NUM <= 010010
+ chan->callerid,
+#else
+ (chan->cid.cid_num) ? chan->cid.cid_num : "",
diff --git a/net/asterisk10/files/patch-apps::app_txfax.c b/net/asterisk10/files/patch-apps::app_txfax.c
index 8daf0f9..15ad667 100644
--- a/net/asterisk10/files/patch-apps::app_txfax.c
+++ b/net/asterisk10/files/patch-apps::app_txfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_txfax.c.orig
-+++ apps/app_txfax.c
-@@ -0,0 +1,293 @@
+--- /dev/null Thu Jan 12 17:48:54 2006
++++ apps/app_txfax.c Thu Jan 12 17:48:36 2006
+@@ -0,0 +1,295 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <string.h>
+#include <stdlib.h>
++#include <math.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
+#include <inttypes.h>
+#else
diff --git a/net/asterisk10/files/patch-astman::Makefile b/net/asterisk10/files/patch-astman::Makefile
deleted file mode 100644
index 2745860..0000000
--- a/net/asterisk10/files/patch-astman::Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-
-$FreeBSD$
-
---- astman/Makefile.orig Sat Jun 26 22:25:39 2004
-+++ astman/Makefile Thu Oct 14 19:14:22 2004
-@@ -5,16 +5,16 @@
-
- OSARCH=$(shell uname -s)
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS+=-I/usr/local/include -L/usr/local/lib
-+CFLAGS+=-I$(LOCALBASE)/include -L$(LOCALBASE)/lib
- endif
-
--TARGET=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else if [ -f /usr/local/include/newt.h ]; then echo "astman"; else echo "none" ; fi ; fi)
-+TARGET=astman
- all: depend $(TARGET)
-
- install:
- if [ "$(TARGET)" != "none" ]; then \
- for x in $(TARGET); do \
-- install -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
-+ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
- done ; \
- fi
-
diff --git a/net/asterisk10/files/patch-cdr::Makefile b/net/asterisk10/files/patch-cdr::Makefile
index 1d0fb20..da16b60 100644
--- a/net/asterisk10/files/patch-cdr::Makefile
+++ b/net/asterisk10/files/patch-cdr::Makefile
@@ -1,51 +1,65 @@
---- cdr/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ cdr/Makefile Tue Aug 9 17:28:11 2005
-@@ -21,7 +21,7 @@
- OSARCH=$(shell uname -s)
-
- ifeq (${OSARCH},FreeBSD)
--SOLINK+=-L/usr/local/lib
-+SOLINK+=-L$(LOCALBASE)/lib
+
+$FreeBSD$
+
+--- cdr/Makefile.orig Tue Nov 29 20:24:39 2005
++++ cdr/Makefile Thu Jan 12 17:56:23 2006
+@@ -21,8 +21,8 @@
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
endif
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
-@@ -37,18 +37,23 @@
+@@ -38,18 +38,18 @@
#
# unixODBC stuff...
#
-+ifdef WITH_ODBC
- MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/odbcinst.h),)
+ MODS+=cdr_odbc.so
+ endif
#
# FreeTDS stuff...
#
-+ifdef WITH_FREETDS
- MODS+=$(shell if [ -f "/usr/include/tds.h" ]; then echo "cdr_tds.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/tds.h" ]; then echo "cdr_tds.so"; fi)
-+endif
-
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h),)
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.63),1)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tds.h),)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.63),1)
+ CFLAGS += -DFREETDS_0_63
+ else
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.62),1)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.62),1)
+ CFLAGS += -DFREETDS_0_62
+ else
+ CFLAGS += -DFREETDS_PRE_0_62
+@@ -61,7 +61,7 @@
#
# PGSQL stuff... Autoconf anyone??
#
-+ifdef WITH_PGSQL
- MODS+=$(shell if [ -d /usr/local/pgsql/include ] || [ -d /usr/include/pgsql ] || [ -d /usr/local/include/pgsql ] || [ -d /opt/pgsql/include ] || [ -f /usr/include/libpq-fe.h ] ; then echo "cdr_pgsql.so"; fi)
- CFLAGS+=$(shell if [ -d /usr/local/pgsql/include ]; then echo "-I/usr/local/pgsql/include"; fi)
- CFLAGS+=$(shell if [ -d /usr/include/pgsql ]; then echo "-I/usr/include/pgsql"; fi)
-@@ -62,16 +67,19 @@
- MLFLAGS+=$(shell if [ -d /usr/local/lib/pgsql ]; then echo "-L/usr/local/lib/pgsql"; fi)
- MLFLAGS+=$(shell if [ -d /opt/pgsql/lib ]; then echo "-L/opt/pgsql/lib"; fi)
- MLFLAGS+=$(shell if [ -f /usr/lib/libpq.so ]; then echo "-L/usr/lib"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
+ MODS+=cdr_pgsql.so
+ endif
- #
- # SQLIte stuff...
- #
-+ifdef WITH_SQLITE
- MODS+=$(shell if [ -f "/usr/include/sqlite.h" ]; then echo "cdr_sqlite.so"; fi)
-+endif
+@@ -82,9 +82,9 @@
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/pgsql
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql),)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/pgsql
+- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib/pgsql
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql),)
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql
++ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/pgsql
+ endif
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include),)
+@@ -110,7 +110,7 @@
all: depend $(MODS)
install: all
diff --git a/net/asterisk10/files/patch-channels::Makefile b/net/asterisk10/files/patch-channels::Makefile
index 7ecab67..edca9b1 100644
--- a/net/asterisk10/files/patch-channels::Makefile
+++ b/net/asterisk10/files/patch-channels::Makefile
@@ -1,97 +1,85 @@
---- channels/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ channels/Makefile Tue Aug 9 17:34:28 2005
-@@ -57,10 +57,10 @@
-
+
+$FreeBSD$
+
+--- channels/Makefile.orig
++++ channels/Makefile
+@@ -48,9 +48,9 @@
endif
+
ifeq (${OSARCH},FreeBSD)
--PTLIB=-lpt_FreeBSD_x86_r
--H323LIB=-lh323_FreeBSD_x86_r
--CHANH323LIB=-pthread
--SOLINK+=-L/usr/local/lib
-+PTLIB=-lpt_FreeBSD_x86_r_s
-+H323LIB=-lh323_FreeBSD_x86_r_s
-+CHANH323LIB=
-+SOLINK+=-L$(LOCALBASE)/lib
+- PTLIB=-lpt_FreeBSD_x86_r
+- H323LIB=-lh323_FreeBSD_x86_r
+- CHANH323LIB=-pthread
++ PTLIB=-lpt_FreeBSD_x86_r_s
++ H323LIB=-lh323_FreeBSD_x86_r_s
++ CHANH323LIB=
endif
+
ifeq (${OSARCH},NetBSD)
- PTLIB=-lpt_NetBSD_x86_r
-@@ -72,19 +72,23 @@
+@@ -73,11 +73,11 @@
+ SOLINK+=-lrt
endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/ixjuser.h ] && echo chan_phone.so)
-+ifdef WITH_H323
-+CHANNEL_LIBS+=chan_h323.so
-+endif
-
- CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
- CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
- CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
--CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
- CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
- CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
--ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
-+ZAPPRI=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo "-lpri")
- ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
-+ifdef WITH_ZAPTEL
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "-DIAX_TRUNKING -I$(LOCALBASE)/include")
-+endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
- CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX")
-
-@@ -106,8 +110,10 @@
-
- ZAPDIR=/usr/lib
-
-+ifdef WITH_ZAPTEL
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so")
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "chan_zap.so")
-+endif
-
- CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/ixjuser.h),)
+ CHANNEL_LIBS+=chan_phone.so
+ endif
-@@ -156,6 +162,8 @@
- chan_oss.so: chan_oss.o
- $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
+-ifneq ($(wildcard h323/libchanh323.a),)
++ifdef WITH_H323
+ CHANNEL_LIBS+=chan_h323.so
endif
-+chan_oss.so: chan_oss.o
-+ $(CC) $(SOLINK) -o $@ chan_oss.o
- chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o
- ifeq ($(USE_MYSQL_FRIENDS),1)
-@@ -175,7 +183,7 @@
- $(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c
+@@ -91,12 +91,12 @@
+ CHANNEL_LIBS+=chan_alsa.so
+ endif
- chan_zap.so: chan_zap.o
-- $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -ltonezone
-+ $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -L$(LOCALBASE)/lib -ltonezone
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libpri.so.1),)
+ CFLAGS+=-DZAPATA_PRI
+ ZAPPRI=-lpri
+ endif
- chan_sip.so: chan_sip.o
- ifeq ($(USE_SIP_MYSQL_FRIENDS),1)
-@@ -199,15 +207,17 @@
- chan_vpb.so: chan_vpb.o
- $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libmfcr2.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libmfcr2.so.1),)
+ CFLAGS+=-DZAPATA_R2
+ ZAPR2=-lmfcr2
+ endif
+@@ -109,12 +109,12 @@
+ endif
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ifeq (${OSARCH},NetBSD)
+ SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/pkg/lib
+ endif
+ ifeq (${OSARCH},FreeBSD)
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ CFLAGS+=-DIAX_TRUNKING
+ CHANNEL_LIBS+=chan_zap.so
+@@ -229,8 +229,10 @@
+ chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast
+ $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
+ else
-chan_h323.so: chan_h323.o h323/libchanh323.a
- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
+chan_h323.so: chan_h323.o h323/ast_h323.o
-+ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -lcrypto -lssl -L$(LOCALBASE)/lib -lexpat -llber -lldap -lldap_r
-
++ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o $(CHANH323LIB) -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L/usr/lib -lcrypto -lssl -lexpat -L$(LOCALBASE)/lib -llber -lldap -lldap_r
+h323/ast_h323.o:
+ $(MAKE) -C h323 ast_h323.o
+ endif
- #chan_modem.so : chan_modem.o
+ chan_misdn.so: chan_misdn.o chan_misdn_config.o misdn/chan_misdn_lib.a
+@@ -244,8 +246,7 @@
# $(CC) -rdynamic -shared -Xlinker -x -o $@ $<
install: all
- for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
+ for x in $(CHANNEL_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
depend: .depend
+
diff --git a/net/asterisk10/files/patch-channels::chan_h323.c b/net/asterisk10/files/patch-channels::chan_h323.c
index de2ed39..6498b97 100644
--- a/net/asterisk10/files/patch-channels::chan_h323.c
+++ b/net/asterisk10/files/patch-channels::chan_h323.c
@@ -1,14 +1,14 @@
$FreeBSD$
---- channels/chan_h323.c 2004/10/10 13:00:17 1.1
-+++ channels/chan_h323.c 2004/10/10 13:00:39
-@@ -26,7 +26,7 @@
- * Version Info: $Id: patch-channels::chan_h323.c,v 1.3.2.3 2004/10/14 14:30:13 sobomax Exp $
- */
+--- channels/chan_h323.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_h323.c Thu Jan 12 18:29:50 2006
+@@ -2281,7 +2281,7 @@ static char *convertcap(int cap)
+ }
+ }
--
-+#include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/signal.h>
- #include <sys/param.h>
+-static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs)
++static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active)
+ {
+ /* XXX Deal with Video */
+ struct oh323_pvt *pvt;
diff --git a/net/asterisk10/files/patch-channels::chan_sip.c b/net/asterisk10/files/patch-channels::chan_sip.c
index e634ce4..355c558 100644
--- a/net/asterisk10/files/patch-channels::chan_sip.c
+++ b/net/asterisk10/files/patch-channels::chan_sip.c
@@ -1,144 +1,131 @@
$FreeBSD$
---- channels/chan_sip.c.orig Sun Feb 17 18:01:43 2002
-+++ channels/chan_sip.c Sun Feb 17 18:10:52 2002
-@@ -141,7 +141,7 @@
+--- channels/chan_sip.c.orig Thu Jan 12 18:43:37 2006
++++ channels/chan_sip.c Thu Jan 12 18:50:11 2006
+@@ -336,7 +336,7 @@ static char global_vmexten[AST_MAX_EXTEN
static char default_language[MAX_LANGUAGE] = "";
--static char default_callerid[AST_MAX_EXTENSION] = "asterisk";
-+static char default_callerid[AST_MAX_EXTENSION] = "Unknown";
+-#define DEFAULT_CALLERID "asterisk"
++#define DEFAULT_CALLERID "Unknown"
+ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID;
static char default_fromdomain[AST_MAX_EXTENSION] = "";
+@@ -474,6 +474,7 @@ struct sip_invite_param {
-@@ -244,6 +244,7 @@
struct sip_route {
struct sip_route *next;
- char hop[0];
+ int lr;
+ char hop[0];
};
- struct sip_history {
-@@ -2218,7 +2219,7 @@
- if (p->owner) {
- /* We already hold the channel lock */
- if (f->frametype == AST_FRAME_VOICE) {
-- if (f->subclass != p->owner->nativeformats) {
-+ if (!(f->subclass & p->owner->nativeformats)) {
- ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
- p->owner->nativeformats = f->subclass;
- ast_set_read_format(p->owner, p->owner->readformat);
-@@ -4620,6 +4621,10 @@
+@@ -5993,6 +5994,7 @@ static void build_route(struct sip_pvt *
/* Make a struct route */
- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
+ thishop = malloc(sizeof(*thishop) + len);
if (thishop) {
-+ if (strnstr(rr, ";lr", len) != NULL)
-+ thishop->lr = 1;
-+ else
-+ thishop->lr = 0;
- strncpy(thishop->hop, rr, len); /* safe */
- thishop->hop[len] = '\0';
++ thishop->lr = (strnstr(rr, ";lr", len) != NULL ? 1 : 0);
+ ast_copy_string(thishop->hop, rr, len);
ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop);
-@@ -4643,31 +4648,41 @@
- rr += len+1;
- }
- }
-- /* 2nd append the Contact: if there is one */
-- /* Can be multiple Contact headers, comma separated values - we just take the first */
-- contact = get_header(req, "Contact");
-- if (!ast_strlen_zero(contact)) {
-- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-- /* Look for <: delimited address */
-- c = strchr(contact, '<');
-- if (c) {
-- /* Take to > */
-- ++c;
-- len = strcspn(c, ">");
-- } else {
-- /* No <> - just take the lot */
-- c = contact; len = strlen(contact);
-- }
-- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ /* Duplicate first route from the list */
-+ if (head && head->lr) {
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
- if (thishop) {
-- strncpy(thishop->hop, c, len); /* safe */
-- thishop->hop[len] = '\0';
-- thishop->next = NULL;
-- /* Goes at the end */
-- if (tail)
-- tail->next = thishop;
-- else
-- head = thishop;
-+ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
-+ thishop->next = head;
-+ head = thishop;
-+ }
-+ } else {
-+ /* Append the Contact: if there is one and first route is w/o `lr' param */
-+ /* Can be multiple Contact headers, comma separated values - we just take the first */
-+ contact = get_header(req, "Contact");
-+ if (!ast_strlen_zero(contact)) {
-+ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-+ /* Look for <: delimited address */
-+ c = strchr(contact, '<');
-+ if (c) {
-+ /* Take to > */
-+ ++c;
-+ len = strcspn(c, ">");
-+ } else {
-+ /* No <> - just take the lot */
-+ c = contact; len = strlen(contact);
-+ }
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ if (thishop) {
-+ strncpy(thishop->hop, c, len); /* safe */
-+ thishop->hop[len] = '\0';
-+ thishop->next = NULL;
-+ /* Goes at the end */
-+ if (tail)
-+ tail->next = thishop;
-+ else
-+ head = thishop;
+ /* Link in */
+@@ -6018,31 +6020,41 @@ static void build_route(struct sip_pvt *
+
+ /* Only append the contact if we are dealing with a strict router */
+ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) {
+- /* 2nd append the Contact: if there is one */
+- /* Can be multiple Contact headers, comma separated values - we just take the first */
+- contact = get_header(req, "Contact");
+- if (!ast_strlen_zero(contact)) {
+- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
+- /* Look for <: delimited address */
+- c = strchr(contact, '<');
+- if (c) {
+- /* Take to > */
+- ++c;
+- len = strcspn(c, ">") + 1;
+- } else {
+- /* No <> - just take the lot */
+- c = contact;
+- len = strlen(contact) + 1;
+- }
+- thishop = malloc(sizeof(*thishop) + len);
++ /* Duplicate first route from the list */
++ if (head && head->lr) {
++ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
+ if (thishop) {
+- ast_copy_string(thishop->hop, c, len);
+- thishop->next = NULL;
+- /* Goes at the end */
+- if (tail)
+- tail->next = thishop;
+- else
+- head = thishop;
++ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
++ thishop->next = head;
++ head = thishop;
+ }
++ } else {
++ /* Append the Contact: if there is one and first route is w/o `lr' param */
++ /* Can be multiple Contact headers, comma separated values - we just take the first */
++ contact = get_header(req, "Contact");
++ if (!ast_strlen_zero(contact)) {
++ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
++ /* Look for <: delimited address */
++ c = strchr(contact, '<');
++ if (c) {
++ /* Take to > */
++ ++c;
++ len = strcspn(c, ">") + 1;
++ } else {
++ /* No <> - just take the lot */
++ c = contact;
++ len = strlen(contact) + 1;
++ }
++ thishop = malloc(sizeof(*thishop) + len);
++ if (thishop) {
++ ast_copy_string(thishop->hop, c, len);
++ thishop->next = NULL;
++ /* Goes at the end */
++ if (tail)
++ tail->next = thishop;
++ else
++ head = thishop;
++ }
+ }
}
}
- /* Store as new route */
-@@ -7338,7 +7353,11 @@
- /* Get destination right away */
- gotdest = get_destination(p, NULL);
- get_rdnis(p, NULL);
-- extract_uri(p, req);
-+ build_route(p, req, 0);
-+ if (!p->route->lr)
-+ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
-+ else
-+ extract_uri(p, req);
- build_contact(p);
+@@ -10336,7 +10348,11 @@ static int handle_request_invite(struct
+ gotdest = get_destination(p, NULL);
- if (gotdest) {
-@@ -7366,7 +7385,6 @@
- c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
- *recount = 1;
- /* Save Record-Route for any later requests we make on this dialogue */
-- build_route(p, req, 0);
- if (c) {
- /* Pre-lock the call */
- ast_mutex_lock(&c->lock);
-@@ -7426,6 +7444,14 @@
- transmit_response(p, "180 Ringing", req);
- break;
- case AST_STATE_UP:
-+ /* Assuming this to be reinvite, process new SDP portion */
-+ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
-+ process_sdp(p, req);
-+ } else {
-+ p->jointcapability = p->capability;
-+ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
-+ }
-+
- transmit_response_with_sdp(p, "200 OK", req, 1);
- break;
- default:
+ get_rdnis(p, NULL);
+- extract_uri(p, req);
++ build_route(p, req, 0);
++ if (!p->route->lr)
++ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
++ else
++ extract_uri(p, req);
+ build_contact(p);
+
+ if (gotdest) {
+@@ -10364,7 +10380,6 @@ static int handle_request_invite(struct
+ c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
+ *recount = 1;
+ /* Save Record-Route for any later requests we make on this dialogue */
+- build_route(p, req, 0);
+ if (c) {
+ /* Pre-lock the call */
+ ast_mutex_lock(&c->lock);
+@@ -10450,6 +10465,13 @@ static int handle_request_invite(struct
+ transmit_response(p, "180 Ringing", req);
+ break;
+ case AST_STATE_UP:
++ /* Assuming this to be reinvite, process new SDP portion */
++ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
++ process_sdp(p, req);
++ } else {
++ p->jointcapability = p->capability;
++ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
++ }
+ transmit_response_with_sdp(p, "200 OK", req, 1);
+ break;
+ default:
diff --git a/net/asterisk10/files/patch-channels::chan_zap.c b/net/asterisk10/files/patch-channels::chan_zap.c
index 458a6147..ab02c02 100644
--- a/net/asterisk10/files/patch-channels::chan_zap.c
+++ b/net/asterisk10/files/patch-channels::chan_zap.c
@@ -1,85 +1,65 @@
$FreeBSD$
---- channels/chan_zap.c.orig Sun Feb 17 18:01:44 2002
-+++ channels/chan_zap.c Sun Feb 17 18:03:26 2002
-@@ -46,7 +46,9 @@
- #include <sys/signal.h>
- #include <errno.h>
- #include <stdlib.h>
-+#ifndef __FreeBSD__
- #include <stdint.h>
-+#endif
- #include <unistd.h>
- #include <sys/ioctl.h>
- #ifdef __linux__
-@@ -320,7 +322,7 @@
- #define CALLWAITING_REPEAT_SAMPLES ( (10000 * 8) / READ_SIZE) /* 300 ms */
- #define CIDCW_EXPIRE_SAMPLES ( (500 * 8) / READ_SIZE) /* 500 ms */
- #define MIN_MS_SINCE_FLASH ( (2000) ) /* 2000 ms */
--#define RINGT ( (8000 * 8) / READ_SIZE)
-+#define RINGT ( (8000 * 8) / READ_SIZE) /* 8000 ms */
-
- struct zt_pvt;
-
-@@ -535,6 +537,7 @@
- int cidpos;
+--- channels/chan_zap.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_zap.c Fri Jan 13 13:28:33 2006
+@@ -638,6 +638,7 @@ static struct zt_pvt {
int cidlen;
int ringt;
+ int ringt_base;
+ int waitnorings;
int stripmsd;
- int callwaiting;
int callwaitcas;
-@@ -2134,12 +2137,20 @@
-
- if (option_debug)
- ast_log(LOG_DEBUG, "zt_hangup(%s)\n", ast->name);
-+
- if (!ast->pvt->pvt) {
- ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
- return 0;
+ int callwaitrings;
+@@ -2308,6 +2309,19 @@ static int zt_hangup(struct ast_channel
}
ast_mutex_lock(&p->lock);
++ switch (p->sig) {
++ case SIG_FXSGS:
++ case SIG_FXSKS:
++ case SIG_FXSLS:
++ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
++ {
++ p->waitnorings = 1;
++ }
++ break;
++ default:
++ break;
++ };
+
-+
-+ if((p->sig == SIG_FXSGS) || (p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS))
-+ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
-+ {
-+ p->waitnorings = 1;
-+ }
index = zt_get_index(ast, p, 1);
-@@ -5717,7 +5728,37 @@
+@@ -6129,7 +6143,37 @@ static void *ss_thread(void *data)
ast_setstate(chan, AST_STATE_RING);
chan->rings = 1;
- p->ringt = RINGT;
+ p->ringt = p->ringt_base;
+ p->waitnorings = 0;
res = ast_pbx_run(chan);
+
+ if(p->waitnorings)
+ {
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+ for(;;)
+ {
+ int i,j=0;
+ i = ZT_IOMUX_SIGEVENT | ZT_IOMUX_NOWAIT;
-+ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
++ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
+ break;
-+
-+ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
++
++ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
+ break;
-+
++
+ if(j == ZT_EVENT_RINGOFFHOOK)
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+
+ usleep(20000);
+
+ if (p->ringt <= 0)
+ break;
+
-+ else if (p->ringt > 0)
++ else if (p->ringt > 0)
+ p->ringt--;
+ }
+ p->ringt = 0;
@@ -89,7 +69,7 @@ $FreeBSD$
if (res) {
ast_hangup(chan);
ast_log(LOG_WARNING, "PBX exited non-zero\n");
-@@ -6018,7 +6059,7 @@
+@@ -6431,7 +6475,7 @@ static void *do_monitor(void *data)
i = iflist;
while(i) {
if ((i->subs[SUB_REAL].zfd > -1) && i->sig && (!i->radio)) {
diff --git a/net/asterisk10/files/patch-channels::h323::Makefile b/net/asterisk10/files/patch-channels::h323::Makefile
deleted file mode 100644
index 779096b..0000000
--- a/net/asterisk10/files/patch-channels::h323::Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-
-$FreeBSD$
-
---- channels/h323/Makefile.orig
-+++ channels/h323/Makefile
-@@ -53,7 +53,7 @@
- LIBS+=-lpthread
- endif
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS += -pthread
-+CFLAGS += $(PTHREAD_LIBS)
- endif
- CFLAGS += -D_REENTRANT -D_GNU_SOURCE
- CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
-@@ -77,20 +77,20 @@
- ar cr libchanh323.a ast_h323.o
-
- ast_h323.o: ast_h323.cpp
-- $(CXX) -g -c -fno-rtti -o $@ $(CFLAGS) $<
-+ $(CXX) $(CXXFLAGS) -c -fno-rtti -o $@ $(CFLAGS) $<
-
- ifneq ($(wildcard .depend),)
- include .depend
- endif
-
- chan_h323.so:
-- $(CXX) -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_d.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_s.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
- clean:
- rm -f *.o *.so core.* libchanh323.a .depend
-
diff --git a/net/asterisk10/files/patch-channels::h323::ast_h323.cpp b/net/asterisk10/files/patch-channels::h323::ast_h323.cpp
new file mode 100644
index 0000000..feb79e5
--- /dev/null
+++ b/net/asterisk10/files/patch-channels::h323::ast_h323.cpp
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.cpp.orig Thu Jan 12 18:16:08 2006
++++ channels/h323/ast_h323.cpp Thu Jan 12 18:16:35 2006
+@@ -953,8 +953,8 @@ BOOL MyH323Connection::OnReceivedCapabil
+ H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capability & capability,
+ H323Channel::Directions dir,
+ unsigned sessionID,
+- const H245_H2250LogicalChannelParameters * /*param*/,
+- RTP_QOS * /*param*/ )
++ const H245_H2250LogicalChannelParameters * /*param*/ /*,
++ RTP_QOS * */ /*param*/ )
+ {
+ return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID);
+ }
diff --git a/net/asterisk10/files/patch-channels::h323::ast_h323.h b/net/asterisk10/files/patch-channels::h323::ast_h323.h
new file mode 100644
index 0000000..606bb01
--- /dev/null
+++ b/net/asterisk10/files/patch-channels::h323::ast_h323.h
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.h.orig Thu Jan 12 18:14:49 2006
++++ channels/h323/ast_h323.h Thu Jan 12 18:15:02 2006
+@@ -155,8 +155,8 @@ class MyH323Connection : public H323Conn
+ H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
+ H323Channel::Directions,
+ unsigned,
+- const H245_H2250LogicalChannelParameters *,
+- RTP_QOS *);
++ const H245_H2250LogicalChannelParameters * /* ,
++ RTP_QOS * */);
+ H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
+ const H323SignalPDU &,
+ H323SignalPDU &);
diff --git a/net/asterisk10/files/patch-codecs::Makefile b/net/asterisk10/files/patch-codecs::Makefile
index 325e590..ab5cbc4 100644
--- a/net/asterisk10/files/patch-codecs::Makefile
+++ b/net/asterisk10/files/patch-codecs::Makefile
@@ -1,39 +1,48 @@
---- codecs/Makefile.orig Thu Mar 17 20:43:51 2005
-+++ codecs/Makefile Thu Apr 14 00:09:04 2005
-@@ -17,25 +17,23 @@
- # g723.1b)
- #
- #MODG723=codec_g723_1.so codec_g723_1b.so
--MODG723=$(shell [ -f g723.1/coder.c ] && echo "codec_g723_1.so")
--MODG723+=$(shell [ -f g723.1b/coder2.c ] && echo "codec_g723_1b.so")
--MODSPEEX=$(shell [ -f /usr/include/speex.h ] || [ -f /usr/include/speex/speex.h ] || [ -f /usr/local/include/speex.h ] || [ -f /usr/local/include/speex/speex.h ] && echo "codec_speex.so")
--MODILBC=$(shell [ -f ilbc/iLBC_decode.h ] && echo "codec_ilbc.so")
-+MODG723=codec_g723_1_dummy.so
-+MODG729=codec_g729_dummy.so
-+MODSPEEX=codec_speex.so
-+MODILBC=codec_ilbc.so
- CFLAGS+=-fPIC
--CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include")
--CFLAGS+=$(shell [ -f /usr/local/include/speex/speex.h ] && echo "-I/usr/local/include/speex")
--CFLAGS+=$(shell [ -f /usr/include/speex/speex.h ] && echo "-I/usr/include/speex")
-+CFLAGS+=-I$(LOCALBASE)/include
+
+$FreeBSD$
+
+--- codecs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ codecs/Makefile Fri Jan 13 10:33:21 2006
+@@ -30,8 +30,8 @@
- LIBG723=g723.1/libg723.a
- LIBG723B=g723.1b/libg723b.a
- LIBGSM=gsm/lib/libgsm.a
- LIBGSMT=gsm/lib/libgsm.a
+ UI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex.h)
+ UIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex/speex.h)
+-ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex.h)
+-ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex/speex.h)
++ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex.h)
++ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex/speex.h)
+ ifneq (${UI_SPEEX},)
+ MODSPEEX=codec_speex.so
+ LIBSPEEX+=-lspeex -lm
+@@ -43,14 +43,14 @@
+ endif
+ ifneq (${ULI_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+ ifneq (${ULIS_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/speex
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+
+@@ -65,7 +65,7 @@
LIBLPC10=lpc10/liblpc10.a
--LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
-+LIBSPEEX=-L$(LOCALBASE)/lib
- LIBSPEEX+=-lspeex -lm
- LIBILBC=ilbc/libilbc.a
--CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
-+CODECS+=$(MODG723) $(MODG729) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
- codec_adpcm.so codec_ulaw.so codec_alaw.so codec_a_mu.so \
- codec_g726.so
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
-@@ -93,7 +91,7 @@
+ CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
+@@ -126,7 +126,7 @@
endif
install: all
diff --git a/net/asterisk10/files/patch-codecs::codec_g723_1_dummy.c b/net/asterisk10/files/patch-codecs::codec_g723_1_dummy.c
deleted file mode 100644
index 3ce9571..0000000
--- a/net/asterisk10/files/patch-codecs::codec_g723_1_dummy.c
+++ /dev/null
@@ -1,314 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g723_1_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g723_1_dummy.c Sun Oct 10 16:07:05 2004
-@@ -0,0 +1,308 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.723.1 (dummy!)
-+ *
-+ * The G.723.1 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#define TYPE_HIGH 0x0
-+#define TYPE_LOW 0x1
-+#define TYPE_SILENCE 0x2
-+#define TYPE_DONTSEND 0x3
-+#define TYPE_MASK 0x3
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g723_ex.h"
-+#include "g723_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.723.1/PCM16 Codec Translator";
-+
-+struct g723_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g723_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g723tolin_new()
-+{
-+ struct g723_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog723_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g723_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g723_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g723_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g723tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G723_1;
-+ f.datalen = sizeof(g723_slin_ex);
-+ /* All frames are 30 ms long */
-+ f.samples = 30;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g723_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog723_new()
-+{
-+ struct g723_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g723tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g723_len(unsigned char buf)
-+{
-+ switch(buf & TYPE_MASK) {
-+ case TYPE_DONTSEND:
-+ return 2;
-+ break;
-+ case TYPE_SILENCE:
-+ return 4;
-+ break;
-+ case TYPE_HIGH:
-+ return 24;
-+ break;
-+ case TYPE_LOW:
-+ return 20;
-+ break;
-+ default:
-+ ast_log(LOG_WARNING, "Badly encoded frame (%d)\n", buf & TYPE_MASK);
-+ }
-+ return -1;
-+}
-+
-+static int g723tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ int len = 0;
-+ int res;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ res = g723_len(((unsigned char *)f->data + len)[0]);
-+ if (res < 0) {
-+ ast_log(LOG_WARNING, "Invalid data\n");
-+ return -1;
-+ }
-+ if (res + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 480 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 480);
-+ tmp->tail+=480;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += res;
-+ }
-+ return 0;
-+}
-+
-+static int lintog723_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog723_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 480)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G723_1;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 480) {
-+ /* Encode a frame of data */
-+ if (cnt + 24 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 24);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 30;
-+ cnt += 24;
-+ tmp->tail -= 480;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 480, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g723_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g723tolin =
-+ { "g723tolin_dummy",
-+ AST_FORMAT_G723_1, AST_FORMAT_SLINEAR,
-+ g723tolin_new,
-+ g723tolin_framein,
-+ g723tolin_frameout,
-+ g723_destroy,
-+ g723tolin_sample
-+ };
-+
-+static struct ast_translator lintog723 =
-+ { "lintog723_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G723_1,
-+ lintog723_new,
-+ lintog723_framein,
-+ lintog723_frameout,
-+ g723_destroy,
-+ lintog723_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog723);
-+ if (!res)
-+ res = ast_unregister_translator(&g723tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g723tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog723);
-+ else
-+ ast_unregister_translator(&g723tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk10/files/patch-codecs::codec_g729_dummy.c b/net/asterisk10/files/patch-codecs::codec_g729_dummy.c
deleted file mode 100644
index 9fcc7b1..0000000
--- a/net/asterisk10/files/patch-codecs::codec_g729_dummy.c
+++ /dev/null
@@ -1,281 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g729_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g729_dummy.c Sun Oct 10 16:07:12 2004
-@@ -0,0 +1,275 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.729 (dummy!)
-+ *
-+ * The G.729 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g729_ex.h"
-+#include "g729_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.729/PCM16 Codec Translator";
-+
-+struct g729_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g729_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g729tolin_new()
-+{
-+ struct g729_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog729_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g729_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g729_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g729_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g729tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G729A;
-+ f.datalen = sizeof(g729_slin_ex);
-+ /* All frames are 10 ms long */
-+ f.samples = 10;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g729_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog729_new()
-+{
-+ struct g729_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g729tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g729tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ int len = 0;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ if (10 + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 160 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 160);
-+ tmp->tail+=160;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += 10;
-+ }
-+ return 0;
-+}
-+
-+static int lintog729_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog729_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 160)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G729A;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 160) {
-+ /* Encode a frame of data */
-+ if (cnt + 10 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 10);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 10;
-+ cnt += 10;
-+ tmp->tail -= 160;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 160, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g729_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g729tolin =
-+ { "g729tolin_dummy",
-+ AST_FORMAT_G729A, AST_FORMAT_SLINEAR,
-+ g729tolin_new,
-+ g729tolin_framein,
-+ g729tolin_frameout,
-+ g729_destroy,
-+ g729tolin_sample
-+ };
-+
-+static struct ast_translator lintog729 =
-+ { "lintog729_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G729A,
-+ lintog729_new,
-+ lintog729_framein,
-+ lintog729_frameout,
-+ g729_destroy,
-+ lintog729_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog729);
-+ if (!res)
-+ res = ast_unregister_translator(&g729tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g729tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog729);
-+ else
-+ ast_unregister_translator(&g729tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk10/files/patch-codecs::g729_slin_ex.h b/net/asterisk10/files/patch-codecs::g729_slin_ex.h
deleted file mode 100644
index 44e60f2..0000000
--- a/net/asterisk10/files/patch-codecs::g729_slin_ex.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/g729_slin_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,14 @@
-+/*
-+ * g729_slin_ex.h --
-+ *
-+ * 8-bit G.729 data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Copyright (C) 2004, Maxim Sobolev <sobomax@FreeBSD.org>
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static unsigned char g729_slin_ex[] = {
-+120,82,175,64,0,250,219,0,7,214
-+};
diff --git a/net/asterisk10/files/patch-codecs::ilbc::Makefile b/net/asterisk10/files/patch-codecs::ilbc::Makefile
index 7770e07..26a2f20 100644
--- a/net/asterisk10/files/patch-codecs::ilbc::Makefile
+++ b/net/asterisk10/files/patch-codecs::ilbc::Makefile
@@ -1,11 +1,12 @@
$FreeBSD$
---- codecs/ilbc/Makefile.orig Sun Apr 27 21:13:11 2003
-+++ codecs/ilbc/Makefile Fri Jan 30 01:47:34 2004
-@@ -1,4 +1,4 @@
--CFLAGS+= -fPIC -O3
-+CFLAGS+= -fPIC
- LIB=libilbc.a
-
- OBJS= anaFilter.o iCBSearch.o packing.o \
+--- codecs/ilbc/Makefile.orig Fri Jan 13 11:01:07 2006
++++ codecs/ilbc/Makefile Fri Jan 13 11:01:51 2006
+@@ -1,5 +1,5 @@
+ ARCH=$(PROC)
+-CFLAGS+=-Wall -O3 -funroll-loops
++CFLAGS+=-Wall -funroll-loops
+ ifneq (${OSARCH},CYGWIN)
+ CFLAGS += -fPIC
+ endif
diff --git a/net/asterisk10/files/patch-codecs::slin_g729_ex.h b/net/asterisk10/files/patch-codecs::slin_g729_ex.h
deleted file mode 100644
index e1236d2..0000000
--- a/net/asterisk10/files/patch-codecs::slin_g729_ex.h
+++ /dev/null
@@ -1,31 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/slin_g729_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,25 @@
-+/*
-+ * slin_g729_ex.h --
-+ *
-+ * Signed 16-bit audio data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Source: g723.example
-+ *
-+ * Copyright (C) 2001, Linux Support Services, Inc.
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static signed short slin_g729_ex[] = {
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-+};
diff --git a/net/asterisk10/files/patch-configs::musiconhold.conf.sample b/net/asterisk10/files/patch-configs::musiconhold.conf.sample
new file mode 100644
index 0000000..ff63cc9
--- /dev/null
+++ b/net/asterisk10/files/patch-configs::musiconhold.conf.sample
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- configs/musiconhold.conf.sample.orig Tue Nov 29 20:24:39 2005
++++ configs/musiconhold.conf.sample Fri Jan 13 11:38:39 2006
+@@ -4,7 +4,7 @@
+
+ [default]
+ mode=quietmp3
+-directory=/var/lib/asterisk/mohmp3
++directory=/usr/local/share/asterisk/mohmp3
+
+ ; valid mode options:
+ ; quietmp3 -- default
diff --git a/net/asterisk10/files/patch-db.c b/net/asterisk10/files/patch-db.c
index 6c2bdcd..ba7f3f2 100644
--- a/net/asterisk10/files/patch-db.c
+++ b/net/asterisk10/files/patch-db.c
@@ -1,14 +1,21 @@
$FreeBSD$
---- db.c.orig Fri Jul 9 13:08:09 2004
-+++ db.c Sun Oct 10 15:32:33 2004
-@@ -33,7 +33,7 @@
- #include <asterisk/cli.h>
- #include <asterisk/utils.h>
- #include <asterisk/lock.h>
--#include "db1-ast/include/db.h"
+--- db.c.orig Fri Jan 13 11:05:32 2006
++++ db.c Fri Jan 13 11:06:55 2006
+@@ -35,6 +35,7 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <dirent.h>
+#include <db.h>
+
#include "asterisk.h"
- #include "astconf.h"
+@@ -51,7 +52,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
+ #include "asterisk/utils.h"
+ #include "asterisk/lock.h"
+ #include "asterisk/manager.h"
+-#include "db1-ast/include/db.h"
+
+ #ifdef __CYGWIN__
+ #define dbopen __dbopen
diff --git a/net/asterisk10/files/patch-formats::Makefile b/net/asterisk10/files/patch-formats::Makefile
index dacfd7b..b2b1db5 100644
--- a/net/asterisk10/files/patch-formats::Makefile
+++ b/net/asterisk10/files/patch-formats::Makefile
@@ -1,19 +1,19 @@
$FreeBSD$
---- formats/Makefile.orig Tue Nov 4 04:40:09 2003
-+++ formats/Makefile Fri Jan 30 01:47:34 2004
-@@ -18,7 +18,7 @@
+--- formats/Makefile.orig Fri Jan 13 11:16:07 2006
++++ formats/Makefile Fri Jan 13 11:47:25 2006
+@@ -20,7 +20,7 @@
#
- # G723 simple frame is depricated
+ # G723 simple frame is deprecated
#
--#FORMAT_LIBS+=format_g723.so
+-FORMAT_LIBS+=format_g723.so
+FORMAT_LIBS+=format_g723_1.so
- GSMLIB=../codecs/gsm/lib/libgsm.a
-
-@@ -40,7 +40,7 @@
- $(CC) $(SOLINK) -o $@ $< -lm
+ #
+ # OGG/Vorbis format
+@@ -60,7 +60,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -logg -lvorbis -lvorbisenc -lm
install: all
- for x in $(FORMAT_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
diff --git a/net/asterisk10/files/patch-formats::format_g723_1.c b/net/asterisk10/files/patch-formats::format_g723_1.c
index fb5eb12..ae814f1 100644
--- a/net/asterisk10/files/patch-formats::format_g723_1.c
+++ b/net/asterisk10/files/patch-formats::format_g723_1.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- formats/format_g723_1.c.orig Sun Oct 10 15:59:18 2004
-+++ formats/format_g723_1.c Sun Oct 10 16:05:05 2004
-@@ -0,0 +1,345 @@
+--- /dev/null Fri Jan 13 12:18:51 2006
++++ formats/format_g723_1.c Fri Jan 13 12:18:41 2006
+@@ -0,0 +1,348 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -16,6 +16,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/channel.h>
+#include <asterisk/file.h>
@@ -26,7 +27,6 @@ $FreeBSD$
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <sys/time.h>
-+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
@@ -48,7 +48,7 @@ $FreeBSD$
+struct ast_filestream {
+ void *reserved[AST_RESERVED_POINTERS];
+ /* This is what a filestream means to us */
-+ int fd; /* Descriptor */
++ FILE *f; /* Descriptor */
+ struct ast_frame fr; /* Frame information */
+ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
+ char empty; /* Empty character */
@@ -85,7 +85,7 @@ $FreeBSD$
+ return -1;
+}
+
-+static struct ast_filestream *g723_open(int fd)
++static struct ast_filestream *g723_open(FILE *f)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -98,7 +98,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ tmp->fr.data = tmp->g723;
+ tmp->fr.frametype = AST_FRAME_VOICE;
+ tmp->fr.subclass = AST_FORMAT_G723_1;
@@ -112,7 +112,7 @@ $FreeBSD$
+ return tmp;
+}
+
-+static struct ast_filestream *g723_rewrite(int fd, char *comment)
++static struct ast_filestream *g723_rewrite(FILE *f, const char *comment)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -125,7 +125,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ glistcnt++;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
@@ -143,7 +143,7 @@ $FreeBSD$
+ glistcnt--;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
-+ close(s->fd);
++ fclose(s->f);
+ free(s);
+ s = NULL;
+}
@@ -158,7 +158,7 @@ $FreeBSD$
+ s->fr.samples = 240;
+ s->fr.mallocd = 0;
+ s->fr.data = s->g723;
-+ if ((res = read(s->fd, s->g723, 1)) != 1) {
++ if ((res = fread(s->g723, 1, 1, s->f)) != 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -168,7 +168,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 frame!\n");
+ return NULL;
+ }
-+ if (s->fr.datalen > 1 && (res = read(s->fd, s->g723 + 1, s->fr.datalen - 1)) != s->fr.datalen - 1) {
++ if (s->fr.datalen > 1 && (res = fread(s->g723 + 1, 1, s->fr.datalen - 1, s->f)) != s->fr.datalen - 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -200,7 +200,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 data length, %d\n", f->datalen);
+ return -1;
+ }
-+ if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
++ if ((res = fwrite(f->data, 1, f->datalen, fs->f)) != f->datalen) {
+ ast_log(LOG_WARNING, "Bad write %d: %s\n", res, strerror(errno));
+ return -1;
+ }
@@ -229,10 +229,13 @@ $FreeBSD$
+ }
+ offset = cur + sample_offset;
+ }
-+ if ((moffset = lseek(fs->fd, 0, SEEK_END)) == -1) {
++ if (fseeko(fs->f, 0, SEEK_END) == -1) {
+ ast_log(LOG_WARNING, "Can't seek stream to an end!\n");
+ return -1;
+ }
++ else {
++ moffset = ftello(fs->f);
++ }
+ if (whence == SEEK_END) {
+ if ((max = g723_tell(fs)) == -1) {
+ ast_log(LOG_WARNING, "Can't get maximum position!\n");
@@ -244,11 +247,11 @@ $FreeBSD$
+ offset = 0;
+ soffset = -1;
+ for (coffset = 0; coffset < moffset && offset > 0; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %lli!\n", coffset);
+ return -1;
+ }
@@ -260,7 +263,7 @@ $FreeBSD$
+ if (res > 1)
+ offset -= 240;
+ }
-+ if (soffset != -1 && lseek(fs->fd, soffset, SEEK_SET) != soffset) {
++ if (soffset != -1 && fseeko(fs->f, soffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", soffset);
+ return -1;
+ }
@@ -271,7 +274,7 @@ $FreeBSD$
+static int g723_trunc(struct ast_filestream *fs)
+{
+ /* Truncate file to current length */
-+ if (ftruncate(fs->fd, lseek(fs->fd, 0, SEEK_CUR)) < 0)
++ if (ftruncate(fileno(fs->f), ftello(fs->f)) < 0)
+ return -1;
+ return 0;
+}
@@ -283,14 +286,14 @@ $FreeBSD$
+ long rval;
+ unsigned char c;
+
-+ offset = lseek(fs->fd, 0, SEEK_CUR);
++ offset = ftello(fs->f);
+ rval = 0;
+ for (coffset = 0; coffset < offset; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %llu!\n", coffset);
+ return -1;
+ }
@@ -301,7 +304,7 @@ $FreeBSD$
+ if (res > 1)
+ rval += 240;
+ }
-+ if (lseek(fs->fd, offset, SEEK_SET) != offset) {
++ if (fseeko(fs->f, offset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", offset);
+ return -1;
+ }
diff --git a/net/asterisk10/files/patch-formats::format_g729.c b/net/asterisk10/files/patch-formats::format_g729.c
index 78899a3..11be528 100644
--- a/net/asterisk10/files/patch-formats::format_g729.c
+++ b/net/asterisk10/files/patch-formats::format_g729.c
@@ -1,6 +1,9 @@
---- formats/format_g729.c.orig Mon Feb 7 10:29:19 2005
-+++ formats/format_g729.c Wed Mar 9 06:26:36 2005
-@@ -44,7 +44,7 @@
+
+$FreeBSD$
+
+--- formats/format_g729.c.orig Fri Jan 13 12:20:53 2006
++++ formats/format_g729.c Fri Jan 13 12:23:33 2006
+@@ -60,7 +60,7 @@ struct ast_filestream {
struct ast_frame fr; /* Frame information */
char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
char empty; /* Empty character */
@@ -9,7 +12,7 @@
};
-@@ -125,11 +125,11 @@
+@@ -141,11 +141,11 @@ static struct ast_frame *g729_read(struc
s->fr.frametype = AST_FRAME_VOICE;
s->fr.subclass = AST_FORMAT_G729A;
s->fr.offset = AST_FRIENDLY_OFFSET;
@@ -19,24 +22,24 @@
+ s->fr.datalen = 10;
s->fr.mallocd = 0;
s->fr.data = s->g729;
-- if ((res = read(s->fd, s->g729, 20)) != 20) {
-+ if ((res = read(s->fd, s->g729, 10)) != 10) {
+- if ((res = fread(s->g729, 1, 20, s->f)) != 20) {
++ if ((res = fread(s->g729, 1, 10, s->f)) != 10) {
if (res && (res != 10))
ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
return NULL;
-@@ -173,7 +173,7 @@
- cur = lseek(fs->fd, 0, SEEK_CUR);
- max = lseek(fs->fd, 0, SEEK_END);
+@@ -190,7 +190,7 @@ static int g729_seek(struct ast_filestre
+ fseek(fs->f, 0, SEEK_END);
+ max = ftell(fs->f);
- bytes = 20 * (sample_offset / 160);
+ bytes = 10 * (sample_offset / 80);
if (whence == SEEK_SET)
offset = bytes;
else if (whence == SEEK_CUR || whence == SEEK_FORCECUR)
-@@ -202,7 +202,7 @@
+@@ -219,7 +219,7 @@ static long g729_tell(struct ast_filestr
{
off_t offset;
- offset = lseek(fs->fd, 0, SEEK_CUR);
+ offset = ftell(fs->f);
- return (offset/20)*160;
+ return (offset/10)*80;
}
diff --git a/net/asterisk10/files/patch-funcs::Makefile b/net/asterisk10/files/patch-funcs::Makefile
new file mode 100644
index 0000000..a14daee
--- /dev/null
+++ b/net/asterisk10/files/patch-funcs::Makefile
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- funcs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ funcs/Makefile Fri Jan 13 12:36:57 2006
+@@ -67,7 +67,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
+
+ install: all
+- for x in $(FUNCS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
++ for x in $(FUNCS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
+
+ ifneq ($(wildcard .depend),)
+ include .depend
diff --git a/net/asterisk10/files/patch-pbx::Makefile b/net/asterisk10/files/patch-pbx::Makefile
index dca6672..97d03e1 100644
--- a/net/asterisk10/files/patch-pbx::Makefile
+++ b/net/asterisk10/files/patch-pbx::Makefile
@@ -1,18 +1,20 @@
$FreeBSD$
---- pbx/Makefile.orig Sun Oct 26 20:50:49 2003
-+++ pbx/Makefile Fri Jan 30 01:47:34 2004
-@@ -16,7 +16,7 @@
- PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so # pbx_gtkconsole.so pbx_kdeconsole.so
-
- # Add GTK console if appropriate
--PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
-+#PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
+--- pbx/Makefile.orig
++++ pbx/Makefile
+@@ -23,8 +23,8 @@
# Add KDE Console if appropriate
#PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so")
-@@ -62,7 +62,7 @@
+-GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
+-GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
++#GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
++#GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
+ MOC=$(QTDIR)/bin/moc
+ KDE_FLAGS=-I$(KDEDIR)/include -I$(KDEDIR)/include/kde -I$(QTDIR)/include
+ KDE_LIBS=-L$(KDEDIR)/lib -L$(QTDIR)/lib -lqt -lkdecore -lkdeui
+@@ -72,7 +72,7 @@
endif
install: all
diff --git a/net/asterisk10/files/patch-pbx::pbx_wilcalu.c b/net/asterisk10/files/patch-pbx::pbx_wilcalu.c
deleted file mode 100644
index 41722c6..0000000
--- a/net/asterisk10/files/patch-pbx::pbx_wilcalu.c
+++ /dev/null
@@ -1,14 +0,0 @@
---- pbx/pbx_wilcalu.c.orig Tue Apr 26 10:00:28 2005
-+++ pbx/pbx_wilcalu.c Tue Apr 26 10:03:42 2005
-@@ -82,6 +82,11 @@
- fds[0].events = POLLIN;
- poll(fds, 1, -1);
- bytes=read(fd,buf,256);
-+ if (bytes <= 0) {
-+ /* XXX error on device, sleep a bit before retrying */
-+ sleep(1);
-+ continue;
-+ }
- buf[(int)bytes]=0;
-
- if(bytes>0){
diff --git a/net/asterisk10/files/patch-res-res_watchdog.c b/net/asterisk10/files/patch-res-res_watchdog.c
deleted file mode 100644
index 51e4b0a..0000000
--- a/net/asterisk10/files/patch-res-res_watchdog.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- res/res_watchdog.c.orig Fri Jul 15 13:24:24 2005
-+++ res/res_watchdog.c Fri Jul 15 13:24:42 2005
-@@ -40,6 +40,10 @@
-
- /* Registrar for operations */
-
-+#ifndef O_SYNC
-+#define O_SYNC O_FSYNC
-+#endif
-+
- static struct watchdog_pvt *watchdogs = NULL;
-
- STANDARD_LOCAL_USER;
diff --git a/net/asterisk10/files/patch-res::Makefile b/net/asterisk10/files/patch-res::Makefile
index 3e48e84..de5c365 100644
--- a/net/asterisk10/files/patch-res::Makefile
+++ b/net/asterisk10/files/patch-res::Makefile
@@ -1,33 +1,35 @@
---- res/Makefile.orig Tue Aug 9 17:18:55 2005
-+++ res/Makefile Tue Aug 9 17:33:36 2005
-@@ -13,15 +13,18 @@
+
+$FreeBSD$
+
+--- res/Makefile
++++ res/Makefile
+@@ -37,8 +37,8 @@
+ endif
- MODS=res_adsi.so res_features.so res_crypto.so res_musiconhold.so res_indications.so res_monitor.so \
- res_agi.so res_watchdog.so
--MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
--MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/include/osp/osp.h" ]; then echo "res_osp.so"; fi)
-
- CRYPTO_LIBS=-lssl -lcrypto
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ ifeq (${OSARCH},CYGWIN)
+@@ -55,9 +55,7 @@
CFLAGS+=
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH")
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPATA_MOH
-+endif
- #
- # Work around buggy RedHat 9.0
+
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
+ CFLAGS+=-DZAPATA_MOH
+-endif
+ endif # WITHOUT_ZAPTEL
+
#
-@@ -34,7 +37,7 @@
+@@ -75,7 +73,7 @@
rm -f $(DESTDIR)$(ASTHEADERDIR)/parking.h
rm -f $(DESTDIR)$(MODULES_DIR)/app_agi.so
rm -f $(DESTDIR)$(MODULES_DIR)/res_parking.so
- for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(MODS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- res_crypto.so: res_crypto.o
- $(CC) $(SOLINK) -o $@ $< $(CRYPTO_LIBS)
+ @if [ x`which mpg123 2>/dev/null | grep -v '^no'` != x ] ; then \
+ if mpg123 --longhelp 2>&1 | grep -q .59r 2>&1 >/dev/null ; then echo ; else \
+ echo "*************************************************************";\
diff --git a/net/asterisk10/files/patch-rtp.c b/net/asterisk10/files/patch-rtp.c
index c652add..bbc2649 100644
--- a/net/asterisk10/files/patch-rtp.c
+++ b/net/asterisk10/files/patch-rtp.c
@@ -1,23 +1,17 @@
---- rtp.c.orig Tue Apr 26 10:00:28 2005
-+++ rtp.c Tue Apr 26 10:06:35 2005
-@@ -127,7 +127,7 @@
- {
- switch(buf & TYPE_MASK) {
- case TYPE_DONTSEND:
-- return 0;
-+ return 2;
- break;
- case TYPE_SILENCE:
- return 4;
-@@ -862,8 +858,10 @@
- /* Must be an even port number by RTP spec */
+
+$FreeBSD$
+
+--- rtp.c.orig Fri Jan 13 13:38:01 2006
++++ rtp.c Fri Jan 13 13:40:50 2006
+@@ -950,8 +950,10 @@ struct ast_rtp *ast_rtp_new_with_bindadd
rtp->us.sin_port = htons(x);
rtp->us.sin_addr = addr;
+ /* If there's rtcp, initialize it as well. */
- if (rtp->rtcp)
+ if (rtp->rtcp) {
rtp->rtcp->us.sin_port = htons(x + 1);
+ rtp->rtcp->us.sin_addr = addr;
+ }
+ /* Try to bind it/them. */
if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) &&
(!rtp->rtcp || !bind(rtp->rtcp->s, (struct sockaddr *)&rtp->rtcp->us, sizeof(rtp->rtcp->us))))
- break;
diff --git a/net/asterisk10/files/patch-utils::Makefile b/net/asterisk10/files/patch-utils::Makefile
new file mode 100644
index 0000000..f3164c0
--- /dev/null
+++ b/net/asterisk10/files/patch-utils::Makefile
@@ -0,0 +1,34 @@
+
+$FreeBSD$
+
+--- utils/Makefile
++++ utils/Makefile
+@@ -17,16 +17,16 @@
+ CFLAGS+=-DNO_AST_MM
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+ TARGET=stereorize streamplayer
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/popt.h),)
+ TARGET+=smsq
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/newt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/newt.h),)
+ TARGET+=astman
+ endif
+
+@@ -40,7 +40,7 @@
+ install:
+ for x in $(TARGET); do \
+ if [ "$$x" != "none" ]; then \
+- $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
++ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
+ fi; \
+ done
+
diff --git a/net/asterisk10/pkg-plist b/net/asterisk10/pkg-plist
index 019b270..702370a 100644
--- a/net/asterisk10/pkg-plist
+++ b/net/asterisk10/pkg-plist
@@ -19,6 +19,12 @@ etc/asterisk/asterisk.adsi-dist
@unexec if cmp -s %D/etc/asterisk/asterisk.conf %D/etc/asterisk/asterisk.conf-dist; then rm -f %D/etc/asterisk/asterisk.conf; fi
etc/asterisk/asterisk.conf-dist
@exec [ -f %B/asterisk.conf ] || cp %B/%f %B/asterisk.conf
+@unexec if cmp -s %D/etc/asterisk/cdr.conf %D/etc/asterisk/cdr.conf-dist; then rm -f %D/etc/asterisk/cdr.conf; fi
+etc/asterisk/cdr.conf-dist
+@exec [ -f %B/cdr.conf ] || cp %B/%f %B/cdr.conf
+@unexec if cmp -s %D/etc/asterisk/cdr_custom.conf %D/etc/asterisk/cdr_custom.conf-dist; then rm -f %D/etc/asterisk/cdr_custom.conf; fi
+etc/asterisk/cdr_custom.conf-dist
+@exec [ -f %B/cdr_custom.conf ] || cp %B/%f %B/cdr_custom.conf
@unexec if cmp -s %D/etc/asterisk/cdr_manager.conf %D/etc/asterisk/cdr_manager.conf-dist; then rm -f %D/etc/asterisk/cdr_manager.conf; fi
etc/asterisk/cdr_manager.conf-dist
@exec [ -f %B/cdr_manager.conf ] || cp %B/%f %B/cdr_manager.conf
@@ -31,9 +37,21 @@ etc/asterisk/cdr_pgsql.conf-dist
@unexec if cmp -s %D/etc/asterisk/cdr_tds.conf %D/etc/asterisk/cdr_tds.conf-dist; then rm -f %D/etc/asterisk/cdr_tds.conf; fi
etc/asterisk/cdr_tds.conf-dist
@exec [ -f %B/cdr_tds.conf ] || cp %B/%f %B/cdr_tds.conf
+@unexec if cmp -s %D/etc/asterisk/codecs.conf %D/etc/asterisk/codecs.conf-dist; then rm -f %D/etc/asterisk/codecs.conf; fi
+etc/asterisk/codecs.conf-dist
+@exec [ -f %B/codecs.conf ] || cp %B/%f %B/codecs.conf
+@unexec if cmp -s %D/etc/asterisk/dnsmgr.conf %D/etc/asterisk/dnsmgr.conf-dist; then rm -f %D/etc/asterisk/dnsmgr.conf; fi
+etc/asterisk/dnsmgr.conf-dist
+@exec [ -f %B/dnsmgr.conf ] || cp %B/%f %B/dmsmgr.conf
+@unexec if cmp -s %D/etc/asterisk/dundi.conf %D/etc/asterisk/dundi.conf-dist; then rm -f %D/etc/asterisk/dundi.conf; fi
+etc/asterisk/dundi.conf-dist
+@exec [ -f %B/dundi.conf ] || cp %B/%f %B/dundi.conf
@unexec if cmp -s %D/etc/asterisk/enum.conf %D/etc/asterisk/enum.conf-dist; then rm -f %D/etc/asterisk/enum.conf; fi
etc/asterisk/enum.conf-dist
@exec [ -f %B/enum.conf ] || cp %B/%f %B/enum.conf
+@unexec if cmp -s %D/etc/asterisk/extensions.ael %D/etc/asterisk/extensions.ael-dist; then rm -f %D/etc/asterisk/extensions.ael; fi
+etc/asterisk/extensions.ael-dist
+@exec [ -f %B/extensions.ael ] || cp %B/%f %B/extensions.ael
@unexec if cmp -s %D/etc/asterisk/extconfig.conf %D/etc/asterisk/extconfig.conf-dist; then rm -f %D/etc/asterisk/extconfig.conf; fi
etc/asterisk/extconfig.conf-dist
@exec [ -f %B/extconfig.conf ] || cp %B/%f %B/extconfig.conf
@@ -46,9 +64,6 @@ etc/asterisk/features.conf-dist
@unexec if cmp -s %D/etc/asterisk/festival.conf %D/etc/asterisk/festival.conf-dist; then rm -f %D/etc/asterisk/festival.conf; fi
etc/asterisk/festival.conf-dist
@exec [ -f %B/festival.conf ] || cp %B/%f %B/festival.conf
-@unexec if cmp -s %D/etc/asterisk/h323.conf %D/etc/asterisk/h323.conf-dist; then rm -f %D/etc/asterisk/h323.conf; fi
-etc/asterisk/h323.conf-dist
-@exec [ -f %B/h323.conf ] || cp %B/%f %B/h323.conf
@unexec if cmp -s %D/etc/asterisk/iax.conf %D/etc/asterisk/iax.conf-dist; then rm -f %D/etc/asterisk/iax.conf; fi
etc/asterisk/iax.conf-dist
@exec [ -f %B/iax.conf ] || cp %B/%f %B/iax.conf
@@ -70,6 +85,9 @@ etc/asterisk/meetme.conf-dist
@unexec if cmp -s %D/etc/asterisk/mgcp.conf %D/etc/asterisk/mgcp.conf-dist; then rm -f %D/etc/asterisk/mgcp.conf; fi
etc/asterisk/mgcp.conf-dist
@exec [ -f %B/mgcp.conf ] || cp %B/%f %B/mgcp.conf
+@unexec if cmp -s %D/etc/asterisk/misdn.conf %D/etc/asterisk/misdn.conf-dist; then rm -f %D/etc/asterisk/misdn.conf; fi
+etc/asterisk/misdn.conf-dist
+@exec [ -f %B/misdn.conf ] || cp %B/%f %B/misdn.conf
@unexec if cmp -s %D/etc/asterisk/modem.conf %D/etc/asterisk/modem.conf-dist; then rm -f %D/etc/asterisk/modem.conf; fi
etc/asterisk/modem.conf-dist
@exec [ -f %B/modem.conf ] || cp %B/%f %B/modem.conf
@@ -94,9 +112,6 @@ etc/asterisk/privacy.conf-dist
@unexec if cmp -s %D/etc/asterisk/queues.conf %D/etc/asterisk/queues.conf-dist; then rm -f %D/etc/asterisk/queues.conf; fi
etc/asterisk/queues.conf-dist
@exec [ -f %B/queues.conf ] || cp %B/%f %B/queues.conf
-@unexec if cmp -s %D/etc/asterisk/res_config_odbc.conf %D/etc/asterisk/res_config_odbc.conf-dist; then rm -f %D/etc/asterisk/res_config_odbc.conf; fi
-etc/asterisk/res_config_odbc.conf-dist
-@exec [ -f %B/res_config_odbc.conf ] || cp %B/%f %B/res_config_odbc.conf
@unexec if cmp -s %D/etc/asterisk/res_odbc.conf %D/etc/asterisk/res_odbc.conf-dist; then rm -f %D/etc/asterisk/res_odbc.conf; fi
etc/asterisk/res_odbc.conf-dist
@exec [ -f %B/res_odbc.conf ] || cp %B/%f %B/res_odbc.conf
@@ -109,6 +124,9 @@ etc/asterisk/rtp.conf-dist
@unexec if cmp -s %D/etc/asterisk/sip.conf %D/etc/asterisk/sip.conf-dist; then rm -f %D/etc/asterisk/sip.conf; fi
etc/asterisk/sip.conf-dist
@exec [ -f %B/sip.conf ] || cp %B/%f %B/sip.conf
+@unexec if cmp -s %D/etc/asterisk/sip_notify.conf %D/etc/asterisk/sip_notify.conf-dist; then rm -f %D/etc/asterisk/sip_notify.conf; fi
+etc/asterisk/sip_notify.conf-dist
+@exec [ -f %B/sip_notify.conf ] || cp %B/%f %B/sip_notify.conf
@unexec if cmp -s %D/etc/asterisk/skinny.conf %D/etc/asterisk/skinny.conf-dist; then rm -f %D/etc/asterisk/skinny.conf; fi
etc/asterisk/skinny.conf-dist
@exec [ -f %B/skinny.conf ] || cp %B/%f %B/skinny.conf
@@ -121,9 +139,6 @@ etc/asterisk/voicemail.conf-dist
@unexec if cmp -s %D/etc/asterisk/vpb.conf %D/etc/asterisk/vpb.conf-dist; then rm -f %D/etc/asterisk/vpb.conf; fi
etc/asterisk/vpb.conf-dist
@exec [ -f %B/vpb.conf ] || cp %B/%f %B/vpb.conf
-@unexec if cmp -s %D/etc/asterisk/watchdog.conf %D/etc/asterisk/watchdog.conf-dist; then rm -f %D/etc/asterisk/watchdog.conf; fi
-etc/asterisk/watchdog.conf-dist
-@exec [ -f %B/watchdog.conf ] || cp %B/%f %B/watchdog.conf
@unexec if cmp -s %D/etc/asterisk/zapata.conf %D/etc/asterisk/zapata.conf-dist; then rm -f %D/etc/asterisk/zapata.conf; fi
etc/asterisk/zapata.conf-dist
@exec [ -f %B/zapata.conf ] || cp %B/%f %B/zapata.conf
@@ -136,28 +151,36 @@ include/asterisk/app.h
include/asterisk/ast_expr.h
include/asterisk/astdb.h
include/asterisk/astmm.h
+include/asterisk/astobj.h
include/asterisk/astosp.h
+include/asterisk/build.h
include/asterisk/callerid.h
include/asterisk/causes.h
include/asterisk/cdr.h
include/asterisk/channel.h
-include/asterisk/channel_pvt.h
+include/asterisk/chanspy.h
include/asterisk/chanvars.h
include/asterisk/cli.h
+include/asterisk/compat.h
include/asterisk/config.h
-include/asterisk/config_pvt.h
+include/asterisk/compiler.h
include/asterisk/crypto.h
-include/asterisk/cvsid.h
+include/asterisk/devicestate.h
include/asterisk/dlfcn-compat.h
include/asterisk/dns.h
+include/asterisk/dnsmgr.h
+include/asterisk/doxyref.h
include/asterisk/dsp.h
+include/asterisk/dundi.h
include/asterisk/enum.h
+include/asterisk/endian.h
include/asterisk/features.h
include/asterisk/file.h
include/asterisk/frame.h
include/asterisk/fskmodem.h
include/asterisk/image.h
include/asterisk/indications.h
+include/asterisk/inline_api.h
include/asterisk/io.h
include/asterisk/linkedlists.h
include/asterisk/localtime.h
@@ -168,38 +191,50 @@ include/asterisk/md5.h
include/asterisk/module.h
include/asterisk/monitor.h
include/asterisk/musiconhold.h
+include/asterisk/netsock.h
include/asterisk/options.h
include/asterisk/pbx.h
+include/asterisk/plc.h
include/asterisk/poll-compat.h
include/asterisk/privacy.h
include/asterisk/res_odbc.h
include/asterisk/rtp.h
include/asterisk/say.h
include/asterisk/sched.h
+include/asterisk/slinfactory.h
include/asterisk/srv.h
+include/asterisk/strings.h
include/asterisk/tdd.h
include/asterisk/term.h
+include/asterisk/time.h
include/asterisk/transcap.h
include/asterisk/translate.h
include/asterisk/ulaw.h
+include/asterisk/unaligned.h
include/asterisk/utils.h
+include/asterisk/version.h
include/asterisk/vmodem.h
lib/asterisk/modules/app_adsiprog.so
lib/asterisk/modules/app_alarmreceiver.so
lib/asterisk/modules/app_authenticate.so
lib/asterisk/modules/app_cdr.so
lib/asterisk/modules/app_chanisavail.so
+lib/asterisk/modules/app_chanspy.so
lib/asterisk/modules/app_controlplayback.so
+lib/asterisk/modules/app_curl.so
lib/asterisk/modules/app_cut.so
lib/asterisk/modules/app_db.so
-lib/asterisk/modules/app_devstate.so
lib/asterisk/modules/app_dial.so
+lib/asterisk/modules/app_dictate.so
+lib/asterisk/modules/app_directed_pickup.so
lib/asterisk/modules/app_directory.so
lib/asterisk/modules/app_disa.so
+lib/asterisk/modules/app_dumpchan.so
lib/asterisk/modules/app_echo.so
lib/asterisk/modules/app_enumlookup.so
lib/asterisk/modules/app_eval.so
lib/asterisk/modules/app_exec.so
+lib/asterisk/modules/app_externalivr.so
lib/asterisk/modules/app_festival.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_flash.so
lib/asterisk/modules/app_forkcdr.so
@@ -208,64 +243,66 @@ lib/asterisk/modules/app_groupcount.so
lib/asterisk/modules/app_hasnewvoicemail.so
lib/asterisk/modules/app_ices.so
lib/asterisk/modules/app_image.so
-lib/asterisk/modules/app_intercom.so
lib/asterisk/modules/app_lookupblacklist.so
lib/asterisk/modules/app_lookupcidname.so
lib/asterisk/modules/app_macro.so
+lib/asterisk/modules/app_math.so
+lib/asterisk/modules/app_md5.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_meetme.so
lib/asterisk/modules/app_milliwatt.so
+lib/asterisk/modules/app_mixmonitor.so
lib/asterisk/modules/app_mp3.so
lib/asterisk/modules/app_nbscat.so
+%%WITH_ZAPTEL%%lib/asterisk/modules/app_page.so
lib/asterisk/modules/app_parkandannounce.so
-lib/asterisk/modules/app_pickup.so
lib/asterisk/modules/app_playback.so
lib/asterisk/modules/app_privacy.so
-lib/asterisk/modules/app_qcall.so
lib/asterisk/modules/app_queue.so
lib/asterisk/modules/app_random.so
lib/asterisk/modules/app_read.so
+lib/asterisk/modules/app_readfile.so
+lib/asterisk/modules/app_realtime.so
lib/asterisk/modules/app_record.so
%%WITH_FAX%%lib/asterisk/modules/app_rxfax.so
lib/asterisk/modules/app_sayunixtime.so
-lib/asterisk/modules/app_segfault.so
lib/asterisk/modules/app_senddtmf.so
lib/asterisk/modules/app_sendtext.so
lib/asterisk/modules/app_setcallerid.so
lib/asterisk/modules/app_setcdruserfield.so
lib/asterisk/modules/app_setcidname.so
lib/asterisk/modules/app_setcidnum.so
+lib/asterisk/modules/app_setrdnis.so
lib/asterisk/modules/app_settransfercapability.so
lib/asterisk/modules/app_sms.so
lib/asterisk/modules/app_softhangup.so
-lib/asterisk/modules/app_striplsd.so
-lib/asterisk/modules/app_substring.so
+lib/asterisk/modules/app_stack.so
lib/asterisk/modules/app_system.so
lib/asterisk/modules/app_talkdetect.so
lib/asterisk/modules/app_test.so
lib/asterisk/modules/app_transfer.so
-lib/asterisk/modules/app_txtcidname.so
%%WITH_FAX%%lib/asterisk/modules/app_txfax.so
+lib/asterisk/modules/app_txtcidname.so
lib/asterisk/modules/app_url.so
lib/asterisk/modules/app_userevent.so
lib/asterisk/modules/app_verbose.so
lib/asterisk/modules/app_voicemail.so
lib/asterisk/modules/app_waitforring.so
+lib/asterisk/modules/app_waitforsilence.so
+lib/asterisk/modules/app_while.so
lib/asterisk/modules/app_zapateller.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapbarge.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapras.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapscan.so
lib/asterisk/modules/cdr_csv.so
+lib/asterisk/modules/cdr_custom.so
lib/asterisk/modules/cdr_manager.so
%%WITH_ODBC%%lib/asterisk/modules/cdr_odbc.so
lib/asterisk/modules/chan_agent.so
+lib/asterisk/modules/chan_features.so
%%WITH_H323%%lib/asterisk/modules/chan_h323.so
lib/asterisk/modules/chan_iax2.so
lib/asterisk/modules/chan_local.so
lib/asterisk/modules/chan_mgcp.so
-lib/asterisk/modules/chan_modem.so
-lib/asterisk/modules/chan_modem_aopen.so
-lib/asterisk/modules/chan_modem_bestdata.so
-lib/asterisk/modules/chan_modem_i4l.so
lib/asterisk/modules/chan_oss.so
lib/asterisk/modules/chan_sip.so
lib/asterisk/modules/chan_skinny.so
@@ -273,14 +310,13 @@ lib/asterisk/modules/chan_skinny.so
lib/asterisk/modules/codec_a_mu.so
lib/asterisk/modules/codec_adpcm.so
lib/asterisk/modules/codec_alaw.so
-lib/asterisk/modules/codec_g723_1_dummy.so
lib/asterisk/modules/codec_g726.so
-lib/asterisk/modules/codec_g729_dummy.so
lib/asterisk/modules/codec_gsm.so
lib/asterisk/modules/codec_ilbc.so
lib/asterisk/modules/codec_lpc10.so
lib/asterisk/modules/codec_speex.so
lib/asterisk/modules/codec_ulaw.so
+lib/asterisk/modules/format_au.so
lib/asterisk/modules/format_g723_1.so
lib/asterisk/modules/format_g726.so
lib/asterisk/modules/format_g729.so
@@ -294,22 +330,34 @@ lib/asterisk/modules/format_sln.so
lib/asterisk/modules/format_vox.so
lib/asterisk/modules/format_wav.so
lib/asterisk/modules/format_wav_gsm.so
+lib/asterisk/modules/func_callerid.so
+lib/asterisk/modules/func_enum.so
+lib/asterisk/modules/func_uri.so
+lib/asterisk/modules/pbx_ael.so
lib/asterisk/modules/pbx_config.so
+lib/asterisk/modules/pbx_dundi.so
+lib/asterisk/modules/pbx_functions.so
+lib/asterisk/modules/pbx_loopback.so
+lib/asterisk/modules/pbx_realtime.so
lib/asterisk/modules/pbx_spool.so
-lib/asterisk/modules/pbx_wilcalu.so
lib/asterisk/modules/res_adsi.so
lib/asterisk/modules/res_agi.so
+lib/asterisk/modules/res_config_odbc.so
lib/asterisk/modules/res_crypto.so
lib/asterisk/modules/res_features.so
lib/asterisk/modules/res_indications.so
lib/asterisk/modules/res_monitor.so
+lib/asterisk/modules/res_odbc.so
lib/asterisk/modules/res_musiconhold.so
-lib/asterisk/modules/res_watchdog.so
sbin/asterisk
sbin/astgenkey
sbin/astman
sbin/autosupport
+sbin/rasterisk
sbin/safe_asterisk
+sbin/smsq
+sbin/stereorize
+sbin/streamplayer
%%DATADIR%%/agi-bin/agi-test.agi
%%DATADIR%%/agi-bin/eagi-sphinx-test
%%DATADIR%%/agi-bin/eagi-test
@@ -330,23 +378,34 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/auth-incorrect.gsm
%%DATADIR%%/sounds/auth-thankyou.gsm
%%DATADIR%%/sounds/beep.gsm
+%%DATADIR%%/sounds/beeperr.gsm
%%DATADIR%%/sounds/conf-adminmenu.gsm
%%DATADIR%%/sounds/conf-enteringno.gsm
%%DATADIR%%/sounds/conf-errormenu.gsm
%%DATADIR%%/sounds/conf-getchannel.gsm
%%DATADIR%%/sounds/conf-getconfno.gsm
%%DATADIR%%/sounds/conf-getpin.gsm
+%%DATADIR%%/sounds/conf-hasjoin.gsm
+%%DATADIR%%/sounds/conf-hasleft.gsm
%%DATADIR%%/sounds/conf-invalid.gsm
%%DATADIR%%/sounds/conf-invalidpin.gsm
%%DATADIR%%/sounds/conf-kicked.gsm
+%%DATADIR%%/sounds/conf-leaderhasleft.gsm
%%DATADIR%%/sounds/conf-locked.gsm
%%DATADIR%%/sounds/conf-lockednow.gsm
%%DATADIR%%/sounds/conf-muted.gsm
%%DATADIR%%/sounds/conf-noempty.gsm
+%%DATADIR%%/sounds/conf-onlyone.gsm
%%DATADIR%%/sounds/conf-onlyperson.gsm
+%%DATADIR%%/sounds/conf-otherinparty.gsm
+%%DATADIR%%/sounds/conf-placeintoconf.gsm
+%%DATADIR%%/sounds/conf-thereare.gsm
%%DATADIR%%/sounds/conf-unlockednow.gsm
%%DATADIR%%/sounds/conf-unmuted.gsm
%%DATADIR%%/sounds/conf-usermenu.gsm
+%%DATADIR%%/sounds/conf-userswilljoin.gsm
+%%DATADIR%%/sounds/conf-userwilljoin.gsm
+%%DATADIR%%/sounds/conf-waitforleader.gsm
%%DATADIR%%/sounds/demo-abouttotry.gsm
%%DATADIR%%/sounds/demo-congrats.gsm
%%DATADIR%%/sounds/demo-echodone.gsm
@@ -357,6 +416,18 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/demo-nogo.gsm
%%DATADIR%%/sounds/demo-nomatch.gsm
%%DATADIR%%/sounds/demo-thanks.gsm
+%%DATADIR%%/sounds/dictate/both_help.gsm
+%%DATADIR%%/sounds/dictate/enter_filename.gsm
+%%DATADIR%%/sounds/dictate/forhelp.gsm
+%%DATADIR%%/sounds/dictate/pause.gsm
+%%DATADIR%%/sounds/dictate/paused.gsm
+%%DATADIR%%/sounds/dictate/play_help.gsm
+%%DATADIR%%/sounds/dictate/playback.gsm
+%%DATADIR%%/sounds/dictate/playback_mode.gsm
+%%DATADIR%%/sounds/dictate/record.gsm
+%%DATADIR%%/sounds/dictate/record_help.gsm
+%%DATADIR%%/sounds/dictate/record_mode.gsm
+%%DATADIR%%/sounds/dictate/truncating_audio.gsm
%%DATADIR%%/sounds/digits/0.gsm
%%DATADIR%%/sounds/digits/1.gsm
%%DATADIR%%/sounds/digits/10.gsm
@@ -445,6 +516,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/dir-intro.gsm
%%DATADIR%%/sounds/dir-nomatch.gsm
%%DATADIR%%/sounds/dir-nomore.gsm
+%%DATADIR%%/sounds/hello-world.gsm
%%DATADIR%%/sounds/invalid.gsm
%%DATADIR%%/sounds/letters/a.gsm
%%DATADIR%%/sounds/letters/at.gsm
@@ -512,6 +584,10 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/phonetic/x_p.gsm
%%DATADIR%%/sounds/phonetic/y_p.gsm
%%DATADIR%%/sounds/phonetic/z_p.gsm
+%%DATADIR%%/sounds/priv-callee-options.gsm
+%%DATADIR%%/sounds/priv-callpending.gsm
+%%DATADIR%%/sounds/priv-introsaved.gsm
+%%DATADIR%%/sounds/priv-recordintro.gsm
%%DATADIR%%/sounds/privacy-incorrect.gsm
%%DATADIR%%/sounds/privacy-prompt.gsm
%%DATADIR%%/sounds/privacy-thankyou.gsm
@@ -520,10 +596,21 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/queue-holdtime.gsm
%%DATADIR%%/sounds/queue-less-than.gsm
%%DATADIR%%/sounds/queue-minutes.gsm
+%%DATADIR%%/sounds/queue-periodic-announce.gsm
+%%DATADIR%%/sounds/queue-reporthold.gsm
%%DATADIR%%/sounds/queue-seconds.gsm
%%DATADIR%%/sounds/queue-thankyou.gsm
%%DATADIR%%/sounds/queue-thereare.gsm
%%DATADIR%%/sounds/queue-youarenext.gsm
+%%DATADIR%%/sounds/screen-callee-options.gsm
+%%DATADIR%%/sounds/spy-agent.gsm
+%%DATADIR%%/sounds/spy-h323.gsm
+%%DATADIR%%/sounds/spy-iax.gsm
+%%DATADIR%%/sounds/spy-iax2.gsm
+%%DATADIR%%/sounds/spy-mgcp.gsm
+%%DATADIR%%/sounds/spy-sip.gsm
+%%DATADIR%%/sounds/spy-skinny.gsm
+%%DATADIR%%/sounds/spy-zap.gsm
%%DATADIR%%/sounds/ss-noservice.gsm
%%DATADIR%%/sounds/transfer.gsm
%%DATADIR%%/sounds/tt-allbusy.gsm
@@ -531,7 +618,6 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/tt-monkeysintro.gsm
%%DATADIR%%/sounds/tt-somethingwrong.gsm
%%DATADIR%%/sounds/tt-weasels.gsm
-%%DATADIR%%/sounds/vm
%%DATADIR%%/sounds/vm-Cust1.gsm
%%DATADIR%%/sounds/vm-Cust2.gsm
%%DATADIR%%/sounds/vm-Cust3.gsm
@@ -553,6 +639,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-extension.gsm
%%DATADIR%%/sounds/vm-first.gsm
%%DATADIR%%/sounds/vm-for.gsm
+%%DATADIR%%/sounds/vm-forward.gsm
%%DATADIR%%/sounds/vm-forwardoptions.gsm
%%DATADIR%%/sounds/vm-from-extension.gsm
%%DATADIR%%/sounds/vm-from-phonenumber.gsm
@@ -571,10 +658,12 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-mailboxfull.gsm
%%DATADIR%%/sounds/vm-message.gsm
%%DATADIR%%/sounds/vm-messages.gsm
+%%DATADIR%%/sounds/vm-minutes.gsm
%%DATADIR%%/sounds/vm-mismatch.gsm
%%DATADIR%%/sounds/vm-msginstruct.gsm
%%DATADIR%%/sounds/vm-msgsaved.gsm
%%DATADIR%%/sounds/vm-newpassword.gsm
+%%DATADIR%%/sounds/vm-newuser.gsm
%%DATADIR%%/sounds/vm-next.gsm
%%DATADIR%%/sounds/vm-no.gsm
%%DATADIR%%/sounds/vm-nobodyavail.gsm
@@ -592,6 +681,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-reachoper.gsm
%%DATADIR%%/sounds/vm-rec-busy.gsm
%%DATADIR%%/sounds/vm-rec-name.gsm
+%%DATADIR%%/sounds/vm-rec-temp.gsm
%%DATADIR%%/sounds/vm-rec-unv.gsm
%%DATADIR%%/sounds/vm-received.gsm
%%DATADIR%%/sounds/vm-reenterpassword.gsm
@@ -605,6 +695,9 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-sorry.gsm
%%DATADIR%%/sounds/vm-star-cancel.gsm
%%DATADIR%%/sounds/vm-starmain.gsm
+%%DATADIR%%/sounds/vm-tempgreeting.gsm
+%%DATADIR%%/sounds/vm-tempgreeting2.gsm
+%%DATADIR%%/sounds/vm-tempremoved.gsm
%%DATADIR%%/sounds/vm-then-pound.gsm
%%DATADIR%%/sounds/vm-theperson.gsm
%%DATADIR%%/sounds/vm-tocallback.gsm
@@ -624,9 +717,11 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-whichbox.gsm
%%DATADIR%%/sounds/vm-youhave.gsm
%%DATADIR%%/sounds/voicemail
+@dirrm %%DATADIR%%/sounds/dictate
@dirrm %%DATADIR%%/sounds/phonetic
@dirrm %%DATADIR%%/sounds/letters
@dirrm %%DATADIR%%/sounds/digits
+@dirrm %%DATADIR%%/sounds/priv-callerintros
@dirrm %%DATADIR%%/sounds
@dirrm %%DATADIR%%/mohmp3
@dirrm %%DATADIR%%/keys
@@ -641,11 +736,14 @@ sbin/safe_asterisk
@dirrm etc/asterisk
@unexec rm -f %D/%%DATADIR%%/astdb
@cwd /var
-spool/asterisk/vm
spool/asterisk/voicemail/default/1234/busy.gsm
spool/asterisk/voicemail/default/1234/unavail.gsm
@exec mkdir -p %D/log/asterisk/cdr-csv
@exec mkdir -p %D/spool/asterisk/voicemail/default/1234/INBOX
+@dirrm spool/asterisk/dictate
+@dirrm spool/asterisk/meetme
+@dirrm spool/asterisk/monitor
+@dirrm spool/asterisk/system
@dirrm spool/asterisk/voicemail/default/1234/INBOX
@dirrm spool/asterisk/voicemail/default/1234
@dirrm spool/asterisk/voicemail/default
@@ -653,4 +751,5 @@ spool/asterisk/voicemail/default/1234/unavail.gsm
@dirrm spool/asterisk/tmp
@dirrm spool/asterisk
@dirrm log/asterisk/cdr-csv
+@dirrm log/asterisk/cdr-custom
@dirrm log/asterisk
diff --git a/net/asterisk12/Makefile b/net/asterisk12/Makefile
index 276aa57..3cfbf7e 100644
--- a/net/asterisk12/Makefile
+++ b/net/asterisk12/Makefile
@@ -6,30 +6,24 @@
#
PORTNAME= asterisk
-PORTVERSION= 1.0.9
-PORTREVISION= 2
+PORTVERSION= 1.2.1
CATEGORIES= net
MASTER_SITES= http://ftp.digium.com/pub/asterisk/ \
http://ftp.digium.com/pub/asterisk/old-releases/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/old-releases/
-PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
-PATCH_SITES= ${MASTER_SITE_LOCAL}
-PATCH_SITE_SUBDIR= fjoe
-PATCH_DIST_STRIP= -p1
-
MAINTAINER= sobomax@FreeBSD.org
COMMENT= An Open Source PBX and telephony toolkit
BUILD_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
LIB_DEPENDS= speex.3:${PORTSDIR}/audio/speex \
- newt.51:${PORTSDIR}/devel/newt
+ newt.51:${PORTSDIR}/devel/newt \
+ curl.3:${PORTSDIR}/ftp/curl
RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
ONLY_FOR_ARCHS= i386 sparc64 amd64
-BRIVER= bristuff-0.2.0-RC8h
GNU_CONFIGURE= yes
CONFIGURE_WRKSRC= ${WRKSRC}/editline
USE_GMAKE= yes
@@ -44,7 +38,7 @@ MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
OSVERSION=${OSVERSION} \
CXX="${CXX}"
-MAN8= asterisk.8
+MAN8= asterisk.8 astgenkey.8 autosupport.8 safe_asterisk.8
.include <bsd.port.pre.mk>
@@ -68,8 +62,9 @@ MAKE_ENV+= WITH_H323=1
.if defined(WITHOUT_ZAPTEL)
PLIST_SUB+= WITH_ZAPTEL="@comment "
.else
+BUILD_DEPENDS+= libpri>=1.2.0:${PORTSDIR}/misc/libpri \
+ ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
LIB_DEPENDS+= pri.1:${PORTSDIR}/misc/libpri
-BUILD_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
RUN_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
PLIST_SUB+= WITH_ZAPTEL=""
MAKE_ENV+= WITH_ZAPTEL=1
@@ -86,10 +81,6 @@ PLIST_SUB+= WITH_ODBC=""
MAKE_ENV+= WITH_ODBC=1
.endif
-.if !defined(WITHOUT_MYSQL)
-USE_MYSQL= yes
-.endif
-
.if defined(WITHOUT_FAX)
PLIST_SUB+= WITH_FAX="@comment "
.else
@@ -99,7 +90,6 @@ PLIST_SUB+= WITH_FAX=""
.endif
post-patch:
- ${CP} ${FILESDIR}/chan_oss.c ${WRKSRC}/channels
${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample
.include <bsd.port.post.mk>
diff --git a/net/asterisk12/distinfo b/net/asterisk12/distinfo
index 9ef6daa..9d56959 100644
--- a/net/asterisk12/distinfo
+++ b/net/asterisk12/distinfo
@@ -1,4 +1,3 @@
-MD5 (asterisk-1.0.9.tar.gz) = 0d7f1c680ae53a739f26a069ef8b580a
-SIZE (asterisk-1.0.9.tar.gz) = 9604582
-MD5 (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 42172c5b04af9080f22b883296c34002
-SIZE (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 56589
+MD5 (asterisk-1.2.1.tar.gz) = 04657086791e80f319c0d728af705001
+SHA256 (asterisk-1.2.1.tar.gz) = f0d3ed36353c1f5726225d2794bea7d1d1a92c9e58336b02b293f43dd4b97948
+SIZE (asterisk-1.2.1.tar.gz) = 10517194
diff --git a/net/asterisk12/files/chan_oss.c b/net/asterisk12/files/chan_oss.c
deleted file mode 100644
index 95a9236..0000000
--- a/net/asterisk12/files/chan_oss.c
+++ /dev/null
@@ -1,1327 +0,0 @@
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * Copyright (C) 1999, Mark Spencer
- *
- * Mark Spencer <markster@linux-support.net>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- *
- * FreeBSD changes and multiple device support by Luigi Rizzo, 2005.05.02
- * note-this code best seen with ts=8 (8-spaces tabs) in the editor
- */
-
-#include <asterisk/lock.h>
-#include <asterisk/frame.h>
-#include <asterisk/logger.h>
-#include <asterisk/channel.h>
-#include <asterisk/module.h>
-#include <asterisk/channel_pvt.h>
-#include <asterisk/options.h>
-#include <asterisk/pbx.h>
-#include <asterisk/config.h>
-#include <asterisk/cli.h>
-#include <asterisk/utils.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h> /* for isalnum */
-#ifdef __linux
-#include <linux/soundcard.h>
-#elif defined(__FreeBSD__)
-#include <sys/soundcard.h>
-#else
-#include <soundcard.h>
-#endif
-#include "busy.h"
-#include "ringtone.h"
-#include "ring10.h"
-#include "answer.h"
-
-/*
- * Helper macros to parse config arguments. They will go in a common
- * header file if their usage is globally accepted. In the meantime,
- * we define them here. Typical usage is as below, WITHOUT ; on each line.
- *
- * {
- * M_START(v->name, v->value)
- *
- * M_BOOL("dothis", x->flag1)
- * M_STR("name", x->somestring)
- * M_F("bar", some_c_code)
- * M_END(some_final_statement)
- */
-#define M_START(var, val) \
- char *__s = var; char *__val = val;
-#define M_END(x) x;
-#define M_F(tag, f) if (!strcasecmp((__s), tag)) { f; } else
-#define M_BOOL(tag, dst) M_F(tag, (dst) = ast_true(__val) )
-#define M_UINT(tag, dst) M_F(tag, (dst) = strtoul(__val, NULL, 0) )
-#define M_STR(tag, dst) M_F(tag, strncpy(dst, __val, sizeof(dst) - 1) )
-
-
-/* Which device to use */
-#if defined( __OpenBSD__ ) || defined( __NetBSD__ )
-#define DEV_DSP "/dev/audio"
-#else
-#define DEV_DSP "/dev/dsp"
-#endif
-
-/*
- * Basic mode of operation:
- *
- * we have one keyboard (which receives commands from the keyboard)
- * and multiple headset's connected to audio cards. Headsets are named as
- * the sections of oss.conf
- *
- * At any time, the keyboard is attached to one headset, and you
- * can switch among them using the 'console' command.
- *
- * The following parameters are important for the configuration of
- * the device:
- *
- * FRAME_SIZE the size of an audio frame, in samples.
- * 160 is used almost universally, so you should not change it.
- *
- * FRAGS the argument for the SETFRAGMENT ioctl.
- * Overridden by the 'frags' parameter in oss.conf
- *
- * Bits 0-7 are the base-2 log of the device's block size,
- * bits 16-31 are the number of blocks in the driver's queue.
- * There are a lot of differences in the way this parameter
- * is supported by different drivers, so you may need to
- * experiment a bit with the value.
- * A good default for linux is 30 blocks of 64 bytes, which
- * results in 6 frames of 320 bytes (160 samples).
- * FreeBSD works decently with blocks of 256 or 512 bytes,
- * leaving the number unspecified.
- * Note that this only refers to the device buffer size,
- * this module will then try to keep the lenght of audio
- * buffered within small constraints.
- *
- * QUEUE_SIZE The max number of blocks actually allowed in the device
- * driver's buffer, irrespective of the available number.
- * Overridden by the 'queuesize' parameter in oss.conf
- *
- * Should be >=2, and at most as large as the hw queue above
- * (otherwise it will never be full).
- */
-
-#define FRAME_SIZE 160
-#define QUEUE_SIZE 10
-
-#if defined(__FreeBSD__)
-#define FRAGS 0x8
-#else
-#define FRAGS ( ( (6 * 5) << 16 ) | 0x6 )
-#endif
-
-
-/* Don't switch between read/write modes faster than every 300 ms */
-#define MIN_SWITCH_TIME 300
-
-
-static int usecnt;
-AST_MUTEX_DEFINE_STATIC(usecnt_lock);
-
-static char *desc = "OSS Console Channel Driver";
-static char *tdesc = "OSS Console Channel Driver";
-static char *config = "oss.conf"; /* default config file */
-
-static int oss_debug;
-
-/*
- * Each sound is made of 'datalen' samples of sound, repeated as needed to
- * generate 'samplen' samples of data, then followed by 'silencelen' samples
- * of silence. The loop is repeated if 'repeat' is set.
- */
-struct sound {
- int ind;
- char *desc;
- short *data;
- int datalen;
- int samplen;
- int silencelen;
- int repeat;
-};
-
-static struct sound sounds[] = {
- { AST_CONTROL_RINGING, "RINGING", ringtone, sizeof(ringtone)/2, 16000, 32000, 1 },
- { AST_CONTROL_BUSY, "BUSY", busy, sizeof(busy)/2, 4000, 4000, 1 },
- { AST_CONTROL_CONGESTION, "CONGESTION", busy, sizeof(busy)/2, 2000, 2000, 1 },
- { AST_CONTROL_RING, "RING10", ring10, sizeof(ring10)/2, 16000, 32000, 1 },
- { AST_CONTROL_ANSWER, "ANSWER", answer, sizeof(answer)/2, 2200, 0, 0 },
- { -1, NULL, 0, 0, 0, 0 }, /* end marker */
-};
-
-
-/*
- * descriptor for one of our channels.
- * There is one used for 'default' values (from the [general] entry in
- * the configuration file, and then one instance for each device
- * (the default is cloned from [general], others are only created
- * if the relevant section exists.
- */
-struct chan_oss_pvt {
- struct chan_oss_pvt *next;
-
- char *type;
- char *name;
- /*
- * cursound indicates which in struct sound we play. -1 means nothing,
- * any other value is a valid sound, in which case sampsent indicates
- * the next sample to send in [0..samplen + silencelen]
- * nosound is set to disable the audio data from the channel
- * (so we can play the tones etc.).
- */
- int sndcmd[2]; /* Sound command pipe */
- int cursound; /* index of sound to send */
- int sampsent; /* # of sound samples sent */
- int nosound; /* set to block audio from the PBX */
-
- int total_blocks; /* total blocks in the output device */
- int sounddev;
- enum { M_UNSET, M_FULL, M_READ, M_WRITE } duplex;
- int autoanswer;
- int autohangup;
- int hookstate;
- struct timeval lasttime; /* last setformat */
- char *mixer_cmd; /* initial command to issue to the mixer */
- unsigned int queuesize; /* max fragments in queue */
- unsigned int frags; /* parameter for SETFRAGMENT */
-
- int warned; /* various flags used for warnings */
-#define WARN_used_blocks 1
-#define WARN_speed 2
-#define WARN_frag 4
- int w_errors; /* overfull in the write path */
-
- int silencesuppression;
- int silencethreshold;
- int playbackonly;
- char device[64]; /* device to open */
-
- pthread_t sthread;
-
- struct ast_channel *owner;
- char ext[AST_MAX_EXTENSION];
- char ctx[AST_MAX_EXTENSION];
- char language[MAX_LANGUAGE];
-
- /* buffers used in oss_write */
- char oss_write_buf[FRAME_SIZE*2];
- int oss_write_dst;
- /* buffers used in oss_read - AST_FRIENDLY_OFFSET space for headers
- * plus enough room for a full frame
- */
- char oss_read_buf[FRAME_SIZE * 2 + AST_FRIENDLY_OFFSET];
- int readpos; /* read position above */
- struct ast_frame read_f; /* returned by oss_read */
-};
-
-static struct chan_oss_pvt oss_default = {
- .type = "Console",
- .cursound = -1,
- .sounddev = -1,
- .duplex = M_UNSET, /* XXX check this */
- .autoanswer = 1,
- .autohangup = 1,
- .queuesize = QUEUE_SIZE,
- .frags = FRAGS,
- .silencethreshold = 1000, /* currently unused */
- .ext = "s",
- .ctx = "default",
- .readpos = AST_FRIENDLY_OFFSET, /* start here on reads */
-};
-
-static char *oss_active; /* the active device */
-
-/*
- * returns true if too early to switch
- */
-static int too_early(struct chan_oss_pvt *o)
-{
- struct timeval tv;
- int ms;
- gettimeofday(&tv, NULL);
- ms = (tv.tv_sec - o->lasttime.tv_sec) * 1000 +
- (tv.tv_usec - o->lasttime.tv_usec) / 1000;
- if (ms < MIN_SWITCH_TIME)
- return -1;
- return 0;
-}
-
-/*
- * Returns the number of blocks used in the audio output channel
- */
-static int used_blocks(struct chan_oss_pvt *o)
-{
- struct audio_buf_info info;
-
- if (ioctl(o->sounddev, SNDCTL_DSP_GETOSPACE, &info)) {
- if (! (o->warned & WARN_used_blocks)) {
- ast_log(LOG_WARNING, "Error reading output space\n");
- o->warned |= WARN_used_blocks;
- }
- return 1;
- }
- if (o->total_blocks == 0) {
- if (0) /* debugging */
- ast_log(LOG_WARNING, "fragtotal %d size %d avail %d\n",
- info.fragstotal,
- info.fragsize,
- info.fragments);
- o->total_blocks = info.fragments;
- }
- return o->total_blocks - info.fragments;
-}
-
-static int soundcard_writeframe(struct chan_oss_pvt *o, short *data)
-{
- /* Write an exactly FRAME_SIZE sized frame */
- int res;
-
- /*
- * Nothing complex to manage the audio device queue.
- * If the buffer is full just drop the extra, otherwise write.
- * XXX in some cases it might be useful to write anyways after
- * a number of failures, to restart the output chain.
- */
- res = used_blocks(o);
- if (res > o->queuesize) { /* no room to write a block */
- if (o->w_errors++ == 0 && (oss_debug & 0x4))
- ast_log(LOG_WARNING, "write: used %d blocks (%d)\n",
- res, o->w_errors);
- return 0;
- }
- o->w_errors = 0;
- res = write(o->sounddev, ((void *)data), FRAME_SIZE * 2);
- return res;
-}
-
-/*
- * handler for 'sound writable' events from the sound thread.
- * Builds a frame from the high level description of the sounds,
- * and passes it to the audio device.
- * The actual sound is made of 1 or more sequences of sound samples
- * (s->datalen, repeated to make s->samplen samples) followed by
- * s->silencelen samples of silence. The position in the sequence is stored
- * in o->sampsent, which goes between 0 .. s->samplen+s->silencelen.
- * In case we fail to write a frame, don't update o->sampsent.
- */
-static void send_sound(struct chan_oss_pvt *o)
-{
- short myframe[FRAME_SIZE];
- int ofs, l, start;
- int l_sampsent = o->sampsent;
- struct sound *s;
-
- if (o->cursound < 0) /* no sound to send */
- return;
- s = &sounds[o->cursound];
- for (ofs = 0; ofs < FRAME_SIZE; ofs += l) {
- l = s->samplen - l_sampsent; /* sound available */
- if (l > 0) {
- start = l_sampsent % s->datalen; /* source offset */
- if (l > FRAME_SIZE - ofs) /* don't overflow the frame */
- l = FRAME_SIZE - ofs;
- if (l > s->datalen - start) /* don't overflow the source */
- l = s->datalen - start;
- bcopy(s->data + start, myframe + ofs, l*2);
- if (0)
- ast_log(LOG_WARNING, "send_sound sound %d/%d of %d into %d\n",
- l_sampsent, l, s->samplen, ofs);
- l_sampsent += l;
- } else { /* no sound, maybe some silence */
- static short silence[FRAME_SIZE] = {0, };
-
- l += s->silencelen;
- if (l > 0) {
- if (l > FRAME_SIZE - ofs)
- l = FRAME_SIZE - ofs;
- bcopy(silence, myframe + ofs, l*2);
- l_sampsent += l;
- } else { /* silence is over, restart sound if loop */
- if (s->repeat == 0) { /* last block */
- o->cursound = -1;
- o->nosound = 0; /* allow audio data */
- if (ofs < FRAME_SIZE) /* pad with silence */
- bcopy(silence, myframe + ofs, (FRAME_SIZE - ofs)*2);
- }
- l_sampsent = 0;
- }
- }
- }
- l = soundcard_writeframe(o, myframe);
- if (l > 0)
- o->sampsent = l_sampsent; /* update status */
-}
-
-static void *sound_thread(void *arg)
-{
- char ign[4096];
- struct chan_oss_pvt *o = (struct chan_oss_pvt *)arg;
-
- /* kick the driver by trying to read from it. Ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- for(;;) {
- fd_set rfds, wfds;
- int maxfd, res;
-
- FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- maxfd = o->sndcmd[0]; /* pipe from the main process */
- FD_SET(o->sndcmd[0], &rfds);
- if (!o->owner) { /* no one owns the audio, so we must drain it */
- FD_SET(o->sounddev, &rfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- if (o->cursound > -1) {
- FD_SET(o->sounddev, &wfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- /* ast_select emulates linux behaviour in terms of timeout handling */
- res = ast_select(maxfd + 1, &rfds, &wfds, NULL, NULL);
- if (res < 1) {
- ast_log(LOG_WARNING, "select failed: %s\n",
- strerror(errno));
- continue;
- }
- if (FD_ISSET(o->sndcmd[0], &rfds)) {
- /* read which sound to play from the pipe */
- int i, what = -1;
-
- read(o->sndcmd[0], &what, sizeof(what));
- for (i = 0; sounds[i].ind != -1; i++) {
- if (sounds[i].ind == what) {
- o->cursound = i;
- o->sampsent = 0;
- o->nosound = 1; /* block audio from pbx */
- break;
- }
- }
- if (sounds[i].ind == -1)
- ast_log(LOG_WARNING, "invalid sound index: %d\n", what);
- }
- if (FD_ISSET(o->sounddev, &rfds)) { /* read and ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- }
- if (FD_ISSET(o->sounddev, &wfds))
- send_sound(o);
- }
- /* Never reached */
- return NULL;
-}
-
-/*
- * reset and close the device if opened,
- * then open and initialize it in the desired mode,
- * trigger reads and writes so we can start using it.
- */
-static int setformat(struct chan_oss_pvt *o, int mode)
-{
- int fmt, desired, res, fd;
-
- if (o->sounddev >= 0) {
- ioctl(o->sounddev, SNDCTL_DSP_RESET, 0);
- close(o->sounddev);
- o->duplex = M_UNSET;
- }
- fd = o->sounddev = open(o->device, mode |O_NONBLOCK);
- if (o->sounddev < 0) {
- ast_log(LOG_WARNING, "Unable to re-open DSP device: %s\n",
- strerror(errno));
- return -1;
- }
-
- gettimeofday(&o->lasttime, NULL);
- fmt = AFMT_S16_LE;
- res = ioctl(fd, SNDCTL_DSP_SETFMT, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set format to 16-bit signed\n");
- return -1;
- }
- switch (mode) {
- case O_RDWR:
- res = ioctl(fd, SNDCTL_DSP_SETDUPLEX, 0);
- /* Check to see if duplex set (FreeBSD Bug)*/
- res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt);
- if (res == 0 && (fmt & DSP_CAP_DUPLEX)) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Console is full duplex\n");
- o->duplex = M_FULL;
- };
- break;
- case O_WRONLY:
- o->duplex = M_WRITE;
- break;
- case O_RDONLY:
- o->duplex = M_READ;
- break;
- }
-
- fmt = 0;
- res = ioctl(fd, SNDCTL_DSP_STEREO, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- /* 8000 Hz desired */
- desired = 8000;
- fmt = desired;
- res = ioctl(fd, SNDCTL_DSP_SPEED, &fmt);
-
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- if (fmt != desired) {
- if (!(o->warned & WARN_speed)) {
- ast_log(LOG_WARNING,
- "Requested %d Hz, got %d Hz -- sound may be choppy\n",
- desired, fmt);
- o->warned |= WARN_speed;
- }
- }
- /*
- * on Freebsd, SETFRAGMENT does not work very well on some cards.
- * Default to use 256 bytes, let the user override
- */
- if (o->frags) {
- fmt = o->frags;
- res = ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &fmt);
- if (res < 0) {
- if (!(o->warned & WARN_frag)) {
- ast_log(LOG_WARNING,
- "Unable to set fragment size -- sound may be choppy\n");
- o->warned |= WARN_frag;
- }
- }
- }
- /* XXX on some cards, we need SNDCTL_DSP_SETTRIGGER to start outputting */
- res = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT;
- res = ioctl(fd, SNDCTL_DSP_SETTRIGGER, &res);
- /* it may fail if we are in half duplex, never mind */
- return 0;
-}
-
-/*
- * make sure output mode is available. Returns 0 if done,
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setoutput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_WRITE && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_WRONLY))
- return -1;
- return 0;
-}
-
-/*
- * make sure input mode is available. Returns 0 if done
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setinput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_READ && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_RDONLY))
- return -1;
- return 0;
-}
-
-/*
- * some of the standard methods supported by channels.
- */
-static int oss_digit(struct ast_channel *c, char digit)
-{
- /* no better use for received digits than print them */
- ast_verbose( " << Console Received digit %c >> \n", digit);
- return 0;
-}
-
-static int oss_text(struct ast_channel *c, char *text)
-{
- /* print received messages */
- ast_verbose( " << Console Received text %s >> \n", text);
- return 0;
-}
-
-/* Play ringtone 'x' on device 'o' */
-#define RING(o, x) { int what = x; write((o)->sndcmd[1], &what, sizeof(what)); }
-
-/*
- * handler for incoming calls. Either autoanswer, or start ringing
- */
-static int oss_call(struct ast_channel *c, char *dest, int timeout)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame f = { 0, };
-
- ast_verbose( " << Call placed to '%s' on console >> \n", dest);
- if (o->autoanswer) {
- ast_verbose( " << Auto-answered >> \n" );
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_ANSWER;
- ast_queue_frame(c, &f);
- } else {
- ast_verbose(" << Type 'answer' to answer, or use 'autoanswer' for future calls >> \n");
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_RINGING;
- ast_queue_frame(c, &f);
- RING(o, AST_CONTROL_RING);
- }
- return 0;
-}
-
-/*
- * remote side answered the phone
- */
-static int oss_answer(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- ast_verbose( " << Console call has been answered >> \n");
-#if 0
- /* play an answer tone (XXX do we really need it ?) */
- RING(o, AST_CONTROL_ANSWER);
-#endif
- ast_setstate(c, AST_STATE_UP);
- o->cursound = -1;
- o->nosound=0;
- return 0;
-}
-
-static int oss_hangup(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- o->cursound = -1;
- c->pvt->pvt = NULL;
- o->owner = NULL;
- ast_verbose( " << Hangup on console >> \n");
- ast_mutex_lock(&usecnt_lock); /* XXX not sure why */
- usecnt--;
- ast_mutex_unlock(&usecnt_lock);
- if (o->hookstate) {
- if (o->autoanswer || o->autohangup) {
- /* Assume auto-hangup too */
- o->hookstate = 0;
- } else {
- /* Make congestion noise */
- RING(o, AST_CONTROL_CONGESTION);
- }
- }
- return 0;
-}
-
-/* used for data coming from the network */
-static int oss_write(struct ast_channel *c, struct ast_frame *f)
-{
- int res;
- int src;
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- /* Immediately return if no sound is enabled */
- if (o->nosound)
- return 0;
- /* Stop any currently playing sound */
- o->cursound = -1;
- if (o->duplex != M_FULL && !o->playbackonly) {
- /* XXX check this, looks weird! */
- /* If we're half duplex, we have to switch to read mode
- to honor immediate needs if necessary */
- res = soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set device to input mode\n");
- return -1;
- }
- return 0;
- }
- res = soundcard_setoutput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set output device\n");
- return -1;
- } else if (res > 0) {
- /* The device is still in read mode, and it's too soon to change it,
- so just pretend we wrote it */
- return 0;
- }
- /*
- * we could receive a sample which is not a multiple of our FRAME_SIZE,
- * so we buffer it locally and write to the device in FRAME_SIZE
- * chunks, keeping the residue stored for future use.
- */
- src = 0; /* read position into f->data */
- while ( src < f->datalen ) {
- /* Compute spare room in the buffer */
- int l = sizeof(o->oss_write_buf) - o->oss_write_dst;
-
- if (f->datalen - src >= l) { /* enough to fill a frame */
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- soundcard_writeframe(o, (short *)o->oss_write_buf);
- src += l;
- o->oss_write_dst = 0;
- } else { /* copy residue */
- l = f->datalen - src;
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- src += l; /* but really, we are done */
- o->oss_write_dst += l;
- }
- }
- return 0;
-}
-
-static struct ast_frame *oss_read(struct ast_channel *c)
-{
- int res;
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame *f = &o->read_f;
-
- /* prepare a NULL frame in case we don't have enough data to return */
- bzero(f, sizeof(struct ast_frame));
- f->frametype = AST_FRAME_NULL;
- f->src = o->type;
-
- res = soundcard_setinput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set input mode\n");
- return NULL;
- } else if (res > 0) { /* too early to switch ? */
- /* Theoretically shouldn't happen, but anyway, return a NULL frame */
- return f;
- }
-
- res = read(o->sounddev, o->oss_read_buf + o->readpos,
- sizeof(o->oss_read_buf) - o->readpos);
- if (res < 0) /* audio data not ready, return a NULL frame */
- return f;
-
- o->readpos += res;
- if (o->readpos < sizeof(o->oss_read_buf)) /* not enough samples */
- return f;
-
- o->readpos = AST_FRIENDLY_OFFSET; /* reset read pointer for next frame */
- if (c->_state != AST_STATE_UP) /* drop data if frame is not up */
- return f;
- /* ok we can build and deliver the frame to the caller */
- f->frametype = AST_FRAME_VOICE;
- f->subclass = AST_FORMAT_SLINEAR;
- f->samples = FRAME_SIZE;
- f->datalen = FRAME_SIZE * 2;
- f->data = o->oss_read_buf + AST_FRIENDLY_OFFSET;
- f->offset = AST_FRIENDLY_OFFSET;
- return f;
-}
-
-static int oss_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
-{
- struct chan_oss_pvt *o = newchan->pvt->pvt;
- o->owner = newchan;
- return 0;
-}
-
-static int oss_indicate(struct ast_channel *c, int cond)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- int res;
-
- switch(cond) {
- case AST_CONTROL_BUSY:
- case AST_CONTROL_CONGESTION:
- case AST_CONTROL_RINGING:
- res = cond;
- break;
- case -1:
- o->cursound = -1;
- return 0;
- default:
- ast_log(LOG_WARNING,
- "Don't know how to display condition %d on %s\n",
- cond, c->name);
- return -1;
- }
- if (res > -1)
- RING(o, res);
- return 0;
-}
-
-static struct ast_channel *oss_new(struct chan_oss_pvt *o,
- char *ext, char *ctx, int state)
-{
- struct ast_channel *c;
- struct ast_channel_pvt *pvt;
-
- c = ast_channel_alloc(1);
- if (c == NULL)
- return NULL;
- snprintf(c->name, sizeof(c->name), "OSS/%s", o->device + 5);
- c->type = o->type;
- c->fds[0] = o->sounddev;
- c->nativeformats = AST_FORMAT_SLINEAR;
- pvt = c->pvt;
- pvt->pvt = o;
-
- /* relevant callbacks */
- pvt->send_digit = oss_digit;
- pvt->send_text = oss_text;
- pvt->hangup = oss_hangup;
- pvt->answer = oss_answer;
- pvt->read = oss_read;
- pvt->call = oss_call;
- pvt->write = oss_write;
- pvt->indicate = oss_indicate;
- pvt->fixup = oss_fixup;
-
-#define S_OVERRIDE(dst, src) \
- { if (src && src[0] != '\0') /* non-empty string */ \
- strncpy((dst), src, sizeof(dst)-1); }
- S_OVERRIDE(c->context, ctx);
- S_OVERRIDE(c->exten, ext);
- S_OVERRIDE(c->language, o->language);
- o->owner = c;
- ast_setstate(c, state);
- ast_mutex_lock(&usecnt_lock);
- usecnt++;
- ast_mutex_unlock(&usecnt_lock);
- ast_update_use_count();
- if (state != AST_STATE_DOWN) {
- if (ast_pbx_start(c)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", c->name);
- ast_hangup(c);
- o->owner = c = NULL;
- /* XXX what about the channel itself ? */
- /* XXX what about usecnt ? */
- }
- }
- return c;
-}
-
-/*
- * returns a pointer to the descriptor with the given name
- */
-static struct chan_oss_pvt *find_desc(char *dev)
-{
- struct chan_oss_pvt *o;
-
- for (o = oss_default.next; o && strcmp(o->name, dev) != 0; o = o->next)
- ;
- if (o == NULL)
- ast_log(LOG_WARNING, "%s could not find <%s>\n", __func__, dev);
- return o;
-}
-
-static struct ast_channel *oss_request(char *type, int format, void *data)
-{
- struct ast_channel *c;
- struct chan_oss_pvt *o = find_desc(data);
-
- ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n",
- type, data, (char *)data);
- if (o == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data);
- /* XXX we could default to 'dsp' perhaps ? */
- return NULL;
- }
- if ((format & AST_FORMAT_SLINEAR) == 0) {
- ast_log(LOG_NOTICE, "Format 0x%x unsupported\n", format);
- return NULL;
- }
- if (o->owner) {
- ast_log(LOG_NOTICE, "Already have a call on the OSS channel\n");
- return NULL;
- }
- c= oss_new(o, NULL, NULL, AST_STATE_DOWN);
- if (c == NULL) {
- ast_log(LOG_WARNING, "Unable to create new OSS channel\n");
- return NULL;
- }
- return c;
-}
-
-static int console_autoanswer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o == NULL) {
- ast_log(LOG_WARNING, "Cannot find device %s (should not happen!)\n",
- oss_active);
- return RESULT_FAILURE;
- }
- if (argc == 1) {
- ast_cli(fd, "Auto answer is %s.\n", o->autoanswer ? "on" : "off");
- return RESULT_SUCCESS;
- }
- if (!strcasecmp(argv[1], "on"))
- o->autoanswer = -1;
- else if (!strcasecmp(argv[1], "off"))
- o->autoanswer = 0;
- else
- return RESULT_SHOWUSAGE;
- return RESULT_SUCCESS;
-}
-
-static char *autoanswer_complete(char *line, char *word, int pos, int state)
-{
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
- int l = strlen(word);
-
- switch(state) {
- case 0:
- if (l && !strncasecmp(word, "on", MIN(l, 2)))
- return strdup("on");
- case 1:
- if (l && !strncasecmp(word, "off", MIN(l, 3)))
- return strdup("off");
- default:
- return NULL;
- }
- return NULL;
-}
-
-static char autoanswer_usage[] =
-"Usage: autoanswer [on|off]\n"
-" Enables or disables autoanswer feature. If used without\n"
-" argument, displays the current on/off status of autoanswer.\n"
-" The default value of autoanswer is in 'oss.conf'.\n";
-
-/*
- * answer command from the console
- */
-static int console_answer(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 1;
- o->cursound = -1;
- ast_queue_frame(o->owner, &f);
- RING(o, AST_CONTROL_ANSWER);
- return RESULT_SUCCESS;
-}
-
-static char sendtext_usage[] =
-"Usage: send text <message>\n"
-" Sends a text message for display on the remote terminal.\n";
-
-static int console_sendtext(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- int tmparg = 2;
- char text2send[256] = "";
- struct ast_frame f = { 0, };
-
- if (argc < 2)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- if (strlen(text2send))
- ast_cli(fd, "Warning: message already waiting to be sent, overwriting\n");
- text2send[0] = '\0';
- while(tmparg < argc) {
- strncat(text2send, argv[tmparg++], sizeof(text2send) - strlen(text2send) - 1);
- strncat(text2send, " ", sizeof(text2send) - strlen(text2send) - 1);
- }
- if (strlen(text2send)) {
- f.frametype = AST_FRAME_TEXT;
- f.subclass = 0;
- f.data = text2send;
- f.datalen = strlen(text2send);
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-static char answer_usage[] =
-"Usage: answer\n"
-" Answers an incoming call on the console (OSS) channel.\n";
-
-static int console_hangup(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner && !o->hookstate) {
- ast_cli(fd, "No call to hangup up\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) {
- ast_queue_hangup(o->owner);
- }
- return RESULT_SUCCESS;
-}
-
-static char hangup_usage[] =
-"Usage: hangup\n"
-" Hangs up any call currently placed on the console.\n";
-
-
-static int console_flash(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_FLASH };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner) { /* XXX maybe !o->hookstate too ? */
- ast_cli(fd, "No call to flash\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) { /* XXX must be true, right ? */
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-
-static char flash_usage[] =
-"Usage: flash\n"
-" Flashes the call currently placed on the console.\n";
-
-
-
-static int console_dial(int fd, int argc, char *argv[])
-{
- char *tmp = NULL, *mye = NULL, *myc = NULL;
- int i;
- struct ast_frame f = { AST_FRAME_DTMF, 0 };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o->owner) { /* already in a call */
- if (argc == 1) { /* argument is mandatory here */
- ast_cli(fd, "Already in a call. You can only dial digits until you hangup.\n");
- return RESULT_FAILURE;
- }
- mye = argv[1];
- /* send the string one char at a time */
- for (i=0; i<strlen(mye); i++) {
- f.subclass = mye[i];
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
- }
- /* if we have an argument split it into extension and context */
-
- if (argc == 2) {
- tmp = myc = strdup(argv[1]); /* make a writable copy */
- mye = strsep(&myc, "@"); /* set exten, advance to context */
- myc = strsep(&myc, "@"); /* set context */
- }
- /* supply default values if needed */
- if (mye == NULL)
- mye = o->ext;
- if (myc == NULL)
- myc = o->ctx;
- if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
- o->hookstate = 1;
- oss_new(o, mye, myc, AST_STATE_RINGING);
- } else
- ast_cli(fd, "No such extension '%s' in context '%s'\n", mye, myc);
- return RESULT_SUCCESS;
-}
-
-static char dial_usage[] =
-"Usage: dial [extension[@context]]\n"
-" Dials a given extensison (and context if specified)\n";
-
-static int console_transfer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- struct ast_channel *b = NULL;
- char *ext, *ctx;
-
- if (argc != 2)
- return RESULT_SHOWUSAGE;
- if (o == NULL)
- return RESULT_FAILURE;
- if (o->owner == NULL || (b = o->owner->bridge) == NULL) {
- ast_cli(fd, "There is no call to transfer\n");
- return RESULT_SUCCESS;
- }
-
- ext = ctx = strdup(argv[1]); /* make a writable copy */
- strsep(&ctx, "@"); /* set exten, advance to context */
- ctx = strsep(&ctx, "@"); /* strip trailing @ and the rest */
-
- if (ctx == NULL) /* supply default context if needed */
- ctx = o->owner->context;
- if (!ast_exists_extension(b, ctx, ext, 1, b->callerid)) {
- ast_cli(fd, "No such extension exists\n");
- } else {
- ast_cli(fd, "Whee, transferring %s to %s@%s.\n", b->name, ext, ctx);
- if (ast_async_goto(b, ctx, ext, 1))
- ast_cli(fd, "Failed to transfer :(\n");
- }
- free(ext);
- return RESULT_SUCCESS;
-}
-
-static char transfer_usage[] =
-"Usage: transfer <extension>[@context]\n"
-" Transfers the currently connected call to the given extension (and\n"
-"context if specified)\n";
-
-static int console_active(int fd, int argc, char *argv[])
-{
- if (argc == 1) {
- ast_cli(fd, "active console is [%s]\n", oss_active);
- } else if (argc != 2) {
- return RESULT_SHOWUSAGE;
- } else {
- struct chan_oss_pvt *o;
- if (strcmp(argv[1], "show") == 0) {
- for (o = oss_default.next; o ; o = o->next)
- ast_cli(fd, "device [%s] exists\n", o->name);
- return RESULT_SUCCESS;
- }
- o = find_desc(argv[1]);
- if (o == NULL)
- ast_cli(fd, "No device [%s] exists\n", argv[1]);
- else
- oss_active = o->name;
- }
- return RESULT_SUCCESS;
-}
-
-static struct ast_cli_entry myclis[] = {
- { { "answer", NULL }, console_answer, "Answer an incoming console call", answer_usage },
- { { "hangup", NULL }, console_hangup, "Hangup a call on the console", hangup_usage },
- { { "flash", NULL }, console_flash, "Flash a call on the console", flash_usage },
- { { "dial", NULL }, console_dial, "Dial an extension on the console", dial_usage },
- { { "transfer", NULL }, console_transfer, "Transfer a call to a different extension", transfer_usage },
- { { "send", "text", NULL }, console_sendtext, "Send text to the remote device", sendtext_usage },
- { { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete },
- { { "console", NULL }, console_active, "Sets/displays active console",
- "console foo sets foo as the console"}
-};
-
-/*
- * store the mixer argument from the config file, filtering possibly
- * invalid or dangerous values (the string is used as argument for
- * system("mixer %s")
- */
-static void store_mixer(struct chan_oss_pvt *o, char *s)
-{
- int i;
-
- for (i=0; i < strlen(s); i++) {
- 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;
- }
- }
- if (o->mixer_cmd)
- free(o->mixer_cmd);
- o->mixer_cmd = strdup(s);
- ast_log(LOG_WARNING, "setting mixer %s\n", s);
-}
-
-/*
- * grab fields from the config file, init the descriptor and open the device.
- */
-static struct chan_oss_pvt * store_config(struct ast_config *cfg,
- char *ctg)
-{
- struct ast_variable *v;
- struct chan_oss_pvt *o;
-
- if (ctg == NULL) {
- o = &oss_default;
- o->next = NULL; /* XXX needed ? */
- ctg = "general";
- } else {
- o = (struct chan_oss_pvt *)malloc(sizeof *o);
- if (o == NULL) /* fail */
- return NULL;
- *o = oss_default;
- /* "general" is also the default thing */
- if (strcmp(ctg, "general") == 0) {
- o->name = strdup("dsp");
- oss_active = o->name;
- goto openit;
- }
- o->name = strdup(ctg);
- }
- ast_log(LOG_WARNING, "found category [%s]\n", ctg);
-
- /* fill other fields from configuration */
- v = ast_variable_browse(cfg, ctg);
- while(v) {
- M_START(v->name, v->value);
-
- M_BOOL("autoanswer", o->autoanswer)
- M_BOOL("autohangup", o->autohangup)
- M_BOOL("playbackonly", o->playbackonly)
- M_BOOL("silencesuppression", o->silencesuppression)
- M_UINT("silencethreshold", o->silencethreshold )
- M_STR("device", o->device)
- M_UINT("frags", o->frags)
- M_UINT("debug", oss_debug)
- M_UINT("queuesize", o->queuesize)
- M_STR("context", o->ctx)
- M_STR("language", o->language)
- M_STR("extension", o->ext)
- M_F("mixer", store_mixer(o, v->value))
- M_END(;);
- v=v->next;
- }
- if (!strlen(o->device))
- strncpy(o->device, DEV_DSP, sizeof(o->device)-1);
- if (o->mixer_cmd) {
- char *cmd;
-
- asprintf(&cmd, "mixer %s", o->mixer_cmd);
- ast_log(LOG_WARNING, "running [%s]\n", cmd);
- system(cmd);
- free(cmd);
- }
- if (o == &oss_default) /* we are done with the default */
- return NULL;
-
-openit:
- if (setformat(o, O_RDWR) < 0) { /* open device */
- if (option_verbose > 0) {
- ast_verbose(VERBOSE_PREFIX_2 "Device %s not detected\n", ctg);
- ast_verbose(VERBOSE_PREFIX_2 "Turn off OSS support by adding "
- "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
- }
- goto error;
- }
- soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (o->duplex != M_FULL)
- ast_log(LOG_WARNING, "XXX I don't work right with non "
- "full-duplex sound cards XXX\n");
- if ( pipe(o->sndcmd) != 0 ) {
- ast_log(LOG_ERROR, "Unable to create pipe\n");
- goto error;
- }
- ast_pthread_create(&o->sthread, NULL, sound_thread, o);
- /* link into list of devices */
- if (o != &oss_default) {
- o->next = oss_default.next;
- oss_default.next = o;
- }
- return o;
-
-error:
- if (o != &oss_default)
- free(o);
- return NULL;
-}
-
-int load_module()
-{
- int i;
- struct ast_config *cfg;
-
- /* load config file */
- cfg = ast_load(config);
- if (cfg != NULL) {
- char *ctg;
-
- store_config(cfg, NULL); /* init general category */
- ctg = ast_category_browse(cfg, NULL); /* initial category */
- while (ctg != NULL) {
- store_config(cfg, ctg);
- ctg = ast_category_browse(cfg, ctg);
- }
- ast_destroy(cfg);
- }
- if (find_desc(oss_active) == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", oss_active);
- /* XXX we could default to 'dsp' perhaps ? */
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- i = ast_channel_register(oss_default.type, tdesc,
- AST_FORMAT_SLINEAR, oss_request);
- if (i < 0) {
- ast_log(LOG_ERROR, "Unable to register channel class '%s'\n",
- oss_default.type);
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- for (i=0; i<sizeof(myclis)/sizeof(struct ast_cli_entry); i++)
- ast_cli_register(myclis + i);
- return 0;
-}
-
-
-int unload_module()
-{
- int x;
- struct chan_oss_pvt *o;
-
- /* XXX do we need a ast_channel_unregister oss_request ? */
- for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++)
- ast_cli_unregister(myclis + x);
-
- for (o = oss_default.next; o ; o = o->next) {
- close(o->sounddev);
- if (o->sndcmd[0] > 0) {
- close(o->sndcmd[0]);
- close(o->sndcmd[1]);
- }
- if (o->owner)
- ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD);
- if (o->owner) /* XXX how ??? */
- return -1;
- /* XXX what about the thread ? */
- /* XXX what about the memory allocated ? */
- }
- return 0;
-}
-
-char *description()
-{
- return desc;
-}
-
-int usecount() /* XXX is this per-device or global for the module ? */
-{
- int res;
- ast_mutex_lock(&usecnt_lock);
- res = usecnt;
- ast_mutex_unlock(&usecnt_lock);
- return res;
-}
-
-char *key()
-{
- return ASTERISK_GPL_KEY;
-}
diff --git a/net/asterisk12/files/patch-Makefile b/net/asterisk12/files/patch-Makefile
index 49c66ed..16f6b03 100644
--- a/net/asterisk12/files/patch-Makefile
+++ b/net/asterisk12/files/patch-Makefile
@@ -3,128 +3,200 @@ $FreeBSD$
--- Makefile.orig
+++ Makefile
-@@ -45,6 +45,19 @@
- PROC=$(shell uname -m)
- endif
-
-+ifeq (${OSARCH},FreeBSD)
-+ifeq ($(PROC),sparc64)
-+PROC=ultrasparc
-+OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
-+OPTIONS+=$(shell if $(CC) -mcpu=v9 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v9"; fi)
-+OPTIONS+=-fomit-frame-pointer
-+endif
-+ifeq ($(PROC),amd64)
-+PROC=k8
-+OPTIONS+=-m64
-+endif
-+endif
-+
- # Pentium Pro Optimize
- #PROC=i686
-
-@@ -63,10 +76,10 @@
+@@ -19,8 +19,8 @@
+ # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
+ # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
+ # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
+-CC=$(CROSS_COMPILE)gcc
+-HOST_CC=gcc
++CC?=$(CROSS_COMPILE)gcc
++HOST_CC=${CC}
+ # CROSS_ARCH=Linux
+ # CROSS_PROC=arm
+ # SUB_PROC=xscale # or maverick
+@@ -44,14 +44,14 @@
#K6OPT = -DK6OPT
- #Tell gcc to optimize the asterisk's code
+ #Tell gcc to optimize the code
-OPTIMIZE+=-O6
+#OPTIMIZE+=-O6
+ endif
- #Include debug symbols in the executables (-g) and profiling info (-pg)
--DEBUG=-g #-pg
-+#DEBUG=-g #-pg
+ #Overwite config files on "make samples"
+-OVERWRITE=y
++OVERWRITE=n
- # If you are running a radio application, define RADIO_RELAX so that the DTMF
- # will be received more reliably
-@@ -91,7 +104,7 @@
+ #Include debug and macro symbols in the executables (-g) and profiling info (-pg)
+-DEBUG=-g3 #-pg
++#DEBUG=-g3 #-pg
+
+ #Set NOCRYPTO to yes if you do not want to have crypto support or
+ #dependencies
+@@ -83,7 +83,7 @@
# Where to install asterisk after compiling
# Default -> leave empty
--INSTALL_PREFIX=
+-INSTALL_PREFIX?=
+INSTALL_PREFIX=$(PREFIX)
# Staging directory
# Files are copied here temporarily during the install process
-@@ -111,23 +124,23 @@
- # Don't use together with -DBUSYDETECT_TONEONLY
+@@ -106,17 +106,17 @@
BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
--ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
--ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
-+ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
-+ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
- ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
--ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
--ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
--ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
-+ASTSPOOLDIR=/var/spool/asterisk
-+ASTLOGDIR=/var/log/asterisk
-+ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
- ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
--ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
--ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
--ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
--ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
-+ASTBINDIR=$(INSTALL_PREFIX)/bin
-+ASTSBINDIR=$(INSTALL_PREFIX)/sbin
-+ASTVARRUNDIR=/var/run
-+ASTMANDIR=$(INSTALL_PREFIX)/man
-
- MODULES_DIR=$(ASTLIBDIR)/modules
- AGI_DIR=$(ASTVARLIBDIR)/agi-bin
-
- INCLUDE=-Iinclude -I../include
--CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
-+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
- CFLAGS+=$(OPTIMIZE)
+ ifneq ($(OSARCH),SunOS)
+- ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
+ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+ MODULES_DIR=$(ASTLIBDIR)/modules
+ AGI_DIR=$(ASTVARLIBDIR)/agi-bin
+ else
+@@ -218,13 +218,13 @@
+ endif
+
+ INCLUDE+=-Iinclude -I../include
+-ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
+-ASTCFLAGS+=$(OPTIMIZE)
++ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
++#ASTCFLAGS+=$(OPTIMIZE)
+ ASTOBJ=-o asterisk
+
+ ifeq ($(findstring BSD,$(OSARCH)),BSD)
+ PROC=$(shell uname -m)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
ifneq ($(PROC),ultrasparc)
-@@ -138,12 +151,8 @@
- CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi)
-
- ifeq (${OSARCH},FreeBSD)
--OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
--CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
--LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
--INCLUDE+=-I/usr/local/include
--CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
--MPG123TARG=freebsd
-+CFLAGS+=$(PTHREAD_CFLAGS)
-+LIBS+=$(PTHREAD_LIBS)
+@@ -235,8 +235,8 @@
+ ASTCFLAGS+=-fsigned-char
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h),)
+- ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/local/include/osp
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h),)
++ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp
+ else
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp
+@@ -245,27 +245,24 @@
+
+ ifeq ($(OSARCH),FreeBSD)
+ BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
+- ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
+- LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
+- ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp
++ ASTCFLAGS+=$(PTHREAD_CFLAGS)
++ LIBS+=$(PTHREAD_LIBS)
++ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp),)
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp
+ endif
+ MPG123TARG=freebsd
+
+- # XXX FreeBSD paths
+- PREFIX?=/usr/local
+- ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
+- ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
++ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
+- # XXX end FreeBSD paths
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+
endif # FreeBSD
- ifeq (${OSARCH},NetBSD)
-@@ -160,7 +169,10 @@
- #CFLAGS+=-DOLD_DSP_ROUTINES
+@@ -281,7 +278,7 @@
- CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
--CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPTEL_OPTIMIZATIONS
-+endif
+ ifeq ($(OSARCH),SunOS)
+ ASTCFLAGS+=-Wcast-align -DSOLARIS
+- INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
++ INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/include
+ endif
- LIBEDIT=editline/libedit.a
+ ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN)
+@@ -296,7 +293,7 @@
-@@ -222,7 +234,7 @@
- SOLINK=-shared -Xlinker -x
+ ifndef WITHOUT_ZAPTEL
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS
+ endif
+
+@@ -323,7 +320,7 @@
+ ASTERISKVERSIONNUM=999999
+ ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name)
+ else
+- ASTERISKVERSIONNUM=000000
++ ASTERISKVERSIONNUM?=000000
+ endif
+ endif
+
+@@ -388,10 +385,10 @@
endif
--CC=gcc
-+CC?=gcc
- INSTALL=install
+ ifeq ($(OSARCH),SunOS)
+- LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ OBJS+=strcompat.o
+ ASTLINK=
+- SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ endif
+
+ ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
+@@ -399,7 +396,7 @@
+ endif
- _all: all
-@@ -234,7 +246,7 @@
+ # This is used when generating the doxygen documentation
+-ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),)
++ifneq ($(wildcard $(LOCALBASE)/bin/dot)$(wildcard /usr/bin/dot),)
+ HAVEDOT=yes
+ else
+ HAVEDOT=no
+@@ -418,7 +415,7 @@
@echo " + $(MAKE) install +"
@echo " +-------------------------------------------+"
--all: depend asterisk subdirs
-+all: depend asterisk subdirs manpage
+-all: cleantest depend asterisk subdirs
++all: cleantest depend asterisk subdirs manpage
- editline/config.h:
- cd editline && unset CFLAGS LIBS && ./configure ; \
-@@ -243,13 +255,13 @@
+ #ifneq ($(wildcard tags),)
+ ctags: tags
+@@ -437,13 +434,13 @@
cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
$(MAKE) -C editline libedit.a
@@ -144,55 +216,57 @@ $FreeBSD$
+# fi
ifneq ($(wildcard .depend),)
- include .depend
-@@ -271,13 +283,10 @@
-
- asterisk.o: asterisk.c build.h
-
--manpage: asterisk.8.gz
-+manpage: asterisk.8
-
--asterisk.8.gz: asterisk.sgml
-- rm -f asterisk.8
-- docbook2man asterisk.sgml
-- mv ./*.8 asterisk.8
-- gzip asterisk.8
-+asterisk.8: asterisk.8.gz
-+ gzcat asterisk.8.gz > asterisk.8
-
- ifneq ($(strip $(ASTERISKVERSION)),)
- build.h: .version
-@@ -295,8 +304,8 @@
- exit 1; \
+ include .depend
+@@ -510,14 +507,14 @@
+ cygwin_a:
+ $(MAKE) -C cygwin all
+
+-asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
++asterisk: $(CYGLOADER) editline/libedit.a stdtime/libtime.a $(OBJS)
+ build_tools/make_build_h > include/asterisk/build.h.tmp
+ if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
+ mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
fi
-
--asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
-- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
-+asterisk: editline/libedit.a stdtime/libtime.a $(OBJS)
-+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) stdtime/libtime.a $(LIBS)
+ rm -f include/asterisk/build.h.tmp
+ $(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
+- $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
++ $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) stdtime/libtime.a $(LIBS)
muted: muted.o
- $(CC) -o muted muted.o
-@@ -315,28 +324,28 @@
- $(MAKE) -C stdtime clean
+ $(CC) $(AUDIO_LIBS) -o muted muted.o
+@@ -539,38 +536,38 @@
datafiles: all
+ if [ x`whoami` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
for x in sounds/digits/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
+ for x in sounds/dictate/*.gsm; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
+ else \
+ echo "No description for $$x"; \
+ exit 1; \
+ fi; \
+ done
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
for x in sounds/letters/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
else \
echo "No description for $$x"; \
@@ -202,17 +276,17 @@ $FreeBSD$
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
for x in sounds/phonetic/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
else \
echo "No description for $$x"; \
exit 1; \
-@@ -344,18 +353,18 @@
+@@ -578,18 +575,18 @@
done
- for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
@@ -224,70 +298,80 @@ $FreeBSD$
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images
for x in images/*.jpg; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
done
- mkdir -p $(DESTDIR)$(AGI_DIR)
+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
update:
- @if [ -d CVS ]; then \
-@@ -367,127 +376,90 @@
- fi
+ @if [ -d .svn ]; then \
+@@ -618,75 +615,53 @@
+ OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
bininstall: all
- mkdir -p $(DESTDIR)$(MODULES_DIR)
- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTETCDIR)
- mkdir -p $(DESTDIR)$(ASTBINDIR)
-- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
-- install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
+- if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ $(MKDIR) $(DESTDIR)$(MODULES_DIR)
+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTBINDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR)
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/dictate
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/system
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/tmp
-+ $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/meetme
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/monitor
++ if [ -f asterisk ]; then $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f cygwin/asterisk.exe ]; then $(BSD_INSTALL_PROGRAM) cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f asterisk.dll ]; then $(BSD_INSTALL_PROGRAM) asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
+- $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
+- $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
++ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
-- install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
+ chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
fi
for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
-- install -d $(DESTDIR)$(ASTHEADERDIR)
-- install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm
-- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
-- if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \
-- mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- else \
-- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \
-- fi
-- ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+ if [ -n "$(OLDHEADERS)" ]; then \
+ rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
+ fi
+ rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
+- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
-- install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 asterisk.8.gz $(DESTDIR)$(ASTMANDIR)/man8
-+ ln -sf $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv
++ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
@@ -295,14 +379,16 @@ $FreeBSD$
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
if [ -d contrib/firmware/iax ]; then \
-- install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
else \
echo "You need to do cvs update -d not just cvs update" ; \
fi
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . )
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
- if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
- @echo " +---- Asterisk Installation Complete -------+"
- @echo " + +"
@@ -325,85 +411,74 @@ $FreeBSD$
- @echo " + **Note** This requires that you have +"
- @echo " + doxygen installed on your local system +"
- @echo " +-------------------------------------------+"
-- @echo " + +"
-- @echo " + ** NOTE FOR DOWNGRADING FROM CVS HEAD ** +"
-- @echo " + +"
-- @echo " + If you are downgrading from CVS HEAD to +"
-- @echo " + a stable release, remember to delete +"
-- @echo " + everything from your asterisk modules +"
-- @echo " + directory (/usr/lib/asterisk/modules/) +"
-- @echo " + and the asterisk header directory +"
-- @echo " + (/usr/include/asterisk/) +"
-- @echo " + before doing a '$(MAKE) install'. +"
-- @echo " + +"
-- @echo " +-------------------------------------------+"
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/vm . )
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/voicemail . )
+ @$(MAKE) -s oldmodcheck
+ NEWMODS=$(notdir $(wildcard */*.so))
+@@ -710,7 +685,7 @@
+ echo " WARNING WARNING WARNING" ;\
+ fi
-install: all datafiles bininstall
+install: all datafiles bininstall samples
-
+ @if [ -x /usr/sbin/asterisk-post-install ]; then \
+ /usr/sbin/asterisk-post-install $(DESTDIR) . ; \
+ fi
+@@ -718,16 +693,19 @@
upgrade: all bininstall
- adsi: all
+ adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x`-dist; \
- if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
fi ; \
done
- samples: all datafiles adsi
+ samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
-- for x in configs/*.sample; do \
-- if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
++ echo ADSI INSTALL $(BSD_INSTALL_DATA)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
-+ for x in configs/*.sample channels/h323/*.sample; do \
+ for x in configs/*.sample; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`-dist;\
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+ if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
+ if [ "$(OVERWRITE)" = "y" ]; then \
+ if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
+@@ -740,7 +718,7 @@
+ continue; \
+ fi ;\
fi ; \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
done
-- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-+ echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
-+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist $(DESTDIR)$(ASTETCDIR)/asterisk.conf; \
-+ fi
+ if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ ( \
+@@ -759,25 +737,25 @@
+ echo ";astctlowner = root" ; \
+ echo ";astctlgroup = apache" ; \
+ echo ";astctl = asterisk.ctl" ; \
+- ) > $(DESTDIR)$(ASTCONFPATH) ; \
++ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ else \
+ echo "Skipping asterisk.conf creation"; \
+ fi
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
for x in sounds/demo-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
for x in sounds/*.mp3; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
done
rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3
@@ -412,18 +487,18 @@ $FreeBSD$
:> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
-@@ -502,7 +474,7 @@
- @[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 )
- @[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 )
- install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi
-- mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk
-+ $(MKDIR) $(DESTDIR)$(HTTPDIR)/html/_asterisk
+@@ -791,7 +769,7 @@
+ @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
+ @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
+ $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
+- mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
++ $(MKDIR) $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
for x in images/*.gif; do \
- install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
done
-@@ -522,10 +494,10 @@
+@@ -820,10 +798,10 @@
- __rpm: _version
+ __rpm: include/asterisk/version.h spec
rm -rf /tmp/asterisk ; \
- mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
+ $(MKDIR) /tmp/asterisk/redhat/RPMS/i386 ; \
@@ -431,6 +506,6 @@ $FreeBSD$
$(MAKE) DESTDIR=/tmp/asterisk samples ; \
- mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
+ $(MKDIR) /tmp/asterisk/etc/rc.d/init.d ; \
- cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
- sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
+ cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
+
diff --git a/net/asterisk12/files/patch-agi::Makefile b/net/asterisk12/files/patch-agi::Makefile
index 32efb5d..b359765 100644
--- a/net/asterisk12/files/patch-agi::Makefile
+++ b/net/asterisk12/files/patch-agi::Makefile
@@ -1,9 +1,9 @@
$FreeBSD$
---- agi/Makefile.orig Tue Jun 22 20:42:13 2004
-+++ agi/Makefile Tue Oct 5 21:03:40 2004
-@@ -11,15 +11,18 @@
+--- agi/Makefile.orig Thu Jan 12 15:42:07 2006
++++ agi/Makefile Thu Jan 12 15:44:39 2006
+@@ -11,7 +11,9 @@
# the GNU General Public License
#
@@ -14,14 +14,15 @@ $FreeBSD$
CFLAGS+=
+@@ -27,8 +29,9 @@
all: depend $(AGIS)
install: all
- mkdir -p $(DESTDIR)$(AGI_DIR)
- for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
-+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
++ $(MKDIR) -p $(DESTDIR)$(AGI_DIR)
+ for x in $(AGIS_BIN); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(AGI_DIR) ; done
+ for x in $(AGIS_SCR); do $(BSD_INSTALL_SCRIPT) $$x $(DESTDIR)$(AGI_DIR) ; done
eagi-test: eagi-test.o
- $(CC) $(CFLAGS) -o eagi-test eagi-test.o
+ $(CC) $(CFLAGS) -o eagi-test eagi-test.o $(LIBS)
diff --git a/net/asterisk12/files/patch-apps::Makefile b/net/asterisk12/files/patch-apps::Makefile
index 44f8495..ee7d560 100644
--- a/net/asterisk12/files/patch-apps::Makefile
+++ b/net/asterisk12/files/patch-apps::Makefile
@@ -1,38 +1,56 @@
---- apps/Makefile.orig Wed Jun 22 14:40:11 2005
-+++ apps/Makefile Wed Jun 22 14:43:45 2005
-@@ -40,9 +40,13 @@
+
+$FreeBSD$
+
+--- apps/Makefile.orig
++++ apps/Makefile
+@@ -45,25 +45,27 @@
#APPS+=app_rpt.so
- APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
--APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
- APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi)
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h),)
+ APPS+=app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so
+ endif
+ endif # WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ifdef WITH_FAX
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/spandsp.h ]; then echo "app_rxfax.so app_txfax.so" ; fi)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp.h),)
++APPS+=app_rxfax.so app_txfax.so
++endif
+endif
+
- CFLAGS+=-fPIC
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ APPS+=app_osplookup.so
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+-CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+-CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
+-ifneq ($(shell if [[ 0x`$(CROSS_COMPILE_BIN)curl-config --vernum` -ge 0x70907 ]]; then echo "OK" ; fi),)
+- ifneq (${CURLLIBS},)
+- APPS+=app_curl.so
+- endif
+-endif
++CURLLIBS=$(shell $(CROSS_COMPILE_BIN)$(LOCALBASE)/bin/curl-config --libs)
++APPS+=app_curl.so
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
-@@ -65,12 +69,12 @@
- $(CC) $(SOLINK) -o $@ $< -ltonezone
+ ifeq (${OSARCH},CYGWIN)
+ CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
+@@ -95,24 +97,32 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -ltonezone
install: all
- for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(APPS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
+ rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
- app_voicemail.so : app_voicemail.o
- ifeq ($(USE_MYSQL_VM_INTERFACE),1)
-- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L/usr/lib/mysql -lmysqlclient -lz
-+ $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L$(LOCALBASE)/lib/mysql -lmysqlclient -lz
- else
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lpq
-@@ -79,17 +83,25 @@
- endif
- endif
+ app_curl.so: app_curl.o
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
+ifdef WITH_FAX
+app_rxfax.so : app_rxfax.o
@@ -47,15 +65,15 @@
+ $(CC) -I$(LOCALBASE)/include/pgsql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
app_sql_postgres.so: app_sql_postgres.o
-- $(CC) $(SOLINK) -o $@ $< -L/usr/local/pgsql/lib -lpq
-+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lpq
+- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
++ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L$(LOCALBASE)/lib -lpq
app_sql_odbc.so: app_sql_odbc.o
- $(CC) $(SOLINK) -o $@ $< -lodbc
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
look: look.c
- $(CC) -pipe -O6 -g look.c -o look -lncurses
-+ $(CC) $(CFLAGS) look.c -o look -lncurses
++ $(CC) look.c -o look -lncurses
- ifneq ($(wildcard .depend),)
- include .depend
+ ifeq (SunOS,$(shell uname))
+ app_chanspy.so: app_chanspy.o
diff --git a/net/asterisk12/files/patch-apps::app_rxfax.c b/net/asterisk12/files/patch-apps::app_rxfax.c
index 88362bfc..820208e 100644
--- a/net/asterisk12/files/patch-apps::app_rxfax.c
+++ b/net/asterisk12/files/patch-apps::app_rxfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_rxfax.c.orig
-+++ apps/app_rxfax.c
-@@ -0,0 +1,371 @@
+--- /dev/null Thu Jan 12 17:44:40 2006
++++ apps/app_rxfax.c Thu Jan 12 17:41:53 2006
+@@ -0,0 +1,373 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <asterisk/dsp.h>
+#include <asterisk/manager.h>
++#include <asterisk/version.h>
+#include <string.h>
+#include <stdlib.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
@@ -100,7 +102,7 @@ $FreeBSD$
+ "FaxReceived", "Channel: %s\nExten: %s\nCallerID: %s\nRemoteStationID: %s\nLocalStationID: %s\nPagesTransferred: %i\nResolution: %i\nTransferRate: %i\nFileName: %s\n",
+ chan->name,
+ chan->exten,
-+#if (ASTERISK_VERSION_NUM <= 011000)
++#if ASTERISK_VERSION_NUM <= 010010
+ chan->callerid,
+#else
+ (chan->cid.cid_num) ? chan->cid.cid_num : "",
diff --git a/net/asterisk12/files/patch-apps::app_txfax.c b/net/asterisk12/files/patch-apps::app_txfax.c
index 8daf0f9..15ad667 100644
--- a/net/asterisk12/files/patch-apps::app_txfax.c
+++ b/net/asterisk12/files/patch-apps::app_txfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_txfax.c.orig
-+++ apps/app_txfax.c
-@@ -0,0 +1,293 @@
+--- /dev/null Thu Jan 12 17:48:54 2006
++++ apps/app_txfax.c Thu Jan 12 17:48:36 2006
+@@ -0,0 +1,295 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <string.h>
+#include <stdlib.h>
++#include <math.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
+#include <inttypes.h>
+#else
diff --git a/net/asterisk12/files/patch-astman::Makefile b/net/asterisk12/files/patch-astman::Makefile
deleted file mode 100644
index 2745860..0000000
--- a/net/asterisk12/files/patch-astman::Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-
-$FreeBSD$
-
---- astman/Makefile.orig Sat Jun 26 22:25:39 2004
-+++ astman/Makefile Thu Oct 14 19:14:22 2004
-@@ -5,16 +5,16 @@
-
- OSARCH=$(shell uname -s)
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS+=-I/usr/local/include -L/usr/local/lib
-+CFLAGS+=-I$(LOCALBASE)/include -L$(LOCALBASE)/lib
- endif
-
--TARGET=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else if [ -f /usr/local/include/newt.h ]; then echo "astman"; else echo "none" ; fi ; fi)
-+TARGET=astman
- all: depend $(TARGET)
-
- install:
- if [ "$(TARGET)" != "none" ]; then \
- for x in $(TARGET); do \
-- install -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
-+ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
- done ; \
- fi
-
diff --git a/net/asterisk12/files/patch-cdr::Makefile b/net/asterisk12/files/patch-cdr::Makefile
index 1d0fb20..da16b60 100644
--- a/net/asterisk12/files/patch-cdr::Makefile
+++ b/net/asterisk12/files/patch-cdr::Makefile
@@ -1,51 +1,65 @@
---- cdr/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ cdr/Makefile Tue Aug 9 17:28:11 2005
-@@ -21,7 +21,7 @@
- OSARCH=$(shell uname -s)
-
- ifeq (${OSARCH},FreeBSD)
--SOLINK+=-L/usr/local/lib
-+SOLINK+=-L$(LOCALBASE)/lib
+
+$FreeBSD$
+
+--- cdr/Makefile.orig Tue Nov 29 20:24:39 2005
++++ cdr/Makefile Thu Jan 12 17:56:23 2006
+@@ -21,8 +21,8 @@
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
endif
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
-@@ -37,18 +37,23 @@
+@@ -38,18 +38,18 @@
#
# unixODBC stuff...
#
-+ifdef WITH_ODBC
- MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/odbcinst.h),)
+ MODS+=cdr_odbc.so
+ endif
#
# FreeTDS stuff...
#
-+ifdef WITH_FREETDS
- MODS+=$(shell if [ -f "/usr/include/tds.h" ]; then echo "cdr_tds.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/tds.h" ]; then echo "cdr_tds.so"; fi)
-+endif
-
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h),)
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.63),1)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tds.h),)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.63),1)
+ CFLAGS += -DFREETDS_0_63
+ else
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.62),1)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.62),1)
+ CFLAGS += -DFREETDS_0_62
+ else
+ CFLAGS += -DFREETDS_PRE_0_62
+@@ -61,7 +61,7 @@
#
# PGSQL stuff... Autoconf anyone??
#
-+ifdef WITH_PGSQL
- MODS+=$(shell if [ -d /usr/local/pgsql/include ] || [ -d /usr/include/pgsql ] || [ -d /usr/local/include/pgsql ] || [ -d /opt/pgsql/include ] || [ -f /usr/include/libpq-fe.h ] ; then echo "cdr_pgsql.so"; fi)
- CFLAGS+=$(shell if [ -d /usr/local/pgsql/include ]; then echo "-I/usr/local/pgsql/include"; fi)
- CFLAGS+=$(shell if [ -d /usr/include/pgsql ]; then echo "-I/usr/include/pgsql"; fi)
-@@ -62,16 +67,19 @@
- MLFLAGS+=$(shell if [ -d /usr/local/lib/pgsql ]; then echo "-L/usr/local/lib/pgsql"; fi)
- MLFLAGS+=$(shell if [ -d /opt/pgsql/lib ]; then echo "-L/opt/pgsql/lib"; fi)
- MLFLAGS+=$(shell if [ -f /usr/lib/libpq.so ]; then echo "-L/usr/lib"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
+ MODS+=cdr_pgsql.so
+ endif
- #
- # SQLIte stuff...
- #
-+ifdef WITH_SQLITE
- MODS+=$(shell if [ -f "/usr/include/sqlite.h" ]; then echo "cdr_sqlite.so"; fi)
-+endif
+@@ -82,9 +82,9 @@
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/pgsql
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql),)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/pgsql
+- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib/pgsql
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql),)
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql
++ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/pgsql
+ endif
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include),)
+@@ -110,7 +110,7 @@
all: depend $(MODS)
install: all
diff --git a/net/asterisk12/files/patch-channels::Makefile b/net/asterisk12/files/patch-channels::Makefile
index 7ecab67..edca9b1 100644
--- a/net/asterisk12/files/patch-channels::Makefile
+++ b/net/asterisk12/files/patch-channels::Makefile
@@ -1,97 +1,85 @@
---- channels/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ channels/Makefile Tue Aug 9 17:34:28 2005
-@@ -57,10 +57,10 @@
-
+
+$FreeBSD$
+
+--- channels/Makefile.orig
++++ channels/Makefile
+@@ -48,9 +48,9 @@
endif
+
ifeq (${OSARCH},FreeBSD)
--PTLIB=-lpt_FreeBSD_x86_r
--H323LIB=-lh323_FreeBSD_x86_r
--CHANH323LIB=-pthread
--SOLINK+=-L/usr/local/lib
-+PTLIB=-lpt_FreeBSD_x86_r_s
-+H323LIB=-lh323_FreeBSD_x86_r_s
-+CHANH323LIB=
-+SOLINK+=-L$(LOCALBASE)/lib
+- PTLIB=-lpt_FreeBSD_x86_r
+- H323LIB=-lh323_FreeBSD_x86_r
+- CHANH323LIB=-pthread
++ PTLIB=-lpt_FreeBSD_x86_r_s
++ H323LIB=-lh323_FreeBSD_x86_r_s
++ CHANH323LIB=
endif
+
ifeq (${OSARCH},NetBSD)
- PTLIB=-lpt_NetBSD_x86_r
-@@ -72,19 +72,23 @@
+@@ -73,11 +73,11 @@
+ SOLINK+=-lrt
endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/ixjuser.h ] && echo chan_phone.so)
-+ifdef WITH_H323
-+CHANNEL_LIBS+=chan_h323.so
-+endif
-
- CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
- CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
- CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
--CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
- CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
- CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
--ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
-+ZAPPRI=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo "-lpri")
- ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
-+ifdef WITH_ZAPTEL
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "-DIAX_TRUNKING -I$(LOCALBASE)/include")
-+endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
- CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX")
-
-@@ -106,8 +110,10 @@
-
- ZAPDIR=/usr/lib
-
-+ifdef WITH_ZAPTEL
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so")
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "chan_zap.so")
-+endif
-
- CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/ixjuser.h),)
+ CHANNEL_LIBS+=chan_phone.so
+ endif
-@@ -156,6 +162,8 @@
- chan_oss.so: chan_oss.o
- $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
+-ifneq ($(wildcard h323/libchanh323.a),)
++ifdef WITH_H323
+ CHANNEL_LIBS+=chan_h323.so
endif
-+chan_oss.so: chan_oss.o
-+ $(CC) $(SOLINK) -o $@ chan_oss.o
- chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o
- ifeq ($(USE_MYSQL_FRIENDS),1)
-@@ -175,7 +183,7 @@
- $(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c
+@@ -91,12 +91,12 @@
+ CHANNEL_LIBS+=chan_alsa.so
+ endif
- chan_zap.so: chan_zap.o
-- $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -ltonezone
-+ $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -L$(LOCALBASE)/lib -ltonezone
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libpri.so.1),)
+ CFLAGS+=-DZAPATA_PRI
+ ZAPPRI=-lpri
+ endif
- chan_sip.so: chan_sip.o
- ifeq ($(USE_SIP_MYSQL_FRIENDS),1)
-@@ -199,15 +207,17 @@
- chan_vpb.so: chan_vpb.o
- $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libmfcr2.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libmfcr2.so.1),)
+ CFLAGS+=-DZAPATA_R2
+ ZAPR2=-lmfcr2
+ endif
+@@ -109,12 +109,12 @@
+ endif
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ifeq (${OSARCH},NetBSD)
+ SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/pkg/lib
+ endif
+ ifeq (${OSARCH},FreeBSD)
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ CFLAGS+=-DIAX_TRUNKING
+ CHANNEL_LIBS+=chan_zap.so
+@@ -229,8 +229,10 @@
+ chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast
+ $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
+ else
-chan_h323.so: chan_h323.o h323/libchanh323.a
- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
+chan_h323.so: chan_h323.o h323/ast_h323.o
-+ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -lcrypto -lssl -L$(LOCALBASE)/lib -lexpat -llber -lldap -lldap_r
-
++ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o $(CHANH323LIB) -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L/usr/lib -lcrypto -lssl -lexpat -L$(LOCALBASE)/lib -llber -lldap -lldap_r
+h323/ast_h323.o:
+ $(MAKE) -C h323 ast_h323.o
+ endif
- #chan_modem.so : chan_modem.o
+ chan_misdn.so: chan_misdn.o chan_misdn_config.o misdn/chan_misdn_lib.a
+@@ -244,8 +246,7 @@
# $(CC) -rdynamic -shared -Xlinker -x -o $@ $<
install: all
- for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
+ for x in $(CHANNEL_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
depend: .depend
+
diff --git a/net/asterisk12/files/patch-channels::chan_h323.c b/net/asterisk12/files/patch-channels::chan_h323.c
index de2ed39..6498b97 100644
--- a/net/asterisk12/files/patch-channels::chan_h323.c
+++ b/net/asterisk12/files/patch-channels::chan_h323.c
@@ -1,14 +1,14 @@
$FreeBSD$
---- channels/chan_h323.c 2004/10/10 13:00:17 1.1
-+++ channels/chan_h323.c 2004/10/10 13:00:39
-@@ -26,7 +26,7 @@
- * Version Info: $Id: patch-channels::chan_h323.c,v 1.3.2.3 2004/10/14 14:30:13 sobomax Exp $
- */
+--- channels/chan_h323.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_h323.c Thu Jan 12 18:29:50 2006
+@@ -2281,7 +2281,7 @@ static char *convertcap(int cap)
+ }
+ }
--
-+#include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/signal.h>
- #include <sys/param.h>
+-static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs)
++static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active)
+ {
+ /* XXX Deal with Video */
+ struct oh323_pvt *pvt;
diff --git a/net/asterisk12/files/patch-channels::chan_sip.c b/net/asterisk12/files/patch-channels::chan_sip.c
index e634ce4..355c558 100644
--- a/net/asterisk12/files/patch-channels::chan_sip.c
+++ b/net/asterisk12/files/patch-channels::chan_sip.c
@@ -1,144 +1,131 @@
$FreeBSD$
---- channels/chan_sip.c.orig Sun Feb 17 18:01:43 2002
-+++ channels/chan_sip.c Sun Feb 17 18:10:52 2002
-@@ -141,7 +141,7 @@
+--- channels/chan_sip.c.orig Thu Jan 12 18:43:37 2006
++++ channels/chan_sip.c Thu Jan 12 18:50:11 2006
+@@ -336,7 +336,7 @@ static char global_vmexten[AST_MAX_EXTEN
static char default_language[MAX_LANGUAGE] = "";
--static char default_callerid[AST_MAX_EXTENSION] = "asterisk";
-+static char default_callerid[AST_MAX_EXTENSION] = "Unknown";
+-#define DEFAULT_CALLERID "asterisk"
++#define DEFAULT_CALLERID "Unknown"
+ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID;
static char default_fromdomain[AST_MAX_EXTENSION] = "";
+@@ -474,6 +474,7 @@ struct sip_invite_param {
-@@ -244,6 +244,7 @@
struct sip_route {
struct sip_route *next;
- char hop[0];
+ int lr;
+ char hop[0];
};
- struct sip_history {
-@@ -2218,7 +2219,7 @@
- if (p->owner) {
- /* We already hold the channel lock */
- if (f->frametype == AST_FRAME_VOICE) {
-- if (f->subclass != p->owner->nativeformats) {
-+ if (!(f->subclass & p->owner->nativeformats)) {
- ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
- p->owner->nativeformats = f->subclass;
- ast_set_read_format(p->owner, p->owner->readformat);
-@@ -4620,6 +4621,10 @@
+@@ -5993,6 +5994,7 @@ static void build_route(struct sip_pvt *
/* Make a struct route */
- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
+ thishop = malloc(sizeof(*thishop) + len);
if (thishop) {
-+ if (strnstr(rr, ";lr", len) != NULL)
-+ thishop->lr = 1;
-+ else
-+ thishop->lr = 0;
- strncpy(thishop->hop, rr, len); /* safe */
- thishop->hop[len] = '\0';
++ thishop->lr = (strnstr(rr, ";lr", len) != NULL ? 1 : 0);
+ ast_copy_string(thishop->hop, rr, len);
ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop);
-@@ -4643,31 +4648,41 @@
- rr += len+1;
- }
- }
-- /* 2nd append the Contact: if there is one */
-- /* Can be multiple Contact headers, comma separated values - we just take the first */
-- contact = get_header(req, "Contact");
-- if (!ast_strlen_zero(contact)) {
-- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-- /* Look for <: delimited address */
-- c = strchr(contact, '<');
-- if (c) {
-- /* Take to > */
-- ++c;
-- len = strcspn(c, ">");
-- } else {
-- /* No <> - just take the lot */
-- c = contact; len = strlen(contact);
-- }
-- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ /* Duplicate first route from the list */
-+ if (head && head->lr) {
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
- if (thishop) {
-- strncpy(thishop->hop, c, len); /* safe */
-- thishop->hop[len] = '\0';
-- thishop->next = NULL;
-- /* Goes at the end */
-- if (tail)
-- tail->next = thishop;
-- else
-- head = thishop;
-+ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
-+ thishop->next = head;
-+ head = thishop;
-+ }
-+ } else {
-+ /* Append the Contact: if there is one and first route is w/o `lr' param */
-+ /* Can be multiple Contact headers, comma separated values - we just take the first */
-+ contact = get_header(req, "Contact");
-+ if (!ast_strlen_zero(contact)) {
-+ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-+ /* Look for <: delimited address */
-+ c = strchr(contact, '<');
-+ if (c) {
-+ /* Take to > */
-+ ++c;
-+ len = strcspn(c, ">");
-+ } else {
-+ /* No <> - just take the lot */
-+ c = contact; len = strlen(contact);
-+ }
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ if (thishop) {
-+ strncpy(thishop->hop, c, len); /* safe */
-+ thishop->hop[len] = '\0';
-+ thishop->next = NULL;
-+ /* Goes at the end */
-+ if (tail)
-+ tail->next = thishop;
-+ else
-+ head = thishop;
+ /* Link in */
+@@ -6018,31 +6020,41 @@ static void build_route(struct sip_pvt *
+
+ /* Only append the contact if we are dealing with a strict router */
+ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) {
+- /* 2nd append the Contact: if there is one */
+- /* Can be multiple Contact headers, comma separated values - we just take the first */
+- contact = get_header(req, "Contact");
+- if (!ast_strlen_zero(contact)) {
+- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
+- /* Look for <: delimited address */
+- c = strchr(contact, '<');
+- if (c) {
+- /* Take to > */
+- ++c;
+- len = strcspn(c, ">") + 1;
+- } else {
+- /* No <> - just take the lot */
+- c = contact;
+- len = strlen(contact) + 1;
+- }
+- thishop = malloc(sizeof(*thishop) + len);
++ /* Duplicate first route from the list */
++ if (head && head->lr) {
++ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
+ if (thishop) {
+- ast_copy_string(thishop->hop, c, len);
+- thishop->next = NULL;
+- /* Goes at the end */
+- if (tail)
+- tail->next = thishop;
+- else
+- head = thishop;
++ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
++ thishop->next = head;
++ head = thishop;
+ }
++ } else {
++ /* Append the Contact: if there is one and first route is w/o `lr' param */
++ /* Can be multiple Contact headers, comma separated values - we just take the first */
++ contact = get_header(req, "Contact");
++ if (!ast_strlen_zero(contact)) {
++ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
++ /* Look for <: delimited address */
++ c = strchr(contact, '<');
++ if (c) {
++ /* Take to > */
++ ++c;
++ len = strcspn(c, ">") + 1;
++ } else {
++ /* No <> - just take the lot */
++ c = contact;
++ len = strlen(contact) + 1;
++ }
++ thishop = malloc(sizeof(*thishop) + len);
++ if (thishop) {
++ ast_copy_string(thishop->hop, c, len);
++ thishop->next = NULL;
++ /* Goes at the end */
++ if (tail)
++ tail->next = thishop;
++ else
++ head = thishop;
++ }
+ }
}
}
- /* Store as new route */
-@@ -7338,7 +7353,11 @@
- /* Get destination right away */
- gotdest = get_destination(p, NULL);
- get_rdnis(p, NULL);
-- extract_uri(p, req);
-+ build_route(p, req, 0);
-+ if (!p->route->lr)
-+ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
-+ else
-+ extract_uri(p, req);
- build_contact(p);
+@@ -10336,7 +10348,11 @@ static int handle_request_invite(struct
+ gotdest = get_destination(p, NULL);
- if (gotdest) {
-@@ -7366,7 +7385,6 @@
- c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
- *recount = 1;
- /* Save Record-Route for any later requests we make on this dialogue */
-- build_route(p, req, 0);
- if (c) {
- /* Pre-lock the call */
- ast_mutex_lock(&c->lock);
-@@ -7426,6 +7444,14 @@
- transmit_response(p, "180 Ringing", req);
- break;
- case AST_STATE_UP:
-+ /* Assuming this to be reinvite, process new SDP portion */
-+ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
-+ process_sdp(p, req);
-+ } else {
-+ p->jointcapability = p->capability;
-+ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
-+ }
-+
- transmit_response_with_sdp(p, "200 OK", req, 1);
- break;
- default:
+ get_rdnis(p, NULL);
+- extract_uri(p, req);
++ build_route(p, req, 0);
++ if (!p->route->lr)
++ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
++ else
++ extract_uri(p, req);
+ build_contact(p);
+
+ if (gotdest) {
+@@ -10364,7 +10380,6 @@ static int handle_request_invite(struct
+ c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
+ *recount = 1;
+ /* Save Record-Route for any later requests we make on this dialogue */
+- build_route(p, req, 0);
+ if (c) {
+ /* Pre-lock the call */
+ ast_mutex_lock(&c->lock);
+@@ -10450,6 +10465,13 @@ static int handle_request_invite(struct
+ transmit_response(p, "180 Ringing", req);
+ break;
+ case AST_STATE_UP:
++ /* Assuming this to be reinvite, process new SDP portion */
++ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
++ process_sdp(p, req);
++ } else {
++ p->jointcapability = p->capability;
++ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
++ }
+ transmit_response_with_sdp(p, "200 OK", req, 1);
+ break;
+ default:
diff --git a/net/asterisk12/files/patch-channels::chan_zap.c b/net/asterisk12/files/patch-channels::chan_zap.c
index 458a6147..ab02c02 100644
--- a/net/asterisk12/files/patch-channels::chan_zap.c
+++ b/net/asterisk12/files/patch-channels::chan_zap.c
@@ -1,85 +1,65 @@
$FreeBSD$
---- channels/chan_zap.c.orig Sun Feb 17 18:01:44 2002
-+++ channels/chan_zap.c Sun Feb 17 18:03:26 2002
-@@ -46,7 +46,9 @@
- #include <sys/signal.h>
- #include <errno.h>
- #include <stdlib.h>
-+#ifndef __FreeBSD__
- #include <stdint.h>
-+#endif
- #include <unistd.h>
- #include <sys/ioctl.h>
- #ifdef __linux__
-@@ -320,7 +322,7 @@
- #define CALLWAITING_REPEAT_SAMPLES ( (10000 * 8) / READ_SIZE) /* 300 ms */
- #define CIDCW_EXPIRE_SAMPLES ( (500 * 8) / READ_SIZE) /* 500 ms */
- #define MIN_MS_SINCE_FLASH ( (2000) ) /* 2000 ms */
--#define RINGT ( (8000 * 8) / READ_SIZE)
-+#define RINGT ( (8000 * 8) / READ_SIZE) /* 8000 ms */
-
- struct zt_pvt;
-
-@@ -535,6 +537,7 @@
- int cidpos;
+--- channels/chan_zap.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_zap.c Fri Jan 13 13:28:33 2006
+@@ -638,6 +638,7 @@ static struct zt_pvt {
int cidlen;
int ringt;
+ int ringt_base;
+ int waitnorings;
int stripmsd;
- int callwaiting;
int callwaitcas;
-@@ -2134,12 +2137,20 @@
-
- if (option_debug)
- ast_log(LOG_DEBUG, "zt_hangup(%s)\n", ast->name);
-+
- if (!ast->pvt->pvt) {
- ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
- return 0;
+ int callwaitrings;
+@@ -2308,6 +2309,19 @@ static int zt_hangup(struct ast_channel
}
ast_mutex_lock(&p->lock);
++ switch (p->sig) {
++ case SIG_FXSGS:
++ case SIG_FXSKS:
++ case SIG_FXSLS:
++ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
++ {
++ p->waitnorings = 1;
++ }
++ break;
++ default:
++ break;
++ };
+
-+
-+ if((p->sig == SIG_FXSGS) || (p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS))
-+ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
-+ {
-+ p->waitnorings = 1;
-+ }
index = zt_get_index(ast, p, 1);
-@@ -5717,7 +5728,37 @@
+@@ -6129,7 +6143,37 @@ static void *ss_thread(void *data)
ast_setstate(chan, AST_STATE_RING);
chan->rings = 1;
- p->ringt = RINGT;
+ p->ringt = p->ringt_base;
+ p->waitnorings = 0;
res = ast_pbx_run(chan);
+
+ if(p->waitnorings)
+ {
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+ for(;;)
+ {
+ int i,j=0;
+ i = ZT_IOMUX_SIGEVENT | ZT_IOMUX_NOWAIT;
-+ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
++ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
+ break;
-+
-+ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
++
++ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
+ break;
-+
++
+ if(j == ZT_EVENT_RINGOFFHOOK)
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+
+ usleep(20000);
+
+ if (p->ringt <= 0)
+ break;
+
-+ else if (p->ringt > 0)
++ else if (p->ringt > 0)
+ p->ringt--;
+ }
+ p->ringt = 0;
@@ -89,7 +69,7 @@ $FreeBSD$
if (res) {
ast_hangup(chan);
ast_log(LOG_WARNING, "PBX exited non-zero\n");
-@@ -6018,7 +6059,7 @@
+@@ -6431,7 +6475,7 @@ static void *do_monitor(void *data)
i = iflist;
while(i) {
if ((i->subs[SUB_REAL].zfd > -1) && i->sig && (!i->radio)) {
diff --git a/net/asterisk12/files/patch-channels::h323::Makefile b/net/asterisk12/files/patch-channels::h323::Makefile
deleted file mode 100644
index 779096b..0000000
--- a/net/asterisk12/files/patch-channels::h323::Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-
-$FreeBSD$
-
---- channels/h323/Makefile.orig
-+++ channels/h323/Makefile
-@@ -53,7 +53,7 @@
- LIBS+=-lpthread
- endif
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS += -pthread
-+CFLAGS += $(PTHREAD_LIBS)
- endif
- CFLAGS += -D_REENTRANT -D_GNU_SOURCE
- CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
-@@ -77,20 +77,20 @@
- ar cr libchanh323.a ast_h323.o
-
- ast_h323.o: ast_h323.cpp
-- $(CXX) -g -c -fno-rtti -o $@ $(CFLAGS) $<
-+ $(CXX) $(CXXFLAGS) -c -fno-rtti -o $@ $(CFLAGS) $<
-
- ifneq ($(wildcard .depend),)
- include .depend
- endif
-
- chan_h323.so:
-- $(CXX) -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_d.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_s.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
- clean:
- rm -f *.o *.so core.* libchanh323.a .depend
-
diff --git a/net/asterisk12/files/patch-channels::h323::ast_h323.cpp b/net/asterisk12/files/patch-channels::h323::ast_h323.cpp
new file mode 100644
index 0000000..feb79e5
--- /dev/null
+++ b/net/asterisk12/files/patch-channels::h323::ast_h323.cpp
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.cpp.orig Thu Jan 12 18:16:08 2006
++++ channels/h323/ast_h323.cpp Thu Jan 12 18:16:35 2006
+@@ -953,8 +953,8 @@ BOOL MyH323Connection::OnReceivedCapabil
+ H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capability & capability,
+ H323Channel::Directions dir,
+ unsigned sessionID,
+- const H245_H2250LogicalChannelParameters * /*param*/,
+- RTP_QOS * /*param*/ )
++ const H245_H2250LogicalChannelParameters * /*param*/ /*,
++ RTP_QOS * */ /*param*/ )
+ {
+ return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID);
+ }
diff --git a/net/asterisk12/files/patch-channels::h323::ast_h323.h b/net/asterisk12/files/patch-channels::h323::ast_h323.h
new file mode 100644
index 0000000..606bb01
--- /dev/null
+++ b/net/asterisk12/files/patch-channels::h323::ast_h323.h
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.h.orig Thu Jan 12 18:14:49 2006
++++ channels/h323/ast_h323.h Thu Jan 12 18:15:02 2006
+@@ -155,8 +155,8 @@ class MyH323Connection : public H323Conn
+ H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
+ H323Channel::Directions,
+ unsigned,
+- const H245_H2250LogicalChannelParameters *,
+- RTP_QOS *);
++ const H245_H2250LogicalChannelParameters * /* ,
++ RTP_QOS * */);
+ H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
+ const H323SignalPDU &,
+ H323SignalPDU &);
diff --git a/net/asterisk12/files/patch-codecs::Makefile b/net/asterisk12/files/patch-codecs::Makefile
index 325e590..ab5cbc4 100644
--- a/net/asterisk12/files/patch-codecs::Makefile
+++ b/net/asterisk12/files/patch-codecs::Makefile
@@ -1,39 +1,48 @@
---- codecs/Makefile.orig Thu Mar 17 20:43:51 2005
-+++ codecs/Makefile Thu Apr 14 00:09:04 2005
-@@ -17,25 +17,23 @@
- # g723.1b)
- #
- #MODG723=codec_g723_1.so codec_g723_1b.so
--MODG723=$(shell [ -f g723.1/coder.c ] && echo "codec_g723_1.so")
--MODG723+=$(shell [ -f g723.1b/coder2.c ] && echo "codec_g723_1b.so")
--MODSPEEX=$(shell [ -f /usr/include/speex.h ] || [ -f /usr/include/speex/speex.h ] || [ -f /usr/local/include/speex.h ] || [ -f /usr/local/include/speex/speex.h ] && echo "codec_speex.so")
--MODILBC=$(shell [ -f ilbc/iLBC_decode.h ] && echo "codec_ilbc.so")
-+MODG723=codec_g723_1_dummy.so
-+MODG729=codec_g729_dummy.so
-+MODSPEEX=codec_speex.so
-+MODILBC=codec_ilbc.so
- CFLAGS+=-fPIC
--CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include")
--CFLAGS+=$(shell [ -f /usr/local/include/speex/speex.h ] && echo "-I/usr/local/include/speex")
--CFLAGS+=$(shell [ -f /usr/include/speex/speex.h ] && echo "-I/usr/include/speex")
-+CFLAGS+=-I$(LOCALBASE)/include
+
+$FreeBSD$
+
+--- codecs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ codecs/Makefile Fri Jan 13 10:33:21 2006
+@@ -30,8 +30,8 @@
- LIBG723=g723.1/libg723.a
- LIBG723B=g723.1b/libg723b.a
- LIBGSM=gsm/lib/libgsm.a
- LIBGSMT=gsm/lib/libgsm.a
+ UI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex.h)
+ UIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex/speex.h)
+-ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex.h)
+-ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex/speex.h)
++ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex.h)
++ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex/speex.h)
+ ifneq (${UI_SPEEX},)
+ MODSPEEX=codec_speex.so
+ LIBSPEEX+=-lspeex -lm
+@@ -43,14 +43,14 @@
+ endif
+ ifneq (${ULI_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+ ifneq (${ULIS_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/speex
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+
+@@ -65,7 +65,7 @@
LIBLPC10=lpc10/liblpc10.a
--LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
-+LIBSPEEX=-L$(LOCALBASE)/lib
- LIBSPEEX+=-lspeex -lm
- LIBILBC=ilbc/libilbc.a
--CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
-+CODECS+=$(MODG723) $(MODG729) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
- codec_adpcm.so codec_ulaw.so codec_alaw.so codec_a_mu.so \
- codec_g726.so
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
-@@ -93,7 +91,7 @@
+ CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
+@@ -126,7 +126,7 @@
endif
install: all
diff --git a/net/asterisk12/files/patch-codecs::codec_g723_1_dummy.c b/net/asterisk12/files/patch-codecs::codec_g723_1_dummy.c
deleted file mode 100644
index 3ce9571..0000000
--- a/net/asterisk12/files/patch-codecs::codec_g723_1_dummy.c
+++ /dev/null
@@ -1,314 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g723_1_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g723_1_dummy.c Sun Oct 10 16:07:05 2004
-@@ -0,0 +1,308 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.723.1 (dummy!)
-+ *
-+ * The G.723.1 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#define TYPE_HIGH 0x0
-+#define TYPE_LOW 0x1
-+#define TYPE_SILENCE 0x2
-+#define TYPE_DONTSEND 0x3
-+#define TYPE_MASK 0x3
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g723_ex.h"
-+#include "g723_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.723.1/PCM16 Codec Translator";
-+
-+struct g723_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g723_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g723tolin_new()
-+{
-+ struct g723_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog723_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g723_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g723_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g723_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g723tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G723_1;
-+ f.datalen = sizeof(g723_slin_ex);
-+ /* All frames are 30 ms long */
-+ f.samples = 30;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g723_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog723_new()
-+{
-+ struct g723_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g723tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g723_len(unsigned char buf)
-+{
-+ switch(buf & TYPE_MASK) {
-+ case TYPE_DONTSEND:
-+ return 2;
-+ break;
-+ case TYPE_SILENCE:
-+ return 4;
-+ break;
-+ case TYPE_HIGH:
-+ return 24;
-+ break;
-+ case TYPE_LOW:
-+ return 20;
-+ break;
-+ default:
-+ ast_log(LOG_WARNING, "Badly encoded frame (%d)\n", buf & TYPE_MASK);
-+ }
-+ return -1;
-+}
-+
-+static int g723tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ int len = 0;
-+ int res;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ res = g723_len(((unsigned char *)f->data + len)[0]);
-+ if (res < 0) {
-+ ast_log(LOG_WARNING, "Invalid data\n");
-+ return -1;
-+ }
-+ if (res + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 480 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 480);
-+ tmp->tail+=480;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += res;
-+ }
-+ return 0;
-+}
-+
-+static int lintog723_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog723_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 480)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G723_1;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 480) {
-+ /* Encode a frame of data */
-+ if (cnt + 24 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 24);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 30;
-+ cnt += 24;
-+ tmp->tail -= 480;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 480, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g723_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g723tolin =
-+ { "g723tolin_dummy",
-+ AST_FORMAT_G723_1, AST_FORMAT_SLINEAR,
-+ g723tolin_new,
-+ g723tolin_framein,
-+ g723tolin_frameout,
-+ g723_destroy,
-+ g723tolin_sample
-+ };
-+
-+static struct ast_translator lintog723 =
-+ { "lintog723_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G723_1,
-+ lintog723_new,
-+ lintog723_framein,
-+ lintog723_frameout,
-+ g723_destroy,
-+ lintog723_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog723);
-+ if (!res)
-+ res = ast_unregister_translator(&g723tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g723tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog723);
-+ else
-+ ast_unregister_translator(&g723tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk12/files/patch-codecs::codec_g729_dummy.c b/net/asterisk12/files/patch-codecs::codec_g729_dummy.c
deleted file mode 100644
index 9fcc7b1..0000000
--- a/net/asterisk12/files/patch-codecs::codec_g729_dummy.c
+++ /dev/null
@@ -1,281 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g729_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g729_dummy.c Sun Oct 10 16:07:12 2004
-@@ -0,0 +1,275 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.729 (dummy!)
-+ *
-+ * The G.729 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g729_ex.h"
-+#include "g729_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.729/PCM16 Codec Translator";
-+
-+struct g729_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g729_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g729tolin_new()
-+{
-+ struct g729_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog729_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g729_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g729_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g729_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g729tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G729A;
-+ f.datalen = sizeof(g729_slin_ex);
-+ /* All frames are 10 ms long */
-+ f.samples = 10;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g729_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog729_new()
-+{
-+ struct g729_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g729tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g729tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ int len = 0;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ if (10 + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 160 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 160);
-+ tmp->tail+=160;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += 10;
-+ }
-+ return 0;
-+}
-+
-+static int lintog729_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog729_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 160)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G729A;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 160) {
-+ /* Encode a frame of data */
-+ if (cnt + 10 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 10);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 10;
-+ cnt += 10;
-+ tmp->tail -= 160;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 160, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g729_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g729tolin =
-+ { "g729tolin_dummy",
-+ AST_FORMAT_G729A, AST_FORMAT_SLINEAR,
-+ g729tolin_new,
-+ g729tolin_framein,
-+ g729tolin_frameout,
-+ g729_destroy,
-+ g729tolin_sample
-+ };
-+
-+static struct ast_translator lintog729 =
-+ { "lintog729_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G729A,
-+ lintog729_new,
-+ lintog729_framein,
-+ lintog729_frameout,
-+ g729_destroy,
-+ lintog729_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog729);
-+ if (!res)
-+ res = ast_unregister_translator(&g729tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g729tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog729);
-+ else
-+ ast_unregister_translator(&g729tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk12/files/patch-codecs::g729_slin_ex.h b/net/asterisk12/files/patch-codecs::g729_slin_ex.h
deleted file mode 100644
index 44e60f2..0000000
--- a/net/asterisk12/files/patch-codecs::g729_slin_ex.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/g729_slin_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,14 @@
-+/*
-+ * g729_slin_ex.h --
-+ *
-+ * 8-bit G.729 data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Copyright (C) 2004, Maxim Sobolev <sobomax@FreeBSD.org>
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static unsigned char g729_slin_ex[] = {
-+120,82,175,64,0,250,219,0,7,214
-+};
diff --git a/net/asterisk12/files/patch-codecs::ilbc::Makefile b/net/asterisk12/files/patch-codecs::ilbc::Makefile
index 7770e07..26a2f20 100644
--- a/net/asterisk12/files/patch-codecs::ilbc::Makefile
+++ b/net/asterisk12/files/patch-codecs::ilbc::Makefile
@@ -1,11 +1,12 @@
$FreeBSD$
---- codecs/ilbc/Makefile.orig Sun Apr 27 21:13:11 2003
-+++ codecs/ilbc/Makefile Fri Jan 30 01:47:34 2004
-@@ -1,4 +1,4 @@
--CFLAGS+= -fPIC -O3
-+CFLAGS+= -fPIC
- LIB=libilbc.a
-
- OBJS= anaFilter.o iCBSearch.o packing.o \
+--- codecs/ilbc/Makefile.orig Fri Jan 13 11:01:07 2006
++++ codecs/ilbc/Makefile Fri Jan 13 11:01:51 2006
+@@ -1,5 +1,5 @@
+ ARCH=$(PROC)
+-CFLAGS+=-Wall -O3 -funroll-loops
++CFLAGS+=-Wall -funroll-loops
+ ifneq (${OSARCH},CYGWIN)
+ CFLAGS += -fPIC
+ endif
diff --git a/net/asterisk12/files/patch-codecs::slin_g729_ex.h b/net/asterisk12/files/patch-codecs::slin_g729_ex.h
deleted file mode 100644
index e1236d2..0000000
--- a/net/asterisk12/files/patch-codecs::slin_g729_ex.h
+++ /dev/null
@@ -1,31 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/slin_g729_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,25 @@
-+/*
-+ * slin_g729_ex.h --
-+ *
-+ * Signed 16-bit audio data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Source: g723.example
-+ *
-+ * Copyright (C) 2001, Linux Support Services, Inc.
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static signed short slin_g729_ex[] = {
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-+};
diff --git a/net/asterisk12/files/patch-configs::musiconhold.conf.sample b/net/asterisk12/files/patch-configs::musiconhold.conf.sample
new file mode 100644
index 0000000..ff63cc9
--- /dev/null
+++ b/net/asterisk12/files/patch-configs::musiconhold.conf.sample
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- configs/musiconhold.conf.sample.orig Tue Nov 29 20:24:39 2005
++++ configs/musiconhold.conf.sample Fri Jan 13 11:38:39 2006
+@@ -4,7 +4,7 @@
+
+ [default]
+ mode=quietmp3
+-directory=/var/lib/asterisk/mohmp3
++directory=/usr/local/share/asterisk/mohmp3
+
+ ; valid mode options:
+ ; quietmp3 -- default
diff --git a/net/asterisk12/files/patch-db.c b/net/asterisk12/files/patch-db.c
index 6c2bdcd..ba7f3f2 100644
--- a/net/asterisk12/files/patch-db.c
+++ b/net/asterisk12/files/patch-db.c
@@ -1,14 +1,21 @@
$FreeBSD$
---- db.c.orig Fri Jul 9 13:08:09 2004
-+++ db.c Sun Oct 10 15:32:33 2004
-@@ -33,7 +33,7 @@
- #include <asterisk/cli.h>
- #include <asterisk/utils.h>
- #include <asterisk/lock.h>
--#include "db1-ast/include/db.h"
+--- db.c.orig Fri Jan 13 11:05:32 2006
++++ db.c Fri Jan 13 11:06:55 2006
+@@ -35,6 +35,7 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <dirent.h>
+#include <db.h>
+
#include "asterisk.h"
- #include "astconf.h"
+@@ -51,7 +52,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
+ #include "asterisk/utils.h"
+ #include "asterisk/lock.h"
+ #include "asterisk/manager.h"
+-#include "db1-ast/include/db.h"
+
+ #ifdef __CYGWIN__
+ #define dbopen __dbopen
diff --git a/net/asterisk12/files/patch-formats::Makefile b/net/asterisk12/files/patch-formats::Makefile
index dacfd7b..b2b1db5 100644
--- a/net/asterisk12/files/patch-formats::Makefile
+++ b/net/asterisk12/files/patch-formats::Makefile
@@ -1,19 +1,19 @@
$FreeBSD$
---- formats/Makefile.orig Tue Nov 4 04:40:09 2003
-+++ formats/Makefile Fri Jan 30 01:47:34 2004
-@@ -18,7 +18,7 @@
+--- formats/Makefile.orig Fri Jan 13 11:16:07 2006
++++ formats/Makefile Fri Jan 13 11:47:25 2006
+@@ -20,7 +20,7 @@
#
- # G723 simple frame is depricated
+ # G723 simple frame is deprecated
#
--#FORMAT_LIBS+=format_g723.so
+-FORMAT_LIBS+=format_g723.so
+FORMAT_LIBS+=format_g723_1.so
- GSMLIB=../codecs/gsm/lib/libgsm.a
-
-@@ -40,7 +40,7 @@
- $(CC) $(SOLINK) -o $@ $< -lm
+ #
+ # OGG/Vorbis format
+@@ -60,7 +60,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -logg -lvorbis -lvorbisenc -lm
install: all
- for x in $(FORMAT_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
diff --git a/net/asterisk12/files/patch-formats::format_g723_1.c b/net/asterisk12/files/patch-formats::format_g723_1.c
index fb5eb12..ae814f1 100644
--- a/net/asterisk12/files/patch-formats::format_g723_1.c
+++ b/net/asterisk12/files/patch-formats::format_g723_1.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- formats/format_g723_1.c.orig Sun Oct 10 15:59:18 2004
-+++ formats/format_g723_1.c Sun Oct 10 16:05:05 2004
-@@ -0,0 +1,345 @@
+--- /dev/null Fri Jan 13 12:18:51 2006
++++ formats/format_g723_1.c Fri Jan 13 12:18:41 2006
+@@ -0,0 +1,348 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -16,6 +16,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/channel.h>
+#include <asterisk/file.h>
@@ -26,7 +27,6 @@ $FreeBSD$
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <sys/time.h>
-+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
@@ -48,7 +48,7 @@ $FreeBSD$
+struct ast_filestream {
+ void *reserved[AST_RESERVED_POINTERS];
+ /* This is what a filestream means to us */
-+ int fd; /* Descriptor */
++ FILE *f; /* Descriptor */
+ struct ast_frame fr; /* Frame information */
+ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
+ char empty; /* Empty character */
@@ -85,7 +85,7 @@ $FreeBSD$
+ return -1;
+}
+
-+static struct ast_filestream *g723_open(int fd)
++static struct ast_filestream *g723_open(FILE *f)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -98,7 +98,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ tmp->fr.data = tmp->g723;
+ tmp->fr.frametype = AST_FRAME_VOICE;
+ tmp->fr.subclass = AST_FORMAT_G723_1;
@@ -112,7 +112,7 @@ $FreeBSD$
+ return tmp;
+}
+
-+static struct ast_filestream *g723_rewrite(int fd, char *comment)
++static struct ast_filestream *g723_rewrite(FILE *f, const char *comment)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -125,7 +125,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ glistcnt++;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
@@ -143,7 +143,7 @@ $FreeBSD$
+ glistcnt--;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
-+ close(s->fd);
++ fclose(s->f);
+ free(s);
+ s = NULL;
+}
@@ -158,7 +158,7 @@ $FreeBSD$
+ s->fr.samples = 240;
+ s->fr.mallocd = 0;
+ s->fr.data = s->g723;
-+ if ((res = read(s->fd, s->g723, 1)) != 1) {
++ if ((res = fread(s->g723, 1, 1, s->f)) != 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -168,7 +168,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 frame!\n");
+ return NULL;
+ }
-+ if (s->fr.datalen > 1 && (res = read(s->fd, s->g723 + 1, s->fr.datalen - 1)) != s->fr.datalen - 1) {
++ if (s->fr.datalen > 1 && (res = fread(s->g723 + 1, 1, s->fr.datalen - 1, s->f)) != s->fr.datalen - 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -200,7 +200,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 data length, %d\n", f->datalen);
+ return -1;
+ }
-+ if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
++ if ((res = fwrite(f->data, 1, f->datalen, fs->f)) != f->datalen) {
+ ast_log(LOG_WARNING, "Bad write %d: %s\n", res, strerror(errno));
+ return -1;
+ }
@@ -229,10 +229,13 @@ $FreeBSD$
+ }
+ offset = cur + sample_offset;
+ }
-+ if ((moffset = lseek(fs->fd, 0, SEEK_END)) == -1) {
++ if (fseeko(fs->f, 0, SEEK_END) == -1) {
+ ast_log(LOG_WARNING, "Can't seek stream to an end!\n");
+ return -1;
+ }
++ else {
++ moffset = ftello(fs->f);
++ }
+ if (whence == SEEK_END) {
+ if ((max = g723_tell(fs)) == -1) {
+ ast_log(LOG_WARNING, "Can't get maximum position!\n");
@@ -244,11 +247,11 @@ $FreeBSD$
+ offset = 0;
+ soffset = -1;
+ for (coffset = 0; coffset < moffset && offset > 0; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %lli!\n", coffset);
+ return -1;
+ }
@@ -260,7 +263,7 @@ $FreeBSD$
+ if (res > 1)
+ offset -= 240;
+ }
-+ if (soffset != -1 && lseek(fs->fd, soffset, SEEK_SET) != soffset) {
++ if (soffset != -1 && fseeko(fs->f, soffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", soffset);
+ return -1;
+ }
@@ -271,7 +274,7 @@ $FreeBSD$
+static int g723_trunc(struct ast_filestream *fs)
+{
+ /* Truncate file to current length */
-+ if (ftruncate(fs->fd, lseek(fs->fd, 0, SEEK_CUR)) < 0)
++ if (ftruncate(fileno(fs->f), ftello(fs->f)) < 0)
+ return -1;
+ return 0;
+}
@@ -283,14 +286,14 @@ $FreeBSD$
+ long rval;
+ unsigned char c;
+
-+ offset = lseek(fs->fd, 0, SEEK_CUR);
++ offset = ftello(fs->f);
+ rval = 0;
+ for (coffset = 0; coffset < offset; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %llu!\n", coffset);
+ return -1;
+ }
@@ -301,7 +304,7 @@ $FreeBSD$
+ if (res > 1)
+ rval += 240;
+ }
-+ if (lseek(fs->fd, offset, SEEK_SET) != offset) {
++ if (fseeko(fs->f, offset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", offset);
+ return -1;
+ }
diff --git a/net/asterisk12/files/patch-formats::format_g729.c b/net/asterisk12/files/patch-formats::format_g729.c
index 78899a3..11be528 100644
--- a/net/asterisk12/files/patch-formats::format_g729.c
+++ b/net/asterisk12/files/patch-formats::format_g729.c
@@ -1,6 +1,9 @@
---- formats/format_g729.c.orig Mon Feb 7 10:29:19 2005
-+++ formats/format_g729.c Wed Mar 9 06:26:36 2005
-@@ -44,7 +44,7 @@
+
+$FreeBSD$
+
+--- formats/format_g729.c.orig Fri Jan 13 12:20:53 2006
++++ formats/format_g729.c Fri Jan 13 12:23:33 2006
+@@ -60,7 +60,7 @@ struct ast_filestream {
struct ast_frame fr; /* Frame information */
char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
char empty; /* Empty character */
@@ -9,7 +12,7 @@
};
-@@ -125,11 +125,11 @@
+@@ -141,11 +141,11 @@ static struct ast_frame *g729_read(struc
s->fr.frametype = AST_FRAME_VOICE;
s->fr.subclass = AST_FORMAT_G729A;
s->fr.offset = AST_FRIENDLY_OFFSET;
@@ -19,24 +22,24 @@
+ s->fr.datalen = 10;
s->fr.mallocd = 0;
s->fr.data = s->g729;
-- if ((res = read(s->fd, s->g729, 20)) != 20) {
-+ if ((res = read(s->fd, s->g729, 10)) != 10) {
+- if ((res = fread(s->g729, 1, 20, s->f)) != 20) {
++ if ((res = fread(s->g729, 1, 10, s->f)) != 10) {
if (res && (res != 10))
ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
return NULL;
-@@ -173,7 +173,7 @@
- cur = lseek(fs->fd, 0, SEEK_CUR);
- max = lseek(fs->fd, 0, SEEK_END);
+@@ -190,7 +190,7 @@ static int g729_seek(struct ast_filestre
+ fseek(fs->f, 0, SEEK_END);
+ max = ftell(fs->f);
- bytes = 20 * (sample_offset / 160);
+ bytes = 10 * (sample_offset / 80);
if (whence == SEEK_SET)
offset = bytes;
else if (whence == SEEK_CUR || whence == SEEK_FORCECUR)
-@@ -202,7 +202,7 @@
+@@ -219,7 +219,7 @@ static long g729_tell(struct ast_filestr
{
off_t offset;
- offset = lseek(fs->fd, 0, SEEK_CUR);
+ offset = ftell(fs->f);
- return (offset/20)*160;
+ return (offset/10)*80;
}
diff --git a/net/asterisk12/files/patch-funcs::Makefile b/net/asterisk12/files/patch-funcs::Makefile
new file mode 100644
index 0000000..a14daee
--- /dev/null
+++ b/net/asterisk12/files/patch-funcs::Makefile
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- funcs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ funcs/Makefile Fri Jan 13 12:36:57 2006
+@@ -67,7 +67,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
+
+ install: all
+- for x in $(FUNCS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
++ for x in $(FUNCS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
+
+ ifneq ($(wildcard .depend),)
+ include .depend
diff --git a/net/asterisk12/files/patch-pbx::Makefile b/net/asterisk12/files/patch-pbx::Makefile
index dca6672..97d03e1 100644
--- a/net/asterisk12/files/patch-pbx::Makefile
+++ b/net/asterisk12/files/patch-pbx::Makefile
@@ -1,18 +1,20 @@
$FreeBSD$
---- pbx/Makefile.orig Sun Oct 26 20:50:49 2003
-+++ pbx/Makefile Fri Jan 30 01:47:34 2004
-@@ -16,7 +16,7 @@
- PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so # pbx_gtkconsole.so pbx_kdeconsole.so
-
- # Add GTK console if appropriate
--PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
-+#PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
+--- pbx/Makefile.orig
++++ pbx/Makefile
+@@ -23,8 +23,8 @@
# Add KDE Console if appropriate
#PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so")
-@@ -62,7 +62,7 @@
+-GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
+-GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
++#GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
++#GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
+ MOC=$(QTDIR)/bin/moc
+ KDE_FLAGS=-I$(KDEDIR)/include -I$(KDEDIR)/include/kde -I$(QTDIR)/include
+ KDE_LIBS=-L$(KDEDIR)/lib -L$(QTDIR)/lib -lqt -lkdecore -lkdeui
+@@ -72,7 +72,7 @@
endif
install: all
diff --git a/net/asterisk12/files/patch-pbx::pbx_wilcalu.c b/net/asterisk12/files/patch-pbx::pbx_wilcalu.c
deleted file mode 100644
index 41722c6..0000000
--- a/net/asterisk12/files/patch-pbx::pbx_wilcalu.c
+++ /dev/null
@@ -1,14 +0,0 @@
---- pbx/pbx_wilcalu.c.orig Tue Apr 26 10:00:28 2005
-+++ pbx/pbx_wilcalu.c Tue Apr 26 10:03:42 2005
-@@ -82,6 +82,11 @@
- fds[0].events = POLLIN;
- poll(fds, 1, -1);
- bytes=read(fd,buf,256);
-+ if (bytes <= 0) {
-+ /* XXX error on device, sleep a bit before retrying */
-+ sleep(1);
-+ continue;
-+ }
- buf[(int)bytes]=0;
-
- if(bytes>0){
diff --git a/net/asterisk12/files/patch-res-res_watchdog.c b/net/asterisk12/files/patch-res-res_watchdog.c
deleted file mode 100644
index 51e4b0a..0000000
--- a/net/asterisk12/files/patch-res-res_watchdog.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- res/res_watchdog.c.orig Fri Jul 15 13:24:24 2005
-+++ res/res_watchdog.c Fri Jul 15 13:24:42 2005
-@@ -40,6 +40,10 @@
-
- /* Registrar for operations */
-
-+#ifndef O_SYNC
-+#define O_SYNC O_FSYNC
-+#endif
-+
- static struct watchdog_pvt *watchdogs = NULL;
-
- STANDARD_LOCAL_USER;
diff --git a/net/asterisk12/files/patch-res::Makefile b/net/asterisk12/files/patch-res::Makefile
index 3e48e84..de5c365 100644
--- a/net/asterisk12/files/patch-res::Makefile
+++ b/net/asterisk12/files/patch-res::Makefile
@@ -1,33 +1,35 @@
---- res/Makefile.orig Tue Aug 9 17:18:55 2005
-+++ res/Makefile Tue Aug 9 17:33:36 2005
-@@ -13,15 +13,18 @@
+
+$FreeBSD$
+
+--- res/Makefile
++++ res/Makefile
+@@ -37,8 +37,8 @@
+ endif
- MODS=res_adsi.so res_features.so res_crypto.so res_musiconhold.so res_indications.so res_monitor.so \
- res_agi.so res_watchdog.so
--MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
--MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/include/osp/osp.h" ]; then echo "res_osp.so"; fi)
-
- CRYPTO_LIBS=-lssl -lcrypto
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ ifeq (${OSARCH},CYGWIN)
+@@ -55,9 +55,7 @@
CFLAGS+=
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH")
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPATA_MOH
-+endif
- #
- # Work around buggy RedHat 9.0
+
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
+ CFLAGS+=-DZAPATA_MOH
+-endif
+ endif # WITHOUT_ZAPTEL
+
#
-@@ -34,7 +37,7 @@
+@@ -75,7 +73,7 @@
rm -f $(DESTDIR)$(ASTHEADERDIR)/parking.h
rm -f $(DESTDIR)$(MODULES_DIR)/app_agi.so
rm -f $(DESTDIR)$(MODULES_DIR)/res_parking.so
- for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(MODS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- res_crypto.so: res_crypto.o
- $(CC) $(SOLINK) -o $@ $< $(CRYPTO_LIBS)
+ @if [ x`which mpg123 2>/dev/null | grep -v '^no'` != x ] ; then \
+ if mpg123 --longhelp 2>&1 | grep -q .59r 2>&1 >/dev/null ; then echo ; else \
+ echo "*************************************************************";\
diff --git a/net/asterisk12/files/patch-rtp.c b/net/asterisk12/files/patch-rtp.c
index c652add..bbc2649 100644
--- a/net/asterisk12/files/patch-rtp.c
+++ b/net/asterisk12/files/patch-rtp.c
@@ -1,23 +1,17 @@
---- rtp.c.orig Tue Apr 26 10:00:28 2005
-+++ rtp.c Tue Apr 26 10:06:35 2005
-@@ -127,7 +127,7 @@
- {
- switch(buf & TYPE_MASK) {
- case TYPE_DONTSEND:
-- return 0;
-+ return 2;
- break;
- case TYPE_SILENCE:
- return 4;
-@@ -862,8 +858,10 @@
- /* Must be an even port number by RTP spec */
+
+$FreeBSD$
+
+--- rtp.c.orig Fri Jan 13 13:38:01 2006
++++ rtp.c Fri Jan 13 13:40:50 2006
+@@ -950,8 +950,10 @@ struct ast_rtp *ast_rtp_new_with_bindadd
rtp->us.sin_port = htons(x);
rtp->us.sin_addr = addr;
+ /* If there's rtcp, initialize it as well. */
- if (rtp->rtcp)
+ if (rtp->rtcp) {
rtp->rtcp->us.sin_port = htons(x + 1);
+ rtp->rtcp->us.sin_addr = addr;
+ }
+ /* Try to bind it/them. */
if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) &&
(!rtp->rtcp || !bind(rtp->rtcp->s, (struct sockaddr *)&rtp->rtcp->us, sizeof(rtp->rtcp->us))))
- break;
diff --git a/net/asterisk12/files/patch-utils::Makefile b/net/asterisk12/files/patch-utils::Makefile
new file mode 100644
index 0000000..f3164c0
--- /dev/null
+++ b/net/asterisk12/files/patch-utils::Makefile
@@ -0,0 +1,34 @@
+
+$FreeBSD$
+
+--- utils/Makefile
++++ utils/Makefile
+@@ -17,16 +17,16 @@
+ CFLAGS+=-DNO_AST_MM
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+ TARGET=stereorize streamplayer
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/popt.h),)
+ TARGET+=smsq
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/newt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/newt.h),)
+ TARGET+=astman
+ endif
+
+@@ -40,7 +40,7 @@
+ install:
+ for x in $(TARGET); do \
+ if [ "$$x" != "none" ]; then \
+- $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
++ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
+ fi; \
+ done
+
diff --git a/net/asterisk12/pkg-plist b/net/asterisk12/pkg-plist
index 019b270..702370a 100644
--- a/net/asterisk12/pkg-plist
+++ b/net/asterisk12/pkg-plist
@@ -19,6 +19,12 @@ etc/asterisk/asterisk.adsi-dist
@unexec if cmp -s %D/etc/asterisk/asterisk.conf %D/etc/asterisk/asterisk.conf-dist; then rm -f %D/etc/asterisk/asterisk.conf; fi
etc/asterisk/asterisk.conf-dist
@exec [ -f %B/asterisk.conf ] || cp %B/%f %B/asterisk.conf
+@unexec if cmp -s %D/etc/asterisk/cdr.conf %D/etc/asterisk/cdr.conf-dist; then rm -f %D/etc/asterisk/cdr.conf; fi
+etc/asterisk/cdr.conf-dist
+@exec [ -f %B/cdr.conf ] || cp %B/%f %B/cdr.conf
+@unexec if cmp -s %D/etc/asterisk/cdr_custom.conf %D/etc/asterisk/cdr_custom.conf-dist; then rm -f %D/etc/asterisk/cdr_custom.conf; fi
+etc/asterisk/cdr_custom.conf-dist
+@exec [ -f %B/cdr_custom.conf ] || cp %B/%f %B/cdr_custom.conf
@unexec if cmp -s %D/etc/asterisk/cdr_manager.conf %D/etc/asterisk/cdr_manager.conf-dist; then rm -f %D/etc/asterisk/cdr_manager.conf; fi
etc/asterisk/cdr_manager.conf-dist
@exec [ -f %B/cdr_manager.conf ] || cp %B/%f %B/cdr_manager.conf
@@ -31,9 +37,21 @@ etc/asterisk/cdr_pgsql.conf-dist
@unexec if cmp -s %D/etc/asterisk/cdr_tds.conf %D/etc/asterisk/cdr_tds.conf-dist; then rm -f %D/etc/asterisk/cdr_tds.conf; fi
etc/asterisk/cdr_tds.conf-dist
@exec [ -f %B/cdr_tds.conf ] || cp %B/%f %B/cdr_tds.conf
+@unexec if cmp -s %D/etc/asterisk/codecs.conf %D/etc/asterisk/codecs.conf-dist; then rm -f %D/etc/asterisk/codecs.conf; fi
+etc/asterisk/codecs.conf-dist
+@exec [ -f %B/codecs.conf ] || cp %B/%f %B/codecs.conf
+@unexec if cmp -s %D/etc/asterisk/dnsmgr.conf %D/etc/asterisk/dnsmgr.conf-dist; then rm -f %D/etc/asterisk/dnsmgr.conf; fi
+etc/asterisk/dnsmgr.conf-dist
+@exec [ -f %B/dnsmgr.conf ] || cp %B/%f %B/dmsmgr.conf
+@unexec if cmp -s %D/etc/asterisk/dundi.conf %D/etc/asterisk/dundi.conf-dist; then rm -f %D/etc/asterisk/dundi.conf; fi
+etc/asterisk/dundi.conf-dist
+@exec [ -f %B/dundi.conf ] || cp %B/%f %B/dundi.conf
@unexec if cmp -s %D/etc/asterisk/enum.conf %D/etc/asterisk/enum.conf-dist; then rm -f %D/etc/asterisk/enum.conf; fi
etc/asterisk/enum.conf-dist
@exec [ -f %B/enum.conf ] || cp %B/%f %B/enum.conf
+@unexec if cmp -s %D/etc/asterisk/extensions.ael %D/etc/asterisk/extensions.ael-dist; then rm -f %D/etc/asterisk/extensions.ael; fi
+etc/asterisk/extensions.ael-dist
+@exec [ -f %B/extensions.ael ] || cp %B/%f %B/extensions.ael
@unexec if cmp -s %D/etc/asterisk/extconfig.conf %D/etc/asterisk/extconfig.conf-dist; then rm -f %D/etc/asterisk/extconfig.conf; fi
etc/asterisk/extconfig.conf-dist
@exec [ -f %B/extconfig.conf ] || cp %B/%f %B/extconfig.conf
@@ -46,9 +64,6 @@ etc/asterisk/features.conf-dist
@unexec if cmp -s %D/etc/asterisk/festival.conf %D/etc/asterisk/festival.conf-dist; then rm -f %D/etc/asterisk/festival.conf; fi
etc/asterisk/festival.conf-dist
@exec [ -f %B/festival.conf ] || cp %B/%f %B/festival.conf
-@unexec if cmp -s %D/etc/asterisk/h323.conf %D/etc/asterisk/h323.conf-dist; then rm -f %D/etc/asterisk/h323.conf; fi
-etc/asterisk/h323.conf-dist
-@exec [ -f %B/h323.conf ] || cp %B/%f %B/h323.conf
@unexec if cmp -s %D/etc/asterisk/iax.conf %D/etc/asterisk/iax.conf-dist; then rm -f %D/etc/asterisk/iax.conf; fi
etc/asterisk/iax.conf-dist
@exec [ -f %B/iax.conf ] || cp %B/%f %B/iax.conf
@@ -70,6 +85,9 @@ etc/asterisk/meetme.conf-dist
@unexec if cmp -s %D/etc/asterisk/mgcp.conf %D/etc/asterisk/mgcp.conf-dist; then rm -f %D/etc/asterisk/mgcp.conf; fi
etc/asterisk/mgcp.conf-dist
@exec [ -f %B/mgcp.conf ] || cp %B/%f %B/mgcp.conf
+@unexec if cmp -s %D/etc/asterisk/misdn.conf %D/etc/asterisk/misdn.conf-dist; then rm -f %D/etc/asterisk/misdn.conf; fi
+etc/asterisk/misdn.conf-dist
+@exec [ -f %B/misdn.conf ] || cp %B/%f %B/misdn.conf
@unexec if cmp -s %D/etc/asterisk/modem.conf %D/etc/asterisk/modem.conf-dist; then rm -f %D/etc/asterisk/modem.conf; fi
etc/asterisk/modem.conf-dist
@exec [ -f %B/modem.conf ] || cp %B/%f %B/modem.conf
@@ -94,9 +112,6 @@ etc/asterisk/privacy.conf-dist
@unexec if cmp -s %D/etc/asterisk/queues.conf %D/etc/asterisk/queues.conf-dist; then rm -f %D/etc/asterisk/queues.conf; fi
etc/asterisk/queues.conf-dist
@exec [ -f %B/queues.conf ] || cp %B/%f %B/queues.conf
-@unexec if cmp -s %D/etc/asterisk/res_config_odbc.conf %D/etc/asterisk/res_config_odbc.conf-dist; then rm -f %D/etc/asterisk/res_config_odbc.conf; fi
-etc/asterisk/res_config_odbc.conf-dist
-@exec [ -f %B/res_config_odbc.conf ] || cp %B/%f %B/res_config_odbc.conf
@unexec if cmp -s %D/etc/asterisk/res_odbc.conf %D/etc/asterisk/res_odbc.conf-dist; then rm -f %D/etc/asterisk/res_odbc.conf; fi
etc/asterisk/res_odbc.conf-dist
@exec [ -f %B/res_odbc.conf ] || cp %B/%f %B/res_odbc.conf
@@ -109,6 +124,9 @@ etc/asterisk/rtp.conf-dist
@unexec if cmp -s %D/etc/asterisk/sip.conf %D/etc/asterisk/sip.conf-dist; then rm -f %D/etc/asterisk/sip.conf; fi
etc/asterisk/sip.conf-dist
@exec [ -f %B/sip.conf ] || cp %B/%f %B/sip.conf
+@unexec if cmp -s %D/etc/asterisk/sip_notify.conf %D/etc/asterisk/sip_notify.conf-dist; then rm -f %D/etc/asterisk/sip_notify.conf; fi
+etc/asterisk/sip_notify.conf-dist
+@exec [ -f %B/sip_notify.conf ] || cp %B/%f %B/sip_notify.conf
@unexec if cmp -s %D/etc/asterisk/skinny.conf %D/etc/asterisk/skinny.conf-dist; then rm -f %D/etc/asterisk/skinny.conf; fi
etc/asterisk/skinny.conf-dist
@exec [ -f %B/skinny.conf ] || cp %B/%f %B/skinny.conf
@@ -121,9 +139,6 @@ etc/asterisk/voicemail.conf-dist
@unexec if cmp -s %D/etc/asterisk/vpb.conf %D/etc/asterisk/vpb.conf-dist; then rm -f %D/etc/asterisk/vpb.conf; fi
etc/asterisk/vpb.conf-dist
@exec [ -f %B/vpb.conf ] || cp %B/%f %B/vpb.conf
-@unexec if cmp -s %D/etc/asterisk/watchdog.conf %D/etc/asterisk/watchdog.conf-dist; then rm -f %D/etc/asterisk/watchdog.conf; fi
-etc/asterisk/watchdog.conf-dist
-@exec [ -f %B/watchdog.conf ] || cp %B/%f %B/watchdog.conf
@unexec if cmp -s %D/etc/asterisk/zapata.conf %D/etc/asterisk/zapata.conf-dist; then rm -f %D/etc/asterisk/zapata.conf; fi
etc/asterisk/zapata.conf-dist
@exec [ -f %B/zapata.conf ] || cp %B/%f %B/zapata.conf
@@ -136,28 +151,36 @@ include/asterisk/app.h
include/asterisk/ast_expr.h
include/asterisk/astdb.h
include/asterisk/astmm.h
+include/asterisk/astobj.h
include/asterisk/astosp.h
+include/asterisk/build.h
include/asterisk/callerid.h
include/asterisk/causes.h
include/asterisk/cdr.h
include/asterisk/channel.h
-include/asterisk/channel_pvt.h
+include/asterisk/chanspy.h
include/asterisk/chanvars.h
include/asterisk/cli.h
+include/asterisk/compat.h
include/asterisk/config.h
-include/asterisk/config_pvt.h
+include/asterisk/compiler.h
include/asterisk/crypto.h
-include/asterisk/cvsid.h
+include/asterisk/devicestate.h
include/asterisk/dlfcn-compat.h
include/asterisk/dns.h
+include/asterisk/dnsmgr.h
+include/asterisk/doxyref.h
include/asterisk/dsp.h
+include/asterisk/dundi.h
include/asterisk/enum.h
+include/asterisk/endian.h
include/asterisk/features.h
include/asterisk/file.h
include/asterisk/frame.h
include/asterisk/fskmodem.h
include/asterisk/image.h
include/asterisk/indications.h
+include/asterisk/inline_api.h
include/asterisk/io.h
include/asterisk/linkedlists.h
include/asterisk/localtime.h
@@ -168,38 +191,50 @@ include/asterisk/md5.h
include/asterisk/module.h
include/asterisk/monitor.h
include/asterisk/musiconhold.h
+include/asterisk/netsock.h
include/asterisk/options.h
include/asterisk/pbx.h
+include/asterisk/plc.h
include/asterisk/poll-compat.h
include/asterisk/privacy.h
include/asterisk/res_odbc.h
include/asterisk/rtp.h
include/asterisk/say.h
include/asterisk/sched.h
+include/asterisk/slinfactory.h
include/asterisk/srv.h
+include/asterisk/strings.h
include/asterisk/tdd.h
include/asterisk/term.h
+include/asterisk/time.h
include/asterisk/transcap.h
include/asterisk/translate.h
include/asterisk/ulaw.h
+include/asterisk/unaligned.h
include/asterisk/utils.h
+include/asterisk/version.h
include/asterisk/vmodem.h
lib/asterisk/modules/app_adsiprog.so
lib/asterisk/modules/app_alarmreceiver.so
lib/asterisk/modules/app_authenticate.so
lib/asterisk/modules/app_cdr.so
lib/asterisk/modules/app_chanisavail.so
+lib/asterisk/modules/app_chanspy.so
lib/asterisk/modules/app_controlplayback.so
+lib/asterisk/modules/app_curl.so
lib/asterisk/modules/app_cut.so
lib/asterisk/modules/app_db.so
-lib/asterisk/modules/app_devstate.so
lib/asterisk/modules/app_dial.so
+lib/asterisk/modules/app_dictate.so
+lib/asterisk/modules/app_directed_pickup.so
lib/asterisk/modules/app_directory.so
lib/asterisk/modules/app_disa.so
+lib/asterisk/modules/app_dumpchan.so
lib/asterisk/modules/app_echo.so
lib/asterisk/modules/app_enumlookup.so
lib/asterisk/modules/app_eval.so
lib/asterisk/modules/app_exec.so
+lib/asterisk/modules/app_externalivr.so
lib/asterisk/modules/app_festival.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_flash.so
lib/asterisk/modules/app_forkcdr.so
@@ -208,64 +243,66 @@ lib/asterisk/modules/app_groupcount.so
lib/asterisk/modules/app_hasnewvoicemail.so
lib/asterisk/modules/app_ices.so
lib/asterisk/modules/app_image.so
-lib/asterisk/modules/app_intercom.so
lib/asterisk/modules/app_lookupblacklist.so
lib/asterisk/modules/app_lookupcidname.so
lib/asterisk/modules/app_macro.so
+lib/asterisk/modules/app_math.so
+lib/asterisk/modules/app_md5.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_meetme.so
lib/asterisk/modules/app_milliwatt.so
+lib/asterisk/modules/app_mixmonitor.so
lib/asterisk/modules/app_mp3.so
lib/asterisk/modules/app_nbscat.so
+%%WITH_ZAPTEL%%lib/asterisk/modules/app_page.so
lib/asterisk/modules/app_parkandannounce.so
-lib/asterisk/modules/app_pickup.so
lib/asterisk/modules/app_playback.so
lib/asterisk/modules/app_privacy.so
-lib/asterisk/modules/app_qcall.so
lib/asterisk/modules/app_queue.so
lib/asterisk/modules/app_random.so
lib/asterisk/modules/app_read.so
+lib/asterisk/modules/app_readfile.so
+lib/asterisk/modules/app_realtime.so
lib/asterisk/modules/app_record.so
%%WITH_FAX%%lib/asterisk/modules/app_rxfax.so
lib/asterisk/modules/app_sayunixtime.so
-lib/asterisk/modules/app_segfault.so
lib/asterisk/modules/app_senddtmf.so
lib/asterisk/modules/app_sendtext.so
lib/asterisk/modules/app_setcallerid.so
lib/asterisk/modules/app_setcdruserfield.so
lib/asterisk/modules/app_setcidname.so
lib/asterisk/modules/app_setcidnum.so
+lib/asterisk/modules/app_setrdnis.so
lib/asterisk/modules/app_settransfercapability.so
lib/asterisk/modules/app_sms.so
lib/asterisk/modules/app_softhangup.so
-lib/asterisk/modules/app_striplsd.so
-lib/asterisk/modules/app_substring.so
+lib/asterisk/modules/app_stack.so
lib/asterisk/modules/app_system.so
lib/asterisk/modules/app_talkdetect.so
lib/asterisk/modules/app_test.so
lib/asterisk/modules/app_transfer.so
-lib/asterisk/modules/app_txtcidname.so
%%WITH_FAX%%lib/asterisk/modules/app_txfax.so
+lib/asterisk/modules/app_txtcidname.so
lib/asterisk/modules/app_url.so
lib/asterisk/modules/app_userevent.so
lib/asterisk/modules/app_verbose.so
lib/asterisk/modules/app_voicemail.so
lib/asterisk/modules/app_waitforring.so
+lib/asterisk/modules/app_waitforsilence.so
+lib/asterisk/modules/app_while.so
lib/asterisk/modules/app_zapateller.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapbarge.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapras.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapscan.so
lib/asterisk/modules/cdr_csv.so
+lib/asterisk/modules/cdr_custom.so
lib/asterisk/modules/cdr_manager.so
%%WITH_ODBC%%lib/asterisk/modules/cdr_odbc.so
lib/asterisk/modules/chan_agent.so
+lib/asterisk/modules/chan_features.so
%%WITH_H323%%lib/asterisk/modules/chan_h323.so
lib/asterisk/modules/chan_iax2.so
lib/asterisk/modules/chan_local.so
lib/asterisk/modules/chan_mgcp.so
-lib/asterisk/modules/chan_modem.so
-lib/asterisk/modules/chan_modem_aopen.so
-lib/asterisk/modules/chan_modem_bestdata.so
-lib/asterisk/modules/chan_modem_i4l.so
lib/asterisk/modules/chan_oss.so
lib/asterisk/modules/chan_sip.so
lib/asterisk/modules/chan_skinny.so
@@ -273,14 +310,13 @@ lib/asterisk/modules/chan_skinny.so
lib/asterisk/modules/codec_a_mu.so
lib/asterisk/modules/codec_adpcm.so
lib/asterisk/modules/codec_alaw.so
-lib/asterisk/modules/codec_g723_1_dummy.so
lib/asterisk/modules/codec_g726.so
-lib/asterisk/modules/codec_g729_dummy.so
lib/asterisk/modules/codec_gsm.so
lib/asterisk/modules/codec_ilbc.so
lib/asterisk/modules/codec_lpc10.so
lib/asterisk/modules/codec_speex.so
lib/asterisk/modules/codec_ulaw.so
+lib/asterisk/modules/format_au.so
lib/asterisk/modules/format_g723_1.so
lib/asterisk/modules/format_g726.so
lib/asterisk/modules/format_g729.so
@@ -294,22 +330,34 @@ lib/asterisk/modules/format_sln.so
lib/asterisk/modules/format_vox.so
lib/asterisk/modules/format_wav.so
lib/asterisk/modules/format_wav_gsm.so
+lib/asterisk/modules/func_callerid.so
+lib/asterisk/modules/func_enum.so
+lib/asterisk/modules/func_uri.so
+lib/asterisk/modules/pbx_ael.so
lib/asterisk/modules/pbx_config.so
+lib/asterisk/modules/pbx_dundi.so
+lib/asterisk/modules/pbx_functions.so
+lib/asterisk/modules/pbx_loopback.so
+lib/asterisk/modules/pbx_realtime.so
lib/asterisk/modules/pbx_spool.so
-lib/asterisk/modules/pbx_wilcalu.so
lib/asterisk/modules/res_adsi.so
lib/asterisk/modules/res_agi.so
+lib/asterisk/modules/res_config_odbc.so
lib/asterisk/modules/res_crypto.so
lib/asterisk/modules/res_features.so
lib/asterisk/modules/res_indications.so
lib/asterisk/modules/res_monitor.so
+lib/asterisk/modules/res_odbc.so
lib/asterisk/modules/res_musiconhold.so
-lib/asterisk/modules/res_watchdog.so
sbin/asterisk
sbin/astgenkey
sbin/astman
sbin/autosupport
+sbin/rasterisk
sbin/safe_asterisk
+sbin/smsq
+sbin/stereorize
+sbin/streamplayer
%%DATADIR%%/agi-bin/agi-test.agi
%%DATADIR%%/agi-bin/eagi-sphinx-test
%%DATADIR%%/agi-bin/eagi-test
@@ -330,23 +378,34 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/auth-incorrect.gsm
%%DATADIR%%/sounds/auth-thankyou.gsm
%%DATADIR%%/sounds/beep.gsm
+%%DATADIR%%/sounds/beeperr.gsm
%%DATADIR%%/sounds/conf-adminmenu.gsm
%%DATADIR%%/sounds/conf-enteringno.gsm
%%DATADIR%%/sounds/conf-errormenu.gsm
%%DATADIR%%/sounds/conf-getchannel.gsm
%%DATADIR%%/sounds/conf-getconfno.gsm
%%DATADIR%%/sounds/conf-getpin.gsm
+%%DATADIR%%/sounds/conf-hasjoin.gsm
+%%DATADIR%%/sounds/conf-hasleft.gsm
%%DATADIR%%/sounds/conf-invalid.gsm
%%DATADIR%%/sounds/conf-invalidpin.gsm
%%DATADIR%%/sounds/conf-kicked.gsm
+%%DATADIR%%/sounds/conf-leaderhasleft.gsm
%%DATADIR%%/sounds/conf-locked.gsm
%%DATADIR%%/sounds/conf-lockednow.gsm
%%DATADIR%%/sounds/conf-muted.gsm
%%DATADIR%%/sounds/conf-noempty.gsm
+%%DATADIR%%/sounds/conf-onlyone.gsm
%%DATADIR%%/sounds/conf-onlyperson.gsm
+%%DATADIR%%/sounds/conf-otherinparty.gsm
+%%DATADIR%%/sounds/conf-placeintoconf.gsm
+%%DATADIR%%/sounds/conf-thereare.gsm
%%DATADIR%%/sounds/conf-unlockednow.gsm
%%DATADIR%%/sounds/conf-unmuted.gsm
%%DATADIR%%/sounds/conf-usermenu.gsm
+%%DATADIR%%/sounds/conf-userswilljoin.gsm
+%%DATADIR%%/sounds/conf-userwilljoin.gsm
+%%DATADIR%%/sounds/conf-waitforleader.gsm
%%DATADIR%%/sounds/demo-abouttotry.gsm
%%DATADIR%%/sounds/demo-congrats.gsm
%%DATADIR%%/sounds/demo-echodone.gsm
@@ -357,6 +416,18 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/demo-nogo.gsm
%%DATADIR%%/sounds/demo-nomatch.gsm
%%DATADIR%%/sounds/demo-thanks.gsm
+%%DATADIR%%/sounds/dictate/both_help.gsm
+%%DATADIR%%/sounds/dictate/enter_filename.gsm
+%%DATADIR%%/sounds/dictate/forhelp.gsm
+%%DATADIR%%/sounds/dictate/pause.gsm
+%%DATADIR%%/sounds/dictate/paused.gsm
+%%DATADIR%%/sounds/dictate/play_help.gsm
+%%DATADIR%%/sounds/dictate/playback.gsm
+%%DATADIR%%/sounds/dictate/playback_mode.gsm
+%%DATADIR%%/sounds/dictate/record.gsm
+%%DATADIR%%/sounds/dictate/record_help.gsm
+%%DATADIR%%/sounds/dictate/record_mode.gsm
+%%DATADIR%%/sounds/dictate/truncating_audio.gsm
%%DATADIR%%/sounds/digits/0.gsm
%%DATADIR%%/sounds/digits/1.gsm
%%DATADIR%%/sounds/digits/10.gsm
@@ -445,6 +516,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/dir-intro.gsm
%%DATADIR%%/sounds/dir-nomatch.gsm
%%DATADIR%%/sounds/dir-nomore.gsm
+%%DATADIR%%/sounds/hello-world.gsm
%%DATADIR%%/sounds/invalid.gsm
%%DATADIR%%/sounds/letters/a.gsm
%%DATADIR%%/sounds/letters/at.gsm
@@ -512,6 +584,10 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/phonetic/x_p.gsm
%%DATADIR%%/sounds/phonetic/y_p.gsm
%%DATADIR%%/sounds/phonetic/z_p.gsm
+%%DATADIR%%/sounds/priv-callee-options.gsm
+%%DATADIR%%/sounds/priv-callpending.gsm
+%%DATADIR%%/sounds/priv-introsaved.gsm
+%%DATADIR%%/sounds/priv-recordintro.gsm
%%DATADIR%%/sounds/privacy-incorrect.gsm
%%DATADIR%%/sounds/privacy-prompt.gsm
%%DATADIR%%/sounds/privacy-thankyou.gsm
@@ -520,10 +596,21 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/queue-holdtime.gsm
%%DATADIR%%/sounds/queue-less-than.gsm
%%DATADIR%%/sounds/queue-minutes.gsm
+%%DATADIR%%/sounds/queue-periodic-announce.gsm
+%%DATADIR%%/sounds/queue-reporthold.gsm
%%DATADIR%%/sounds/queue-seconds.gsm
%%DATADIR%%/sounds/queue-thankyou.gsm
%%DATADIR%%/sounds/queue-thereare.gsm
%%DATADIR%%/sounds/queue-youarenext.gsm
+%%DATADIR%%/sounds/screen-callee-options.gsm
+%%DATADIR%%/sounds/spy-agent.gsm
+%%DATADIR%%/sounds/spy-h323.gsm
+%%DATADIR%%/sounds/spy-iax.gsm
+%%DATADIR%%/sounds/spy-iax2.gsm
+%%DATADIR%%/sounds/spy-mgcp.gsm
+%%DATADIR%%/sounds/spy-sip.gsm
+%%DATADIR%%/sounds/spy-skinny.gsm
+%%DATADIR%%/sounds/spy-zap.gsm
%%DATADIR%%/sounds/ss-noservice.gsm
%%DATADIR%%/sounds/transfer.gsm
%%DATADIR%%/sounds/tt-allbusy.gsm
@@ -531,7 +618,6 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/tt-monkeysintro.gsm
%%DATADIR%%/sounds/tt-somethingwrong.gsm
%%DATADIR%%/sounds/tt-weasels.gsm
-%%DATADIR%%/sounds/vm
%%DATADIR%%/sounds/vm-Cust1.gsm
%%DATADIR%%/sounds/vm-Cust2.gsm
%%DATADIR%%/sounds/vm-Cust3.gsm
@@ -553,6 +639,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-extension.gsm
%%DATADIR%%/sounds/vm-first.gsm
%%DATADIR%%/sounds/vm-for.gsm
+%%DATADIR%%/sounds/vm-forward.gsm
%%DATADIR%%/sounds/vm-forwardoptions.gsm
%%DATADIR%%/sounds/vm-from-extension.gsm
%%DATADIR%%/sounds/vm-from-phonenumber.gsm
@@ -571,10 +658,12 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-mailboxfull.gsm
%%DATADIR%%/sounds/vm-message.gsm
%%DATADIR%%/sounds/vm-messages.gsm
+%%DATADIR%%/sounds/vm-minutes.gsm
%%DATADIR%%/sounds/vm-mismatch.gsm
%%DATADIR%%/sounds/vm-msginstruct.gsm
%%DATADIR%%/sounds/vm-msgsaved.gsm
%%DATADIR%%/sounds/vm-newpassword.gsm
+%%DATADIR%%/sounds/vm-newuser.gsm
%%DATADIR%%/sounds/vm-next.gsm
%%DATADIR%%/sounds/vm-no.gsm
%%DATADIR%%/sounds/vm-nobodyavail.gsm
@@ -592,6 +681,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-reachoper.gsm
%%DATADIR%%/sounds/vm-rec-busy.gsm
%%DATADIR%%/sounds/vm-rec-name.gsm
+%%DATADIR%%/sounds/vm-rec-temp.gsm
%%DATADIR%%/sounds/vm-rec-unv.gsm
%%DATADIR%%/sounds/vm-received.gsm
%%DATADIR%%/sounds/vm-reenterpassword.gsm
@@ -605,6 +695,9 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-sorry.gsm
%%DATADIR%%/sounds/vm-star-cancel.gsm
%%DATADIR%%/sounds/vm-starmain.gsm
+%%DATADIR%%/sounds/vm-tempgreeting.gsm
+%%DATADIR%%/sounds/vm-tempgreeting2.gsm
+%%DATADIR%%/sounds/vm-tempremoved.gsm
%%DATADIR%%/sounds/vm-then-pound.gsm
%%DATADIR%%/sounds/vm-theperson.gsm
%%DATADIR%%/sounds/vm-tocallback.gsm
@@ -624,9 +717,11 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-whichbox.gsm
%%DATADIR%%/sounds/vm-youhave.gsm
%%DATADIR%%/sounds/voicemail
+@dirrm %%DATADIR%%/sounds/dictate
@dirrm %%DATADIR%%/sounds/phonetic
@dirrm %%DATADIR%%/sounds/letters
@dirrm %%DATADIR%%/sounds/digits
+@dirrm %%DATADIR%%/sounds/priv-callerintros
@dirrm %%DATADIR%%/sounds
@dirrm %%DATADIR%%/mohmp3
@dirrm %%DATADIR%%/keys
@@ -641,11 +736,14 @@ sbin/safe_asterisk
@dirrm etc/asterisk
@unexec rm -f %D/%%DATADIR%%/astdb
@cwd /var
-spool/asterisk/vm
spool/asterisk/voicemail/default/1234/busy.gsm
spool/asterisk/voicemail/default/1234/unavail.gsm
@exec mkdir -p %D/log/asterisk/cdr-csv
@exec mkdir -p %D/spool/asterisk/voicemail/default/1234/INBOX
+@dirrm spool/asterisk/dictate
+@dirrm spool/asterisk/meetme
+@dirrm spool/asterisk/monitor
+@dirrm spool/asterisk/system
@dirrm spool/asterisk/voicemail/default/1234/INBOX
@dirrm spool/asterisk/voicemail/default/1234
@dirrm spool/asterisk/voicemail/default
@@ -653,4 +751,5 @@ spool/asterisk/voicemail/default/1234/unavail.gsm
@dirrm spool/asterisk/tmp
@dirrm spool/asterisk
@dirrm log/asterisk/cdr-csv
+@dirrm log/asterisk/cdr-custom
@dirrm log/asterisk
diff --git a/net/asterisk14/Makefile b/net/asterisk14/Makefile
index 276aa57..3cfbf7e 100644
--- a/net/asterisk14/Makefile
+++ b/net/asterisk14/Makefile
@@ -6,30 +6,24 @@
#
PORTNAME= asterisk
-PORTVERSION= 1.0.9
-PORTREVISION= 2
+PORTVERSION= 1.2.1
CATEGORIES= net
MASTER_SITES= http://ftp.digium.com/pub/asterisk/ \
http://ftp.digium.com/pub/asterisk/old-releases/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/old-releases/
-PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
-PATCH_SITES= ${MASTER_SITE_LOCAL}
-PATCH_SITE_SUBDIR= fjoe
-PATCH_DIST_STRIP= -p1
-
MAINTAINER= sobomax@FreeBSD.org
COMMENT= An Open Source PBX and telephony toolkit
BUILD_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
LIB_DEPENDS= speex.3:${PORTSDIR}/audio/speex \
- newt.51:${PORTSDIR}/devel/newt
+ newt.51:${PORTSDIR}/devel/newt \
+ curl.3:${PORTSDIR}/ftp/curl
RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
ONLY_FOR_ARCHS= i386 sparc64 amd64
-BRIVER= bristuff-0.2.0-RC8h
GNU_CONFIGURE= yes
CONFIGURE_WRKSRC= ${WRKSRC}/editline
USE_GMAKE= yes
@@ -44,7 +38,7 @@ MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
OSVERSION=${OSVERSION} \
CXX="${CXX}"
-MAN8= asterisk.8
+MAN8= asterisk.8 astgenkey.8 autosupport.8 safe_asterisk.8
.include <bsd.port.pre.mk>
@@ -68,8 +62,9 @@ MAKE_ENV+= WITH_H323=1
.if defined(WITHOUT_ZAPTEL)
PLIST_SUB+= WITH_ZAPTEL="@comment "
.else
+BUILD_DEPENDS+= libpri>=1.2.0:${PORTSDIR}/misc/libpri \
+ ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
LIB_DEPENDS+= pri.1:${PORTSDIR}/misc/libpri
-BUILD_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
RUN_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
PLIST_SUB+= WITH_ZAPTEL=""
MAKE_ENV+= WITH_ZAPTEL=1
@@ -86,10 +81,6 @@ PLIST_SUB+= WITH_ODBC=""
MAKE_ENV+= WITH_ODBC=1
.endif
-.if !defined(WITHOUT_MYSQL)
-USE_MYSQL= yes
-.endif
-
.if defined(WITHOUT_FAX)
PLIST_SUB+= WITH_FAX="@comment "
.else
@@ -99,7 +90,6 @@ PLIST_SUB+= WITH_FAX=""
.endif
post-patch:
- ${CP} ${FILESDIR}/chan_oss.c ${WRKSRC}/channels
${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample
.include <bsd.port.post.mk>
diff --git a/net/asterisk14/distinfo b/net/asterisk14/distinfo
index 9ef6daa..9d56959 100644
--- a/net/asterisk14/distinfo
+++ b/net/asterisk14/distinfo
@@ -1,4 +1,3 @@
-MD5 (asterisk-1.0.9.tar.gz) = 0d7f1c680ae53a739f26a069ef8b580a
-SIZE (asterisk-1.0.9.tar.gz) = 9604582
-MD5 (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 42172c5b04af9080f22b883296c34002
-SIZE (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 56589
+MD5 (asterisk-1.2.1.tar.gz) = 04657086791e80f319c0d728af705001
+SHA256 (asterisk-1.2.1.tar.gz) = f0d3ed36353c1f5726225d2794bea7d1d1a92c9e58336b02b293f43dd4b97948
+SIZE (asterisk-1.2.1.tar.gz) = 10517194
diff --git a/net/asterisk14/files/chan_oss.c b/net/asterisk14/files/chan_oss.c
deleted file mode 100644
index 95a9236..0000000
--- a/net/asterisk14/files/chan_oss.c
+++ /dev/null
@@ -1,1327 +0,0 @@
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * Copyright (C) 1999, Mark Spencer
- *
- * Mark Spencer <markster@linux-support.net>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- *
- * FreeBSD changes and multiple device support by Luigi Rizzo, 2005.05.02
- * note-this code best seen with ts=8 (8-spaces tabs) in the editor
- */
-
-#include <asterisk/lock.h>
-#include <asterisk/frame.h>
-#include <asterisk/logger.h>
-#include <asterisk/channel.h>
-#include <asterisk/module.h>
-#include <asterisk/channel_pvt.h>
-#include <asterisk/options.h>
-#include <asterisk/pbx.h>
-#include <asterisk/config.h>
-#include <asterisk/cli.h>
-#include <asterisk/utils.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h> /* for isalnum */
-#ifdef __linux
-#include <linux/soundcard.h>
-#elif defined(__FreeBSD__)
-#include <sys/soundcard.h>
-#else
-#include <soundcard.h>
-#endif
-#include "busy.h"
-#include "ringtone.h"
-#include "ring10.h"
-#include "answer.h"
-
-/*
- * Helper macros to parse config arguments. They will go in a common
- * header file if their usage is globally accepted. In the meantime,
- * we define them here. Typical usage is as below, WITHOUT ; on each line.
- *
- * {
- * M_START(v->name, v->value)
- *
- * M_BOOL("dothis", x->flag1)
- * M_STR("name", x->somestring)
- * M_F("bar", some_c_code)
- * M_END(some_final_statement)
- */
-#define M_START(var, val) \
- char *__s = var; char *__val = val;
-#define M_END(x) x;
-#define M_F(tag, f) if (!strcasecmp((__s), tag)) { f; } else
-#define M_BOOL(tag, dst) M_F(tag, (dst) = ast_true(__val) )
-#define M_UINT(tag, dst) M_F(tag, (dst) = strtoul(__val, NULL, 0) )
-#define M_STR(tag, dst) M_F(tag, strncpy(dst, __val, sizeof(dst) - 1) )
-
-
-/* Which device to use */
-#if defined( __OpenBSD__ ) || defined( __NetBSD__ )
-#define DEV_DSP "/dev/audio"
-#else
-#define DEV_DSP "/dev/dsp"
-#endif
-
-/*
- * Basic mode of operation:
- *
- * we have one keyboard (which receives commands from the keyboard)
- * and multiple headset's connected to audio cards. Headsets are named as
- * the sections of oss.conf
- *
- * At any time, the keyboard is attached to one headset, and you
- * can switch among them using the 'console' command.
- *
- * The following parameters are important for the configuration of
- * the device:
- *
- * FRAME_SIZE the size of an audio frame, in samples.
- * 160 is used almost universally, so you should not change it.
- *
- * FRAGS the argument for the SETFRAGMENT ioctl.
- * Overridden by the 'frags' parameter in oss.conf
- *
- * Bits 0-7 are the base-2 log of the device's block size,
- * bits 16-31 are the number of blocks in the driver's queue.
- * There are a lot of differences in the way this parameter
- * is supported by different drivers, so you may need to
- * experiment a bit with the value.
- * A good default for linux is 30 blocks of 64 bytes, which
- * results in 6 frames of 320 bytes (160 samples).
- * FreeBSD works decently with blocks of 256 or 512 bytes,
- * leaving the number unspecified.
- * Note that this only refers to the device buffer size,
- * this module will then try to keep the lenght of audio
- * buffered within small constraints.
- *
- * QUEUE_SIZE The max number of blocks actually allowed in the device
- * driver's buffer, irrespective of the available number.
- * Overridden by the 'queuesize' parameter in oss.conf
- *
- * Should be >=2, and at most as large as the hw queue above
- * (otherwise it will never be full).
- */
-
-#define FRAME_SIZE 160
-#define QUEUE_SIZE 10
-
-#if defined(__FreeBSD__)
-#define FRAGS 0x8
-#else
-#define FRAGS ( ( (6 * 5) << 16 ) | 0x6 )
-#endif
-
-
-/* Don't switch between read/write modes faster than every 300 ms */
-#define MIN_SWITCH_TIME 300
-
-
-static int usecnt;
-AST_MUTEX_DEFINE_STATIC(usecnt_lock);
-
-static char *desc = "OSS Console Channel Driver";
-static char *tdesc = "OSS Console Channel Driver";
-static char *config = "oss.conf"; /* default config file */
-
-static int oss_debug;
-
-/*
- * Each sound is made of 'datalen' samples of sound, repeated as needed to
- * generate 'samplen' samples of data, then followed by 'silencelen' samples
- * of silence. The loop is repeated if 'repeat' is set.
- */
-struct sound {
- int ind;
- char *desc;
- short *data;
- int datalen;
- int samplen;
- int silencelen;
- int repeat;
-};
-
-static struct sound sounds[] = {
- { AST_CONTROL_RINGING, "RINGING", ringtone, sizeof(ringtone)/2, 16000, 32000, 1 },
- { AST_CONTROL_BUSY, "BUSY", busy, sizeof(busy)/2, 4000, 4000, 1 },
- { AST_CONTROL_CONGESTION, "CONGESTION", busy, sizeof(busy)/2, 2000, 2000, 1 },
- { AST_CONTROL_RING, "RING10", ring10, sizeof(ring10)/2, 16000, 32000, 1 },
- { AST_CONTROL_ANSWER, "ANSWER", answer, sizeof(answer)/2, 2200, 0, 0 },
- { -1, NULL, 0, 0, 0, 0 }, /* end marker */
-};
-
-
-/*
- * descriptor for one of our channels.
- * There is one used for 'default' values (from the [general] entry in
- * the configuration file, and then one instance for each device
- * (the default is cloned from [general], others are only created
- * if the relevant section exists.
- */
-struct chan_oss_pvt {
- struct chan_oss_pvt *next;
-
- char *type;
- char *name;
- /*
- * cursound indicates which in struct sound we play. -1 means nothing,
- * any other value is a valid sound, in which case sampsent indicates
- * the next sample to send in [0..samplen + silencelen]
- * nosound is set to disable the audio data from the channel
- * (so we can play the tones etc.).
- */
- int sndcmd[2]; /* Sound command pipe */
- int cursound; /* index of sound to send */
- int sampsent; /* # of sound samples sent */
- int nosound; /* set to block audio from the PBX */
-
- int total_blocks; /* total blocks in the output device */
- int sounddev;
- enum { M_UNSET, M_FULL, M_READ, M_WRITE } duplex;
- int autoanswer;
- int autohangup;
- int hookstate;
- struct timeval lasttime; /* last setformat */
- char *mixer_cmd; /* initial command to issue to the mixer */
- unsigned int queuesize; /* max fragments in queue */
- unsigned int frags; /* parameter for SETFRAGMENT */
-
- int warned; /* various flags used for warnings */
-#define WARN_used_blocks 1
-#define WARN_speed 2
-#define WARN_frag 4
- int w_errors; /* overfull in the write path */
-
- int silencesuppression;
- int silencethreshold;
- int playbackonly;
- char device[64]; /* device to open */
-
- pthread_t sthread;
-
- struct ast_channel *owner;
- char ext[AST_MAX_EXTENSION];
- char ctx[AST_MAX_EXTENSION];
- char language[MAX_LANGUAGE];
-
- /* buffers used in oss_write */
- char oss_write_buf[FRAME_SIZE*2];
- int oss_write_dst;
- /* buffers used in oss_read - AST_FRIENDLY_OFFSET space for headers
- * plus enough room for a full frame
- */
- char oss_read_buf[FRAME_SIZE * 2 + AST_FRIENDLY_OFFSET];
- int readpos; /* read position above */
- struct ast_frame read_f; /* returned by oss_read */
-};
-
-static struct chan_oss_pvt oss_default = {
- .type = "Console",
- .cursound = -1,
- .sounddev = -1,
- .duplex = M_UNSET, /* XXX check this */
- .autoanswer = 1,
- .autohangup = 1,
- .queuesize = QUEUE_SIZE,
- .frags = FRAGS,
- .silencethreshold = 1000, /* currently unused */
- .ext = "s",
- .ctx = "default",
- .readpos = AST_FRIENDLY_OFFSET, /* start here on reads */
-};
-
-static char *oss_active; /* the active device */
-
-/*
- * returns true if too early to switch
- */
-static int too_early(struct chan_oss_pvt *o)
-{
- struct timeval tv;
- int ms;
- gettimeofday(&tv, NULL);
- ms = (tv.tv_sec - o->lasttime.tv_sec) * 1000 +
- (tv.tv_usec - o->lasttime.tv_usec) / 1000;
- if (ms < MIN_SWITCH_TIME)
- return -1;
- return 0;
-}
-
-/*
- * Returns the number of blocks used in the audio output channel
- */
-static int used_blocks(struct chan_oss_pvt *o)
-{
- struct audio_buf_info info;
-
- if (ioctl(o->sounddev, SNDCTL_DSP_GETOSPACE, &info)) {
- if (! (o->warned & WARN_used_blocks)) {
- ast_log(LOG_WARNING, "Error reading output space\n");
- o->warned |= WARN_used_blocks;
- }
- return 1;
- }
- if (o->total_blocks == 0) {
- if (0) /* debugging */
- ast_log(LOG_WARNING, "fragtotal %d size %d avail %d\n",
- info.fragstotal,
- info.fragsize,
- info.fragments);
- o->total_blocks = info.fragments;
- }
- return o->total_blocks - info.fragments;
-}
-
-static int soundcard_writeframe(struct chan_oss_pvt *o, short *data)
-{
- /* Write an exactly FRAME_SIZE sized frame */
- int res;
-
- /*
- * Nothing complex to manage the audio device queue.
- * If the buffer is full just drop the extra, otherwise write.
- * XXX in some cases it might be useful to write anyways after
- * a number of failures, to restart the output chain.
- */
- res = used_blocks(o);
- if (res > o->queuesize) { /* no room to write a block */
- if (o->w_errors++ == 0 && (oss_debug & 0x4))
- ast_log(LOG_WARNING, "write: used %d blocks (%d)\n",
- res, o->w_errors);
- return 0;
- }
- o->w_errors = 0;
- res = write(o->sounddev, ((void *)data), FRAME_SIZE * 2);
- return res;
-}
-
-/*
- * handler for 'sound writable' events from the sound thread.
- * Builds a frame from the high level description of the sounds,
- * and passes it to the audio device.
- * The actual sound is made of 1 or more sequences of sound samples
- * (s->datalen, repeated to make s->samplen samples) followed by
- * s->silencelen samples of silence. The position in the sequence is stored
- * in o->sampsent, which goes between 0 .. s->samplen+s->silencelen.
- * In case we fail to write a frame, don't update o->sampsent.
- */
-static void send_sound(struct chan_oss_pvt *o)
-{
- short myframe[FRAME_SIZE];
- int ofs, l, start;
- int l_sampsent = o->sampsent;
- struct sound *s;
-
- if (o->cursound < 0) /* no sound to send */
- return;
- s = &sounds[o->cursound];
- for (ofs = 0; ofs < FRAME_SIZE; ofs += l) {
- l = s->samplen - l_sampsent; /* sound available */
- if (l > 0) {
- start = l_sampsent % s->datalen; /* source offset */
- if (l > FRAME_SIZE - ofs) /* don't overflow the frame */
- l = FRAME_SIZE - ofs;
- if (l > s->datalen - start) /* don't overflow the source */
- l = s->datalen - start;
- bcopy(s->data + start, myframe + ofs, l*2);
- if (0)
- ast_log(LOG_WARNING, "send_sound sound %d/%d of %d into %d\n",
- l_sampsent, l, s->samplen, ofs);
- l_sampsent += l;
- } else { /* no sound, maybe some silence */
- static short silence[FRAME_SIZE] = {0, };
-
- l += s->silencelen;
- if (l > 0) {
- if (l > FRAME_SIZE - ofs)
- l = FRAME_SIZE - ofs;
- bcopy(silence, myframe + ofs, l*2);
- l_sampsent += l;
- } else { /* silence is over, restart sound if loop */
- if (s->repeat == 0) { /* last block */
- o->cursound = -1;
- o->nosound = 0; /* allow audio data */
- if (ofs < FRAME_SIZE) /* pad with silence */
- bcopy(silence, myframe + ofs, (FRAME_SIZE - ofs)*2);
- }
- l_sampsent = 0;
- }
- }
- }
- l = soundcard_writeframe(o, myframe);
- if (l > 0)
- o->sampsent = l_sampsent; /* update status */
-}
-
-static void *sound_thread(void *arg)
-{
- char ign[4096];
- struct chan_oss_pvt *o = (struct chan_oss_pvt *)arg;
-
- /* kick the driver by trying to read from it. Ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- for(;;) {
- fd_set rfds, wfds;
- int maxfd, res;
-
- FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- maxfd = o->sndcmd[0]; /* pipe from the main process */
- FD_SET(o->sndcmd[0], &rfds);
- if (!o->owner) { /* no one owns the audio, so we must drain it */
- FD_SET(o->sounddev, &rfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- if (o->cursound > -1) {
- FD_SET(o->sounddev, &wfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- /* ast_select emulates linux behaviour in terms of timeout handling */
- res = ast_select(maxfd + 1, &rfds, &wfds, NULL, NULL);
- if (res < 1) {
- ast_log(LOG_WARNING, "select failed: %s\n",
- strerror(errno));
- continue;
- }
- if (FD_ISSET(o->sndcmd[0], &rfds)) {
- /* read which sound to play from the pipe */
- int i, what = -1;
-
- read(o->sndcmd[0], &what, sizeof(what));
- for (i = 0; sounds[i].ind != -1; i++) {
- if (sounds[i].ind == what) {
- o->cursound = i;
- o->sampsent = 0;
- o->nosound = 1; /* block audio from pbx */
- break;
- }
- }
- if (sounds[i].ind == -1)
- ast_log(LOG_WARNING, "invalid sound index: %d\n", what);
- }
- if (FD_ISSET(o->sounddev, &rfds)) { /* read and ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- }
- if (FD_ISSET(o->sounddev, &wfds))
- send_sound(o);
- }
- /* Never reached */
- return NULL;
-}
-
-/*
- * reset and close the device if opened,
- * then open and initialize it in the desired mode,
- * trigger reads and writes so we can start using it.
- */
-static int setformat(struct chan_oss_pvt *o, int mode)
-{
- int fmt, desired, res, fd;
-
- if (o->sounddev >= 0) {
- ioctl(o->sounddev, SNDCTL_DSP_RESET, 0);
- close(o->sounddev);
- o->duplex = M_UNSET;
- }
- fd = o->sounddev = open(o->device, mode |O_NONBLOCK);
- if (o->sounddev < 0) {
- ast_log(LOG_WARNING, "Unable to re-open DSP device: %s\n",
- strerror(errno));
- return -1;
- }
-
- gettimeofday(&o->lasttime, NULL);
- fmt = AFMT_S16_LE;
- res = ioctl(fd, SNDCTL_DSP_SETFMT, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set format to 16-bit signed\n");
- return -1;
- }
- switch (mode) {
- case O_RDWR:
- res = ioctl(fd, SNDCTL_DSP_SETDUPLEX, 0);
- /* Check to see if duplex set (FreeBSD Bug)*/
- res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt);
- if (res == 0 && (fmt & DSP_CAP_DUPLEX)) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Console is full duplex\n");
- o->duplex = M_FULL;
- };
- break;
- case O_WRONLY:
- o->duplex = M_WRITE;
- break;
- case O_RDONLY:
- o->duplex = M_READ;
- break;
- }
-
- fmt = 0;
- res = ioctl(fd, SNDCTL_DSP_STEREO, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- /* 8000 Hz desired */
- desired = 8000;
- fmt = desired;
- res = ioctl(fd, SNDCTL_DSP_SPEED, &fmt);
-
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- if (fmt != desired) {
- if (!(o->warned & WARN_speed)) {
- ast_log(LOG_WARNING,
- "Requested %d Hz, got %d Hz -- sound may be choppy\n",
- desired, fmt);
- o->warned |= WARN_speed;
- }
- }
- /*
- * on Freebsd, SETFRAGMENT does not work very well on some cards.
- * Default to use 256 bytes, let the user override
- */
- if (o->frags) {
- fmt = o->frags;
- res = ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &fmt);
- if (res < 0) {
- if (!(o->warned & WARN_frag)) {
- ast_log(LOG_WARNING,
- "Unable to set fragment size -- sound may be choppy\n");
- o->warned |= WARN_frag;
- }
- }
- }
- /* XXX on some cards, we need SNDCTL_DSP_SETTRIGGER to start outputting */
- res = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT;
- res = ioctl(fd, SNDCTL_DSP_SETTRIGGER, &res);
- /* it may fail if we are in half duplex, never mind */
- return 0;
-}
-
-/*
- * make sure output mode is available. Returns 0 if done,
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setoutput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_WRITE && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_WRONLY))
- return -1;
- return 0;
-}
-
-/*
- * make sure input mode is available. Returns 0 if done
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setinput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_READ && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_RDONLY))
- return -1;
- return 0;
-}
-
-/*
- * some of the standard methods supported by channels.
- */
-static int oss_digit(struct ast_channel *c, char digit)
-{
- /* no better use for received digits than print them */
- ast_verbose( " << Console Received digit %c >> \n", digit);
- return 0;
-}
-
-static int oss_text(struct ast_channel *c, char *text)
-{
- /* print received messages */
- ast_verbose( " << Console Received text %s >> \n", text);
- return 0;
-}
-
-/* Play ringtone 'x' on device 'o' */
-#define RING(o, x) { int what = x; write((o)->sndcmd[1], &what, sizeof(what)); }
-
-/*
- * handler for incoming calls. Either autoanswer, or start ringing
- */
-static int oss_call(struct ast_channel *c, char *dest, int timeout)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame f = { 0, };
-
- ast_verbose( " << Call placed to '%s' on console >> \n", dest);
- if (o->autoanswer) {
- ast_verbose( " << Auto-answered >> \n" );
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_ANSWER;
- ast_queue_frame(c, &f);
- } else {
- ast_verbose(" << Type 'answer' to answer, or use 'autoanswer' for future calls >> \n");
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_RINGING;
- ast_queue_frame(c, &f);
- RING(o, AST_CONTROL_RING);
- }
- return 0;
-}
-
-/*
- * remote side answered the phone
- */
-static int oss_answer(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- ast_verbose( " << Console call has been answered >> \n");
-#if 0
- /* play an answer tone (XXX do we really need it ?) */
- RING(o, AST_CONTROL_ANSWER);
-#endif
- ast_setstate(c, AST_STATE_UP);
- o->cursound = -1;
- o->nosound=0;
- return 0;
-}
-
-static int oss_hangup(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- o->cursound = -1;
- c->pvt->pvt = NULL;
- o->owner = NULL;
- ast_verbose( " << Hangup on console >> \n");
- ast_mutex_lock(&usecnt_lock); /* XXX not sure why */
- usecnt--;
- ast_mutex_unlock(&usecnt_lock);
- if (o->hookstate) {
- if (o->autoanswer || o->autohangup) {
- /* Assume auto-hangup too */
- o->hookstate = 0;
- } else {
- /* Make congestion noise */
- RING(o, AST_CONTROL_CONGESTION);
- }
- }
- return 0;
-}
-
-/* used for data coming from the network */
-static int oss_write(struct ast_channel *c, struct ast_frame *f)
-{
- int res;
- int src;
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- /* Immediately return if no sound is enabled */
- if (o->nosound)
- return 0;
- /* Stop any currently playing sound */
- o->cursound = -1;
- if (o->duplex != M_FULL && !o->playbackonly) {
- /* XXX check this, looks weird! */
- /* If we're half duplex, we have to switch to read mode
- to honor immediate needs if necessary */
- res = soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set device to input mode\n");
- return -1;
- }
- return 0;
- }
- res = soundcard_setoutput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set output device\n");
- return -1;
- } else if (res > 0) {
- /* The device is still in read mode, and it's too soon to change it,
- so just pretend we wrote it */
- return 0;
- }
- /*
- * we could receive a sample which is not a multiple of our FRAME_SIZE,
- * so we buffer it locally and write to the device in FRAME_SIZE
- * chunks, keeping the residue stored for future use.
- */
- src = 0; /* read position into f->data */
- while ( src < f->datalen ) {
- /* Compute spare room in the buffer */
- int l = sizeof(o->oss_write_buf) - o->oss_write_dst;
-
- if (f->datalen - src >= l) { /* enough to fill a frame */
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- soundcard_writeframe(o, (short *)o->oss_write_buf);
- src += l;
- o->oss_write_dst = 0;
- } else { /* copy residue */
- l = f->datalen - src;
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- src += l; /* but really, we are done */
- o->oss_write_dst += l;
- }
- }
- return 0;
-}
-
-static struct ast_frame *oss_read(struct ast_channel *c)
-{
- int res;
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame *f = &o->read_f;
-
- /* prepare a NULL frame in case we don't have enough data to return */
- bzero(f, sizeof(struct ast_frame));
- f->frametype = AST_FRAME_NULL;
- f->src = o->type;
-
- res = soundcard_setinput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set input mode\n");
- return NULL;
- } else if (res > 0) { /* too early to switch ? */
- /* Theoretically shouldn't happen, but anyway, return a NULL frame */
- return f;
- }
-
- res = read(o->sounddev, o->oss_read_buf + o->readpos,
- sizeof(o->oss_read_buf) - o->readpos);
- if (res < 0) /* audio data not ready, return a NULL frame */
- return f;
-
- o->readpos += res;
- if (o->readpos < sizeof(o->oss_read_buf)) /* not enough samples */
- return f;
-
- o->readpos = AST_FRIENDLY_OFFSET; /* reset read pointer for next frame */
- if (c->_state != AST_STATE_UP) /* drop data if frame is not up */
- return f;
- /* ok we can build and deliver the frame to the caller */
- f->frametype = AST_FRAME_VOICE;
- f->subclass = AST_FORMAT_SLINEAR;
- f->samples = FRAME_SIZE;
- f->datalen = FRAME_SIZE * 2;
- f->data = o->oss_read_buf + AST_FRIENDLY_OFFSET;
- f->offset = AST_FRIENDLY_OFFSET;
- return f;
-}
-
-static int oss_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
-{
- struct chan_oss_pvt *o = newchan->pvt->pvt;
- o->owner = newchan;
- return 0;
-}
-
-static int oss_indicate(struct ast_channel *c, int cond)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- int res;
-
- switch(cond) {
- case AST_CONTROL_BUSY:
- case AST_CONTROL_CONGESTION:
- case AST_CONTROL_RINGING:
- res = cond;
- break;
- case -1:
- o->cursound = -1;
- return 0;
- default:
- ast_log(LOG_WARNING,
- "Don't know how to display condition %d on %s\n",
- cond, c->name);
- return -1;
- }
- if (res > -1)
- RING(o, res);
- return 0;
-}
-
-static struct ast_channel *oss_new(struct chan_oss_pvt *o,
- char *ext, char *ctx, int state)
-{
- struct ast_channel *c;
- struct ast_channel_pvt *pvt;
-
- c = ast_channel_alloc(1);
- if (c == NULL)
- return NULL;
- snprintf(c->name, sizeof(c->name), "OSS/%s", o->device + 5);
- c->type = o->type;
- c->fds[0] = o->sounddev;
- c->nativeformats = AST_FORMAT_SLINEAR;
- pvt = c->pvt;
- pvt->pvt = o;
-
- /* relevant callbacks */
- pvt->send_digit = oss_digit;
- pvt->send_text = oss_text;
- pvt->hangup = oss_hangup;
- pvt->answer = oss_answer;
- pvt->read = oss_read;
- pvt->call = oss_call;
- pvt->write = oss_write;
- pvt->indicate = oss_indicate;
- pvt->fixup = oss_fixup;
-
-#define S_OVERRIDE(dst, src) \
- { if (src && src[0] != '\0') /* non-empty string */ \
- strncpy((dst), src, sizeof(dst)-1); }
- S_OVERRIDE(c->context, ctx);
- S_OVERRIDE(c->exten, ext);
- S_OVERRIDE(c->language, o->language);
- o->owner = c;
- ast_setstate(c, state);
- ast_mutex_lock(&usecnt_lock);
- usecnt++;
- ast_mutex_unlock(&usecnt_lock);
- ast_update_use_count();
- if (state != AST_STATE_DOWN) {
- if (ast_pbx_start(c)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", c->name);
- ast_hangup(c);
- o->owner = c = NULL;
- /* XXX what about the channel itself ? */
- /* XXX what about usecnt ? */
- }
- }
- return c;
-}
-
-/*
- * returns a pointer to the descriptor with the given name
- */
-static struct chan_oss_pvt *find_desc(char *dev)
-{
- struct chan_oss_pvt *o;
-
- for (o = oss_default.next; o && strcmp(o->name, dev) != 0; o = o->next)
- ;
- if (o == NULL)
- ast_log(LOG_WARNING, "%s could not find <%s>\n", __func__, dev);
- return o;
-}
-
-static struct ast_channel *oss_request(char *type, int format, void *data)
-{
- struct ast_channel *c;
- struct chan_oss_pvt *o = find_desc(data);
-
- ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n",
- type, data, (char *)data);
- if (o == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data);
- /* XXX we could default to 'dsp' perhaps ? */
- return NULL;
- }
- if ((format & AST_FORMAT_SLINEAR) == 0) {
- ast_log(LOG_NOTICE, "Format 0x%x unsupported\n", format);
- return NULL;
- }
- if (o->owner) {
- ast_log(LOG_NOTICE, "Already have a call on the OSS channel\n");
- return NULL;
- }
- c= oss_new(o, NULL, NULL, AST_STATE_DOWN);
- if (c == NULL) {
- ast_log(LOG_WARNING, "Unable to create new OSS channel\n");
- return NULL;
- }
- return c;
-}
-
-static int console_autoanswer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o == NULL) {
- ast_log(LOG_WARNING, "Cannot find device %s (should not happen!)\n",
- oss_active);
- return RESULT_FAILURE;
- }
- if (argc == 1) {
- ast_cli(fd, "Auto answer is %s.\n", o->autoanswer ? "on" : "off");
- return RESULT_SUCCESS;
- }
- if (!strcasecmp(argv[1], "on"))
- o->autoanswer = -1;
- else if (!strcasecmp(argv[1], "off"))
- o->autoanswer = 0;
- else
- return RESULT_SHOWUSAGE;
- return RESULT_SUCCESS;
-}
-
-static char *autoanswer_complete(char *line, char *word, int pos, int state)
-{
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
- int l = strlen(word);
-
- switch(state) {
- case 0:
- if (l && !strncasecmp(word, "on", MIN(l, 2)))
- return strdup("on");
- case 1:
- if (l && !strncasecmp(word, "off", MIN(l, 3)))
- return strdup("off");
- default:
- return NULL;
- }
- return NULL;
-}
-
-static char autoanswer_usage[] =
-"Usage: autoanswer [on|off]\n"
-" Enables or disables autoanswer feature. If used without\n"
-" argument, displays the current on/off status of autoanswer.\n"
-" The default value of autoanswer is in 'oss.conf'.\n";
-
-/*
- * answer command from the console
- */
-static int console_answer(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 1;
- o->cursound = -1;
- ast_queue_frame(o->owner, &f);
- RING(o, AST_CONTROL_ANSWER);
- return RESULT_SUCCESS;
-}
-
-static char sendtext_usage[] =
-"Usage: send text <message>\n"
-" Sends a text message for display on the remote terminal.\n";
-
-static int console_sendtext(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- int tmparg = 2;
- char text2send[256] = "";
- struct ast_frame f = { 0, };
-
- if (argc < 2)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- if (strlen(text2send))
- ast_cli(fd, "Warning: message already waiting to be sent, overwriting\n");
- text2send[0] = '\0';
- while(tmparg < argc) {
- strncat(text2send, argv[tmparg++], sizeof(text2send) - strlen(text2send) - 1);
- strncat(text2send, " ", sizeof(text2send) - strlen(text2send) - 1);
- }
- if (strlen(text2send)) {
- f.frametype = AST_FRAME_TEXT;
- f.subclass = 0;
- f.data = text2send;
- f.datalen = strlen(text2send);
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-static char answer_usage[] =
-"Usage: answer\n"
-" Answers an incoming call on the console (OSS) channel.\n";
-
-static int console_hangup(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner && !o->hookstate) {
- ast_cli(fd, "No call to hangup up\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) {
- ast_queue_hangup(o->owner);
- }
- return RESULT_SUCCESS;
-}
-
-static char hangup_usage[] =
-"Usage: hangup\n"
-" Hangs up any call currently placed on the console.\n";
-
-
-static int console_flash(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_FLASH };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner) { /* XXX maybe !o->hookstate too ? */
- ast_cli(fd, "No call to flash\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) { /* XXX must be true, right ? */
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-
-static char flash_usage[] =
-"Usage: flash\n"
-" Flashes the call currently placed on the console.\n";
-
-
-
-static int console_dial(int fd, int argc, char *argv[])
-{
- char *tmp = NULL, *mye = NULL, *myc = NULL;
- int i;
- struct ast_frame f = { AST_FRAME_DTMF, 0 };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o->owner) { /* already in a call */
- if (argc == 1) { /* argument is mandatory here */
- ast_cli(fd, "Already in a call. You can only dial digits until you hangup.\n");
- return RESULT_FAILURE;
- }
- mye = argv[1];
- /* send the string one char at a time */
- for (i=0; i<strlen(mye); i++) {
- f.subclass = mye[i];
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
- }
- /* if we have an argument split it into extension and context */
-
- if (argc == 2) {
- tmp = myc = strdup(argv[1]); /* make a writable copy */
- mye = strsep(&myc, "@"); /* set exten, advance to context */
- myc = strsep(&myc, "@"); /* set context */
- }
- /* supply default values if needed */
- if (mye == NULL)
- mye = o->ext;
- if (myc == NULL)
- myc = o->ctx;
- if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
- o->hookstate = 1;
- oss_new(o, mye, myc, AST_STATE_RINGING);
- } else
- ast_cli(fd, "No such extension '%s' in context '%s'\n", mye, myc);
- return RESULT_SUCCESS;
-}
-
-static char dial_usage[] =
-"Usage: dial [extension[@context]]\n"
-" Dials a given extensison (and context if specified)\n";
-
-static int console_transfer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- struct ast_channel *b = NULL;
- char *ext, *ctx;
-
- if (argc != 2)
- return RESULT_SHOWUSAGE;
- if (o == NULL)
- return RESULT_FAILURE;
- if (o->owner == NULL || (b = o->owner->bridge) == NULL) {
- ast_cli(fd, "There is no call to transfer\n");
- return RESULT_SUCCESS;
- }
-
- ext = ctx = strdup(argv[1]); /* make a writable copy */
- strsep(&ctx, "@"); /* set exten, advance to context */
- ctx = strsep(&ctx, "@"); /* strip trailing @ and the rest */
-
- if (ctx == NULL) /* supply default context if needed */
- ctx = o->owner->context;
- if (!ast_exists_extension(b, ctx, ext, 1, b->callerid)) {
- ast_cli(fd, "No such extension exists\n");
- } else {
- ast_cli(fd, "Whee, transferring %s to %s@%s.\n", b->name, ext, ctx);
- if (ast_async_goto(b, ctx, ext, 1))
- ast_cli(fd, "Failed to transfer :(\n");
- }
- free(ext);
- return RESULT_SUCCESS;
-}
-
-static char transfer_usage[] =
-"Usage: transfer <extension>[@context]\n"
-" Transfers the currently connected call to the given extension (and\n"
-"context if specified)\n";
-
-static int console_active(int fd, int argc, char *argv[])
-{
- if (argc == 1) {
- ast_cli(fd, "active console is [%s]\n", oss_active);
- } else if (argc != 2) {
- return RESULT_SHOWUSAGE;
- } else {
- struct chan_oss_pvt *o;
- if (strcmp(argv[1], "show") == 0) {
- for (o = oss_default.next; o ; o = o->next)
- ast_cli(fd, "device [%s] exists\n", o->name);
- return RESULT_SUCCESS;
- }
- o = find_desc(argv[1]);
- if (o == NULL)
- ast_cli(fd, "No device [%s] exists\n", argv[1]);
- else
- oss_active = o->name;
- }
- return RESULT_SUCCESS;
-}
-
-static struct ast_cli_entry myclis[] = {
- { { "answer", NULL }, console_answer, "Answer an incoming console call", answer_usage },
- { { "hangup", NULL }, console_hangup, "Hangup a call on the console", hangup_usage },
- { { "flash", NULL }, console_flash, "Flash a call on the console", flash_usage },
- { { "dial", NULL }, console_dial, "Dial an extension on the console", dial_usage },
- { { "transfer", NULL }, console_transfer, "Transfer a call to a different extension", transfer_usage },
- { { "send", "text", NULL }, console_sendtext, "Send text to the remote device", sendtext_usage },
- { { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete },
- { { "console", NULL }, console_active, "Sets/displays active console",
- "console foo sets foo as the console"}
-};
-
-/*
- * store the mixer argument from the config file, filtering possibly
- * invalid or dangerous values (the string is used as argument for
- * system("mixer %s")
- */
-static void store_mixer(struct chan_oss_pvt *o, char *s)
-{
- int i;
-
- for (i=0; i < strlen(s); i++) {
- 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;
- }
- }
- if (o->mixer_cmd)
- free(o->mixer_cmd);
- o->mixer_cmd = strdup(s);
- ast_log(LOG_WARNING, "setting mixer %s\n", s);
-}
-
-/*
- * grab fields from the config file, init the descriptor and open the device.
- */
-static struct chan_oss_pvt * store_config(struct ast_config *cfg,
- char *ctg)
-{
- struct ast_variable *v;
- struct chan_oss_pvt *o;
-
- if (ctg == NULL) {
- o = &oss_default;
- o->next = NULL; /* XXX needed ? */
- ctg = "general";
- } else {
- o = (struct chan_oss_pvt *)malloc(sizeof *o);
- if (o == NULL) /* fail */
- return NULL;
- *o = oss_default;
- /* "general" is also the default thing */
- if (strcmp(ctg, "general") == 0) {
- o->name = strdup("dsp");
- oss_active = o->name;
- goto openit;
- }
- o->name = strdup(ctg);
- }
- ast_log(LOG_WARNING, "found category [%s]\n", ctg);
-
- /* fill other fields from configuration */
- v = ast_variable_browse(cfg, ctg);
- while(v) {
- M_START(v->name, v->value);
-
- M_BOOL("autoanswer", o->autoanswer)
- M_BOOL("autohangup", o->autohangup)
- M_BOOL("playbackonly", o->playbackonly)
- M_BOOL("silencesuppression", o->silencesuppression)
- M_UINT("silencethreshold", o->silencethreshold )
- M_STR("device", o->device)
- M_UINT("frags", o->frags)
- M_UINT("debug", oss_debug)
- M_UINT("queuesize", o->queuesize)
- M_STR("context", o->ctx)
- M_STR("language", o->language)
- M_STR("extension", o->ext)
- M_F("mixer", store_mixer(o, v->value))
- M_END(;);
- v=v->next;
- }
- if (!strlen(o->device))
- strncpy(o->device, DEV_DSP, sizeof(o->device)-1);
- if (o->mixer_cmd) {
- char *cmd;
-
- asprintf(&cmd, "mixer %s", o->mixer_cmd);
- ast_log(LOG_WARNING, "running [%s]\n", cmd);
- system(cmd);
- free(cmd);
- }
- if (o == &oss_default) /* we are done with the default */
- return NULL;
-
-openit:
- if (setformat(o, O_RDWR) < 0) { /* open device */
- if (option_verbose > 0) {
- ast_verbose(VERBOSE_PREFIX_2 "Device %s not detected\n", ctg);
- ast_verbose(VERBOSE_PREFIX_2 "Turn off OSS support by adding "
- "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
- }
- goto error;
- }
- soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (o->duplex != M_FULL)
- ast_log(LOG_WARNING, "XXX I don't work right with non "
- "full-duplex sound cards XXX\n");
- if ( pipe(o->sndcmd) != 0 ) {
- ast_log(LOG_ERROR, "Unable to create pipe\n");
- goto error;
- }
- ast_pthread_create(&o->sthread, NULL, sound_thread, o);
- /* link into list of devices */
- if (o != &oss_default) {
- o->next = oss_default.next;
- oss_default.next = o;
- }
- return o;
-
-error:
- if (o != &oss_default)
- free(o);
- return NULL;
-}
-
-int load_module()
-{
- int i;
- struct ast_config *cfg;
-
- /* load config file */
- cfg = ast_load(config);
- if (cfg != NULL) {
- char *ctg;
-
- store_config(cfg, NULL); /* init general category */
- ctg = ast_category_browse(cfg, NULL); /* initial category */
- while (ctg != NULL) {
- store_config(cfg, ctg);
- ctg = ast_category_browse(cfg, ctg);
- }
- ast_destroy(cfg);
- }
- if (find_desc(oss_active) == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", oss_active);
- /* XXX we could default to 'dsp' perhaps ? */
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- i = ast_channel_register(oss_default.type, tdesc,
- AST_FORMAT_SLINEAR, oss_request);
- if (i < 0) {
- ast_log(LOG_ERROR, "Unable to register channel class '%s'\n",
- oss_default.type);
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- for (i=0; i<sizeof(myclis)/sizeof(struct ast_cli_entry); i++)
- ast_cli_register(myclis + i);
- return 0;
-}
-
-
-int unload_module()
-{
- int x;
- struct chan_oss_pvt *o;
-
- /* XXX do we need a ast_channel_unregister oss_request ? */
- for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++)
- ast_cli_unregister(myclis + x);
-
- for (o = oss_default.next; o ; o = o->next) {
- close(o->sounddev);
- if (o->sndcmd[0] > 0) {
- close(o->sndcmd[0]);
- close(o->sndcmd[1]);
- }
- if (o->owner)
- ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD);
- if (o->owner) /* XXX how ??? */
- return -1;
- /* XXX what about the thread ? */
- /* XXX what about the memory allocated ? */
- }
- return 0;
-}
-
-char *description()
-{
- return desc;
-}
-
-int usecount() /* XXX is this per-device or global for the module ? */
-{
- int res;
- ast_mutex_lock(&usecnt_lock);
- res = usecnt;
- ast_mutex_unlock(&usecnt_lock);
- return res;
-}
-
-char *key()
-{
- return ASTERISK_GPL_KEY;
-}
diff --git a/net/asterisk14/files/patch-Makefile b/net/asterisk14/files/patch-Makefile
index 49c66ed..16f6b03 100644
--- a/net/asterisk14/files/patch-Makefile
+++ b/net/asterisk14/files/patch-Makefile
@@ -3,128 +3,200 @@ $FreeBSD$
--- Makefile.orig
+++ Makefile
-@@ -45,6 +45,19 @@
- PROC=$(shell uname -m)
- endif
-
-+ifeq (${OSARCH},FreeBSD)
-+ifeq ($(PROC),sparc64)
-+PROC=ultrasparc
-+OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
-+OPTIONS+=$(shell if $(CC) -mcpu=v9 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v9"; fi)
-+OPTIONS+=-fomit-frame-pointer
-+endif
-+ifeq ($(PROC),amd64)
-+PROC=k8
-+OPTIONS+=-m64
-+endif
-+endif
-+
- # Pentium Pro Optimize
- #PROC=i686
-
-@@ -63,10 +76,10 @@
+@@ -19,8 +19,8 @@
+ # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
+ # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
+ # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
+-CC=$(CROSS_COMPILE)gcc
+-HOST_CC=gcc
++CC?=$(CROSS_COMPILE)gcc
++HOST_CC=${CC}
+ # CROSS_ARCH=Linux
+ # CROSS_PROC=arm
+ # SUB_PROC=xscale # or maverick
+@@ -44,14 +44,14 @@
#K6OPT = -DK6OPT
- #Tell gcc to optimize the asterisk's code
+ #Tell gcc to optimize the code
-OPTIMIZE+=-O6
+#OPTIMIZE+=-O6
+ endif
- #Include debug symbols in the executables (-g) and profiling info (-pg)
--DEBUG=-g #-pg
-+#DEBUG=-g #-pg
+ #Overwite config files on "make samples"
+-OVERWRITE=y
++OVERWRITE=n
- # If you are running a radio application, define RADIO_RELAX so that the DTMF
- # will be received more reliably
-@@ -91,7 +104,7 @@
+ #Include debug and macro symbols in the executables (-g) and profiling info (-pg)
+-DEBUG=-g3 #-pg
++#DEBUG=-g3 #-pg
+
+ #Set NOCRYPTO to yes if you do not want to have crypto support or
+ #dependencies
+@@ -83,7 +83,7 @@
# Where to install asterisk after compiling
# Default -> leave empty
--INSTALL_PREFIX=
+-INSTALL_PREFIX?=
+INSTALL_PREFIX=$(PREFIX)
# Staging directory
# Files are copied here temporarily during the install process
-@@ -111,23 +124,23 @@
- # Don't use together with -DBUSYDETECT_TONEONLY
+@@ -106,17 +106,17 @@
BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
--ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
--ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
-+ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
-+ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
- ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
--ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
--ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
--ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
-+ASTSPOOLDIR=/var/spool/asterisk
-+ASTLOGDIR=/var/log/asterisk
-+ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
- ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
--ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
--ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
--ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
--ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
-+ASTBINDIR=$(INSTALL_PREFIX)/bin
-+ASTSBINDIR=$(INSTALL_PREFIX)/sbin
-+ASTVARRUNDIR=/var/run
-+ASTMANDIR=$(INSTALL_PREFIX)/man
-
- MODULES_DIR=$(ASTLIBDIR)/modules
- AGI_DIR=$(ASTVARLIBDIR)/agi-bin
-
- INCLUDE=-Iinclude -I../include
--CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
-+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
- CFLAGS+=$(OPTIMIZE)
+ ifneq ($(OSARCH),SunOS)
+- ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
+ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+ MODULES_DIR=$(ASTLIBDIR)/modules
+ AGI_DIR=$(ASTVARLIBDIR)/agi-bin
+ else
+@@ -218,13 +218,13 @@
+ endif
+
+ INCLUDE+=-Iinclude -I../include
+-ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
+-ASTCFLAGS+=$(OPTIMIZE)
++ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
++#ASTCFLAGS+=$(OPTIMIZE)
+ ASTOBJ=-o asterisk
+
+ ifeq ($(findstring BSD,$(OSARCH)),BSD)
+ PROC=$(shell uname -m)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
ifneq ($(PROC),ultrasparc)
-@@ -138,12 +151,8 @@
- CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi)
-
- ifeq (${OSARCH},FreeBSD)
--OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
--CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
--LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
--INCLUDE+=-I/usr/local/include
--CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
--MPG123TARG=freebsd
-+CFLAGS+=$(PTHREAD_CFLAGS)
-+LIBS+=$(PTHREAD_LIBS)
+@@ -235,8 +235,8 @@
+ ASTCFLAGS+=-fsigned-char
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h),)
+- ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/local/include/osp
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h),)
++ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp
+ else
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp
+@@ -245,27 +245,24 @@
+
+ ifeq ($(OSARCH),FreeBSD)
+ BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
+- ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
+- LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
+- ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp
++ ASTCFLAGS+=$(PTHREAD_CFLAGS)
++ LIBS+=$(PTHREAD_LIBS)
++ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp),)
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp
+ endif
+ MPG123TARG=freebsd
+
+- # XXX FreeBSD paths
+- PREFIX?=/usr/local
+- ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
+- ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
++ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
+- # XXX end FreeBSD paths
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+
endif # FreeBSD
- ifeq (${OSARCH},NetBSD)
-@@ -160,7 +169,10 @@
- #CFLAGS+=-DOLD_DSP_ROUTINES
+@@ -281,7 +278,7 @@
- CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
--CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPTEL_OPTIMIZATIONS
-+endif
+ ifeq ($(OSARCH),SunOS)
+ ASTCFLAGS+=-Wcast-align -DSOLARIS
+- INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
++ INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/include
+ endif
- LIBEDIT=editline/libedit.a
+ ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN)
+@@ -296,7 +293,7 @@
-@@ -222,7 +234,7 @@
- SOLINK=-shared -Xlinker -x
+ ifndef WITHOUT_ZAPTEL
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS
+ endif
+
+@@ -323,7 +320,7 @@
+ ASTERISKVERSIONNUM=999999
+ ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name)
+ else
+- ASTERISKVERSIONNUM=000000
++ ASTERISKVERSIONNUM?=000000
+ endif
+ endif
+
+@@ -388,10 +385,10 @@
endif
--CC=gcc
-+CC?=gcc
- INSTALL=install
+ ifeq ($(OSARCH),SunOS)
+- LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ OBJS+=strcompat.o
+ ASTLINK=
+- SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ endif
+
+ ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
+@@ -399,7 +396,7 @@
+ endif
- _all: all
-@@ -234,7 +246,7 @@
+ # This is used when generating the doxygen documentation
+-ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),)
++ifneq ($(wildcard $(LOCALBASE)/bin/dot)$(wildcard /usr/bin/dot),)
+ HAVEDOT=yes
+ else
+ HAVEDOT=no
+@@ -418,7 +415,7 @@
@echo " + $(MAKE) install +"
@echo " +-------------------------------------------+"
--all: depend asterisk subdirs
-+all: depend asterisk subdirs manpage
+-all: cleantest depend asterisk subdirs
++all: cleantest depend asterisk subdirs manpage
- editline/config.h:
- cd editline && unset CFLAGS LIBS && ./configure ; \
-@@ -243,13 +255,13 @@
+ #ifneq ($(wildcard tags),)
+ ctags: tags
+@@ -437,13 +434,13 @@
cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
$(MAKE) -C editline libedit.a
@@ -144,55 +216,57 @@ $FreeBSD$
+# fi
ifneq ($(wildcard .depend),)
- include .depend
-@@ -271,13 +283,10 @@
-
- asterisk.o: asterisk.c build.h
-
--manpage: asterisk.8.gz
-+manpage: asterisk.8
-
--asterisk.8.gz: asterisk.sgml
-- rm -f asterisk.8
-- docbook2man asterisk.sgml
-- mv ./*.8 asterisk.8
-- gzip asterisk.8
-+asterisk.8: asterisk.8.gz
-+ gzcat asterisk.8.gz > asterisk.8
-
- ifneq ($(strip $(ASTERISKVERSION)),)
- build.h: .version
-@@ -295,8 +304,8 @@
- exit 1; \
+ include .depend
+@@ -510,14 +507,14 @@
+ cygwin_a:
+ $(MAKE) -C cygwin all
+
+-asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
++asterisk: $(CYGLOADER) editline/libedit.a stdtime/libtime.a $(OBJS)
+ build_tools/make_build_h > include/asterisk/build.h.tmp
+ if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
+ mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
fi
-
--asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
-- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
-+asterisk: editline/libedit.a stdtime/libtime.a $(OBJS)
-+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) stdtime/libtime.a $(LIBS)
+ rm -f include/asterisk/build.h.tmp
+ $(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
+- $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
++ $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) stdtime/libtime.a $(LIBS)
muted: muted.o
- $(CC) -o muted muted.o
-@@ -315,28 +324,28 @@
- $(MAKE) -C stdtime clean
+ $(CC) $(AUDIO_LIBS) -o muted muted.o
+@@ -539,38 +536,38 @@
datafiles: all
+ if [ x`whoami` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
for x in sounds/digits/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
+ for x in sounds/dictate/*.gsm; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
+ else \
+ echo "No description for $$x"; \
+ exit 1; \
+ fi; \
+ done
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
for x in sounds/letters/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
else \
echo "No description for $$x"; \
@@ -202,17 +276,17 @@ $FreeBSD$
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
for x in sounds/phonetic/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
else \
echo "No description for $$x"; \
exit 1; \
-@@ -344,18 +353,18 @@
+@@ -578,18 +575,18 @@
done
- for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
@@ -224,70 +298,80 @@ $FreeBSD$
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images
for x in images/*.jpg; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
done
- mkdir -p $(DESTDIR)$(AGI_DIR)
+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
update:
- @if [ -d CVS ]; then \
-@@ -367,127 +376,90 @@
- fi
+ @if [ -d .svn ]; then \
+@@ -618,75 +615,53 @@
+ OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
bininstall: all
- mkdir -p $(DESTDIR)$(MODULES_DIR)
- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTETCDIR)
- mkdir -p $(DESTDIR)$(ASTBINDIR)
-- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
-- install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
+- if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ $(MKDIR) $(DESTDIR)$(MODULES_DIR)
+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTBINDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR)
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/dictate
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/system
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/tmp
-+ $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/meetme
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/monitor
++ if [ -f asterisk ]; then $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f cygwin/asterisk.exe ]; then $(BSD_INSTALL_PROGRAM) cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f asterisk.dll ]; then $(BSD_INSTALL_PROGRAM) asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
+- $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
+- $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
++ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
-- install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
+ chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
fi
for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
-- install -d $(DESTDIR)$(ASTHEADERDIR)
-- install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm
-- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
-- if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \
-- mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- else \
-- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \
-- fi
-- ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+ if [ -n "$(OLDHEADERS)" ]; then \
+ rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
+ fi
+ rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
+- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
-- install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 asterisk.8.gz $(DESTDIR)$(ASTMANDIR)/man8
-+ ln -sf $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv
++ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
@@ -295,14 +379,16 @@ $FreeBSD$
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
if [ -d contrib/firmware/iax ]; then \
-- install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
else \
echo "You need to do cvs update -d not just cvs update" ; \
fi
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . )
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
- if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
- @echo " +---- Asterisk Installation Complete -------+"
- @echo " + +"
@@ -325,85 +411,74 @@ $FreeBSD$
- @echo " + **Note** This requires that you have +"
- @echo " + doxygen installed on your local system +"
- @echo " +-------------------------------------------+"
-- @echo " + +"
-- @echo " + ** NOTE FOR DOWNGRADING FROM CVS HEAD ** +"
-- @echo " + +"
-- @echo " + If you are downgrading from CVS HEAD to +"
-- @echo " + a stable release, remember to delete +"
-- @echo " + everything from your asterisk modules +"
-- @echo " + directory (/usr/lib/asterisk/modules/) +"
-- @echo " + and the asterisk header directory +"
-- @echo " + (/usr/include/asterisk/) +"
-- @echo " + before doing a '$(MAKE) install'. +"
-- @echo " + +"
-- @echo " +-------------------------------------------+"
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/vm . )
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/voicemail . )
+ @$(MAKE) -s oldmodcheck
+ NEWMODS=$(notdir $(wildcard */*.so))
+@@ -710,7 +685,7 @@
+ echo " WARNING WARNING WARNING" ;\
+ fi
-install: all datafiles bininstall
+install: all datafiles bininstall samples
-
+ @if [ -x /usr/sbin/asterisk-post-install ]; then \
+ /usr/sbin/asterisk-post-install $(DESTDIR) . ; \
+ fi
+@@ -718,16 +693,19 @@
upgrade: all bininstall
- adsi: all
+ adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x`-dist; \
- if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
fi ; \
done
- samples: all datafiles adsi
+ samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
-- for x in configs/*.sample; do \
-- if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
++ echo ADSI INSTALL $(BSD_INSTALL_DATA)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
-+ for x in configs/*.sample channels/h323/*.sample; do \
+ for x in configs/*.sample; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`-dist;\
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+ if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
+ if [ "$(OVERWRITE)" = "y" ]; then \
+ if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
+@@ -740,7 +718,7 @@
+ continue; \
+ fi ;\
fi ; \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
done
-- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-+ echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
-+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist $(DESTDIR)$(ASTETCDIR)/asterisk.conf; \
-+ fi
+ if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ ( \
+@@ -759,25 +737,25 @@
+ echo ";astctlowner = root" ; \
+ echo ";astctlgroup = apache" ; \
+ echo ";astctl = asterisk.ctl" ; \
+- ) > $(DESTDIR)$(ASTCONFPATH) ; \
++ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ else \
+ echo "Skipping asterisk.conf creation"; \
+ fi
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
for x in sounds/demo-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
for x in sounds/*.mp3; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
done
rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3
@@ -412,18 +487,18 @@ $FreeBSD$
:> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
-@@ -502,7 +474,7 @@
- @[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 )
- @[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 )
- install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi
-- mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk
-+ $(MKDIR) $(DESTDIR)$(HTTPDIR)/html/_asterisk
+@@ -791,7 +769,7 @@
+ @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
+ @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
+ $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
+- mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
++ $(MKDIR) $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
for x in images/*.gif; do \
- install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
done
-@@ -522,10 +494,10 @@
+@@ -820,10 +798,10 @@
- __rpm: _version
+ __rpm: include/asterisk/version.h spec
rm -rf /tmp/asterisk ; \
- mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
+ $(MKDIR) /tmp/asterisk/redhat/RPMS/i386 ; \
@@ -431,6 +506,6 @@ $FreeBSD$
$(MAKE) DESTDIR=/tmp/asterisk samples ; \
- mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
+ $(MKDIR) /tmp/asterisk/etc/rc.d/init.d ; \
- cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
- sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
+ cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
+
diff --git a/net/asterisk14/files/patch-agi::Makefile b/net/asterisk14/files/patch-agi::Makefile
index 32efb5d..b359765 100644
--- a/net/asterisk14/files/patch-agi::Makefile
+++ b/net/asterisk14/files/patch-agi::Makefile
@@ -1,9 +1,9 @@
$FreeBSD$
---- agi/Makefile.orig Tue Jun 22 20:42:13 2004
-+++ agi/Makefile Tue Oct 5 21:03:40 2004
-@@ -11,15 +11,18 @@
+--- agi/Makefile.orig Thu Jan 12 15:42:07 2006
++++ agi/Makefile Thu Jan 12 15:44:39 2006
+@@ -11,7 +11,9 @@
# the GNU General Public License
#
@@ -14,14 +14,15 @@ $FreeBSD$
CFLAGS+=
+@@ -27,8 +29,9 @@
all: depend $(AGIS)
install: all
- mkdir -p $(DESTDIR)$(AGI_DIR)
- for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
-+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
++ $(MKDIR) -p $(DESTDIR)$(AGI_DIR)
+ for x in $(AGIS_BIN); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(AGI_DIR) ; done
+ for x in $(AGIS_SCR); do $(BSD_INSTALL_SCRIPT) $$x $(DESTDIR)$(AGI_DIR) ; done
eagi-test: eagi-test.o
- $(CC) $(CFLAGS) -o eagi-test eagi-test.o
+ $(CC) $(CFLAGS) -o eagi-test eagi-test.o $(LIBS)
diff --git a/net/asterisk14/files/patch-apps::Makefile b/net/asterisk14/files/patch-apps::Makefile
index 44f8495..ee7d560 100644
--- a/net/asterisk14/files/patch-apps::Makefile
+++ b/net/asterisk14/files/patch-apps::Makefile
@@ -1,38 +1,56 @@
---- apps/Makefile.orig Wed Jun 22 14:40:11 2005
-+++ apps/Makefile Wed Jun 22 14:43:45 2005
-@@ -40,9 +40,13 @@
+
+$FreeBSD$
+
+--- apps/Makefile.orig
++++ apps/Makefile
+@@ -45,25 +45,27 @@
#APPS+=app_rpt.so
- APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
--APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
- APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi)
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h),)
+ APPS+=app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so
+ endif
+ endif # WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ifdef WITH_FAX
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/spandsp.h ]; then echo "app_rxfax.so app_txfax.so" ; fi)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp.h),)
++APPS+=app_rxfax.so app_txfax.so
++endif
+endif
+
- CFLAGS+=-fPIC
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ APPS+=app_osplookup.so
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+-CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+-CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
+-ifneq ($(shell if [[ 0x`$(CROSS_COMPILE_BIN)curl-config --vernum` -ge 0x70907 ]]; then echo "OK" ; fi),)
+- ifneq (${CURLLIBS},)
+- APPS+=app_curl.so
+- endif
+-endif
++CURLLIBS=$(shell $(CROSS_COMPILE_BIN)$(LOCALBASE)/bin/curl-config --libs)
++APPS+=app_curl.so
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
-@@ -65,12 +69,12 @@
- $(CC) $(SOLINK) -o $@ $< -ltonezone
+ ifeq (${OSARCH},CYGWIN)
+ CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
+@@ -95,24 +97,32 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -ltonezone
install: all
- for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(APPS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
+ rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
- app_voicemail.so : app_voicemail.o
- ifeq ($(USE_MYSQL_VM_INTERFACE),1)
-- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L/usr/lib/mysql -lmysqlclient -lz
-+ $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L$(LOCALBASE)/lib/mysql -lmysqlclient -lz
- else
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lpq
-@@ -79,17 +83,25 @@
- endif
- endif
+ app_curl.so: app_curl.o
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
+ifdef WITH_FAX
+app_rxfax.so : app_rxfax.o
@@ -47,15 +65,15 @@
+ $(CC) -I$(LOCALBASE)/include/pgsql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
app_sql_postgres.so: app_sql_postgres.o
-- $(CC) $(SOLINK) -o $@ $< -L/usr/local/pgsql/lib -lpq
-+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lpq
+- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
++ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L$(LOCALBASE)/lib -lpq
app_sql_odbc.so: app_sql_odbc.o
- $(CC) $(SOLINK) -o $@ $< -lodbc
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
look: look.c
- $(CC) -pipe -O6 -g look.c -o look -lncurses
-+ $(CC) $(CFLAGS) look.c -o look -lncurses
++ $(CC) look.c -o look -lncurses
- ifneq ($(wildcard .depend),)
- include .depend
+ ifeq (SunOS,$(shell uname))
+ app_chanspy.so: app_chanspy.o
diff --git a/net/asterisk14/files/patch-apps::app_rxfax.c b/net/asterisk14/files/patch-apps::app_rxfax.c
index 88362bfc..820208e 100644
--- a/net/asterisk14/files/patch-apps::app_rxfax.c
+++ b/net/asterisk14/files/patch-apps::app_rxfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_rxfax.c.orig
-+++ apps/app_rxfax.c
-@@ -0,0 +1,371 @@
+--- /dev/null Thu Jan 12 17:44:40 2006
++++ apps/app_rxfax.c Thu Jan 12 17:41:53 2006
+@@ -0,0 +1,373 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <asterisk/dsp.h>
+#include <asterisk/manager.h>
++#include <asterisk/version.h>
+#include <string.h>
+#include <stdlib.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
@@ -100,7 +102,7 @@ $FreeBSD$
+ "FaxReceived", "Channel: %s\nExten: %s\nCallerID: %s\nRemoteStationID: %s\nLocalStationID: %s\nPagesTransferred: %i\nResolution: %i\nTransferRate: %i\nFileName: %s\n",
+ chan->name,
+ chan->exten,
-+#if (ASTERISK_VERSION_NUM <= 011000)
++#if ASTERISK_VERSION_NUM <= 010010
+ chan->callerid,
+#else
+ (chan->cid.cid_num) ? chan->cid.cid_num : "",
diff --git a/net/asterisk14/files/patch-apps::app_txfax.c b/net/asterisk14/files/patch-apps::app_txfax.c
index 8daf0f9..15ad667 100644
--- a/net/asterisk14/files/patch-apps::app_txfax.c
+++ b/net/asterisk14/files/patch-apps::app_txfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_txfax.c.orig
-+++ apps/app_txfax.c
-@@ -0,0 +1,293 @@
+--- /dev/null Thu Jan 12 17:48:54 2006
++++ apps/app_txfax.c Thu Jan 12 17:48:36 2006
+@@ -0,0 +1,295 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <string.h>
+#include <stdlib.h>
++#include <math.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
+#include <inttypes.h>
+#else
diff --git a/net/asterisk14/files/patch-astman::Makefile b/net/asterisk14/files/patch-astman::Makefile
deleted file mode 100644
index 2745860..0000000
--- a/net/asterisk14/files/patch-astman::Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-
-$FreeBSD$
-
---- astman/Makefile.orig Sat Jun 26 22:25:39 2004
-+++ astman/Makefile Thu Oct 14 19:14:22 2004
-@@ -5,16 +5,16 @@
-
- OSARCH=$(shell uname -s)
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS+=-I/usr/local/include -L/usr/local/lib
-+CFLAGS+=-I$(LOCALBASE)/include -L$(LOCALBASE)/lib
- endif
-
--TARGET=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else if [ -f /usr/local/include/newt.h ]; then echo "astman"; else echo "none" ; fi ; fi)
-+TARGET=astman
- all: depend $(TARGET)
-
- install:
- if [ "$(TARGET)" != "none" ]; then \
- for x in $(TARGET); do \
-- install -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
-+ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
- done ; \
- fi
-
diff --git a/net/asterisk14/files/patch-cdr::Makefile b/net/asterisk14/files/patch-cdr::Makefile
index 1d0fb20..da16b60 100644
--- a/net/asterisk14/files/patch-cdr::Makefile
+++ b/net/asterisk14/files/patch-cdr::Makefile
@@ -1,51 +1,65 @@
---- cdr/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ cdr/Makefile Tue Aug 9 17:28:11 2005
-@@ -21,7 +21,7 @@
- OSARCH=$(shell uname -s)
-
- ifeq (${OSARCH},FreeBSD)
--SOLINK+=-L/usr/local/lib
-+SOLINK+=-L$(LOCALBASE)/lib
+
+$FreeBSD$
+
+--- cdr/Makefile.orig Tue Nov 29 20:24:39 2005
++++ cdr/Makefile Thu Jan 12 17:56:23 2006
+@@ -21,8 +21,8 @@
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
endif
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
-@@ -37,18 +37,23 @@
+@@ -38,18 +38,18 @@
#
# unixODBC stuff...
#
-+ifdef WITH_ODBC
- MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/odbcinst.h),)
+ MODS+=cdr_odbc.so
+ endif
#
# FreeTDS stuff...
#
-+ifdef WITH_FREETDS
- MODS+=$(shell if [ -f "/usr/include/tds.h" ]; then echo "cdr_tds.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/tds.h" ]; then echo "cdr_tds.so"; fi)
-+endif
-
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h),)
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.63),1)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tds.h),)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.63),1)
+ CFLAGS += -DFREETDS_0_63
+ else
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.62),1)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.62),1)
+ CFLAGS += -DFREETDS_0_62
+ else
+ CFLAGS += -DFREETDS_PRE_0_62
+@@ -61,7 +61,7 @@
#
# PGSQL stuff... Autoconf anyone??
#
-+ifdef WITH_PGSQL
- MODS+=$(shell if [ -d /usr/local/pgsql/include ] || [ -d /usr/include/pgsql ] || [ -d /usr/local/include/pgsql ] || [ -d /opt/pgsql/include ] || [ -f /usr/include/libpq-fe.h ] ; then echo "cdr_pgsql.so"; fi)
- CFLAGS+=$(shell if [ -d /usr/local/pgsql/include ]; then echo "-I/usr/local/pgsql/include"; fi)
- CFLAGS+=$(shell if [ -d /usr/include/pgsql ]; then echo "-I/usr/include/pgsql"; fi)
-@@ -62,16 +67,19 @@
- MLFLAGS+=$(shell if [ -d /usr/local/lib/pgsql ]; then echo "-L/usr/local/lib/pgsql"; fi)
- MLFLAGS+=$(shell if [ -d /opt/pgsql/lib ]; then echo "-L/opt/pgsql/lib"; fi)
- MLFLAGS+=$(shell if [ -f /usr/lib/libpq.so ]; then echo "-L/usr/lib"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
+ MODS+=cdr_pgsql.so
+ endif
- #
- # SQLIte stuff...
- #
-+ifdef WITH_SQLITE
- MODS+=$(shell if [ -f "/usr/include/sqlite.h" ]; then echo "cdr_sqlite.so"; fi)
-+endif
+@@ -82,9 +82,9 @@
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/pgsql
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql),)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/pgsql
+- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib/pgsql
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql),)
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql
++ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/pgsql
+ endif
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include),)
+@@ -110,7 +110,7 @@
all: depend $(MODS)
install: all
diff --git a/net/asterisk14/files/patch-channels::Makefile b/net/asterisk14/files/patch-channels::Makefile
index 7ecab67..edca9b1 100644
--- a/net/asterisk14/files/patch-channels::Makefile
+++ b/net/asterisk14/files/patch-channels::Makefile
@@ -1,97 +1,85 @@
---- channels/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ channels/Makefile Tue Aug 9 17:34:28 2005
-@@ -57,10 +57,10 @@
-
+
+$FreeBSD$
+
+--- channels/Makefile.orig
++++ channels/Makefile
+@@ -48,9 +48,9 @@
endif
+
ifeq (${OSARCH},FreeBSD)
--PTLIB=-lpt_FreeBSD_x86_r
--H323LIB=-lh323_FreeBSD_x86_r
--CHANH323LIB=-pthread
--SOLINK+=-L/usr/local/lib
-+PTLIB=-lpt_FreeBSD_x86_r_s
-+H323LIB=-lh323_FreeBSD_x86_r_s
-+CHANH323LIB=
-+SOLINK+=-L$(LOCALBASE)/lib
+- PTLIB=-lpt_FreeBSD_x86_r
+- H323LIB=-lh323_FreeBSD_x86_r
+- CHANH323LIB=-pthread
++ PTLIB=-lpt_FreeBSD_x86_r_s
++ H323LIB=-lh323_FreeBSD_x86_r_s
++ CHANH323LIB=
endif
+
ifeq (${OSARCH},NetBSD)
- PTLIB=-lpt_NetBSD_x86_r
-@@ -72,19 +72,23 @@
+@@ -73,11 +73,11 @@
+ SOLINK+=-lrt
endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/ixjuser.h ] && echo chan_phone.so)
-+ifdef WITH_H323
-+CHANNEL_LIBS+=chan_h323.so
-+endif
-
- CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
- CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
- CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
--CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
- CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
- CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
--ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
-+ZAPPRI=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo "-lpri")
- ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
-+ifdef WITH_ZAPTEL
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "-DIAX_TRUNKING -I$(LOCALBASE)/include")
-+endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
- CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX")
-
-@@ -106,8 +110,10 @@
-
- ZAPDIR=/usr/lib
-
-+ifdef WITH_ZAPTEL
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so")
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "chan_zap.so")
-+endif
-
- CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/ixjuser.h),)
+ CHANNEL_LIBS+=chan_phone.so
+ endif
-@@ -156,6 +162,8 @@
- chan_oss.so: chan_oss.o
- $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
+-ifneq ($(wildcard h323/libchanh323.a),)
++ifdef WITH_H323
+ CHANNEL_LIBS+=chan_h323.so
endif
-+chan_oss.so: chan_oss.o
-+ $(CC) $(SOLINK) -o $@ chan_oss.o
- chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o
- ifeq ($(USE_MYSQL_FRIENDS),1)
-@@ -175,7 +183,7 @@
- $(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c
+@@ -91,12 +91,12 @@
+ CHANNEL_LIBS+=chan_alsa.so
+ endif
- chan_zap.so: chan_zap.o
-- $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -ltonezone
-+ $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -L$(LOCALBASE)/lib -ltonezone
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libpri.so.1),)
+ CFLAGS+=-DZAPATA_PRI
+ ZAPPRI=-lpri
+ endif
- chan_sip.so: chan_sip.o
- ifeq ($(USE_SIP_MYSQL_FRIENDS),1)
-@@ -199,15 +207,17 @@
- chan_vpb.so: chan_vpb.o
- $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libmfcr2.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libmfcr2.so.1),)
+ CFLAGS+=-DZAPATA_R2
+ ZAPR2=-lmfcr2
+ endif
+@@ -109,12 +109,12 @@
+ endif
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ifeq (${OSARCH},NetBSD)
+ SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/pkg/lib
+ endif
+ ifeq (${OSARCH},FreeBSD)
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ CFLAGS+=-DIAX_TRUNKING
+ CHANNEL_LIBS+=chan_zap.so
+@@ -229,8 +229,10 @@
+ chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast
+ $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
+ else
-chan_h323.so: chan_h323.o h323/libchanh323.a
- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
+chan_h323.so: chan_h323.o h323/ast_h323.o
-+ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -lcrypto -lssl -L$(LOCALBASE)/lib -lexpat -llber -lldap -lldap_r
-
++ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o $(CHANH323LIB) -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L/usr/lib -lcrypto -lssl -lexpat -L$(LOCALBASE)/lib -llber -lldap -lldap_r
+h323/ast_h323.o:
+ $(MAKE) -C h323 ast_h323.o
+ endif
- #chan_modem.so : chan_modem.o
+ chan_misdn.so: chan_misdn.o chan_misdn_config.o misdn/chan_misdn_lib.a
+@@ -244,8 +246,7 @@
# $(CC) -rdynamic -shared -Xlinker -x -o $@ $<
install: all
- for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
+ for x in $(CHANNEL_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
depend: .depend
+
diff --git a/net/asterisk14/files/patch-channels::chan_h323.c b/net/asterisk14/files/patch-channels::chan_h323.c
index de2ed39..6498b97 100644
--- a/net/asterisk14/files/patch-channels::chan_h323.c
+++ b/net/asterisk14/files/patch-channels::chan_h323.c
@@ -1,14 +1,14 @@
$FreeBSD$
---- channels/chan_h323.c 2004/10/10 13:00:17 1.1
-+++ channels/chan_h323.c 2004/10/10 13:00:39
-@@ -26,7 +26,7 @@
- * Version Info: $Id: patch-channels::chan_h323.c,v 1.3.2.3 2004/10/14 14:30:13 sobomax Exp $
- */
+--- channels/chan_h323.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_h323.c Thu Jan 12 18:29:50 2006
+@@ -2281,7 +2281,7 @@ static char *convertcap(int cap)
+ }
+ }
--
-+#include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/signal.h>
- #include <sys/param.h>
+-static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs)
++static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active)
+ {
+ /* XXX Deal with Video */
+ struct oh323_pvt *pvt;
diff --git a/net/asterisk14/files/patch-channels::chan_sip.c b/net/asterisk14/files/patch-channels::chan_sip.c
index e634ce4..355c558 100644
--- a/net/asterisk14/files/patch-channels::chan_sip.c
+++ b/net/asterisk14/files/patch-channels::chan_sip.c
@@ -1,144 +1,131 @@
$FreeBSD$
---- channels/chan_sip.c.orig Sun Feb 17 18:01:43 2002
-+++ channels/chan_sip.c Sun Feb 17 18:10:52 2002
-@@ -141,7 +141,7 @@
+--- channels/chan_sip.c.orig Thu Jan 12 18:43:37 2006
++++ channels/chan_sip.c Thu Jan 12 18:50:11 2006
+@@ -336,7 +336,7 @@ static char global_vmexten[AST_MAX_EXTEN
static char default_language[MAX_LANGUAGE] = "";
--static char default_callerid[AST_MAX_EXTENSION] = "asterisk";
-+static char default_callerid[AST_MAX_EXTENSION] = "Unknown";
+-#define DEFAULT_CALLERID "asterisk"
++#define DEFAULT_CALLERID "Unknown"
+ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID;
static char default_fromdomain[AST_MAX_EXTENSION] = "";
+@@ -474,6 +474,7 @@ struct sip_invite_param {
-@@ -244,6 +244,7 @@
struct sip_route {
struct sip_route *next;
- char hop[0];
+ int lr;
+ char hop[0];
};
- struct sip_history {
-@@ -2218,7 +2219,7 @@
- if (p->owner) {
- /* We already hold the channel lock */
- if (f->frametype == AST_FRAME_VOICE) {
-- if (f->subclass != p->owner->nativeformats) {
-+ if (!(f->subclass & p->owner->nativeformats)) {
- ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
- p->owner->nativeformats = f->subclass;
- ast_set_read_format(p->owner, p->owner->readformat);
-@@ -4620,6 +4621,10 @@
+@@ -5993,6 +5994,7 @@ static void build_route(struct sip_pvt *
/* Make a struct route */
- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
+ thishop = malloc(sizeof(*thishop) + len);
if (thishop) {
-+ if (strnstr(rr, ";lr", len) != NULL)
-+ thishop->lr = 1;
-+ else
-+ thishop->lr = 0;
- strncpy(thishop->hop, rr, len); /* safe */
- thishop->hop[len] = '\0';
++ thishop->lr = (strnstr(rr, ";lr", len) != NULL ? 1 : 0);
+ ast_copy_string(thishop->hop, rr, len);
ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop);
-@@ -4643,31 +4648,41 @@
- rr += len+1;
- }
- }
-- /* 2nd append the Contact: if there is one */
-- /* Can be multiple Contact headers, comma separated values - we just take the first */
-- contact = get_header(req, "Contact");
-- if (!ast_strlen_zero(contact)) {
-- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-- /* Look for <: delimited address */
-- c = strchr(contact, '<');
-- if (c) {
-- /* Take to > */
-- ++c;
-- len = strcspn(c, ">");
-- } else {
-- /* No <> - just take the lot */
-- c = contact; len = strlen(contact);
-- }
-- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ /* Duplicate first route from the list */
-+ if (head && head->lr) {
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
- if (thishop) {
-- strncpy(thishop->hop, c, len); /* safe */
-- thishop->hop[len] = '\0';
-- thishop->next = NULL;
-- /* Goes at the end */
-- if (tail)
-- tail->next = thishop;
-- else
-- head = thishop;
-+ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
-+ thishop->next = head;
-+ head = thishop;
-+ }
-+ } else {
-+ /* Append the Contact: if there is one and first route is w/o `lr' param */
-+ /* Can be multiple Contact headers, comma separated values - we just take the first */
-+ contact = get_header(req, "Contact");
-+ if (!ast_strlen_zero(contact)) {
-+ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-+ /* Look for <: delimited address */
-+ c = strchr(contact, '<');
-+ if (c) {
-+ /* Take to > */
-+ ++c;
-+ len = strcspn(c, ">");
-+ } else {
-+ /* No <> - just take the lot */
-+ c = contact; len = strlen(contact);
-+ }
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ if (thishop) {
-+ strncpy(thishop->hop, c, len); /* safe */
-+ thishop->hop[len] = '\0';
-+ thishop->next = NULL;
-+ /* Goes at the end */
-+ if (tail)
-+ tail->next = thishop;
-+ else
-+ head = thishop;
+ /* Link in */
+@@ -6018,31 +6020,41 @@ static void build_route(struct sip_pvt *
+
+ /* Only append the contact if we are dealing with a strict router */
+ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) {
+- /* 2nd append the Contact: if there is one */
+- /* Can be multiple Contact headers, comma separated values - we just take the first */
+- contact = get_header(req, "Contact");
+- if (!ast_strlen_zero(contact)) {
+- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
+- /* Look for <: delimited address */
+- c = strchr(contact, '<');
+- if (c) {
+- /* Take to > */
+- ++c;
+- len = strcspn(c, ">") + 1;
+- } else {
+- /* No <> - just take the lot */
+- c = contact;
+- len = strlen(contact) + 1;
+- }
+- thishop = malloc(sizeof(*thishop) + len);
++ /* Duplicate first route from the list */
++ if (head && head->lr) {
++ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
+ if (thishop) {
+- ast_copy_string(thishop->hop, c, len);
+- thishop->next = NULL;
+- /* Goes at the end */
+- if (tail)
+- tail->next = thishop;
+- else
+- head = thishop;
++ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
++ thishop->next = head;
++ head = thishop;
+ }
++ } else {
++ /* Append the Contact: if there is one and first route is w/o `lr' param */
++ /* Can be multiple Contact headers, comma separated values - we just take the first */
++ contact = get_header(req, "Contact");
++ if (!ast_strlen_zero(contact)) {
++ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
++ /* Look for <: delimited address */
++ c = strchr(contact, '<');
++ if (c) {
++ /* Take to > */
++ ++c;
++ len = strcspn(c, ">") + 1;
++ } else {
++ /* No <> - just take the lot */
++ c = contact;
++ len = strlen(contact) + 1;
++ }
++ thishop = malloc(sizeof(*thishop) + len);
++ if (thishop) {
++ ast_copy_string(thishop->hop, c, len);
++ thishop->next = NULL;
++ /* Goes at the end */
++ if (tail)
++ tail->next = thishop;
++ else
++ head = thishop;
++ }
+ }
}
}
- /* Store as new route */
-@@ -7338,7 +7353,11 @@
- /* Get destination right away */
- gotdest = get_destination(p, NULL);
- get_rdnis(p, NULL);
-- extract_uri(p, req);
-+ build_route(p, req, 0);
-+ if (!p->route->lr)
-+ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
-+ else
-+ extract_uri(p, req);
- build_contact(p);
+@@ -10336,7 +10348,11 @@ static int handle_request_invite(struct
+ gotdest = get_destination(p, NULL);
- if (gotdest) {
-@@ -7366,7 +7385,6 @@
- c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
- *recount = 1;
- /* Save Record-Route for any later requests we make on this dialogue */
-- build_route(p, req, 0);
- if (c) {
- /* Pre-lock the call */
- ast_mutex_lock(&c->lock);
-@@ -7426,6 +7444,14 @@
- transmit_response(p, "180 Ringing", req);
- break;
- case AST_STATE_UP:
-+ /* Assuming this to be reinvite, process new SDP portion */
-+ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
-+ process_sdp(p, req);
-+ } else {
-+ p->jointcapability = p->capability;
-+ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
-+ }
-+
- transmit_response_with_sdp(p, "200 OK", req, 1);
- break;
- default:
+ get_rdnis(p, NULL);
+- extract_uri(p, req);
++ build_route(p, req, 0);
++ if (!p->route->lr)
++ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
++ else
++ extract_uri(p, req);
+ build_contact(p);
+
+ if (gotdest) {
+@@ -10364,7 +10380,6 @@ static int handle_request_invite(struct
+ c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
+ *recount = 1;
+ /* Save Record-Route for any later requests we make on this dialogue */
+- build_route(p, req, 0);
+ if (c) {
+ /* Pre-lock the call */
+ ast_mutex_lock(&c->lock);
+@@ -10450,6 +10465,13 @@ static int handle_request_invite(struct
+ transmit_response(p, "180 Ringing", req);
+ break;
+ case AST_STATE_UP:
++ /* Assuming this to be reinvite, process new SDP portion */
++ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
++ process_sdp(p, req);
++ } else {
++ p->jointcapability = p->capability;
++ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
++ }
+ transmit_response_with_sdp(p, "200 OK", req, 1);
+ break;
+ default:
diff --git a/net/asterisk14/files/patch-channels::chan_zap.c b/net/asterisk14/files/patch-channels::chan_zap.c
index 458a6147..ab02c02 100644
--- a/net/asterisk14/files/patch-channels::chan_zap.c
+++ b/net/asterisk14/files/patch-channels::chan_zap.c
@@ -1,85 +1,65 @@
$FreeBSD$
---- channels/chan_zap.c.orig Sun Feb 17 18:01:44 2002
-+++ channels/chan_zap.c Sun Feb 17 18:03:26 2002
-@@ -46,7 +46,9 @@
- #include <sys/signal.h>
- #include <errno.h>
- #include <stdlib.h>
-+#ifndef __FreeBSD__
- #include <stdint.h>
-+#endif
- #include <unistd.h>
- #include <sys/ioctl.h>
- #ifdef __linux__
-@@ -320,7 +322,7 @@
- #define CALLWAITING_REPEAT_SAMPLES ( (10000 * 8) / READ_SIZE) /* 300 ms */
- #define CIDCW_EXPIRE_SAMPLES ( (500 * 8) / READ_SIZE) /* 500 ms */
- #define MIN_MS_SINCE_FLASH ( (2000) ) /* 2000 ms */
--#define RINGT ( (8000 * 8) / READ_SIZE)
-+#define RINGT ( (8000 * 8) / READ_SIZE) /* 8000 ms */
-
- struct zt_pvt;
-
-@@ -535,6 +537,7 @@
- int cidpos;
+--- channels/chan_zap.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_zap.c Fri Jan 13 13:28:33 2006
+@@ -638,6 +638,7 @@ static struct zt_pvt {
int cidlen;
int ringt;
+ int ringt_base;
+ int waitnorings;
int stripmsd;
- int callwaiting;
int callwaitcas;
-@@ -2134,12 +2137,20 @@
-
- if (option_debug)
- ast_log(LOG_DEBUG, "zt_hangup(%s)\n", ast->name);
-+
- if (!ast->pvt->pvt) {
- ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
- return 0;
+ int callwaitrings;
+@@ -2308,6 +2309,19 @@ static int zt_hangup(struct ast_channel
}
ast_mutex_lock(&p->lock);
++ switch (p->sig) {
++ case SIG_FXSGS:
++ case SIG_FXSKS:
++ case SIG_FXSLS:
++ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
++ {
++ p->waitnorings = 1;
++ }
++ break;
++ default:
++ break;
++ };
+
-+
-+ if((p->sig == SIG_FXSGS) || (p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS))
-+ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
-+ {
-+ p->waitnorings = 1;
-+ }
index = zt_get_index(ast, p, 1);
-@@ -5717,7 +5728,37 @@
+@@ -6129,7 +6143,37 @@ static void *ss_thread(void *data)
ast_setstate(chan, AST_STATE_RING);
chan->rings = 1;
- p->ringt = RINGT;
+ p->ringt = p->ringt_base;
+ p->waitnorings = 0;
res = ast_pbx_run(chan);
+
+ if(p->waitnorings)
+ {
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+ for(;;)
+ {
+ int i,j=0;
+ i = ZT_IOMUX_SIGEVENT | ZT_IOMUX_NOWAIT;
-+ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
++ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
+ break;
-+
-+ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
++
++ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
+ break;
-+
++
+ if(j == ZT_EVENT_RINGOFFHOOK)
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+
+ usleep(20000);
+
+ if (p->ringt <= 0)
+ break;
+
-+ else if (p->ringt > 0)
++ else if (p->ringt > 0)
+ p->ringt--;
+ }
+ p->ringt = 0;
@@ -89,7 +69,7 @@ $FreeBSD$
if (res) {
ast_hangup(chan);
ast_log(LOG_WARNING, "PBX exited non-zero\n");
-@@ -6018,7 +6059,7 @@
+@@ -6431,7 +6475,7 @@ static void *do_monitor(void *data)
i = iflist;
while(i) {
if ((i->subs[SUB_REAL].zfd > -1) && i->sig && (!i->radio)) {
diff --git a/net/asterisk14/files/patch-channels::h323::Makefile b/net/asterisk14/files/patch-channels::h323::Makefile
deleted file mode 100644
index 779096b..0000000
--- a/net/asterisk14/files/patch-channels::h323::Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-
-$FreeBSD$
-
---- channels/h323/Makefile.orig
-+++ channels/h323/Makefile
-@@ -53,7 +53,7 @@
- LIBS+=-lpthread
- endif
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS += -pthread
-+CFLAGS += $(PTHREAD_LIBS)
- endif
- CFLAGS += -D_REENTRANT -D_GNU_SOURCE
- CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
-@@ -77,20 +77,20 @@
- ar cr libchanh323.a ast_h323.o
-
- ast_h323.o: ast_h323.cpp
-- $(CXX) -g -c -fno-rtti -o $@ $(CFLAGS) $<
-+ $(CXX) $(CXXFLAGS) -c -fno-rtti -o $@ $(CFLAGS) $<
-
- ifneq ($(wildcard .depend),)
- include .depend
- endif
-
- chan_h323.so:
-- $(CXX) -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_d.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_s.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
- clean:
- rm -f *.o *.so core.* libchanh323.a .depend
-
diff --git a/net/asterisk14/files/patch-channels::h323::ast_h323.cpp b/net/asterisk14/files/patch-channels::h323::ast_h323.cpp
new file mode 100644
index 0000000..feb79e5
--- /dev/null
+++ b/net/asterisk14/files/patch-channels::h323::ast_h323.cpp
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.cpp.orig Thu Jan 12 18:16:08 2006
++++ channels/h323/ast_h323.cpp Thu Jan 12 18:16:35 2006
+@@ -953,8 +953,8 @@ BOOL MyH323Connection::OnReceivedCapabil
+ H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capability & capability,
+ H323Channel::Directions dir,
+ unsigned sessionID,
+- const H245_H2250LogicalChannelParameters * /*param*/,
+- RTP_QOS * /*param*/ )
++ const H245_H2250LogicalChannelParameters * /*param*/ /*,
++ RTP_QOS * */ /*param*/ )
+ {
+ return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID);
+ }
diff --git a/net/asterisk14/files/patch-channels::h323::ast_h323.h b/net/asterisk14/files/patch-channels::h323::ast_h323.h
new file mode 100644
index 0000000..606bb01
--- /dev/null
+++ b/net/asterisk14/files/patch-channels::h323::ast_h323.h
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.h.orig Thu Jan 12 18:14:49 2006
++++ channels/h323/ast_h323.h Thu Jan 12 18:15:02 2006
+@@ -155,8 +155,8 @@ class MyH323Connection : public H323Conn
+ H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
+ H323Channel::Directions,
+ unsigned,
+- const H245_H2250LogicalChannelParameters *,
+- RTP_QOS *);
++ const H245_H2250LogicalChannelParameters * /* ,
++ RTP_QOS * */);
+ H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
+ const H323SignalPDU &,
+ H323SignalPDU &);
diff --git a/net/asterisk14/files/patch-codecs::Makefile b/net/asterisk14/files/patch-codecs::Makefile
index 325e590..ab5cbc4 100644
--- a/net/asterisk14/files/patch-codecs::Makefile
+++ b/net/asterisk14/files/patch-codecs::Makefile
@@ -1,39 +1,48 @@
---- codecs/Makefile.orig Thu Mar 17 20:43:51 2005
-+++ codecs/Makefile Thu Apr 14 00:09:04 2005
-@@ -17,25 +17,23 @@
- # g723.1b)
- #
- #MODG723=codec_g723_1.so codec_g723_1b.so
--MODG723=$(shell [ -f g723.1/coder.c ] && echo "codec_g723_1.so")
--MODG723+=$(shell [ -f g723.1b/coder2.c ] && echo "codec_g723_1b.so")
--MODSPEEX=$(shell [ -f /usr/include/speex.h ] || [ -f /usr/include/speex/speex.h ] || [ -f /usr/local/include/speex.h ] || [ -f /usr/local/include/speex/speex.h ] && echo "codec_speex.so")
--MODILBC=$(shell [ -f ilbc/iLBC_decode.h ] && echo "codec_ilbc.so")
-+MODG723=codec_g723_1_dummy.so
-+MODG729=codec_g729_dummy.so
-+MODSPEEX=codec_speex.so
-+MODILBC=codec_ilbc.so
- CFLAGS+=-fPIC
--CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include")
--CFLAGS+=$(shell [ -f /usr/local/include/speex/speex.h ] && echo "-I/usr/local/include/speex")
--CFLAGS+=$(shell [ -f /usr/include/speex/speex.h ] && echo "-I/usr/include/speex")
-+CFLAGS+=-I$(LOCALBASE)/include
+
+$FreeBSD$
+
+--- codecs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ codecs/Makefile Fri Jan 13 10:33:21 2006
+@@ -30,8 +30,8 @@
- LIBG723=g723.1/libg723.a
- LIBG723B=g723.1b/libg723b.a
- LIBGSM=gsm/lib/libgsm.a
- LIBGSMT=gsm/lib/libgsm.a
+ UI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex.h)
+ UIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex/speex.h)
+-ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex.h)
+-ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex/speex.h)
++ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex.h)
++ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex/speex.h)
+ ifneq (${UI_SPEEX},)
+ MODSPEEX=codec_speex.so
+ LIBSPEEX+=-lspeex -lm
+@@ -43,14 +43,14 @@
+ endif
+ ifneq (${ULI_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+ ifneq (${ULIS_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/speex
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+
+@@ -65,7 +65,7 @@
LIBLPC10=lpc10/liblpc10.a
--LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
-+LIBSPEEX=-L$(LOCALBASE)/lib
- LIBSPEEX+=-lspeex -lm
- LIBILBC=ilbc/libilbc.a
--CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
-+CODECS+=$(MODG723) $(MODG729) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
- codec_adpcm.so codec_ulaw.so codec_alaw.so codec_a_mu.so \
- codec_g726.so
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
-@@ -93,7 +91,7 @@
+ CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
+@@ -126,7 +126,7 @@
endif
install: all
diff --git a/net/asterisk14/files/patch-codecs::codec_g723_1_dummy.c b/net/asterisk14/files/patch-codecs::codec_g723_1_dummy.c
deleted file mode 100644
index 3ce9571..0000000
--- a/net/asterisk14/files/patch-codecs::codec_g723_1_dummy.c
+++ /dev/null
@@ -1,314 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g723_1_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g723_1_dummy.c Sun Oct 10 16:07:05 2004
-@@ -0,0 +1,308 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.723.1 (dummy!)
-+ *
-+ * The G.723.1 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#define TYPE_HIGH 0x0
-+#define TYPE_LOW 0x1
-+#define TYPE_SILENCE 0x2
-+#define TYPE_DONTSEND 0x3
-+#define TYPE_MASK 0x3
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g723_ex.h"
-+#include "g723_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.723.1/PCM16 Codec Translator";
-+
-+struct g723_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g723_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g723tolin_new()
-+{
-+ struct g723_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog723_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g723_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g723_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g723_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g723tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G723_1;
-+ f.datalen = sizeof(g723_slin_ex);
-+ /* All frames are 30 ms long */
-+ f.samples = 30;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g723_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog723_new()
-+{
-+ struct g723_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g723tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g723_len(unsigned char buf)
-+{
-+ switch(buf & TYPE_MASK) {
-+ case TYPE_DONTSEND:
-+ return 2;
-+ break;
-+ case TYPE_SILENCE:
-+ return 4;
-+ break;
-+ case TYPE_HIGH:
-+ return 24;
-+ break;
-+ case TYPE_LOW:
-+ return 20;
-+ break;
-+ default:
-+ ast_log(LOG_WARNING, "Badly encoded frame (%d)\n", buf & TYPE_MASK);
-+ }
-+ return -1;
-+}
-+
-+static int g723tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ int len = 0;
-+ int res;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ res = g723_len(((unsigned char *)f->data + len)[0]);
-+ if (res < 0) {
-+ ast_log(LOG_WARNING, "Invalid data\n");
-+ return -1;
-+ }
-+ if (res + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 480 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 480);
-+ tmp->tail+=480;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += res;
-+ }
-+ return 0;
-+}
-+
-+static int lintog723_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog723_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 480)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G723_1;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 480) {
-+ /* Encode a frame of data */
-+ if (cnt + 24 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 24);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 30;
-+ cnt += 24;
-+ tmp->tail -= 480;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 480, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g723_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g723tolin =
-+ { "g723tolin_dummy",
-+ AST_FORMAT_G723_1, AST_FORMAT_SLINEAR,
-+ g723tolin_new,
-+ g723tolin_framein,
-+ g723tolin_frameout,
-+ g723_destroy,
-+ g723tolin_sample
-+ };
-+
-+static struct ast_translator lintog723 =
-+ { "lintog723_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G723_1,
-+ lintog723_new,
-+ lintog723_framein,
-+ lintog723_frameout,
-+ g723_destroy,
-+ lintog723_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog723);
-+ if (!res)
-+ res = ast_unregister_translator(&g723tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g723tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog723);
-+ else
-+ ast_unregister_translator(&g723tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk14/files/patch-codecs::codec_g729_dummy.c b/net/asterisk14/files/patch-codecs::codec_g729_dummy.c
deleted file mode 100644
index 9fcc7b1..0000000
--- a/net/asterisk14/files/patch-codecs::codec_g729_dummy.c
+++ /dev/null
@@ -1,281 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g729_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g729_dummy.c Sun Oct 10 16:07:12 2004
-@@ -0,0 +1,275 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.729 (dummy!)
-+ *
-+ * The G.729 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g729_ex.h"
-+#include "g729_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.729/PCM16 Codec Translator";
-+
-+struct g729_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g729_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g729tolin_new()
-+{
-+ struct g729_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog729_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g729_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g729_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g729_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g729tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G729A;
-+ f.datalen = sizeof(g729_slin_ex);
-+ /* All frames are 10 ms long */
-+ f.samples = 10;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g729_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog729_new()
-+{
-+ struct g729_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g729tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g729tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ int len = 0;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ if (10 + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 160 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 160);
-+ tmp->tail+=160;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += 10;
-+ }
-+ return 0;
-+}
-+
-+static int lintog729_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog729_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 160)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G729A;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 160) {
-+ /* Encode a frame of data */
-+ if (cnt + 10 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 10);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 10;
-+ cnt += 10;
-+ tmp->tail -= 160;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 160, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g729_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g729tolin =
-+ { "g729tolin_dummy",
-+ AST_FORMAT_G729A, AST_FORMAT_SLINEAR,
-+ g729tolin_new,
-+ g729tolin_framein,
-+ g729tolin_frameout,
-+ g729_destroy,
-+ g729tolin_sample
-+ };
-+
-+static struct ast_translator lintog729 =
-+ { "lintog729_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G729A,
-+ lintog729_new,
-+ lintog729_framein,
-+ lintog729_frameout,
-+ g729_destroy,
-+ lintog729_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog729);
-+ if (!res)
-+ res = ast_unregister_translator(&g729tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g729tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog729);
-+ else
-+ ast_unregister_translator(&g729tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk14/files/patch-codecs::g729_slin_ex.h b/net/asterisk14/files/patch-codecs::g729_slin_ex.h
deleted file mode 100644
index 44e60f2..0000000
--- a/net/asterisk14/files/patch-codecs::g729_slin_ex.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/g729_slin_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,14 @@
-+/*
-+ * g729_slin_ex.h --
-+ *
-+ * 8-bit G.729 data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Copyright (C) 2004, Maxim Sobolev <sobomax@FreeBSD.org>
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static unsigned char g729_slin_ex[] = {
-+120,82,175,64,0,250,219,0,7,214
-+};
diff --git a/net/asterisk14/files/patch-codecs::ilbc::Makefile b/net/asterisk14/files/patch-codecs::ilbc::Makefile
index 7770e07..26a2f20 100644
--- a/net/asterisk14/files/patch-codecs::ilbc::Makefile
+++ b/net/asterisk14/files/patch-codecs::ilbc::Makefile
@@ -1,11 +1,12 @@
$FreeBSD$
---- codecs/ilbc/Makefile.orig Sun Apr 27 21:13:11 2003
-+++ codecs/ilbc/Makefile Fri Jan 30 01:47:34 2004
-@@ -1,4 +1,4 @@
--CFLAGS+= -fPIC -O3
-+CFLAGS+= -fPIC
- LIB=libilbc.a
-
- OBJS= anaFilter.o iCBSearch.o packing.o \
+--- codecs/ilbc/Makefile.orig Fri Jan 13 11:01:07 2006
++++ codecs/ilbc/Makefile Fri Jan 13 11:01:51 2006
+@@ -1,5 +1,5 @@
+ ARCH=$(PROC)
+-CFLAGS+=-Wall -O3 -funroll-loops
++CFLAGS+=-Wall -funroll-loops
+ ifneq (${OSARCH},CYGWIN)
+ CFLAGS += -fPIC
+ endif
diff --git a/net/asterisk14/files/patch-codecs::slin_g729_ex.h b/net/asterisk14/files/patch-codecs::slin_g729_ex.h
deleted file mode 100644
index e1236d2..0000000
--- a/net/asterisk14/files/patch-codecs::slin_g729_ex.h
+++ /dev/null
@@ -1,31 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/slin_g729_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,25 @@
-+/*
-+ * slin_g729_ex.h --
-+ *
-+ * Signed 16-bit audio data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Source: g723.example
-+ *
-+ * Copyright (C) 2001, Linux Support Services, Inc.
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static signed short slin_g729_ex[] = {
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-+};
diff --git a/net/asterisk14/files/patch-configs::musiconhold.conf.sample b/net/asterisk14/files/patch-configs::musiconhold.conf.sample
new file mode 100644
index 0000000..ff63cc9
--- /dev/null
+++ b/net/asterisk14/files/patch-configs::musiconhold.conf.sample
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- configs/musiconhold.conf.sample.orig Tue Nov 29 20:24:39 2005
++++ configs/musiconhold.conf.sample Fri Jan 13 11:38:39 2006
+@@ -4,7 +4,7 @@
+
+ [default]
+ mode=quietmp3
+-directory=/var/lib/asterisk/mohmp3
++directory=/usr/local/share/asterisk/mohmp3
+
+ ; valid mode options:
+ ; quietmp3 -- default
diff --git a/net/asterisk14/files/patch-db.c b/net/asterisk14/files/patch-db.c
index 6c2bdcd..ba7f3f2 100644
--- a/net/asterisk14/files/patch-db.c
+++ b/net/asterisk14/files/patch-db.c
@@ -1,14 +1,21 @@
$FreeBSD$
---- db.c.orig Fri Jul 9 13:08:09 2004
-+++ db.c Sun Oct 10 15:32:33 2004
-@@ -33,7 +33,7 @@
- #include <asterisk/cli.h>
- #include <asterisk/utils.h>
- #include <asterisk/lock.h>
--#include "db1-ast/include/db.h"
+--- db.c.orig Fri Jan 13 11:05:32 2006
++++ db.c Fri Jan 13 11:06:55 2006
+@@ -35,6 +35,7 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <dirent.h>
+#include <db.h>
+
#include "asterisk.h"
- #include "astconf.h"
+@@ -51,7 +52,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
+ #include "asterisk/utils.h"
+ #include "asterisk/lock.h"
+ #include "asterisk/manager.h"
+-#include "db1-ast/include/db.h"
+
+ #ifdef __CYGWIN__
+ #define dbopen __dbopen
diff --git a/net/asterisk14/files/patch-formats::Makefile b/net/asterisk14/files/patch-formats::Makefile
index dacfd7b..b2b1db5 100644
--- a/net/asterisk14/files/patch-formats::Makefile
+++ b/net/asterisk14/files/patch-formats::Makefile
@@ -1,19 +1,19 @@
$FreeBSD$
---- formats/Makefile.orig Tue Nov 4 04:40:09 2003
-+++ formats/Makefile Fri Jan 30 01:47:34 2004
-@@ -18,7 +18,7 @@
+--- formats/Makefile.orig Fri Jan 13 11:16:07 2006
++++ formats/Makefile Fri Jan 13 11:47:25 2006
+@@ -20,7 +20,7 @@
#
- # G723 simple frame is depricated
+ # G723 simple frame is deprecated
#
--#FORMAT_LIBS+=format_g723.so
+-FORMAT_LIBS+=format_g723.so
+FORMAT_LIBS+=format_g723_1.so
- GSMLIB=../codecs/gsm/lib/libgsm.a
-
-@@ -40,7 +40,7 @@
- $(CC) $(SOLINK) -o $@ $< -lm
+ #
+ # OGG/Vorbis format
+@@ -60,7 +60,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -logg -lvorbis -lvorbisenc -lm
install: all
- for x in $(FORMAT_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
diff --git a/net/asterisk14/files/patch-formats::format_g723_1.c b/net/asterisk14/files/patch-formats::format_g723_1.c
index fb5eb12..ae814f1 100644
--- a/net/asterisk14/files/patch-formats::format_g723_1.c
+++ b/net/asterisk14/files/patch-formats::format_g723_1.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- formats/format_g723_1.c.orig Sun Oct 10 15:59:18 2004
-+++ formats/format_g723_1.c Sun Oct 10 16:05:05 2004
-@@ -0,0 +1,345 @@
+--- /dev/null Fri Jan 13 12:18:51 2006
++++ formats/format_g723_1.c Fri Jan 13 12:18:41 2006
+@@ -0,0 +1,348 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -16,6 +16,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/channel.h>
+#include <asterisk/file.h>
@@ -26,7 +27,6 @@ $FreeBSD$
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <sys/time.h>
-+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
@@ -48,7 +48,7 @@ $FreeBSD$
+struct ast_filestream {
+ void *reserved[AST_RESERVED_POINTERS];
+ /* This is what a filestream means to us */
-+ int fd; /* Descriptor */
++ FILE *f; /* Descriptor */
+ struct ast_frame fr; /* Frame information */
+ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
+ char empty; /* Empty character */
@@ -85,7 +85,7 @@ $FreeBSD$
+ return -1;
+}
+
-+static struct ast_filestream *g723_open(int fd)
++static struct ast_filestream *g723_open(FILE *f)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -98,7 +98,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ tmp->fr.data = tmp->g723;
+ tmp->fr.frametype = AST_FRAME_VOICE;
+ tmp->fr.subclass = AST_FORMAT_G723_1;
@@ -112,7 +112,7 @@ $FreeBSD$
+ return tmp;
+}
+
-+static struct ast_filestream *g723_rewrite(int fd, char *comment)
++static struct ast_filestream *g723_rewrite(FILE *f, const char *comment)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -125,7 +125,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ glistcnt++;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
@@ -143,7 +143,7 @@ $FreeBSD$
+ glistcnt--;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
-+ close(s->fd);
++ fclose(s->f);
+ free(s);
+ s = NULL;
+}
@@ -158,7 +158,7 @@ $FreeBSD$
+ s->fr.samples = 240;
+ s->fr.mallocd = 0;
+ s->fr.data = s->g723;
-+ if ((res = read(s->fd, s->g723, 1)) != 1) {
++ if ((res = fread(s->g723, 1, 1, s->f)) != 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -168,7 +168,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 frame!\n");
+ return NULL;
+ }
-+ if (s->fr.datalen > 1 && (res = read(s->fd, s->g723 + 1, s->fr.datalen - 1)) != s->fr.datalen - 1) {
++ if (s->fr.datalen > 1 && (res = fread(s->g723 + 1, 1, s->fr.datalen - 1, s->f)) != s->fr.datalen - 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -200,7 +200,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 data length, %d\n", f->datalen);
+ return -1;
+ }
-+ if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
++ if ((res = fwrite(f->data, 1, f->datalen, fs->f)) != f->datalen) {
+ ast_log(LOG_WARNING, "Bad write %d: %s\n", res, strerror(errno));
+ return -1;
+ }
@@ -229,10 +229,13 @@ $FreeBSD$
+ }
+ offset = cur + sample_offset;
+ }
-+ if ((moffset = lseek(fs->fd, 0, SEEK_END)) == -1) {
++ if (fseeko(fs->f, 0, SEEK_END) == -1) {
+ ast_log(LOG_WARNING, "Can't seek stream to an end!\n");
+ return -1;
+ }
++ else {
++ moffset = ftello(fs->f);
++ }
+ if (whence == SEEK_END) {
+ if ((max = g723_tell(fs)) == -1) {
+ ast_log(LOG_WARNING, "Can't get maximum position!\n");
@@ -244,11 +247,11 @@ $FreeBSD$
+ offset = 0;
+ soffset = -1;
+ for (coffset = 0; coffset < moffset && offset > 0; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %lli!\n", coffset);
+ return -1;
+ }
@@ -260,7 +263,7 @@ $FreeBSD$
+ if (res > 1)
+ offset -= 240;
+ }
-+ if (soffset != -1 && lseek(fs->fd, soffset, SEEK_SET) != soffset) {
++ if (soffset != -1 && fseeko(fs->f, soffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", soffset);
+ return -1;
+ }
@@ -271,7 +274,7 @@ $FreeBSD$
+static int g723_trunc(struct ast_filestream *fs)
+{
+ /* Truncate file to current length */
-+ if (ftruncate(fs->fd, lseek(fs->fd, 0, SEEK_CUR)) < 0)
++ if (ftruncate(fileno(fs->f), ftello(fs->f)) < 0)
+ return -1;
+ return 0;
+}
@@ -283,14 +286,14 @@ $FreeBSD$
+ long rval;
+ unsigned char c;
+
-+ offset = lseek(fs->fd, 0, SEEK_CUR);
++ offset = ftello(fs->f);
+ rval = 0;
+ for (coffset = 0; coffset < offset; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %llu!\n", coffset);
+ return -1;
+ }
@@ -301,7 +304,7 @@ $FreeBSD$
+ if (res > 1)
+ rval += 240;
+ }
-+ if (lseek(fs->fd, offset, SEEK_SET) != offset) {
++ if (fseeko(fs->f, offset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", offset);
+ return -1;
+ }
diff --git a/net/asterisk14/files/patch-formats::format_g729.c b/net/asterisk14/files/patch-formats::format_g729.c
index 78899a3..11be528 100644
--- a/net/asterisk14/files/patch-formats::format_g729.c
+++ b/net/asterisk14/files/patch-formats::format_g729.c
@@ -1,6 +1,9 @@
---- formats/format_g729.c.orig Mon Feb 7 10:29:19 2005
-+++ formats/format_g729.c Wed Mar 9 06:26:36 2005
-@@ -44,7 +44,7 @@
+
+$FreeBSD$
+
+--- formats/format_g729.c.orig Fri Jan 13 12:20:53 2006
++++ formats/format_g729.c Fri Jan 13 12:23:33 2006
+@@ -60,7 +60,7 @@ struct ast_filestream {
struct ast_frame fr; /* Frame information */
char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
char empty; /* Empty character */
@@ -9,7 +12,7 @@
};
-@@ -125,11 +125,11 @@
+@@ -141,11 +141,11 @@ static struct ast_frame *g729_read(struc
s->fr.frametype = AST_FRAME_VOICE;
s->fr.subclass = AST_FORMAT_G729A;
s->fr.offset = AST_FRIENDLY_OFFSET;
@@ -19,24 +22,24 @@
+ s->fr.datalen = 10;
s->fr.mallocd = 0;
s->fr.data = s->g729;
-- if ((res = read(s->fd, s->g729, 20)) != 20) {
-+ if ((res = read(s->fd, s->g729, 10)) != 10) {
+- if ((res = fread(s->g729, 1, 20, s->f)) != 20) {
++ if ((res = fread(s->g729, 1, 10, s->f)) != 10) {
if (res && (res != 10))
ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
return NULL;
-@@ -173,7 +173,7 @@
- cur = lseek(fs->fd, 0, SEEK_CUR);
- max = lseek(fs->fd, 0, SEEK_END);
+@@ -190,7 +190,7 @@ static int g729_seek(struct ast_filestre
+ fseek(fs->f, 0, SEEK_END);
+ max = ftell(fs->f);
- bytes = 20 * (sample_offset / 160);
+ bytes = 10 * (sample_offset / 80);
if (whence == SEEK_SET)
offset = bytes;
else if (whence == SEEK_CUR || whence == SEEK_FORCECUR)
-@@ -202,7 +202,7 @@
+@@ -219,7 +219,7 @@ static long g729_tell(struct ast_filestr
{
off_t offset;
- offset = lseek(fs->fd, 0, SEEK_CUR);
+ offset = ftell(fs->f);
- return (offset/20)*160;
+ return (offset/10)*80;
}
diff --git a/net/asterisk14/files/patch-funcs::Makefile b/net/asterisk14/files/patch-funcs::Makefile
new file mode 100644
index 0000000..a14daee
--- /dev/null
+++ b/net/asterisk14/files/patch-funcs::Makefile
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- funcs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ funcs/Makefile Fri Jan 13 12:36:57 2006
+@@ -67,7 +67,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
+
+ install: all
+- for x in $(FUNCS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
++ for x in $(FUNCS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
+
+ ifneq ($(wildcard .depend),)
+ include .depend
diff --git a/net/asterisk14/files/patch-pbx::Makefile b/net/asterisk14/files/patch-pbx::Makefile
index dca6672..97d03e1 100644
--- a/net/asterisk14/files/patch-pbx::Makefile
+++ b/net/asterisk14/files/patch-pbx::Makefile
@@ -1,18 +1,20 @@
$FreeBSD$
---- pbx/Makefile.orig Sun Oct 26 20:50:49 2003
-+++ pbx/Makefile Fri Jan 30 01:47:34 2004
-@@ -16,7 +16,7 @@
- PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so # pbx_gtkconsole.so pbx_kdeconsole.so
-
- # Add GTK console if appropriate
--PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
-+#PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
+--- pbx/Makefile.orig
++++ pbx/Makefile
+@@ -23,8 +23,8 @@
# Add KDE Console if appropriate
#PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so")
-@@ -62,7 +62,7 @@
+-GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
+-GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
++#GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
++#GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
+ MOC=$(QTDIR)/bin/moc
+ KDE_FLAGS=-I$(KDEDIR)/include -I$(KDEDIR)/include/kde -I$(QTDIR)/include
+ KDE_LIBS=-L$(KDEDIR)/lib -L$(QTDIR)/lib -lqt -lkdecore -lkdeui
+@@ -72,7 +72,7 @@
endif
install: all
diff --git a/net/asterisk14/files/patch-pbx::pbx_wilcalu.c b/net/asterisk14/files/patch-pbx::pbx_wilcalu.c
deleted file mode 100644
index 41722c6..0000000
--- a/net/asterisk14/files/patch-pbx::pbx_wilcalu.c
+++ /dev/null
@@ -1,14 +0,0 @@
---- pbx/pbx_wilcalu.c.orig Tue Apr 26 10:00:28 2005
-+++ pbx/pbx_wilcalu.c Tue Apr 26 10:03:42 2005
-@@ -82,6 +82,11 @@
- fds[0].events = POLLIN;
- poll(fds, 1, -1);
- bytes=read(fd,buf,256);
-+ if (bytes <= 0) {
-+ /* XXX error on device, sleep a bit before retrying */
-+ sleep(1);
-+ continue;
-+ }
- buf[(int)bytes]=0;
-
- if(bytes>0){
diff --git a/net/asterisk14/files/patch-res-res_watchdog.c b/net/asterisk14/files/patch-res-res_watchdog.c
deleted file mode 100644
index 51e4b0a..0000000
--- a/net/asterisk14/files/patch-res-res_watchdog.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- res/res_watchdog.c.orig Fri Jul 15 13:24:24 2005
-+++ res/res_watchdog.c Fri Jul 15 13:24:42 2005
-@@ -40,6 +40,10 @@
-
- /* Registrar for operations */
-
-+#ifndef O_SYNC
-+#define O_SYNC O_FSYNC
-+#endif
-+
- static struct watchdog_pvt *watchdogs = NULL;
-
- STANDARD_LOCAL_USER;
diff --git a/net/asterisk14/files/patch-res::Makefile b/net/asterisk14/files/patch-res::Makefile
index 3e48e84..de5c365 100644
--- a/net/asterisk14/files/patch-res::Makefile
+++ b/net/asterisk14/files/patch-res::Makefile
@@ -1,33 +1,35 @@
---- res/Makefile.orig Tue Aug 9 17:18:55 2005
-+++ res/Makefile Tue Aug 9 17:33:36 2005
-@@ -13,15 +13,18 @@
+
+$FreeBSD$
+
+--- res/Makefile
++++ res/Makefile
+@@ -37,8 +37,8 @@
+ endif
- MODS=res_adsi.so res_features.so res_crypto.so res_musiconhold.so res_indications.so res_monitor.so \
- res_agi.so res_watchdog.so
--MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
--MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/include/osp/osp.h" ]; then echo "res_osp.so"; fi)
-
- CRYPTO_LIBS=-lssl -lcrypto
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ ifeq (${OSARCH},CYGWIN)
+@@ -55,9 +55,7 @@
CFLAGS+=
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH")
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPATA_MOH
-+endif
- #
- # Work around buggy RedHat 9.0
+
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
+ CFLAGS+=-DZAPATA_MOH
+-endif
+ endif # WITHOUT_ZAPTEL
+
#
-@@ -34,7 +37,7 @@
+@@ -75,7 +73,7 @@
rm -f $(DESTDIR)$(ASTHEADERDIR)/parking.h
rm -f $(DESTDIR)$(MODULES_DIR)/app_agi.so
rm -f $(DESTDIR)$(MODULES_DIR)/res_parking.so
- for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(MODS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- res_crypto.so: res_crypto.o
- $(CC) $(SOLINK) -o $@ $< $(CRYPTO_LIBS)
+ @if [ x`which mpg123 2>/dev/null | grep -v '^no'` != x ] ; then \
+ if mpg123 --longhelp 2>&1 | grep -q .59r 2>&1 >/dev/null ; then echo ; else \
+ echo "*************************************************************";\
diff --git a/net/asterisk14/files/patch-rtp.c b/net/asterisk14/files/patch-rtp.c
index c652add..bbc2649 100644
--- a/net/asterisk14/files/patch-rtp.c
+++ b/net/asterisk14/files/patch-rtp.c
@@ -1,23 +1,17 @@
---- rtp.c.orig Tue Apr 26 10:00:28 2005
-+++ rtp.c Tue Apr 26 10:06:35 2005
-@@ -127,7 +127,7 @@
- {
- switch(buf & TYPE_MASK) {
- case TYPE_DONTSEND:
-- return 0;
-+ return 2;
- break;
- case TYPE_SILENCE:
- return 4;
-@@ -862,8 +858,10 @@
- /* Must be an even port number by RTP spec */
+
+$FreeBSD$
+
+--- rtp.c.orig Fri Jan 13 13:38:01 2006
++++ rtp.c Fri Jan 13 13:40:50 2006
+@@ -950,8 +950,10 @@ struct ast_rtp *ast_rtp_new_with_bindadd
rtp->us.sin_port = htons(x);
rtp->us.sin_addr = addr;
+ /* If there's rtcp, initialize it as well. */
- if (rtp->rtcp)
+ if (rtp->rtcp) {
rtp->rtcp->us.sin_port = htons(x + 1);
+ rtp->rtcp->us.sin_addr = addr;
+ }
+ /* Try to bind it/them. */
if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) &&
(!rtp->rtcp || !bind(rtp->rtcp->s, (struct sockaddr *)&rtp->rtcp->us, sizeof(rtp->rtcp->us))))
- break;
diff --git a/net/asterisk14/files/patch-utils::Makefile b/net/asterisk14/files/patch-utils::Makefile
new file mode 100644
index 0000000..f3164c0
--- /dev/null
+++ b/net/asterisk14/files/patch-utils::Makefile
@@ -0,0 +1,34 @@
+
+$FreeBSD$
+
+--- utils/Makefile
++++ utils/Makefile
+@@ -17,16 +17,16 @@
+ CFLAGS+=-DNO_AST_MM
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+ TARGET=stereorize streamplayer
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/popt.h),)
+ TARGET+=smsq
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/newt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/newt.h),)
+ TARGET+=astman
+ endif
+
+@@ -40,7 +40,7 @@
+ install:
+ for x in $(TARGET); do \
+ if [ "$$x" != "none" ]; then \
+- $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
++ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
+ fi; \
+ done
+
diff --git a/net/asterisk14/pkg-plist b/net/asterisk14/pkg-plist
index 019b270..702370a 100644
--- a/net/asterisk14/pkg-plist
+++ b/net/asterisk14/pkg-plist
@@ -19,6 +19,12 @@ etc/asterisk/asterisk.adsi-dist
@unexec if cmp -s %D/etc/asterisk/asterisk.conf %D/etc/asterisk/asterisk.conf-dist; then rm -f %D/etc/asterisk/asterisk.conf; fi
etc/asterisk/asterisk.conf-dist
@exec [ -f %B/asterisk.conf ] || cp %B/%f %B/asterisk.conf
+@unexec if cmp -s %D/etc/asterisk/cdr.conf %D/etc/asterisk/cdr.conf-dist; then rm -f %D/etc/asterisk/cdr.conf; fi
+etc/asterisk/cdr.conf-dist
+@exec [ -f %B/cdr.conf ] || cp %B/%f %B/cdr.conf
+@unexec if cmp -s %D/etc/asterisk/cdr_custom.conf %D/etc/asterisk/cdr_custom.conf-dist; then rm -f %D/etc/asterisk/cdr_custom.conf; fi
+etc/asterisk/cdr_custom.conf-dist
+@exec [ -f %B/cdr_custom.conf ] || cp %B/%f %B/cdr_custom.conf
@unexec if cmp -s %D/etc/asterisk/cdr_manager.conf %D/etc/asterisk/cdr_manager.conf-dist; then rm -f %D/etc/asterisk/cdr_manager.conf; fi
etc/asterisk/cdr_manager.conf-dist
@exec [ -f %B/cdr_manager.conf ] || cp %B/%f %B/cdr_manager.conf
@@ -31,9 +37,21 @@ etc/asterisk/cdr_pgsql.conf-dist
@unexec if cmp -s %D/etc/asterisk/cdr_tds.conf %D/etc/asterisk/cdr_tds.conf-dist; then rm -f %D/etc/asterisk/cdr_tds.conf; fi
etc/asterisk/cdr_tds.conf-dist
@exec [ -f %B/cdr_tds.conf ] || cp %B/%f %B/cdr_tds.conf
+@unexec if cmp -s %D/etc/asterisk/codecs.conf %D/etc/asterisk/codecs.conf-dist; then rm -f %D/etc/asterisk/codecs.conf; fi
+etc/asterisk/codecs.conf-dist
+@exec [ -f %B/codecs.conf ] || cp %B/%f %B/codecs.conf
+@unexec if cmp -s %D/etc/asterisk/dnsmgr.conf %D/etc/asterisk/dnsmgr.conf-dist; then rm -f %D/etc/asterisk/dnsmgr.conf; fi
+etc/asterisk/dnsmgr.conf-dist
+@exec [ -f %B/dnsmgr.conf ] || cp %B/%f %B/dmsmgr.conf
+@unexec if cmp -s %D/etc/asterisk/dundi.conf %D/etc/asterisk/dundi.conf-dist; then rm -f %D/etc/asterisk/dundi.conf; fi
+etc/asterisk/dundi.conf-dist
+@exec [ -f %B/dundi.conf ] || cp %B/%f %B/dundi.conf
@unexec if cmp -s %D/etc/asterisk/enum.conf %D/etc/asterisk/enum.conf-dist; then rm -f %D/etc/asterisk/enum.conf; fi
etc/asterisk/enum.conf-dist
@exec [ -f %B/enum.conf ] || cp %B/%f %B/enum.conf
+@unexec if cmp -s %D/etc/asterisk/extensions.ael %D/etc/asterisk/extensions.ael-dist; then rm -f %D/etc/asterisk/extensions.ael; fi
+etc/asterisk/extensions.ael-dist
+@exec [ -f %B/extensions.ael ] || cp %B/%f %B/extensions.ael
@unexec if cmp -s %D/etc/asterisk/extconfig.conf %D/etc/asterisk/extconfig.conf-dist; then rm -f %D/etc/asterisk/extconfig.conf; fi
etc/asterisk/extconfig.conf-dist
@exec [ -f %B/extconfig.conf ] || cp %B/%f %B/extconfig.conf
@@ -46,9 +64,6 @@ etc/asterisk/features.conf-dist
@unexec if cmp -s %D/etc/asterisk/festival.conf %D/etc/asterisk/festival.conf-dist; then rm -f %D/etc/asterisk/festival.conf; fi
etc/asterisk/festival.conf-dist
@exec [ -f %B/festival.conf ] || cp %B/%f %B/festival.conf
-@unexec if cmp -s %D/etc/asterisk/h323.conf %D/etc/asterisk/h323.conf-dist; then rm -f %D/etc/asterisk/h323.conf; fi
-etc/asterisk/h323.conf-dist
-@exec [ -f %B/h323.conf ] || cp %B/%f %B/h323.conf
@unexec if cmp -s %D/etc/asterisk/iax.conf %D/etc/asterisk/iax.conf-dist; then rm -f %D/etc/asterisk/iax.conf; fi
etc/asterisk/iax.conf-dist
@exec [ -f %B/iax.conf ] || cp %B/%f %B/iax.conf
@@ -70,6 +85,9 @@ etc/asterisk/meetme.conf-dist
@unexec if cmp -s %D/etc/asterisk/mgcp.conf %D/etc/asterisk/mgcp.conf-dist; then rm -f %D/etc/asterisk/mgcp.conf; fi
etc/asterisk/mgcp.conf-dist
@exec [ -f %B/mgcp.conf ] || cp %B/%f %B/mgcp.conf
+@unexec if cmp -s %D/etc/asterisk/misdn.conf %D/etc/asterisk/misdn.conf-dist; then rm -f %D/etc/asterisk/misdn.conf; fi
+etc/asterisk/misdn.conf-dist
+@exec [ -f %B/misdn.conf ] || cp %B/%f %B/misdn.conf
@unexec if cmp -s %D/etc/asterisk/modem.conf %D/etc/asterisk/modem.conf-dist; then rm -f %D/etc/asterisk/modem.conf; fi
etc/asterisk/modem.conf-dist
@exec [ -f %B/modem.conf ] || cp %B/%f %B/modem.conf
@@ -94,9 +112,6 @@ etc/asterisk/privacy.conf-dist
@unexec if cmp -s %D/etc/asterisk/queues.conf %D/etc/asterisk/queues.conf-dist; then rm -f %D/etc/asterisk/queues.conf; fi
etc/asterisk/queues.conf-dist
@exec [ -f %B/queues.conf ] || cp %B/%f %B/queues.conf
-@unexec if cmp -s %D/etc/asterisk/res_config_odbc.conf %D/etc/asterisk/res_config_odbc.conf-dist; then rm -f %D/etc/asterisk/res_config_odbc.conf; fi
-etc/asterisk/res_config_odbc.conf-dist
-@exec [ -f %B/res_config_odbc.conf ] || cp %B/%f %B/res_config_odbc.conf
@unexec if cmp -s %D/etc/asterisk/res_odbc.conf %D/etc/asterisk/res_odbc.conf-dist; then rm -f %D/etc/asterisk/res_odbc.conf; fi
etc/asterisk/res_odbc.conf-dist
@exec [ -f %B/res_odbc.conf ] || cp %B/%f %B/res_odbc.conf
@@ -109,6 +124,9 @@ etc/asterisk/rtp.conf-dist
@unexec if cmp -s %D/etc/asterisk/sip.conf %D/etc/asterisk/sip.conf-dist; then rm -f %D/etc/asterisk/sip.conf; fi
etc/asterisk/sip.conf-dist
@exec [ -f %B/sip.conf ] || cp %B/%f %B/sip.conf
+@unexec if cmp -s %D/etc/asterisk/sip_notify.conf %D/etc/asterisk/sip_notify.conf-dist; then rm -f %D/etc/asterisk/sip_notify.conf; fi
+etc/asterisk/sip_notify.conf-dist
+@exec [ -f %B/sip_notify.conf ] || cp %B/%f %B/sip_notify.conf
@unexec if cmp -s %D/etc/asterisk/skinny.conf %D/etc/asterisk/skinny.conf-dist; then rm -f %D/etc/asterisk/skinny.conf; fi
etc/asterisk/skinny.conf-dist
@exec [ -f %B/skinny.conf ] || cp %B/%f %B/skinny.conf
@@ -121,9 +139,6 @@ etc/asterisk/voicemail.conf-dist
@unexec if cmp -s %D/etc/asterisk/vpb.conf %D/etc/asterisk/vpb.conf-dist; then rm -f %D/etc/asterisk/vpb.conf; fi
etc/asterisk/vpb.conf-dist
@exec [ -f %B/vpb.conf ] || cp %B/%f %B/vpb.conf
-@unexec if cmp -s %D/etc/asterisk/watchdog.conf %D/etc/asterisk/watchdog.conf-dist; then rm -f %D/etc/asterisk/watchdog.conf; fi
-etc/asterisk/watchdog.conf-dist
-@exec [ -f %B/watchdog.conf ] || cp %B/%f %B/watchdog.conf
@unexec if cmp -s %D/etc/asterisk/zapata.conf %D/etc/asterisk/zapata.conf-dist; then rm -f %D/etc/asterisk/zapata.conf; fi
etc/asterisk/zapata.conf-dist
@exec [ -f %B/zapata.conf ] || cp %B/%f %B/zapata.conf
@@ -136,28 +151,36 @@ include/asterisk/app.h
include/asterisk/ast_expr.h
include/asterisk/astdb.h
include/asterisk/astmm.h
+include/asterisk/astobj.h
include/asterisk/astosp.h
+include/asterisk/build.h
include/asterisk/callerid.h
include/asterisk/causes.h
include/asterisk/cdr.h
include/asterisk/channel.h
-include/asterisk/channel_pvt.h
+include/asterisk/chanspy.h
include/asterisk/chanvars.h
include/asterisk/cli.h
+include/asterisk/compat.h
include/asterisk/config.h
-include/asterisk/config_pvt.h
+include/asterisk/compiler.h
include/asterisk/crypto.h
-include/asterisk/cvsid.h
+include/asterisk/devicestate.h
include/asterisk/dlfcn-compat.h
include/asterisk/dns.h
+include/asterisk/dnsmgr.h
+include/asterisk/doxyref.h
include/asterisk/dsp.h
+include/asterisk/dundi.h
include/asterisk/enum.h
+include/asterisk/endian.h
include/asterisk/features.h
include/asterisk/file.h
include/asterisk/frame.h
include/asterisk/fskmodem.h
include/asterisk/image.h
include/asterisk/indications.h
+include/asterisk/inline_api.h
include/asterisk/io.h
include/asterisk/linkedlists.h
include/asterisk/localtime.h
@@ -168,38 +191,50 @@ include/asterisk/md5.h
include/asterisk/module.h
include/asterisk/monitor.h
include/asterisk/musiconhold.h
+include/asterisk/netsock.h
include/asterisk/options.h
include/asterisk/pbx.h
+include/asterisk/plc.h
include/asterisk/poll-compat.h
include/asterisk/privacy.h
include/asterisk/res_odbc.h
include/asterisk/rtp.h
include/asterisk/say.h
include/asterisk/sched.h
+include/asterisk/slinfactory.h
include/asterisk/srv.h
+include/asterisk/strings.h
include/asterisk/tdd.h
include/asterisk/term.h
+include/asterisk/time.h
include/asterisk/transcap.h
include/asterisk/translate.h
include/asterisk/ulaw.h
+include/asterisk/unaligned.h
include/asterisk/utils.h
+include/asterisk/version.h
include/asterisk/vmodem.h
lib/asterisk/modules/app_adsiprog.so
lib/asterisk/modules/app_alarmreceiver.so
lib/asterisk/modules/app_authenticate.so
lib/asterisk/modules/app_cdr.so
lib/asterisk/modules/app_chanisavail.so
+lib/asterisk/modules/app_chanspy.so
lib/asterisk/modules/app_controlplayback.so
+lib/asterisk/modules/app_curl.so
lib/asterisk/modules/app_cut.so
lib/asterisk/modules/app_db.so
-lib/asterisk/modules/app_devstate.so
lib/asterisk/modules/app_dial.so
+lib/asterisk/modules/app_dictate.so
+lib/asterisk/modules/app_directed_pickup.so
lib/asterisk/modules/app_directory.so
lib/asterisk/modules/app_disa.so
+lib/asterisk/modules/app_dumpchan.so
lib/asterisk/modules/app_echo.so
lib/asterisk/modules/app_enumlookup.so
lib/asterisk/modules/app_eval.so
lib/asterisk/modules/app_exec.so
+lib/asterisk/modules/app_externalivr.so
lib/asterisk/modules/app_festival.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_flash.so
lib/asterisk/modules/app_forkcdr.so
@@ -208,64 +243,66 @@ lib/asterisk/modules/app_groupcount.so
lib/asterisk/modules/app_hasnewvoicemail.so
lib/asterisk/modules/app_ices.so
lib/asterisk/modules/app_image.so
-lib/asterisk/modules/app_intercom.so
lib/asterisk/modules/app_lookupblacklist.so
lib/asterisk/modules/app_lookupcidname.so
lib/asterisk/modules/app_macro.so
+lib/asterisk/modules/app_math.so
+lib/asterisk/modules/app_md5.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_meetme.so
lib/asterisk/modules/app_milliwatt.so
+lib/asterisk/modules/app_mixmonitor.so
lib/asterisk/modules/app_mp3.so
lib/asterisk/modules/app_nbscat.so
+%%WITH_ZAPTEL%%lib/asterisk/modules/app_page.so
lib/asterisk/modules/app_parkandannounce.so
-lib/asterisk/modules/app_pickup.so
lib/asterisk/modules/app_playback.so
lib/asterisk/modules/app_privacy.so
-lib/asterisk/modules/app_qcall.so
lib/asterisk/modules/app_queue.so
lib/asterisk/modules/app_random.so
lib/asterisk/modules/app_read.so
+lib/asterisk/modules/app_readfile.so
+lib/asterisk/modules/app_realtime.so
lib/asterisk/modules/app_record.so
%%WITH_FAX%%lib/asterisk/modules/app_rxfax.so
lib/asterisk/modules/app_sayunixtime.so
-lib/asterisk/modules/app_segfault.so
lib/asterisk/modules/app_senddtmf.so
lib/asterisk/modules/app_sendtext.so
lib/asterisk/modules/app_setcallerid.so
lib/asterisk/modules/app_setcdruserfield.so
lib/asterisk/modules/app_setcidname.so
lib/asterisk/modules/app_setcidnum.so
+lib/asterisk/modules/app_setrdnis.so
lib/asterisk/modules/app_settransfercapability.so
lib/asterisk/modules/app_sms.so
lib/asterisk/modules/app_softhangup.so
-lib/asterisk/modules/app_striplsd.so
-lib/asterisk/modules/app_substring.so
+lib/asterisk/modules/app_stack.so
lib/asterisk/modules/app_system.so
lib/asterisk/modules/app_talkdetect.so
lib/asterisk/modules/app_test.so
lib/asterisk/modules/app_transfer.so
-lib/asterisk/modules/app_txtcidname.so
%%WITH_FAX%%lib/asterisk/modules/app_txfax.so
+lib/asterisk/modules/app_txtcidname.so
lib/asterisk/modules/app_url.so
lib/asterisk/modules/app_userevent.so
lib/asterisk/modules/app_verbose.so
lib/asterisk/modules/app_voicemail.so
lib/asterisk/modules/app_waitforring.so
+lib/asterisk/modules/app_waitforsilence.so
+lib/asterisk/modules/app_while.so
lib/asterisk/modules/app_zapateller.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapbarge.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapras.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapscan.so
lib/asterisk/modules/cdr_csv.so
+lib/asterisk/modules/cdr_custom.so
lib/asterisk/modules/cdr_manager.so
%%WITH_ODBC%%lib/asterisk/modules/cdr_odbc.so
lib/asterisk/modules/chan_agent.so
+lib/asterisk/modules/chan_features.so
%%WITH_H323%%lib/asterisk/modules/chan_h323.so
lib/asterisk/modules/chan_iax2.so
lib/asterisk/modules/chan_local.so
lib/asterisk/modules/chan_mgcp.so
-lib/asterisk/modules/chan_modem.so
-lib/asterisk/modules/chan_modem_aopen.so
-lib/asterisk/modules/chan_modem_bestdata.so
-lib/asterisk/modules/chan_modem_i4l.so
lib/asterisk/modules/chan_oss.so
lib/asterisk/modules/chan_sip.so
lib/asterisk/modules/chan_skinny.so
@@ -273,14 +310,13 @@ lib/asterisk/modules/chan_skinny.so
lib/asterisk/modules/codec_a_mu.so
lib/asterisk/modules/codec_adpcm.so
lib/asterisk/modules/codec_alaw.so
-lib/asterisk/modules/codec_g723_1_dummy.so
lib/asterisk/modules/codec_g726.so
-lib/asterisk/modules/codec_g729_dummy.so
lib/asterisk/modules/codec_gsm.so
lib/asterisk/modules/codec_ilbc.so
lib/asterisk/modules/codec_lpc10.so
lib/asterisk/modules/codec_speex.so
lib/asterisk/modules/codec_ulaw.so
+lib/asterisk/modules/format_au.so
lib/asterisk/modules/format_g723_1.so
lib/asterisk/modules/format_g726.so
lib/asterisk/modules/format_g729.so
@@ -294,22 +330,34 @@ lib/asterisk/modules/format_sln.so
lib/asterisk/modules/format_vox.so
lib/asterisk/modules/format_wav.so
lib/asterisk/modules/format_wav_gsm.so
+lib/asterisk/modules/func_callerid.so
+lib/asterisk/modules/func_enum.so
+lib/asterisk/modules/func_uri.so
+lib/asterisk/modules/pbx_ael.so
lib/asterisk/modules/pbx_config.so
+lib/asterisk/modules/pbx_dundi.so
+lib/asterisk/modules/pbx_functions.so
+lib/asterisk/modules/pbx_loopback.so
+lib/asterisk/modules/pbx_realtime.so
lib/asterisk/modules/pbx_spool.so
-lib/asterisk/modules/pbx_wilcalu.so
lib/asterisk/modules/res_adsi.so
lib/asterisk/modules/res_agi.so
+lib/asterisk/modules/res_config_odbc.so
lib/asterisk/modules/res_crypto.so
lib/asterisk/modules/res_features.so
lib/asterisk/modules/res_indications.so
lib/asterisk/modules/res_monitor.so
+lib/asterisk/modules/res_odbc.so
lib/asterisk/modules/res_musiconhold.so
-lib/asterisk/modules/res_watchdog.so
sbin/asterisk
sbin/astgenkey
sbin/astman
sbin/autosupport
+sbin/rasterisk
sbin/safe_asterisk
+sbin/smsq
+sbin/stereorize
+sbin/streamplayer
%%DATADIR%%/agi-bin/agi-test.agi
%%DATADIR%%/agi-bin/eagi-sphinx-test
%%DATADIR%%/agi-bin/eagi-test
@@ -330,23 +378,34 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/auth-incorrect.gsm
%%DATADIR%%/sounds/auth-thankyou.gsm
%%DATADIR%%/sounds/beep.gsm
+%%DATADIR%%/sounds/beeperr.gsm
%%DATADIR%%/sounds/conf-adminmenu.gsm
%%DATADIR%%/sounds/conf-enteringno.gsm
%%DATADIR%%/sounds/conf-errormenu.gsm
%%DATADIR%%/sounds/conf-getchannel.gsm
%%DATADIR%%/sounds/conf-getconfno.gsm
%%DATADIR%%/sounds/conf-getpin.gsm
+%%DATADIR%%/sounds/conf-hasjoin.gsm
+%%DATADIR%%/sounds/conf-hasleft.gsm
%%DATADIR%%/sounds/conf-invalid.gsm
%%DATADIR%%/sounds/conf-invalidpin.gsm
%%DATADIR%%/sounds/conf-kicked.gsm
+%%DATADIR%%/sounds/conf-leaderhasleft.gsm
%%DATADIR%%/sounds/conf-locked.gsm
%%DATADIR%%/sounds/conf-lockednow.gsm
%%DATADIR%%/sounds/conf-muted.gsm
%%DATADIR%%/sounds/conf-noempty.gsm
+%%DATADIR%%/sounds/conf-onlyone.gsm
%%DATADIR%%/sounds/conf-onlyperson.gsm
+%%DATADIR%%/sounds/conf-otherinparty.gsm
+%%DATADIR%%/sounds/conf-placeintoconf.gsm
+%%DATADIR%%/sounds/conf-thereare.gsm
%%DATADIR%%/sounds/conf-unlockednow.gsm
%%DATADIR%%/sounds/conf-unmuted.gsm
%%DATADIR%%/sounds/conf-usermenu.gsm
+%%DATADIR%%/sounds/conf-userswilljoin.gsm
+%%DATADIR%%/sounds/conf-userwilljoin.gsm
+%%DATADIR%%/sounds/conf-waitforleader.gsm
%%DATADIR%%/sounds/demo-abouttotry.gsm
%%DATADIR%%/sounds/demo-congrats.gsm
%%DATADIR%%/sounds/demo-echodone.gsm
@@ -357,6 +416,18 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/demo-nogo.gsm
%%DATADIR%%/sounds/demo-nomatch.gsm
%%DATADIR%%/sounds/demo-thanks.gsm
+%%DATADIR%%/sounds/dictate/both_help.gsm
+%%DATADIR%%/sounds/dictate/enter_filename.gsm
+%%DATADIR%%/sounds/dictate/forhelp.gsm
+%%DATADIR%%/sounds/dictate/pause.gsm
+%%DATADIR%%/sounds/dictate/paused.gsm
+%%DATADIR%%/sounds/dictate/play_help.gsm
+%%DATADIR%%/sounds/dictate/playback.gsm
+%%DATADIR%%/sounds/dictate/playback_mode.gsm
+%%DATADIR%%/sounds/dictate/record.gsm
+%%DATADIR%%/sounds/dictate/record_help.gsm
+%%DATADIR%%/sounds/dictate/record_mode.gsm
+%%DATADIR%%/sounds/dictate/truncating_audio.gsm
%%DATADIR%%/sounds/digits/0.gsm
%%DATADIR%%/sounds/digits/1.gsm
%%DATADIR%%/sounds/digits/10.gsm
@@ -445,6 +516,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/dir-intro.gsm
%%DATADIR%%/sounds/dir-nomatch.gsm
%%DATADIR%%/sounds/dir-nomore.gsm
+%%DATADIR%%/sounds/hello-world.gsm
%%DATADIR%%/sounds/invalid.gsm
%%DATADIR%%/sounds/letters/a.gsm
%%DATADIR%%/sounds/letters/at.gsm
@@ -512,6 +584,10 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/phonetic/x_p.gsm
%%DATADIR%%/sounds/phonetic/y_p.gsm
%%DATADIR%%/sounds/phonetic/z_p.gsm
+%%DATADIR%%/sounds/priv-callee-options.gsm
+%%DATADIR%%/sounds/priv-callpending.gsm
+%%DATADIR%%/sounds/priv-introsaved.gsm
+%%DATADIR%%/sounds/priv-recordintro.gsm
%%DATADIR%%/sounds/privacy-incorrect.gsm
%%DATADIR%%/sounds/privacy-prompt.gsm
%%DATADIR%%/sounds/privacy-thankyou.gsm
@@ -520,10 +596,21 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/queue-holdtime.gsm
%%DATADIR%%/sounds/queue-less-than.gsm
%%DATADIR%%/sounds/queue-minutes.gsm
+%%DATADIR%%/sounds/queue-periodic-announce.gsm
+%%DATADIR%%/sounds/queue-reporthold.gsm
%%DATADIR%%/sounds/queue-seconds.gsm
%%DATADIR%%/sounds/queue-thankyou.gsm
%%DATADIR%%/sounds/queue-thereare.gsm
%%DATADIR%%/sounds/queue-youarenext.gsm
+%%DATADIR%%/sounds/screen-callee-options.gsm
+%%DATADIR%%/sounds/spy-agent.gsm
+%%DATADIR%%/sounds/spy-h323.gsm
+%%DATADIR%%/sounds/spy-iax.gsm
+%%DATADIR%%/sounds/spy-iax2.gsm
+%%DATADIR%%/sounds/spy-mgcp.gsm
+%%DATADIR%%/sounds/spy-sip.gsm
+%%DATADIR%%/sounds/spy-skinny.gsm
+%%DATADIR%%/sounds/spy-zap.gsm
%%DATADIR%%/sounds/ss-noservice.gsm
%%DATADIR%%/sounds/transfer.gsm
%%DATADIR%%/sounds/tt-allbusy.gsm
@@ -531,7 +618,6 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/tt-monkeysintro.gsm
%%DATADIR%%/sounds/tt-somethingwrong.gsm
%%DATADIR%%/sounds/tt-weasels.gsm
-%%DATADIR%%/sounds/vm
%%DATADIR%%/sounds/vm-Cust1.gsm
%%DATADIR%%/sounds/vm-Cust2.gsm
%%DATADIR%%/sounds/vm-Cust3.gsm
@@ -553,6 +639,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-extension.gsm
%%DATADIR%%/sounds/vm-first.gsm
%%DATADIR%%/sounds/vm-for.gsm
+%%DATADIR%%/sounds/vm-forward.gsm
%%DATADIR%%/sounds/vm-forwardoptions.gsm
%%DATADIR%%/sounds/vm-from-extension.gsm
%%DATADIR%%/sounds/vm-from-phonenumber.gsm
@@ -571,10 +658,12 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-mailboxfull.gsm
%%DATADIR%%/sounds/vm-message.gsm
%%DATADIR%%/sounds/vm-messages.gsm
+%%DATADIR%%/sounds/vm-minutes.gsm
%%DATADIR%%/sounds/vm-mismatch.gsm
%%DATADIR%%/sounds/vm-msginstruct.gsm
%%DATADIR%%/sounds/vm-msgsaved.gsm
%%DATADIR%%/sounds/vm-newpassword.gsm
+%%DATADIR%%/sounds/vm-newuser.gsm
%%DATADIR%%/sounds/vm-next.gsm
%%DATADIR%%/sounds/vm-no.gsm
%%DATADIR%%/sounds/vm-nobodyavail.gsm
@@ -592,6 +681,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-reachoper.gsm
%%DATADIR%%/sounds/vm-rec-busy.gsm
%%DATADIR%%/sounds/vm-rec-name.gsm
+%%DATADIR%%/sounds/vm-rec-temp.gsm
%%DATADIR%%/sounds/vm-rec-unv.gsm
%%DATADIR%%/sounds/vm-received.gsm
%%DATADIR%%/sounds/vm-reenterpassword.gsm
@@ -605,6 +695,9 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-sorry.gsm
%%DATADIR%%/sounds/vm-star-cancel.gsm
%%DATADIR%%/sounds/vm-starmain.gsm
+%%DATADIR%%/sounds/vm-tempgreeting.gsm
+%%DATADIR%%/sounds/vm-tempgreeting2.gsm
+%%DATADIR%%/sounds/vm-tempremoved.gsm
%%DATADIR%%/sounds/vm-then-pound.gsm
%%DATADIR%%/sounds/vm-theperson.gsm
%%DATADIR%%/sounds/vm-tocallback.gsm
@@ -624,9 +717,11 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-whichbox.gsm
%%DATADIR%%/sounds/vm-youhave.gsm
%%DATADIR%%/sounds/voicemail
+@dirrm %%DATADIR%%/sounds/dictate
@dirrm %%DATADIR%%/sounds/phonetic
@dirrm %%DATADIR%%/sounds/letters
@dirrm %%DATADIR%%/sounds/digits
+@dirrm %%DATADIR%%/sounds/priv-callerintros
@dirrm %%DATADIR%%/sounds
@dirrm %%DATADIR%%/mohmp3
@dirrm %%DATADIR%%/keys
@@ -641,11 +736,14 @@ sbin/safe_asterisk
@dirrm etc/asterisk
@unexec rm -f %D/%%DATADIR%%/astdb
@cwd /var
-spool/asterisk/vm
spool/asterisk/voicemail/default/1234/busy.gsm
spool/asterisk/voicemail/default/1234/unavail.gsm
@exec mkdir -p %D/log/asterisk/cdr-csv
@exec mkdir -p %D/spool/asterisk/voicemail/default/1234/INBOX
+@dirrm spool/asterisk/dictate
+@dirrm spool/asterisk/meetme
+@dirrm spool/asterisk/monitor
+@dirrm spool/asterisk/system
@dirrm spool/asterisk/voicemail/default/1234/INBOX
@dirrm spool/asterisk/voicemail/default/1234
@dirrm spool/asterisk/voicemail/default
@@ -653,4 +751,5 @@ spool/asterisk/voicemail/default/1234/unavail.gsm
@dirrm spool/asterisk/tmp
@dirrm spool/asterisk
@dirrm log/asterisk/cdr-csv
+@dirrm log/asterisk/cdr-custom
@dirrm log/asterisk
diff --git a/net/asterisk16/Makefile b/net/asterisk16/Makefile
index 276aa57..3cfbf7e 100644
--- a/net/asterisk16/Makefile
+++ b/net/asterisk16/Makefile
@@ -6,30 +6,24 @@
#
PORTNAME= asterisk
-PORTVERSION= 1.0.9
-PORTREVISION= 2
+PORTVERSION= 1.2.1
CATEGORIES= net
MASTER_SITES= http://ftp.digium.com/pub/asterisk/ \
http://ftp.digium.com/pub/asterisk/old-releases/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/ \
ftp://ftp.asterisk.org/pub/telephony/asterisk/old-releases/
-PATCHFILES= ${PORTNAME}-1.0.8-${BRIVER}.patch.gz
-PATCH_SITES= ${MASTER_SITE_LOCAL}
-PATCH_SITE_SUBDIR= fjoe
-PATCH_DIST_STRIP= -p1
-
MAINTAINER= sobomax@FreeBSD.org
COMMENT= An Open Source PBX and telephony toolkit
BUILD_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
LIB_DEPENDS= speex.3:${PORTSDIR}/audio/speex \
- newt.51:${PORTSDIR}/devel/newt
+ newt.51:${PORTSDIR}/devel/newt \
+ curl.3:${PORTSDIR}/ftp/curl
RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123
ONLY_FOR_ARCHS= i386 sparc64 amd64
-BRIVER= bristuff-0.2.0-RC8h
GNU_CONFIGURE= yes
CONFIGURE_WRKSRC= ${WRKSRC}/editline
USE_GMAKE= yes
@@ -44,7 +38,7 @@ MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
OSVERSION=${OSVERSION} \
CXX="${CXX}"
-MAN8= asterisk.8
+MAN8= asterisk.8 astgenkey.8 autosupport.8 safe_asterisk.8
.include <bsd.port.pre.mk>
@@ -68,8 +62,9 @@ MAKE_ENV+= WITH_H323=1
.if defined(WITHOUT_ZAPTEL)
PLIST_SUB+= WITH_ZAPTEL="@comment "
.else
+BUILD_DEPENDS+= libpri>=1.2.0:${PORTSDIR}/misc/libpri \
+ ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
LIB_DEPENDS+= pri.1:${PORTSDIR}/misc/libpri
-BUILD_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
RUN_DEPENDS+= ${LOCALBASE}/include/zaptel.h:${PORTSDIR}/misc/zaptel
PLIST_SUB+= WITH_ZAPTEL=""
MAKE_ENV+= WITH_ZAPTEL=1
@@ -86,10 +81,6 @@ PLIST_SUB+= WITH_ODBC=""
MAKE_ENV+= WITH_ODBC=1
.endif
-.if !defined(WITHOUT_MYSQL)
-USE_MYSQL= yes
-.endif
-
.if defined(WITHOUT_FAX)
PLIST_SUB+= WITH_FAX="@comment "
.else
@@ -99,7 +90,6 @@ PLIST_SUB+= WITH_FAX=""
.endif
post-patch:
- ${CP} ${FILESDIR}/chan_oss.c ${WRKSRC}/channels
${REINPLACE_CMD} -e 's|/var/lib|${PREFIX}/share|g' ${WRKSRC}/configs/musiconhold.conf.sample
.include <bsd.port.post.mk>
diff --git a/net/asterisk16/distinfo b/net/asterisk16/distinfo
index 9ef6daa..9d56959 100644
--- a/net/asterisk16/distinfo
+++ b/net/asterisk16/distinfo
@@ -1,4 +1,3 @@
-MD5 (asterisk-1.0.9.tar.gz) = 0d7f1c680ae53a739f26a069ef8b580a
-SIZE (asterisk-1.0.9.tar.gz) = 9604582
-MD5 (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 42172c5b04af9080f22b883296c34002
-SIZE (asterisk-1.0.8-bristuff-0.2.0-RC8h.patch.gz) = 56589
+MD5 (asterisk-1.2.1.tar.gz) = 04657086791e80f319c0d728af705001
+SHA256 (asterisk-1.2.1.tar.gz) = f0d3ed36353c1f5726225d2794bea7d1d1a92c9e58336b02b293f43dd4b97948
+SIZE (asterisk-1.2.1.tar.gz) = 10517194
diff --git a/net/asterisk16/files/chan_oss.c b/net/asterisk16/files/chan_oss.c
deleted file mode 100644
index 95a9236..0000000
--- a/net/asterisk16/files/chan_oss.c
+++ /dev/null
@@ -1,1327 +0,0 @@
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * Copyright (C) 1999, Mark Spencer
- *
- * Mark Spencer <markster@linux-support.net>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- *
- * FreeBSD changes and multiple device support by Luigi Rizzo, 2005.05.02
- * note-this code best seen with ts=8 (8-spaces tabs) in the editor
- */
-
-#include <asterisk/lock.h>
-#include <asterisk/frame.h>
-#include <asterisk/logger.h>
-#include <asterisk/channel.h>
-#include <asterisk/module.h>
-#include <asterisk/channel_pvt.h>
-#include <asterisk/options.h>
-#include <asterisk/pbx.h>
-#include <asterisk/config.h>
-#include <asterisk/cli.h>
-#include <asterisk/utils.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h> /* for isalnum */
-#ifdef __linux
-#include <linux/soundcard.h>
-#elif defined(__FreeBSD__)
-#include <sys/soundcard.h>
-#else
-#include <soundcard.h>
-#endif
-#include "busy.h"
-#include "ringtone.h"
-#include "ring10.h"
-#include "answer.h"
-
-/*
- * Helper macros to parse config arguments. They will go in a common
- * header file if their usage is globally accepted. In the meantime,
- * we define them here. Typical usage is as below, WITHOUT ; on each line.
- *
- * {
- * M_START(v->name, v->value)
- *
- * M_BOOL("dothis", x->flag1)
- * M_STR("name", x->somestring)
- * M_F("bar", some_c_code)
- * M_END(some_final_statement)
- */
-#define M_START(var, val) \
- char *__s = var; char *__val = val;
-#define M_END(x) x;
-#define M_F(tag, f) if (!strcasecmp((__s), tag)) { f; } else
-#define M_BOOL(tag, dst) M_F(tag, (dst) = ast_true(__val) )
-#define M_UINT(tag, dst) M_F(tag, (dst) = strtoul(__val, NULL, 0) )
-#define M_STR(tag, dst) M_F(tag, strncpy(dst, __val, sizeof(dst) - 1) )
-
-
-/* Which device to use */
-#if defined( __OpenBSD__ ) || defined( __NetBSD__ )
-#define DEV_DSP "/dev/audio"
-#else
-#define DEV_DSP "/dev/dsp"
-#endif
-
-/*
- * Basic mode of operation:
- *
- * we have one keyboard (which receives commands from the keyboard)
- * and multiple headset's connected to audio cards. Headsets are named as
- * the sections of oss.conf
- *
- * At any time, the keyboard is attached to one headset, and you
- * can switch among them using the 'console' command.
- *
- * The following parameters are important for the configuration of
- * the device:
- *
- * FRAME_SIZE the size of an audio frame, in samples.
- * 160 is used almost universally, so you should not change it.
- *
- * FRAGS the argument for the SETFRAGMENT ioctl.
- * Overridden by the 'frags' parameter in oss.conf
- *
- * Bits 0-7 are the base-2 log of the device's block size,
- * bits 16-31 are the number of blocks in the driver's queue.
- * There are a lot of differences in the way this parameter
- * is supported by different drivers, so you may need to
- * experiment a bit with the value.
- * A good default for linux is 30 blocks of 64 bytes, which
- * results in 6 frames of 320 bytes (160 samples).
- * FreeBSD works decently with blocks of 256 or 512 bytes,
- * leaving the number unspecified.
- * Note that this only refers to the device buffer size,
- * this module will then try to keep the lenght of audio
- * buffered within small constraints.
- *
- * QUEUE_SIZE The max number of blocks actually allowed in the device
- * driver's buffer, irrespective of the available number.
- * Overridden by the 'queuesize' parameter in oss.conf
- *
- * Should be >=2, and at most as large as the hw queue above
- * (otherwise it will never be full).
- */
-
-#define FRAME_SIZE 160
-#define QUEUE_SIZE 10
-
-#if defined(__FreeBSD__)
-#define FRAGS 0x8
-#else
-#define FRAGS ( ( (6 * 5) << 16 ) | 0x6 )
-#endif
-
-
-/* Don't switch between read/write modes faster than every 300 ms */
-#define MIN_SWITCH_TIME 300
-
-
-static int usecnt;
-AST_MUTEX_DEFINE_STATIC(usecnt_lock);
-
-static char *desc = "OSS Console Channel Driver";
-static char *tdesc = "OSS Console Channel Driver";
-static char *config = "oss.conf"; /* default config file */
-
-static int oss_debug;
-
-/*
- * Each sound is made of 'datalen' samples of sound, repeated as needed to
- * generate 'samplen' samples of data, then followed by 'silencelen' samples
- * of silence. The loop is repeated if 'repeat' is set.
- */
-struct sound {
- int ind;
- char *desc;
- short *data;
- int datalen;
- int samplen;
- int silencelen;
- int repeat;
-};
-
-static struct sound sounds[] = {
- { AST_CONTROL_RINGING, "RINGING", ringtone, sizeof(ringtone)/2, 16000, 32000, 1 },
- { AST_CONTROL_BUSY, "BUSY", busy, sizeof(busy)/2, 4000, 4000, 1 },
- { AST_CONTROL_CONGESTION, "CONGESTION", busy, sizeof(busy)/2, 2000, 2000, 1 },
- { AST_CONTROL_RING, "RING10", ring10, sizeof(ring10)/2, 16000, 32000, 1 },
- { AST_CONTROL_ANSWER, "ANSWER", answer, sizeof(answer)/2, 2200, 0, 0 },
- { -1, NULL, 0, 0, 0, 0 }, /* end marker */
-};
-
-
-/*
- * descriptor for one of our channels.
- * There is one used for 'default' values (from the [general] entry in
- * the configuration file, and then one instance for each device
- * (the default is cloned from [general], others are only created
- * if the relevant section exists.
- */
-struct chan_oss_pvt {
- struct chan_oss_pvt *next;
-
- char *type;
- char *name;
- /*
- * cursound indicates which in struct sound we play. -1 means nothing,
- * any other value is a valid sound, in which case sampsent indicates
- * the next sample to send in [0..samplen + silencelen]
- * nosound is set to disable the audio data from the channel
- * (so we can play the tones etc.).
- */
- int sndcmd[2]; /* Sound command pipe */
- int cursound; /* index of sound to send */
- int sampsent; /* # of sound samples sent */
- int nosound; /* set to block audio from the PBX */
-
- int total_blocks; /* total blocks in the output device */
- int sounddev;
- enum { M_UNSET, M_FULL, M_READ, M_WRITE } duplex;
- int autoanswer;
- int autohangup;
- int hookstate;
- struct timeval lasttime; /* last setformat */
- char *mixer_cmd; /* initial command to issue to the mixer */
- unsigned int queuesize; /* max fragments in queue */
- unsigned int frags; /* parameter for SETFRAGMENT */
-
- int warned; /* various flags used for warnings */
-#define WARN_used_blocks 1
-#define WARN_speed 2
-#define WARN_frag 4
- int w_errors; /* overfull in the write path */
-
- int silencesuppression;
- int silencethreshold;
- int playbackonly;
- char device[64]; /* device to open */
-
- pthread_t sthread;
-
- struct ast_channel *owner;
- char ext[AST_MAX_EXTENSION];
- char ctx[AST_MAX_EXTENSION];
- char language[MAX_LANGUAGE];
-
- /* buffers used in oss_write */
- char oss_write_buf[FRAME_SIZE*2];
- int oss_write_dst;
- /* buffers used in oss_read - AST_FRIENDLY_OFFSET space for headers
- * plus enough room for a full frame
- */
- char oss_read_buf[FRAME_SIZE * 2 + AST_FRIENDLY_OFFSET];
- int readpos; /* read position above */
- struct ast_frame read_f; /* returned by oss_read */
-};
-
-static struct chan_oss_pvt oss_default = {
- .type = "Console",
- .cursound = -1,
- .sounddev = -1,
- .duplex = M_UNSET, /* XXX check this */
- .autoanswer = 1,
- .autohangup = 1,
- .queuesize = QUEUE_SIZE,
- .frags = FRAGS,
- .silencethreshold = 1000, /* currently unused */
- .ext = "s",
- .ctx = "default",
- .readpos = AST_FRIENDLY_OFFSET, /* start here on reads */
-};
-
-static char *oss_active; /* the active device */
-
-/*
- * returns true if too early to switch
- */
-static int too_early(struct chan_oss_pvt *o)
-{
- struct timeval tv;
- int ms;
- gettimeofday(&tv, NULL);
- ms = (tv.tv_sec - o->lasttime.tv_sec) * 1000 +
- (tv.tv_usec - o->lasttime.tv_usec) / 1000;
- if (ms < MIN_SWITCH_TIME)
- return -1;
- return 0;
-}
-
-/*
- * Returns the number of blocks used in the audio output channel
- */
-static int used_blocks(struct chan_oss_pvt *o)
-{
- struct audio_buf_info info;
-
- if (ioctl(o->sounddev, SNDCTL_DSP_GETOSPACE, &info)) {
- if (! (o->warned & WARN_used_blocks)) {
- ast_log(LOG_WARNING, "Error reading output space\n");
- o->warned |= WARN_used_blocks;
- }
- return 1;
- }
- if (o->total_blocks == 0) {
- if (0) /* debugging */
- ast_log(LOG_WARNING, "fragtotal %d size %d avail %d\n",
- info.fragstotal,
- info.fragsize,
- info.fragments);
- o->total_blocks = info.fragments;
- }
- return o->total_blocks - info.fragments;
-}
-
-static int soundcard_writeframe(struct chan_oss_pvt *o, short *data)
-{
- /* Write an exactly FRAME_SIZE sized frame */
- int res;
-
- /*
- * Nothing complex to manage the audio device queue.
- * If the buffer is full just drop the extra, otherwise write.
- * XXX in some cases it might be useful to write anyways after
- * a number of failures, to restart the output chain.
- */
- res = used_blocks(o);
- if (res > o->queuesize) { /* no room to write a block */
- if (o->w_errors++ == 0 && (oss_debug & 0x4))
- ast_log(LOG_WARNING, "write: used %d blocks (%d)\n",
- res, o->w_errors);
- return 0;
- }
- o->w_errors = 0;
- res = write(o->sounddev, ((void *)data), FRAME_SIZE * 2);
- return res;
-}
-
-/*
- * handler for 'sound writable' events from the sound thread.
- * Builds a frame from the high level description of the sounds,
- * and passes it to the audio device.
- * The actual sound is made of 1 or more sequences of sound samples
- * (s->datalen, repeated to make s->samplen samples) followed by
- * s->silencelen samples of silence. The position in the sequence is stored
- * in o->sampsent, which goes between 0 .. s->samplen+s->silencelen.
- * In case we fail to write a frame, don't update o->sampsent.
- */
-static void send_sound(struct chan_oss_pvt *o)
-{
- short myframe[FRAME_SIZE];
- int ofs, l, start;
- int l_sampsent = o->sampsent;
- struct sound *s;
-
- if (o->cursound < 0) /* no sound to send */
- return;
- s = &sounds[o->cursound];
- for (ofs = 0; ofs < FRAME_SIZE; ofs += l) {
- l = s->samplen - l_sampsent; /* sound available */
- if (l > 0) {
- start = l_sampsent % s->datalen; /* source offset */
- if (l > FRAME_SIZE - ofs) /* don't overflow the frame */
- l = FRAME_SIZE - ofs;
- if (l > s->datalen - start) /* don't overflow the source */
- l = s->datalen - start;
- bcopy(s->data + start, myframe + ofs, l*2);
- if (0)
- ast_log(LOG_WARNING, "send_sound sound %d/%d of %d into %d\n",
- l_sampsent, l, s->samplen, ofs);
- l_sampsent += l;
- } else { /* no sound, maybe some silence */
- static short silence[FRAME_SIZE] = {0, };
-
- l += s->silencelen;
- if (l > 0) {
- if (l > FRAME_SIZE - ofs)
- l = FRAME_SIZE - ofs;
- bcopy(silence, myframe + ofs, l*2);
- l_sampsent += l;
- } else { /* silence is over, restart sound if loop */
- if (s->repeat == 0) { /* last block */
- o->cursound = -1;
- o->nosound = 0; /* allow audio data */
- if (ofs < FRAME_SIZE) /* pad with silence */
- bcopy(silence, myframe + ofs, (FRAME_SIZE - ofs)*2);
- }
- l_sampsent = 0;
- }
- }
- }
- l = soundcard_writeframe(o, myframe);
- if (l > 0)
- o->sampsent = l_sampsent; /* update status */
-}
-
-static void *sound_thread(void *arg)
-{
- char ign[4096];
- struct chan_oss_pvt *o = (struct chan_oss_pvt *)arg;
-
- /* kick the driver by trying to read from it. Ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- for(;;) {
- fd_set rfds, wfds;
- int maxfd, res;
-
- FD_ZERO(&rfds);
- FD_ZERO(&wfds);
- maxfd = o->sndcmd[0]; /* pipe from the main process */
- FD_SET(o->sndcmd[0], &rfds);
- if (!o->owner) { /* no one owns the audio, so we must drain it */
- FD_SET(o->sounddev, &rfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- if (o->cursound > -1) {
- FD_SET(o->sounddev, &wfds);
- if (o->sounddev > maxfd)
- maxfd = o->sounddev;
- }
- /* ast_select emulates linux behaviour in terms of timeout handling */
- res = ast_select(maxfd + 1, &rfds, &wfds, NULL, NULL);
- if (res < 1) {
- ast_log(LOG_WARNING, "select failed: %s\n",
- strerror(errno));
- continue;
- }
- if (FD_ISSET(o->sndcmd[0], &rfds)) {
- /* read which sound to play from the pipe */
- int i, what = -1;
-
- read(o->sndcmd[0], &what, sizeof(what));
- for (i = 0; sounds[i].ind != -1; i++) {
- if (sounds[i].ind == what) {
- o->cursound = i;
- o->sampsent = 0;
- o->nosound = 1; /* block audio from pbx */
- break;
- }
- }
- if (sounds[i].ind == -1)
- ast_log(LOG_WARNING, "invalid sound index: %d\n", what);
- }
- if (FD_ISSET(o->sounddev, &rfds)) { /* read and ignore errors */
- read(o->sounddev, ign, sizeof(ign));
- }
- if (FD_ISSET(o->sounddev, &wfds))
- send_sound(o);
- }
- /* Never reached */
- return NULL;
-}
-
-/*
- * reset and close the device if opened,
- * then open and initialize it in the desired mode,
- * trigger reads and writes so we can start using it.
- */
-static int setformat(struct chan_oss_pvt *o, int mode)
-{
- int fmt, desired, res, fd;
-
- if (o->sounddev >= 0) {
- ioctl(o->sounddev, SNDCTL_DSP_RESET, 0);
- close(o->sounddev);
- o->duplex = M_UNSET;
- }
- fd = o->sounddev = open(o->device, mode |O_NONBLOCK);
- if (o->sounddev < 0) {
- ast_log(LOG_WARNING, "Unable to re-open DSP device: %s\n",
- strerror(errno));
- return -1;
- }
-
- gettimeofday(&o->lasttime, NULL);
- fmt = AFMT_S16_LE;
- res = ioctl(fd, SNDCTL_DSP_SETFMT, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set format to 16-bit signed\n");
- return -1;
- }
- switch (mode) {
- case O_RDWR:
- res = ioctl(fd, SNDCTL_DSP_SETDUPLEX, 0);
- /* Check to see if duplex set (FreeBSD Bug)*/
- res = ioctl(fd, SNDCTL_DSP_GETCAPS, &fmt);
- if (res == 0 && (fmt & DSP_CAP_DUPLEX)) {
- if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Console is full duplex\n");
- o->duplex = M_FULL;
- };
- break;
- case O_WRONLY:
- o->duplex = M_WRITE;
- break;
- case O_RDONLY:
- o->duplex = M_READ;
- break;
- }
-
- fmt = 0;
- res = ioctl(fd, SNDCTL_DSP_STEREO, &fmt);
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- /* 8000 Hz desired */
- desired = 8000;
- fmt = desired;
- res = ioctl(fd, SNDCTL_DSP_SPEED, &fmt);
-
- if (res < 0) {
- ast_log(LOG_WARNING, "Failed to set audio device to mono\n");
- return -1;
- }
- if (fmt != desired) {
- if (!(o->warned & WARN_speed)) {
- ast_log(LOG_WARNING,
- "Requested %d Hz, got %d Hz -- sound may be choppy\n",
- desired, fmt);
- o->warned |= WARN_speed;
- }
- }
- /*
- * on Freebsd, SETFRAGMENT does not work very well on some cards.
- * Default to use 256 bytes, let the user override
- */
- if (o->frags) {
- fmt = o->frags;
- res = ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &fmt);
- if (res < 0) {
- if (!(o->warned & WARN_frag)) {
- ast_log(LOG_WARNING,
- "Unable to set fragment size -- sound may be choppy\n");
- o->warned |= WARN_frag;
- }
- }
- }
- /* XXX on some cards, we need SNDCTL_DSP_SETTRIGGER to start outputting */
- res = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT;
- res = ioctl(fd, SNDCTL_DSP_SETTRIGGER, &res);
- /* it may fail if we are in half duplex, never mind */
- return 0;
-}
-
-/*
- * make sure output mode is available. Returns 0 if done,
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setoutput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_WRITE && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_WRONLY))
- return -1;
- return 0;
-}
-
-/*
- * make sure input mode is available. Returns 0 if done
- * 1 if too early to switch, -1 if error
- */
-static int soundcard_setinput(struct chan_oss_pvt *o, int force)
-{
- if (o->duplex == M_FULL || (o->duplex == M_READ && !force))
- return 0;
- if (!force && too_early(o))
- return 1;
- if (setformat(o, O_RDONLY))
- return -1;
- return 0;
-}
-
-/*
- * some of the standard methods supported by channels.
- */
-static int oss_digit(struct ast_channel *c, char digit)
-{
- /* no better use for received digits than print them */
- ast_verbose( " << Console Received digit %c >> \n", digit);
- return 0;
-}
-
-static int oss_text(struct ast_channel *c, char *text)
-{
- /* print received messages */
- ast_verbose( " << Console Received text %s >> \n", text);
- return 0;
-}
-
-/* Play ringtone 'x' on device 'o' */
-#define RING(o, x) { int what = x; write((o)->sndcmd[1], &what, sizeof(what)); }
-
-/*
- * handler for incoming calls. Either autoanswer, or start ringing
- */
-static int oss_call(struct ast_channel *c, char *dest, int timeout)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame f = { 0, };
-
- ast_verbose( " << Call placed to '%s' on console >> \n", dest);
- if (o->autoanswer) {
- ast_verbose( " << Auto-answered >> \n" );
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_ANSWER;
- ast_queue_frame(c, &f);
- } else {
- ast_verbose(" << Type 'answer' to answer, or use 'autoanswer' for future calls >> \n");
- f.frametype = AST_FRAME_CONTROL;
- f.subclass = AST_CONTROL_RINGING;
- ast_queue_frame(c, &f);
- RING(o, AST_CONTROL_RING);
- }
- return 0;
-}
-
-/*
- * remote side answered the phone
- */
-static int oss_answer(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- ast_verbose( " << Console call has been answered >> \n");
-#if 0
- /* play an answer tone (XXX do we really need it ?) */
- RING(o, AST_CONTROL_ANSWER);
-#endif
- ast_setstate(c, AST_STATE_UP);
- o->cursound = -1;
- o->nosound=0;
- return 0;
-}
-
-static int oss_hangup(struct ast_channel *c)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- o->cursound = -1;
- c->pvt->pvt = NULL;
- o->owner = NULL;
- ast_verbose( " << Hangup on console >> \n");
- ast_mutex_lock(&usecnt_lock); /* XXX not sure why */
- usecnt--;
- ast_mutex_unlock(&usecnt_lock);
- if (o->hookstate) {
- if (o->autoanswer || o->autohangup) {
- /* Assume auto-hangup too */
- o->hookstate = 0;
- } else {
- /* Make congestion noise */
- RING(o, AST_CONTROL_CONGESTION);
- }
- }
- return 0;
-}
-
-/* used for data coming from the network */
-static int oss_write(struct ast_channel *c, struct ast_frame *f)
-{
- int res;
- int src;
- struct chan_oss_pvt *o = c->pvt->pvt;
-
- /* Immediately return if no sound is enabled */
- if (o->nosound)
- return 0;
- /* Stop any currently playing sound */
- o->cursound = -1;
- if (o->duplex != M_FULL && !o->playbackonly) {
- /* XXX check this, looks weird! */
- /* If we're half duplex, we have to switch to read mode
- to honor immediate needs if necessary */
- res = soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set device to input mode\n");
- return -1;
- }
- return 0;
- }
- res = soundcard_setoutput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set output device\n");
- return -1;
- } else if (res > 0) {
- /* The device is still in read mode, and it's too soon to change it,
- so just pretend we wrote it */
- return 0;
- }
- /*
- * we could receive a sample which is not a multiple of our FRAME_SIZE,
- * so we buffer it locally and write to the device in FRAME_SIZE
- * chunks, keeping the residue stored for future use.
- */
- src = 0; /* read position into f->data */
- while ( src < f->datalen ) {
- /* Compute spare room in the buffer */
- int l = sizeof(o->oss_write_buf) - o->oss_write_dst;
-
- if (f->datalen - src >= l) { /* enough to fill a frame */
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- soundcard_writeframe(o, (short *)o->oss_write_buf);
- src += l;
- o->oss_write_dst = 0;
- } else { /* copy residue */
- l = f->datalen - src;
- memcpy(o->oss_write_buf + o->oss_write_dst,
- f->data + src, l);
- src += l; /* but really, we are done */
- o->oss_write_dst += l;
- }
- }
- return 0;
-}
-
-static struct ast_frame *oss_read(struct ast_channel *c)
-{
- int res;
- struct chan_oss_pvt *o = c->pvt->pvt;
- struct ast_frame *f = &o->read_f;
-
- /* prepare a NULL frame in case we don't have enough data to return */
- bzero(f, sizeof(struct ast_frame));
- f->frametype = AST_FRAME_NULL;
- f->src = o->type;
-
- res = soundcard_setinput(o, 0);
- if (res < 0) {
- ast_log(LOG_WARNING, "Unable to set input mode\n");
- return NULL;
- } else if (res > 0) { /* too early to switch ? */
- /* Theoretically shouldn't happen, but anyway, return a NULL frame */
- return f;
- }
-
- res = read(o->sounddev, o->oss_read_buf + o->readpos,
- sizeof(o->oss_read_buf) - o->readpos);
- if (res < 0) /* audio data not ready, return a NULL frame */
- return f;
-
- o->readpos += res;
- if (o->readpos < sizeof(o->oss_read_buf)) /* not enough samples */
- return f;
-
- o->readpos = AST_FRIENDLY_OFFSET; /* reset read pointer for next frame */
- if (c->_state != AST_STATE_UP) /* drop data if frame is not up */
- return f;
- /* ok we can build and deliver the frame to the caller */
- f->frametype = AST_FRAME_VOICE;
- f->subclass = AST_FORMAT_SLINEAR;
- f->samples = FRAME_SIZE;
- f->datalen = FRAME_SIZE * 2;
- f->data = o->oss_read_buf + AST_FRIENDLY_OFFSET;
- f->offset = AST_FRIENDLY_OFFSET;
- return f;
-}
-
-static int oss_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
-{
- struct chan_oss_pvt *o = newchan->pvt->pvt;
- o->owner = newchan;
- return 0;
-}
-
-static int oss_indicate(struct ast_channel *c, int cond)
-{
- struct chan_oss_pvt *o = c->pvt->pvt;
- int res;
-
- switch(cond) {
- case AST_CONTROL_BUSY:
- case AST_CONTROL_CONGESTION:
- case AST_CONTROL_RINGING:
- res = cond;
- break;
- case -1:
- o->cursound = -1;
- return 0;
- default:
- ast_log(LOG_WARNING,
- "Don't know how to display condition %d on %s\n",
- cond, c->name);
- return -1;
- }
- if (res > -1)
- RING(o, res);
- return 0;
-}
-
-static struct ast_channel *oss_new(struct chan_oss_pvt *o,
- char *ext, char *ctx, int state)
-{
- struct ast_channel *c;
- struct ast_channel_pvt *pvt;
-
- c = ast_channel_alloc(1);
- if (c == NULL)
- return NULL;
- snprintf(c->name, sizeof(c->name), "OSS/%s", o->device + 5);
- c->type = o->type;
- c->fds[0] = o->sounddev;
- c->nativeformats = AST_FORMAT_SLINEAR;
- pvt = c->pvt;
- pvt->pvt = o;
-
- /* relevant callbacks */
- pvt->send_digit = oss_digit;
- pvt->send_text = oss_text;
- pvt->hangup = oss_hangup;
- pvt->answer = oss_answer;
- pvt->read = oss_read;
- pvt->call = oss_call;
- pvt->write = oss_write;
- pvt->indicate = oss_indicate;
- pvt->fixup = oss_fixup;
-
-#define S_OVERRIDE(dst, src) \
- { if (src && src[0] != '\0') /* non-empty string */ \
- strncpy((dst), src, sizeof(dst)-1); }
- S_OVERRIDE(c->context, ctx);
- S_OVERRIDE(c->exten, ext);
- S_OVERRIDE(c->language, o->language);
- o->owner = c;
- ast_setstate(c, state);
- ast_mutex_lock(&usecnt_lock);
- usecnt++;
- ast_mutex_unlock(&usecnt_lock);
- ast_update_use_count();
- if (state != AST_STATE_DOWN) {
- if (ast_pbx_start(c)) {
- ast_log(LOG_WARNING, "Unable to start PBX on %s\n", c->name);
- ast_hangup(c);
- o->owner = c = NULL;
- /* XXX what about the channel itself ? */
- /* XXX what about usecnt ? */
- }
- }
- return c;
-}
-
-/*
- * returns a pointer to the descriptor with the given name
- */
-static struct chan_oss_pvt *find_desc(char *dev)
-{
- struct chan_oss_pvt *o;
-
- for (o = oss_default.next; o && strcmp(o->name, dev) != 0; o = o->next)
- ;
- if (o == NULL)
- ast_log(LOG_WARNING, "%s could not find <%s>\n", __func__, dev);
- return o;
-}
-
-static struct ast_channel *oss_request(char *type, int format, void *data)
-{
- struct ast_channel *c;
- struct chan_oss_pvt *o = find_desc(data);
-
- ast_log(LOG_WARNING, "oss_request ty <%s> data 0x%p <%s>\n",
- type, data, (char *)data);
- if (o == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", (char *)data);
- /* XXX we could default to 'dsp' perhaps ? */
- return NULL;
- }
- if ((format & AST_FORMAT_SLINEAR) == 0) {
- ast_log(LOG_NOTICE, "Format 0x%x unsupported\n", format);
- return NULL;
- }
- if (o->owner) {
- ast_log(LOG_NOTICE, "Already have a call on the OSS channel\n");
- return NULL;
- }
- c= oss_new(o, NULL, NULL, AST_STATE_DOWN);
- if (c == NULL) {
- ast_log(LOG_WARNING, "Unable to create new OSS channel\n");
- return NULL;
- }
- return c;
-}
-
-static int console_autoanswer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o == NULL) {
- ast_log(LOG_WARNING, "Cannot find device %s (should not happen!)\n",
- oss_active);
- return RESULT_FAILURE;
- }
- if (argc == 1) {
- ast_cli(fd, "Auto answer is %s.\n", o->autoanswer ? "on" : "off");
- return RESULT_SUCCESS;
- }
- if (!strcasecmp(argv[1], "on"))
- o->autoanswer = -1;
- else if (!strcasecmp(argv[1], "off"))
- o->autoanswer = 0;
- else
- return RESULT_SHOWUSAGE;
- return RESULT_SUCCESS;
-}
-
-static char *autoanswer_complete(char *line, char *word, int pos, int state)
-{
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
- int l = strlen(word);
-
- switch(state) {
- case 0:
- if (l && !strncasecmp(word, "on", MIN(l, 2)))
- return strdup("on");
- case 1:
- if (l && !strncasecmp(word, "off", MIN(l, 3)))
- return strdup("off");
- default:
- return NULL;
- }
- return NULL;
-}
-
-static char autoanswer_usage[] =
-"Usage: autoanswer [on|off]\n"
-" Enables or disables autoanswer feature. If used without\n"
-" argument, displays the current on/off status of autoanswer.\n"
-" The default value of autoanswer is in 'oss.conf'.\n";
-
-/*
- * answer command from the console
- */
-static int console_answer(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 1;
- o->cursound = -1;
- ast_queue_frame(o->owner, &f);
- RING(o, AST_CONTROL_ANSWER);
- return RESULT_SUCCESS;
-}
-
-static char sendtext_usage[] =
-"Usage: send text <message>\n"
-" Sends a text message for display on the remote terminal.\n";
-
-static int console_sendtext(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- int tmparg = 2;
- char text2send[256] = "";
- struct ast_frame f = { 0, };
-
- if (argc < 2)
- return RESULT_SHOWUSAGE;
- if (!o->owner) {
- ast_cli(fd, "No one is calling us\n");
- return RESULT_FAILURE;
- }
- if (strlen(text2send))
- ast_cli(fd, "Warning: message already waiting to be sent, overwriting\n");
- text2send[0] = '\0';
- while(tmparg < argc) {
- strncat(text2send, argv[tmparg++], sizeof(text2send) - strlen(text2send) - 1);
- strncat(text2send, " ", sizeof(text2send) - strlen(text2send) - 1);
- }
- if (strlen(text2send)) {
- f.frametype = AST_FRAME_TEXT;
- f.subclass = 0;
- f.data = text2send;
- f.datalen = strlen(text2send);
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-static char answer_usage[] =
-"Usage: answer\n"
-" Answers an incoming call on the console (OSS) channel.\n";
-
-static int console_hangup(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner && !o->hookstate) {
- ast_cli(fd, "No call to hangup up\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) {
- ast_queue_hangup(o->owner);
- }
- return RESULT_SUCCESS;
-}
-
-static char hangup_usage[] =
-"Usage: hangup\n"
-" Hangs up any call currently placed on the console.\n";
-
-
-static int console_flash(int fd, int argc, char *argv[])
-{
- struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_FLASH };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if (argc != 1)
- return RESULT_SHOWUSAGE;
- o->cursound = -1;
- if (!o->owner) { /* XXX maybe !o->hookstate too ? */
- ast_cli(fd, "No call to flash\n");
- return RESULT_FAILURE;
- }
- o->hookstate = 0;
- if (o->owner) { /* XXX must be true, right ? */
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
-}
-
-
-static char flash_usage[] =
-"Usage: flash\n"
-" Flashes the call currently placed on the console.\n";
-
-
-
-static int console_dial(int fd, int argc, char *argv[])
-{
- char *tmp = NULL, *mye = NULL, *myc = NULL;
- int i;
- struct ast_frame f = { AST_FRAME_DTMF, 0 };
- struct chan_oss_pvt *o = find_desc(oss_active);
-
- if ((argc != 1) && (argc != 2))
- return RESULT_SHOWUSAGE;
- if (o->owner) { /* already in a call */
- if (argc == 1) { /* argument is mandatory here */
- ast_cli(fd, "Already in a call. You can only dial digits until you hangup.\n");
- return RESULT_FAILURE;
- }
- mye = argv[1];
- /* send the string one char at a time */
- for (i=0; i<strlen(mye); i++) {
- f.subclass = mye[i];
- ast_queue_frame(o->owner, &f);
- }
- return RESULT_SUCCESS;
- }
- /* if we have an argument split it into extension and context */
-
- if (argc == 2) {
- tmp = myc = strdup(argv[1]); /* make a writable copy */
- mye = strsep(&myc, "@"); /* set exten, advance to context */
- myc = strsep(&myc, "@"); /* set context */
- }
- /* supply default values if needed */
- if (mye == NULL)
- mye = o->ext;
- if (myc == NULL)
- myc = o->ctx;
- if (ast_exists_extension(NULL, myc, mye, 1, NULL)) {
- o->hookstate = 1;
- oss_new(o, mye, myc, AST_STATE_RINGING);
- } else
- ast_cli(fd, "No such extension '%s' in context '%s'\n", mye, myc);
- return RESULT_SUCCESS;
-}
-
-static char dial_usage[] =
-"Usage: dial [extension[@context]]\n"
-" Dials a given extensison (and context if specified)\n";
-
-static int console_transfer(int fd, int argc, char *argv[])
-{
- struct chan_oss_pvt *o = find_desc(oss_active);
- struct ast_channel *b = NULL;
- char *ext, *ctx;
-
- if (argc != 2)
- return RESULT_SHOWUSAGE;
- if (o == NULL)
- return RESULT_FAILURE;
- if (o->owner == NULL || (b = o->owner->bridge) == NULL) {
- ast_cli(fd, "There is no call to transfer\n");
- return RESULT_SUCCESS;
- }
-
- ext = ctx = strdup(argv[1]); /* make a writable copy */
- strsep(&ctx, "@"); /* set exten, advance to context */
- ctx = strsep(&ctx, "@"); /* strip trailing @ and the rest */
-
- if (ctx == NULL) /* supply default context if needed */
- ctx = o->owner->context;
- if (!ast_exists_extension(b, ctx, ext, 1, b->callerid)) {
- ast_cli(fd, "No such extension exists\n");
- } else {
- ast_cli(fd, "Whee, transferring %s to %s@%s.\n", b->name, ext, ctx);
- if (ast_async_goto(b, ctx, ext, 1))
- ast_cli(fd, "Failed to transfer :(\n");
- }
- free(ext);
- return RESULT_SUCCESS;
-}
-
-static char transfer_usage[] =
-"Usage: transfer <extension>[@context]\n"
-" Transfers the currently connected call to the given extension (and\n"
-"context if specified)\n";
-
-static int console_active(int fd, int argc, char *argv[])
-{
- if (argc == 1) {
- ast_cli(fd, "active console is [%s]\n", oss_active);
- } else if (argc != 2) {
- return RESULT_SHOWUSAGE;
- } else {
- struct chan_oss_pvt *o;
- if (strcmp(argv[1], "show") == 0) {
- for (o = oss_default.next; o ; o = o->next)
- ast_cli(fd, "device [%s] exists\n", o->name);
- return RESULT_SUCCESS;
- }
- o = find_desc(argv[1]);
- if (o == NULL)
- ast_cli(fd, "No device [%s] exists\n", argv[1]);
- else
- oss_active = o->name;
- }
- return RESULT_SUCCESS;
-}
-
-static struct ast_cli_entry myclis[] = {
- { { "answer", NULL }, console_answer, "Answer an incoming console call", answer_usage },
- { { "hangup", NULL }, console_hangup, "Hangup a call on the console", hangup_usage },
- { { "flash", NULL }, console_flash, "Flash a call on the console", flash_usage },
- { { "dial", NULL }, console_dial, "Dial an extension on the console", dial_usage },
- { { "transfer", NULL }, console_transfer, "Transfer a call to a different extension", transfer_usage },
- { { "send", "text", NULL }, console_sendtext, "Send text to the remote device", sendtext_usage },
- { { "autoanswer", NULL }, console_autoanswer, "Sets/displays autoanswer", autoanswer_usage, autoanswer_complete },
- { { "console", NULL }, console_active, "Sets/displays active console",
- "console foo sets foo as the console"}
-};
-
-/*
- * store the mixer argument from the config file, filtering possibly
- * invalid or dangerous values (the string is used as argument for
- * system("mixer %s")
- */
-static void store_mixer(struct chan_oss_pvt *o, char *s)
-{
- int i;
-
- for (i=0; i < strlen(s); i++) {
- 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;
- }
- }
- if (o->mixer_cmd)
- free(o->mixer_cmd);
- o->mixer_cmd = strdup(s);
- ast_log(LOG_WARNING, "setting mixer %s\n", s);
-}
-
-/*
- * grab fields from the config file, init the descriptor and open the device.
- */
-static struct chan_oss_pvt * store_config(struct ast_config *cfg,
- char *ctg)
-{
- struct ast_variable *v;
- struct chan_oss_pvt *o;
-
- if (ctg == NULL) {
- o = &oss_default;
- o->next = NULL; /* XXX needed ? */
- ctg = "general";
- } else {
- o = (struct chan_oss_pvt *)malloc(sizeof *o);
- if (o == NULL) /* fail */
- return NULL;
- *o = oss_default;
- /* "general" is also the default thing */
- if (strcmp(ctg, "general") == 0) {
- o->name = strdup("dsp");
- oss_active = o->name;
- goto openit;
- }
- o->name = strdup(ctg);
- }
- ast_log(LOG_WARNING, "found category [%s]\n", ctg);
-
- /* fill other fields from configuration */
- v = ast_variable_browse(cfg, ctg);
- while(v) {
- M_START(v->name, v->value);
-
- M_BOOL("autoanswer", o->autoanswer)
- M_BOOL("autohangup", o->autohangup)
- M_BOOL("playbackonly", o->playbackonly)
- M_BOOL("silencesuppression", o->silencesuppression)
- M_UINT("silencethreshold", o->silencethreshold )
- M_STR("device", o->device)
- M_UINT("frags", o->frags)
- M_UINT("debug", oss_debug)
- M_UINT("queuesize", o->queuesize)
- M_STR("context", o->ctx)
- M_STR("language", o->language)
- M_STR("extension", o->ext)
- M_F("mixer", store_mixer(o, v->value))
- M_END(;);
- v=v->next;
- }
- if (!strlen(o->device))
- strncpy(o->device, DEV_DSP, sizeof(o->device)-1);
- if (o->mixer_cmd) {
- char *cmd;
-
- asprintf(&cmd, "mixer %s", o->mixer_cmd);
- ast_log(LOG_WARNING, "running [%s]\n", cmd);
- system(cmd);
- free(cmd);
- }
- if (o == &oss_default) /* we are done with the default */
- return NULL;
-
-openit:
- if (setformat(o, O_RDWR) < 0) { /* open device */
- if (option_verbose > 0) {
- ast_verbose(VERBOSE_PREFIX_2 "Device %s not detected\n", ctg);
- ast_verbose(VERBOSE_PREFIX_2 "Turn off OSS support by adding "
- "'noload=chan_oss.so' in /etc/asterisk/modules.conf\n");
- }
- goto error;
- }
- soundcard_setinput(o, 1); /* force set if not full_duplex */
- if (o->duplex != M_FULL)
- ast_log(LOG_WARNING, "XXX I don't work right with non "
- "full-duplex sound cards XXX\n");
- if ( pipe(o->sndcmd) != 0 ) {
- ast_log(LOG_ERROR, "Unable to create pipe\n");
- goto error;
- }
- ast_pthread_create(&o->sthread, NULL, sound_thread, o);
- /* link into list of devices */
- if (o != &oss_default) {
- o->next = oss_default.next;
- oss_default.next = o;
- }
- return o;
-
-error:
- if (o != &oss_default)
- free(o);
- return NULL;
-}
-
-int load_module()
-{
- int i;
- struct ast_config *cfg;
-
- /* load config file */
- cfg = ast_load(config);
- if (cfg != NULL) {
- char *ctg;
-
- store_config(cfg, NULL); /* init general category */
- ctg = ast_category_browse(cfg, NULL); /* initial category */
- while (ctg != NULL) {
- store_config(cfg, ctg);
- ctg = ast_category_browse(cfg, ctg);
- }
- ast_destroy(cfg);
- }
- if (find_desc(oss_active) == NULL) {
- ast_log(LOG_NOTICE, "Device %s not found\n", oss_active);
- /* XXX we could default to 'dsp' perhaps ? */
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- i = ast_channel_register(oss_default.type, tdesc,
- AST_FORMAT_SLINEAR, oss_request);
- if (i < 0) {
- ast_log(LOG_ERROR, "Unable to register channel class '%s'\n",
- oss_default.type);
- /* XXX should cleanup allocated memory etc. */
- return -1;
- }
- for (i=0; i<sizeof(myclis)/sizeof(struct ast_cli_entry); i++)
- ast_cli_register(myclis + i);
- return 0;
-}
-
-
-int unload_module()
-{
- int x;
- struct chan_oss_pvt *o;
-
- /* XXX do we need a ast_channel_unregister oss_request ? */
- for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++)
- ast_cli_unregister(myclis + x);
-
- for (o = oss_default.next; o ; o = o->next) {
- close(o->sounddev);
- if (o->sndcmd[0] > 0) {
- close(o->sndcmd[0]);
- close(o->sndcmd[1]);
- }
- if (o->owner)
- ast_softhangup(o->owner, AST_SOFTHANGUP_APPUNLOAD);
- if (o->owner) /* XXX how ??? */
- return -1;
- /* XXX what about the thread ? */
- /* XXX what about the memory allocated ? */
- }
- return 0;
-}
-
-char *description()
-{
- return desc;
-}
-
-int usecount() /* XXX is this per-device or global for the module ? */
-{
- int res;
- ast_mutex_lock(&usecnt_lock);
- res = usecnt;
- ast_mutex_unlock(&usecnt_lock);
- return res;
-}
-
-char *key()
-{
- return ASTERISK_GPL_KEY;
-}
diff --git a/net/asterisk16/files/patch-Makefile b/net/asterisk16/files/patch-Makefile
index 49c66ed..16f6b03 100644
--- a/net/asterisk16/files/patch-Makefile
+++ b/net/asterisk16/files/patch-Makefile
@@ -3,128 +3,200 @@ $FreeBSD$
--- Makefile.orig
+++ Makefile
-@@ -45,6 +45,19 @@
- PROC=$(shell uname -m)
- endif
-
-+ifeq (${OSARCH},FreeBSD)
-+ifeq ($(PROC),sparc64)
-+PROC=ultrasparc
-+OPTIONS+=$(shell if $(CC) -mtune=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mtune=$(PROC)"; fi)
-+OPTIONS+=$(shell if $(CC) -mcpu=v9 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mcpu=v9"; fi)
-+OPTIONS+=-fomit-frame-pointer
-+endif
-+ifeq ($(PROC),amd64)
-+PROC=k8
-+OPTIONS+=-m64
-+endif
-+endif
-+
- # Pentium Pro Optimize
- #PROC=i686
-
-@@ -63,10 +76,10 @@
+@@ -19,8 +19,8 @@
+ # CROSS_COMPILE=/opt/montavista/pro/devkit/arm/xscale_be/bin/xscale_be-
+ # CROSS_COMPILE_BIN=/opt/montavista/pro/devkit/arm/xscale_be/bin/
+ # CROSS_COMPILE_TARGET=/opt/montavista/pro/devkit/arm/xscale_be/target
+-CC=$(CROSS_COMPILE)gcc
+-HOST_CC=gcc
++CC?=$(CROSS_COMPILE)gcc
++HOST_CC=${CC}
+ # CROSS_ARCH=Linux
+ # CROSS_PROC=arm
+ # SUB_PROC=xscale # or maverick
+@@ -44,14 +44,14 @@
#K6OPT = -DK6OPT
- #Tell gcc to optimize the asterisk's code
+ #Tell gcc to optimize the code
-OPTIMIZE+=-O6
+#OPTIMIZE+=-O6
+ endif
- #Include debug symbols in the executables (-g) and profiling info (-pg)
--DEBUG=-g #-pg
-+#DEBUG=-g #-pg
+ #Overwite config files on "make samples"
+-OVERWRITE=y
++OVERWRITE=n
- # If you are running a radio application, define RADIO_RELAX so that the DTMF
- # will be received more reliably
-@@ -91,7 +104,7 @@
+ #Include debug and macro symbols in the executables (-g) and profiling info (-pg)
+-DEBUG=-g3 #-pg
++#DEBUG=-g3 #-pg
+
+ #Set NOCRYPTO to yes if you do not want to have crypto support or
+ #dependencies
+@@ -83,7 +83,7 @@
# Where to install asterisk after compiling
# Default -> leave empty
--INSTALL_PREFIX=
+-INSTALL_PREFIX?=
+INSTALL_PREFIX=$(PREFIX)
# Staging directory
# Files are copied here temporarily during the install process
-@@ -111,23 +124,23 @@
- # Don't use together with -DBUSYDETECT_TONEONLY
+@@ -106,17 +106,17 @@
BUSYDETECT+= #-DBUSYDETECT_COMPARE_TONE_AND_SILENCE
--ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
--ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
-+ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
-+ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
- ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
--ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
--ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
--ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
-+ASTSPOOLDIR=/var/spool/asterisk
-+ASTLOGDIR=/var/log/asterisk
-+ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
- ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
--ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
--ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
--ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
--ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
-+ASTBINDIR=$(INSTALL_PREFIX)/bin
-+ASTSBINDIR=$(INSTALL_PREFIX)/sbin
-+ASTVARRUNDIR=/var/run
-+ASTMANDIR=$(INSTALL_PREFIX)/man
-
- MODULES_DIR=$(ASTLIBDIR)/modules
- AGI_DIR=$(ASTVARLIBDIR)/agi-bin
-
- INCLUDE=-Iinclude -I../include
--CFLAGS=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
-+CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
- CFLAGS+=$(OPTIMIZE)
+ ifneq ($(OSARCH),SunOS)
+- ASTLIBDIR=$(INSTALL_PREFIX)/usr/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)/var/lib/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
+ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)/usr/include/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)/usr/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)/usr/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)/usr/share/man
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+ MODULES_DIR=$(ASTLIBDIR)/modules
+ AGI_DIR=$(ASTVARLIBDIR)/agi-bin
+ else
+@@ -218,13 +218,13 @@
+ endif
+
+ INCLUDE+=-Iinclude -I../include
+-ASTCFLAGS+=-pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
+-ASTCFLAGS+=$(OPTIMIZE)
++ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
++#ASTCFLAGS+=$(OPTIMIZE)
+ ASTOBJ=-o asterisk
+
+ ifeq ($(findstring BSD,$(OSARCH)),BSD)
+ PROC=$(shell uname -m)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
ifneq ($(PROC),ultrasparc)
-@@ -138,12 +151,8 @@
- CFLAGS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "-DOSP_SUPPORT -I/usr/include/osp" ; fi)
-
- ifeq (${OSARCH},FreeBSD)
--OSVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
--CFLAGS+=$(shell if test ${OSVERSION} -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
--LIBS+=$(shell if test ${OSVERSION} -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
--INCLUDE+=-I/usr/local/include
--CFLAGS+=$(shell if [ -d /usr/local/include/spandsp ]; then echo "-I/usr/local/include/spandsp"; fi)
--MPG123TARG=freebsd
-+CFLAGS+=$(PTHREAD_CFLAGS)
-+LIBS+=$(PTHREAD_LIBS)
+@@ -235,8 +235,8 @@
+ ASTCFLAGS+=-fsigned-char
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h),)
+- ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/local/include/osp
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h),)
++ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp
+ else
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ ASTCFLAGS+=-DOSP_SUPPORT -I$(CROSS_COMPILE_TARGET)/usr/include/osp
+@@ -245,27 +245,24 @@
+
+ ifeq ($(OSARCH),FreeBSD)
+ BSDVERSION=$(shell make -V OSVERSION -f $(CROSS_COMPILE_TARGET)/usr/share/mk/bsd.port.subdir.mk)
+- ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
+- LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
+- ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/spandsp),)
+- ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/spandsp
++ ASTCFLAGS+=$(PTHREAD_CFLAGS)
++ LIBS+=$(PTHREAD_LIBS)
++ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp),)
++ ASTCFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp
+ endif
+ MPG123TARG=freebsd
+
+- # XXX FreeBSD paths
+- PREFIX?=/usr/local
+- ASTLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/lib/asterisk
+- ASTVARLIBDIR=$(INSTALL_PREFIX)$(PREFIX)/share/asterisk
+- ASTETCDIR=$(INSTALL_PREFIX)$(PREFIX)/etc/asterisk
+- ASTSPOOLDIR=$(INSTALL_PREFIX)/var/spool/asterisk
+- ASTLOGDIR=$(INSTALL_PREFIX)/var/log/asterisk
+- ASTHEADERDIR=$(INSTALL_PREFIX)$(PREFIX)/include/asterisk
++ ASTLIBDIR=$(INSTALL_PREFIX)/lib/asterisk
++ ASTVARLIBDIR=$(INSTALL_PREFIX)/share/asterisk
++ ASTETCDIR=$(INSTALL_PREFIX)/etc/asterisk
++ ASTSPOOLDIR=/var/spool/asterisk
++ ASTLOGDIR=/var/log/asterisk
++ ASTHEADERDIR=$(INSTALL_PREFIX)/include/asterisk
+ ASTCONFPATH=$(ASTETCDIR)/asterisk.conf
+- ASTBINDIR=$(INSTALL_PREFIX)$(PREFIX)/bin
+- ASTSBINDIR=$(INSTALL_PREFIX)$(PREFIX)/sbin
+- ASTVARRUNDIR=$(INSTALL_PREFIX)/var/run
+- ASTMANDIR=$(INSTALL_PREFIX)$(PREFIX)/man
+- # XXX end FreeBSD paths
++ ASTBINDIR=$(INSTALL_PREFIX)/bin
++ ASTSBINDIR=$(INSTALL_PREFIX)/sbin
++ ASTVARRUNDIR=/var/run
++ ASTMANDIR=$(INSTALL_PREFIX)/man
+
endif # FreeBSD
- ifeq (${OSARCH},NetBSD)
-@@ -160,7 +169,10 @@
- #CFLAGS+=-DOLD_DSP_ROUTINES
+@@ -281,7 +278,7 @@
- CFLAGS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
--CFLAGS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "-DZAPTEL_OPTIMIZATIONS"; fi)
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPTEL_OPTIMIZATIONS
-+endif
+ ifeq ($(OSARCH),SunOS)
+ ASTCFLAGS+=-Wcast-align -DSOLARIS
+- INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)/usr/local/ssl/include
++ INCLUDE+=-Iinclude/solaris-compat -I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/include
+ endif
- LIBEDIT=editline/libedit.a
+ ifeq ($(findstring CYGWIN,$(OSARCH)),CYGWIN)
+@@ -296,7 +293,7 @@
-@@ -222,7 +234,7 @@
- SOLINK=-shared -Xlinker -x
+ ifndef WITHOUT_ZAPTEL
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ASTCFLAGS+=-DZAPTEL_OPTIMIZATIONS
+ endif
+
+@@ -323,7 +320,7 @@
+ ASTERISKVERSIONNUM=999999
+ ASTERISKVERSION=SVN-$(shell build_tools/make_svn_branch_name)
+ else
+- ASTERISKVERSIONNUM=000000
++ ASTERISKVERSIONNUM?=000000
+ endif
+ endif
+
+@@ -388,10 +385,10 @@
endif
--CC=gcc
-+CC?=gcc
- INSTALL=install
+ ifeq ($(OSARCH),SunOS)
+- LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ LIBS+=-lpthread -ldl -lnsl -lsocket -lresolv -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ OBJS+=strcompat.o
+ ASTLINK=
+- SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)/usr/local/ssl/lib
++ SOLINK=-shared -fpic -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/ssl/lib
+ endif
+
+ ifeq ($(MAKETOPLEVEL),$(MAKELEVEL))
+@@ -399,7 +396,7 @@
+ endif
- _all: all
-@@ -234,7 +246,7 @@
+ # This is used when generating the doxygen documentation
+-ifneq ($(wildcard /usr/local/bin/dot)$(wildcard /usr/bin/dot),)
++ifneq ($(wildcard $(LOCALBASE)/bin/dot)$(wildcard /usr/bin/dot),)
+ HAVEDOT=yes
+ else
+ HAVEDOT=no
+@@ -418,7 +415,7 @@
@echo " + $(MAKE) install +"
@echo " +-------------------------------------------+"
--all: depend asterisk subdirs
-+all: depend asterisk subdirs manpage
+-all: cleantest depend asterisk subdirs
++all: cleantest depend asterisk subdirs manpage
- editline/config.h:
- cd editline && unset CFLAGS LIBS && ./configure ; \
-@@ -243,13 +255,13 @@
+ #ifneq ($(wildcard tags),)
+ ctags: tags
+@@ -437,13 +434,13 @@
cd editline && unset CFLAGS LIBS && test -f config.h || ./configure
$(MAKE) -C editline libedit.a
@@ -144,55 +216,57 @@ $FreeBSD$
+# fi
ifneq ($(wildcard .depend),)
- include .depend
-@@ -271,13 +283,10 @@
-
- asterisk.o: asterisk.c build.h
-
--manpage: asterisk.8.gz
-+manpage: asterisk.8
-
--asterisk.8.gz: asterisk.sgml
-- rm -f asterisk.8
-- docbook2man asterisk.sgml
-- mv ./*.8 asterisk.8
-- gzip asterisk.8
-+asterisk.8: asterisk.8.gz
-+ gzcat asterisk.8.gz > asterisk.8
-
- ifneq ($(strip $(ASTERISKVERSION)),)
- build.h: .version
-@@ -295,8 +304,8 @@
- exit 1; \
+ include .depend
+@@ -510,14 +507,14 @@
+ cygwin_a:
+ $(MAKE) -C cygwin all
+
+-asterisk: $(CYGLOADER) editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
++asterisk: $(CYGLOADER) editline/libedit.a stdtime/libtime.a $(OBJS)
+ build_tools/make_build_h > include/asterisk/build.h.tmp
+ if cmp -s include/asterisk/build.h.tmp include/asterisk/build.h ; then echo ; else \
+ mv include/asterisk/build.h.tmp include/asterisk/build.h ; \
fi
-
--asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
-- $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
-+asterisk: editline/libedit.a stdtime/libtime.a $(OBJS)
-+ $(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) stdtime/libtime.a $(LIBS)
+ rm -f include/asterisk/build.h.tmp
+ $(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
+- $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
++ $(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) stdtime/libtime.a $(LIBS)
muted: muted.o
- $(CC) -o muted muted.o
-@@ -315,28 +324,28 @@
- $(MAKE) -C stdtime clean
+ $(CC) $(AUDIO_LIBS) -o muted muted.o
+@@ -539,38 +536,38 @@
datafiles: all
+ if [ x`whoami` = xroot ]; then sh mkpkgconfig $(DESTDIR)/usr/lib/pkgconfig; fi
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/priv-callerintros
for x in sounds/digits/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/digits ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate
+ for x in sounds/dictate/*.gsm; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/dictate ; \
+ else \
+ echo "No description for $$x"; \
+ exit 1; \
+ fi; \
+ done
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters
for x in sounds/letters/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/letters ; \
else \
echo "No description for $$x"; \
@@ -202,17 +276,17 @@ $FreeBSD$
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic
for x in sounds/phonetic/*.gsm; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds/phonetic ; \
else \
echo "No description for $$x"; \
exit 1; \
-@@ -344,18 +353,18 @@
+@@ -578,18 +575,18 @@
done
- for x in sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ for x in sounds/demo-* sounds/vm-* sounds/transfer* sounds/pbx-* sounds/ss-* sounds/beep* sounds/dir-* sounds/conf-* sounds/agent-* sounds/invalid* sounds/tt-* sounds/auth-* sounds/privacy-* sounds/queue-* sounds/spy-* sounds/priv-* sounds/screen-* sounds/hello-*; do \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
@@ -224,70 +298,80 @@ $FreeBSD$
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/images
for x in images/*.jpg; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/images ; \
done
- mkdir -p $(DESTDIR)$(AGI_DIR)
+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
update:
- @if [ -d CVS ]; then \
-@@ -367,127 +376,90 @@
- fi
+ @if [ -d .svn ]; then \
+@@ -618,75 +615,53 @@
+ OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
bininstall: all
- mkdir -p $(DESTDIR)$(MODULES_DIR)
- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTETCDIR)
- mkdir -p $(DESTDIR)$(ASTBINDIR)
-- mkdir -p $(DESTDIR)$(ASTSBINDIR)
- mkdir -p $(DESTDIR)$(ASTVARRUNDIR)
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/dictate
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/system
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/tmp
-- install -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-- install -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/meetme
+- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/monitor
+- if [ -f asterisk ]; then $(INSTALL) -m 755 asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f cygwin/asterisk.exe ]; then $(INSTALL) -m 755 cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
+- if [ -f asterisk.dll ]; then $(INSTALL) -m 755 asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ $(MKDIR) $(DESTDIR)$(MODULES_DIR)
+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTBINDIR)
-+ $(MKDIR) $(DESTDIR)$(ASTSBINDIR)
+ $(MKDIR) $(DESTDIR)$(ASTVARRUNDIR)
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/dictate
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/system
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/tmp
-+ $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/meetme
++ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/monitor
++ if [ -f asterisk ]; then $(BSD_INSTALL_PROGRAM) asterisk $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f cygwin/asterisk.exe ]; then $(BSD_INSTALL_PROGRAM) cygwin/asterisk.exe $(DESTDIR)$(ASTSBINDIR)/; fi
++ if [ -f asterisk.dll ]; then $(BSD_INSTALL_PROGRAM) asterisk.dll $(DESTDIR)$(ASTSBINDIR)/; fi
+ ln -sf asterisk $(DESTDIR)$(ASTSBINDIR)/rasterisk
+- $(INSTALL) -m 755 contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
+- $(INSTALL) -m 755 contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
+ $(BSD_INSTALL_SCRIPT) contrib/scripts/astgenkey $(DESTDIR)$(ASTSBINDIR)/
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
++ $(BSD_INSTALL_SCRIPT) contrib/scripts/autosupport $(DESTDIR)$(ASTSBINDIR)/
if [ ! -f $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ]; then \
-- install -m 755 contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
-+ $(BSD_INSTALL_SCRIPT) contrib/scripts/safe_asterisk $(DESTDIR)$(ASTSBINDIR)/ ;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
+ chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
fi
for x in $(SUBDIRS); do $(MAKE) -C $$x install || exit 1 ; done
-- install -d $(DESTDIR)$(ASTHEADERDIR)
-- install -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
+- $(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
+ $(MKDIR) $(DESTDIR)$(ASTHEADERDIR)
+ $(BSD_INSTALL_DATA) include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/vm
-- rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
-- if [ ! -h $(DESTDIR)$(ASTSPOOLDIR)/vm ] && [ -d $(DESTDIR)$(ASTSPOOLDIR)/vm ]; then \
-- mv $(DESTDIR)$(ASTSPOOLDIR)/vm $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- else \
-- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default; \
-- rm -f $(DESTDIR)$(ASTSPOOLDIR)/vm; \
-- fi
-- ln -s $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+ if [ -n "$(OLDHEADERS)" ]; then \
+ rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
+ fi
+ rm -f $(DESTDIR)$(ASTVARLIBDIR)/sounds/voicemail
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds
- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-csv
+- mkdir -p $(DESTDIR)$(ASTLOGDIR)/cdr-custom
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/keys
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware
- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
- mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
-- install -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
-- install -m 644 asterisk.8.gz $(DESTDIR)$(ASTMANDIR)/man8
-+ ln -sf $(ASTSPOOLDIR)/voicemail/default $(DESTDIR)$(ASTSPOOLDIR)/vm
+- $(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+- $(INSTALL) -m 644 asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
+- $(INSTALL) -m 644 contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds
+ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-csv
++ $(MKDIR) $(DESTDIR)$(ASTLOGDIR)/cdr-custom
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware
+ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax
@@ -295,14 +379,16 @@ $FreeBSD$
+ $(BSD_INSTALL_DATA) keys/iaxtel.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) keys/freeworlddialup.pub $(DESTDIR)$(ASTVARLIBDIR)/keys
+ $(BSD_INSTALL_DATA) asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/astgenkey.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/autosupport.8 $(DESTDIR)$(ASTMANDIR)/man8
++ $(BSD_INSTALL_DATA) contrib/scripts/safe_asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
if [ -d contrib/firmware/iax ]; then \
-- install -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+- $(INSTALL) -m 644 contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
+ $(BSD_INSTALL_DATA) contrib/firmware/iax/iaxy.bin $(DESTDIR)$(ASTVARLIBDIR)/firmware/iax/iaxy.bin; \
else \
echo "You need to do cvs update -d not just cvs update" ; \
fi
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/vm . )
-- ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -s $(ASTSPOOLDIR)/voicemail . )
- if [ -f mpg123-0.59r/mpg123 ]; then $(MAKE) -C mpg123-0.59r install; fi
- @echo " +---- Asterisk Installation Complete -------+"
- @echo " + +"
@@ -325,85 +411,74 @@ $FreeBSD$
- @echo " + **Note** This requires that you have +"
- @echo " + doxygen installed on your local system +"
- @echo " +-------------------------------------------+"
-- @echo " + +"
-- @echo " + ** NOTE FOR DOWNGRADING FROM CVS HEAD ** +"
-- @echo " + +"
-- @echo " + If you are downgrading from CVS HEAD to +"
-- @echo " + a stable release, remember to delete +"
-- @echo " + everything from your asterisk modules +"
-- @echo " + directory (/usr/lib/asterisk/modules/) +"
-- @echo " + and the asterisk header directory +"
-- @echo " + (/usr/include/asterisk/) +"
-- @echo " + before doing a '$(MAKE) install'. +"
-- @echo " + +"
-- @echo " +-------------------------------------------+"
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/vm . )
-+ ( cd $(DESTDIR)$(ASTVARLIBDIR)/sounds ; ln -sf $(ASTSPOOLDIR)/voicemail . )
+ @$(MAKE) -s oldmodcheck
+ NEWMODS=$(notdir $(wildcard */*.so))
+@@ -710,7 +685,7 @@
+ echo " WARNING WARNING WARNING" ;\
+ fi
-install: all datafiles bininstall
+install: all datafiles bininstall samples
-
+ @if [ -x /usr/sbin/asterisk-post-install ]; then \
+ /usr/sbin/asterisk-post-install $(DESTDIR) . ; \
+ fi
+@@ -718,16 +693,19 @@
upgrade: all bininstall
- adsi: all
+ adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x`-dist; \
- if ! [ -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ if [ ! -f $(DESTDIR)$(ASTETCDIRX)/$$x ]; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x` ; \
fi ; \
done
- samples: all datafiles adsi
+ samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
-- for x in configs/*.sample; do \
-- if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-- mv -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`.old ; \
++ echo ADSI INSTALL $(BSD_INSTALL_DATA)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
-+ for x in configs/*.sample channels/h323/*.sample; do \
+ for x in configs/*.sample; do \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample`-dist;\
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
-+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+ if [ -f $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ]; then \
+ if [ "$(OVERWRITE)" = "y" ]; then \
+ if cmp -s $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` $$x ; then \
+@@ -740,7 +718,7 @@
+ continue; \
+ fi ;\
fi ; \
-- install -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
++ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`basename $$x .sample` ;\
done
-- echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-- echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf
-+ echo "[directories]" > $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astetcdir => $(ASTETCDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astmoddir => $(MODULES_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astvarlibdir => $(ASTVARLIBDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astagidir => $(AGI_DIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astspooldir => $(ASTSPOOLDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astrundir => $(ASTVARRUNDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "astlogdir => $(ASTLOGDIR)" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "[options]" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ echo "uniquename = asterisk" >> $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist
-+ if ! [ -f $(DESTDIR)$(ASTETCDIR)/asterisk.conf ]; then \
-+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTETCDIR)/asterisk.conf-dist $(DESTDIR)$(ASTETCDIR)/asterisk.conf; \
-+ fi
+ if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ ( \
+@@ -759,25 +737,25 @@
+ echo ";astctlowner = root" ; \
+ echo ";astctlgroup = apache" ; \
+ echo ";astctl = asterisk.ctl" ; \
+- ) > $(DESTDIR)$(ASTCONFPATH) ; \
++ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ else \
+ echo "Skipping asterisk.conf creation"; \
+ fi
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
for x in sounds/demo-*; do \
- if grep -q "^%`basename $$x`%" sounds.txt; then \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ if $(GREP) -q "^%`basename $$x`%" sounds.txt; then \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/sounds ; \
else \
echo "No description for $$x"; \
exit 1; \
fi; \
done
+- mkdir -p $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
++ $(MKDIR) $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
for x in sounds/*.mp3; do \
-- install -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTVARLIBDIR)/mohmp3 ; \
done
rm -f $(DESTDIR)$(ASTVARLIBDIR)/mohmp3/sample-hold.mp3
@@ -412,18 +487,18 @@ $FreeBSD$
:> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm
for x in vm-theperson digits/1 digits/2 digits/3 digits/4 vm-isunavail; do \
cat $(DESTDIR)$(ASTVARLIBDIR)/sounds/$$x.gsm >> $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/unavail.gsm ; \
-@@ -502,7 +474,7 @@
- @[ -d $(DESTDIR)$(HTTPDIR)/html ] || ( echo "No http directory" && exit 1 )
- @[ -d $(DESTDIR)$(HTTPDIR)/cgi-bin ] || ( echo "No cgi-bin directory" && exit 1 )
- install -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTPDIR)/cgi-bin/vmail.cgi
-- mkdir -p $(DESTDIR)$(HTTPDIR)/html/_asterisk
-+ $(MKDIR) $(DESTDIR)$(HTTPDIR)/html/_asterisk
+@@ -791,7 +769,7 @@
+ @[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
+ @[ -d $(DESTDIR)$(HTTP_CGIDIR) ] || ( printf "cgi-bin directory not found.\nUpdate assignment of variable HTTP_CGIDIR in Makefile!\n" && exit 1 )
+ $(INSTALL) -m 4755 -o root -g root contrib/scripts/vmail.cgi $(DESTDIR)$(HTTP_CGIDIR)/vmail.cgi
+- mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
++ $(MKDIR) $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
for x in images/*.gif; do \
- install -m 644 $$x $(DESTDIR)$(HTTPDIR)/html/_asterisk/; \
+ $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
done
-@@ -522,10 +494,10 @@
+@@ -820,10 +798,10 @@
- __rpm: _version
+ __rpm: include/asterisk/version.h spec
rm -rf /tmp/asterisk ; \
- mkdir -p /tmp/asterisk/redhat/RPMS/i386 ; \
+ $(MKDIR) /tmp/asterisk/redhat/RPMS/i386 ; \
@@ -431,6 +506,6 @@ $FreeBSD$
$(MAKE) DESTDIR=/tmp/asterisk samples ; \
- mkdir -p /tmp/asterisk/etc/rc.d/init.d ; \
+ $(MKDIR) /tmp/asterisk/etc/rc.d/init.d ; \
- cp -f redhat/asterisk /tmp/asterisk/etc/rc.d/init.d/ ; \
- sed "s/^Version:.*/Version: $(RPMVERSION)/g" redhat/asterisk.spec > asterisk.spec ; \
+ cp -f contrib/init.d/rc.redhat.asterisk /tmp/asterisk/etc/rc.d/init.d/asterisk ; \
rpmbuild --rcfile /usr/lib/rpm/rpmrc:redhat/rpmrc -bb asterisk.spec
+
diff --git a/net/asterisk16/files/patch-agi::Makefile b/net/asterisk16/files/patch-agi::Makefile
index 32efb5d..b359765 100644
--- a/net/asterisk16/files/patch-agi::Makefile
+++ b/net/asterisk16/files/patch-agi::Makefile
@@ -1,9 +1,9 @@
$FreeBSD$
---- agi/Makefile.orig Tue Jun 22 20:42:13 2004
-+++ agi/Makefile Tue Oct 5 21:03:40 2004
-@@ -11,15 +11,18 @@
+--- agi/Makefile.orig Thu Jan 12 15:42:07 2006
++++ agi/Makefile Thu Jan 12 15:44:39 2006
+@@ -11,7 +11,9 @@
# the GNU General Public License
#
@@ -14,14 +14,15 @@ $FreeBSD$
CFLAGS+=
+@@ -27,8 +29,9 @@
all: depend $(AGIS)
install: all
- mkdir -p $(DESTDIR)$(AGI_DIR)
- for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
-+ $(MKDIR) $(DESTDIR)$(AGI_DIR)
++ $(MKDIR) -p $(DESTDIR)$(AGI_DIR)
+ for x in $(AGIS_BIN); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(AGI_DIR) ; done
+ for x in $(AGIS_SCR); do $(BSD_INSTALL_SCRIPT) $$x $(DESTDIR)$(AGI_DIR) ; done
eagi-test: eagi-test.o
- $(CC) $(CFLAGS) -o eagi-test eagi-test.o
+ $(CC) $(CFLAGS) -o eagi-test eagi-test.o $(LIBS)
diff --git a/net/asterisk16/files/patch-apps::Makefile b/net/asterisk16/files/patch-apps::Makefile
index 44f8495..ee7d560 100644
--- a/net/asterisk16/files/patch-apps::Makefile
+++ b/net/asterisk16/files/patch-apps::Makefile
@@ -1,38 +1,56 @@
---- apps/Makefile.orig Wed Jun 22 14:40:11 2005
-+++ apps/Makefile Wed Jun 22 14:43:45 2005
-@@ -40,9 +40,13 @@
+
+$FreeBSD$
+
+--- apps/Makefile.orig
++++ apps/Makefile
+@@ -45,25 +45,27 @@
#APPS+=app_rpt.so
- APPS+=$(shell if [ -f /usr/include/linux/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
--APPS+=$(shell if [ -f /usr/local/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/zaptel.h ]; then echo "app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so" ; fi)
- APPS+=$(shell if [ -f /usr/include/osp/osp.h ]; then echo "app_osplookup.so" ; fi)
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h),)
+ APPS+=app_zapras.so app_meetme.so app_flash.so app_zapbarge.so app_zapscan.so app_page.so
+ endif
+ endif # WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ifdef WITH_FAX
-+APPS+=$(shell if [ -f $(LOCALBASE)/include/spandsp.h ]; then echo "app_rxfax.so app_txfax.so" ; fi)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/spandsp.h),)
++APPS+=app_rxfax.so app_txfax.so
++endif
+endif
+
- CFLAGS+=-fPIC
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/osp/osp.h $(CROSS_COMPILE_TARGET)/usr/include/osp/osp.h),)
+ APPS+=app_osplookup.so
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+-CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+-CURLLIBS=$(shell $(CROSS_COMPILE_BIN)curl-config --libs)
+-ifneq ($(shell if [[ 0x`$(CROSS_COMPILE_BIN)curl-config --vernum` -ge 0x70907 ]]; then echo "OK" ; fi),)
+- ifneq (${CURLLIBS},)
+- APPS+=app_curl.so
+- endif
+-endif
++CURLLIBS=$(shell $(CROSS_COMPILE_BIN)$(LOCALBASE)/bin/curl-config --libs)
++APPS+=app_curl.so
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
-@@ -65,12 +69,12 @@
- $(CC) $(SOLINK) -o $@ $< -ltonezone
+ ifeq (${OSARCH},CYGWIN)
+ CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
+@@ -95,24 +97,32 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -ltonezone
install: all
- for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(APPS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
+ rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
- app_voicemail.so : app_voicemail.o
- ifeq ($(USE_MYSQL_VM_INTERFACE),1)
-- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L/usr/lib/mysql -lmysqlclient -lz
-+ $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -L$(LOCALBASE)/lib/mysql -lmysqlclient -lz
- else
- ifeq ($(USE_POSTGRES_VM_INTERFACE),1)
- $(CC) $(SOLINK) -o $@ $(MLFLAGS) $< -lpq
-@@ -79,17 +83,25 @@
- endif
- endif
+ app_curl.so: app_curl.o
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
+ifdef WITH_FAX
+app_rxfax.so : app_rxfax.o
@@ -47,15 +65,15 @@
+ $(CC) -I$(LOCALBASE)/include/pgsql $(CFLAGS) -c -o app_sql_postgres.o app_sql_postgres.c
app_sql_postgres.so: app_sql_postgres.o
-- $(CC) $(SOLINK) -o $@ $< -L/usr/local/pgsql/lib -lpq
-+ $(CC) $(SOLINK) -o $@ $< -L$(LOCALBASE)/lib -lpq
+- $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L/usr/local/pgsql/lib -lpq
++ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -L$(LOCALBASE)/lib -lpq
app_sql_odbc.so: app_sql_odbc.o
- $(CC) $(SOLINK) -o $@ $< -lodbc
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -lodbc
look: look.c
- $(CC) -pipe -O6 -g look.c -o look -lncurses
-+ $(CC) $(CFLAGS) look.c -o look -lncurses
++ $(CC) look.c -o look -lncurses
- ifneq ($(wildcard .depend),)
- include .depend
+ ifeq (SunOS,$(shell uname))
+ app_chanspy.so: app_chanspy.o
diff --git a/net/asterisk16/files/patch-apps::app_rxfax.c b/net/asterisk16/files/patch-apps::app_rxfax.c
index 88362bfc..820208e 100644
--- a/net/asterisk16/files/patch-apps::app_rxfax.c
+++ b/net/asterisk16/files/patch-apps::app_rxfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_rxfax.c.orig
-+++ apps/app_rxfax.c
-@@ -0,0 +1,371 @@
+--- /dev/null Thu Jan 12 17:44:40 2006
++++ apps/app_rxfax.c Thu Jan 12 17:41:53 2006
+@@ -0,0 +1,373 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <asterisk/dsp.h>
+#include <asterisk/manager.h>
++#include <asterisk/version.h>
+#include <string.h>
+#include <stdlib.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
@@ -100,7 +102,7 @@ $FreeBSD$
+ "FaxReceived", "Channel: %s\nExten: %s\nCallerID: %s\nRemoteStationID: %s\nLocalStationID: %s\nPagesTransferred: %i\nResolution: %i\nTransferRate: %i\nFileName: %s\n",
+ chan->name,
+ chan->exten,
-+#if (ASTERISK_VERSION_NUM <= 011000)
++#if ASTERISK_VERSION_NUM <= 010010
+ chan->callerid,
+#else
+ (chan->cid.cid_num) ? chan->cid.cid_num : "",
diff --git a/net/asterisk16/files/patch-apps::app_txfax.c b/net/asterisk16/files/patch-apps::app_txfax.c
index 8daf0f9..15ad667 100644
--- a/net/asterisk16/files/patch-apps::app_txfax.c
+++ b/net/asterisk16/files/patch-apps::app_txfax.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- apps/app_txfax.c.orig
-+++ apps/app_txfax.c
-@@ -0,0 +1,293 @@
+--- /dev/null Thu Jan 12 17:48:54 2006
++++ apps/app_txfax.c Thu Jan 12 17:48:36 2006
+@@ -0,0 +1,295 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -17,6 +17,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/file.h>
+#include <asterisk/logger.h>
@@ -26,6 +27,7 @@ $FreeBSD$
+#include <asterisk/translate.h>
+#include <string.h>
+#include <stdlib.h>
++#include <math.h>
+#if defined(__FreeBSD__) && __FreeBSD_version < 500028
+#include <inttypes.h>
+#else
diff --git a/net/asterisk16/files/patch-astman::Makefile b/net/asterisk16/files/patch-astman::Makefile
deleted file mode 100644
index 2745860..0000000
--- a/net/asterisk16/files/patch-astman::Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-
-$FreeBSD$
-
---- astman/Makefile.orig Sat Jun 26 22:25:39 2004
-+++ astman/Makefile Thu Oct 14 19:14:22 2004
-@@ -5,16 +5,16 @@
-
- OSARCH=$(shell uname -s)
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS+=-I/usr/local/include -L/usr/local/lib
-+CFLAGS+=-I$(LOCALBASE)/include -L$(LOCALBASE)/lib
- endif
-
--TARGET=$(shell if [ -f /usr/include/newt.h ]; then echo "astman"; else if [ -f /usr/local/include/newt.h ]; then echo "astman"; else echo "none" ; fi ; fi)
-+TARGET=astman
- all: depend $(TARGET)
-
- install:
- if [ "$(TARGET)" != "none" ]; then \
- for x in $(TARGET); do \
-- install -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
-+ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/astman; \
- done ; \
- fi
-
diff --git a/net/asterisk16/files/patch-cdr::Makefile b/net/asterisk16/files/patch-cdr::Makefile
index 1d0fb20..da16b60 100644
--- a/net/asterisk16/files/patch-cdr::Makefile
+++ b/net/asterisk16/files/patch-cdr::Makefile
@@ -1,51 +1,65 @@
---- cdr/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ cdr/Makefile Tue Aug 9 17:28:11 2005
-@@ -21,7 +21,7 @@
- OSARCH=$(shell uname -s)
-
- ifeq (${OSARCH},FreeBSD)
--SOLINK+=-L/usr/local/lib
-+SOLINK+=-L$(LOCALBASE)/lib
+
+$FreeBSD$
+
+--- cdr/Makefile.orig Tue Nov 29 20:24:39 2005
++++ cdr/Makefile Thu Jan 12 17:56:23 2006
+@@ -21,8 +21,8 @@
+ endif
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
endif
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
-@@ -37,18 +37,23 @@
+@@ -38,18 +38,18 @@
#
# unixODBC stuff...
#
-+ifdef WITH_ODBC
- MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "cdr_odbc.so"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/odbcinst.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/odbcinst.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/odbcinst.h),)
+ MODS+=cdr_odbc.so
+ endif
#
# FreeTDS stuff...
#
-+ifdef WITH_FREETDS
- MODS+=$(shell if [ -f "/usr/include/tds.h" ]; then echo "cdr_tds.so"; fi)
- MODS+=$(shell if [ -f "/usr/local/include/tds.h" ]; then echo "cdr_tds.so"; fi)
-+endif
-
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/tds.h),)
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.63),1)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/tds.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tds.h),)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.63),1)
+ CFLAGS += -DFREETDS_0_63
+ else
+- ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)/usr/local/include/tdsver.h | grep -c 0.62),1)
++ ifeq ($(shell grep -s TDS_VERSION_NO $(CROSS_COMPILE_TARGET)/usr/include/tdsver.h $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/tdsver.h | grep -c 0.62),1)
+ CFLAGS += -DFREETDS_0_62
+ else
+ CFLAGS += -DFREETDS_PRE_0_62
+@@ -61,7 +61,7 @@
#
# PGSQL stuff... Autoconf anyone??
#
-+ifdef WITH_PGSQL
- MODS+=$(shell if [ -d /usr/local/pgsql/include ] || [ -d /usr/include/pgsql ] || [ -d /usr/local/include/pgsql ] || [ -d /opt/pgsql/include ] || [ -f /usr/include/libpq-fe.h ] ; then echo "cdr_pgsql.so"; fi)
- CFLAGS+=$(shell if [ -d /usr/local/pgsql/include ]; then echo "-I/usr/local/pgsql/include"; fi)
- CFLAGS+=$(shell if [ -d /usr/include/pgsql ]; then echo "-I/usr/include/pgsql"; fi)
-@@ -62,16 +67,19 @@
- MLFLAGS+=$(shell if [ -d /usr/local/lib/pgsql ]; then echo "-L/usr/local/lib/pgsql"; fi)
- MLFLAGS+=$(shell if [ -d /opt/pgsql/lib ]; then echo "-L/opt/pgsql/lib"; fi)
- MLFLAGS+=$(shell if [ -f /usr/lib/libpq.so ]; then echo "-L/usr/lib"; fi)
-+endif
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/postgresql)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql)$(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include)$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/libpq-fe.h),)
+ MODS+=cdr_pgsql.so
+ endif
- #
- # SQLIte stuff...
- #
-+ifdef WITH_SQLITE
- MODS+=$(shell if [ -f "/usr/include/sqlite.h" ]; then echo "cdr_sqlite.so"; fi)
-+endif
+@@ -82,9 +82,9 @@
+ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/lib/pgsql
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/pgsql),)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/pgsql
+- MLFLAGS+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib/pgsql
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql),)
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/pgsql
++ MLFLAGS+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/pgsql
+ endif
+ ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/opt/pgsql/include),)
+@@ -110,7 +110,7 @@
all: depend $(MODS)
install: all
diff --git a/net/asterisk16/files/patch-channels::Makefile b/net/asterisk16/files/patch-channels::Makefile
index 7ecab67..edca9b1 100644
--- a/net/asterisk16/files/patch-channels::Makefile
+++ b/net/asterisk16/files/patch-channels::Makefile
@@ -1,97 +1,85 @@
---- channels/Makefile.orig Tue Aug 31 23:33:00 2004
-+++ channels/Makefile Tue Aug 9 17:34:28 2005
-@@ -57,10 +57,10 @@
-
+
+$FreeBSD$
+
+--- channels/Makefile.orig
++++ channels/Makefile
+@@ -48,9 +48,9 @@
endif
+
ifeq (${OSARCH},FreeBSD)
--PTLIB=-lpt_FreeBSD_x86_r
--H323LIB=-lh323_FreeBSD_x86_r
--CHANH323LIB=-pthread
--SOLINK+=-L/usr/local/lib
-+PTLIB=-lpt_FreeBSD_x86_r_s
-+H323LIB=-lh323_FreeBSD_x86_r_s
-+CHANH323LIB=
-+SOLINK+=-L$(LOCALBASE)/lib
+- PTLIB=-lpt_FreeBSD_x86_r
+- H323LIB=-lh323_FreeBSD_x86_r
+- CHANH323LIB=-pthread
++ PTLIB=-lpt_FreeBSD_x86_r_s
++ H323LIB=-lh323_FreeBSD_x86_r_s
++ CHANH323LIB=
endif
+
ifeq (${OSARCH},NetBSD)
- PTLIB=-lpt_NetBSD_x86_r
-@@ -72,19 +72,23 @@
+@@ -73,11 +73,11 @@
+ SOLINK+=-lrt
endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/ixjuser.h ] && echo chan_phone.so)
--CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/ixjuser.h ] && echo chan_phone.so)
-+ifdef WITH_H323
-+CHANNEL_LIBS+=chan_h323.so
-+endif
-
- CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
- CFLAGS+=$(shell [ ! -f /usr/include/linux/if_wanpipe.h ] && echo " -DOLD_SANGOMA_API")
- CHANNEL_LIBS+=$(shell [ -f /usr/include/alsa/asoundlib.h ] && echo "chan_alsa.so")
--CFLAGS+=$(shell [ -f /usr/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo " -DZAPATA_PRI")
- CFLAGS+=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo " -DZAPATA_R2")
- CFLAGS+=$(shell [ -f alsa-monitor.h ] && echo " -DALSA_MONITOR")
--ZAPPRI=$(shell [ -f /usr/lib/libpri.so.1 ] && echo "-lpri")
-+ZAPPRI=$(shell [ -f $(LOCALBASE)/lib/libpri.so.1 ] && echo "-lpri")
- ZAPR2=$(shell [ -f /usr/lib/libmfcr2.so.1 ] && echo "-lmfcr2")
-+ifdef WITH_ZAPTEL
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "-DIAX_TRUNKING")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "-DIAX_TRUNKING")
-+CFLAGS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "-DIAX_TRUNKING -I$(LOCALBASE)/include")
-+endif
- CHANNEL_LIBS+=$(shell [ -f /usr/include/vpbapi.h ] && echo "chan_vpb.so" )
- CFLAGS+=$(shell [ -f /usr/include/vpbapi.h ] && echo " -DLINUX")
-
-@@ -106,8 +110,10 @@
-
- ZAPDIR=/usr/lib
-
-+ifdef WITH_ZAPTEL
- CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo "chan_zap.so")
--CHANNEL_LIBS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo "chan_zap.so")
-+CHANNEL_LIBS+=$(shell [ -f $(LOCALBASE)/include/zaptel.h ] && echo "chan_zap.so")
-+endif
-
- CHANNEL_LIBS+=$(shell [ -f /usr/include/nbs.h ] && echo "chan_nbs.so" )
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/ixjuser.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/ixjuser.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/ixjuser.h),)
+ CHANNEL_LIBS+=chan_phone.so
+ endif
-@@ -156,6 +162,8 @@
- chan_oss.so: chan_oss.o
- $(CC) $(SOLINK) -o $@ chan_oss.o -lossaudio
+-ifneq ($(wildcard h323/libchanh323.a),)
++ifdef WITH_H323
+ CHANNEL_LIBS+=chan_h323.so
endif
-+chan_oss.so: chan_oss.o
-+ $(CC) $(SOLINK) -o $@ chan_oss.o
- chan_iax2.so: chan_iax2.o iax2-parser.o iax2-provision.o
- ifeq ($(USE_MYSQL_FRIENDS),1)
-@@ -175,7 +183,7 @@
- $(CC) -c $(CFLAGS) -o chan_zap.o chan_zap.c
+@@ -91,12 +91,12 @@
+ CHANNEL_LIBS+=chan_alsa.so
+ endif
- chan_zap.so: chan_zap.o
-- $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -ltonezone
-+ $(CC) $(SOLINK) -o $@ $< $(ZAPPRI) $(ZAPR2) -L$(LOCALBASE)/lib -ltonezone
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libpri.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libpri.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libpri.so.1),)
+ CFLAGS+=-DZAPATA_PRI
+ ZAPPRI=-lpri
+ endif
- chan_sip.so: chan_sip.o
- ifeq ($(USE_SIP_MYSQL_FRIENDS),1)
-@@ -199,15 +207,17 @@
- chan_vpb.so: chan_vpb.o
- $(CXX) $(SOLINK) -o $@ $< -lvpb -lpthread -lm -ldl
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/lib/libmfcr2.so.1),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/lib/libmfcr2.so.1)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib/libmfcr2.so.1),)
+ CFLAGS+=-DZAPATA_R2
+ ZAPR2=-lmfcr2
+ endif
+@@ -109,12 +109,12 @@
+ endif
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/pkg/include/zaptel.h),)
+ ifeq (${OSARCH},NetBSD)
+ SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/pkg/lib
+ endif
+ ifeq (${OSARCH},FreeBSD)
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ CFLAGS+=-DIAX_TRUNKING
+ CHANNEL_LIBS+=chan_zap.so
+@@ -229,8 +229,10 @@
+ chan_h323.so: chan_h323.o h323/libchanh323.a h323/Makefile.ast
+ $(CC) $(SOLINK) $(H323LDFLAGS) -o $@ $< h323/libchanh323.a $(H323LDLIBS) -lstdc++
+ else
-chan_h323.so: chan_h323.o h323/libchanh323.a
- $(CC) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
+chan_h323.so: chan_h323.o h323/ast_h323.o
-+ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -lcrypto -lssl -L$(LOCALBASE)/lib -lexpat -llber -lldap -lldap_r
-
++ $(CXX) $(SOLINK) -o $@ $< h323/ast_h323.o $(CHANH323LIB) -L$(OPENH323DIR)/lib $(H323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L/usr/lib -lcrypto -lssl -lexpat -L$(LOCALBASE)/lib -llber -lldap -lldap_r
+h323/ast_h323.o:
+ $(MAKE) -C h323 ast_h323.o
+ endif
- #chan_modem.so : chan_modem.o
+ chan_misdn.so: chan_misdn.o chan_misdn_config.o misdn/chan_misdn_lib.a
+@@ -244,8 +246,7 @@
# $(CC) -rdynamic -shared -Xlinker -x -o $@ $<
install: all
- for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
+ for x in $(CHANNEL_LIBS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
- if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
depend: .depend
+
diff --git a/net/asterisk16/files/patch-channels::chan_h323.c b/net/asterisk16/files/patch-channels::chan_h323.c
index de2ed39..6498b97 100644
--- a/net/asterisk16/files/patch-channels::chan_h323.c
+++ b/net/asterisk16/files/patch-channels::chan_h323.c
@@ -1,14 +1,14 @@
$FreeBSD$
---- channels/chan_h323.c 2004/10/10 13:00:17 1.1
-+++ channels/chan_h323.c 2004/10/10 13:00:39
-@@ -26,7 +26,7 @@
- * Version Info: $Id: patch-channels::chan_h323.c,v 1.3.2.3 2004/10/14 14:30:13 sobomax Exp $
- */
+--- channels/chan_h323.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_h323.c Thu Jan 12 18:29:50 2006
+@@ -2281,7 +2281,7 @@ static char *convertcap(int cap)
+ }
+ }
--
-+#include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/signal.h>
- #include <sys/param.h>
+-static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs)
++static int oh323_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active)
+ {
+ /* XXX Deal with Video */
+ struct oh323_pvt *pvt;
diff --git a/net/asterisk16/files/patch-channels::chan_sip.c b/net/asterisk16/files/patch-channels::chan_sip.c
index e634ce4..355c558 100644
--- a/net/asterisk16/files/patch-channels::chan_sip.c
+++ b/net/asterisk16/files/patch-channels::chan_sip.c
@@ -1,144 +1,131 @@
$FreeBSD$
---- channels/chan_sip.c.orig Sun Feb 17 18:01:43 2002
-+++ channels/chan_sip.c Sun Feb 17 18:10:52 2002
-@@ -141,7 +141,7 @@
+--- channels/chan_sip.c.orig Thu Jan 12 18:43:37 2006
++++ channels/chan_sip.c Thu Jan 12 18:50:11 2006
+@@ -336,7 +336,7 @@ static char global_vmexten[AST_MAX_EXTEN
static char default_language[MAX_LANGUAGE] = "";
--static char default_callerid[AST_MAX_EXTENSION] = "asterisk";
-+static char default_callerid[AST_MAX_EXTENSION] = "Unknown";
+-#define DEFAULT_CALLERID "asterisk"
++#define DEFAULT_CALLERID "Unknown"
+ static char default_callerid[AST_MAX_EXTENSION] = DEFAULT_CALLERID;
static char default_fromdomain[AST_MAX_EXTENSION] = "";
+@@ -474,6 +474,7 @@ struct sip_invite_param {
-@@ -244,6 +244,7 @@
struct sip_route {
struct sip_route *next;
- char hop[0];
+ int lr;
+ char hop[0];
};
- struct sip_history {
-@@ -2218,7 +2219,7 @@
- if (p->owner) {
- /* We already hold the channel lock */
- if (f->frametype == AST_FRAME_VOICE) {
-- if (f->subclass != p->owner->nativeformats) {
-+ if (!(f->subclass & p->owner->nativeformats)) {
- ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
- p->owner->nativeformats = f->subclass;
- ast_set_read_format(p->owner, p->owner->readformat);
-@@ -4620,6 +4621,10 @@
+@@ -5993,6 +5994,7 @@ static void build_route(struct sip_pvt *
/* Make a struct route */
- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
+ thishop = malloc(sizeof(*thishop) + len);
if (thishop) {
-+ if (strnstr(rr, ";lr", len) != NULL)
-+ thishop->lr = 1;
-+ else
-+ thishop->lr = 0;
- strncpy(thishop->hop, rr, len); /* safe */
- thishop->hop[len] = '\0';
++ thishop->lr = (strnstr(rr, ";lr", len) != NULL ? 1 : 0);
+ ast_copy_string(thishop->hop, rr, len);
ast_log(LOG_DEBUG, "build_route: Record-Route hop: <%s>\n", thishop->hop);
-@@ -4643,31 +4648,41 @@
- rr += len+1;
- }
- }
-- /* 2nd append the Contact: if there is one */
-- /* Can be multiple Contact headers, comma separated values - we just take the first */
-- contact = get_header(req, "Contact");
-- if (!ast_strlen_zero(contact)) {
-- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-- /* Look for <: delimited address */
-- c = strchr(contact, '<');
-- if (c) {
-- /* Take to > */
-- ++c;
-- len = strcspn(c, ">");
-- } else {
-- /* No <> - just take the lot */
-- c = contact; len = strlen(contact);
-- }
-- thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ /* Duplicate first route from the list */
-+ if (head && head->lr) {
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
- if (thishop) {
-- strncpy(thishop->hop, c, len); /* safe */
-- thishop->hop[len] = '\0';
-- thishop->next = NULL;
-- /* Goes at the end */
-- if (tail)
-- tail->next = thishop;
-- else
-- head = thishop;
-+ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
-+ thishop->next = head;
-+ head = thishop;
-+ }
-+ } else {
-+ /* Append the Contact: if there is one and first route is w/o `lr' param */
-+ /* Can be multiple Contact headers, comma separated values - we just take the first */
-+ contact = get_header(req, "Contact");
-+ if (!ast_strlen_zero(contact)) {
-+ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
-+ /* Look for <: delimited address */
-+ c = strchr(contact, '<');
-+ if (c) {
-+ /* Take to > */
-+ ++c;
-+ len = strcspn(c, ">");
-+ } else {
-+ /* No <> - just take the lot */
-+ c = contact; len = strlen(contact);
-+ }
-+ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+len+1);
-+ if (thishop) {
-+ strncpy(thishop->hop, c, len); /* safe */
-+ thishop->hop[len] = '\0';
-+ thishop->next = NULL;
-+ /* Goes at the end */
-+ if (tail)
-+ tail->next = thishop;
-+ else
-+ head = thishop;
+ /* Link in */
+@@ -6018,31 +6020,41 @@ static void build_route(struct sip_pvt *
+
+ /* Only append the contact if we are dealing with a strict router */
+ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) {
+- /* 2nd append the Contact: if there is one */
+- /* Can be multiple Contact headers, comma separated values - we just take the first */
+- contact = get_header(req, "Contact");
+- if (!ast_strlen_zero(contact)) {
+- ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
+- /* Look for <: delimited address */
+- c = strchr(contact, '<');
+- if (c) {
+- /* Take to > */
+- ++c;
+- len = strcspn(c, ">") + 1;
+- } else {
+- /* No <> - just take the lot */
+- c = contact;
+- len = strlen(contact) + 1;
+- }
+- thishop = malloc(sizeof(*thishop) + len);
++ /* Duplicate first route from the list */
++ if (head && head->lr) {
++ thishop = (struct sip_route *)malloc(sizeof(struct sip_route)+strlen(head->hop)+1);
+ if (thishop) {
+- ast_copy_string(thishop->hop, c, len);
+- thishop->next = NULL;
+- /* Goes at the end */
+- if (tail)
+- tail->next = thishop;
+- else
+- head = thishop;
++ memcpy(thishop, head, sizeof(struct sip_route)+strlen(head->hop)+1);
++ thishop->next = head;
++ head = thishop;
+ }
++ } else {
++ /* Append the Contact: if there is one and first route is w/o `lr' param */
++ /* Can be multiple Contact headers, comma separated values - we just take the first */
++ contact = get_header(req, "Contact");
++ if (!ast_strlen_zero(contact)) {
++ ast_log(LOG_DEBUG, "build_route: Contact hop: %s\n", contact);
++ /* Look for <: delimited address */
++ c = strchr(contact, '<');
++ if (c) {
++ /* Take to > */
++ ++c;
++ len = strcspn(c, ">") + 1;
++ } else {
++ /* No <> - just take the lot */
++ c = contact;
++ len = strlen(contact) + 1;
++ }
++ thishop = malloc(sizeof(*thishop) + len);
++ if (thishop) {
++ ast_copy_string(thishop->hop, c, len);
++ thishop->next = NULL;
++ /* Goes at the end */
++ if (tail)
++ tail->next = thishop;
++ else
++ head = thishop;
++ }
+ }
}
}
- /* Store as new route */
-@@ -7338,7 +7353,11 @@
- /* Get destination right away */
- gotdest = get_destination(p, NULL);
- get_rdnis(p, NULL);
-- extract_uri(p, req);
-+ build_route(p, req, 0);
-+ if (!p->route->lr)
-+ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
-+ else
-+ extract_uri(p, req);
- build_contact(p);
+@@ -10336,7 +10348,11 @@ static int handle_request_invite(struct
+ gotdest = get_destination(p, NULL);
- if (gotdest) {
-@@ -7366,7 +7385,6 @@
- c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
- *recount = 1;
- /* Save Record-Route for any later requests we make on this dialogue */
-- build_route(p, req, 0);
- if (c) {
- /* Pre-lock the call */
- ast_mutex_lock(&c->lock);
-@@ -7426,6 +7444,14 @@
- transmit_response(p, "180 Ringing", req);
- break;
- case AST_STATE_UP:
-+ /* Assuming this to be reinvite, process new SDP portion */
-+ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
-+ process_sdp(p, req);
-+ } else {
-+ p->jointcapability = p->capability;
-+ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
-+ }
-+
- transmit_response_with_sdp(p, "200 OK", req, 1);
- break;
- default:
+ get_rdnis(p, NULL);
+- extract_uri(p, req);
++ build_route(p, req, 0);
++ if (!p->route->lr)
++ strncpy(p->uri, p->route->hop, sizeof(p->uri) - 1);
++ else
++ extract_uri(p, req);
+ build_contact(p);
+
+ if (gotdest) {
+@@ -10364,7 +10380,6 @@ static int handle_request_invite(struct
+ c = sip_new(p, AST_STATE_DOWN, ast_strlen_zero(p->username) ? NULL : p->username );
+ *recount = 1;
+ /* Save Record-Route for any later requests we make on this dialogue */
+- build_route(p, req, 0);
+ if (c) {
+ /* Pre-lock the call */
+ ast_mutex_lock(&c->lock);
+@@ -10450,6 +10465,13 @@ static int handle_request_invite(struct
+ transmit_response(p, "180 Ringing", req);
+ break;
+ case AST_STATE_UP:
++ /* Assuming this to be reinvite, process new SDP portion */
++ if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
++ process_sdp(p, req);
++ } else {
++ p->jointcapability = p->capability;
++ ast_log(LOG_DEBUG, "Hm.... No sdp for the moment\n");
++ }
+ transmit_response_with_sdp(p, "200 OK", req, 1);
+ break;
+ default:
diff --git a/net/asterisk16/files/patch-channels::chan_zap.c b/net/asterisk16/files/patch-channels::chan_zap.c
index 458a6147..ab02c02 100644
--- a/net/asterisk16/files/patch-channels::chan_zap.c
+++ b/net/asterisk16/files/patch-channels::chan_zap.c
@@ -1,85 +1,65 @@
$FreeBSD$
---- channels/chan_zap.c.orig Sun Feb 17 18:01:44 2002
-+++ channels/chan_zap.c Sun Feb 17 18:03:26 2002
-@@ -46,7 +46,9 @@
- #include <sys/signal.h>
- #include <errno.h>
- #include <stdlib.h>
-+#ifndef __FreeBSD__
- #include <stdint.h>
-+#endif
- #include <unistd.h>
- #include <sys/ioctl.h>
- #ifdef __linux__
-@@ -320,7 +322,7 @@
- #define CALLWAITING_REPEAT_SAMPLES ( (10000 * 8) / READ_SIZE) /* 300 ms */
- #define CIDCW_EXPIRE_SAMPLES ( (500 * 8) / READ_SIZE) /* 500 ms */
- #define MIN_MS_SINCE_FLASH ( (2000) ) /* 2000 ms */
--#define RINGT ( (8000 * 8) / READ_SIZE)
-+#define RINGT ( (8000 * 8) / READ_SIZE) /* 8000 ms */
-
- struct zt_pvt;
-
-@@ -535,6 +537,7 @@
- int cidpos;
+--- channels/chan_zap.c.orig Tue Nov 29 20:24:39 2005
++++ channels/chan_zap.c Fri Jan 13 13:28:33 2006
+@@ -638,6 +638,7 @@ static struct zt_pvt {
int cidlen;
int ringt;
+ int ringt_base;
+ int waitnorings;
int stripmsd;
- int callwaiting;
int callwaitcas;
-@@ -2134,12 +2137,20 @@
-
- if (option_debug)
- ast_log(LOG_DEBUG, "zt_hangup(%s)\n", ast->name);
-+
- if (!ast->pvt->pvt) {
- ast_log(LOG_WARNING, "Asked to hangup channel not connected\n");
- return 0;
+ int callwaitrings;
+@@ -2308,6 +2309,19 @@ static int zt_hangup(struct ast_channel
}
ast_mutex_lock(&p->lock);
++ switch (p->sig) {
++ case SIG_FXSGS:
++ case SIG_FXSKS:
++ case SIG_FXSLS:
++ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
++ {
++ p->waitnorings = 1;
++ }
++ break;
++ default:
++ break;
++ };
+
-+
-+ if((p->sig == SIG_FXSGS) || (p->sig == SIG_FXSKS) || (p->sig == SIG_FXSLS))
-+ if((ast->_state == AST_STATE_RING) && (p->ringt > 1))
-+ {
-+ p->waitnorings = 1;
-+ }
index = zt_get_index(ast, p, 1);
-@@ -5717,7 +5728,37 @@
+@@ -6129,7 +6143,37 @@ static void *ss_thread(void *data)
ast_setstate(chan, AST_STATE_RING);
chan->rings = 1;
- p->ringt = RINGT;
+ p->ringt = p->ringt_base;
+ p->waitnorings = 0;
res = ast_pbx_run(chan);
+
+ if(p->waitnorings)
+ {
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+ for(;;)
+ {
+ int i,j=0;
+ i = ZT_IOMUX_SIGEVENT | ZT_IOMUX_NOWAIT;
-+ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
++ if (ioctl(p->subs[index].zfd, ZT_IOMUX, &i) == -1)
+ break;
-+
-+ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
++
++ if (ioctl(p->subs[index].zfd, ZT_GETEVENT, &j) == -1)
+ break;
-+
++
+ if(j == ZT_EVENT_RINGOFFHOOK)
-+ p->ringt = RINGT;
++ p->ringt = p->ringt_base;
+
+ usleep(20000);
+
+ if (p->ringt <= 0)
+ break;
+
-+ else if (p->ringt > 0)
++ else if (p->ringt > 0)
+ p->ringt--;
+ }
+ p->ringt = 0;
@@ -89,7 +69,7 @@ $FreeBSD$
if (res) {
ast_hangup(chan);
ast_log(LOG_WARNING, "PBX exited non-zero\n");
-@@ -6018,7 +6059,7 @@
+@@ -6431,7 +6475,7 @@ static void *do_monitor(void *data)
i = iflist;
while(i) {
if ((i->subs[SUB_REAL].zfd > -1) && i->sig && (!i->radio)) {
diff --git a/net/asterisk16/files/patch-channels::h323::Makefile b/net/asterisk16/files/patch-channels::h323::Makefile
deleted file mode 100644
index 779096b..0000000
--- a/net/asterisk16/files/patch-channels::h323::Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-
-$FreeBSD$
-
---- channels/h323/Makefile.orig
-+++ channels/h323/Makefile
-@@ -53,7 +53,7 @@
- LIBS+=-lpthread
- endif
- ifeq ($(findstring BSD,${OSARCH}),BSD)
--CFLAGS += -pthread
-+CFLAGS += $(PTHREAD_LIBS)
- endif
- CFLAGS += -D_REENTRANT -D_GNU_SOURCE
- CFLAGS += -DP_HAS_SEMAPHORES -DP_SSL -DP_PTHREADS
-@@ -77,20 +77,20 @@
- ar cr libchanh323.a ast_h323.o
-
- ast_h323.o: ast_h323.cpp
-- $(CXX) -g -c -fno-rtti -o $@ $(CFLAGS) $<
-+ $(CXX) $(CXXFLAGS) -c -fno-rtti -o $@ $(CFLAGS) $<
-
- ifneq ($(wildcard .depend),)
- include .depend
- endif
-
- chan_h323.so:
-- $(CXX) -g -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r -L$(OPENH323DIR)/lib -lh323_linux_x86_r -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_d.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_d -L$(OPENH323DIR)/lib -lh323_linux_x86_d -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
-
- chan_h323_s.so: chan_h323.o ast_h323.o
-- $(CXX) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_linux_x86_r_s -L$(OPENH323DIR)/lib -lh323_linux_x86_r_s -L/usr/lib $(CHANH323LIB)
-+ $(CXX) $(CXXFLAGS) -shared -Xlinker -x -o chan_h323.so chan_h323.o ast_h323.o -L$(PWLIBDIR)/lib -lpt_FreeBSD_x86_r_s -L$(OPENH323DIR)/lib -lh323_FreeBSD_x86_r $(CHANH323LIB)
- clean:
- rm -f *.o *.so core.* libchanh323.a .depend
-
diff --git a/net/asterisk16/files/patch-channels::h323::ast_h323.cpp b/net/asterisk16/files/patch-channels::h323::ast_h323.cpp
new file mode 100644
index 0000000..feb79e5
--- /dev/null
+++ b/net/asterisk16/files/patch-channels::h323::ast_h323.cpp
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.cpp.orig Thu Jan 12 18:16:08 2006
++++ channels/h323/ast_h323.cpp Thu Jan 12 18:16:35 2006
+@@ -953,8 +953,8 @@ BOOL MyH323Connection::OnReceivedCapabil
+ H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capability & capability,
+ H323Channel::Directions dir,
+ unsigned sessionID,
+- const H245_H2250LogicalChannelParameters * /*param*/,
+- RTP_QOS * /*param*/ )
++ const H245_H2250LogicalChannelParameters * /*param*/ /*,
++ RTP_QOS * */ /*param*/ )
+ {
+ return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID);
+ }
diff --git a/net/asterisk16/files/patch-channels::h323::ast_h323.h b/net/asterisk16/files/patch-channels::h323::ast_h323.h
new file mode 100644
index 0000000..606bb01
--- /dev/null
+++ b/net/asterisk16/files/patch-channels::h323::ast_h323.h
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- channels/h323/ast_h323.h.orig Thu Jan 12 18:14:49 2006
++++ channels/h323/ast_h323.h Thu Jan 12 18:15:02 2006
+@@ -155,8 +155,8 @@ class MyH323Connection : public H323Conn
+ H323Channel * CreateRealTimeLogicalChannel(const H323Capability &,
+ H323Channel::Directions,
+ unsigned,
+- const H245_H2250LogicalChannelParameters *,
+- RTP_QOS *);
++ const H245_H2250LogicalChannelParameters * /* ,
++ RTP_QOS * */);
+ H323Connection::AnswerCallResponse OnAnswerCall(const PString &,
+ const H323SignalPDU &,
+ H323SignalPDU &);
diff --git a/net/asterisk16/files/patch-codecs::Makefile b/net/asterisk16/files/patch-codecs::Makefile
index 325e590..ab5cbc4 100644
--- a/net/asterisk16/files/patch-codecs::Makefile
+++ b/net/asterisk16/files/patch-codecs::Makefile
@@ -1,39 +1,48 @@
---- codecs/Makefile.orig Thu Mar 17 20:43:51 2005
-+++ codecs/Makefile Thu Apr 14 00:09:04 2005
-@@ -17,25 +17,23 @@
- # g723.1b)
- #
- #MODG723=codec_g723_1.so codec_g723_1b.so
--MODG723=$(shell [ -f g723.1/coder.c ] && echo "codec_g723_1.so")
--MODG723+=$(shell [ -f g723.1b/coder2.c ] && echo "codec_g723_1b.so")
--MODSPEEX=$(shell [ -f /usr/include/speex.h ] || [ -f /usr/include/speex/speex.h ] || [ -f /usr/local/include/speex.h ] || [ -f /usr/local/include/speex/speex.h ] && echo "codec_speex.so")
--MODILBC=$(shell [ -f ilbc/iLBC_decode.h ] && echo "codec_ilbc.so")
-+MODG723=codec_g723_1_dummy.so
-+MODG729=codec_g729_dummy.so
-+MODSPEEX=codec_speex.so
-+MODILBC=codec_ilbc.so
- CFLAGS+=-fPIC
--CFLAGS+=$(shell [ -f /usr/local/include/speex.h ] && echo "-I/usr/local/include")
--CFLAGS+=$(shell [ -f /usr/local/include/speex/speex.h ] && echo "-I/usr/local/include/speex")
--CFLAGS+=$(shell [ -f /usr/include/speex/speex.h ] && echo "-I/usr/include/speex")
-+CFLAGS+=-I$(LOCALBASE)/include
+
+$FreeBSD$
+
+--- codecs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ codecs/Makefile Fri Jan 13 10:33:21 2006
+@@ -30,8 +30,8 @@
- LIBG723=g723.1/libg723.a
- LIBG723B=g723.1b/libg723b.a
- LIBGSM=gsm/lib/libgsm.a
- LIBGSMT=gsm/lib/libgsm.a
+ UI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex.h)
+ UIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/include/speex/speex.h)
+-ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex.h)
+-ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/speex/speex.h)
++ULI_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex.h)
++ULIS_SPEEX=$(wildcard $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex/speex.h)
+ ifneq (${UI_SPEEX},)
+ MODSPEEX=codec_speex.so
+ LIBSPEEX+=-lspeex -lm
+@@ -43,14 +43,14 @@
+ endif
+ ifneq (${ULI_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+ ifneq (${ULIS_SPEEX},)
+ MODSPEEX=codec_speex.so
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include/speex
+- LIBSPEEX=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/speex
++ LIBSPEEX=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ LIBSPEEX+=-lspeex -lm
+ endif
+
+@@ -65,7 +65,7 @@
LIBLPC10=lpc10/liblpc10.a
--LIBSPEEX=$(shell [ -f /usr/local/lib/libspeex.a ] && echo "-L/usr/local/lib")
-+LIBSPEEX=-L$(LOCALBASE)/lib
- LIBSPEEX+=-lspeex -lm
- LIBILBC=ilbc/libilbc.a
--CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
-+CODECS+=$(MODG723) $(MODG729) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
- codec_adpcm.so codec_ulaw.so codec_alaw.so codec_a_mu.so \
- codec_g726.so
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
-@@ -93,7 +91,7 @@
+ CODECS+=$(MODG723) $(MODSPEEX) $(MODILBC) codec_gsm.so codec_lpc10.so \
+@@ -126,7 +126,7 @@
endif
install: all
diff --git a/net/asterisk16/files/patch-codecs::codec_g723_1_dummy.c b/net/asterisk16/files/patch-codecs::codec_g723_1_dummy.c
deleted file mode 100644
index 3ce9571..0000000
--- a/net/asterisk16/files/patch-codecs::codec_g723_1_dummy.c
+++ /dev/null
@@ -1,314 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g723_1_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g723_1_dummy.c Sun Oct 10 16:07:05 2004
-@@ -0,0 +1,308 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.723.1 (dummy!)
-+ *
-+ * The G.723.1 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#define TYPE_HIGH 0x0
-+#define TYPE_LOW 0x1
-+#define TYPE_SILENCE 0x2
-+#define TYPE_DONTSEND 0x3
-+#define TYPE_MASK 0x3
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g723_ex.h"
-+#include "g723_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.723.1/PCM16 Codec Translator";
-+
-+struct g723_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g723_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g723tolin_new()
-+{
-+ struct g723_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog723_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g723_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g723_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g723_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g723tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G723_1;
-+ f.datalen = sizeof(g723_slin_ex);
-+ /* All frames are 30 ms long */
-+ f.samples = 30;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g723_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog723_new()
-+{
-+ struct g723_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g723_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g723tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g723_len(unsigned char buf)
-+{
-+ switch(buf & TYPE_MASK) {
-+ case TYPE_DONTSEND:
-+ return 2;
-+ break;
-+ case TYPE_SILENCE:
-+ return 4;
-+ break;
-+ case TYPE_HIGH:
-+ return 24;
-+ break;
-+ case TYPE_LOW:
-+ return 20;
-+ break;
-+ default:
-+ ast_log(LOG_WARNING, "Badly encoded frame (%d)\n", buf & TYPE_MASK);
-+ }
-+ return -1;
-+}
-+
-+static int g723tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g723_decoder_pvt *tmp = (struct g723_decoder_pvt *)pvt;
-+ int len = 0;
-+ int res;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ res = g723_len(((unsigned char *)f->data + len)[0]);
-+ if (res < 0) {
-+ ast_log(LOG_WARNING, "Invalid data\n");
-+ return -1;
-+ }
-+ if (res + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 480 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 480);
-+ tmp->tail+=480;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += res;
-+ }
-+ return 0;
-+}
-+
-+static int lintog723_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog723_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g723_encoder_pvt *tmp = (struct g723_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 480)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G723_1;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 480) {
-+ /* Encode a frame of data */
-+ if (cnt + 24 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 24);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 30;
-+ cnt += 24;
-+ tmp->tail -= 480;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 480, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g723_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g723tolin =
-+ { "g723tolin_dummy",
-+ AST_FORMAT_G723_1, AST_FORMAT_SLINEAR,
-+ g723tolin_new,
-+ g723tolin_framein,
-+ g723tolin_frameout,
-+ g723_destroy,
-+ g723tolin_sample
-+ };
-+
-+static struct ast_translator lintog723 =
-+ { "lintog723_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G723_1,
-+ lintog723_new,
-+ lintog723_framein,
-+ lintog723_frameout,
-+ g723_destroy,
-+ lintog723_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog723);
-+ if (!res)
-+ res = ast_unregister_translator(&g723tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g723tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog723);
-+ else
-+ ast_unregister_translator(&g723tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk16/files/patch-codecs::codec_g729_dummy.c b/net/asterisk16/files/patch-codecs::codec_g729_dummy.c
deleted file mode 100644
index 9fcc7b1..0000000
--- a/net/asterisk16/files/patch-codecs::codec_g729_dummy.c
+++ /dev/null
@@ -1,281 +0,0 @@
-
-$FreeBSD$
-
---- codecs/codec_g729_dummy.c.orig Sun Oct 10 16:05:56 2004
-+++ codecs/codec_g729_dummy.c Sun Oct 10 16:07:12 2004
-@@ -0,0 +1,275 @@
-+/*
-+ * Asterisk -- A telephony toolkit for Linux.
-+ *
-+ * Translate between signed linear and G.729 (dummy!)
-+ *
-+ * The G.729 code is not included in the Asterisk distribution because
-+ * it is covered with patents, and in spite of statements to the contrary,
-+ * the "technology" is extremely expensive to license.
-+ *
-+ * Copyright (C) 1999, Mark Spencer
-+ *
-+ * Mark Spencer <markster@linux-support.net>
-+ *
-+ * This program is free software, distributed under the terms of
-+ * the GNU General Public License
-+ */
-+
-+#include <sys/types.h>
-+#include <asterisk/translate.h>
-+#include <asterisk/module.h>
-+#include <asterisk/logger.h>
-+#include <asterisk/channel.h>
-+#include <pthread.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
-+#include <unistd.h>
-+#include <netinet/in.h>
-+#include <string.h>
-+#include <stdio.h>
-+
-+/* Sample frame data */
-+#include "slin_g729_ex.h"
-+#include "g729_slin_ex.h"
-+
-+AST_MUTEX_DEFINE_STATIC(localuser_lock);
-+static int localusecnt=0;
-+
-+static char *tdesc = "Dummy G.729/PCM16 Codec Translator";
-+
-+struct g729_encoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Buffer for our outgoing frame */
-+ char outbuf[8000];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+struct g729_decoder_pvt {
-+ struct ast_frame f;
-+ /* Space to build offset */
-+ char offset[AST_FRIENDLY_OFFSET];
-+ /* Enough to store a full second */
-+ short buf[8000];
-+ int tail;
-+};
-+
-+static struct ast_translator_pvt *g729tolin_new()
-+{
-+ struct g729_decoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_decoder_pvt));
-+ if (tmp) {
-+ tmp->tail = 0;
-+ localusecnt++;
-+ ast_update_use_count();
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *lintog729_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_SLINEAR;
-+ f.datalen = sizeof(slin_g729_ex);
-+ /* Assume 8000 Hz */
-+ f.samples = sizeof(slin_g729_ex)/16;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = slin_g729_ex;
-+ return &f;
-+}
-+
-+static struct ast_frame *g729tolin_sample()
-+{
-+ static struct ast_frame f;
-+ f.frametype = AST_FRAME_VOICE;
-+ f.subclass = AST_FORMAT_G729A;
-+ f.datalen = sizeof(g729_slin_ex);
-+ /* All frames are 10 ms long */
-+ f.samples = 10;
-+ f.mallocd = 0;
-+ f.offset = 0;
-+ f.src = __PRETTY_FUNCTION__;
-+ f.data = g729_slin_ex;
-+ return &f;
-+}
-+
-+static struct ast_translator_pvt *lintog729_new()
-+{
-+ struct g729_encoder_pvt *tmp;
-+ tmp = malloc(sizeof(struct g729_encoder_pvt));
-+ if (tmp) {
-+ localusecnt++;
-+ ast_update_use_count();
-+ tmp->tail = 0;
-+ }
-+ return (struct ast_translator_pvt *)tmp;
-+}
-+
-+static struct ast_frame *g729tolin_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ if (!tmp->tail)
-+ return NULL;
-+ /* Signed linear is no particular frame size, so just send whatever
-+ we have in the buffer in one lump sum */
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_SLINEAR;
-+ tmp->f.datalen = tmp->tail * 2;
-+ /* Assume 8000 Hz */
-+ tmp->f.samples = tmp->tail / 8;
-+ tmp->f.mallocd = 0;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.data = tmp->buf;
-+ /* Reset tail pointer */
-+ tmp->tail = 0;
-+
-+ return &tmp->f;
-+}
-+
-+static int g729tolin_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ struct g729_decoder_pvt *tmp = (struct g729_decoder_pvt *)pvt;
-+ int len = 0;
-+ while(len < f->datalen) {
-+ /* Assuming there's space left, decode into the current buffer at
-+ the tail location */
-+ if (10 + len > f->datalen) {
-+ ast_log(LOG_WARNING, "Measured length exceeds frame length\n");
-+ return -1;
-+ }
-+ if (tmp->tail + 160 < sizeof(tmp->buf)/2) {
-+ memset(tmp->buf + tmp->tail, 0, 160);
-+ tmp->tail+=160;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ len += 10;
-+ }
-+ return 0;
-+}
-+
-+static int lintog729_framein(struct ast_translator_pvt *pvt, struct ast_frame *f)
-+{
-+ /* Just add the frames to our stream */
-+ /* XXX We should look at how old the rest of our stream is, and if it
-+ is too old, then we should overwrite it entirely, otherwise we can
-+ get artifacts of earlier talk that do not belong */
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ if (tmp->tail + f->datalen/2 < sizeof(tmp->buf) / 2) {
-+ memcpy(&tmp->buf[tmp->tail], f->data, f->datalen);
-+ tmp->tail += f->datalen/2;
-+ } else {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return -1;
-+ }
-+ return 0;
-+}
-+
-+static struct ast_frame *lintog729_frameout(struct ast_translator_pvt *pvt)
-+{
-+ struct g729_encoder_pvt *tmp = (struct g729_encoder_pvt *)pvt;
-+ int cnt=0;
-+ /* We can't work on anything less than a frame in size */
-+ if (tmp->tail < 160)
-+ return NULL;
-+ tmp->f.frametype = AST_FRAME_VOICE;
-+ tmp->f.subclass = AST_FORMAT_G729A;
-+ tmp->f.offset = AST_FRIENDLY_OFFSET;
-+ tmp->f.src = __PRETTY_FUNCTION__;
-+ tmp->f.samples = 0;
-+ tmp->f.mallocd = 0;
-+ while(tmp->tail >= 160) {
-+ /* Encode a frame of data */
-+ if (cnt + 10 >= sizeof(tmp->outbuf)) {
-+ ast_log(LOG_WARNING, "Out of buffer space\n");
-+ return NULL;
-+ }
-+ memset(tmp->outbuf + cnt, 0, 10);
-+ /* Assume 8000 Hz */
-+ tmp->f.samples += 10;
-+ cnt += 10;
-+ tmp->tail -= 160;
-+ /* Move the data at the end of the buffer to the front */
-+ if (tmp->tail)
-+ memmove(tmp->buf, tmp->buf + 160, tmp->tail * 2);
-+ }
-+ tmp->f.datalen = cnt;
-+ tmp->f.data = tmp->outbuf;
-+ return &tmp->f;
-+}
-+
-+static void g729_destroy(struct ast_translator_pvt *pvt)
-+{
-+ free(pvt);
-+ localusecnt--;
-+ ast_update_use_count();
-+}
-+
-+static struct ast_translator g729tolin =
-+ { "g729tolin_dummy",
-+ AST_FORMAT_G729A, AST_FORMAT_SLINEAR,
-+ g729tolin_new,
-+ g729tolin_framein,
-+ g729tolin_frameout,
-+ g729_destroy,
-+ g729tolin_sample
-+ };
-+
-+static struct ast_translator lintog729 =
-+ { "lintog729_dummy",
-+ AST_FORMAT_SLINEAR, AST_FORMAT_G729A,
-+ lintog729_new,
-+ lintog729_framein,
-+ lintog729_frameout,
-+ g729_destroy,
-+ lintog729_sample
-+ };
-+
-+int unload_module(void)
-+{
-+ int res;
-+ ast_mutex_lock(&localuser_lock);
-+ res = ast_unregister_translator(&lintog729);
-+ if (!res)
-+ res = ast_unregister_translator(&g729tolin);
-+ if (localusecnt)
-+ res = -1;
-+ ast_mutex_unlock(&localuser_lock);
-+ return res;
-+}
-+
-+int load_module(void)
-+{
-+ int res;
-+ res=ast_register_translator(&g729tolin);
-+ if (!res)
-+ res=ast_register_translator(&lintog729);
-+ else
-+ ast_unregister_translator(&g729tolin);
-+ return res;
-+}
-+
-+char *description(void)
-+{
-+ return tdesc;
-+}
-+
-+int usecount(void)
-+{
-+ int res;
-+ STANDARD_USECOUNT(res);
-+ return res;
-+}
-+
-+char *key()
-+{
-+ return ASTERISK_GPL_KEY;
-+}
diff --git a/net/asterisk16/files/patch-codecs::g729_slin_ex.h b/net/asterisk16/files/patch-codecs::g729_slin_ex.h
deleted file mode 100644
index 44e60f2..0000000
--- a/net/asterisk16/files/patch-codecs::g729_slin_ex.h
+++ /dev/null
@@ -1,20 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/g729_slin_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,14 @@
-+/*
-+ * g729_slin_ex.h --
-+ *
-+ * 8-bit G.729 data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Copyright (C) 2004, Maxim Sobolev <sobomax@FreeBSD.org>
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static unsigned char g729_slin_ex[] = {
-+120,82,175,64,0,250,219,0,7,214
-+};
diff --git a/net/asterisk16/files/patch-codecs::ilbc::Makefile b/net/asterisk16/files/patch-codecs::ilbc::Makefile
index 7770e07..26a2f20 100644
--- a/net/asterisk16/files/patch-codecs::ilbc::Makefile
+++ b/net/asterisk16/files/patch-codecs::ilbc::Makefile
@@ -1,11 +1,12 @@
$FreeBSD$
---- codecs/ilbc/Makefile.orig Sun Apr 27 21:13:11 2003
-+++ codecs/ilbc/Makefile Fri Jan 30 01:47:34 2004
-@@ -1,4 +1,4 @@
--CFLAGS+= -fPIC -O3
-+CFLAGS+= -fPIC
- LIB=libilbc.a
-
- OBJS= anaFilter.o iCBSearch.o packing.o \
+--- codecs/ilbc/Makefile.orig Fri Jan 13 11:01:07 2006
++++ codecs/ilbc/Makefile Fri Jan 13 11:01:51 2006
+@@ -1,5 +1,5 @@
+ ARCH=$(PROC)
+-CFLAGS+=-Wall -O3 -funroll-loops
++CFLAGS+=-Wall -funroll-loops
+ ifneq (${OSARCH},CYGWIN)
+ CFLAGS += -fPIC
+ endif
diff --git a/net/asterisk16/files/patch-codecs::slin_g729_ex.h b/net/asterisk16/files/patch-codecs::slin_g729_ex.h
deleted file mode 100644
index e1236d2..0000000
--- a/net/asterisk16/files/patch-codecs::slin_g729_ex.h
+++ /dev/null
@@ -1,31 +0,0 @@
-
-$FreeBSD$
-
---- /dev/null Fri Jan 30 01:52:11 2004
-+++ codecs/slin_g729_ex.h Fri Jan 30 01:57:59 2004
-@@ -0,0 +1,25 @@
-+/*
-+ * slin_g729_ex.h --
-+ *
-+ * Signed 16-bit audio data, 10 milliseconds worth at 8 kHz.
-+ *
-+ * Source: g723.example
-+ *
-+ * Copyright (C) 2001, Linux Support Services, Inc.
-+ *
-+ * Distributed under the terms of the GNU General Public License
-+ *
-+ */
-+
-+static signed short slin_g729_ex[] = {
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
-+};
diff --git a/net/asterisk16/files/patch-configs::musiconhold.conf.sample b/net/asterisk16/files/patch-configs::musiconhold.conf.sample
new file mode 100644
index 0000000..ff63cc9
--- /dev/null
+++ b/net/asterisk16/files/patch-configs::musiconhold.conf.sample
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- configs/musiconhold.conf.sample.orig Tue Nov 29 20:24:39 2005
++++ configs/musiconhold.conf.sample Fri Jan 13 11:38:39 2006
+@@ -4,7 +4,7 @@
+
+ [default]
+ mode=quietmp3
+-directory=/var/lib/asterisk/mohmp3
++directory=/usr/local/share/asterisk/mohmp3
+
+ ; valid mode options:
+ ; quietmp3 -- default
diff --git a/net/asterisk16/files/patch-db.c b/net/asterisk16/files/patch-db.c
index 6c2bdcd..ba7f3f2 100644
--- a/net/asterisk16/files/patch-db.c
+++ b/net/asterisk16/files/patch-db.c
@@ -1,14 +1,21 @@
$FreeBSD$
---- db.c.orig Fri Jul 9 13:08:09 2004
-+++ db.c Sun Oct 10 15:32:33 2004
-@@ -33,7 +33,7 @@
- #include <asterisk/cli.h>
- #include <asterisk/utils.h>
- #include <asterisk/lock.h>
--#include "db1-ast/include/db.h"
+--- db.c.orig Fri Jan 13 11:05:32 2006
++++ db.c Fri Jan 13 11:06:55 2006
+@@ -35,6 +35,7 @@
+ #include <errno.h>
+ #include <unistd.h>
+ #include <dirent.h>
+#include <db.h>
+
#include "asterisk.h"
- #include "astconf.h"
+@@ -51,7 +52,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
+ #include "asterisk/utils.h"
+ #include "asterisk/lock.h"
+ #include "asterisk/manager.h"
+-#include "db1-ast/include/db.h"
+
+ #ifdef __CYGWIN__
+ #define dbopen __dbopen
diff --git a/net/asterisk16/files/patch-formats::Makefile b/net/asterisk16/files/patch-formats::Makefile
index dacfd7b..b2b1db5 100644
--- a/net/asterisk16/files/patch-formats::Makefile
+++ b/net/asterisk16/files/patch-formats::Makefile
@@ -1,19 +1,19 @@
$FreeBSD$
---- formats/Makefile.orig Tue Nov 4 04:40:09 2003
-+++ formats/Makefile Fri Jan 30 01:47:34 2004
-@@ -18,7 +18,7 @@
+--- formats/Makefile.orig Fri Jan 13 11:16:07 2006
++++ formats/Makefile Fri Jan 13 11:47:25 2006
+@@ -20,7 +20,7 @@
#
- # G723 simple frame is depricated
+ # G723 simple frame is deprecated
#
--#FORMAT_LIBS+=format_g723.so
+-FORMAT_LIBS+=format_g723.so
+FORMAT_LIBS+=format_g723_1.so
- GSMLIB=../codecs/gsm/lib/libgsm.a
-
-@@ -40,7 +40,7 @@
- $(CC) $(SOLINK) -o $@ $< -lm
+ #
+ # OGG/Vorbis format
+@@ -60,7 +60,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} -logg -lvorbis -lvorbisenc -lm
install: all
- for x in $(FORMAT_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
diff --git a/net/asterisk16/files/patch-formats::format_g723_1.c b/net/asterisk16/files/patch-formats::format_g723_1.c
index fb5eb12..ae814f1 100644
--- a/net/asterisk16/files/patch-formats::format_g723_1.c
+++ b/net/asterisk16/files/patch-formats::format_g723_1.c
@@ -1,9 +1,9 @@
$FreeBSD$
---- formats/format_g723_1.c.orig Sun Oct 10 15:59:18 2004
-+++ formats/format_g723_1.c Sun Oct 10 16:05:05 2004
-@@ -0,0 +1,345 @@
+--- /dev/null Fri Jan 13 12:18:51 2006
++++ formats/format_g723_1.c Fri Jan 13 12:18:41 2006
+@@ -0,0 +1,348 @@
+/*
+ * Asterisk -- A telephony toolkit for Linux.
+ *
@@ -16,6 +16,7 @@ $FreeBSD$
+ * the GNU General Public License
+ */
+
++#include <stdio.h>
+#include <asterisk/lock.h>
+#include <asterisk/channel.h>
+#include <asterisk/file.h>
@@ -26,7 +27,6 @@ $FreeBSD$
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <sys/time.h>
-+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
@@ -48,7 +48,7 @@ $FreeBSD$
+struct ast_filestream {
+ void *reserved[AST_RESERVED_POINTERS];
+ /* This is what a filestream means to us */
-+ int fd; /* Descriptor */
++ FILE *f; /* Descriptor */
+ struct ast_frame fr; /* Frame information */
+ char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
+ char empty; /* Empty character */
@@ -85,7 +85,7 @@ $FreeBSD$
+ return -1;
+}
+
-+static struct ast_filestream *g723_open(int fd)
++static struct ast_filestream *g723_open(FILE *f)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -98,7 +98,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ tmp->fr.data = tmp->g723;
+ tmp->fr.frametype = AST_FRAME_VOICE;
+ tmp->fr.subclass = AST_FORMAT_G723_1;
@@ -112,7 +112,7 @@ $FreeBSD$
+ return tmp;
+}
+
-+static struct ast_filestream *g723_rewrite(int fd, char *comment)
++static struct ast_filestream *g723_rewrite(FILE *f, const char *comment)
+{
+ /* We don't have any header to read or anything really, but
+ if we did, it would go here. We also might want to check
@@ -125,7 +125,7 @@ $FreeBSD$
+ free(tmp);
+ return NULL;
+ }
-+ tmp->fd = fd;
++ tmp->f = f;
+ glistcnt++;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
@@ -143,7 +143,7 @@ $FreeBSD$
+ glistcnt--;
+ ast_mutex_unlock(&g723_lock);
+ ast_update_use_count();
-+ close(s->fd);
++ fclose(s->f);
+ free(s);
+ s = NULL;
+}
@@ -158,7 +158,7 @@ $FreeBSD$
+ s->fr.samples = 240;
+ s->fr.mallocd = 0;
+ s->fr.data = s->g723;
-+ if ((res = read(s->fd, s->g723, 1)) != 1) {
++ if ((res = fread(s->g723, 1, 1, s->f)) != 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -168,7 +168,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 frame!\n");
+ return NULL;
+ }
-+ if (s->fr.datalen > 1 && (res = read(s->fd, s->g723 + 1, s->fr.datalen - 1)) != s->fr.datalen - 1) {
++ if (s->fr.datalen > 1 && (res = fread(s->g723 + 1, 1, s->fr.datalen - 1, s->f)) != s->fr.datalen - 1) {
+ if (res)
+ ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
+ return NULL;
@@ -200,7 +200,7 @@ $FreeBSD$
+ ast_log(LOG_WARNING, "Invalid G723.1 data length, %d\n", f->datalen);
+ return -1;
+ }
-+ if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
++ if ((res = fwrite(f->data, 1, f->datalen, fs->f)) != f->datalen) {
+ ast_log(LOG_WARNING, "Bad write %d: %s\n", res, strerror(errno));
+ return -1;
+ }
@@ -229,10 +229,13 @@ $FreeBSD$
+ }
+ offset = cur + sample_offset;
+ }
-+ if ((moffset = lseek(fs->fd, 0, SEEK_END)) == -1) {
++ if (fseeko(fs->f, 0, SEEK_END) == -1) {
+ ast_log(LOG_WARNING, "Can't seek stream to an end!\n");
+ return -1;
+ }
++ else {
++ moffset = ftello(fs->f);
++ }
+ if (whence == SEEK_END) {
+ if ((max = g723_tell(fs)) == -1) {
+ ast_log(LOG_WARNING, "Can't get maximum position!\n");
@@ -244,11 +247,11 @@ $FreeBSD$
+ offset = 0;
+ soffset = -1;
+ for (coffset = 0; coffset < moffset && offset > 0; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %lli!\n", coffset);
+ return -1;
+ }
@@ -260,7 +263,7 @@ $FreeBSD$
+ if (res > 1)
+ offset -= 240;
+ }
-+ if (soffset != -1 && lseek(fs->fd, soffset, SEEK_SET) != soffset) {
++ if (soffset != -1 && fseeko(fs->f, soffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %lli!\n", soffset);
+ return -1;
+ }
@@ -271,7 +274,7 @@ $FreeBSD$
+static int g723_trunc(struct ast_filestream *fs)
+{
+ /* Truncate file to current length */
-+ if (ftruncate(fs->fd, lseek(fs->fd, 0, SEEK_CUR)) < 0)
++ if (ftruncate(fileno(fs->f), ftello(fs->f)) < 0)
+ return -1;
+ return 0;
+}
@@ -283,14 +286,14 @@ $FreeBSD$
+ long rval;
+ unsigned char c;
+
-+ offset = lseek(fs->fd, 0, SEEK_CUR);
++ offset = ftello(fs->f);
+ rval = 0;
+ for (coffset = 0; coffset < offset; coffset += res) {
-+ if (lseek(fs->fd, coffset, SEEK_SET) != coffset) {
++ if (fseeko(fs->f, coffset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", coffset);
+ return -1;
+ }
-+ if (read(fs->fd, &c, 1) != 1) {
++ if (fread(&c, 1, 1, fs->f) != 1) {
+ ast_log(LOG_WARNING, "Can't read from offset %llu!\n", coffset);
+ return -1;
+ }
@@ -301,7 +304,7 @@ $FreeBSD$
+ if (res > 1)
+ rval += 240;
+ }
-+ if (lseek(fs->fd, offset, SEEK_SET) != offset) {
++ if (fseeko(fs->f, offset, SEEK_SET) == -1) {
+ ast_log(LOG_WARNING, "Can't seek to offset %llu!\n", offset);
+ return -1;
+ }
diff --git a/net/asterisk16/files/patch-formats::format_g729.c b/net/asterisk16/files/patch-formats::format_g729.c
index 78899a3..11be528 100644
--- a/net/asterisk16/files/patch-formats::format_g729.c
+++ b/net/asterisk16/files/patch-formats::format_g729.c
@@ -1,6 +1,9 @@
---- formats/format_g729.c.orig Mon Feb 7 10:29:19 2005
-+++ formats/format_g729.c Wed Mar 9 06:26:36 2005
-@@ -44,7 +44,7 @@
+
+$FreeBSD$
+
+--- formats/format_g729.c.orig Fri Jan 13 12:20:53 2006
++++ formats/format_g729.c Fri Jan 13 12:23:33 2006
+@@ -60,7 +60,7 @@ struct ast_filestream {
struct ast_frame fr; /* Frame information */
char waste[AST_FRIENDLY_OFFSET]; /* Buffer for sending frames, etc */
char empty; /* Empty character */
@@ -9,7 +12,7 @@
};
-@@ -125,11 +125,11 @@
+@@ -141,11 +141,11 @@ static struct ast_frame *g729_read(struc
s->fr.frametype = AST_FRAME_VOICE;
s->fr.subclass = AST_FORMAT_G729A;
s->fr.offset = AST_FRIENDLY_OFFSET;
@@ -19,24 +22,24 @@
+ s->fr.datalen = 10;
s->fr.mallocd = 0;
s->fr.data = s->g729;
-- if ((res = read(s->fd, s->g729, 20)) != 20) {
-+ if ((res = read(s->fd, s->g729, 10)) != 10) {
+- if ((res = fread(s->g729, 1, 20, s->f)) != 20) {
++ if ((res = fread(s->g729, 1, 10, s->f)) != 10) {
if (res && (res != 10))
ast_log(LOG_WARNING, "Short read (%d) (%s)!\n", res, strerror(errno));
return NULL;
-@@ -173,7 +173,7 @@
- cur = lseek(fs->fd, 0, SEEK_CUR);
- max = lseek(fs->fd, 0, SEEK_END);
+@@ -190,7 +190,7 @@ static int g729_seek(struct ast_filestre
+ fseek(fs->f, 0, SEEK_END);
+ max = ftell(fs->f);
- bytes = 20 * (sample_offset / 160);
+ bytes = 10 * (sample_offset / 80);
if (whence == SEEK_SET)
offset = bytes;
else if (whence == SEEK_CUR || whence == SEEK_FORCECUR)
-@@ -202,7 +202,7 @@
+@@ -219,7 +219,7 @@ static long g729_tell(struct ast_filestr
{
off_t offset;
- offset = lseek(fs->fd, 0, SEEK_CUR);
+ offset = ftell(fs->f);
- return (offset/20)*160;
+ return (offset/10)*80;
}
diff --git a/net/asterisk16/files/patch-funcs::Makefile b/net/asterisk16/files/patch-funcs::Makefile
new file mode 100644
index 0000000..a14daee
--- /dev/null
+++ b/net/asterisk16/files/patch-funcs::Makefile
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- funcs/Makefile.orig Tue Nov 29 20:24:39 2005
++++ funcs/Makefile Fri Jan 13 12:36:57 2006
+@@ -67,7 +67,7 @@
+ $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}
+
+ install: all
+- for x in $(FUNCS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
++ for x in $(FUNCS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
+
+ ifneq ($(wildcard .depend),)
+ include .depend
diff --git a/net/asterisk16/files/patch-pbx::Makefile b/net/asterisk16/files/patch-pbx::Makefile
index dca6672..97d03e1 100644
--- a/net/asterisk16/files/patch-pbx::Makefile
+++ b/net/asterisk16/files/patch-pbx::Makefile
@@ -1,18 +1,20 @@
$FreeBSD$
---- pbx/Makefile.orig Sun Oct 26 20:50:49 2003
-+++ pbx/Makefile Fri Jan 30 01:47:34 2004
-@@ -16,7 +16,7 @@
- PBX_LIBS=pbx_config.so pbx_wilcalu.so pbx_spool.so # pbx_gtkconsole.so pbx_kdeconsole.so
-
- # Add GTK console if appropriate
--PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
-+#PBX_LIBS+=$(shell gtk-config --cflags >/dev/null 2>/dev/null && echo "pbx_gtkconsole.so")
+--- pbx/Makefile.orig
++++ pbx/Makefile
+@@ -23,8 +23,8 @@
# Add KDE Console if appropriate
#PBX_LIBS+=$(shell [ "$$QTDIR" != "" ] && echo "pbx_kdeconsole.so")
-@@ -62,7 +62,7 @@
+-GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
+-GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
++#GTK_FLAGS=`${CROSS_COMPILE_BIN}gtk-config --cflags gthread`
++#GTK_LIBS=`${CROSS_COMPILE_BIN}gtk-config --libs gthread`
+ MOC=$(QTDIR)/bin/moc
+ KDE_FLAGS=-I$(KDEDIR)/include -I$(KDEDIR)/include/kde -I$(QTDIR)/include
+ KDE_LIBS=-L$(KDEDIR)/lib -L$(QTDIR)/lib -lqt -lkdecore -lkdeui
+@@ -72,7 +72,7 @@
endif
install: all
diff --git a/net/asterisk16/files/patch-pbx::pbx_wilcalu.c b/net/asterisk16/files/patch-pbx::pbx_wilcalu.c
deleted file mode 100644
index 41722c6..0000000
--- a/net/asterisk16/files/patch-pbx::pbx_wilcalu.c
+++ /dev/null
@@ -1,14 +0,0 @@
---- pbx/pbx_wilcalu.c.orig Tue Apr 26 10:00:28 2005
-+++ pbx/pbx_wilcalu.c Tue Apr 26 10:03:42 2005
-@@ -82,6 +82,11 @@
- fds[0].events = POLLIN;
- poll(fds, 1, -1);
- bytes=read(fd,buf,256);
-+ if (bytes <= 0) {
-+ /* XXX error on device, sleep a bit before retrying */
-+ sleep(1);
-+ continue;
-+ }
- buf[(int)bytes]=0;
-
- if(bytes>0){
diff --git a/net/asterisk16/files/patch-res-res_watchdog.c b/net/asterisk16/files/patch-res-res_watchdog.c
deleted file mode 100644
index 51e4b0a..0000000
--- a/net/asterisk16/files/patch-res-res_watchdog.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- res/res_watchdog.c.orig Fri Jul 15 13:24:24 2005
-+++ res/res_watchdog.c Fri Jul 15 13:24:42 2005
-@@ -40,6 +40,10 @@
-
- /* Registrar for operations */
-
-+#ifndef O_SYNC
-+#define O_SYNC O_FSYNC
-+#endif
-+
- static struct watchdog_pvt *watchdogs = NULL;
-
- STANDARD_LOCAL_USER;
diff --git a/net/asterisk16/files/patch-res::Makefile b/net/asterisk16/files/patch-res::Makefile
index 3e48e84..de5c365 100644
--- a/net/asterisk16/files/patch-res::Makefile
+++ b/net/asterisk16/files/patch-res::Makefile
@@ -1,33 +1,35 @@
---- res/Makefile.orig Tue Aug 9 17:18:55 2005
-+++ res/Makefile Tue Aug 9 17:33:36 2005
-@@ -13,15 +13,18 @@
+
+$FreeBSD$
+
+--- res/Makefile
++++ res/Makefile
+@@ -37,8 +37,8 @@
+ endif
- MODS=res_adsi.so res_features.so res_crypto.so res_musiconhold.so res_indications.so res_monitor.so \
- res_agi.so res_watchdog.so
--MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
--MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
-+#MODS+=$(shell if [ -f "/usr/local/include/odbcinst.h" ]; then echo "res_odbc.so res_config_odbc.so"; fi)
- MODS+=$(shell if [ -f "/usr/include/osp/osp.h" ]; then echo "res_osp.so"; fi)
-
- CRYPTO_LIBS=-lssl -lcrypto
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include
+- SOLINK+=-L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include
++ SOLINK+=-L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+ ifeq (${OSARCH},CYGWIN)
+@@ -55,9 +55,7 @@
CFLAGS+=
- CFLAGS+=$(shell [ -f /usr/include/linux/zaptel.h ] && echo " -DZAPATA_MOH")
--CFLAGS+=$(shell [ -f /usr/local/include/zaptel.h ] && echo " -DZAPATA_MOH")
-+CFLAGS+=-I$(LOCALBASE)/include
-+ifdef WITH_ZAPTEL
-+CFLAGS+=-DZAPATA_MOH
-+endif
- #
- # Work around buggy RedHat 9.0
+
+ ifndef WITHOUT_ZAPTEL
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/linux/zaptel.h)$(wildcard $(CROSS_COMPILE_TARGET)/usr/local/include/zaptel.h),)
+ CFLAGS+=-DZAPATA_MOH
+-endif
+ endif # WITHOUT_ZAPTEL
+
#
-@@ -34,7 +37,7 @@
+@@ -75,7 +73,7 @@
rm -f $(DESTDIR)$(ASTHEADERDIR)/parking.h
rm -f $(DESTDIR)$(MODULES_DIR)/app_agi.so
rm -f $(DESTDIR)$(MODULES_DIR)/res_parking.so
- for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+ for x in $(MODS); do $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(MODULES_DIR) ; done
-
- res_crypto.so: res_crypto.o
- $(CC) $(SOLINK) -o $@ $< $(CRYPTO_LIBS)
+ @if [ x`which mpg123 2>/dev/null | grep -v '^no'` != x ] ; then \
+ if mpg123 --longhelp 2>&1 | grep -q .59r 2>&1 >/dev/null ; then echo ; else \
+ echo "*************************************************************";\
diff --git a/net/asterisk16/files/patch-rtp.c b/net/asterisk16/files/patch-rtp.c
index c652add..bbc2649 100644
--- a/net/asterisk16/files/patch-rtp.c
+++ b/net/asterisk16/files/patch-rtp.c
@@ -1,23 +1,17 @@
---- rtp.c.orig Tue Apr 26 10:00:28 2005
-+++ rtp.c Tue Apr 26 10:06:35 2005
-@@ -127,7 +127,7 @@
- {
- switch(buf & TYPE_MASK) {
- case TYPE_DONTSEND:
-- return 0;
-+ return 2;
- break;
- case TYPE_SILENCE:
- return 4;
-@@ -862,8 +858,10 @@
- /* Must be an even port number by RTP spec */
+
+$FreeBSD$
+
+--- rtp.c.orig Fri Jan 13 13:38:01 2006
++++ rtp.c Fri Jan 13 13:40:50 2006
+@@ -950,8 +950,10 @@ struct ast_rtp *ast_rtp_new_with_bindadd
rtp->us.sin_port = htons(x);
rtp->us.sin_addr = addr;
+ /* If there's rtcp, initialize it as well. */
- if (rtp->rtcp)
+ if (rtp->rtcp) {
rtp->rtcp->us.sin_port = htons(x + 1);
+ rtp->rtcp->us.sin_addr = addr;
+ }
+ /* Try to bind it/them. */
if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) &&
(!rtp->rtcp || !bind(rtp->rtcp->s, (struct sockaddr *)&rtp->rtcp->us, sizeof(rtp->rtcp->us))))
- break;
diff --git a/net/asterisk16/files/patch-utils::Makefile b/net/asterisk16/files/patch-utils::Makefile
new file mode 100644
index 0000000..f3164c0
--- /dev/null
+++ b/net/asterisk16/files/patch-utils::Makefile
@@ -0,0 +1,34 @@
+
+$FreeBSD$
+
+--- utils/Makefile
++++ utils/Makefile
+@@ -17,16 +17,16 @@
+ CFLAGS+=-DNO_AST_MM
+
+ ifeq ($(findstring BSD,${OSARCH}),BSD)
+- CFLAGS+=-I$(CROSS_COMPILE_TARGET)/usr/local/include -L$(CROSS_COMPILE_TARGET)/usr/local/lib
++ CFLAGS+=-I$(CROSS_COMPILE_TARGET)$(LOCALBASE)/include -L$(CROSS_COMPILE_TARGET)$(LOCALBASE)/lib
+ endif
+
+ TARGET=stereorize streamplayer
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/popt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/popt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/popt.h),)
+ TARGET+=smsq
+ endif
+
+-ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)/usr/local/include/newt.h),)
++ifneq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/newt.h)$(wildcard -f $(CROSS_COMPILE_TARGET)$(LOCALBASE)/include/newt.h),)
+ TARGET+=astman
+ endif
+
+@@ -40,7 +40,7 @@
+ install:
+ for x in $(TARGET); do \
+ if [ "$$x" != "none" ]; then \
+- $(INSTALL) -m 755 $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
++ $(BSD_INSTALL_PROGRAM) $$x $(DESTDIR)$(ASTSBINDIR)/$$x; \
+ fi; \
+ done
+
diff --git a/net/asterisk16/pkg-plist b/net/asterisk16/pkg-plist
index 019b270..702370a 100644
--- a/net/asterisk16/pkg-plist
+++ b/net/asterisk16/pkg-plist
@@ -19,6 +19,12 @@ etc/asterisk/asterisk.adsi-dist
@unexec if cmp -s %D/etc/asterisk/asterisk.conf %D/etc/asterisk/asterisk.conf-dist; then rm -f %D/etc/asterisk/asterisk.conf; fi
etc/asterisk/asterisk.conf-dist
@exec [ -f %B/asterisk.conf ] || cp %B/%f %B/asterisk.conf
+@unexec if cmp -s %D/etc/asterisk/cdr.conf %D/etc/asterisk/cdr.conf-dist; then rm -f %D/etc/asterisk/cdr.conf; fi
+etc/asterisk/cdr.conf-dist
+@exec [ -f %B/cdr.conf ] || cp %B/%f %B/cdr.conf
+@unexec if cmp -s %D/etc/asterisk/cdr_custom.conf %D/etc/asterisk/cdr_custom.conf-dist; then rm -f %D/etc/asterisk/cdr_custom.conf; fi
+etc/asterisk/cdr_custom.conf-dist
+@exec [ -f %B/cdr_custom.conf ] || cp %B/%f %B/cdr_custom.conf
@unexec if cmp -s %D/etc/asterisk/cdr_manager.conf %D/etc/asterisk/cdr_manager.conf-dist; then rm -f %D/etc/asterisk/cdr_manager.conf; fi
etc/asterisk/cdr_manager.conf-dist
@exec [ -f %B/cdr_manager.conf ] || cp %B/%f %B/cdr_manager.conf
@@ -31,9 +37,21 @@ etc/asterisk/cdr_pgsql.conf-dist
@unexec if cmp -s %D/etc/asterisk/cdr_tds.conf %D/etc/asterisk/cdr_tds.conf-dist; then rm -f %D/etc/asterisk/cdr_tds.conf; fi
etc/asterisk/cdr_tds.conf-dist
@exec [ -f %B/cdr_tds.conf ] || cp %B/%f %B/cdr_tds.conf
+@unexec if cmp -s %D/etc/asterisk/codecs.conf %D/etc/asterisk/codecs.conf-dist; then rm -f %D/etc/asterisk/codecs.conf; fi
+etc/asterisk/codecs.conf-dist
+@exec [ -f %B/codecs.conf ] || cp %B/%f %B/codecs.conf
+@unexec if cmp -s %D/etc/asterisk/dnsmgr.conf %D/etc/asterisk/dnsmgr.conf-dist; then rm -f %D/etc/asterisk/dnsmgr.conf; fi
+etc/asterisk/dnsmgr.conf-dist
+@exec [ -f %B/dnsmgr.conf ] || cp %B/%f %B/dmsmgr.conf
+@unexec if cmp -s %D/etc/asterisk/dundi.conf %D/etc/asterisk/dundi.conf-dist; then rm -f %D/etc/asterisk/dundi.conf; fi
+etc/asterisk/dundi.conf-dist
+@exec [ -f %B/dundi.conf ] || cp %B/%f %B/dundi.conf
@unexec if cmp -s %D/etc/asterisk/enum.conf %D/etc/asterisk/enum.conf-dist; then rm -f %D/etc/asterisk/enum.conf; fi
etc/asterisk/enum.conf-dist
@exec [ -f %B/enum.conf ] || cp %B/%f %B/enum.conf
+@unexec if cmp -s %D/etc/asterisk/extensions.ael %D/etc/asterisk/extensions.ael-dist; then rm -f %D/etc/asterisk/extensions.ael; fi
+etc/asterisk/extensions.ael-dist
+@exec [ -f %B/extensions.ael ] || cp %B/%f %B/extensions.ael
@unexec if cmp -s %D/etc/asterisk/extconfig.conf %D/etc/asterisk/extconfig.conf-dist; then rm -f %D/etc/asterisk/extconfig.conf; fi
etc/asterisk/extconfig.conf-dist
@exec [ -f %B/extconfig.conf ] || cp %B/%f %B/extconfig.conf
@@ -46,9 +64,6 @@ etc/asterisk/features.conf-dist
@unexec if cmp -s %D/etc/asterisk/festival.conf %D/etc/asterisk/festival.conf-dist; then rm -f %D/etc/asterisk/festival.conf; fi
etc/asterisk/festival.conf-dist
@exec [ -f %B/festival.conf ] || cp %B/%f %B/festival.conf
-@unexec if cmp -s %D/etc/asterisk/h323.conf %D/etc/asterisk/h323.conf-dist; then rm -f %D/etc/asterisk/h323.conf; fi
-etc/asterisk/h323.conf-dist
-@exec [ -f %B/h323.conf ] || cp %B/%f %B/h323.conf
@unexec if cmp -s %D/etc/asterisk/iax.conf %D/etc/asterisk/iax.conf-dist; then rm -f %D/etc/asterisk/iax.conf; fi
etc/asterisk/iax.conf-dist
@exec [ -f %B/iax.conf ] || cp %B/%f %B/iax.conf
@@ -70,6 +85,9 @@ etc/asterisk/meetme.conf-dist
@unexec if cmp -s %D/etc/asterisk/mgcp.conf %D/etc/asterisk/mgcp.conf-dist; then rm -f %D/etc/asterisk/mgcp.conf; fi
etc/asterisk/mgcp.conf-dist
@exec [ -f %B/mgcp.conf ] || cp %B/%f %B/mgcp.conf
+@unexec if cmp -s %D/etc/asterisk/misdn.conf %D/etc/asterisk/misdn.conf-dist; then rm -f %D/etc/asterisk/misdn.conf; fi
+etc/asterisk/misdn.conf-dist
+@exec [ -f %B/misdn.conf ] || cp %B/%f %B/misdn.conf
@unexec if cmp -s %D/etc/asterisk/modem.conf %D/etc/asterisk/modem.conf-dist; then rm -f %D/etc/asterisk/modem.conf; fi
etc/asterisk/modem.conf-dist
@exec [ -f %B/modem.conf ] || cp %B/%f %B/modem.conf
@@ -94,9 +112,6 @@ etc/asterisk/privacy.conf-dist
@unexec if cmp -s %D/etc/asterisk/queues.conf %D/etc/asterisk/queues.conf-dist; then rm -f %D/etc/asterisk/queues.conf; fi
etc/asterisk/queues.conf-dist
@exec [ -f %B/queues.conf ] || cp %B/%f %B/queues.conf
-@unexec if cmp -s %D/etc/asterisk/res_config_odbc.conf %D/etc/asterisk/res_config_odbc.conf-dist; then rm -f %D/etc/asterisk/res_config_odbc.conf; fi
-etc/asterisk/res_config_odbc.conf-dist
-@exec [ -f %B/res_config_odbc.conf ] || cp %B/%f %B/res_config_odbc.conf
@unexec if cmp -s %D/etc/asterisk/res_odbc.conf %D/etc/asterisk/res_odbc.conf-dist; then rm -f %D/etc/asterisk/res_odbc.conf; fi
etc/asterisk/res_odbc.conf-dist
@exec [ -f %B/res_odbc.conf ] || cp %B/%f %B/res_odbc.conf
@@ -109,6 +124,9 @@ etc/asterisk/rtp.conf-dist
@unexec if cmp -s %D/etc/asterisk/sip.conf %D/etc/asterisk/sip.conf-dist; then rm -f %D/etc/asterisk/sip.conf; fi
etc/asterisk/sip.conf-dist
@exec [ -f %B/sip.conf ] || cp %B/%f %B/sip.conf
+@unexec if cmp -s %D/etc/asterisk/sip_notify.conf %D/etc/asterisk/sip_notify.conf-dist; then rm -f %D/etc/asterisk/sip_notify.conf; fi
+etc/asterisk/sip_notify.conf-dist
+@exec [ -f %B/sip_notify.conf ] || cp %B/%f %B/sip_notify.conf
@unexec if cmp -s %D/etc/asterisk/skinny.conf %D/etc/asterisk/skinny.conf-dist; then rm -f %D/etc/asterisk/skinny.conf; fi
etc/asterisk/skinny.conf-dist
@exec [ -f %B/skinny.conf ] || cp %B/%f %B/skinny.conf
@@ -121,9 +139,6 @@ etc/asterisk/voicemail.conf-dist
@unexec if cmp -s %D/etc/asterisk/vpb.conf %D/etc/asterisk/vpb.conf-dist; then rm -f %D/etc/asterisk/vpb.conf; fi
etc/asterisk/vpb.conf-dist
@exec [ -f %B/vpb.conf ] || cp %B/%f %B/vpb.conf
-@unexec if cmp -s %D/etc/asterisk/watchdog.conf %D/etc/asterisk/watchdog.conf-dist; then rm -f %D/etc/asterisk/watchdog.conf; fi
-etc/asterisk/watchdog.conf-dist
-@exec [ -f %B/watchdog.conf ] || cp %B/%f %B/watchdog.conf
@unexec if cmp -s %D/etc/asterisk/zapata.conf %D/etc/asterisk/zapata.conf-dist; then rm -f %D/etc/asterisk/zapata.conf; fi
etc/asterisk/zapata.conf-dist
@exec [ -f %B/zapata.conf ] || cp %B/%f %B/zapata.conf
@@ -136,28 +151,36 @@ include/asterisk/app.h
include/asterisk/ast_expr.h
include/asterisk/astdb.h
include/asterisk/astmm.h
+include/asterisk/astobj.h
include/asterisk/astosp.h
+include/asterisk/build.h
include/asterisk/callerid.h
include/asterisk/causes.h
include/asterisk/cdr.h
include/asterisk/channel.h
-include/asterisk/channel_pvt.h
+include/asterisk/chanspy.h
include/asterisk/chanvars.h
include/asterisk/cli.h
+include/asterisk/compat.h
include/asterisk/config.h
-include/asterisk/config_pvt.h
+include/asterisk/compiler.h
include/asterisk/crypto.h
-include/asterisk/cvsid.h
+include/asterisk/devicestate.h
include/asterisk/dlfcn-compat.h
include/asterisk/dns.h
+include/asterisk/dnsmgr.h
+include/asterisk/doxyref.h
include/asterisk/dsp.h
+include/asterisk/dundi.h
include/asterisk/enum.h
+include/asterisk/endian.h
include/asterisk/features.h
include/asterisk/file.h
include/asterisk/frame.h
include/asterisk/fskmodem.h
include/asterisk/image.h
include/asterisk/indications.h
+include/asterisk/inline_api.h
include/asterisk/io.h
include/asterisk/linkedlists.h
include/asterisk/localtime.h
@@ -168,38 +191,50 @@ include/asterisk/md5.h
include/asterisk/module.h
include/asterisk/monitor.h
include/asterisk/musiconhold.h
+include/asterisk/netsock.h
include/asterisk/options.h
include/asterisk/pbx.h
+include/asterisk/plc.h
include/asterisk/poll-compat.h
include/asterisk/privacy.h
include/asterisk/res_odbc.h
include/asterisk/rtp.h
include/asterisk/say.h
include/asterisk/sched.h
+include/asterisk/slinfactory.h
include/asterisk/srv.h
+include/asterisk/strings.h
include/asterisk/tdd.h
include/asterisk/term.h
+include/asterisk/time.h
include/asterisk/transcap.h
include/asterisk/translate.h
include/asterisk/ulaw.h
+include/asterisk/unaligned.h
include/asterisk/utils.h
+include/asterisk/version.h
include/asterisk/vmodem.h
lib/asterisk/modules/app_adsiprog.so
lib/asterisk/modules/app_alarmreceiver.so
lib/asterisk/modules/app_authenticate.so
lib/asterisk/modules/app_cdr.so
lib/asterisk/modules/app_chanisavail.so
+lib/asterisk/modules/app_chanspy.so
lib/asterisk/modules/app_controlplayback.so
+lib/asterisk/modules/app_curl.so
lib/asterisk/modules/app_cut.so
lib/asterisk/modules/app_db.so
-lib/asterisk/modules/app_devstate.so
lib/asterisk/modules/app_dial.so
+lib/asterisk/modules/app_dictate.so
+lib/asterisk/modules/app_directed_pickup.so
lib/asterisk/modules/app_directory.so
lib/asterisk/modules/app_disa.so
+lib/asterisk/modules/app_dumpchan.so
lib/asterisk/modules/app_echo.so
lib/asterisk/modules/app_enumlookup.so
lib/asterisk/modules/app_eval.so
lib/asterisk/modules/app_exec.so
+lib/asterisk/modules/app_externalivr.so
lib/asterisk/modules/app_festival.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_flash.so
lib/asterisk/modules/app_forkcdr.so
@@ -208,64 +243,66 @@ lib/asterisk/modules/app_groupcount.so
lib/asterisk/modules/app_hasnewvoicemail.so
lib/asterisk/modules/app_ices.so
lib/asterisk/modules/app_image.so
-lib/asterisk/modules/app_intercom.so
lib/asterisk/modules/app_lookupblacklist.so
lib/asterisk/modules/app_lookupcidname.so
lib/asterisk/modules/app_macro.so
+lib/asterisk/modules/app_math.so
+lib/asterisk/modules/app_md5.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_meetme.so
lib/asterisk/modules/app_milliwatt.so
+lib/asterisk/modules/app_mixmonitor.so
lib/asterisk/modules/app_mp3.so
lib/asterisk/modules/app_nbscat.so
+%%WITH_ZAPTEL%%lib/asterisk/modules/app_page.so
lib/asterisk/modules/app_parkandannounce.so
-lib/asterisk/modules/app_pickup.so
lib/asterisk/modules/app_playback.so
lib/asterisk/modules/app_privacy.so
-lib/asterisk/modules/app_qcall.so
lib/asterisk/modules/app_queue.so
lib/asterisk/modules/app_random.so
lib/asterisk/modules/app_read.so
+lib/asterisk/modules/app_readfile.so
+lib/asterisk/modules/app_realtime.so
lib/asterisk/modules/app_record.so
%%WITH_FAX%%lib/asterisk/modules/app_rxfax.so
lib/asterisk/modules/app_sayunixtime.so
-lib/asterisk/modules/app_segfault.so
lib/asterisk/modules/app_senddtmf.so
lib/asterisk/modules/app_sendtext.so
lib/asterisk/modules/app_setcallerid.so
lib/asterisk/modules/app_setcdruserfield.so
lib/asterisk/modules/app_setcidname.so
lib/asterisk/modules/app_setcidnum.so
+lib/asterisk/modules/app_setrdnis.so
lib/asterisk/modules/app_settransfercapability.so
lib/asterisk/modules/app_sms.so
lib/asterisk/modules/app_softhangup.so
-lib/asterisk/modules/app_striplsd.so
-lib/asterisk/modules/app_substring.so
+lib/asterisk/modules/app_stack.so
lib/asterisk/modules/app_system.so
lib/asterisk/modules/app_talkdetect.so
lib/asterisk/modules/app_test.so
lib/asterisk/modules/app_transfer.so
-lib/asterisk/modules/app_txtcidname.so
%%WITH_FAX%%lib/asterisk/modules/app_txfax.so
+lib/asterisk/modules/app_txtcidname.so
lib/asterisk/modules/app_url.so
lib/asterisk/modules/app_userevent.so
lib/asterisk/modules/app_verbose.so
lib/asterisk/modules/app_voicemail.so
lib/asterisk/modules/app_waitforring.so
+lib/asterisk/modules/app_waitforsilence.so
+lib/asterisk/modules/app_while.so
lib/asterisk/modules/app_zapateller.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapbarge.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapras.so
%%WITH_ZAPTEL%%lib/asterisk/modules/app_zapscan.so
lib/asterisk/modules/cdr_csv.so
+lib/asterisk/modules/cdr_custom.so
lib/asterisk/modules/cdr_manager.so
%%WITH_ODBC%%lib/asterisk/modules/cdr_odbc.so
lib/asterisk/modules/chan_agent.so
+lib/asterisk/modules/chan_features.so
%%WITH_H323%%lib/asterisk/modules/chan_h323.so
lib/asterisk/modules/chan_iax2.so
lib/asterisk/modules/chan_local.so
lib/asterisk/modules/chan_mgcp.so
-lib/asterisk/modules/chan_modem.so
-lib/asterisk/modules/chan_modem_aopen.so
-lib/asterisk/modules/chan_modem_bestdata.so
-lib/asterisk/modules/chan_modem_i4l.so
lib/asterisk/modules/chan_oss.so
lib/asterisk/modules/chan_sip.so
lib/asterisk/modules/chan_skinny.so
@@ -273,14 +310,13 @@ lib/asterisk/modules/chan_skinny.so
lib/asterisk/modules/codec_a_mu.so
lib/asterisk/modules/codec_adpcm.so
lib/asterisk/modules/codec_alaw.so
-lib/asterisk/modules/codec_g723_1_dummy.so
lib/asterisk/modules/codec_g726.so
-lib/asterisk/modules/codec_g729_dummy.so
lib/asterisk/modules/codec_gsm.so
lib/asterisk/modules/codec_ilbc.so
lib/asterisk/modules/codec_lpc10.so
lib/asterisk/modules/codec_speex.so
lib/asterisk/modules/codec_ulaw.so
+lib/asterisk/modules/format_au.so
lib/asterisk/modules/format_g723_1.so
lib/asterisk/modules/format_g726.so
lib/asterisk/modules/format_g729.so
@@ -294,22 +330,34 @@ lib/asterisk/modules/format_sln.so
lib/asterisk/modules/format_vox.so
lib/asterisk/modules/format_wav.so
lib/asterisk/modules/format_wav_gsm.so
+lib/asterisk/modules/func_callerid.so
+lib/asterisk/modules/func_enum.so
+lib/asterisk/modules/func_uri.so
+lib/asterisk/modules/pbx_ael.so
lib/asterisk/modules/pbx_config.so
+lib/asterisk/modules/pbx_dundi.so
+lib/asterisk/modules/pbx_functions.so
+lib/asterisk/modules/pbx_loopback.so
+lib/asterisk/modules/pbx_realtime.so
lib/asterisk/modules/pbx_spool.so
-lib/asterisk/modules/pbx_wilcalu.so
lib/asterisk/modules/res_adsi.so
lib/asterisk/modules/res_agi.so
+lib/asterisk/modules/res_config_odbc.so
lib/asterisk/modules/res_crypto.so
lib/asterisk/modules/res_features.so
lib/asterisk/modules/res_indications.so
lib/asterisk/modules/res_monitor.so
+lib/asterisk/modules/res_odbc.so
lib/asterisk/modules/res_musiconhold.so
-lib/asterisk/modules/res_watchdog.so
sbin/asterisk
sbin/astgenkey
sbin/astman
sbin/autosupport
+sbin/rasterisk
sbin/safe_asterisk
+sbin/smsq
+sbin/stereorize
+sbin/streamplayer
%%DATADIR%%/agi-bin/agi-test.agi
%%DATADIR%%/agi-bin/eagi-sphinx-test
%%DATADIR%%/agi-bin/eagi-test
@@ -330,23 +378,34 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/auth-incorrect.gsm
%%DATADIR%%/sounds/auth-thankyou.gsm
%%DATADIR%%/sounds/beep.gsm
+%%DATADIR%%/sounds/beeperr.gsm
%%DATADIR%%/sounds/conf-adminmenu.gsm
%%DATADIR%%/sounds/conf-enteringno.gsm
%%DATADIR%%/sounds/conf-errormenu.gsm
%%DATADIR%%/sounds/conf-getchannel.gsm
%%DATADIR%%/sounds/conf-getconfno.gsm
%%DATADIR%%/sounds/conf-getpin.gsm
+%%DATADIR%%/sounds/conf-hasjoin.gsm
+%%DATADIR%%/sounds/conf-hasleft.gsm
%%DATADIR%%/sounds/conf-invalid.gsm
%%DATADIR%%/sounds/conf-invalidpin.gsm
%%DATADIR%%/sounds/conf-kicked.gsm
+%%DATADIR%%/sounds/conf-leaderhasleft.gsm
%%DATADIR%%/sounds/conf-locked.gsm
%%DATADIR%%/sounds/conf-lockednow.gsm
%%DATADIR%%/sounds/conf-muted.gsm
%%DATADIR%%/sounds/conf-noempty.gsm
+%%DATADIR%%/sounds/conf-onlyone.gsm
%%DATADIR%%/sounds/conf-onlyperson.gsm
+%%DATADIR%%/sounds/conf-otherinparty.gsm
+%%DATADIR%%/sounds/conf-placeintoconf.gsm
+%%DATADIR%%/sounds/conf-thereare.gsm
%%DATADIR%%/sounds/conf-unlockednow.gsm
%%DATADIR%%/sounds/conf-unmuted.gsm
%%DATADIR%%/sounds/conf-usermenu.gsm
+%%DATADIR%%/sounds/conf-userswilljoin.gsm
+%%DATADIR%%/sounds/conf-userwilljoin.gsm
+%%DATADIR%%/sounds/conf-waitforleader.gsm
%%DATADIR%%/sounds/demo-abouttotry.gsm
%%DATADIR%%/sounds/demo-congrats.gsm
%%DATADIR%%/sounds/demo-echodone.gsm
@@ -357,6 +416,18 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/demo-nogo.gsm
%%DATADIR%%/sounds/demo-nomatch.gsm
%%DATADIR%%/sounds/demo-thanks.gsm
+%%DATADIR%%/sounds/dictate/both_help.gsm
+%%DATADIR%%/sounds/dictate/enter_filename.gsm
+%%DATADIR%%/sounds/dictate/forhelp.gsm
+%%DATADIR%%/sounds/dictate/pause.gsm
+%%DATADIR%%/sounds/dictate/paused.gsm
+%%DATADIR%%/sounds/dictate/play_help.gsm
+%%DATADIR%%/sounds/dictate/playback.gsm
+%%DATADIR%%/sounds/dictate/playback_mode.gsm
+%%DATADIR%%/sounds/dictate/record.gsm
+%%DATADIR%%/sounds/dictate/record_help.gsm
+%%DATADIR%%/sounds/dictate/record_mode.gsm
+%%DATADIR%%/sounds/dictate/truncating_audio.gsm
%%DATADIR%%/sounds/digits/0.gsm
%%DATADIR%%/sounds/digits/1.gsm
%%DATADIR%%/sounds/digits/10.gsm
@@ -445,6 +516,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/dir-intro.gsm
%%DATADIR%%/sounds/dir-nomatch.gsm
%%DATADIR%%/sounds/dir-nomore.gsm
+%%DATADIR%%/sounds/hello-world.gsm
%%DATADIR%%/sounds/invalid.gsm
%%DATADIR%%/sounds/letters/a.gsm
%%DATADIR%%/sounds/letters/at.gsm
@@ -512,6 +584,10 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/phonetic/x_p.gsm
%%DATADIR%%/sounds/phonetic/y_p.gsm
%%DATADIR%%/sounds/phonetic/z_p.gsm
+%%DATADIR%%/sounds/priv-callee-options.gsm
+%%DATADIR%%/sounds/priv-callpending.gsm
+%%DATADIR%%/sounds/priv-introsaved.gsm
+%%DATADIR%%/sounds/priv-recordintro.gsm
%%DATADIR%%/sounds/privacy-incorrect.gsm
%%DATADIR%%/sounds/privacy-prompt.gsm
%%DATADIR%%/sounds/privacy-thankyou.gsm
@@ -520,10 +596,21 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/queue-holdtime.gsm
%%DATADIR%%/sounds/queue-less-than.gsm
%%DATADIR%%/sounds/queue-minutes.gsm
+%%DATADIR%%/sounds/queue-periodic-announce.gsm
+%%DATADIR%%/sounds/queue-reporthold.gsm
%%DATADIR%%/sounds/queue-seconds.gsm
%%DATADIR%%/sounds/queue-thankyou.gsm
%%DATADIR%%/sounds/queue-thereare.gsm
%%DATADIR%%/sounds/queue-youarenext.gsm
+%%DATADIR%%/sounds/screen-callee-options.gsm
+%%DATADIR%%/sounds/spy-agent.gsm
+%%DATADIR%%/sounds/spy-h323.gsm
+%%DATADIR%%/sounds/spy-iax.gsm
+%%DATADIR%%/sounds/spy-iax2.gsm
+%%DATADIR%%/sounds/spy-mgcp.gsm
+%%DATADIR%%/sounds/spy-sip.gsm
+%%DATADIR%%/sounds/spy-skinny.gsm
+%%DATADIR%%/sounds/spy-zap.gsm
%%DATADIR%%/sounds/ss-noservice.gsm
%%DATADIR%%/sounds/transfer.gsm
%%DATADIR%%/sounds/tt-allbusy.gsm
@@ -531,7 +618,6 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/tt-monkeysintro.gsm
%%DATADIR%%/sounds/tt-somethingwrong.gsm
%%DATADIR%%/sounds/tt-weasels.gsm
-%%DATADIR%%/sounds/vm
%%DATADIR%%/sounds/vm-Cust1.gsm
%%DATADIR%%/sounds/vm-Cust2.gsm
%%DATADIR%%/sounds/vm-Cust3.gsm
@@ -553,6 +639,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-extension.gsm
%%DATADIR%%/sounds/vm-first.gsm
%%DATADIR%%/sounds/vm-for.gsm
+%%DATADIR%%/sounds/vm-forward.gsm
%%DATADIR%%/sounds/vm-forwardoptions.gsm
%%DATADIR%%/sounds/vm-from-extension.gsm
%%DATADIR%%/sounds/vm-from-phonenumber.gsm
@@ -571,10 +658,12 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-mailboxfull.gsm
%%DATADIR%%/sounds/vm-message.gsm
%%DATADIR%%/sounds/vm-messages.gsm
+%%DATADIR%%/sounds/vm-minutes.gsm
%%DATADIR%%/sounds/vm-mismatch.gsm
%%DATADIR%%/sounds/vm-msginstruct.gsm
%%DATADIR%%/sounds/vm-msgsaved.gsm
%%DATADIR%%/sounds/vm-newpassword.gsm
+%%DATADIR%%/sounds/vm-newuser.gsm
%%DATADIR%%/sounds/vm-next.gsm
%%DATADIR%%/sounds/vm-no.gsm
%%DATADIR%%/sounds/vm-nobodyavail.gsm
@@ -592,6 +681,7 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-reachoper.gsm
%%DATADIR%%/sounds/vm-rec-busy.gsm
%%DATADIR%%/sounds/vm-rec-name.gsm
+%%DATADIR%%/sounds/vm-rec-temp.gsm
%%DATADIR%%/sounds/vm-rec-unv.gsm
%%DATADIR%%/sounds/vm-received.gsm
%%DATADIR%%/sounds/vm-reenterpassword.gsm
@@ -605,6 +695,9 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-sorry.gsm
%%DATADIR%%/sounds/vm-star-cancel.gsm
%%DATADIR%%/sounds/vm-starmain.gsm
+%%DATADIR%%/sounds/vm-tempgreeting.gsm
+%%DATADIR%%/sounds/vm-tempgreeting2.gsm
+%%DATADIR%%/sounds/vm-tempremoved.gsm
%%DATADIR%%/sounds/vm-then-pound.gsm
%%DATADIR%%/sounds/vm-theperson.gsm
%%DATADIR%%/sounds/vm-tocallback.gsm
@@ -624,9 +717,11 @@ sbin/safe_asterisk
%%DATADIR%%/sounds/vm-whichbox.gsm
%%DATADIR%%/sounds/vm-youhave.gsm
%%DATADIR%%/sounds/voicemail
+@dirrm %%DATADIR%%/sounds/dictate
@dirrm %%DATADIR%%/sounds/phonetic
@dirrm %%DATADIR%%/sounds/letters
@dirrm %%DATADIR%%/sounds/digits
+@dirrm %%DATADIR%%/sounds/priv-callerintros
@dirrm %%DATADIR%%/sounds
@dirrm %%DATADIR%%/mohmp3
@dirrm %%DATADIR%%/keys
@@ -641,11 +736,14 @@ sbin/safe_asterisk
@dirrm etc/asterisk
@unexec rm -f %D/%%DATADIR%%/astdb
@cwd /var
-spool/asterisk/vm
spool/asterisk/voicemail/default/1234/busy.gsm
spool/asterisk/voicemail/default/1234/unavail.gsm
@exec mkdir -p %D/log/asterisk/cdr-csv
@exec mkdir -p %D/spool/asterisk/voicemail/default/1234/INBOX
+@dirrm spool/asterisk/dictate
+@dirrm spool/asterisk/meetme
+@dirrm spool/asterisk/monitor
+@dirrm spool/asterisk/system
@dirrm spool/asterisk/voicemail/default/1234/INBOX
@dirrm spool/asterisk/voicemail/default/1234
@dirrm spool/asterisk/voicemail/default
@@ -653,4 +751,5 @@ spool/asterisk/voicemail/default/1234/unavail.gsm
@dirrm spool/asterisk/tmp
@dirrm spool/asterisk
@dirrm log/asterisk/cdr-csv
+@dirrm log/asterisk/cdr-custom
@dirrm log/asterisk
OpenPOWER on IntegriCloud