Latest Entries »

When reading/writing a disk image using Linux tool ‘dd’ launch as follows:
dd if=/dev/sdb of=filename.img & pid=$!
this will run ‘dd’ in the background.

To see the progress:
kill -USR1 $pid

Notes:

  1. If you are doing it as a non-root user you’ll need to prefix those commands with sudo
  2. If you do that do ’sudo ls’ first, otherwise the ’sudo dd’ will fail waiting on the password which it’ll never get as its backgrounded.

Thanks to Cian.

Shutdown and remove the hard disk, then connect to a separate PC with VirtualBox (virtualbox-ose) installed.

  • Take a ‘dd’ copy of the hard disk, eg: dd if=/dev/sdb of=filename.img
    (warning this may take a while and requires enough free disk space to hold a copy of the entire hard disk being cloned)
  • After the image has been successfully created, convert it to an image suitable for VMWare or VirtualBox using the command:
    vboxmanage convertfromraw filename.img -format VMDK filename.vmdk
  • This can be imported into VirtualBox by creating a new (Linux/Other Linux) Virtual Machine and “Use existing hard drive”. Click the browse button to go to the Virtual Media Manager, click ‘Add’ and select the VMDK file created in the previous step.

The virtual machine should now be ready to run in VirtualBox.
To import into VMWare, create a new virtual machine and virtual hard disk. Overwrite the new Virtual Hard disk by copying the VMDK file created earlier, into its place.

Clifford Chambers the village where I grew up, now has a site cataloging pictures from the past century.

Thanks to Rory McCann for pointing this one out.

It is possible to convert (resize, rotate etc) an image without creating a new file. mogrify takes the same options as convert but operates on the existing image. Both are tools included in imagemagick.

A warning to all: audio does not work full-duplex when calling from a VPoint (VCON Emblaze) H323 client -> GNUGK -> Asterisk-oh323 -> SIP client. Tested with versions 8 and 10.

However audio works perfectly in the other direction.

The solution would appear to be to use OOH323. However the audio is again half duplex in the scenario where SIP clients are calling H323 clients.
Therefore calls originating from Asterisk to H323 clients use the ‘OH323′ module, and calls from GNUGK into Asterisk use the ‘OOH323′ module.

On my previous laptop I suffered with repeated over-heating problems whenever CPU load went high for a prolonged period. After several emergency shutdowns (performed by ACPI) I discovered the problem:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

returned the result: “performance”

Inserting the following line before the ‘exit’ line in /etc/rc.local:

echo "conservative" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

resolved the problem.

For all available scaling governors:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

With some bash scripts it can be useful to have them exit as soon as a command fails. To accomplish this have the following just after the “#!/bin/bash” line:

set -o errexit

This will cause the script to exit as soon as any command or program returns an exit status not equal to zero.
Thanks to Rory.

Skype, Linux and NFS

A problem I found when using the Linux client for Skype is that it will try to perform file locking, which is a problem if your home partition is an NFS drive.

To overcome this limitation, create a directory on the local hard disk:

  1. sudo mkdir /usr/local/skype
  2. sudo chown tom.tom /usr/local/skype

Delete the configuration that Skype attempted to install, and symlink to the directory on the local harddisk:

  1. rm -rf /home/tom/.Skype
  2. ln -s /usr/local/skype /home/tom/.Skype

After this Skype worked as normal.

The completed system must support SIP clients connected to Asterisk, and H323 clients that connect to GNUGK (GNU Gatekeeper). Calls between H323 and SIP clients must be supported, in both directions.

This guide is mainly for building the Asterisk and associated RPMs. Rolling out these packages to other servers is a fairly simple task.

GNUGK is used for H323 as Asterisk 1.4.* does not support video codecs. The ‘oh323′ module is used in Asterisk, to interface with GNUGK. The ‘ooh323′ connected but the connection was unreliable and the sound quality poor, so this wasn’t used.

Additional packages required for building:

yum -y install gcc gcc-c++ kernel-devel bison openssl-devel \
libtermcap-devel ncurses-devel doxygen curl-devel newt-devel \
mlocate lynx tar wget nmap bzip2 mod_ssl crontabs vixie-cron \
speex speex-devel unixODBC unixODBC-devel libtool-ltdl \
libtool-ltdl-devel make readline-devel mysql-connector-odbc mysql mysql-devel \
mysql-server php-mysql pwlib pwlib-devel openldap-devel SDL SDL-devel \
sqlite sqlite-devel flex bison libtiff-devel bridge-utils rpm-build speex speex-devel

Before building Asterisk, the following packages must be built:

Build process:

  1. ./configure --prefix=/usr --sysconfdir=/etc --with-postgres=no
  2. make menuselect
  3. make
  4. make
  5. make install
  6. checkinstall

The ‘make’ command may have to be repeated if it is a clean build.

Optional post-compile steps:

  1. make samples
  2. make progdocs
  3. make config
  4. Asterisk-addons (version 1.4.10) may be installed, and provides the ‘h323′ module which I do not use.

Asterisk-oh323 should be compiled and installed.

Asterisk 1.4.30 is now built.

The following packages should be installed on target servers before installing the packaged RPMs:

  • SDL
  • esound
  • audiofile
  • speex
  • speex-devel

The following RPMs which have been constructed during this process, should be installed in the following order:

  1. pwlib_v1_10_2-1.10.2-1.i386.rpm
  2. openh323_v1_18_0-1.18.rpm
  3. gnugk-2.3.1-1.i386.rpm
  4. asterisk-1.4.30-1.i386.rpm
  5. asterisk-oh323-1.i386.rpm

My servers have suffered from poor Postgresql libraries and bad ooh323 experiences. The following two commands prevented my Asterisk daemon from repeatedly crashing:

  • rm /usr/lib/asterisk/modules/chan_ooh323.so
  • rm /usr/lib/asterisk/modules/res_config_pgsql.so

Configuration:
To configure and route H323 calls from GNUGK into Asterisk, edit the /etc/asterisk/oh323.conf file and set the ‘alias’ and the ‘gwprefix’ under the ‘register’ section. For example:

alias=asterisk
gwprefix=9

All calls from H323 clients starting with a ‘9′ will be routed into Asterisk. Asterisk can now process and forward these calls by adding the following line in /etc/asterisk/extensions.conf:

exten=>9X.,1,Dial(SIP/${EXTEN:1})

which will strip away the ‘9′.

For SIP calls to be routed out over H323, enter the following into /etc/asterisk/extensions.conf:

exten=>8X.,1,Dial(OH323/${EXTEN:1})

which will route all calls starting with an ‘8′ into the OH323 module, and strip off the leading digit.

The interface between Asterisk and GNUGK is the ‘oh323′ which is loaded into Asterisk.

The official version of Asterisk-oh323 does not compile against Asterisk version 1.4.30 due to type mismatches with Asterisk include files. I have modified Asterisk-oh323 to resolve this issue, my version is available here.

To compile, variables in the Makefile should be updated to reflect the local environment. The build procedure:

  1. make
  2. make install
  3. checkinstall

The library ‘chan_oh323′ should be configured to installed in the directory /usr/lib/asterisk/modules/

A sample configuration file is included called ‘oh323.conf.sample’. which should be copied to ‘/etc/asterisk/oh323.conf’

For the module to load, see file ‘/etc/asterisk/modules.conf’ and either “autoload=yes” should be set or the module must be specified separately.

Powered by WordPress. Theme: Motion by 85ideas.