asterisk-hass-addons
asterisk-hass-addons copied to clipboard
Custom wait music for parking
It would be nice to be able to edit the music what is played when parking a call.
In /config/asterisk/musiconhold.conf you will find the config file for this. Just adjust it to your own needs. This even supports a playlist mode with HTTP(S) based URL access to get the sound files from.
In res_parking.conf you can find the MOH class that is to be used. Default is: parkedmusicclass = default
"default" is specified in musiconhold.conf as the default MOH music which is played from the "moh" dir in the container.
@stefanschoemaker if @nanosonde's suggestion does not solve your problem, please let us know.
While you can always copy the music files into the config folder, this might not be nice as there is already a folder dedicated to media. @felipecrs So maybe we should map the media folder into the docker container as well in config.yaml?
Awesome, I agree! @TECH7Fox do you too?
It's harmless to map /media
as we the addon won't create any files there by default anyway.
It's harmless to map
/media
as we the addon won't create any files there by default anyway.
That is the question. The asterisk docker build also includes downloading all the sound files incl. default MOH music. Maybe we should keep this. It would also shrink the docker image size.
What I could image is that it would be nice to mount the media folder RW and let the asterisk.sh startup script check in the media folder if there is an "asterisk" folder. If it is not there, it could download and install the default asterisk sound files. That way we don't have the sound files in the docker images. Currently they are default ENGLISH anyway. Maybe people want to change and play with the sound files. So they would be able to do so by exchanging them in the media folder.
Sound great! Let's do that. :)
I also find it a very cool idea!
The sound files are in /var/lib/asterisk/
in moh
en sounds/<language>
.
Should we have them both in /media/asterisk/
?
Or do you guys have another idea?
I would say /media/asterisk/moh/sounds/<language>
and /media/asterisk/sounds/sounds/<language>
to keep the hierarchy as close as from Asterisk itself.
By the way, it would be nice to support downloading multiple languages. For example, I would like both English and Portuguese.
And just to summarize, if I understood well:
The language would only be downloaded if there isn't yet a folder for it, or the folder is empty.
I have a question: can we simply download all sounds from https://www.asterisksounds.org, even the English ones (i.e. totally ignore core sounds)?
I would say /media/asterisk/moh/sounds/
and /media/asterisk/sounds/sounds/ to keep the hierarchy as close as from Asterisk itself.
Can't we better have /media/asterisk/moh
and /media/asterisk/sounds/<language>
? Music on hold doesn't have to be langauge specific.
Should we add a automatic language download? It's probably a one time thing, and how would we make the config for that? And while still allowing users to add their own files.
So only the default sounds would be included like now. But what if other sounds get's added by a Asterisk update? A default
and custom
folder would take a lot more space.
I'm working on this. Let me push my first draft and we continue discussing there.
As housekeeping, I'm closing this issue in favor of #226 (released in 3.2.0).
- You can set custom sounds as you want, and refer to files in /media (as suggested by @nanosonde)
- The add-on is now capable of downloading language sounds automatically to /media
Notes:
- moh are still included in the image: they are not language-based, so I don't think there would be any usefulness of removing them from the image. They would need to be otherwise downloaded on add-on startup anyway, which means no space would be saved (except that it would make add-on upgrades slightly faster). I don't think it's worth implementing this.
- en core sounds are still included in the image: I did some search and realized that downloading the core sounds isn't as simple as 123. The Asterisk scripts to download these sounds relies on the Asterisk source code, make, autoconf and several other tools that we strip out from the image to make it smaller. If we go that route we would be exchanging size from the EN core sounds in favor of the tools needed to download them again. I honestly don't think it is worth the compromise.
If you disagree, please open a separate issue for the item you would like implemented.