Wednesday, April 1, 2009

Compiling Asterisk 1.4.x with H323 channel driver




This is just a step by step procedure I followed to compile Asterisk 1.4 version with H323 channel driver

apt-get install flex bison

  • Here we download and compile Asterisk
Compile zaptel driver

cd /usr/src
wget http://downloads.digium.com/pub/zaptel/releases/zaptel-1.4.10.1.tar.gz
cd zaptel-1.4.10
./install_prereq test
./configure
make
make install


Compile libpri

cd /usr/src
wget http://downloads.digium.com/pub/libpri/releases/libpri-1.4.4.tar.gz
cd libpri-1.4.4
make
make install


Compile Asterisk

cd /usr/src
wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.20.tar.gz
cd asterisk-1.4.20
./configure
make menuselect
make
make install
make samples


  • Compiling pwlib and openH323 for H323 channel driver
NOTE: openH323 v1.19.0.1 with corresponding pwlib v1.11.0. not pwlib_v1.11.1.

This is required since openh323 will look for compiler.h
touch /usr/include/linux/compiler.h

Compile pwlib

cd /usr/src
wget http://downloads.sourceforge.net/openh323/pwlib-v1_11_0-src-tar.gz?use_mirror=nchc
tar zxvf pwlib-v1_11_0-src-tar.gz
cd pwlib_v1_9_0
./configure
make
make install
make opt
export PWLIBDIR=/usr/src/
pwlib-v1_11_0

Compile openh323

cd /usr/src
wget http://downloads.sourceforge.net/openh323/openh323-v1_19_0_1-src-tar.gz?use_mirror=jaist
tar zxvf openh323-v1_19_0_1-src-tar.gz
cd openh323-v1_19_0_1
./configure
make
make install
make opt
export OPENH323DIR=/usr/src/openh323-v1_19_0_1


OpenH323 generates its libs in /usr/local/lib but my Linux uses /usr/lib for shared libraries, we'll need to copy the genberated libraries from /usr/local/lib to /usr/lib.

cp /usr/local/lib/* /usr/lib
Compile Asterisk

cd /usr/src/asterisk-1.4.20
./configure
make menuselect ## check if h323 is enabled under channels
cd channels/h323
make
make opt
cd ..
cd ..
make install



Now we make sure the channel driver exists and is loadable:

ldd /usr/lib/asterisk/modules/chan_h323.so

start asterisk

/etc/init.d/asterisk start


Thursday, October 2, 2008

Install PHP 5 on Windows Xp for IIS 5.1

Step by step guide to install IIS and PHP 5 on windows XP:

  1. First install IIS server:
      • Go to your control panel > add remove programs. Click on "Add/Remove Windows Components".
      • Make sure windows CD is inserted
      • Place a Select check for "Internet Information Services (IIS)”
      • Continue with the installation completely.
  1. Check whether IIS is installed properly by browsing the default iis site (http://localhost).
  1. Now you must get the correct files for php5. Head over to http://www.php.net/downloads.php and download the zip package under "Windows Binaries" Do not get the installer! In addition, while you are here you will need to get the "Collection of PECL modules" also under Windows Binaries
  2. Once Downloaded extract the first file you downloaded and place the files in "C:\php". Extract the PECL modules to "C:\php\ext".
  3. Rename C:\php\php.ini-recommended to C:\php\php.ini and then COPY it to C:\Windows
  4. Open both the php.ini file you have now and uncomment cgi.force_redirect in php.ini and set it to 0
  5. Change session.save_path as "session.save_path=C:\php\sessions" and make the directory C:\php\sessions
  6. Set the line "extension_dir" as "extension_dir = "C:\php\ext".
  7. Uncomment all of the following items.
    extension=php_mssql.dll
    extension=php_msql.dll
    extension=php_mysql.dll
    extension=php_mysqli.dll
    extension=php_java.dll
    extension=php_ldap.dll
    extension=php_iisfunc.dll
    extension=php_imap.dll
    extension=php_filepro.dll
    extension=php_gd2.dll
    extension=php_gettext.dll
    extension=php_dba.dll
    extension=php_dbase.dll
    extension=php_dbx.dll
    extension=php_mbstring.dll
    extension=php_pdf.dll
    extension=php_pgsql.dll
    extension=php_sockets.dll
    extension=php_xmlrpc.dll
    extension=php_xsl.dll
    extension=php_zip.dll
  8. Now copy all of those DLL files in C:\php\ext to C:\windows\system32 or add "C:\PHP;" to your Windows path:
      • Right Click on My Computer and choose properties > Advanced Tab > Click "Environment Variables".
      • Now add "C:\PHP;" to the very beginning.
      • Now go to start > run > type: regedit and click ok
      • Add HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath = C:\php to the registry. If you change your windows path instead of copying the dll files then you will need to restart your computer before php will work. Updating php is easier when you add it to your Windows path. So bookmark this page and go restart. Now is the best time since we are done with file placement.
  1. You might have to restart your system at this point
  2. Ok, you are back. Now it is time to let IIS know that you have php and you are going to tell IIS how to use it and when
  3. Open Internet Services Manager in your Administrative Tools in the start menu
  4. Right Click on Web Sites and click Properties, go to ISAPI filter tab choose Add, Filter Properties window pops up. Enter

    Filter Name: php

    Executables: Browse to C:\php\php5isapi.dll

  1. Right Click on websites and choose properties. Go to the Documents tab and add index.php as a start document.
  2. Go to C:\Inetpub\wwwroot and delete everything in there except for aspnet_client. Now make a new text file and name it phpinfo.php. Open it up with your text editor ant put this in it: .
  3. Open a web Browser and go to http://127.0.0.1/phpinfo.php
  4. Enjoy php on Windows XP and IIS

Wednesday, January 9, 2008

Interactive Voice Response (IVR)

Interactive Voice Response (IVR).

Interactive Voice Response (IVR) is the technology that let you interact with a menu using a touch-tone telephone. In our day to day life we have already come across IVR in many ways, a best example is when you call banks

It is very easy to set-up such a menu with Asterisk.

The following is just an example for an IVR system where you call the number 9877777777 and you enter the IVR system. First you will get the greeting message ("welcome to dash dash Bank, please press 1 for Account related Enquiry, 2 for Credit card Enquiry or press 9 to talk to pur representative") and during this message you can press key 1, 2 or 9. According to the number pressed, you will be directed to the right extension

In extensions.conf place this snippet

exten => 9877777777,1,Answer
exten => 9877777777,2,SetMusicOnHold(default)
exten => 9877777777,3,DigitTimeout,5
exten => 9877777777,4,ResponseTimeout,10
exten => 9877777777,5,Background(greeting)

;; greeting -- "welcome to dash dash Bank, please press 1 for Account related Enquiry, 2 for ;;Credit card Enquiry or press 9 to talk to pur representative

exten => 1,1,Playback(ivr1) ; takes to another Account related IVR

exten => 2,1,Playback(ivr2) ; takes to another Credit card related IVR

exten => 9,1,Playback(representative)
exten => 9,2,Dial(SIP/bankrep)
;; representative -- Please wai while the call is transfered to our representative

Saturday, December 29, 2007

Christmas Lights

My christmas fun in Janakpuri church Delhi.....

Monday, December 17, 2007

Vim Commands Cheat Sheet

Cursor movement

  • h - move left
  • j - move down
  • k - move up
  • l - move right
  • w - jump by start of words (punctuation considered words)
  • W - jump by words (spaces separate words)
  • e - jump to end of words (punctuation considered words)
  • E - jump to end of words (no punctuation)
  • b - jump backward by words (punctuation considered words)
  • B - jump backward by words (no punctuation)
  • 0 - (zero) start of line
  • ^ - first non-blank character of line
  • $ - end of line
  • G - Go To command (prefix with number - 5G goes to line 5)

Note: Prefix a cursor movement command with a number to repeat it. For example, 4j moves down 4 lines.

Insert Mode - Inserting/Appending text

  • i - start insert mode at cursor
  • I - insert at the beginning of the line
  • a - append after the cursor
  • A - append at the end of the line
  • o - open (append) blank line below current line (no need to press return)
  • O - open blank line above current line
  • ea - append at end of word
  • Esc - exit insert mode

Editing

  • r - replace a single character (does not use insert mode)
  • J - join line below to the current one
  • cc - change (replace) an entire line
  • cw - change (replace) to the end of word
  • c$ - change (replace) to the end of line
  • s - delete character at cursor and subsitute text
  • S - delete line at cursor and substitute text (same as cc)
  • xp - transpose two letters (delete and paste, technically)
  • u - undo
  • . - repeat last command

Marking text (visual mode)

  • v - start visual mode, mark lines, then do command (such as y-yank)
  • V - start Linewise visual mode
  • o - move to other end of marked area
  • Ctrl+v - start visual block mode
  • O - move to Other corner of block
  • aw - mark a word
  • ab - a () block (with braces)
  • aB - a {} block (with brackets)
  • ib - inner () block
  • iB - inner {} block
  • Esc - exit visual mode

Visual commands

  • > - shift right
  • < - shift left
  • y - yank (copy) marked text
  • d - delete marked text
  • ~ - switch case

Cut and Paste

  • yy - yank (copy) a line
  • 2yy - yank 2 lines
  • yw - yank word
  • y$ - yank to end of line
  • p - put (paste) the clipboard after cursor
  • P - put (paste) before cursor
  • dd - delete (cut) a line
  • dw - delete (cut) the current word
  • x - delete (cut) current character

Exiting

  • :w - write (save) the file, but don't exit
  • :wq - write (save) and quit
  • :q - quit (fails if anything has changed)
  • :q! - quit and throw away changes

Search/Replace

  • /pattern - search for pattern
  • ?pattern - search backward for pattern
  • n - repeat search in same direction
  • N - repeat search in opposite direction
  • :%s/old/new /g - replace all old with new throughout file
  • :%s/old/new/gc - replace all old with new throughout file with confirmations

Working with multiple files

  • :e filename - Edit a file in a new buffer
  • :bnext (or :bn) - go to next buffer
  • :bprev (of :bp) - go to previous buffer
  • :bd - delete a buffer (close a file)
  • :sp filename - Open a file in a new buffer and split window
  • ctrl+ws - Split windows
  • ctrl+ww - switch between windows
  • ctrl+wq - Quit a window
  • ctrl+wv - Split windows vertically

Appending Character to start of multiple lines

  • ctrl+v;shift+i;;ESC

Saturday, December 8, 2007

Lyrics of Pray for me brother

Lyrics of Pray for me brother

Pray for me brother
Pray for me brother
Pray for me sister
Are you searchin’….
Pray for me brother

Lookin’ for the answers To all the questions In my life
Will I be alone Will you be there By my side
Is it something he said Is it something he did
I wonder why He is searchin’ For the answers
To stay alive

Could you ever listen Could you ever care
To speak your mind
Only for a minute For only one moment
In time

The joy is around us But show me the love
That we must find
Are you searchin’ For a reason to be kind, to be kind…
He said… Pray for me brother



Pray for me brother Pray for me sister
Pray for me brother Say
what you wanna say now
But keep your hearts open
Be what you wanna be now
Let’s heal the confusion
Pray for me brother

Don’t let me take When you don’t wanna give
Don’t be afraid Just let me live
Don’t let me take When you don’t wanna give
Don’t be afraid Say what you wanna say now
But keep your hearts open

Be what you wanna be now Let’s heal the confusion
Pray for me brother Pray for me brother
I’m ashamed ah, brother be dying of poverty
when he down on his knees its only then he prays
And it’s a shame ah, brother be dying of ignorance
cos the world is a trip and everybody’s a hypocrite
Need to stop ah , taking a look at the other
I’m not ashamed of poverty
need to be making his life better
So think about it, think about it once more
cos life is a blessing and it’s not justa show, ah
Round and round the world is spinning around

We need to be singing a prayer, we need to be singing it now
Round and round the world is turning around
We need to be singing a prayer, we need to be singing it now
Need to be feeling the power, need to be feeling the faith
We need to coming together just to win this race

Need to be feeling the power, need to be feeling the faith
We need to coming together just to win this race (twice)
Are you searching for a reason to be kind ?

Saturday, December 1, 2007

How VoIP Works?

If you've never heard of VoIP, get ready to change the way you think about long-distance phone calls. VoIP, or Voice over Internet Protocol, is a method for taking analog audio signals, like the kind you hear when you talk on the phone, and turning them into digital data that can be transmitted over the Internet.



How is this useful? VoIP can turn a standard Internet connection into a way to place free phone calls. The practical upshot of this is that by using some of the free VoIP software that is available to make Internet phone calls, you are bypassing the phone company (and its charges) entirely.

VoIP is a revolutionary technology that has the potential to completely rework the world's phone systems. VoIP providers like Vonage have already been around for a little while and are growing steadily. Major carriers like AT&T are already setting up VoIP calling plans in several markets around the United States, and the FCC is looking seriously at the potential ramifications of VoIP service.

Above all else, VoIP is basically a clever "reinvention of the wheel." In this article, we'll explore the principles behind VoIP, its applications and the potential of this emerging technology, which will more than likely one day replace the traditional phone system entirely.

The interesting thing about VoIP is that there is not just one way to place a call. There are three different "flavors" of VoIP service in common use today:

* ATA - The simplest and most common way is through the use of a device called an ATA (analog telephone adaptor). The ATA allows you to connect a standard phone to your computer or your Internet connection for use with VoIP. The ATA is an analog-to-digital converter. It takes the analog signal from your traditional phone and converts it into digital data for transmission over the Internet. Providers like Vonage and AT&T CallVantage are bundling ATAs free with their service. You simply crack the ATA out of the box, plug the cable from your phone that would normally go in the wall socket into the ATA, and you're ready to make VoIP calls. Some ATAs may ship with additional software that is loaded onto the host computer to configure it; but in any case, it is a very straightforward setup.

* IP Phones - These specialized phones look just like normal phones with a handset, cradle and buttons. But instead of having the standard RJ-11 phone connectors, IP phones have an RJ-45 Ethernet connector. IP phones connect directly to your router and have all the hardware and software necessary right onboard to handle the IP call. Wi-Fi phones allow subscribing callers to make VoIP calls from any Wi-Fi hot spot.

* Computer-to-computer - This is certainly the easiest way to use VoIP. You don't even have to pay for long-distance calls. There are several companies offering free or very low-cost software that you can use for this type of VoIP. All you need is the software, a microphone, speakers, a sound card and an Internet connection, preferably a fast one like you would get through a cable or DSL modem. Except for your normal monthly ISP fee, there is usually no charge for computer-to-computer calls, no matter the distance.

If you're interested in trying VoIP, then you should check out some of the free VoIP software available on the Internet. You should be able to download and set it up in about three to five minutes. Get a friend to download the software, too, and you can start tinkering with VoIP to get a feel for how it works.