Upgrade 3CX to v18 and get it hosted free!

Building app_swift under Mac OS X

Author image

app_swift is a module used for integrating Cepstral text-to-speech library with Asterisk. This is a particularly good fit for Asterisk since Cepstral’s “Allison” voice was sampled from the same voice actress as Asterisk’s pre-recorded sound files. The app_swift module can be build along with Asterisk 1.6 under Mac OS X with some slight modifications.

At least one Cepstral voice must be installed in order for the required framework to be available. A trial version of any voice can be downloaded for free from cepstral.com.

Also, download app_swift-2.0_ast-1.6.tar from asterisk.org.

After extracting the app_swift-2.0_ast-1.6.tar archive, edit the app_swift.c file.

Near the top of the file, change the line


#include <swift.h>

to:


#include "/Library/Frameworks/swift.framework/Headers/swift.h"

After extracting the Asterisk source archive, copy the app_swift.c file into the apps folder.
Edit the Asterisk Makefile. Find the line for SOLINK directives under the Darwin architecture section. Append the text “-framework swift” to the line to make it read something like:


SOLINK=-dynamic -bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace -framework swift

Configure and build Asterisk as usual. This example was tested by building for the x86_64 architecture.

If desired, copy the swift.conf.sample into the asterisk config directory. Don’t forget to rename it to “swift.conf”

There is a bug in Asterisk 1.6.2 where ast_frfree incorrectly tries to free a null pointer, causing app_swift to crash the process if a hangup occurs during playback. If this is the case, change line 432 of app_swift.c from


ast_frfree(f);

to:


if( f ) ast_frfree(f);


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.
Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.