initial commit

This commit is contained in:
Alex 2022-08-28 00:41:44 -04:00
commit fcb71e44e4
Signed by: technically
GPG Key ID: 46E0A080F69E83F1
5 changed files with 242 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.tar.gz

53
Dockerfile Executable file
View File

@ -0,0 +1,53 @@
FROM debian:latest
COPY resources /build
## Upgrade packages on system
RUN apt-get update
## Install build tools
RUN apt-get install -y g++ gcc make patch
## Install package dependencies
RUN apt-get install -y \
curl\
libc-dev\
libcurl4-openssl-dev\
libedit-dev\
libjansson-dev\
libogg-dev\
libresample1-dev\
libspeex-dev\
libsqlite3-dev\
libsrtp2-dev\
libssl-dev\
libvorbis-dev\
libxml2-dev\
libxslt-dev\
ncurses-dev\
uuid-dev
## Install GONK specific dependencies
RUN apt-get install -y fail2ban iptables net-tools
## Move and unpack source to /build
RUN mkdir /build/asterisk-current
RUN tar -xzf /build/asterisk-current.tar.gz --strip-components 1 -C /build/asterisk-current
RUN rm /build/asterisk-current.tar.gz
## Configure asterisk source for build
WORKDIR /build/asterisk-current
RUN ./configure
RUN mv /build/menuselect.makeopts /build/asterisk-current/
RUN make -j$(cat /proc/cpuinfo | grep processor | wc -l)
RUN make install
## Cleanup
WORKDIR /
RUN cp /build/gonk.sh /usr/bin/gonk
RUN chmod +x /usr/bin/gonk
RUN rm -rf /build
RUN apt-get remove -y --purge g++ gcc make patch
ENTRYPOINT [ "gonk" ]

1
prep.ps1 Executable file
View File

@ -0,0 +1 @@
Invoke-WebRequest https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-19-current.tar.gz -OutFile ./build/asterisk-current.tar.gz

37
resources/gonk.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
echo "Starting Gonk node..."
echo " ______
/______\\
| [==] |
|______|
\\______/
| | |
|/\|/\|"
if [ -f /var/gonk ]; then
echo "Gonk has already been provisioned"
else
echo "Running first time provisioning..."
echo " Adding gonk user..."
useradd -d /var/lib/asterisk/ -c "Gonk asterisk user" -r -s /sbin/nologin gonk
echo " Setting permissions..."
chown -R gonk:gonk /var/lib/asterisk
chown -R gonk:gonk /var/log/asterisk
chown -R gonk:gonk /var/spool/asterisk
echo " Pulling config files for the first time..."
curl -o /etc/asterisk/asterisk.conf https://api.gonk.nicolor.tech/asterisk/$HOSTNAME/$GONK_KEY
curl -o /etc/asterisk/pjsip.conf https://api.gonk.nicolor.tech/pjsip/$HOSTNAME/$GONK_KEY
curl -o /etc/asterisk/modules.conf https://api.gonk.nicolor.tech/modules/$HOSTNAME/$GONK_KEY
touch /var/gonk
fi
echo "Starting Asterisk..."
asterisk -U gonk -G gonk -f

View File

@ -0,0 +1,150 @@
MENUSELECT_ADDONS=chan_mobile chan_ooh323 format_mp3 res_config_mysql
MENUSELECT_APPS=app_flash app_privacy app_skel app_voicemail_imap app_voicemail_odbc app_alarmreceiver app_amd app_audiosocket app_dictate app_festival app_ivrdemo app_jack app_saycounted app_sms app_statsd app_test app_zapateller app_adsiprog app_getcpeid app_macro app_meetme app_osplookup
MENUSELECT_BRIDGES=binaural_rendering_in_bridge_softmix
MENUSELECT_CDR=cdr_adaptive_odbc cdr_beanstalkd cdr_odbc cdr_pgsql cdr_radius cdr_tds
MENUSELECT_CEL=cel_odbc cel_beanstalkd cel_pgsql cel_radius cel_tds
MENUSELECT_CHANNELS=chan_dahdi chan_motif chan_audiosocket chan_console chan_unistim chan_alsa chan_mgcp chan_sip chan_skinny
MENUSELECT_CODECS=codec_codec2 codec_dahdi codec_speex codec_opus codec_silk codec_siren7 codec_siren14 codec_g729a
MENUSELECT_FORMATS=
MENUSELECT_FUNCS=func_odbc func_speex
MENUSELECT_PBX=pbx_dundi pbx_lua
MENUSELECT_RES=res_ari_mailboxes res_config_odbc res_http_post res_mwi_external res_mwi_external_ami res_odbc res_odbc_transaction res_resolver_unbound res_stasis_mailbox res_stasis_test res_timing_dahdi res_xmpp res_calendar_caldav res_calendar_ews res_calendar_exchange res_calendar_icalendar res_chan_stats res_config_ldap res_config_pgsql res_corosync res_endpoint_stats res_fax_spandsp res_remb_modifier res_snmp res_timing_kqueue res_adsi res_monitor res_pktccops res_digium_phone
MENUSELECT_TESTS=test_abstract_jb test_acl test_aeap test_aeap_speech test_aeap_transaction test_aeap_transport test_amihooks test_aoc test_app test_ari test_ari_model test_ast_format_str_reduce test_astobj2 test_astobj2_thrash test_astobj2_weaken test_bridging test_bucket test_callerid test_cdr test_cel test_channel test_channel_feature_hooks test_config test_conversions test_core_codec test_core_format test_data_buffer test_db test_devicestate test_dlinklists test_dns test_dns_naptr test_dns_query_set test_dns_recurring test_dns_srv test_endpoints test_event test_expr test_file test_format_cache test_format_cap test_func_file test_gosub test_hashtab_thrash test_heap test_http_media_cache test_jitterbuf test_json test_linkedlists test_locale test_logger test_media_cache test_message test_mwi test_named_lock test_netsock2 test_optional_api test_pbx test_poll test_res_pjsip_scheduler test_res_pjsip_session_caps test_res_rtp test_res_stasis test_sched test_scope_trace test_scoped_lock test_security_events test_skel test_sorcery test_sorcery_astdb test_sorcery_memory_cache_thrash test_sorcery_realtime test_stasis test_stasis_channels test_stasis_endpoints test_stasis_state test_stream test_stringfields test_strings test_substitution test_taskprocessor test_threadpool test_time test_uri test_utils test_uuid test_vector test_voicemail_api test_websocket_client test_xml_escape test_res_prometheus
MENUSELECT_CFLAGS=OPTIONAL_API RADIO_RELAX
MENUSELECT_UTILS=astcanary stereorize streamplayer
MENUSELECT_AGIS=
MENUSELECT_CORE_SOUNDS=CORE-SOUNDS-EN-WAV
MENUSELECT_MOH=MOH-OPSOUND-WAV
MENUSELECT_EXTRA_SOUNDS=EXTRA-SOUNDS-EN-WAV
MENUSELECT_BUILD_DEPS=bridge_holding app_cdr func_periodic_hook app_confbridge res_speech res_agi res_stasis res_smdi res_crypto res_pjsip res_pjsip_pubsub res_pjsip_session res_rtp_multicast res_curl app_chanspy func_cut func_groupcount func_uri res_ael_share res_http_websocket res_ari res_ari_model res_stasis_recording res_stasis_playback res_stasis_answer res_stasis_snoop res_stasis_device_state func_curl res_sorcery_config res_pjproject res_sorcery_memory res_sorcery_astdb res_statsd res_pjsip_outbound_publish res_stir_shaken res_hep res_phoneprov res_pjsip_outbound_registration DONT_OPTIMIZE G711_NEW_ALGORITHM
MENUSELECT_DEPSFAILED=MENUSELECT_APPS=app_flash
MENUSELECT_DEPSFAILED=MENUSELECT_APPS=app_jack
MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_adaptive_odbc
MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_beanstalkd
MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_odbc
MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_pgsql
MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_radius
MENUSELECT_DEPSFAILED=MENUSELECT_CDR=cdr_tds
MENUSELECT_DEPSFAILED=MENUSELECT_CEL=cel_odbc
MENUSELECT_DEPSFAILED=MENUSELECT_CEL=cel_beanstalkd
MENUSELECT_DEPSFAILED=MENUSELECT_CEL=cel_pgsql
MENUSELECT_DEPSFAILED=MENUSELECT_CEL=cel_radius
MENUSELECT_DEPSFAILED=MENUSELECT_CEL=cel_tds
MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_dahdi
MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_motif
MENUSELECT_DEPSFAILED=MENUSELECT_CHANNELS=chan_console
MENUSELECT_DEPSFAILED=MENUSELECT_CODECS=codec_codec2
MENUSELECT_DEPSFAILED=MENUSELECT_CODECS=codec_dahdi
MENUSELECT_DEPSFAILED=MENUSELECT_CODECS=codec_speex
MENUSELECT_DEPSFAILED=MENUSELECT_FUNCS=func_odbc
MENUSELECT_DEPSFAILED=MENUSELECT_FUNCS=func_speex
MENUSELECT_DEPSFAILED=MENUSELECT_PBX=pbx_dundi
MENUSELECT_DEPSFAILED=MENUSELECT_PBX=pbx_lua
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_config_odbc
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_http_post
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_odbc
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_odbc_transaction
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_resolver_unbound
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_stasis_test
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_timing_dahdi
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_xmpp
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_calendar_caldav
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_calendar_ews
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_calendar_exchange
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_calendar_icalendar
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_config_ldap
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_config_pgsql
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_fax_spandsp
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_snmp
MENUSELECT_DEPSFAILED=MENUSELECT_RES=res_timing_kqueue
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_abstract_jb
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_acl
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_aeap
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_aeap_speech
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_aeap_transaction
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_aeap_transport
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_amihooks
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_aoc
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_app
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_ari
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_ari_model
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_ast_format_str_reduce
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_astobj2
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_astobj2_thrash
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_astobj2_weaken
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_bridging
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_bucket
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_callerid
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_cdr
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_cel
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_channel
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_channel_feature_hooks
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_config
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_conversions
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_core_codec
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_core_format
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_data_buffer
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_db
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_devicestate
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dlinklists
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dns
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dns_naptr
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dns_query_set
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dns_recurring
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_dns_srv
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_endpoints
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_event
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_expr
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_file
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_format_cache
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_format_cap
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_func_file
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_gosub
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_hashtab_thrash
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_heap
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_http_media_cache
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_jitterbuf
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_json
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_linkedlists
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_locale
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_logger
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_media_cache
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_message
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_mwi
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_named_lock
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_netsock2
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_optional_api
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_pbx
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_poll
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_res_pjsip_scheduler
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_res_pjsip_session_caps
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_res_rtp
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_res_stasis
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_sched
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_scope_trace
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_scoped_lock
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_security_events
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_skel
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_sorcery
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_sorcery_astdb
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_sorcery_memory_cache_thrash
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_sorcery_realtime
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stasis
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stasis_channels
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stasis_endpoints
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stasis_state
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stream
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_stringfields
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_strings
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_substitution
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_taskprocessor
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_threadpool
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_time
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_uri
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_utils
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_uuid
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_vector
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_voicemail_api
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_websocket_client
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_xml_escape
MENUSELECT_DEPSFAILED=MENUSELECT_TESTS=test_res_prometheus