diff --git a/testing/jigasi/APKBUILD b/testing/jigasi/APKBUILD new file mode 100644 index 0000000000000000000000000000000000000000..7e96ab9c4436ad027ff76c639d2c2bb35c524b9b --- /dev/null +++ b/testing/jigasi/APKBUILD @@ -0,0 +1,55 @@ +# Maintainer: Noel Kuntze <noel.kuntze@contauro.com> +pkgname=jigasi +pkgver=0_git20230410 +pkgrel=0 +_gitrev=b5002fc8a98eba39b8590b82b0fc827a21bd104e +pkgdesc="Jitsi meet SIP gateway" +url="https://github.com/jitsi/jigasi" +arch="x86_64" +license="Apache-2.0" +depends="openjdk11-jre-headless jicofo jitsi-videobridge jitsi-meet" +makedepends="maven" +install="$pkgname.pre-install" +subpackages="$pkgname-openrc" +source="$pkgname-$pkgver.tar.gz::https://github.com/jitsi/jigasi/archive/$_gitrev.tar.gz + $pkgname.initd + $pkgname.confd + $pkgname.logrotate + " +builddir="$srcdir/jigasi-$_gitrev" +options="!check" # No test suite + +build() { + mvn clean + mvn package -DskipTests -Dassembly.skipAssembly=true -Dmaven.repo.local="$builddir/.m2/repository" + mvn dependency:copy-dependencies -DincludeScope=runtime -Dmaven.repo.local="$builddir/.m2/repository" +} + +package() { + DESTDIR="$pkgdir/usr/lib/$pkgname" + CONFDIR="$pkgdir/etc/jitsi/jigasi" + + # dependencies, libraries and java launch files + install -Dm644 -t "$DESTDIR/lib" target/dependency/* + install -Dm644 target/jigasi-*-SNAPSHOT.jar "$DESTDIR/jigasi.jar" + install -Dm755 -t "$DESTDIR" "jigasi.sh" + install -Dm755 -t "$DESTDIR" "script/graceful_shutdown.sh" + install -Dm755 -t "$DESTDIR" "script/collect-dump-logs.sh" + + + # configuration + install -dm700 "$CONFDIR" + install -Dm640 -t "$CONFDIR" "lib/logging.properties" "jigasi-home/sip-communicator.properties" + + # init scripts and logrotate + install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.logrotate "$pkgdir"/etc/logrotate.d/$pkgname +} + +sha512sums=" +400d3486201fcc19681736407de0de1a4b4ad09d52aeb1b95167e850835e7a7a6254ee3bc7c00825e6c0359c948747c95e99eaf829e9ba2ad64e3024f32cdf1c jigasi-0_git20230410.tar.gz +f24d00757f6341a19e4732de5de0cf3a1766457d06731680cc1ecf14be9b0e39f6f63722ed91f3e734af4a81446e736a2361c9bf6c05e8b4e74408a7b9c489c0 jigasi.initd +2fc7bdcabbdf46c01c7edb02f22d76e972f9fa060999f8f120759cb78f64475d8d36ef7b07875cbcb2309f8d0220e5cdd86ab0a3ed1c050a50f8026ccea23009 jigasi.confd +9a3c97e983d1fc67bac3066a7f13cf043bd48e0448044c32ef8c6025f59d7df476ca22ffe305054d7d17c60a366eaa16ca653e1877a373eb1f896a863dd5e343 jigasi.logrotate +" diff --git a/testing/jigasi/jigasi.confd b/testing/jigasi/jigasi.confd new file mode 100644 index 0000000000000000000000000000000000000000..090fc57e3530280f07692e6a2879135c172d5ae0 --- /dev/null +++ b/testing/jigasi/jigasi.confd @@ -0,0 +1,27 @@ +## Jigasi settings + +# SIP account +JIGASI_SIPUSER=xxx + +# SIP password. Store it with $(echo -n $PWD | base64 -) +JIGASI_SIPPWD=PASSWORD1 + +# 8-chars random secret, alternative to pwgen 8 +# head -c 8 /dev/urandom | tr '\0-\377' 'a-zA-Z0-9a-zA-Z0-9a-zA-Z0-9a-zA-Z0-9@@@@####' +JIGASI_SECRET=SECRET4 + +# Domain name. Use the XMPP domain (JVB_HOSTNAME) here +JIGASI_HOSTNAME=jitsi.example.com + +# Host name (default: localhost) +JIGASI_HOST=localhost + +# Extra options to pass to the jigasi daemon +JIGASI_OPTS="" + +# sets the log directory and service log file +JIGASI_LOGDIR="/var/log/jitsi" +JIGASI_LOGFILE="$JIGASI_LOGDIR/jigasi.log" + +# Add java system props that are passed to jigasi +JAVA_SYS_PROPS="-Djava.util.logging.config.file=/etc/jitsi/jigasi/logging.properties" diff --git a/testing/jigasi/jigasi.initd b/testing/jigasi/jigasi.initd new file mode 100644 index 0000000000000000000000000000000000000000..2ceee98a38967befc5eb13964ae021ba6b2c852d --- /dev/null +++ b/testing/jigasi/jigasi.initd @@ -0,0 +1,27 @@ +#!/sbin/openrc-run + +description="Jitsi Gateway for SIP" + +pidfile="/run/jigasi/jigasi.pid" +# launcher script below will work on OpenRC also +command="/usr/lib/jigasi/jigasi.sh" +command_args=" --host=$JIGASI_HOST --domain=$JIGASI_HOSTNAME --subdomain=callcontrol --secret=$JIGASI_SECRET --logdir=$JIGASI_LOGDIR --configdir=/etc/jitsi --configdirname=jigasi $JIGASI_OPTS" +command_user="jigasi:jitsi" +command_background=true + +depend() { + need net + want jabber-server +} + +start_pre() { + checkpath -d -m 770 -o $command_user /run/jigasi +} + +start() { + ebegin "Starting ${name}" + start-stop-daemon --start --quiet --background --chuid $command_user \ + -m --pidfile $pidfile \ + --exec /bin/bash -- -c "JAVA_SYS_PROPS=\"$JAVA_SYS_PROPS\" exec $command $command_args >> $JIGASI_LOGFILE 2>&1" + eend $? +} diff --git a/testing/jigasi/jigasi.logrotate b/testing/jigasi/jigasi.logrotate new file mode 100644 index 0000000000000000000000000000000000000000..b9b48d0af1340b1ff9703f54e26da72f4d87f936 --- /dev/null +++ b/testing/jigasi/jigasi.logrotate @@ -0,0 +1,10 @@ +/var/log/jitsi/jigasi.log { + daily + missingok + rotate 7 + compress + delaycompress + notifempty + copytruncate + su jigasi jitsi +} diff --git a/testing/jigasi/jigasi.pre-install b/testing/jigasi/jigasi.pre-install new file mode 100644 index 0000000000000000000000000000000000000000..cd74c1dce0de321de6c83854eaf023efde530b1c --- /dev/null +++ b/testing/jigasi/jigasi.pre-install @@ -0,0 +1,6 @@ +#!/bin/sh + +addgroup -S jitsi 2>/dev/null +adduser -S -D -H -h /usr/share/jigasi -s /sbin/nologin -G jitsi -g jigasi jigasi 2>/dev/null + +exit 0 diff --git a/testing/jigasi/sip-communicator.properties b/testing/jigasi/sip-communicator.properties new file mode 100644 index 0000000000000000000000000000000000000000..f8c8be96965f1eca4e54421700cbe5d1c6c0006b --- /dev/null +++ b/testing/jigasi/sip-communicator.properties @@ -0,0 +1,160 @@ +#Sample config with one XMPP and one SIP account configured +# Replace {sip-pass-hash} with SIP user password hash +# as well as other account properties + +# Name of default JVB room that will be joined if no special header is included +# in SIP invite +org.jitsi.jigasi.DEFAULT_JVB_ROOM_NAME=siptest + +net.java.sip.communicator.impl.protocol.SingleCallInProgressPolicy.enabled=false + +# Should be enabled when using translator mode +#net.java.sip.communicator.impl.neomedia.audioSystem.audiosilence.captureDevice_list=["AudioSilenceCaptureDevice:noTransferData"] + +# Adjust opus encoder complexity +net.java.sip.communicator.impl.neomedia.codec.audio.opus.encoder.COMPLEXITY=10 + +# Disables packet logging +net.java.sip.communicator.packetlogging.PACKET_LOGGING_ENABLED=true + +net.java.sip.communicator.impl.protocol.sip.acc1403273890647=acc1403273890647 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.ACCOUNT_UID=SIP\:<<JIGASI_SIPUSER>> +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.PASSWORD=<<JIGASI_SIPPWD>> +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.PROTOCOL_NAME=SIP +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.SERVER_ADDRESS=<<JIGASI_SIPSERVER>> +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.USER_ID=<<JIGASI_SIPUSER>> +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.KEEP_ALIVE_INTERVAL=25 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.KEEP_ALIVE_METHOD=OPTIONS +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.VOICEMAIL_ENABLED=false +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.AMR-WB/16000=750 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.G722/8000=700 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.GSM/8000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.H263-1998/90000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.H264/90000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.PCMA/8000=600 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.PCMU/8000=650 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.SILK/12000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.SILK/16000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.SILK/24000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.SILK/8000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.VP8/90000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.iLBC/8000=10 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.opus/48000=1000 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.red/90000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.speex/16000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.speex/32000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.speex/8000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.telephone-event/8000=1 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.Encodings.ulpfec/90000=0 +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.OVERRIDE_ENCODINGS=true +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.DEFAULT_ENCRYPTION=false + +# If an authenticated (hidden) domain is used to connect to a conference, +# PREVENT_AUTH_LOGIN will prevent the SIP participant from being seen as a +# hidden participant in the conference +#net.java.sip.communicator.impl.protocol.sip.acc1403273890647.PREVENT_AUTH_LOGIN=FALSE + +# Used when incoming calls are used in multidomain environment, used to detect subdomains +# used for constructing callResource and eventually contacting jicofo +net.java.sip.communicator.impl.protocol.sip.acc1403273890647.DOMAIN_BASE=<<DOMAIN_BASE>> + +# the pattern to be used as bosh url when using bosh in multidomain environment +#net.java.sip.communicator.impl.protocol.sip.acc1403273890647.BOSH_URL_PATTERN=https://{host}{subdomain}/http-bind?room={roomName} + +# can be enabled to disable audio mixing and use translator, jigasi will act as jvb, just forward every ssrc stream it receives. +#net.java.sip.communicator.impl.protocol.sip.acc1403273890647.USE_TRANSLATOR_IN_CONFERENCE=true + +# We can use the prefix org.jitsi.jigasi.xmpp.acc to override any of the +# properties that will be used for creating xmpp account for communication. + +# The following two props assume we are using jigasi on the same machine as +# the xmpp server. +org.jitsi.jigasi.xmpp.acc.IS_SERVER_OVERRIDDEN=true +org.jitsi.jigasi.xmpp.acc.SERVER_ADDRESS=127.0.0.1 +org.jitsi.jigasi.xmpp.acc.VIDEO_CALLING_DISABLED=true +org.jitsi.jigasi.xmpp.acc.JINGLE_NODES_ENABLED=false +org.jitsi.jigasi.xmpp.acc.IM_DISABLED=true +org.jitsi.jigasi.xmpp.acc.SERVER_STORED_INFO_DISABLED=true +org.jitsi.jigasi.xmpp.acc.IS_FILE_TRANSFER_DISABLED=true +# Or you can use bosh for the connection establishment by specifing the URL to use. +# org.jitsi.jigasi.xmpp.acc.BOSH_URL_PATTERN=https://server.com/http-bind?room={roomName} + +#Used when outgoing calls are used in multidomain environment, used to detect subdomains +#org.jitsi.jigasi.xmpp.acc.DOMAIN_BASE=<<DOMAIN_BASE>> +#org.jitsi.jigasi.xmpp.acc.BOSH_URL_PATTERN=https://{host}{subdomain}/http-bind?room={roomName} + +# can be enabled to disable audio mixing and use translator, jigasi will act as jvb, just forward every ssrc stream it receives. +#org.jitsi.jigasi.xmpp.acc.USE_TRANSLATOR_IN_CONFERENCE=true + +# If you want jigasi to perform authenticated login instead of anonymous login +# to the XMPP server, you can set the following properties. +# org.jitsi.jigasi.xmpp.acc.USER_ID=SOME_USER@SOME_DOMAIN +# org.jitsi.jigasi.xmpp.acc.PASS=SOME_PASS +# org.jitsi.jigasi.xmpp.acc.ANONYMOUS_AUTH=false + +# If you want to use the SIP user part of the incoming/outgoing call SIP URI +# you can set the following property to true. +# org.jitsi.jigasi.USE_SIP_USER_AS_XMPP_RESOURCE=true + +# Activate this property if you are using self-signed certificates or other +# type of non-trusted certicates. In this mode your service trust in the +# remote certificates always. +# net.java.sip.communicator.service.gui.ALWAYS_TRUST_MODE_ENABLED=true + +# Enable this property to be able to shutdown gracefully jigasi using +# a rest command +# org.jitsi.jigasi.ENABLE_REST_SHUTDOWN=true + +# Options regarding Transcription. Read the README for a detailed description +# about each property + +#org.jitsi.jigasi.ENABLE_TRANSCRIPTION=false +#org.jitsi.jigasi.ENABLE_SIP=true + +# whether to use the more expensive, but better performing +# "video" model when doing transcription +# org.jitsi.jigasi.transcription.USE_VIDEO_MODEL = false + +# delivering final transcript +# org.jitsi.jigasi.transcription.DIRECTORY=/var/lib/jigasi/transcripts +# org.jitsi.jigasi.transcription.BASE_URL=http://localhost/ +# org.jitsi.jigasi.transcription.jetty.port=-1 +# org.jitsi.jigasi.transcription.ADVERTISE_URL=false + +# save formats +# org.jitsi.jigasi.transcription.SAVE_JSON=false +# org.jitsi.jigasi.transcription.SAVE_TXT=true + +# send formats +# org.jitsi.jigasi.transcription.SEND_JSON=true +# org.jitsi.jigasi.transcription.SEND_TXT=false + +# translation +# org.jitsi.jigasi.transcription.ENABLE_TRANSLATION=false + +# record audio. Currently only wav format is supported +# org.jitsi.jigasi.transcription.RECORD_AUDIO=false +# org.jitsi.jigasi.transcription.RECORD_AUDIO_FORMAT=wav + +# execute one or more scripts when a transcript or recording is saved +# org.jitsi.jigasi.transcription.EXECUTE_SCRIPTS=true +# org.jitsi.jigasi.transcription.SCRIPTS_TO_EXECUTE_LIST_SEPARATOR="," +# org.jitsi.jigasi.transcription.SCRIPTS_TO_EXECUTE_LIST=script/example_handle_transcript_directory.sh + +# properties for optionally sending statistics to a DataDog server +#org.jitsi.ddclient.prefix=jitsi.jigasi +#org.jitsi.ddclient.host=localhost +#org.jitsi.ddclient.port=8125 + +# sip health checking +# Enables sip health checking by specifying a number/uri to call +# the target just needs to auto-connect the call play some audio, +# the call must be established for less than 10 seconds +# org.jitsi.jigasi.HEALTH_CHECK_SIP_URI=healthcheck +# +# The interval between healthcheck calls, by default is 5 minutes +# org.jitsi.jigasi.HEALTH_CHECK_INTERVAL=300000 +# +# The timeout of healthcheck, if there was no successful health check for +# 10 minutes (default value) we consider jigasi unhealthy +# org.jitsi.jigasi.HEALTH_CHECK_TIMEOUT=600000