Author: AKN

Time based Dial Plans in Asterisk

Time based Dial Plans in Asterisk

Syntax: include => context|||| e.g: include = day,08:00-16:59,mon-fri,*,* ; First, let’s do the holidays include => holiday|*|*|1|jan include => holiday|*|*|31|may include => holiday|*|*|4|jul include => holiday|*|*|6|sep include => holiday|17:00-23:59|*|24|nov include => holiday|*|*|25|nov include =>...

Asterisk–Creating an Auto Attendant

Asterisk–Creating an Auto Attendant

Method One : using on/off service codes : Login with 111 and log out with 222 exten => *111,1,DBPUT(auto/attendant=1) exten => *222,1,DBPut(auto/attendant=0) Incoming calls- check if autoattendant is logged in, otherwise goto "auto" exten...

RPM Uninstall error–multiple matches

RPM Uninstall error–multiple matches

Sometimes when trying to uninstall an rpm package, you might get an error that says “Package xyz specifies multiple packages”. rpm -e unixODBC error: "unixODBC" specifies multiple packages In that case you can issue...

Accessing Microsoft SQL Database from Linux Boxes

Accessing Microsoft SQL Database from Linux Boxes

In order to use Linux & MSSQL with php , we need to install a TDS driver which is Tabular Data Stream Protocol. yum install freetds /usr/bin/tsql -S [mssql server name or ip] -U...

Export MySQL data to csv using php script

Export MySQL data to csv using php script

Here is a little php script that you can use to export MySQL data to CSV  : #!/usr/bin/php -q <?php include ‘config/config.php’; include ‘config/opendb.php’; $sql = "SQL Query goes here"; $rsSearchResults = mysql_query($sql); $out...

Import CSV file to database using PHP

Import CSV file to database using PHP

Below is the code snippet that will let you import CSV file into database using PHP : <?php # first get a mysql connection as per the FAQ $fcontents = file (‘./spreadsheet.xls’); # expects...

Export result of MySQL Query to CSV Format

Export result of MySQL Query to CSV Format

You can run the following query to output the results of a query to CSV Format : SELECT order_id,product_name,qty FROM orders INTO OUTFILE ‘/tmp/orders.csv’ FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘"’ LINES TERMINATED BY...