Skip to main content

Posts

Showing posts from 2018

Perl - Database Transactions

Database Transactions with Perl To understand what is a database transaction lets look at a simple bank withdrawal and deposit scenario. Assume that you have two bank accounts call A and B, and you need withdraw some amount from account A and Deposit it on account B. In this scenario what happen if you couldn't withdraw money from your account A, the deposit part won't carry out. Again if you couldn't deposit the money to your account B you have to deposit them back on account A (Which means a roll back). So in the  context of Database, Transaction is refer to  a sequence of jobs which is supposed to run as a whole. So in other words, it should happen as whole or not. So as in our following example, we have 3 Database queries which should perform as a whole. Further assume that our first Database query is supposed to perform a insert if successful, second query  should update a table if successful, third query  should delete an entry from a table.  So i

Asterisk Gateway Interface - Perl

Asterisk Gateway Interface 1. What is Asterisk Gateway Interface?  In simple word AGI is Language Independent API to programmers to control the call flow on their Asterisk PBXs. Asterisk provides more than its own dial-plan, to control to the call flow or lets say call logics. So which means you may use either one of Dialplan Asterisk Manager Interface (AMI) Asterisk Gateway Interface (AGI) to manipulate your call logics. Before we move on to AGI lets briefly discuss about each one of above, Dialplan Dial plan is Asterisk native call logics performer, it's fast, easy to learn and efficient. But this configuration script is more closer to assembly program (If you have any previous experience on assembly), the main drawback of the Asterisk Dialplan in it's lack of support on standard procedural  language as an example when you want create a loop.  Any way in the following tutorials we will only discuss about the AGI, But we can't avoi

HAProxy

HAProxy implementation Case Study This tutorial covers HAProxy Deployment on Firewall and SELinux enabled Centos7 systems. First of all lets get an overall idea about my situation.  I've bought a domain call mycompany.com so all of my  hosted sites should be followed by this main domain. As an example, if someone look for london.mycompany.com he should reach to London server, if someone look for chicago.mycompany.com he should reach to Chicago server So, I've created a Cloudflare account and point mycompany.com to our public IP address and created two                 CNAME entries from Cloudflare by adding London and Chicago. From the Cloudflare all the request to mycompany.com will forward to our public address and HAProxy may read those requests and Process them and forward them accordingly between two IIS servers. Note that all HTTPs connection should terminated at HAProxy.   Please see my post   HTTP