4 Ağustos 2012 Cumartesi

Asterisk and AMI

ERROR[5534]: utils.c:1211 ast_careful_fwrite: fwrite() returned error: Broken pipe

When ever i used the php script to send commands to asterisk, i got this error..

"The Big Problem"!! was the timeout value i used;

Solution:

This line;
$this->socket = @fsockopen("127.0.0.1","5038", $errno, $errstr, 1);
is changed into this;
$this->socket = @fsockopen("127.0.0.1","5038", $errno, $errstr, 30);

Problem solved..

3 Ağustos 2012 Cuma

Centos 6 and Asterisk

----------------Errors----------------

No DAHDI found. Unable to open /dev/dahdi/ctl: No such file or directory

DAHDI Tools Version - 2.1.0.2
Notice: Configuration file is /etc/dahdi/system.conf
line 0: Unable to open master device '/dev/dahdi/ctl'


---------------Solution---------------
Try using Atrpms by doing

wget http://packages.atrpms.net/RPM-GPG-KEY.atrpms
rpm --import RPM-GPG-KEY.atrpms

After that;
yum install dahdi-linux

31 Temmuz 2012 Salı

Mysql

mysql -p

28 Temmuz 2012 Cumartesi

yum install asterisk-voicemail

Centos 6 and Asterisk

Asterisk can be installed with Add/Remove Software. But when I did so and started it with the command;

service asterisk start

I wanted to use the Graphical User Interface of Asterisk and surprisingly!! dumped into trouble again..

Asterisk Gui also can be loaded by add/remove. Time to configure..

1) /etc/asterisk/http.conf

enabled=yes
bindaddr=0.0.0.0
bindport=8088
enablestatic=yes
redirect = / /static/config/index.html


2) /etc/asterisk/manager.conf

[general]
enabled = yes
webenabled = yes


[administrator]
secret = password
allow=0.0.0.0/0.0.0.0
read = system,call,log,verbose,command,agent,user,config
write = system,call,log,verbose,command,agent,user,config

3) From wiki.asterisk ;
chown -R asterisk:asterisk /etc/asterisk/ /var/lib/asterisk /usr/share/asterisk
chmod 644 /etc/asterisk/*

and

ls /var/lib/asterisk/static-http/config && rm -rf /usr/share/asterisk/static-http && ln -s /var/lib/asterisk/static-http /usr/share/asterisk/static-http
And finally got asterisk's web interface..

27 Temmuz 2012 Cuma

Centos Php Mcrypt

First get the epel repository. To do this go to the page fedoraproject.org and choose the epel-release under the header "How can I use these extra packages?".

After that, download the package to a location you like. Open command line, get into the directory that you just placed the new rpm.

rpm -i epel-release*.rpm

This will add the epel repository. Next step is to let yum install what we need..

yum install php-mcrypt

And restart your apache..

This has done the trick in my centos..

26 Temmuz 2012 Perşembe

vsftpd and centos 6 configuration..

I didnt want to use home directory because i would be uploading files to var/www/html folder. But i wanted to lock the user to his/her home directory at the same time. Solution:

1) vsftp.conf configuration
local_enable=YES
wite_enable=YES
ascii_upload_enable=YES
ascii_download_enable=YES
chroot_local_user=YES
than save the file..

2) Create a folder in your home dir
mkdir /home/umut/www

3) Bind the real www to the one in your home dir.
mount --bind /var/www/html/ /home/umut/www

{
if you want to (and possibly want to..) create a permanent binding add a line under the /etc/fstab;

/var/www/html  /home/umut/www    none    bind    0       0
}

4) If you have selinux;
setsebool -P ftp_home_dir=1

5)  Restart vsftpd
service vsftpd restart

6) If there are writing problems in www than right click on the /var/www/html and select "user data" in selinux area..

for further information:
http://www.ducea.com/2006/07/27/allowing-ftp-access-to-files-outside-the-home-directory-chroot/