Archive

Posts Tagged ‘asterisk’

asterisk 1.2 with realtime ldap driver

December 28, 2008 13 comments

I have created an auto install script based on http://www.cahilig.org/install-asterisk-12-auto-install-script-centos-4-and-centos-5 to install Asterisk 1.2 with ldap realtime driver support (modified original script to enable realtime ldap support).

This script should work almost with any(Redhat, Centos, Mandrake, Debian, Slackware) Linux distro

Before running this script you must install following packages.

For Centos, Redhat:

yum install openldap-devel gcc kernel-devel bison openssl-devel libtermcap-devel ncurses-devel

For Debian, Ubuntu:

apt-get install libldap2-dev build-essential linux-headers-`uname -r` libncurses5-dev libssl-dev

You can download the script from here, simply run the script to start installation process.

download Asterisk schema for OpenLdap here

Installer and installation process is not tested, if you find any problem please let me know.

#!/bin/sh
#Asterisk Download page
ZAPTEL="http://downloads.digium.com/pub/zaptel/releases/zaptel-1.2.9.tar.gz"
ASTERISK="http://downloads.digium.com/pub/asterisk/releases/asterisk-1.2.30.tar.gz"
ASTERISKADDONS="http://downloads.digium.com/pub/asterisk/releases/asterisk-addons-1.2.9.tar.gz"
RTLDAP="http://free.oxymium.net/Asterisk/res_config_ldap.tgz"
RTLDAPPATCH="http://mustafa.pk.googlepages.com/res_config_ldap.c.patch"
CONFIGPATCH="http://mustafa.pk.googlepages.com/config.c.patch"
MAKEFILEPATCH="http://mustafa.pk.googlepages.com/resmkfile.patch"
#Asterisk Package
ZAPPACKAGE="zaptel-1.2.9.tar.gz"
ASTPACKAGE="asterisk-1.2.30.tar.gz"
ASTADDONSPACKAGE="asterisk-addons-1.2.9.tar.gz"
#Asterisk Folder
ZAPFOLDER="zaptel-1.2.9"
ASTFOLDER="asterisk-1.2.30"
ASTADDONSFOLDER="asterisk-addons-1.2.9"
REALTIMEDIRVER="res_config_ldap.tgz"
if [ -f /etc/redhat-release ] ; then
DISTRO="redhat"
elif [ -f /etc/debian_version ] ; then
DISTRO="debian"
elif [ -f /etc/SUSE-release ] ; then
DISTRO="redhat"
elif [ -f /etc/mandrake-release ] ; then
DISTRO="mandrake"
elif [ -f /etc/slackware-release ] ; then
DISTRO="slackware"
elif [ -f /etc/gentoo-release ] ; then
DISTRO="gentoo"
fi

echo "Downloading and extracting zaptel and asterisk source"
cd /usr/local/src/
if [ ! -e $ZAPPACKAGE ]; then
  wget $ZAPTEL
fi
if [ ! -e $ASTPACKAGE ]; then
  wget $ASTERISK
fi
if [ ! -e $ASTADDONSPACKAGE ]; then
  wget $ASTERISKADDONS
fi
tar -zvxf $ZAPPACKAGE
tar -zvxf $ASTPACKAGE
tar -zvxf $ASTADDONSPACKAGE 

echo "Installing zaptel"
cd $ZAPFOLDER
make clean
make
make install
cd ..

echo "Installing asterisk"
cd $ASTFOLDER
echo "Downloading patches"
wget $CONFIGPATCH
wget $MAKEFILEPATCH
patch -p0<resmkfile.patch
patch -p0<config.c.patch
echo "Downloading Realtime Ldap driver"
cd res
wget $RTLDAP
tar -zxvf $REALTIMEDIRVER
wget $RTLDAPPATCH
patch -p0<res_config_ldap.c.patch
cd ../configs
wget http://mustafa.pk.googlepages.com/extconfig.conf.sample
wget http://mustafa.pk.googlepages.com/res_ldap.conf.sample
cd ..
make clean
make
make install
make samples
cp contrib/init.d/rc.$DISTRO.asterisk /etc/init.d/asterisk
cd ..

echo "Installing asterisk-addons"
cd $ASTADDONSFOLDER
make clean
make
make install

echo "Loading ztdummy driver"
modprobe zaptel
modprobe ztdummy

echo "adding rules to /etc/rc.local"

echo "modprobe zaptel
modprobe ztdummy
" >> /etc/rc.local

echo "Downloading open source g729 codec"
cd /usr/lib/asterisk/modules/
wget http://asterisk.hosting.lv/bin12/codec_g729-ast12-gcc4-glibc-pentium4.so

echo "Running Asterisk"
/etc/init.d/asterisk start

echo "***********************************************************************"
echo "*             INSTALLATION SUCCESSFUL                                 *"
echo "***********************************************************************"
echo "* You can test if Asterisk installed successfully using               *"
echo "* asterisk -ncrvvv and start configuring your dial plan               *"
echo "***********************************************************************"
exit

freeswitch knocks asterisk’s block off

December 4, 2008 10 comments

Freeswitch is gaining popularity among asterisk community these days and looks quite promising, we also migrated our office PBX from asterisk to freeswitch few months back and never faced any issue till now. freeswitch is built from the scratch to address scalability and deadlocks issue within channels,  it’s modular architecture makes it developer friendly.

Freeswitch‘s SIP stack is much better than Asterisk’s sip implementation, Freeswitch uses Sofia sip stack which is 100% RFC compliant(IETF RFC3261 specification). Other than SIP freeswitch supports IAX2, Jingle and Woomera.

Another great thing about freeswitch is that it keeps all its configuration (users/dialplan etc, etc) in XML files. Another more interesting this is unlike asterisk’s dial patterns (e.g. _NXX) freeswitch uses PCRE regular expressions.

Freeswitch comes with an enterprise grade eventing engine, features software based conferences (no hardware timing source required), detailed cdr in XML(btw, i really loved the way freeswitch formats call flow in CDR, specially transfer calls).

Here is a list of Features and possible freeswitch uses:

Possible Uses

  • Rating & Routing Server
  • Transcoding B2BUA
  • IVR & Announcement Server
  • Conference Server
  • Voicemail Server
  • SBC (Session Border Controller)
  • Basic Topology Hiding Session Border Controller
  • Zaptel, Sangoma, Rhino, PIKA Hardware Support (Analog and PRI)

Features

  • Centralized User/Domain Directory (directory.xml)
  • Nano Second CDR granularity
  • Call recording (In Stereo caller/callee left/right)
  • High Performance Multi-Threaded Core engine
  • Configuration via CURL to your http server (xml_curl).
  • XML Config files for easy parsing.
  • Protocol Agnostic
  • Configurable RFC2833 Payload type
  • Inband DTMF generation and detection.
  • Software based Conference (no hardware requirement)
  • Wideband Conferencing
  • Media / No Media modes
  • Proper ENUM/ISN dialing built in
  • Detailed CDR in XML
  • Radius CDR
  • Subscription server
    • Shared Line Appearances
    • Bridged Line Appearances
  • Enterprise/Carrier grade Eventing Engine. (XML Events, Name Value Events, Multicast Events)
  • Loadable File formats and streaming
  • Stream to Shoutcast
  • Multi-lingual Speech Phrase Interface
  • ASR/TTS support (native and via MRCP)
  • Basic IP/PBX features
  • Automated Attendant
  • Custom Ring Back Tones
  • XML RPC support
  • Multiple format CDR’s supported
  • SQL Engine provides session persistence
  • Thread Isolation
  • Parallel Hunting
  • Serial Hunting
  • Mozilla Public License
  • Support
    • Paid support available
    • Free support via IRC & e-mail
  • Many supported codecs
    • G.722 (wideband)
    • G.711
    • G.726 (16k,24k,32k,48k) AAL2 and RFC3551
    • G.723.1 (passthru)
    • G.729 (passthru)
    • AMR (passthru)
    • iLBC
    • speex (narrow and wideband)
    • lpc10
    • DVI4 (ADPCM) 8khz and 16khz

asterisk realtime with ldap — got it working :)

November 28, 2008 4 comments

When we decided to write an asterisk module for Zivios, we went in several debates either we should keep asterisk’s configurations in plain config files or get benefit of asterisk realtime ldap driver.

if you don’t know much about Zivios’s architecture, check out Zivios Architecture page. In short Zivios keeps all of its configurations(Users/Groups/Config files) in OpenLdap as far as there is a possibility to use Ldap as config back-end.

Finally we decided to test asterisk realtime ldap driver, in first attempt everything worked fine, I was able to retrieve sip/iax peers from ldap tree,store registry updates in ldap, also created few dialplan extensions in ldap and it worked as expected. then all the hell broke loose when i added a pattern (say _5XX) in ldap and asterisk couldn’t find it in ldap, I tried to debug the realtime ldap driver, but nothing helped. lastly I decided to look into the realtime ldap driver’s C code(my C knowledge is worst), put several debug messages all over the file, recompiled and came out with the conclusion that there is something wrong with a function called *realtime_multi_ldap, posted bug report to digium with my logs (Faraz Khan posted a bounty as well, check it out), but all in vain, it felt like digium and nobody else doesn’t give a damn about realtime ldap driver, i decided to forget the realtime thing and keep configuration in plain text file, wrote some handy(helper) perl scripts to add/edit and delete configurations(users/routes/queues/ivrs). Zivios’s web interface communicates with these scripts using a special XML-RPC agent (called emsmagent) running on asterisk box. emsmagent executes these perl scripts and returns output to Zivios.

Last month browsing through digium’s bug tracker I found this *realtime_multi_ldap patch, I decided to give it a try, was not expecting it would work, but interestingly it worked and now I can use patterns in ldap exten entry and it really works :).

I have written a custom ldap schema for realtime ldap, You can also check original schema posted and contributed by suretec (guy who fixed the ldap driver) here. I will soon post a how-to on “setting up asterisk realtime ldap”. I am also going to port Zivios Asterisk module from plain text files to openldap backend soon (much busy in some other interesting projects these days :D)

let me know if you need any help in asterisk and realtime ldap driver setup.

KESC deploys asterisk across hundreds of sites

November 25, 2008 4 comments

KESC — Karachi Electric Power Supply Company (Company Engaged in Generation, Transmission and Supply of Electric energy to Karachi  deploys asterisk across hundreds of sites. KESC has selected Emergen‘s Asterisk‘s Business Edition Solution for their telephony infrastructure and will be supporting  around 1500 phones.

About Emergen (quoting from their website):

Emergen Consulting is Pakistan’s premier Open Source Solutions provider. Established in December 2004 we have provided front and back end IT solutions to several major corporations. Our solutions provide the most Reliable, Secure, Scalable and cost effective alternatives to the expensive proprietary, license based enterprise wide IT solutions.

previously Emergen has successfully deployed asterisk at NADRA

Links:

Voiceone – a better GUI for asterisk

November 24, 2008 1 comment
Voiceone

Voiceone

If you are bored of using freepbx or trixbox interface, try out this source forge based opensource webbased asterisk management interface, i just gave it a try and it looks promising. interface is much cooler than freePBX, you can create outbound and inbound rulesets,seems much like firewall rules 😉

They have an online demo as well, so you can try out the application and its functions.

Current version is 0.7.1. Voiceone requires Asterisk with mysql support and Php5+Apache. Following is a list of features from their website.

  • Client/Server architecture based on web services
  • Relies on Asterisk Realtime Architecture (ARA) for database storage
  • Two different panels, Personal for users and Configurator for administrators
  • Extensions management
  • Fully customizable users profile, including Voicemail, Call Forwarding (“Follow Me“) and Do Not Disturb
  • Highly configurable rulesets for outbound and inbound calls
  • Static LCR (Least Cost Routing)
  • Supports VoIP providers (SIP and IAX) and traditional Telco carriers
  • Links remote offices via IAX with RSA public key encryption
  • Powerful IVR creation system
  • Queues management
  • Conference rooms handling
  • Sounds and Music On Hold management
  • Applications and macros editor
  • System Macros and Functions preloaded (DID/DDI, Call Back and DISA included)
  • Plugins system to share ready-to-use macros and application with the VoiceOne community
  • Powerful configuration of mISDN and Zap drivers based hardware
  • Java SIP phone embedded
  • I/O interface and PBX CLI (Command Line Interface)
  • Static-like text editor for conf files
Categories: asterisk Tags: , , , ,