Archive for the ‘Asterisk’ Category.

Asterisk and Festival Integration

So… you want your PBX to talk to you? This could be the start of a very bad relationship! In this short piece, I’ll describe making Asterisk on Debian/Ubuntu talk to Festival that is also installed on a Debian or Ubuntu server.

Firstly, have a read at VoIP-Info but don’t make any changes to files just yet. In this scenario, I’ll be using Method 1.

Create /etc/festival.scm and put the following into it – you may recognize it from Step 1 in the wiki.

;; Enable access to localhost (needed by debian users)
(set! server_access_list ‘(“localhost\\.localdomain” “localhost”))

;;; Command for Asterisk begin

(define (tts_textasterisk string mode)
“(tts_textasterisk STRING MODE)
Apply tts to STRING. This function is specifically designed for
use in server mode so a single function call may synthesize the string.
This function name may be added to the server safe functions.”
(let ((wholeutt (utt.synth (eval (list ‘Utterance ‘Text string)))))
(utt.wave.resample wholeutt 8000)
(utt.wave.rescale wholeutt 5)
(utt.send.wave.client wholeutt)))

;;; Command for Asterisk end

If you are going to access it from a different host, put the source IP address or hostname into the server_access_list array variable.

Next up, execute cp /usr/share/doc/festival/examples/festival.init /etc/init.d/festival to copy a sample init script to the init.d directory. Use chmod +x /etc/init.d/festival to make it executable, and then use update-rc.d festival defaults to insert startup links in the default runlevel directories.

/etc/default/festival also requires RUN_FESTIVAL=yes in it, in order for the init script to start the server.

Once all of the above is complete, you should be able to run /etc/init.d/festival start and Festival will start. This can be verified as such…

root@mxns2:~# ps waux | grep -i festiva[l]
festival 25411 0.0 8.4 26728 21496 ? S 22:52 0:00 /usr/bin/festival –server -b /etc/festival.scm
root@mxns2:~#

You can also check to see that Festival is listening on the network, as it should be in this case.

root@mxns2:~# netstat -lnp | grep -i festival
tcp 0 0 0.0.0.0:1314 0.0.0.0:* LISTEN 25411/festival
root@mxns2:~#

This tells us that it is listening on all IP addresses assigned to the server, on port 1314. Access control is provided by the array mentioned earlier.

Next up, Asterisk has to be told how to communicate with Festival. This is done by creating the /etc/asterisk/festival.conf file, and putting the following data into it.

[general]
host=localhost
port=1314
usecache=yes
cachedir=/var/cache/asterisk/festival/
festivalcommand=(tts_textasterisk “%s” ‘file)(quit)\n

As noted above, the port that Festival is listening on is 1314, and in this case Asterisk and Festival are both running on the same server – hence localhost. In my setup, I have a remote Festival server, and I put in the IP address of the Festival server.

So, almost all good to go. All you need to do now is set up an extension with the appropriate details. As per the wiki, you could stick the following into your extensions.conf

; testing festival (text-to-speech app)
exten => 555,1,Answer
exten => 555,2,Festival(mary had a little lamb) ; do NOT use quotes around the string! if you use commas, you will have to escape them with a “\” (backslash).
exten => 555,3,Hangup

Reload Asterisk, and off you go!

Asterisk Jabber Call Notifications

The other evening I busied myself with tweaking Asterisk to do some more geeky things. One such item was where I configured it to send a message to my Jabber account every time there was a call to a particular extension. Great for call logging, integration, and general user friendliness. If I was so inclined, it could message a Yahoo, MSN, ICQ, or AOL account through the Jabber platform to inform me of a new call. How rather flexible.

A Reason to Hate Cisco

Last week I ‘accidentally’ bought a Cisco 7911 phone on Ebay. My bid was low, the device was missing a few bits, but I still thought I wouldn’t get it.

Suffice to say… I’ve just written this piece on how to load the SIP firmware onto a Cisco 7911 phone. The procedures are covered elsewhere, but I thought I could compress it into a format that’s slightly easier to understand. Hope it makes sense. :-)

Whilst I’m at it, if anyone can email me a working SIP based cnf.xml file, it would be greatly appreciated. Getting the firmware onto the phone is easy… configuring it for Asterisk seems to be a completely different ballgame.

More VoIP

To follow on from my previous post, I’ve gone about setting up SIP addressing like this for a very good reason. Other than the eventual demise of telephone numbers, I believe that larger VoIP networks will increasingly grow in size, whilst marginalizing the smaller networks. This is what happened to free email provides many years ago, and it’ll happen again to VoIP providers. Continue reading ‘More VoIP’ »

VoIP

Lately I’ve been poking around Asterisk and related VoIP stuff, and generally trying to make it work. I’ve (not) read my fair share of documentation, and it still seems pretty patchy. I’ve signed up for a free 0141 number from Sipgate and it seems mostly good. However, SIP addressing is a big itch that I’ve recently scratched… Continue reading ‘VoIP’ »

More Zap Bugs

In an astounding piece of ignorance, the Digium bug tracking managers have closed off bugs 8763 and 9081. Both bugs are clearly reproducable, clearly showstoppers, and clearly a big problem, yet they refer the original reporter to Digium support and close off the bug as “No change required”.

Now, if you have a bit of hardware used by millions the world over, and your software randomly hangs on it without a word of warning and then refuses to work until it is unloaded and reloaded, then it really should be investigated a bit more closely. Digium & Open Source… just like clowns but without the fancy dress.

Zap Bugs

A couple of weeks ago, I commented on a bug that is affecting Zaptel software and hardware, both on the bug tracker, and more recently on the Asterisk users mailing list. Maybe I’m going about it the wrong way, but absolutely nobody seems to be interested in what appears to be quite a critical bug. If anyone has any idea on what to do to cure it, then it would be greatly appreciated.