Md. Golam Rabbany

Just work with honesty, Success will come on your door

Fully IVR base ANI/Calling Card Platform

Today I have lunched new billing for IVR base ANI/Calling Card platform. This system is 100% customizable.  Now it is working on 1tel Network. There are some exceptional features of this billing system such as

  1. Real time least cost route billing
  2. Multi Level Agent
  3. Create or recharge Account via IVR
  4. Add/Remove Speed Dial  via IVR
  5. Add/Remove additional phone number via IVR
  6. Click2Call via IVR
  7. Click2Call via SMS
  8. Click2Call via Web
  9. Speed dial
  10. Follow me
  11. Call Forward
  12. Call conferences
  13. HOT Number Dial
  14. Block Caller ID Unblock
  15. Account System
  16. FnF
  17. Online Payment
  18. CRM
  19.  Dynamic IVR Setting
  20. Customizable Web Panel

rBilling 1.20 Comming Soon

I have developed VoIP billing using Asterisk, PHP, MySQL, PHPAGI and AJAX named rBilling.  Currently BansBerry Pvt. Ltd and IBSYS Canada Inc are using my billing. I have release only one version(rBilling 1.10) and more updated version is coming soon.  rBilling 1.20 can handle 800 to 1000 concurrent calls and real time bill calculate of those calls. rBilling 1.20 has some basic feature, such as

  • Real time Billing
  • Prefix base routing
  • Flexible rating
  • Multiple business models
  • Real time call monitoring
  • Five Level Billing
  • Calling Card Clients
  • ANI Clients
  • GK Register Clients (Mobile Dialer or SIP Devices)
  • Call Shop Clients
  • Whole Sale Billing
  • DID PBX
  • Call forwarding
  • Call conferences
  • HOT Number Dial
  • Block Caller ID Unblock
  • CRM
  • Scratch cards and recharge cards
  • Online payment processing
  • Scalability, reliability and high availability
  • Web-based customer care and self-provisioning
  • Reports and invoices
  • Customize Web Interface for Admin, Reseller and Clients

My Own billing System with Astersik

Today I am really happy that I have launched my VoIP billing using PHP, MySQL, AJAX and Asterisk. It is completely real time billing. Its has some basic feature such as

  • Routing Engine
  • Real-time billing
  • Flexible rating
  • Multiple business models
  • Calling Card, ANI, SIP Billing
  • Products and account management
  • Web-based customer care and self-provisioning
  • Reports and invoices
  • Least Cost Routing
  • Web Interface
  • Credit Card payment processing(Under constriction)
  • Partnerships /Reseller
  • Scalability, reliability and high availability
  • Operation support systems and fraud detection
  • Statistics and monitoring
  • Scratch cards and recharge cards

Asterisk billing

Asterisk is fully SIP base PBX system. For a long time, I try to develop asterisk billing system using AGI. I have collected a lot of documentation and try to study to AGI. I have also collect a2billing for asterisk billing. A2billing is fully open source for asterisk billing but it is so complex. I have install it on my Linux server and tried to understand what is going on.  Now I am fully clear how its work.

From last month I try to develop a new billing system of asterisk. Now I am 100% success to develop asterisk billing system.

Thanks to PHPAGI, A2Billing and voip-info.org.

How to setup Asterisk on Centos

First things first, need to update your server:
Command:
# yum update

A lot of guides out there use the -y switch with yum to auto-install whatever is found to be updated.  You can do this if you like, however, I personally prefer to have to manually select Yes before I do the updates.  That all comes down to personal preference.

Next, we need to install all of Asterisk’s dependencies.  These are programs that are required to be installed before you can compile asterisk.  This is the list I use, it includes the source compilers, some needed development libraries, as well as some dependencies for various asterisk modules I like to load.

Command:
# yum install gcc gcc-c++ make openssl-devel newt-devel ncurses-devel libtermcap-devel libxml2-devel kernel-devel perl curl curl-devel

Also, if you have a PAE-based kernel (like I do), which is becoming more and more common these days, you’ll need to load the PAE kernel headers:

Command:
# yum install kernel-PAE-devel

Next, we’ll install a MySQL database server to handle our CDR (call detail records) storage, and also to prepare the way for using the Asterisk Realtime Architecture (the ability to store our configuration parameters in a database as opposed to flat files).  You can safely skip this step if you feel you’ll never make that transition, but it doesn’t hurt anything to go ahead and get this setup now as opposed to later.

Command:
# yum install libtool-ltdl libtool-ltdl-devel unixODBC-devel mysql mysql-devel mysql-server mysql-connector-odbc

Now, we’ve got all of the dependencies installed.  It’s time to go ahead and get into the meat of the install.  We’ll start by creating a new directory under /usr/src to keep everything nice and tidy.  Then we’ll download all of the sources we’re going to need for this install.

Command:

# 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/ releases /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

First, we’ll install LibPRI.  LibPRI is a library used by TDM cards (T1 / E1 cards, etc).  Even if you don’t have one of these cards, it’s safe to install LibPRI – it won’t have any negative effects on your system.

Command:
# cd /usr/src/asterisk/libpri-1.4.10.2
# make clean
# make
# make install

Next, we’ll install DAHDI.  DAHDI means “Digium Asterisk Hardware Device Interface”, it’s pronounced “Daddy”, and it’s the replacement of the old Zaptel driver stack.  DAHDI is the set of linux kernel modules and also a set of tools for interfacing with TDM cards.  More importantly, DAHDI provides timing to several asterisk components, such as the MeetMe application as well as Music on Hold.  If you don’t have a proper timing source installed, you’ll notice lots of stuttering pauses in any kind of audio playback (Music on Hold, IVR prompts, voicemail greetings) from asterisk.  If you don’t have any TDM hardware installed in your server, DAHDI also provides a “dummy” driver that will provide a timing source to asterisk.

Now, starting with Asterisk 1.6.1, Digium introduced new internal timing options that can be used in place of the DAHDI timer, however, these are only available on systems running the latest kernels (2.6.25+)  in the case of res_timing_timerfd, or on lightly loaded systems, as is the case with res_timing_pthread.  If you would rather use one of these options instead of the DAHDI dummy driver, you may skip this step – just be sure to select one of the above mentioned res_timing resouces when you build asterisk later.  IMPORTANT NOTE – if you do have a TDM card installed in your system, you may not skip this step!

Command:
# cd /usr/src/asterisk/dahdi-linux-complete-2.2.1-rc2+2.2.1-rc2/
# make all
# make install
# make config

Now that you’ve installed DAHDI, you need to configure it.  You do that by editing the following files, based on your situation.  The files themselves contain lots of documentation, so I won’t go over that in much detail here, except to say this – if you have no TDM cards and are only installing DAHDI for the dummy timing source, you can comment out every driver referenced in the modules file.  I prefer to use vi, you can use whichever editor is your favorite.  If you’re new to linux, I would suggest using nano with the -w switch.

Command:
# vi /etc/dahdi/modules
# vi /etc/dahdi/system.conf

Now that we’ve got DAHDI configured the way we need for our system, we need to set it to start at boot time, and then we need to start it.

Command:
# chkconfig dahdi on
# service dahdi start

Next, let’s setup our MySQL database for CDR storage.  I’ll make another post detailing the settings needed for Asterisk Realtime later.  Be sure to run the mysql_secure_installation script after you start MySQL in order to set up a root password to protect your SQL databases!

Command:

# chkconfig mysqld on
# service mysqld start
# /usr/bin/mysql_secure_installation
# mysql -p

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE DATABASE `asterisk` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `asterisk`;
CREATE TABLE IF NOT EXISTS `cdr` (
`recid` mediumint(8) unsigned NOT NULL auto_increment COMMENT 'Record ID',
`calldate` datetime NOT NULL default '0000-00-00 00:00:00',
`clid` varchar(80) NOT NULL default '',
`src` varchar(80) NOT NULL default '',
`dst` varchar(80) NOT NULL default '',
`dcontext` varchar(80) NOT NULL default '',
`channel` varchar(80) NOT NULL default '',
`dstchannel` varchar(80) NOT NULL default '',
`lastapp` varchar(80) NOT NULL default '',
`lastdata` varchar(80) NOT NULL default '',
`duration` int(11) NOT NULL default '0',
`billsec` int(11) NOT NULL default '0',
`disposition` varchar(45) NOT NULL default '',
`amaflags` int(11) NOT NULL default '0',
`accountcode` varchar(20) NOT NULL default '',
`uniqueid` varchar(32) NOT NULL default '',
`userfield` varchar(255) NOT NULL default '',
PRIMARY KEY  (`recid`),
KEY `calldate` (`calldate`),
KEY `dst` (`dst`),
KEY `accountcode` (`accountcode`),
KEY `src` (`src`),
KEY `disposition` (`disposition`),
KEY `uniqueid` (`uniqueid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
CREATE USER 'asterisk'@'localhost' IDENTIFIED BY 'PASSWORD';
GRANT FILE ON * . * TO 'asterisk'@'localhost' IDENTIFIED BY 'PASSWORD' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
GRANT INSERT ON `asterisk`.`cdr` TO 'asterisk'@'localhost';

Be sure to set your own password for the asterisk user (where I used ‘PASSWORD’ in the above block).

Now, we’ve got all the prerequisites installed.  Let’s install Asterisk!

Command:
# cd /usr/src/asterisk/asterisk-1.6.2.0/
# make clean
# ./configure
# make menuselect
# make
# make install
# make samples
# make config
# chkconfig asterisk on

Next, we need to verify that asterisk installed correctly.  We do this by manually starting asterisk from the command line.  If everything starts up and there’s not too many errors or warrnings, we’re good to go:

Command:
# asterisk -vvvvc
OR
# asterisk -r
*CLI> core stop now

Next, we need to install some of the options from the Asterisk-Addons download.  Asterisk-addons contains additional applications, channel drivers, and resource modules that are useful for asterisk but not necessary.  We’re going to install the mysql cdr addons for asterisk.

Command:
# cd /usr/src/asterisk/asterisk-addons-1.6.2.0
# make clean
# ./configure
# make menuselect

At this point, be sure to select at least the following items:

  • Applications – app_addon_sql_mysql
  • Call Detail Recording – cdr_addon_mysql
  • Resource Modules – res_config_mysql

After you’ve got those selected, save and exit.  Then proceed with the following steps:

Command:
# make
# make install
# make samples

Once we’ve got that done, we need to edit the cdr_mysql.conf file to enter the mysql username and password, database, and table we setup earlier.  What’s listed below should be all we need in this file, if there’s anything else in there, either comment it out or delete it.

Command:
# 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

And that’s it!  You should read through several of the key configuration files in order to learn what’s changed, and also how to customize Asterisk for your installation.  The files to look into would be:

/etc/asterisk/asterisk.conf
/etc/asterisk/extensions.ael
/etc/asterisk/extensions.conf
/etc/asterisk/sip.conf
/etc/asterisk/iax.conf
/etc/asterisk/voicemail.conf
/etc/asterisk/users.conf

If you have any questions or run into any trouble, please feel free to leave a comment and I’ll help out where I can.

 

Convert Seconds To Hours Minutes Seconds Words

<?php

/**
*
* @convert seconds to hours minutes and seconds
*
* @param int $seconds The number of seconds
*
* @return string
*
*/
function secondsToWords($seconds)
{
/*** return value ***/
$ret = "";

/*** get the hours ***/
$hours = intval(intval($seconds) / 3600);
if($hours > 0)
{
$ret .= "$hours hours ";
}
/*** get the minutes ***/
$minutes = bcmod((intval($seconds) / 60),60);
if($hours > 0 || $minutes > 0)
{
$ret .= "$minutes minutes ";
}

/*** get the seconds ***/
$seconds = bcmod(intval($seconds),60);
$ret .= "$seconds seconds";

return $ret;
}
?>

Adding Custom Text to an Image

<?
header ("Content-type: image/pjpeg");
$string = "This is sooo cool it works!!!";
$font  = 4;
$width  = ImageFontWidth($font)* strlen($string) ;
$height = ImageFontHeight($font) ;

$im = ImageCreateFromjpeg(“./PLACE_IMAGE_NAME_HERE.jpg”);
$x=imagesx($im)-$width ;
$y=imagesy($im)-$height;
$background_color = imagecolorallocate ($im, 255, 255, 255); //white background
$text_color = imagecolorallocate ($im, 0, 0,0);//black text
imagestring ($im, $font, $x, $y,  $string, $text_color);

imagejpeg ($im);
?>

E-commerce Solution for Calling Card


Its Online Phone card sells system based on PHP, MySQL and AJAX. For this system user can easily create an account and they can buy their phone card by online. Here I have used online payment processing. Current IBSYS Canada Inc is using this application. This application is direct connect with VOIP Switch.

visit http://www.ibsystelecom.com

My First WordPress Theme

Visit: http://www.bansberry.com

How to add your Class at CodeIgniter

Step#1: create your own class
<?
class class_name {

function function_name()
{
echo “I am There”;
}

}
?>

Now save this file on your libraries (system->libraries) and file name is must according to your class name like class_name.php

 

Step#2: create a controller like this…
<?php

class own_controller extends Controller {

function own_controller()

{

parent::Controller();

}

function show_text()

{
$this->load->library(class_name);
echo $this-> class_name -> function_name();
}

}
?>

Now save the controller at your controller folder.

OUT PUT will be “I am There”

 

Follow

Get every new post delivered to your Inbox.