Skip to content
This repository was archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sdesalve authored Aug 9, 2019
0 parents commit 0fdde38
Show file tree
Hide file tree
Showing 18 changed files with 726 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2019 SDeSalve

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Some Hass.io add-ons for Home Assistant

Enable this plugin repository for [Hass.io](https://home-assistant.io/hassio/) following the [third party addon guide](https://home-assistant.io/hassio/installing_third_party_addons/). As repository add `https://github.com/sdesalve/hassio-addons`


106 changes: 106 additions & 0 deletions dss_voip/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
ARG BUILD_FROM=alpine:3.10.1
# hadolint ignore=DL3006
FROM ${BUILD_FROM}

# Environment variables
ENV \
HOME="/root" \
LANG="C.UTF-8" \
PS1="$(whoami)@$(hostname):$(pwd)$ " \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
S6_CMD_WAIT_FOR_SERVICES=1 \
TERM="xterm-256color"

# Copy root filesystem
COPY rootfs /

# Copy yq
ARG BUILD_ARCH=amd64
COPY bin/yq_${BUILD_ARCH} /usr/bin/yq

# Set shell
SHELL ["/bin/ash", "-o", "pipefail", "-c"]

# Install base system
RUN \
set -o pipefail \
\
&& echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \
&& echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories \
&& echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories \
\
&& apk add --no-cache --virtual .build-dependencies \
tar=1.32-r0 \
\
&& apk add --no-cache \
libcrypto1.1=1.1.1c-r0 \
libssl1.1=1.1.1c-r0 \
musl-utils=1.1.22-r2 \
musl=1.1.22-r2 \
\
&& apk add --no-cache \
bash=5.0.0-r0 \
curl=7.65.1-r0 \
jq=1.6-r0 \
tzdata=2019a-r0 \
\
&& apk add --no-cache \
sox=14.4.2-r5 \
pjsua=2.8-r0 \
\
&& S6_ARCH="${BUILD_ARCH}" \
&& if [ "${BUILD_ARCH}" = "i386" ]; then S6_ARCH="x86"; fi \
&& if [ "${BUILD_ARCH}" = "armv7" ]; then S6_ARCH="arm"; fi \
\
&& curl -L -s "https://github.com/just-containers/s6-overlay/releases/download/v1.22.1.0/s6-overlay-${S6_ARCH}.tar.gz" \
| tar zxvf - -C / \
\
&& mkdir -p /etc/fix-attrs.d \
&& mkdir -p /etc/services.d \
\
&& curl -J -L -o /tmp/bashio.tar.gz \
"https://github.com/hassio-addons/bashio/archive/v0.3.2.tar.gz" \
&& mkdir /tmp/bashio \
&& tar zxvf \
/tmp/bashio.tar.gz \
--strip 1 -C /tmp/bashio \
\
&& mv /tmp/bashio/lib /usr/lib/bashio \
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
\
&& apk del --purge .build-dependencies \
&& rm -f -r \
/tmp/*

# Entrypoint & CMD
ENTRYPOINT ["/init"]

#RUN mkdir -p /share/dss_voip
#RUN chmod 770 /share/dss_voip

# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh

CMD [ "/run.sh" ]

# Build arugments
ARG BUILD_DATE
ARG BUILD_REF
ARG BUILD_VERSION

# Labels
LABEL \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="base" \
io.hass.version=${BUILD_VERSION} \
maintainer="SDeSalve <[email protected]>" \
org.label-schema.description="SDeSalve VoIP addon: ${BUILD_ARCH} image" \
org.label-schema.build-date=${BUILD_DATE} \
org.label-schema.name="Addon VoIP for ${BUILD_ARCH}" \
org.label-schema.schema-version="1.0.0" \
org.label-schema.url="https://addons.community" \
org.label-schema.usage="https://github.com/sdesalve/hassio-addons/dss_voip/README.md" \
org.label-schema.vcs-ref=${REF} \
org.label-schema.vcs-url="https://github.com/sdesalve/hassio-addons/dss_voip" \
org.label-schema.vendor="SDeSalve"
21 changes: 21 additions & 0 deletions dss_voip/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2019 SDeSalve

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
199 changes: 199 additions & 0 deletions dss_voip/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# SDeSalve Hass.io Add-ons: DSS VoIP Notifier

![Supports aarch64 Architecture][aarch64-shield]
![Supports amd64 Architecture][amd64-shield]
![Supports armhf Architecture][armhf-shield]
![Supports armv7 Architecture][armv7-shield]
![Supports i386 Architecture][i386-shield]

[![Buy me a coffee][buymeacoffee-shield]][buymeacoffee]

[![Support my work on Paypal][paypal-shield]][paypal]

This add-on allows you to make VoIP calls from Hassio.

## Features

This add-on, of course, provides a way to transform a text in a audio file, make a VoIP call to a SIP url and play them to the attendee.
You will need a valid VoIP account and their parameters to customize this addon config.

Obviously you need to setup [Google Translate Text-to-Speech][googletts].
The google_translate text-to-speech platform uses unofficial Google Translate Text-to-Speech engine to read a text with natural sounding voices.

## Installation

The installation of this add-on is pretty straightforward and not different in
comparison to installing any other Hass.io add-on.

1. [Add our Hass.io add-ons repository][repository] to your Hass.io instance.
1. Install the "DSS VoIP Notifier" add-on.
1. Configure the `sip_server_uri`, `caller_id_uri`, `username`, and `password` options.
1. Start the "DSS VoIP Notifier" add-on.
1. Check the logs of the "DSS VoIP Notifier" add-on to see if everything
went well. Addons will wait to be invoked from an `automation`/`script`.

## Configuration

**Note**: _Remember to restart the add-on when the configuration is changed._

DSS VoIP Notifier add-on configuration:

```json
{
"sip_parameters": {
"sip_server_uri": "sip:sipserver.com:5060",
"caller_id_uri": "sip:[email protected]",
"realm": "*",
"username": "username",
"password": "password"
}
}
```

**Note**: _This is just an example, don't copy and paste it! Create your own!_

#### Option `sip_parameters`: `sip_server_uri` (Optional)

Set the URL of the registrar server. It not specified, then the account will not register. An example of URL: "sip:sipserver.com:5060"

#### Option `sip_parameters`: `callerd_id` (Required)

Set SIP URL of the account(i.e. From header). For example: "sip:username@sipserver.com"

#### Option `sip_parameters`: `username` (Optional)

Set authentication user ID.

#### Option `sip_parameters`: `password` (Optional)

Set authentication password (clear text).

#### Option `sip_parameters`: `realm` (Optional)

Set authentication realm. The realm is used to match this credential against challenges issued by downstream servers. If the realm is not known beforehand, wildcard character ('*') can be specified to make SIP Client respond to any realms.

## Example config for some VoIP providers

Pbxes.com phonebox
```json
{
"sipparameters": {
"registrar": "sip:www3.pbxes.com:36999",
"callerid": "sip:[email protected]",
"realm": "*",
"username": "extension",
"password": "password"
}
}
```
**Note**: _call_sip_uri_ in Hassio service call must end with **@pbxes.com**. An example of URL: "sip:[email protected]"

Vohippo.com VoIP provider
```json
{
"sipparameters": {
"registrar": "sip:sip.vohippo.com:5060",
"callerid": "sip:[email protected]",
"realm": "*",
"username": "username",
"password": "password"
}
}
```
**Note**: _call_sip_uri_ in Hassio service call must end with **@vohippo.com**. An example of URL: "sip:[email protected]"

Eutelia.it/CloudItaliaOrchestra.it VoIP provider
```json
{
"sipparameters": {
"registrar": "sip:voip.eutelia.it:5060",
"callerid": "sip:[email protected]",
"realm": "*",
"username": "phonenumber",
"password": "password"
}
}
```
**Note**: _call_sip_uri_ in Hassio service call must end with **@voip.eutelia.it**. An example of URL: "sip:[email protected]"

## How to use

You will need to call this addon from your Hassio `automation`/`script` usign following yaml service invoke:

```yaml
...
- service: hassio.addon_stdin
data_template:
addon: 89275b70_dss_voip
input: {"call_sip_uri":"sip:[email protected]","message_tts":"Write here your message"}
...
```

#### Option `call_sip_uri` (Required)

Set SIP URL to call. For example: "sip:username@sipserver.com" or "sip:[email protected]"

#### Option `message_tts` (Required)

Write here your message that will be played thru TTS to the attendee.


## Support

Got questions?

You have several options to get them answered:

- The [HassioHelp - Domotica Shelly Sonoff Xiaomi @hassiohelp][hassiohelp] an italian's telegram Home Assistant Italian Group for add-on
support and general Home Assistant discussions and questions.
- [Open an issue here][issue] GitHub.

## Contributing

This is an active open-source project. We are always open to people who want to
use the code or contribute to it.

Thank you for being involved! :heart_eyes:

## Authors & contributors

The original setup of this repository is by [SDeSalve][sdesalve].

## License

MIT License

Copyright (c) 2017-2019 SDeSalve

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg
[i386-shield]: https://img.shields.io/badge/i386-yes-green.svg
[buymeacoffee-shield]: https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-2.svg
[buymeacoffee]: https://www.buymeacoffee.com/sdesalve
[sdesalve]: https://github.com/sdesalve
[issue]: https://github.com/sdesalve/hassio-addons/issues
[paypal-shield]: https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif
[paypal]: https://paypal.me/SDeSalve
[repository]: https://github.com/sdesalve/hassio-addons
[hassiohelp]: https://t.me/HassioHelp
[googletts]: https://www.home-assistant.io/components/google_translate
Binary file added dss_voip/bin/yq_aarch64
Binary file not shown.
Binary file added dss_voip/bin/yq_amd64
Binary file not shown.
Binary file added dss_voip/bin/yq_armhf
Binary file not shown.
Binary file added dss_voip/bin/yq_armv7
Binary file not shown.
Binary file added dss_voip/bin/yq_i386
Binary file not shown.
12 changes: 12 additions & 0 deletions dss_voip/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"image": "sdesalve/dss_voip-{arch}",
"squash": false,
"build_from": {
"aarch64": "arm64v8/alpine:3.10.1",
"amd64": "amd64/alpine:3.10.1",
"armhf": "arm32v6/alpine:3.10.1",
"armv7": "arm32v7/alpine:3.10.1",
"i386": "i386/alpine:3.10.1"
},
"args": {}
}
Loading

0 comments on commit 0fdde38

Please sign in to comment.