From 37d18bc96a31ee4bcc48ae3c4a238ffb3fd82fb3 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Wed, 18 Dec 2024 17:11:11 -0300 Subject: [PATCH 1/2] Update Asterisk to 22.1.0 --- asterisk/CHANGELOG.md | 7 +++++++ asterisk/Dockerfile | 6 +++--- asterisk/config.yaml | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/asterisk/CHANGELOG.md b/asterisk/CHANGELOG.md index 0c85f58..e98ae24 100644 --- a/asterisk/CHANGELOG.md +++ b/asterisk/CHANGELOG.md @@ -2,6 +2,13 @@ # Changelog +## 4.5.0 + +### Upgrades + +- Upgrade Asterisk from 20.8.1 to 22.1.0 +- Upgrade debian-base from 7.4.0 to 7.6.2 + ## 4.4.0 ### New Features diff --git a/asterisk/Dockerfile b/asterisk/Dockerfile index 77cf4f3..8cb54fe 100644 --- a/asterisk/Dockerfile +++ b/asterisk/Dockerfile @@ -1,5 +1,5 @@ # https://github.com/hassio-addons/addon-debian-base/releases -FROM ghcr.io/hassio-addons/debian-base:7.6.1 AS base +FROM ghcr.io/hassio-addons/debian-base:7.6.2 AS base SHELL [ "/bin/bash", "-euxo", "pipefail", "-c" ] @@ -106,14 +106,14 @@ RUN export DEBIAN_FRONTEND=noninteractive; \ # Taken from https://metadata.ftp-master.debian.org/changelogs/main/a/asterisk/unstable_changelog # (replace all ~ with _ and remove final -) -ARG ASTERISK_OPUS_VERSION="20.8.1_dfsg+_cs6.14.40431414" +ARG ASTERISK_OPUS_VERSION="22.1.0_dfsg+_cs6.14.60671435" WORKDIR /usr/src/asterisk-opus RUN curl -fsSL "https://salsa.debian.org/pkg-voip-team/asterisk/-/archive/upstream/${ASTERISK_OPUS_VERSION}/asterisk-upstream-${ASTERISK_OPUS_VERSION}.tar.gz?path=Xopus" | \ tar --strip-components 2 -xz # https://github.com/asterisk/asterisk/tags # https://www.asterisk.org/downloads/asterisk/all-asterisk-versions/ -ARG ASTERISK_VERSION="20.8.1" +ARG ASTERISK_VERSION="22.1.0" WORKDIR /usr/src/asterisk RUN curl -fsSL "http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-${ASTERISK_VERSION}.tar.gz" | \ tar --strip-components 1 -xz diff --git a/asterisk/config.yaml b/asterisk/config.yaml index 93183f0..73561d6 100644 --- a/asterisk/config.yaml +++ b/asterisk/config.yaml @@ -1,5 +1,5 @@ name: Asterisk -version: 4.4.0 +version: 4.5.0 slug: asterisk description: PBX server for SIP devices like doorbells and phones url: https://github.com/TECH7Fox/asterisk-hass-addons From 986fb6fe6901e306f5ba5e678eb775ad4aaba93f Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Wed, 18 Dec 2024 17:20:37 -0300 Subject: [PATCH 2/2] Remove chan_sip --- asterisk/CHANGELOG.md | 7 +++- asterisk/Dockerfile | 6 +-- asterisk/config.yaml | 4 +- asterisk/rootfs/etc/asterisk/extensions.conf | 3 -- asterisk/rootfs/etc/asterisk/modules.conf | 1 - asterisk/rootfs/etc/asterisk/sip.conf | 26 ------------- asterisk/rootfs/etc/asterisk/sip_custom.conf | 1 - asterisk/rootfs/etc/cont-init.d/asterisk.sh | 10 ----- .../usr/share/tempio/sip_default.conf.gtpl | 38 ------------------- 9 files changed, 11 insertions(+), 85 deletions(-) delete mode 100644 asterisk/rootfs/etc/asterisk/sip.conf delete mode 100644 asterisk/rootfs/etc/asterisk/sip_custom.conf delete mode 100644 asterisk/rootfs/usr/share/tempio/sip_default.conf.gtpl diff --git a/asterisk/CHANGELOG.md b/asterisk/CHANGELOG.md index e98ae24..8643493 100644 --- a/asterisk/CHANGELOG.md +++ b/asterisk/CHANGELOG.md @@ -2,7 +2,12 @@ # Changelog -## 4.5.0 +## 5.0.0 + +### Breaking Changes + +- `chan_sip` was [removed](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-chan_sip/) in Asterisk 21, thus it is no longer supported by this add-on. + You should [migrate](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Migrating-from-chan_sip-to-res_pjsip/) to `res_pjsip` if you were using `chan_sip`. ### Upgrades diff --git a/asterisk/Dockerfile b/asterisk/Dockerfile index 8cb54fe..dd8741f 100644 --- a/asterisk/Dockerfile +++ b/asterisk/Dockerfile @@ -182,8 +182,7 @@ RUN \ --enable chan_bridge_media \ --enable chan_iax2 \ --enable chan_pjsip \ - --enable chan_rtp \ - --enable chan_sip ; \ + --enable chan_rtp; \ # enable good things \ menuselect/menuselect --enable BETTER_BACKTRACES menuselect.makeopts; \ # applications \ @@ -212,7 +211,6 @@ RUN \ menuselect/menuselect --disable pbx_spool menuselect.makeopts; \ # resource modules \ menuselect/menuselect --disable res_config_sqlite3 menuselect.makeopts; \ - menuselect/menuselect --disable res_monitor menuselect.makeopts; \ menuselect/menuselect --disable res_adsi menuselect.makeopts; \ # utilities \ menuselect/menuselect --disable astdb2sqlite3 menuselect.makeopts; \ @@ -241,7 +239,7 @@ RUN \ # install example configuration \ DESTDIR="${INSTALL_DIR}" make samples -## Install chan-gongle +## Install chan-dongle WORKDIR /usr/src/asterisk-chan-dongle # https://github.com/wdoekes/asterisk-chan-dongle/commits/master ARG CHAN_DONGLE_VERSION="13450af5f648ddf4bc279c08e53917f503253bdd" diff --git a/asterisk/config.yaml b/asterisk/config.yaml index 73561d6..14484cc 100644 --- a/asterisk/config.yaml +++ b/asterisk/config.yaml @@ -1,5 +1,7 @@ name: Asterisk -version: 4.5.0 +version: 5.0.0 +breaking_versions: + - 5.0.0 slug: asterisk description: PBX server for SIP devices like doorbells and phones url: https://github.com/TECH7Fox/asterisk-hass-addons diff --git a/asterisk/rootfs/etc/asterisk/extensions.conf b/asterisk/rootfs/etc/asterisk/extensions.conf index 41a8e6f..d811062 100644 --- a/asterisk/rootfs/etc/asterisk/extensions.conf +++ b/asterisk/rootfs/etc/asterisk/extensions.conf @@ -11,9 +11,6 @@ exten => 444,1,Park(,s) exten => 555,1,ParkedCall(default,701) ; exten => _X!,1,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN})}) -; -;extension for dialing chan_sip devices. -;exten => _X!,1,Dial(SIP/${EXTEN}) [parkedcallstimeout] exten => s,1,Hangup() diff --git a/asterisk/rootfs/etc/asterisk/modules.conf b/asterisk/rootfs/etc/asterisk/modules.conf index b0717ea..f22edf4 100644 --- a/asterisk/rootfs/etc/asterisk/modules.conf +++ b/asterisk/rootfs/etc/asterisk/modules.conf @@ -8,4 +8,3 @@ noload => res_hep_rtcp.so noload => app_voicemail_imap.so noload => app_voicemail_odbc.so noload => chan_dongle.so ; comment out this line if you want to use chan-dongle -noload => chan_sip.so ; comment out this line if you want to use chan_sip diff --git a/asterisk/rootfs/etc/asterisk/sip.conf b/asterisk/rootfs/etc/asterisk/sip.conf deleted file mode 100644 index 7beed34..0000000 --- a/asterisk/rootfs/etc/asterisk/sip.conf +++ /dev/null @@ -1,26 +0,0 @@ -; Note: this file has been modified from the Asterisk defaults to the add-on - -[general] -udpbindaddr=0.0.0.0:5260 -bindaddr=0.0.0.0:5260 -protocol=udp - -; TLS -tlsenable=yes -tlsbindaddr=0.0.0.0:5261 -tlscertfile=/etc/asterisk/keys/asterisk.pem -tlscipher=ALL -tlsclientmethod=ALL - -; HINTS -limitonpeers=yes -notifyringing=yes -notifyhold=yes -notifycid=yes -callcounter=yes - -; AUTO GENERATED EXTENSIONS -#include sip_default.conf - -; CUSTOM EXTENSIONS -#include sip_custom.conf diff --git a/asterisk/rootfs/etc/asterisk/sip_custom.conf b/asterisk/rootfs/etc/asterisk/sip_custom.conf deleted file mode 100644 index 947b98d..0000000 --- a/asterisk/rootfs/etc/asterisk/sip_custom.conf +++ /dev/null @@ -1 +0,0 @@ -; Place your custom extensions here diff --git a/asterisk/rootfs/etc/cont-init.d/asterisk.sh b/asterisk/rootfs/etc/cont-init.d/asterisk.sh index 06053df..0c0846e 100755 --- a/asterisk/rootfs/etc/cont-init.d/asterisk.sh +++ b/asterisk/rootfs/etc/cont-init.d/asterisk.sh @@ -167,16 +167,6 @@ bashio::var.json \ -template "${tempio_dir}/pjsip_default.conf.gtpl" \ -out "${etc_asterisk}/pjsip_default.conf" -rm -f "${etc_asterisk}/sip_default.conf" -bashio::var.json \ - auto_add "^${auto_add}" \ - auto_add_secret "${auto_add_secret}" \ - video_support "^${video_support}" \ - persons "^${persons}" | - tempio \ - -template "${tempio_dir}/sip_default.conf.gtpl" \ - -out "${etc_asterisk}/sip_default.conf" - rm -f "${etc_asterisk}/asterisk_mbox.ini" bashio::var.json \ port "$(bashio::config 'mailbox_port')" \ diff --git a/asterisk/rootfs/usr/share/tempio/sip_default.conf.gtpl b/asterisk/rootfs/usr/share/tempio/sip_default.conf.gtpl deleted file mode 100644 index b07a97b..0000000 --- a/asterisk/rootfs/usr/share/tempio/sip_default.conf.gtpl +++ /dev/null @@ -1,38 +0,0 @@ -; THIS FILE IS AUTO-GENERATED BY THE ADD-ON -; We do not recommend you change it unless you know what you are doing. -; Instead, you can add your customizations to sip_custom.conf or even sip.conf. - -[sipjs-phone](!) -type=friend -host=dynamic ; Allows any host to register -encryption=yes ; Tell Asterisk to use encryption for this peer -avpf=yes ; Tell Asterisk to use AVPF for this peer -icesupport=yes ; Tell Asterisk to use ICE for this peer -context=default ; Tell Asterisk which context to use when this peer is dialing -directmedia=no ; Asterisk will relay media for this peer -transport=wss,udp,tls ; Asterisk will allow this peer to register on UDP or WebSockets -force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11 -dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer -dtlsverify=fingerprint ; Tell Asterisk to verify DTLS fingerprint -dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is -dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS -rtcp_mux=yes ; Tell Asterisk to do RTCP mux -dtmfmode=rfc2833 -qualify=no -sendrpid=pai -videosupport={{ .video_support }} -busylevel=1 - -[my-codecs](!) -allow=!all,ulaw,alaw,speex,gsm,g726,g723,h263,h263p,h264,vp8 - -{{ if .auto_add }} -{{ $secret := .auto_add_secret }} -{{ range $index, $person := .persons }} -{{ $extension := add 100 $index }} -[{{ $extension }}](sipjs-phone,my-codecs) -username={{ $extension }} -secret={{ $secret }} -callerid="{{ $person }}" <{{ $extension }}> -{{ end }} -{{ end }}