Monday, October 19, 2009

Installing .TTF Fonts in Slackware 12.2

I was recently working on a project for my boss when I found I needed to install some new fonts for GIMP.

I had downloaded some free TTF's from & needed to install them.

Restarting X was a pain, so I found the following steps worked with only restarting GIMP:

1.)  Move your fonts into the ~/.fonts folder.  Create it if it doesn't exist.
2.)  Run command makefontdir
3.)  Run command makefontscale
4.)  Run command fc-cache
5.)  Finally, command xset fp rehash
6.)  Restart whatever application you're working with, be it GIMP, OOo, or whatever.

Your font should now be listed!

Thursday, October 1, 2009

Installing (Free) G729 Codec on Trixbox CE

The G.729 codec is a low-bandwidth codec, excellent for use in VoIP.

In this case, a client which my company manages wanted to minimize bandwidth usage from VoIP phones traveling through a VPN. Both the G729 & G723 codec are freely available from here, though you can alawys purchase a copy from Digium.

First download the G729 codec appropriate for your processor & system type. A great way to find this information is to run a cat /proc/cpuinfo and a uname -m command. Search down through the list (ensure you download G729, not G723!) for your appropriate binary. In my case, we were running on a P4 with no ss3, so I stuck with the standard binary.

Now, I'm not sure if this is necessary, but I moved the /usr/lib/asterisk/modules/ file out of the /usr/lib/asterisk/modules folder, over to /home/root. I did this to ensure we were starting fresh.

Next, copy the downloaded codec over to that same /usr/asterisk/modules folder. Connect into asterisk console with the command asterisk -r, and load the new codec with module load, or whatever your codec was.

You would think the phone system would be ready for G729 use, but in my case, I needed to restart asterisk with the command restart gracefully. Ensure everyone is out of the office, as this will drop all live calls!

When asterisk comes back up, log back into asterisk and run the command show translation which should give you some output such as the following:

As long as there’s a # (in this case, 6’s) and not a – under the g729 codec, we know it’s working properly.

The next step would be to head into the web interface, under PBX->PBX Settings->Extensions, choose the extension you wish to enable the codec for, ensure disallow is set to “all” and allow is set to “g729”.

Once the extension is set up to allow g729, you can test whether it’s working properly by having a test call connected and running the command sip show channels:

trixbox1*CLI> sip show channels

Peer User/ANR Call ID Seq (Tx/Rx) Format Hold Last Message 4004 2e1225e1-27 00101/00002 0x100 (g729) No Rx: ACK