diff --git a/Dockerfile b/Dockerfile index fc02a0a..1bc9ed5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,51 @@ -FROM debian:buster +FROM debian:bookworm -#yate -COPY deps/yate_5.5-1_amd64.deb /tmp/ +#build yate RUN apt update && apt install -y -f \ - /tmp/yate_5.5-1_amd64.deb \ + autoconf \ + build-essential \ + doxygen \ + gcc \ + git \ + grep \ + make \ + original-awk \ + sed \ + vim + +#ADD deps/yate /yate +RUN git clone https://github.com/yatevoip/yate.git /yate +WORKDIR "/yate" +RUN ./autogen.sh +RUN ./configure +RUN make all +RUN make install + +#yate-tcl +RUN apt update && apt install -y -f \ + ffmpeg \ + lame \ + libmp3lame0 \ + netcat-openbsd \ python3-pip \ + python3-venv \ tcl \ - tcllib \ - tcl-tls + tcl-tls \ + tcllib #yate-tcl COPY deps/yate-tcl /opt/yate-tcl RUN mkdir /usr/local/share/tcltk && ln -s /opt/yate-tcl/ygi /usr/local/share/tcltk/ygi -RUN pip3 install python-yate requests +#RUN pip3 install python-yate requests +RUN python3 -m venv /venv +RUN /venv/bin/pip install requests python-yate #yate-config -COPY config /etc/yate +COPY config /usr/local/etc/yate -COPY sounds /opt/sounds +COPY sounds /usr/local/share/yate/sounds/ -COPY hotline /usr/share/yate/scripts/ +COPY hotline /usr/local/share/yate/scripts/ -ENTRYPOINT [ "/usr/bin/yate", "upstream_broke_it" ] +ENTRYPOINT [ "yate", "upstream_broke_it" ] diff --git a/hotline/hotline.tcl b/hotline/hotline.tcl index 2fd69b2..78f7ac4 100755 --- a/hotline/hotline.tcl +++ b/hotline/hotline.tcl @@ -1,22 +1,24 @@ #!/usr/bin/tclsh package require ygi +set sounds "/usr/local/share/yate/sounds" + ::ygi::start_ivr ::ygi::set_dtmf_notify ::ygi::idle_timeout -::ygi::play_wait "yintro" +::ygi::play_wait "$sounds/yintro" ::ygi::sleep 500 while { true } { - set digit [::ygi::play_getdigit file "pocmenu/123"] + set digit [::ygi::play_getdigit file "$sounds/pocmenu/123"] if { $digit == "1" } { - ::ygi::play_getdigit file "pocmenu/warteschleife" stopdigits { 3 } + ::ygi::play_getdigit file "$sounds/pocmenu/warteschleife" stopdigits { 3 } } if { $digit == "2" } { - ::ygi::play_getdigit file "pocmenu/clan_chi_telekom" stopdigits { 3 } + ::ygi::play_getdigit file "$sounds/pocmenu/clan_chi_telekom" stopdigits { 3 } } }