Multiple PRI (ISDN) cards on a single FreeSWITCH box

Where the number simultaneous calls are increasing many of you would like to scale up your FreeSWITCH/Asterisk system by increasing number of PRI/BRI lines to your system and for that, you would like to run more than one telephony card. 

I have successfully tested 3 cards on a single FreeSWITCH machine.

Here is a simple tutorial on how to achieve that (With reference to DAHDI. ofcourse you can use sangoma or any other manufacturer’s cards).

  1. Insert the card into your PCIe slot (as most of the cards today are PCIe compatible)
  2. Load the driver module specific for the cards.
    Now this step should be taken care of. Suppose you are using DAHDI as the driver interface, you have to find the name of the specific driver module for the particular card e.g. for digium 8-span card it’s “wct4xxp”, for single span “wcte12xp” . Now load the module(This step could be different for different OS platforms).
    Now if you are using different type of cards (of same manufacturer as I used) e.g. 8-span and 4-span, you will have to load modules for both the cards.
  3. After modules are loaded properly the cards can be detected by the system.
  4. Configure cards in system.conf (wrt dahdi). 
    If you are using 8+4 span card for example, configure 1-12 spans in system.conf and run dahdi configuration utility and the lines will be up if connected properly.
  5. Now the last step is to configure mod_freetdm. Configure 12 spans in the configuration files of mod_freetdm(refer wiki) and if done properly the system will be up and running.

If you find any issues reach me at gautamashish09[at]gmail.com 

FreeSWITCH FreeBSD Digium 8 span card ‘defult linemode’ issue

In freebsd ( for E1 lines) the default linemode in which the module wct4xxp is T1. For E1 lines in FreeBSD environment the command to set the default linemode does’nt work. Here is a simple source code hack for this:

1. untar /usr/ports/distfiles/dahdi-freebsd-2.6.1-r10738.tar.gz to some directory say ‘/root’

2. go to dahdi-freebsd-2.6.1-r10738/drivers/dahdi/wct4xxp and open base.c (wct4xxp is the module for 8-span digium card).

3. go to line 196 which is:

static char default_linemode[] = “t1”

change “t1” to “e1” and save changes.

Also change line 198 :

static char *default_linemode = “t1”;

to

static char *default_linemode = “e1”;

4. tar the directory and overwrite to /usr/ports/distfiles/dahdi-freebsd-2.6.1-r10738.tar.gz .

5. Calculate the SHA256 hash and the size of the tar file.

6. Go to /usr/ports/misc/dahdi-kmod26/ and open distinfo.

7. Update the SHA256 hash and size of the dahdi-freebsd-2.6.1-r10738.tar.gz file there.

Done!!!!!!

Now install the dahdi-kmod26 port again and the card should work for E1 PRI line.

FreeSWITCH mod_freetdm, Libpri Issue: T316 Timer restart. Channels suspended, only 2 or 3 calls are successful.

If you are seeing something like this in your FS console:

ftmod_libpri.c:1997 [s1c21][1:21] — T316 timed out, resending RESTART request
[ERR] ftmod_libpri.c:1993 [s1c5][1:5] — T316 timed out, channel reached restart attempt limit ‘3’ and is suspended
 
then you will have to make a simple hack in the FS source code:
 
  1. Go to FS source directory and change dir to this path libs/freetdm/src/ftmod/ftmod_libpri.h
  2. change #define T316_TIMEOUT_MS_DEFAULT to 10000
  3. #define T316_TIMEOUT_MS_MAX to 300000
  4. #define T316_ATTEMPT_LIMIT_DEFAULT to 30 (in case of PRI lines or no. of ,max. channels in your case)

After this recompile mod_freetdm and restart freeswitch. You will see channels restarting one by one. Also during this period in which the channels are restart do not make calls as it will show NORMAL_CIRCUIT_CONGESTION. It will take some time to restart the channels and probably the system should work after doing this.

php-agi doesn’t execute properly and gives no output.

This is problem becomes a headache to most of the asterisk developers as it does not show any kind of error but still the agi script does not execute properly with no output.

It happens because of the version incompatibility of asterisk AGI and PHP. If by executing the script from the command line ( php index.php e.g.) it gives the following error:

“PHP Parse error: syntax error, unexpected T_GOTO, expecting T_STRING in /var/lib/asterisk/agi-bin/phpagi.php on line 1207”

go to line 1207 in phpagi.php which shows this line: function goto($context, $extension=’s’, $priority=1)

 

just prefix an underscore before the function name like this:

function _goto($context, $extension=’s’, $priority=1)

 

and done!!!

Asterisk Installation through ports in FreeBSD

After updating the freeBSD ports collection follow these few simple steps to install asterisk

1.) cd /usr/ports/net/asteriskXX(XX may be 10,14,16 depending upon the version)

2.) make

3.) make install clean

and done..

Important: If you want to install and setup PRI ( dahdi,libpri etc) on freeBSD systems, its not going to work because currently only asterisk supports freeBSD well though DAHDI is also being developed to support it. As far as Digital telephony cards are concerned, most of them do not support freeBSD (or BSD also). 

Simple asterisk with dahdi installation steps CentOS 5

1.)yum install gcc gcc-c++ make openssl-devel newt-devel ncurses-devel libtermcap-devel libxml2-devel kernel-devel perl curl curl-devel
2.)uname -r
2.6.18-164.10.1.el5PAE
if kernel is PAE then do:
yum install kernel-PAE-devel

======install mysql database for CDR========
3.)yum install libtool-ltdl libtool-ltdl-devel unixODBC-devel mysql mysql-devel mysql-server mysql-connector-odbc

====steps to download and install asterisk with DAHDI=====
# cd /usr/src
# mkdir asterisk
# cd asterisk
# wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.6.2.0.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-addons-1.6.2.0.tar.gz
# wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
# wget http://downloads.digium.com/pub/libpri/libpri-1.4-current.tar.gz
# tar zxvf asterisk-1.6.2.0.tar.gz
# tar zxvf asterisk-addons-1.6.2.0.tar.gz
# tar zxvf dahdi-linux-complete-current.tar.gz
# tar zxvf libpri-1.4-current.tar.gz
=========install libpri==========================
# cd /usr/src/asterisk/libpri-1.4.10.2
# make clean
# make
# make install
======install dahdi=================================
# cd /usr/src/asterisk/dahdi-linux-complete-2.2.1-rc2+2.2.1-rc2/
# make all
# make install
# make config

====install asterisk with selected packages====================
# cd /usr/src/asterisk/asterisk-1.6.2.0/
# make clean
# ./configure
# make menuselect

# make
# make install
# make samples
# make config
# chkconfig asterisk on

========install addons==========================
# cd /usr/src/asterisk/asterisk-addons-1.6.2.0
# make clean
# ./configure
# make menuselect

# make
# make install
# make samples

=======configure cdr-mysql===================
# vi /etc/asterisk/cdr_mysql.conf
[global]
hostname=localhost
dbname=asterisk
table=cdr
password=PASSWORD
user=asterisk
port=3306
sock=/var/lib/mysql/mysql.sock
userfield=1
loguniqueid=yes

You are creative!!!

There was jungle in which there was a cave where lived a bear who used to eat one rabbit a day. There was a rumor among the rabbits that the bear has prepared a list on which the name of each rabbit whom the bear is going eat and when was there. There were three smart rabbits who wanted to know in advance that they are going to be eaten or not. They decided to go to the bear’s cave one by one and ask him whether he is going to eat them or not. The first rabbit went inside the cave and asked the bear ” are you going to eat me? ” bear just caught it and ate it then and there only. Then decided the second one to go inside. He asked the same question that “are you going to eat me?”. Bear ate it also then and there only.
The third rabbit knew that the rest of the two have been eaten, he then decided to go inside and asked the Bear ” Hey! am I on the list? “. The Bear answered “yes”. The rabbit then said “Can you please take me out of that? “. The bear said ” yes why not” and he left the rabbit alive.

What does the story tells us? what was the difference between the first two and the third rabbit? Well There is one and only difference between the two and the last one and that is ” Communication “. Isn’t it?
He put himself so differently that the bear never heard something like that before and the rabbit found that the bear can also leave him alive. Its just out of the box thinking. So what does that term mean? We all think differently inside of us but the only thing that stops us is the fear. Fear that when we fail what others will say. Fear that I cannot do this. Happens with almost all of us. When you were a kid, everything was possible for you. You would plan to fly in the sky, you would plan to be a superhero and whats even more unbelievable is you believed yourself isn’t it?. As we grow up, gather more knowledge, the fear also grows and we start doubting yourself. Do you remember the days in the childhood when you planned to climb up a tree even when you could not and after trying for some times you made it. Finally you were on the top of the tree. what is that? you believed yourself that time.

Why can’t you believe yourself now? why to doubt yourself. The famous scientist T.E. Edison invented the Electric Bulb we all know that. Do you know he failed thousands of times in man experiments before that trying out to give shape to his thoughts? Those thousand failures do not matter, what matters is that one success which came after those thousand failures just believe yourself. We always be like children, fearless, Self-believers, creative then only we can make anything possible. One does not really have to think specially out of the box, he just has to look at himself from out of the box. Just having faith that whatever idea you get can be made into reality is what matters here. This is the golden rule of the success believe me. There is an Einstein in each of us since we are born, he is just sleeping. Wake him up and see the world from a different perspective. Do things which were never done 😉 !!!!!

Cloud Telephony- the telephony 2.0

Think about this :-

A web application which interacts with users, calls them, get their input through their mobile’s keypad, records their voice, SMS them etc. Now what if the developers of this web application did not have any knowledge about how the Telephony or such applications work? Seems absurd? How is it possible? The one and only answer to all these questions is “Cloud Telephony”.

Now what is Cloud Telephony? Put simply, this term means you do not have to worry about how telephony things work, how outgoing calls are made, conference, call transfer, PRI lines all these terms may prove to be a headache for a developer who wants to develop advanced telephony applications but does not have the expertise on the part of telephony isn’t it? And this is where Cloud Telephony comes into play. Cloud telephony service providers simply provide you all these basic telephony functionalities like making a call through simple methods which are available today. Say you just have to call an API or send information through VXML (Voice XML, a standard format) and all done. Isn’t that simple? Cloud Telephony has made it all possible.

Times are changing and so is the technology. Today is the time of convergence of Internet and Telephony. And when these two are combined, Cloud Telephony is born. Things like choosing a PRI provider, buying a server or datacenter, Telephony software development and deployment and headache about all this stuff is now outdated! Cloud Telephony has open up the door where developers can now just leave all these woes to the Cloud Telephony service providers. In other words Cloud Telephony has emerged as the second generation Telephony. It becomes so simple for the developers to develop highly sophisticated telephony applications because of the same.

It is well said if there are fumes, there must be some fire. Why this term “Cloud Telephony” has become so much popular in such a short time? Obviously there are clear reasons behind that. Now businesses can host the their call centre on cloud, Develop highly sophisticated, innovative telephony applications and IVRS in very short time, No worries about system uptime and maintenance, lowered set-up costs, freedom to develop your own services are some of the benefits out of countless number. You just pay on monthly basis or as per actual usage basis and become free of all the worries. In a simple language, Cloud Telephony is nothing but your personal Telephony system hosted by the service providers. As far as the market need is concerned, its huge as we all know when it comes to telephony.

In India there are 10 percent internet users as compared to more than 70 percent mobile or telephone users. Everybody almost from a young teenager to an old person in his late 70s uses mobile or phone. So there is no doubt that Telephony has a great potential when it comes to market and Cloud Telephony for sure will help businesses to utilize the power of telephony to reach the masses. And this is why it catching up so much popularity today. In future we can expect some great innovative work from developers making use of the power of Cloud Telephony as it has opened up altogether a new world for them.