Migrate to remco
parent
a972571edc
commit
06f1dac788
14
Dockerfile
14
Dockerfile
|
@ -1,12 +1,16 @@
|
||||||
FROM dougbtv/asterisk14
|
FROM dougbtv/asterisk14
|
||||||
|
|
||||||
RUN yum install -y perl-Digest-MD5 perl-libwww-perl perl-LWP-Protocol-https sox mpg123 which python-pip
|
RUN yum install -y perl-Digest-MD5 perl-libwww-perl perl-LWP-Protocol-https sox mpg123 which python-pip wget unzip
|
||||||
RUN pip install pyst2==0.5.0
|
RUN pip install pyst2==0.5.0
|
||||||
RUN curl -L https://github.com/kelseyhightower/confd/releases/download/v0.15.0/confd-0.15.0-linux-amd64 > /usr/local/bin/confd && chmod +x /usr/local/bin/confd
|
ENV REMCO_VER 0.11.1
|
||||||
|
RUN wget https://github.com/HeavyHorst/remco/releases/download/v${REMCO_VER}/remco_${REMCO_VER}_linux_amd64.zip && \
|
||||||
|
unzip remco_${REMCO_VER}_linux_amd64.zip && rm remco_${REMCO_VER}_linux_amd64.zip && \
|
||||||
|
mv remco_linux /bin/remco
|
||||||
|
|
||||||
COPY conf/*.conf /etc/asterisk/
|
COPY conf/*.conf /etc/asterisk/
|
||||||
COPY conf/*.conf.tmpl /etc/confd/templates/
|
|
||||||
COPY conf/*.conf.toml /etc/confd/conf.d/
|
|
||||||
COPY agi/* /var/lib/asterisk/agi-bin/
|
COPY agi/* /var/lib/asterisk/agi-bin/
|
||||||
|
|
||||||
CMD confd -onetime -backend env && asterisk -fvv
|
COPY remco.config /etc/remco/config
|
||||||
|
COPY conf/*.conf.tmpl /etc/remco/templates/
|
||||||
|
|
||||||
|
ENTRYPOINT ["remco"]
|
||||||
|
|
|
@ -4,3 +4,7 @@ exten => s,1,Answer()
|
||||||
same => n,Monitor(wav,rec-${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)}-${CALLERID(num)})
|
same => n,Monitor(wav,rec-${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)}-${CALLERID(num)})
|
||||||
same => n,agi(googletts.agi,"This is BGP.WTF abuse phone number. This call will be recorded.",en)
|
same => n,agi(googletts.agi,"This is BGP.WTF abuse phone number. This call will be recorded.",en)
|
||||||
same => n,agi(phonetab.agi,/etc/asterisk/phonetab)
|
same => n,agi(phonetab.agi,/etc/asterisk/phonetab)
|
||||||
|
|
||||||
|
[internal]
|
||||||
|
exten => s,1,Answer()
|
||||||
|
same => n,agi(googletts.agi,"Oh shit what up",en)
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
[general]
|
[general]
|
||||||
context=sip
|
context=sip
|
||||||
nat=force_rport,comedia
|
nat=force_rport,comedia
|
||||||
register => {{getv "/asterisk/trunk/username"}}:{{getv "/asterisk/trunk/secret"}}@sip.2call.pl
|
allowguest=no
|
||||||
|
register => {{ getv ("/asterisk/trunk/username") }}:{{ getv ("/asterisk/trunk/secret") }}@sip.2call.pl
|
||||||
|
|
||||||
[trunk-out]
|
[trunk-out]
|
||||||
type=friend
|
type=friend
|
||||||
|
@ -17,9 +18,16 @@ qualify=no
|
||||||
fromdomain=sip.2call.pl
|
fromdomain=sip.2call.pl
|
||||||
host=sip.2call.pl
|
host=sip.2call.pl
|
||||||
|
|
||||||
defaultuser={{getv "/asterisk/trunk/username"}}
|
defaultuser={{ getv ("/asterisk/trunk/username") }}
|
||||||
fromuser={{getv "/asterisk/trunk/username"}}
|
fromuser={{ getv ("/asterisk/trunk/username") }}
|
||||||
username={{getv "/asterisk/trunk/username"}}
|
username={{ getv ("/asterisk/trunk/username") }}
|
||||||
user={{getv "/asterisk/trunk/username"}}
|
user={{ getv ("/asterisk/trunk/username") }}
|
||||||
|
secret={{ getv ("/asterisk/trunk/secret") }}
|
||||||
|
|
||||||
secret={{getv "/asterisk/trunk/secret"}}
|
{% for client in ls("/peers") %}
|
||||||
|
[{{ client }}]
|
||||||
|
type=peer
|
||||||
|
host=dynamic
|
||||||
|
secret={{ getv(printf("/peers/%s", client)) }}
|
||||||
|
context=internal
|
||||||
|
{% endfor %}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
[template]
|
|
||||||
src = "sip.conf.tmpl"
|
|
||||||
dest = "/etc/asterisk/sip.conf"
|
|
||||||
keys = [
|
|
||||||
"/asterisk",
|
|
||||||
]
|
|
|
@ -25,3 +25,4 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- "./phonetab:/etc/asterisk/phonetab"
|
- "./phonetab:/etc/asterisk/phonetab"
|
||||||
- "./moh:/var/lib/asterisk/moh"
|
- "./moh:/var/lib/asterisk/moh"
|
||||||
|
- "./peers.yml:/etc/asterisk/peers.yml:ro"
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
log_level = "debug"
|
||||||
|
log_format = "text"
|
||||||
|
|
||||||
|
[[resource]]
|
||||||
|
name = "asterisk"
|
||||||
|
|
||||||
|
[resource.exec]
|
||||||
|
command = "/usr/sbin/asterisk -fvv"
|
||||||
|
kill_signal = "SIGTERM"
|
||||||
|
reload_signal = "SIGHUP"
|
||||||
|
kill_timeout = 10
|
||||||
|
splay = 10
|
||||||
|
|
||||||
|
[[resource.template]]
|
||||||
|
src = "/etc/remco/templates/sip.conf.tmpl"
|
||||||
|
dst = "/etc/asterisk/sip.conf"
|
||||||
|
reload_cmd = "if [[ -e /var/run/asterisk/asterisk.ctl ]]; then asterisk -rx reload ; fi"
|
||||||
|
|
||||||
|
[resource.backend]
|
||||||
|
[resource.backend.file]
|
||||||
|
filepath = "/etc/asterisk/peers.yml"
|
||||||
|
watch = true
|
||||||
|
interval = 5
|
||||||
|
keys = ["/peers", "/asterisk"]
|
||||||
|
|
||||||
|
[resource.backend.env]
|
||||||
|
keys = ["/asterisk"]
|
Loading…
Reference in New Issue