mini-HowTo install Cepstral + Asterisk Weather Station by Zip from NerdVittles on trixbox 2.4.2

bryanj0207
Posts: 3
Member Since:
2007-04-29

First of all...THIS IS MY FIRST EVER mini-HowTo or otherwise. I have merely tried to copy and consolidate steps from a few articles along with my own experience. So please excuse if I miss a step or you find additional errors. Please comment and contribute where lacking.

After running trixbox 2.2.4 successfully using flite and the NerdVittles Asterisk Weather Station by Zip script, I was surprised to be unable to get the same setup working on a fresh 2.4.2 iso install. So after much head scratching, forum digging and irc channel pleadings, the following is a mini-HowTo listing the steps I took to replace flite with Cepstral for use with the NerdVittles Asterisk Weather Station by Zip Script. (The Cepstral voices sound so much better than the Flite "Robot") I would think it applies to others as well...

The following assumes you have a working trixbox system already in place with at least one working phone extension.

Step 1 - Reference arrticle: http://nerdvittles.com/index.php?m=200801

Log into your trixbox system via ssh as root and enter the following commands:

cd /root
wget http://downloads.cepstral.com/cepstral/i386-linux/Cepstral_Alliso...
tar -zxvf Cepstral*
cd Cepstral_Allison-8kHz_i386-linux_4.2.1
./install.sh

After you've read the license, type yes to install the voice on your system, not -yes- as the instructions imply. Don't ask how I know. Accept the default locations for the installation. When the installation completes, issue the following command:

echo /opt/swift/lib > /etc/ld.so.conf.d/cepstral.conf
ldconfig

This places the Cepstral_Allison voice in /opt/swift/voices/
You can download other voices from Cepstral at http://www.cepstral.com/cgi-bin/downloads?type=1143746987

After installing multiple voices, retrieve a list of installed voices with:

ls /opt/swift/voices

Step 2 - Installing apt-swift. There's another important piece in getting Cepstral to play nicely with Asterisk, apt-swift.

Just issue the following commands to install apt-swift on your trixbox system:

cd /usr/src
wget http://www.loopfree.net/app_swift/app_swift-0.9.1.tar.gz
tar -zxvf app_swift*
rm *.gz
cd app_swift-0.9.1
make
make install

Before proceeding, it is important to note I was unsuccessful at first installing apt-swift per the instructions found here: http://nerdvittles.com/index.php?m=200801

I read somewhere but can't remember where a comment stated the need to install asterisk-devel so I issued the following command:

yum install asterisk-devel

This time, the make failed finding no gcc so, I issued:

yum install gcc

Then ran make && make install and apt-swift compiled and installed successfully.

Step 3 - Finally, you need to add a link in your search path for Cepstral and modify /etc/asterisk/swift.conf to tell it which voice you want to use with Asterisk and then restart Asterisk. Assuming you installed Allison-8kHz, here are the commands.

ln -s /opt/swift/bin/swift /usr/bin/swift
sed -i 's|David-8kHz|Allison-8kHz|' /etc/asterisk/swift.conf
amportal restart

You can now check to see that everything is installed correctly in Asterisk by issuing the command:

asterisk -rx "core show application swift"

You should receive the following response:

-= Info about application 'Swift' =-

[Synopsis]
Speak text through Swift text-to-speech engine.

[Description]
Swift(text) Speaks the given text through the Swift TTS engine.
Returns -1 on hangup or 0 otherwise. User can exit by pressing any key.

Note*** If you have multiple voices installed, nano -w /etc/asterisk/swift.conf to change the voice you wish to use then "amportal restart". This allowed me to try different voices prior to purchasing a license for the voice I will use in production.

Step 4 - Installing NerdVittles Asterisk Weather Station by Zip Code; This part is pretty straight forward but we will need to make adjustments for Cepstral now instead of using Flite.

Follow instructions found here: http://bestof.nerdvittles.com/applications/weather-zip/

Per NerdVittles article found here: http://nerdvittles.com/index.php?m=200802 we will need to make adjustments as follows:

Changing DialPlan Code to Cepstral. Log into your server via ssh as root and edit the extensions_custom.conf file in /etc/asterisk: nano -w extensions_custom.conf. Now search for the number 947 then press Enter. You'll be positioned on code that looks like the following:

; Weather by Zip Code
exten => 947,1,Answer
exten => 947,2,Wait(1)
exten => 947,3,Set(TIMEOUT(digit)=7)
exten => 947,4,Set(TIMEOUT(response)=10)
;exten => 947,5,Flite("At the beep enter the five digit code for the weather report you wish to retrieve.")
exten => 947,5,Swift("At the beep enter the five digit code for the weather report you wish to retrieve.")
exten => 947,6,Read(ZIPCODE,beep,5)
;exten => 947,7,Flite("Please hold a moment while we contact the National Weather Service for your report.")
exten => 947,7,Swift("Please hold a moment while we contact the National Weather Service for your report.")
exten => 947,8,AGI(nv-weather-zip.php|${ZIPCODE})
exten => 947,9,NoOp(Wave file: ${TMPWAVE})
exten => 947,10,Playback(${TMPWAVE})
exten => 947,11,Hangup

Don't change anything else. When your code looks like that above save your changes by pressing Ctrl-X, then Y, then the Enter key. Reload your Asterisk dialplan to make the changes take effect:

asterisk -rx "dialplan reload"

You could also issue:

amportal restart

Next, complete the steps to install Asterisk Weather Station by Zip Code. After performing the AGI Script Setup you will need to change the PHP application code to accomodate Cepstral.

Step 5 - Changing PHP Application Code to Cepstral. Log into your server via ssh as root and issue the following commands using the name of the PHP file for the application you want to change:

cd /var/lib/asterisk/agi-bin
nano -w nv-weather-zip.php

At the top of the file, you'll notice several lines with variables that can be changed.

//-------- DON'T CHANGE ANYTHING ABOVE THIS LINE ----------------

$debug = 1;
$newlogeachdebug = 1;
$emaildebuglog = 0;
$email = "yourname@yourdomain" ;
$ttspick = 0 ;

//-------- DON'T CHANGE ANYTHING BELOW THIS LINE ----------------

To activate the Cepstral TTS engine, just change the value for $ttspick from 0 to 1. Then save your changes: Ctrl-X, Y, then Enter. Now try out your fancy new weather application using Cepstral by dialing 947 from any phone on your trixbox system.

Step 6 - Licensing Cepstral Voices - You may skip this step or pay for the voices whenever. You will here the voice nagging for you to visit www.cepstral.com until you do so.

After purchasing the license and receiving your key, issue command:

swift --reg-voice

Fill in the blanks with the information you wrote down, and you're all set. Dial 947 from a phone on your system again, and the nag message should be gone.

Your Name: John Q. Public
Company (if applicable): Acme Widgets
Voice: Allison-8kHz
License Key: xx-xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxxxx
You can license each Cepstral voice for just $29.99 or even cheaper if you find a promocode.

Step 7 - May not apply to all...In my personal experience I have repeated the above steps and each time the script hangsup after failing to read the weather. At the CLI I issued:

asterisk -r
then
set verbose 6

When dialing 947 from my softphone I could see the script stepping through but would never hear the report. Reviewing the log at /var/log/asterisk/nv-weather-zip.txt indicated the report was successfully downloading and I was seeing something like the following towards the bottom of the file:

exec swift "Your report was successfully downloaded. Please stand bye."
200 result=0
SET VARIABLE TMPWAVE tts/tts-86023d82b9aae6fde12517cf987c4802
200 result=1

So the script was completing, but the following dialplan steps were not working correctly:

exten => 947,9,NoOp(Wave file: ${TMPWAVE})
exten => 947,10,Playback(${TMPWAVE})

Finally, I figured out, there was no /var/lib/asterisk/sounds/tts directory so no wave file was being generated. I created the directory and assigned appropriate permissions. 0777 should work.

Now, pick up a phone attached to your trixbox system and dial 947. AMAZING...it works!

If I have left anything out, please post corrections.

Regards,

Jerry Bryan
www.southeasternnetworks.com



jahyde
Posts: 2002
Member Since:
2006-06-02
its in the wiki

its in the wiki here:
http://www.trixbox.org/wiki/Additional_Scripts_and_Tricks

--

--my PBX is run on 2 V8's



jades
Posts: 2336
Member Since:
2006-11-26
I folllwed the wiki VOICE

I folllwed the wiki
VOICE SOUNDS HORRIBLE
trixbox 2.4
The voice keeps on chopping off!! Also it sounds worse than g726 or gsm!
What can be done?
Thanks

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



ricknieves
Posts: 16
Member Since:
2008-01-08
Female or Male?

Hello, and thank for all the information.
I have successfully installed all the weather reports, but I am having an issue of dual personality. My PBX doesn’t know if she is female or male!
I install the Cepstral_Allison-8kHz_ voice with its working fine when I dial 947, I get Allison for the first part of the message but after the weather report is retrieve, the other voice takes over (robotic male, and very nasty!) and does the actual reading of weather report.
Its there a way to only used Allison for the entire call?

Please let me know what I can do to correct this.

Thank you

Rick Nieves



jades
Posts: 2336
Member Since:
2006-11-26
Robotic male is someone from

Robotic male is someone from the remote server I believe
I am actually using cepstral for something else. Internal calls- the voice is not too bad
External calls- the voice sounds worse than that male robot (flite) and you can hardly hear the voice because it's so choppy

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



jades
Posts: 2336
Member Since:
2006-11-26
No

No
the male is coming from the weather server
Unless the weather server starts using cepstral, you cant change it. Not that I know of. Because it downloads a report that the weather server makes with the male voice

Does anyone know why the voice is very choppy with external calls?

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



andrew
Posts: 1418
Member Since:
2006-05-30
great work on this

Thanks for such a complete how-to and thanks for adding it to the wiki so everyone can use it!



ricknieves
Posts: 16
Member Since:
2008-01-08
Replay to ja133

Thank you for answering my question, but I am going to have to disagree with you answers, take a look at the following link:

http://nerdvittles.com/index.php?p=205#comments

Scroll up and fine the telephone numbers they listed for testing purposes, (310-862-5268 and 678-444-2445) if you call you will hear the entire message spooking by Allison. By the way on this link you will also fine that these community took the time to make the installation package with cut the time to set up in leas then a minute. Please check it out, and let’s see how we can get rid of the robotic male voice.

Thank

Rick Nieves



bryanj0207
Posts: 3
Member Since:
2007-04-29
multiple voices on playback

I had similar problem after installing initially and realized I had downloaded and installed multiple voices from Cepstral. Pay particular attention to the entry/entries in /etc/asterisk/swift.conf

If I recall, I completely removed the swift installation, deleted all voices, and reinstalled per the steps on the wiki and specifically installed the Callie-8kHz voice.

I edited the /etc/asterisk/swift.conf file manually instead of using sed -i 's|David-8kHz|Allison-8kHz|' /etc/asterisk/swift.conf

make sure there are no references to the David-8kHz voice which is referenced by default. I think this is the reason for multiple voices...one installed by you and the other being the "male robotic voice".

My test setup is running trixbox 2.4.x, freepbx upgraded to latest stable on a celeron 2.6Ghz/1GB RAM/80GB HDD/SPA3102 trunk to analog pstn.

I have not been able to recreate this effect by following my steps and I have no choppy playback on my end. You may email me directly at bryanj0207 at hotmail dot com and I will send you my test number whereby you can call and listen to my setup if you wish.

I don't think it would be terribly difficult to automate the above installation, I have never done such scripting, but agree it would be nice to have such an option available. I will see what I can do after I update to the latest 2.6iso and have this same setup running on 2.6.



mentalsolutions
Posts: 13
Member Since:
2008-03-05
Using Cepstral for IVR messages

I have just installed trixbox for the first time and am new to all this, so apologies for the basic question, but...

I have installed Cepstral per the instructions above (and thanks to Jerry for those, very useful) though I didn't go as far as installing Weather Station. I would like to use Cepstral to create announcements for the IVR but have no idea how to do this? Should I be able to do it through the GUI or do I need to amend a conf file? If so which one? I can get to the swift.conf file so I assume it has installed correctly, and can get an audio response from a command line...it's the integration with the IVR that I am struggling with

Thanks
Mark



ricknieves
Posts: 16
Member Since:
2008-01-08
Robotic Male Voice Gone...

I finally wipe off the male voice , but really cannot tell you what I did to make it happen. Other then re running the installation again, deleting here and there… but its working fine now.
Thanks
Rick Nieves



jades
Posts: 2336
Member Since:
2006-11-26
You know how I said that

You know how I said that this sounds horrible with external calls? This is actually only happening with Vitelity. I started using teliax and I am NOT having the issue. (I didnt test with any other provider)
So isnt this strange? I was originally told that the choppy voice was due to a timing issue. I have no timing device here, just using trixbox 2.6, and it's working great with teliax. How's this possible?

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



fsit
Posts: 38
Member Since:
2007-10-17
Maybe becuase...

Vitelity is a low cost crappy network that constantly has problems.



jahyde
Posts: 2002
Member Since:
2006-06-02
slightly better than a high

slightly better than a high cost crappy network that constantly has problems

--

--my PBX is run on 2 V8's



fsit
Posts: 38
Member Since:
2007-10-17
I'll agree with that. They

I'll agree with that. They just frustrate me. Monday their toll free numbers were down for hours and at the same time local DID's were intermittently down and wasn't fixed until this morning.



jades
Posts: 2336
Member Since:
2006-11-26
Oh god don't get me started

Oh god don't get me started with my Vitelity issues. That's why our numbers are in the middle of being ported to teliax.

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



mnapuran
Posts: 29
Member Since:
2007-09-04
Help.... I have Cepstral

Help.... I have Cepstral installed and followed the instructions here on getting app_swift installed (used 0.9.1). asterisk -rx "core show application swift" does show swift is installed.

I added a call to swift in my extensions_custom.conf, and monitored the call progress via asterisk -r. Everything executed properly w/ no errors or drops... BUT, I never got the TTS read to me over the phone.

Example below...

-- Executing [s@custom-superclean:3] Playback("SIP/101-09034790", "custom/ENG_PIN") in new stack
-- Playing 'custom/ENG_PIN' (language 'en')
-- Executing [s@custom-superclean:4] Swift("SIP/101-09034790", "This is a test") in new stack
-- Executing [s@custom-superclean:5] Goto("SIP/101-09034790", "pinspot") in new stack
-- Goto (custom-superclean,s,7)
-- Executing [s@custom-superclean:7] Read("SIP/101-09034790", "PIN|beep|6||1|3") in new stack

Any clues?!



bryanj0207
Posts: 3
Member Since:
2007-04-29
Cepstral installed...call to swift in extensions_custom.conf

Please accept my apologies if I am WAY off base on this but I haven't really tested beyond the HowTo with other applications or extensions_custom.conf calls whereby the extension is calling any "text to speech" apps other than the weatherbyzip app.

So without knowing more about your system/installation, I would have to ask you, did you make the symbolic link so the app you are calling would know where to find the Cepstral application?

ln -s /opt/swift/bin/swift /usr/bin/swift

If so, did you create the /var/lib/asterisk/sounds/tts directory and give it 0777 permissions?

If this doesn't resolve the issue, repost with the trixbox version and more details on what extension you are trying to create and the app you are calling and I will try to recreate on my end to help troubleshoot.



mnapuran
Posts: 29
Member Since:
2007-09-04
Yes, I did the ln link (just

Yes, I did the ln link (just double checked), and the /sounds/tts directory as well. As shown above, I am not getting an error on the "Swift" line, just no read response. Is there another log created that I can look at?

This is on a Trixbox CE v2.6.0.0 box, running FreePBX 2.4.0

Thanks!

-Mike



bradchapin
Posts: 3
Member Since:
2008-07-30
Seemingly the latest trixbox

Seemingly the latest trixbox version (V2.6.1) doesn't allow "make" so I got stuck right before the swift install. I tried the yum install asterisk-devel and yum install gcc as the writer stated, but it didn't work. I then tried yum group install "Development Tools" and that fixed some sort of dependency that was missing. Not sure which one, but was able to make and make install the app_swift-0.9.1 after that.



bravonoj
Posts: 204
Member Since:
2007-11-20
I know this is an old old

I know this is an old old thread but has anyone gotten Cepstral and apt-swift installed and working on tb2.8? I just installed it last night as best as I could figure given the instructions, and whatever it did, it made asterisk die.



b14ck
Posts: 772
Member Since:
2009-03-03
You need to use app_swift

You need to use app_swift 1.6 (darren session makes it). You can find it online. After you've got that working, just install cepstral and it'll work.

--

Randall Degges
Lead Developer, RCI Telecommunications
projectb14ck - http://projectb14ck.org/ - Weblog



bravonoj
Posts: 204
Member Since:
2007-11-20
Thanks Randall

Can I do a yum install on that or do I have to download the zip, unzip it, and do a make && make install?



tiggerpaws
Posts: 43
Member Since:
2010-05-11
This no longer functions.

This no longer functions.



SkykingOH
Posts: 8081
Member Since:
2007-12-17
I have app-swift and

I have app-swift and Cepstral running on 1.6.2 system.

Not sure what tiggerpaws is referencing.

--

Scott

aka "Skyking"



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.