Skip to main content

Posts

New Post

Add Custom Fields in Asterisk’s MySQL CDRs

IntroductionThis blog is to introduce some unique fields in Asterisk MySQL CDRs for identifying a call and asterisk instance.
MethodologyFollowing are the steps required:
Step # 1Introduce following columns in database table `cdr`:
ip_addresscall_idunique_identifierALTERTABLE`cdr` ADD`ip_address` VARCHAR(20) NULL; ALTERTABLE`cdr` ADD`call_id` VARCHAR(200) NULL; ALTERTABLE`cdr` ADD`unique_identifier` VARCHAR(100) NULL; Step # 2Add following section in asterisk file i.e. cdr_mysql.conf. It will enable the CDR() function to recognize custom fields included in asterisk MySQL CDRs.
[aliases] ip_address = ip_address call_id = call_id unique_identifier = unique_identifier Step # 3Following is the dialplan (in file i.e. extensions.conf) to handle custom Asterisk MySQL CDRs.
[default-context] exten => _X.,1,set(CDR(ip_address)=${SHELL(/sbin/ifconfig | /usr/bin/awk '/inet addr/{print substr($2,6)}' | /bin/grep -v '127.0.0.1' | /usr/bin/head -n1):0:-1}) exten => _X.,n,set(CDR(call_id)=…
Recent posts

ONES Phone Number API

Introduction These services are developed get updated details of phonenumbers.The result is in JSON and valid-flag signifies whether phonenumber is valid or not i.e. 1 or 0 respectively.Number can be provided in any format i.e. with spaces, characters etc.Phonenumber’s Length must be within range of 4 to 20.GitHub Repo: libphonenumber-api
ServicesGetting Phonenumber’s InformationPhone Numbercurl http://localhost/phonenumber?number=+45(3)216-0398 4532160398 Phonenumber’s Typecurl http://localhost/type?number=4532160398 {"type": "FIXED_LINE_OR_MOBILE", "valid-flag": 1} Phonenumber’s Country Codecurl http://localhost/countrycode?number=4532160398 {"countrycode": "45", "valid-flag": 1} Phonenumber’s National Significant Numbercurl http://localhost/nsn?number=4532160398 {"nsn": "32160398", "valid-flag": 1} Phonenumber’s Country’s ISO CodeISO Code in 2 Alphabetscurl http://localhost/iso2?number=4532160398 {"…

Troubleshooting ODBC Module in Asterisk

IntroductionThis article is to introduce troubleshooting steps for ODBC malfunction for Asterisk.
DescriptionWe are resolving following error for ODBC Connection.

$ echo "select 1" | isql -v asterisk-connector [01000][unixODBC][Driver Manager]Can't open lib '/usr/lib64/libmyodbc5.so' : file not found [ISQL]ERROR: Could not SQLConnect
Methodology
Step # 1Create a separate directory odbc/ in /usr/lib or /usr/lib64/ (as available):

$ mkdir /usr/lib64/odbc/
Step # 2Download and Install latest MySQL Connector for ODBC with suitable for your OS:



$ tar -zxvf mysql-connector-odbc*.tar.gz $ cd mysql-connector-odbc-* $ cp lib/* /usr/lib64/odbc/
Step # 3Create or Edit file /etc/odbcinst.ini to add following contents:

[MySQL] Description = ODBC Driver for MySQL Driver = /usr/lib64/odbc/libmyodbc5w.so Setup = /usr/lib64/odbc/libmyodbc5S.so FileUsage = 1
Step # 4Create or Edit file /etc/odbc.ini with following contents:

[asterisk-connector] Description           = MySQL connection to 'asteri…

How to Install OpenSIPS?

IntroductionThis article is to give an overview to install OpenSIPS with its default settings.
DescriptionIn this article, we are installing OpenSIPS version 2.1.0 in Centos OS. So change your settings as per your OS.
MethodologyBefore starting installation Process, Install some of the dependencies of OpenSIPS:
$ sudo yum install gcc gcc-c++ bison flex zlib-devel openssl-devel mysql-devel subversion pcre-devel ncurses-devel ncurses Following is the step by step guide for installing OpenSIPS.
Step # 1Download and extract OpenSIPS source:
$ wget http://opensips.org/pub/opensips/2.1.0/src/opensips-2.1.0.tar.gz $ tar -zxvf opensips-2.1.0.tar.gz Step # 2Edit Private and Shared Memory as per requirement:
$ vi opensips-2.1.0/config.h Change Following values as per requirement:
#ifdef HP_MALLOC #define PKG_MEM_SIZE 64                         /* Used only if PKG_MALLOC is defined*/ #else #define PKG_MEM_SIZE 8                          /* Used only if PKG_MALLOC is defined*/ #endif #define SHM_MEM_SIZE 128  …

Configuring OpenSIPS database

IntroductionThis article is to provide step by step to configure OpenSIPS database after OpenSIPS Installation.

DescriptionIn this article, we are installing OpenSIPS version 2.1.0 in Centos OS. So change your settings as per your OS.
MethodologyFollowing is the step by step guide for installing OpenSIPS.
Step # 1Create User and Database for OpenSIPS:
CREATEDATABASE`opensips`; CREATEUSER'opensips'@'%'IDENTIFIED BY'<password>'; GRANTALLPRIVILEGESON`opensips`.* TO'opensips'@'%'; FLUSH PRIVILEGES; DROPDATABASE`opensips`; Step # 2Edit opensipsctlrc file for database information:
$ vi /etc/opensips/opensipsctlrc Edit following parameters for connection with MySQL Database created in previous step:
DBENGINE = MYSQL DBHOST = localhost DBNAME = opensips DBRWUSER = opensips DBRWPW = "" MYSQL_ENGINE = "MyISAM" DBROOTUSER = "root" USERCOL = "username" ETCDIR = etc/ Step # 3Create database and tables for OpenSIPS:
$ opensipsdbctl cre…

How to install FreeSWITCH in Centos 7?

IntroductionThis article is to give an overview to install FreeSWITCH with its default settings.
$ sudoyum update $ sudoyum groupinstall "Development tools"-y $ sudoyum installgit autoconf automake libtool gcc-c++ libuuid-devel zlib-devel libjpeg-devel ncurses-devel openssl-devel sqlite-devel.x86_64 curl-devel pcre-devel speex-devel ldns ldns-devel libedit-devel gtk+-devel gtk2-devel ntpdate yasm-devel.x86_64 lua-devel opus-devel libshout-devel  libsndfile-devel
Following is the step by step guide for installing FreeSWITCH.
Step # 1Download and extract FreeSWITCH source:
$ cd/usr/local/src/ $ sudogit clone https://freeswitch.org/stash/scm/fs/freeswitch.git Step # 2Compile & Install FreeSWITCH with libyuv:
$ cd/usr/local/src/freeswitch $ cdlibs $ sudogit clone https://freeswitch.org/stash/scm/sd/libyuv.git $ cdlibyuv $ sudomake-f linux.mk CXXFLAGS="-fPIC -O2 -fomit-frame-pointer -Iinclude/" $ sudomakeinstall $ sudocp/usr/lib/pkgconfig/libyuv.pc /usr/lib64/pkgconfig/ $ cd../../ …