jump to navigation

Freeswitch Step by step Howto February 3, 2011

Posted by hasnain110 in Uncategorized.

Step 1

edit vars.xml and it should look like this

  <!– Internal SIP Profile –>
  <X-PRE-PROCESS cmd="set" data="internal_auth_calls=true"/>
  <X-PRE-PROCESS cmd="set" data="internal_sip_port=5080"/>
  <X-PRE-PROCESS cmd="set" data="internal_tls_port=5081"/>
  <X-PRE-PROCESS cmd="set" data="internal_ssl_enable=false"/>
  <X-PRE-PROCESS cmd="set" data="internal_ssl_dir=$${base_dir}/conf/ssl"/>

  <!– External SIP Profile –>
  <X-PRE-PROCESS cmd="set" data="external_auth_calls=false"/>
  <X-PRE-PROCESS cmd="set" data="external_sip_port=5060"/>
  <X-PRE-PROCESS cmd="set" data="external_tls_port=5061"/>
  <X-PRE-PROCESS cmd="set" data="external_ssl_enable=false"/>
  <X-PRE-PROCESS cmd="set" data="external_ssl_dir=$${base_dir}/conf/ssl"/>


  <X-PRE-PROCESS cmd="set" data="global_codec_prefs=G729,G723,G711U"/>
  <X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=G729,G723,G711U"/>

Step 2:

All Termination GW will be added now under /usr/local/freeswitch/conf/sip_profiles/external

create gw.xml and it should look like this

        <gateway name="broadvoice1">
          <param name="username" value="4234685032 "/>
          <param name="realm" value="4234685032 "/>
          <param name="from-domain" value=""/>
          <param name="password" value="sipsip"/>
          <param name="extension" value="5555551234"/>
          <param name="proxy" value=""/> <!– example using the broadvoice DNS SRV record for New York City. –>
          <param name="expire-seconds" value="3600"/>
          <param name="register" value="false"/>
          <param name="retry-seconds" value="6"/>


Step 3:

Now create a Ingress GW

Goto/usr/local/freeswitch/conf/autoload_configs and edit acl.conf.xml

vi acl.conf.xml and add this in the bottom

<list name="asterisk_box" default="allow">
  <node type="allow" cidr=""/>

now we have to apply this ACL in /usr/local/freeswitch/conf/sip_profiles/internal.xml

vi internal.xml

add this line at the bottom

<param name="apply-inbound-acl" value="asterisk_box"/>

Step 4:

Now create a Dial plan

goto /usr/local/freeswitch/conf/dialplan

vi public.xml

<extension name="outbound_international">
<condition field="destination_number" expression="7243(\d+)$">
<!–<action application="set" data="absolute_codec_string=G729"/>–>
<action application="bridge" data="{absolute_codec_string=’G729′}sofia/gateway/broadvoice1/7243$1"/>

Step 5

Now start the freeswitch and make the calls


Asterisk Video Support January 23, 2011

Posted by hasnain110 in Uncategorized.
1 comment so far

In order to enable video in Asterisk, modify sip.conf to add:

Also better to add the video codecs in the extensions if the video call is from in from extension to extension

For example:

callerid=Video 2 <1222>
disallow=all ; Windows Messenger will choose wrong codecs if you allow=all

Enjoy the video call ! Open-mouthed smile

FACEBOOK WILL END ON MARCH 15th! January 9, 2011

Posted by hasnain110 in Uncategorized.
1 comment so far

HOAX of the Year 2011


PALO ALTO, CA –Mark Zuckerberg announced that Facebook will be shut down in March. Managing the site has become too stressful.

“Facebook has gotten out of control,” said Zuckerberg in a press conference outside his Palo Alto office, “and the stress of managing this company has ruined my life. I need to put an end to all the madness.”

Zuckerberg went on to explain that starting March 15th, users will no longer be able to access their Facebook accounts.

“After March 15th the whole website shuts down,” said Avrat Humarthi, Vice President of Technical Affairs at Facebook. “So if you ever want to see your pictures again, I recommend you take them off the internet. You won’t be able to get them back once Facebook goes out of business.”

Zuckerberg said that the decision to shut down Facebook was difficult, but that he does not think people will be upset.

“I personally don’t think it’s a big deal,” he said in a private phone interview. “And to be honest, I think it’s for the better. Without Facebook, people will have to go outside and make real friends. That’s always a good thing.”

Some Facebook users were furious upon hearing the shocking news.

“What am I going to do without Facebook?” said Denise Bradshaw, a high school student from Indiana. “My life revolves around it. I’m on Facebook at least 10 hours a day. Now what am I going to do with all that free time?”

However, parents across the country have been experiencing a long anticipated sense of relief.

“I’m glad the Facebook nightmare is over,” said Jon Guttari, a single parent from Detroit. “Now my teenager’s face won’t be glued to a computer screen all day. Maybe I can even have a conversation with her.”

Those in the financial circuit are criticizing Zuckerberg for walking away from a multibillion dollar franchise. Facebook is currently ranked as one of the wealthiest businesses in the world, with economists estimating its value at around 7.9 billion.

But Zuckerberg remains unruffled by these accusations. He says he will stand by his decision to give Facebook the axe.

“I don’t care about the money,” said Zuckerberg. “I just want my old life back.”

The Facebook Corporation suggests that users remove all of their personal information from the website before March 15th. After that date, all photos, notes, links, and videos will be permanently erased.

Take from HERE

What is Audio Mining .. ? January 6, 2011

Posted by hasnain110 in Uncategorized.

Audio mining approaches

There are two main approaches to audio mining.

Text-based indexing. Text-based indexing, also known as large-vocabulary continuous speech recognition (LVCSR), converts speech to text and then identifies words in a dictionary that can contain up to several hundred thousand entries. If a word or name is not in the dictionary, the LVCSR system will choose the most similar word it can find.

The system uses language understanding to create a confidence level for its findings. For findings with less than a 100 percent confidence level, the system offers other possible word matches, said Professor Dan Ellis, who leads Columbia University’s Laboratory for Recognition and Organization of Speech and Audio (http://labrosa.ee.columbia.edu).

Thus, an LVCSR system can enhance its accuracy level by storing words that sound much like other words, although this approach also generates some wrong results.

Phoneme-based indexing. Phoneme-based indexing doesn’t convert speech to text but instead works only with sounds.

The system first analyzes and identifies sounds in a piece of audio content to create a phonetic-based index. It then uses a dictionary of several dozen phonemes to convert a user’s search term to the correct phoneme string. (Phonemes are the smallest unit of speech that distinguishes one utterance from another. For example, “ai”, “eigh”, and “ey” are the long “a” phoneme. Each language has a finite set of phonemes, and all words are sets of phonemes.) Finally, the system looks for the search terms in the index.

“A phonetic system requires a more proprietary search tool because it must phoneticize the query term, then try to match it with the existing phonetic-string output,” Weideman said. This is considerably more complex than using one of the many existing text-based search tools.

Phoneme-based searches can result in more false matches than the text-based approach, particularly for short search terms, because many words sound alike or sound like parts of other words. For example, Weideman explained, a search for the word “ray” might get a match from within the word “trading.”

According to Ellis, it’s difficult for a phonetic system to accurately classify a phoneme except by recognizing the entire word that it is part of or by understanding that a language permits only certain phoneme sequences.

However, he added, phonetic indexing can still be useful if the analyzed material contains important words that are likely to be missing from a text system’s dictionary, such as foreign terms and names of people and places.

How the technology works

Text- and phoneme-based systems operate in much the same way, except that the former uses a text-based dictionary and the latter uses a phonetic dictionary.

The most important and complex component technology for audio mining is speech recognition. In these systems, explained University of Texas Assistant Professor Latifur R. Khan, “A speech recognizer converts the observed acoustic signal into the corresponding [written] representation of the spoken [words].”

Speech recognition software contains acoustic models of the way in which all phonemes are represented. Also, TMA’s Meisel said, there is a statistical language model that indicates how likely words are to follow each other in a specific language. By using these capabilities, as well as complex probability analysis, the technology can take a speech signal of unknown content and convert it to a series of words from the program’s dictionary.

Khan noted that this process is more difficult with highly inflected languages, such as Chinese, in which tonality changes the meaning of a word.

Some audio mining dictionaries are domain specific, for use by professionals in different fields, such as law or medicine. In any event, users can update dictionaries, usually manually but sometimes automatically by scanning Web sites or other sources into an audio mining product.

Some products, such as ScanSoft’s AudioMining Development System, use XML’s ability to tag data so that it can be read by other XML-capable systems, ScanSoft’s Weideman noted. This lets the product export speech index information to other systems, he said.


By working with powerful host-system processors, large memories, and efficient algorithms, most audio mining technology provides high performance levels.

For example, Fast-Talk says its newest technology can index a one-hour audio file in five minutes, and can process 30 hours of content per second in response to a specific, 10-phoneme search query in a host system running a 2.53-GHz Pentium CPU.


BlackBerry VoIP/SIP softphone is finally available January 4, 2011

Posted by hasnain110 in Uncategorized.

BlackVoib is a generic SIP client for  GSM BlackBerry devices. It allows the user to make/receive SIP calls on the internet via WIFI or OTA through a SIP service provider or  a SIP server run by the user.



1. User controls all SIP account settings.
2. Supports more recent BlackBerry GSM phones only.
3. Supports G.711 ulaw and alaw codecs.
4. DTMF passthru via SIP INFO.
5. Speaker Phone and Handset can be toggled.
6. Volume Controls.
7. BlackBerry phone book integration.

8. Supports separate authentication ID.

9. Can contact server with a different port other than the default 5060.

10. Can use a different port other than the default 5060 as local port.


Download  Click here

Asterisk IVR- Findme FollowMe February 23, 2010

Posted by hasnain110 in Uncategorized.

Here is the easy configuration of setting up and simple IVR with FindME FollowME service. I will be explaining this quick and Im assuming that people reading this will have some prior basic knowledge of Asterisk


I have on USA DID purchased from virtualphone and they gave me the configuration required to be done on my Asterisk my task is to put an IVR on that DID so that when ever someone calls the call should be entertained first with an IVR and for example if someone press 1 for sales and no one responded then the call should automatically ring on other available extension of the sales if all the sales does not pick up in this case the call should be routed to the head of sales mobile phone and if even the Head doesnt picks up the phone call will be going to VoiceMail.


1. Asterisk Server

2. One DID number from any provider

3. One termination account to configure outgoing sip trunk

Step1: Install the asterisk

Step 2: Configure the configuration of the DID service provider in your Sip.conf here is my example

host=x.x.x.x (IP of your DID service provider)
context=my-ivr ( We will use this context in extensions.conf)
;Disable canreinvite if you are behind a NAT

Step 3: Lets add a SIP Trunk to  terminate IVR calls to Public Network over IP. I used Blue-face account. We will do the same configuration in sip.conf










Step 4: Now the last step is we will add dialplan in the extensions.conf
Exten => s,1,Answer
Exten => s,2,Wait(1)
Exten => s,3,Background(ivr) ==> IVR is the name of the file
Exten => s,4,Set(TIMEOUT(digit)=5)
Exten => s,5,Set(TIMEOUT(response)=5)
Exten => 1,1,Dial(SIP/224,10,tr) => here press 1 for Support first extension 224 will ring for 10 and after that if will automatically go to extension 225 and so on
Exten => 1,2,Dial(SIP/225,10,tr)
Exten => 1,3,Dial(SIP/222,10,tr)
Exten => 1,4,Dial(SIP/00191xxxxxxxx@blue-face,10,tr)  => If no one picks on the sip extensions system will try to dial the mobile number using the SIP trunk we configured above
Exten => 1,5,VoiceMail(555,u) => As a last hop the call will goto the VoiceMail
Exten => 2,1,Dial(SIP/112,10,tr)
Exten => 2,2,Dial(SIP/113,10,tr)
Exten => 2,3,Dial(SIP/114,10,tr)
Exten => 2,4,Dial(SIP/00191xxxxxxxx@blue-face,10,tr)
Exten => 2,5,VoiceMail(555,u)
Exten => 3,1,Dial(SIP/333,10,tr)
Exten => 3,2,Dial(SIP/444,10,tr)
Exten => 3,3,Dial(SIP/00191xxxxxxxx@blue-face,10,tr)
Exten => 3,4,VoiceMail(555,u)
Exten => 4,1,Dial(SIP/444,10,tr)
Exten => s,6,Dial(SIP/00191xxxxxxxx/20)
Exten => i,1,Goto,my-ivr|s|1
Exten => t,1,Goto,my-ivr|s|1
Exten => h,1,Hangup()
Step 5: Reload the Asterisk and try to make a call on your DID
If you have any questions do not hesitate to ask me directly daredevilz1@hotmail.com
If you like the post please do comment

OpenVPN Bridge Public IP LAN February 23, 2010

Posted by hasnain110 in Uncategorized.


Last week I spent alot of time to implement bridge mode configuration on openvpn and my company required me to configuire the OpenVPN in TAP mode. Well I spent alot of time reading it and it took me almost a week to implement a one hour job. So I’m just sharing it here so that you guys dont need to spend the same amount of time 🙂 Hope it will be usefull.

Before I start I would like to mention the scenario to help you understand the requirements.


My office is in Cairo and the OpenVPN server is located in USA and the core objective is that some of the Cairo office PCs should be able to use USA Public IP ( Cairo office laptop should get USA Public IP and should be able to communicate with USA office other resources behind the VPN Server as local LAN) ==> I will not be explaining about the usage of VPN as im assuming that people reading this will already have the idea of it

Site A = Cairo

Local LAN =

My laptop IP =

Site B = USA

Local LAN = 196.202.104.X ( at USA we have a pool of 14 internet IPs )

VPN Server IP =

IPs to be leased from VPN to Sita A  =

Note: All the above IP’s are just example they do not belone to USA in real

Configuration on Site B VPN Server

Step 1: First Install OpenVPN server if you dont have it already installed please run this command.

yum install openvpn

Step 2: once the VPN is install you need to install the bridge utillities to enable the server work in bridge mode. To                            install please run this command.

yum install bridge-utils

Step 3:  Install the webmin for the configuration of Firewall if you are not too good in playing with ip-tables this will help

yum install webmin

Step 4: Once the all of the above required softwares are installed please create a file name bridge-openvpn

a. vi bridge-openvpn

b. please paste this script inside the file and save it and dont forget to change the parameters in RED with your configuration of course 🙂



# Set up Ethernet bridge on Linux
# Requires: bridge-utils

# Define Bridge Interface

# Define list of TAP interfaces to be bridged,
# for example tap=”tap0 tap1 tap2″.

# Define physical ethernet interface to be bridged
# with TAP interface(s) above.


case “$1” in
for t in $tap; do
openvpn –mktun –dev $t

brctl addbr $br
brctl addif $br $eth

for t in $tap; do
brctl addif $br $t

for t in $tap; do
ifconfig $t promisc up

ifconfig $eth promisc up

ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast
route add default gw $gw
ifconfig $br down
brctl delbr $br

for t in $tap; do
openvpn –rmtun –dev $t
ifconfig $eth $eth_ip netmask $eth_netmask broadcast $eth_broadcast
route add default gw $gw
echo “usage openvpn-bridge {start|stop}”

exit 1
exit 0


Step 5: we will start the the bridge script

./bridge-openvpn start

Step 6: Once the bridge is start you should see and interface br0 by doing ifconfig command

br0       Link encap:Ethernet  HWaddr 00:40:05:39:D1:BC

inet addr:X.X.X.X  Bcast:X.X.X.255  Mask:

inet6 addr: fe80::240:5ff:fe39:d1bc/64 Scope:Link


RX packets:906246 errors:0 dropped:0 overruns:0 frame:0

TX packets:157958 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:501272593 (478.0 MiB)  TX bytes:17342157 (16.5 MiB)

Step 7: Now goto /etc/openvpn and your server.conf should look like this

port 1195

proto udp

dev tap0

ca keys/server/ca.crt

cert keys/server/server.crt

key keys/server/server.key

dh keys/server/dh1024.pem


crl-verify keys/server/crl.pem

cipher none

user nobody

group adm

status servers/changeme/logs/openvpn-status.log

log-append servers/changeme/logs/openvpn.log

verb 2

mute 20

max-clients 100

keepalive 10 120




push “dhcp-option DNS”

management 20518


this is a working file you can change the parameters as per your requirements

Step 8: Your client.ovpn should look like this


proto udp

dev tap

ca ca.crt

dh dh1024.pem

cert client.crt

key client.key

remote 1195

cipher none

verb 2

mute 20

keepalive 10 120




resolv-retry infinite




Note: You can change any parameter that you see is required or un-necessary. I made it in dirty manner

Step 9: Once the above files are saved and closed you should now start the openvpn on the server

Service openvpn start

Once started if you do the ifconfig on the machine you should see this interface

tap0      Link encap:Ethernet  HWaddr E2:85:38:12:79:BB

inet6 addr: fe80::e085:38ff:fe12:79bb/64 Scope:Link


RX packets:15211 errors:0 dropped:0 overruns:0 frame:0

TX packets:1305266 errors:0 dropped:4532 overruns:0 carrier:0

collisions:0 txqueuelen:100

RX bytes:2142903 (2.0 MiB)  TX bytes:374471424 (357.1 MiB)

Step 10: Now as we installed above Webmin in step 3 we will actually use it here now. For those who are not familier with webmin please read it . please do the following steps

a)      Access webmin on your browser https://ip of the vpn server:10000

b)      Enter the username root and the root password

c)       Click on WEBMIN è WEBMIN CONFIGURATIon è Webmin Modules

d)      Select the option Third party module from and click SELECT

e)      From the list of software select Turtle Firewall and the click on INSTALL MODULE

f)        Once installed goto NETWORKING è TURTLEFIREWALL

Here are some screen shots of how my firewall rules look like. You can make your own


NAT, Masquerading and Redirection

Firewall Rules

I know these rules are pretty dump but this is just to give you an Idea as for my task security was not any concern. But do change the rules for your deal

Now after making all these rules please start the TURTLEFIREWALL service and your are done. Note you can start or stop the same service from console as well. Service name is turtlefirewall

Step 11:  Now here comes the Site A configuration ( Site where we will be using the Public IP’s from the USA) In my working scenario the network was very plan. There was one DSL connected to a switch and all rest of the PC and laptop connected to the same switch. My laptop having three interface

  1. Physical NIC
  2. Wireless NIC è Disabled
  3. Virtual TAP Adaptor installed by OpenVPN

In this step before I connect the VPN on my laptop I will have to perform a small exercise to prepare a BRIDGE connection between my working INTERFACE and Virtual Interface

Note: Before you make bridge make sure that your working interface is not set the Obtain IP Automatically otherwise internet will stop working

Step 12: Once Bridge is done you should see this

Step 13: Now before you connect its recommended to enable IP Forwarding on your windows do google to see howto do it and then connect your openvpn client on your laptop/pc and you should get one of the public ip defined in server’s server.conf

Step 13:  Last step is once the vpn is connected on your laptop/PC and you are able to go to internet put the other available USA public  IP on other system which need the public IP but remmebmer the GATEWAY of that machine should be the GATEWAY IP address of the SERVER located in USA

I hope this document is pretty details still if you face any problem add me over msn daredevilz1@hotmail.com

If you like this post please take a sec and do comment

Linux VNC Gnome startup March 17, 2009

Posted by hasnain110 in Uncategorized.
add a comment

Step 1:

Edit file vi /root/.vnc/xstartup


# Uncomment the following two lines for normal desktop:
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop”

Step 2:

Edit the last line and it should be like this


# Uncomment the following two lines for normal desktop:
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
exec gnome-session &

Step 3:

Server vncserver restart

Step 4:

On your vnc client enter the ip address like this x.x.x.x:1

Using SIPP for stress testing Asterisk March 12, 2009

Posted by hasnain110 in Asterisk.


Download SIPP from http://sipp.sourceforge.net/ and install the rpm

Step 2:

Adding Following in /etc/asterisk/extensions.conf

exten => 2005,1,Answer
exten => 2005,2,SetMusicOnHold(default)
exten => 2005,3,WaitMusicOnHold(20)
exten => 2005,4,Hangup

Step 3:

Create this in your /etc/asterisk/sip.conf



Reload Asterisk (in debug mode)

asterisk -rvvvv

then type reload in console to make new changes effective

Step 5:

sipp -sn uac -d 20000 -s 2005 IP.OF.YOUR.BOX -l 30

This command will connect as a client, and give the duration of the call 20K miliseconds (or 20 seconds), will dial the server at ip IP.OF.YOUR.BOX, and try to reach the extension 2005, with a limit of 30 simultaneous calls

Howto: Linux Secure Copy February 23, 2009

Posted by hasnain110 in Uncategorized.
add a comment

Here is a quick howto for copying one file from one machine to another machine using SSH session


If remote machine’s ssh is running on some different port e.g. 7890

scp -P 7892 filename.tar.gz root@remote-machine-ip:/root/

If remote machine ssh is running on default

scp filename.tar.gz root@remote-machine-ip:/root/