Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 328513 - asterisk enhancements
Summary: asterisk enhancements
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Tony Vroon (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-15 23:33 UTC by Jaco Kroon
Modified: 2010-08-20 23:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
asterisk-core-sounds-1.4.19.ebuild (asterisk-core-sounds-1.4.19.ebuild,1.73 KB, text/plain)
2010-07-15 23:41 UTC, Jaco Kroon
Details
asterisk-extra-sounds-1.4.11.ebuild (asterisk-extra-sounds-1.4.11.ebuild,1.73 KB, text/plain)
2010-07-15 23:45 UTC, Jaco Kroon
Details
asterisk-moh-opsound-2.03.ebuild (asterisk-moh-opsound-2.03.ebuild,888 bytes, text/plain)
2010-07-15 23:51 UTC, Jaco Kroon
Details
metadata.xml (metadata.xml,831 bytes, text/plain)
2010-07-15 23:53 UTC, Jaco Kroon
Details
asterisk-sounds-ebuild.patch (asterisk-sounds-ebuild.patch,875 bytes, patch)
2010-07-15 23:57 UTC, Jaco Kroon
Details | Diff
asterisk-moh-opsound-2.03.ebuild (asterisk-moh-opsound-2.03.ebuild,986 bytes, text/plain)
2010-07-31 10:45 UTC, Jaco Kroon
Details
asterisk-core-sounds-1.4.19.ebuild (asterisk-core-sounds-1.4.19.ebuild,1.75 KB, text/plain)
2010-07-31 10:47 UTC, Jaco Kroon
Details
asterisk-extra-sounds-1.4.11.ebuild (asterisk-extra-sounds-1.4.11.ebuild,1.75 KB, text/plain)
2010-07-31 10:50 UTC, Jaco Kroon
Details
Re-factored asterisk-core-sounds ebuild (asterisk-core-sounds-1.4.19.ebuild,1.41 KB, text/plain)
2010-08-01 06:37 UTC, kfm
Details
codecs.desc file for /usr/portage/profiles/desc (codecs.desc,501 bytes, text/plain)
2010-08-01 06:45 UTC, kfm
Details
metadata.xml (metadata.xml,830 bytes, text/plain)
2010-08-02 16:09 UTC, Jaco Kroon
Details
asterisk-moh-opsound-2.03.ebuild (asterisk-moh-opsound-2.03.ebuild,1.13 KB, text/plain)
2010-08-02 16:10 UTC, Jaco Kroon
Details
asterisk-core-sounds-1.4.19.ebuild (asterisk-core-sounds-1.4.19.ebuild,1.78 KB, text/plain)
2010-08-02 16:14 UTC, Jaco Kroon
Details
asterisk-extra-sounds-1.4.11.ebuild (asterisk-extra-sounds-1.4.11.ebuild,1.78 KB, text/plain)
2010-08-02 16:16 UTC, Jaco Kroon
Details
asterisk-core-sounds-1.4.19.ebuild (asterisk-core-sounds-1.4.19.ebuild,1.78 KB, text/plain)
2010-08-20 22:04 UTC, Jaco Kroon
Details
asterisk-extra-sounds-1.4.11.ebuild (asterisk-extra-sounds-1.4.11.ebuild,1.78 KB, text/plain)
2010-08-20 22:10 UTC, Jaco Kroon
Details
asterisk-moh-opsound-2.03.ebuild (asterisk-moh-opsound-2.03.ebuild,1.13 KB, text/plain)
2010-08-20 22:17 UTC, Jaco Kroon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaco Kroon 2010-07-15 23:33:51 UTC
The way sounds and moh is currently dealt with is restrictive, and the current asterisk-sounds package is seemingly still a match to asterisk 1.2, thus I intend to submit three new ebuilds:

net-misc/asterisk-core-sounds
net-misc/asterisk-extra-sounds
net-misc/asterisk-moh-opsound

The core-sounds is the same sounds that currently gets installed with asterisk module, except the ebuild supports all the codec variants made available by digium.  The extra-sounds package contains a very close set to the current asterisk-sounds package.  asterisk-moh-opsound is the current default music on hold music.  Again, for each codec there is a USE flag to install or not to install.  In the case of the two sounds packages the LINGUAS USE_EXPAND variable is queried to determine which of english or french should be installed.

I'll also submit two patches to be applied to the asterisk-1.6.1.20 and asterisk-1.6.2.8 ebuilds to prevent it from installing sounds and to instead PDEPEND on the above packages.

Reproducible: Always

Steps to Reproduce:
Comment 1 Jaco Kroon 2010-07-15 23:41:18 UTC
Created attachment 238951 [details]
asterisk-core-sounds-1.4.19.ebuild
Comment 2 Jaco Kroon 2010-07-15 23:45:42 UTC
Created attachment 238953 [details]
asterisk-extra-sounds-1.4.11.ebuild
Comment 3 Jaco Kroon 2010-07-15 23:51:18 UTC
Created attachment 238955 [details]
asterisk-moh-opsound-2.03.ebuild
Comment 4 Jaco Kroon 2010-07-15 23:53:35 UTC
Created attachment 238957 [details]
metadata.xml

The same metadata.xml file can be used for all three ebuilds in this case.  The metadata.xml file merely describes the USE flags.
Comment 5 Jaco Kroon 2010-07-15 23:57:55 UTC
Created attachment 238959 [details, diff]
asterisk-sounds-ebuild.patch

This patch will apply to asterisk-1.6.1.20 as well as asterisk-1.6.2.9 in order to set the appropriate PDEPEND values on the submitted three ebuilds, as well as to blank out sounds/sounds.xml, effectively preventing the core asterisk ebuild from installing sounds files.
Comment 6 Tony Vroon (RETIRED) gentoo-dev 2010-07-19 15:37:59 UTC
Stalled pending further discussion & testing; not going into 1.6.2.9-r1
Comment 7 Jaco Kroon 2010-07-31 10:45:38 UTC
Created attachment 240777 [details]
asterisk-moh-opsound-2.03.ebuild

Remove gsm USE flag as per discussion with Tony, this will now always install the gsm variants, plus any additional selected codecs.  I've left the ability to use + and - in the codecs to set default values for any other codecs even though none of them currently makes use of it.
Comment 8 Jaco Kroon 2010-07-31 10:47:44 UTC
Created attachment 240779 [details]
asterisk-core-sounds-1.4.19.ebuild

gsm and en force-enabled, ability for + and - indicators once more left in place.
Comment 9 Jaco Kroon 2010-07-31 10:50:19 UTC
Created attachment 240783 [details]
asterisk-extra-sounds-1.4.11.ebuild

ditto ...

Any suggestions on packing asterisk-moh-freeplay?  It doesn't seem to contain usable version numbers.
Comment 10 kfm 2010-08-01 05:00:52 UTC
Firstly, I really like the idea of packaging the sound files independently - great idea.

However, I do not like the manner in which the USE flags are handled; I think it is unnecessarily convoluted. My suggestion is that IUSE is declared in the conventional fashion:

  IUSE="alaw g722 g729 gsm siren7 siren14 sln16 ulaw wav"

The gsm flag and english locale can be enforced trivially by appending to /usr/portage/profiles/base/package.use.force:

  net-misc/asterisk-core-sounds gsm linguas_en
  net-misc/asterisk-extra-sounds gsm linguas_en
  net-misc/asterisk-moh-opsound gsm linguas_en

This should simplify things somewhat which is probably just as well ...

# ebuild asterisk-core-sounds-1.4.19.ebuild manifest

<snip>

!!! Couldn't download 'asterisk-core-sounds-^en-^gsm-1.4.19.tar.gz'. Aborting.
!!! Fetch failed for asterisk-core-sounds-^en-^gsm-1.4.19.tar.gz, can't update Manifest
Comment 11 kfm 2010-08-01 05:04:35 UTC
Also, if one would rather not employ the canonical form of USE, one might declare a CODECS USE_EXPAND variable instead (so the package.use.force syntax would be "codecs_gsm linguas_en". Of course, that would require a documentative file under /usr/portage/profiles/desc.
Comment 12 kfm 2010-08-01 06:37:11 UTC
Created attachment 240901 [details]
Re-factored asterisk-core-sounds ebuild

* Changed DEPEND (hey, don't leave asterisk-1.4 out in the cold!)
* Presence of USE_EXPAND flags in IUSE should be unconditional
* Removed the proprietary ^ operator and simplified code
  (see follow-up comment)
* Removed spurious variables and declared some others as local
* Use einfo instead of echo and change wording slighty to distinguish the
  message somewhat from the phase messages that appear nearby

Tested and apparently working.
Comment 13 kfm 2010-08-01 06:40:40 UTC
To simulate the pre-requisite environment:

# mkdir /etc/portage/profile
# echo "net-misc/asterisk-core-sounds codecs_gsm linguas_en" \
    > /etc/portage/profile/package.use.force
# echo USE_EXPAND="CODECS" >> /etc/make.conf
# ACCEPT_KEYWORDS="**" emerge -pv asterisk-core-sounds

[ebuild  N    ] net-misc/asterisk-core-sounds-1.4.19  CODECS="(gsm) -alaw -g722 -g729 -siren14 -siren7 -sln16 -ulaw -wav" LINGUAS="(en) -fr" 0 kB
Comment 14 kfm 2010-08-01 06:45:12 UTC
Created attachment 240903 [details]
codecs.desc file for /usr/portage/profiles/desc
Comment 15 kfm 2010-08-01 07:20:50 UTC
Re: Comment 9 - I would suggest using the date from the upstream tarball e.g. asterisk-moh-freeplay-20091216.
Comment 16 Jaco Kroon 2010-08-01 09:47:13 UTC
E(In reply to comment #15)
> Re: Comment 9 - I would suggest using the date from the upstream tarball e.g.
> asterisk-moh-freeplay-20091216.
> 

They've been removed due to licensing issues, as explained on #asterisk:

<jkroon> is there any specific reason why asterisk-moh-freeplay-* in http://downloads.asterisk.org/pub/telephony/sounds/releases/ isn't versioned?
<tzafrir_laptop> jkroon, they were removed for potential licensing issues
<tzafrir_laptop> They are not versioned because there was only one version
<tzafrir_laptop> Anyway, just use the opsound ones

So I'm guessing we just leave freeplay out of it.  Either way, at the URL above I can't even locate date-stamped versions of freeplay moh at all.  So difficult to package.

Tony, your comments re use of package.use.force - I like it, I'll happily re-adjust the other ebuilds as well if you're happy with that solution.  It still gives someone a chance (I think, via /etc/portage/package.use.force) to remove the gsm stuff if they really insist on not having it, as well as linguas_en.  And it certainly does simplify the "convolution" at the top of the file.
Comment 17 kfm 2010-08-01 17:17:39 UTC
(In reply to comment #16)
> So I'm guessing we just leave freeplay out of it.  Either way, at the URL
> above I can't even locate date-stamped versions of freeplay moh at all. So
> difficult to package.

It can be seen that it was uploaded on the 26th December 2009 but I agree; let's not bother with it.
Comment 18 Jaco Kroon 2010-08-02 16:09:09 UTC
Created attachment 241105 [details]
metadata.xml

Accidentally had +gsm in the xml instead of just gsm.  This just removes the spurious + sign.
Comment 19 Jaco Kroon 2010-08-02 16:10:54 UTC
Created attachment 241107 [details]
asterisk-moh-opsound-2.03.ebuild

* Remove linguas_en as per discussion on #gentoo-dev, only offer fr as an optional.
* Use defaults IUSE for +gsm
* Issue an ewarn if no codecs selected, but don't fail.
Comment 20 Jaco Kroon 2010-08-02 16:14:55 UTC
Created attachment 241113 [details]
asterisk-core-sounds-1.4.19.ebuild

I can't deprecate Kerin's ebuild/files.  As per IRC discussion it's been decided to add all options as USE flags, but to have gsm enabled by default at package level, and to only issue a warning if no codecs are set.

This deprecates both files uploaded by Kerin.  I tried to keep the local var cleanups Kerin made, but please do audit this.

Kerin - you're welcome to change the extracting messages again - I did the echo thing on purpose to make them as close as possible with the way it looks by default.
Comment 21 Jaco Kroon 2010-08-02 16:16:11 UTC
Created attachment 241117 [details]
asterisk-extra-sounds-1.4.11.ebuild

ditto.  Kerin, please confirm that you are able to digest these files.  I've even gone as far as removing the Manifest file and regenerating the digest files and it works for me, but nothing I've changed should change this for you.
Comment 22 Jaco Kroon 2010-08-20 08:25:04 UTC
Hi,

Progress on this?  I believe the last submitted ebuilds are production ready and would like to see these ebuilds made available and the patch to the asterisk ebuild applied at some point.
Comment 23 Tony Vroon (RETIRED) gentoo-dev 2010-08-20 17:43:05 UTC
I have it all set up on my laptop now, ready to commit. But there is a slight problem with the core/extra sounds ebuilds when I try them:
>>> Install asterisk-extra-sounds-1.4.11 into /var/tmp/portage/net-misc/asterisk-extra-sounds-1.4.11/image/ category net-misc
!!! dodoc: ^en/CHANGES-asterisk-extra-^en-1.4.11 does not exist

LINGUAS is unset on my system. Please advise?
Comment 24 Jaco Kroon 2010-08-20 22:04:45 UTC
Created attachment 243769 [details]
asterisk-core-sounds-1.4.19.ebuild

Fix up some bash (4.1) issues.
Comment 25 Jaco Kroon 2010-08-20 22:10:53 UTC
Created attachment 243771 [details]
asterisk-extra-sounds-1.4.11.ebuild
Comment 26 Jaco Kroon 2010-08-20 22:17:23 UTC
Created attachment 243773 [details]
asterisk-moh-opsound-2.03.ebuild

Single modification of bash prefix stripping - it won't actually have an effect, but this is now slightly less cluttered.
Comment 27 Tony Vroon (RETIRED) gentoo-dev 2010-08-20 23:12:22 UTC
+*asterisk-core-sounds-1.4.19 (20 Aug 2010)
+
+  20 Aug 2010; <chainsaw@gentoo.org> +asterisk-core-sounds-1.4.19.ebuild,
+  +metadata.xml:
+  Initial commit, ebuild by Jaco Kroon. For bug #328513.


+*asterisk-extra-sounds-1.4.11 (20 Aug 2010)
+
+  20 Aug 2010; <chainsaw@gentoo.org> +asterisk-extra-sounds-1.4.11.ebuild,
+  +metadata.xml:
+  Initial commit, ebuild by Jaco Kroon. For bug #328513.


+*asterisk-moh-opsound-2.03 (20 Aug 2010)
+
+  20 Aug 2010; <chainsaw@gentoo.org> +asterisk-moh-opsound-2.03.ebuild,
+  +metadata.xml:
+  Initial commit, ebuild by Jaco Kroon. For bug #328513.

+*asterisk-1.6.2.11-r1 (20 Aug 2010)
+
+  20 Aug 2010; <chainsaw@gentoo.org> asterisk-1.2.40.ebuild,
+  asterisk-1.6.2.10.ebuild, asterisk-1.6.2.11.ebuild,
+  +asterisk-1.6.2.11-r1.ebuild,
+  +files/1.6.2/asterisk-1.6.2.11-strip-noapi.patch,
+  +files/1.6.2/asterisk.initd2, +files/1.6.2/asterisk.logrotate,
+  asterisk-1.2.37.ebuild:
+  Tweak nm call to avoid binary deletion as requested by Alexey McSakoff in
+  bug #302736. Bashims removed from init script by Kerin Millar & Federico
+  Santulli, closes bug #309277. Stock audio prompts now split out to
+  separate ebuilds and logrotate support thanks to Jaco Kroon, closes bug
+  #328513 & #329281 respectively.