The Guru Of Tech - Gobind

Asterisk Insall, Codec Install, Vicidial Install.

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS.

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS

Vicidial, Asterisk, Web-MeetMe, MySQL, OTRS.

Saturday, September 22, 2012

Keeping putty idle sessions active.

Another frustrating problem is induced by the time-to-live of inactive or idle TCP sessions on firewall or switch configurations. At some companies this is put aggressively low so that TCP sessions that have no activity for 1 minute or even 30 seconds are being dropped. If you are using an SSH connection over such a network device, you have to take care to send keep-alive packets over your idle session.

To do this

go to Category: Connection and set Seconds between keepalives (0 to turn off) to 25.

You Are DONE!!

Friday, September 21, 2012

Guide to install Web-MeetMe. by Sunny Khetarpal

1. Download and extract Web-MeetMe gui in the root direcotry of your
Web Server (usually /var/www/). The actual version of the package is
1.3.3. Run :
wget http://www.fitawi.com/Asterisk/Web-MeetMe_v1.3.3.tgz
As root run:
cd /var/www/
mv Web-MeetMe_v1.3.3.tgz /var/www/
tar -xzf Web-MeetMe_v1.3.3.tgz
mv Web-MeetMe web-meetme (it's not necessary, if you do this you'll
have to edit the index.html file in the same folder in order to match
the address)


2. Edit the file Web-MeetMe/lib/defines.php in order to match the
configuration of your system ( database configuration). Here is an
example of the configurable part of the file with some comment.

define ("WEBROOT", "http://192.168.0.1/");
// IP address of you asterisk server
define ("FSROOT", "/var/www/Web-MeetMe/");
// Absolute address of the folder where the package was extracted
define ("LIBDIR", FSROOT."lib/");
define ("HOST", "localhost");
// Server alias
define ("PORT", "3306");
// The standard port used by Asterisk is 3306
define ("USER", "root");
define ("PASS", "");
// Username and password of your database.
//Default password for mysql if it was installed by asterisk@home is
//passw0rd, otherwise the default password for root user in a normal
//mysql installation is empty ("").
// It's really dangerous use default password for an obvious security
//issue.
define ("DBNAME", "meetme");
// Database name. Don't change if you want to follow this guide.
define ("DB_TYPE", "mysql"); // mysql o postgres
//This guide is for mysql but can easily be adaptable to postgresql.
// Comment the following three lines if you don't want any kind of
// authentication (every user can handle or delete the conference of
// another user). The only authentication method supported by now is
// based on an Active Directory Server.
define ("AUTH_TYPE", "adLDAP"); // adLDAP or ""
define ("ADMIN_GROUP", "Domain Admins");
include (FSROOT."lib/".AUTH_TYPE.".php");
// In order to configure your Active Directory Server parameters you
// have to edit /lib/adLDAP.php
define ("DB_TABLECDR", "cdr");
define ("DB_TABLESCHED", "booking");
// Name of two tables used by the program. Don't change if you don't
//have any partucoular aim.

3. Download and compile app_cbmysql in /usr/src/asterisk/apps or
wherever you have the Asterisk source. Run as root:
cd /usr/src/asterisk/apps
wget http://www.fitawi.com/Asterisk/app_cbmysql.c
Edit the Makefile in that folder using the patch
www.fitawi.com/Asterisk/Makefile-cbmysql-patch.txt . Compile Asterisk
: run make install in the Asterisk source directory (not the
subdirectory apps!!!!). In this way you will compile only
app_cbmysql.c and not all the other parts of Asterisk.

Note: A comman error is: /usr/bin/ld: cannot find -lpq. You can avoid
this error installin the package postgresql-devel (or the equivalent
of your distribution). You have to install it even if you will use
mysql as database.

4. Create the database meetme and the table booking folling the file
www.fitawi.com/Asterisk/db-tables-v2.txt. Here is the sql code used to
create the table.

CREATE TABLE `booking` (
`bookId` INT( 11 ) DEFAULT NULL NOT NULL AUTO_INCREMENT ,
`clientId` INT( 11 ) DEFAULT '0' NOT NULL ,
`roomNo` VARCHAR( 30 ) DEFAULT '0' NOT NULL ,
`roomPass` VARCHAR( 30 ) DEFAULT '0' NOT NULL ,
`silPass` VARCHAR( 30 ) DEFAULT '0' NOT NULL ,
`startTime` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL ,
`endTime` DATETIME DEFAULT '0000-00-00 00:00:00',
`dateReq` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL ,
`dateMod` DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL ,
`maxUser` VARCHAR( 30 ) DEFAULT '10' NOT NULL ,
`status` VARCHAR( 30 ) DEFAULT 'A' NOT NULL ,
`confOwner` VARCHAR( 30 ) NOT NULL ,
`confDesc` VARCHAR( 30 ) NOT NULL ,
PRIMARY KEY ( `bookId` )
);


5. Download cbmysql.conf and copy it in /etc/asterisk. Run:
cd /etc/asterisk
wget http://www.fitawi.com/Asterisk/cbmysql.conf
Edit with your system parameters. A possible configuration is:
[global]
hostname=localhost
dbname=meetme
password=
user=root
port=3306
// database port, the same used in defines.php
sock=/var/run/mysqld/mysqld.sock
//Where the used socket is. Default path is ok for red hat flavour
while Debian (and his flavors like Ubuntu) has that file in
/var/run/mysqld/mysqld.sock
OptsAdm=dp
OptsUsr=dp
ConfApp=MeetMe
ConfAppCount=MeetMeCount

6. Edit /etc/asterisk/manager.conf
It's necessary to enable the global user and create the phpagi one if
it's not already present adding this code:
[phpagi]
secret = phpagi
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0

read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
It's dangerous to leave default password (in every cas). In order to
chacge it you have to use the same password in manager.conf and in
phpagi.conf in /etc/asterisk.
If that file not exist you have to create it editing
phpagi.example.conf in ../Web-MeetMe/phpagi/ .

7. Edit extensions.conf. You can add:
exten => 8600,1,Answer
exten => 8600,2,Wait(1)
exten => 8600,3,CBMysql()
exten => 8600,4,Hangup

8. Check if you have "register_globals = On" in php.ini and the line
"extension=mysql.so" have to be not commented.

9.Reload Asterisk.

Wednesday, September 12, 2012

How to delete all the files from the directory in PHP

<?PHP

emptyDir("/home/DIR_NAME/public_html");

FUNCTION emptyDir($path) {

// init the debug string
$debugStr = '';
$debugStr .= "DeletingContents Of: $path<br /><br />";

// parse the folder
IF ($handle = OPENDIR($path)) {

WHILE (FALSE !== ($file = READDIR($handle))) {

IF ($file != "." && $file != "..") {

// If it's a file, delete it
IF(IS_FILE($path."/".$file)) {

IF(UNLINK($path."/".$file)) {
$debugStr .= "Deleted File: ".$file."<br />";
}

} ELSE {

// It's a directory...
// crawl through the directory and delete the
contents
IF($handle2 = OPENDIR($path."/".$file)) {

WHILE (FALSE !== ($file2 = READDIR($handle2))) {

IF ($file2 != "." && $file2 != "..") {
IF(UNLINK($path."/".$file."/".$file2)) {
$debugStr .= "Deleted File:
$file/$file2<br />";
}
}

}

}

IF(RMDIR($path."/".$file)) {
$debugStr .= "Directory: ".$file."<br />";
}

}

}

}

}
RETURN $debugStr;
}