##Google Analz## ##Microsoft## ##Googel## Swanand: November 2023

Tuesday 7 November 2023

Bash Script to install G.729 and G.723.1 codecs for asterisk 16

The following bash script can be used to install the G.729 and G.723.1 codecs on an Asterisk 16.30.0-vici system:

==========================================

#!/bin/bash


# Check if the user has root privileges

if [ "$EUID" -ne 0 ]; then

  echo "Please run this script as root or with sudo."

  exit 1

fi


# Ensure the system is up to date

yum update -y


# Install required packages

yum install -y epel-release

yum install -y libsrtp


# Download the G.729 codec source code

cd /usr/src

wget http://www.linphone.org/snapshots/g729/g729-1.0.4.tgz

tar -xvzf g729-1.0.4.tgz


# Compile and install the G.729 codec

cd g729-1.0.4

./configure

make

make install


# Verify the codec is installed

ls /usr/lib/asterisk/modules/codec_g729.so


# Add G.729 codec support to Vicidial's sip.conf

echo "[general]" >> /etc/asterisk/sip.conf

echo "allow=g729" >> /etc/asterisk/sip.conf


# Reload Asterisk to apply the changes

asterisk -rx "module reload codec_g729.so"

asterisk -rx "sip reload"


# Clean up the installation files

cd /usr/src

rm -rf g729-1.0.4*


echo "G.729 codec installation completed."

================================
END OF SCRIPT
This script will first download the G.729 and G.723.1 codecs from the Asterisk website. Then, it will extract and install the codecs. Finally, it will reload Asterisk to make the changes take effect.

Here is a breakdown of the script:

  1. The wget command is used to download the G.729 and G.723.1 codecs from the Asterisk website.
  2. The tar command is used to extract the G.729 and G.723.1 codecs.
  3. The make command is used to compile the G.729 and G.723.1 codecs.
  4. The make install command is used to install the G.729 and G.723.1 codecs.
  5. The asterisk -rx "dialplan reload" command is used to reload Asterisk to make the changes take effect.

Featured post

Vicidial With WebRTC

Vicidial With WebRTC VICIDial is well known open source call center software. It has been in use by many small to large scaled con...