EAPI=8 inherit cmake DESCRIPTION="Telephony in C++: routing configuration API, runtime publisher, routing snapshot, call history, recordings, voicemail, conferences" HOMEPAGE="https://trunkmasters.com/telephony" SRC_URI="https://www.hedronfire.com/distfiles/${P}.tar.gz" # The application carries no grant of an open-source license. LICENSE="all-rights-reserved" SLOT="0" KEYWORDS="~amd64" RESTRICT="mirror bindist" DEPEND=" =dev-libs/boost-1.91.0* =dev-libs/openssl-3.6.5* =dev-db/postgresql-18.6* =dev-cpp/nlohmann_json-3.12.0* media-sound/gsm sys-libs/libxcrypt " # It runs as the existing `telephony` account (groups asterisk and switchboard) and runs # `asterisk -rx` after rendering /etc/asterisk/bridge/bridge. Voicemail's email goes through the # local MTA's /usr/sbin/sendmail, and its transcripts through attendant-speech (USE=speech of # net-misc/attendant); neither is a dependency, as both are off until configured. Its conferences # come from Asterisk's manager on 127.0.0.1:5038, with a login the go-live adds. RDEPEND="${DEPEND}" BDEPEND=" =dev-cpp/catch-3.15.3* " src_configure() { # The project refuses in-source builds and requires an absolute build root. export TELEPHONY_BUILD_ROOT="${WORKDIR}/build" local mycmakeargs=( -DTELEPHONY_SANITIZER=none ) cmake_src_configure } src_test() { # The parity suite needs root, PostgreSQL and the reference; it runs outside the Portage # sandbox (README, "Build and test"). cmake_src_test -R "^unit\$" } src_install() { cmake_src_install newinitd "${ED}"/usr/share/telephony/openrc/telephony.initd telephony } pkg_postinst() { elog "telephony runs as telephony on /run/telephony/telephony.sock (mode 0660) with the runtime" elog "publisher and the routing snapshot as workers. It replaces python3 /srv/telephony/server.py" elog "and the crons asterisk-runtime-projections and telephony-tenant-routing-publisher, which" elog "must be removed when it starts (both would publish too). An /etc/init.d/telephony that is" elog "not the package's is kept (CONFIG_PROTECT); /etc/conf.d/telephony is left as it is, and a" elog "sample is in /usr/share/telephony/openrc/telephony.confd." elog elog "Since 0.2.0 it builds the call history from Asterisk's CDR. Before its first start, apply" elog "/usr/share/telephony/schema/003_call_history.sql to the telephony database and" elog "003_call_history_asterisk.sql to the asterisk database (as postgres); until then the" elog "worker's passes fail and /health says degraded. TELEPHONY_CALL_HISTORY=0 turns it off." elog elog "Since 0.3.0 it indexes the calls' recordings. To read the 0600 files Asterisk writes," elog "telephony needs the read ACL of /usr/share/telephony/recordings-acl.sh (apply, as root);" elog "telephony recordings-backfill links the recordings made before the dialplan's tags." elog elog "Since 0.4.0 it can index the voicemail spool (TELEPHONY_VOICEMAIL) and deliver the messages" elog "of the mailboxes switched to it (TELEPHONY_VOICEMAIL_DELIVERY, ai_transcribe): a local" elog "transcript, the email and the removal. Both are off. Delivery needs the migrations" elog "004_voicemail.sql and 004_voicemail_asterisk.sql, extconfig.conf's voicemail line naming" elog "the view voicemail_realtime (then 'module reload extconfig'), TELEPHONY_VOICEMAIL_FROM, and" elog "/usr/share/telephony/voicemail-acl.sh apply on each switched mailbox's folder." elog elog "Since 0.5.0 it can record Asterisk's conferences (TELEPHONY_CONFERENCES, off) from the" elog "manager's ConfBridge events. It needs 005_conferences.sql, its own manager login (the" elog "section /usr/share/telephony/manager-telephony.conf, appended to manager.conf with a secret," elog "then 'manager reload'), and TELEPHONY_AMI_USER and TELEPHONY_AMI_SECRET." }