Monday, June 23, 2008

Asterisk Web Frontend - VoiceOne on Ubuntu 8.04

----------------------------------------
Pre-requisites

# Install VoiceOne with it's Documentation #####
$ sudo apt-get install apache2 apache2-doc

# Start Apache (it's probably already started) #####
$ sudo /etc/init.d/apache2 start



# Testar o Apache #####

Type on Mozilla Firefox: http://127.0.0.1/
It should read: It works!

Nota: The web page with the message It works!" is on the
/var/www directorie, wich is apache's root directorie,
this is were we are going to install voiceone.



# Install MySQL #####

$ sudo apt-get install mysql-server mysql-client
Type MySQL the following password: voiceone, in the textbox
that will be presented to you in the bash shell.



# Install the needed packages #####


$ sudo apt-get update
$ sudo apt-get install sox madplay php5-cgi php-pear asterisk-mysql

$ sudo apt-get install php5 php5-cli php5-common php5-dev
$ sudo apt-get install libapache2-mod-php5
$ sudo apt-get install php5-mhash php5-mysql php5-odbc


Check that asterisk starts correctly by /etc/init.d/asterisk start followed by asterisk -r. The remote connection will complain if asterisk hasn’t started properly. Check /var/log/asterisk/messages.log for errors to resolve. You only need Asterisk to run and respond. Don't worry about configuration files yet.

Disable magic quotes in php.ini located in:

/etc/php5/apache2/php.ini
/etc/php5/cgi/php.ini
/etc/php5/cli/php.ini

magic_quotes_gpc = Off



# Create a Database the VoiceOne Database on MySql:

$ mysql -u root -p

mysql> create database voiceone;



# Unpack voiceone 0.6.1 into /var/www directory #####

$ cd /var/www
$ sudo tar xvfz /path_to_voiceone_tar_gz/voiceone-0.6.1.tar.gz



# Using visudo add the following line to the end of /etc/sudoers: #####

$ sudo visudo

www-data ALL=NOPASSWD: /var/www/voiceone_webservices/config/script/vo-tools.sh

Or

$ sudo pico /etc/sudoers

www-data ALL=NOPASSWD: /var/www/voiceone_webservices/config/script/vo-tools.sh



# Edit /etc/asterisk/modules.conf file using gedit (or other):

$ sudo gedit /etc/asterisk/modules.conf


- and add this line immediately after: #####

;preload => res_config_odbc.so
preload => res_config_mysql.so



# Create a fresh /etc/asterisk/extconfig.conf file using gedit (or other):

$ sudo gedit /etc/asterisk/extconfig.conf

- containing:

[settings]
agents.conf => mysql,voiceone,ast_config
extensions.conf => mysql,voiceone,ast_config
;iax.conf => mysql,voiceone,ast_config
meetme.conf => mysql,voiceone,ast_config
;misdn.conf => mysql,voiceone,ast_config
musiconhold.conf => mysql,voiceone,ast_config
queues.conf => mysql,voiceone,ast_config
sip.conf => mysql,voiceone,ast_config
zapata.conf => mysql,voiceone,ast_config
;iaxusers => mysql,voiceone,iax_buddies
;iaxpeers => mysql,voiceone,iax_buddies
sipusers => mysql,voiceone,sip_buddies
sippeers => mysql,voiceone,sip_buddies
voicemail => mysql,voiceone,voicemail_users
extensions => mysql,voiceone,extensions_table



# Create /etc/asterisk/res_mysql.conf using gedit

$ sudo gedit /etc/asterisk/res_mysql.conf

- file containing:

[general]
dbhost = localhost
dbname = voiceone
dbuser = root
dbpass = voiceone
dbport = 3306
dbsock = /var/run/mysqld/mysqld.sock



# Create /etc/asterisk/cdr_mysql.conf using gedit (or other)

$ sudo gedit /etc/asterisk/cdr_mysql.conf

- file containing:

[global]
hostname=localhost
dbname=voiceone
table=cdr
user=root
password=voiceone
port=3306
sock=/var/run/mysqld/mysqld.sock
userfield=1



# Edit /etc/asterisk/manager.conf using gedit (or other)

$ sudo gedit /etc/asterisk/manager.conf

- and ensure these three lines are included:

[general]
enabled=yes
#include "manager.d/*.conf"



# Create /etc/asterisk/manager.d/voiceone.conf using gedit (or other)

$ sudo mkdir /etc/asterisk/manager.d/

$ sudo gedit /etc/asterisk/manager.d/voiceone.conf

- containing

[admin]
secret=qwerty_123_mnbvc
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



# Rename both config.inc.php.default in DOCUMENT_ROOT/voiceone/admin/config and DOCUMENT_ROOT/voiceone_webservices/config in config.inc.php (i.e. config.inc.php.default -> config.inc.php), using the following comands:


$ sudo rm -rf /var/www/voiceone/admin/config/config.inc.php

- rename
$ sudo mv /var/www/voiceone/admin/config/config.inc.php.default /var/www/voiceone/admin/config/config.inc.php


$ sudo rm -rf /var/www/voiceone_webservices/admin/config.inc.php

- rename
$ sudo mv /var/www/voiceone_webservices/config/config.inc.php.default /var/www/voiceone_webservices/config/config.inc.php



# Edit /var/www/voiceone/admin/config/config.inc.php using gedit (or other)

$ sudo gedit /var/www/voiceone/admin/config/config.inc.php

- and change $soapUsername and $soapHostname to the following:

$soapUsername = "root";
$soapHostname = "localhost";


# Edit /var/www/voiceone_webservices/config/config.inc.php using gedit (or other)

$ sudo gedit /var/www/voiceone_webservices/config/config.inc.php

- and change the following to match:

//Mysql ACCOUNT
$synDBHost = "localhost";
$synDBUser = "root";
$synDBPassword = "voiceone";
$synDBName = "voiceone";


# Enter the following sequence to finish off permissions & paths:

$ cd /var/www
$ sudo chown www-data voiceone -R
$ sudo chown www-data voiceone_webservices -R
$ sudo chmod 777 voiceone/sandbox -R
$ sudo chmod 777 voiceone/admin/public/template/cache -R
$ sudo chmod 755 voiceone_webservices/config/script/vo-tools.sh
$ sudo chmod 777 voiceone_webservices/utility/provisioning/firmware/data
$ sudo ln -s /usr/share/asterisk /var/lib/asterisk
$ sudo ln -s /usr/share/asterisk/moh /usr/share/asterisk/mohmp3
$ sudo mkdir /usr/share/asterisk/moh/voiceone
$ sudo mkdir /usr/share/asterisk/moh/voiceone/default




# Restart Apache #####

$ sudo /etc/init.d/apache2 restart



# Delete Apache's Test Webpage #####

$ sudo rm -rf /var/www/index.html



# Configure VoiceOne #####

Type on Mozilla Firefox:
http://127.0.0.1/voiceone/setup.php
and follow the presented voiceone instructions.
.


# Using VoiceOne

Type on Mozilla Firefox:
http://127.0.0.1/voiceone/index.php
to use Voiceone

And that's it you are ready to rumble.

Sunday, June 15, 2008

gXine Error - No demuxer found - stream format not recognized

Just installed Ubuntu 8.04 LTS - Hardy Heron and tried to watch a movie on DVD with gxine (libdvdcss2 is installed). This is the resulting error message:

The xine engine failed to start.
No demuxer found - stream format not recognized.


I fixed it by installing the following in the Synaptic Package Manager: -

libxine1-ffmpeg

or just type on the bash shell:

$ apt-get install libxine1-ffmpeg


And thats it.




Taken from: http://ubuntuforums.org/showthread.php?t=461442

Monday, June 2, 2008

Build Essentials - Develop C/C++ in Ubuntu

If you want to develop in C or C++ you have to install the basic packages that include among other things the C/C++ standard libraries, otherwise you migth have the C/C++ compiler (gcc/g++) and you are getting compile errors.


To install these basic C/C++ developement packages just do:

$ sudo apt-get install build-essential


To test it, just save the C code below in a file like "hello.c"


#include

main()
{
printf ("Hello World!\n");
}


now then compile it:

$ gcc hello.c


and run it:

$ ./a.out

it shoul print "Hello World!"


And thats it you are ready to start developing C/C++ in Ubuntu.

Wednesday, May 21, 2008

VTiger CRM 5.0.4 on Ubuntu 8.04 (Hardy Heron)

VTiger CRM 5.0.4 HOWTO


# Install Apache with its Documentation #####
$ sudo apt-get install apache2 apache2-doc



# Start Apache (which probably is already installed) #####
$ sudo /etc/init.d/apache2 start



# Test Apache #####

Type on Mozilla Firefox: http://127.0.0.1/
It should show: It works!
It may show something else, like something saying apache and
with the apache logo.

Note: The web page with the message "Iy works!" is in the
"/var/www" directorie, which is apaches root directory, and
is the directory where we will put VTiger CRM



# Download and Extract the VTiger CRM source #####

Download the VTiger CRM source at: http://heanet.dl.sourceforge.net/sourceforge/vtigercrm/vtigercrm-5.0.4.tar.gz

$ cd /path_were_the_vtiguer_source_is

$ tar zxvf vtigercrm-5.0.4.tar.gz



# Install the MySQL, PHP and Apache needed dependencies #####

$ sudo apt-get install mysql-server mysql-client
# Type in the MySQL password in the text box bash that will apear on the bash shell

$ sudo apt-get install libapache2-mod-php5 libapache2-mod-perl2

$ sudo apt-get install php5 php5-cli php5-common php5-curl php5-dev php5-gd php5-imap php5-ldap

$ sudo apt-get install php5-mhash php5-mysql php5-odbc curl libwww-perl imagemagick



# Install VTiger on Apache #####

$ cd vtigercrm/

# Copy VTiger CRM to the /var/www dir (apache root dir) #####
$ sudo cp -vr * /var/www


# Change the VTiger CRM owner to the Apache owner so that #####
# Apache, can modify these when needed #####

$ sudo chown www-data -vR /var/www



# Delete the Apache test page #####

$ sudo rm -rf /var/www/index.html



# Restart Apache #####

$ sudo /etc/init.d/apache2 restart



# Configurar o Vtiger #####

Open Mozilla Firefox:
http://127.0.0.1/ or http://127.0.0.1/install.php
Now folow the instructions shown on the open page,
and configure the VTiguer CRM, and thats it.

Saturday, May 17, 2008

No sound on ASUS F3SC laptop with Ubuntu 7.04 or 8.04

Hi, thought I should share my problem - and the solution with the forum.

I assume, that you have checked that the speakers are not muted- OK - read on:


WARNING:
I'm a low-tech no-good son-of-a-newbie (have been for 7 years - the learning curve is steeeeeep) ... so please don't ask me a lot of hard questions: I got sound -> I'm happy!


PROBLEM:
No sound after installing Ubuntu 7.10 (Gutsy Gibbon) on new ASUS F3SC laptop.

HARDWARE AND SOFTWARE DETAILS:

Kernel version:
Code:
jospan@discworld:~$ uname -r
2.6.22-14-generic
ALSA version:
Code:
jospan@discworld:~$ cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.14 (Thu May 31 09:03:25 2007 UTC).
The sound card:
Code:
jospan@discworld:~$ lspci -v | grep Audio
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
The chipset on the sound card:
Code:
jospan@discworld:~$ cat /proc/asound/card0/codec#0 | grep Codec
Codec: Realtek ALC660-VD
Loaded sound driver:
Code:
jospan@discworld:~$ cat /proc/asound/modules
0 snd_hda_intel

SOLUTION:

Add the following line:
Code:
options snd-hda-intel model=lenovo
to the file /etc/modprobe.d/alsa-base (create the file if it does not exist)
..and yes: I know it says 'lenovo' and yes: I know my laptop is an ASUS!

Reboot and rejoice to the sound of the Ubuntu opening fanfare

Still no sound? - have you checked again that the speakers aren't muted? - Yes? - sorry, can't help you then...I'm the low-tech no-good son-of-newbie, remember?

By the way: I have also confirmed this solution when using Ubuntu 8.04 LTS (Hardy Heron) (ALSA driver 1.0.16) on the ASUS F3SC.



Taken From: http://ubuntuforums.org/showthread.php?t=728497

Tuesday, February 5, 2008

Environment Variables

LINUX BASICS

How Do I Set and Use Linux Environment Variables?

Environment Variables

Environment variables in the bash shell help you in several ways. Certain built-in variables change the shell in ways that make your life a little easier, and you can define other variables to suit your own purposes. Here are some examples of built-in s hell variables:


· PS1 defines the shell's command-line prompt.

· HOME defines the home directory for a user.

· PATH defines a list of directories to search through when looking for a command to execute.

To list the current values of all environment variables, issue the command

env

or list a specific variable with the echo command, prefixing the variable n ame with a dollar sign (the second line shows the result of the echo command):

echo $HOME
/home/hermie

You've already learned how to customize your shell prompt with the PS1 variable. The HOME variable is one you shouldn't mess with, because lots of programs count on it to create or find files in your personal home directory.

Understanding the Path Variable

As in DOS, the shell uses the PATH variable to locate a command. PATH contains a list of dir ectories separated by colons:

echo $PATH
/bin:/usr/bin:/usr/local/bin

When you enter a command, the shell looks in each of the directories specified in PATH to try to find it. If it can't find the command in any of those directories, you'll see a "Command not found" message.

If you decide to put your own programs in a bin directory under your home directory, you'll have to modify the path to include that directory, or the system will never find your programs (unless you happen to be in that directory when you enter the command). Here's how to change your PATH variable so it includes your personal bin directory:

PATH=$PATH:$HOME/bin

So if PATH was set to /bin:/usr/bin:/usr/local/bin beforehand, it would now have the value /bin:/usr/bin:/usr/local/bin:/home/hermie/bin.

Creating Your Own Shell Variables

If you are a programmer, you'll find it handy to create your own shell variables. First issue the command

code=$HOME/projects/src/spew

and then, regardless of what directory you are in, you can issue

cd $code

to pop over quickly to the directory containing the source code for that way-cool spew program you're developing. (The cd command means "change directory.")

A variable assignment like this will work just fine, but its scope (visibility) is limited to the current shell. If you launch a program or enter another shell, that child task will not know about your environment variables unless you export them first.

Unless you know for sure that an environment variable will have meaning only in the current shell, it's a good idea to always use export when creating variables to ensure they will be global in scope--for example,

export PS1="\u \$ "
export code=$HOME/projects/src/spew

And be sure to add these commands to your .profile file so you won't have to retype them eac h time you log in.


Taken from:
http://lowfatlinux.com/linux-environment-variables.html


Instead of using export to define the variables and to make them permanent, i think you can define these in the file /etc/environment.




Wednesday, November 28, 2007

How To Play RMVB (Real Media) in Mplayer

Mplayer by default doesn't play *.rmvb files, which are real player files, probably because the codecs are proprietary and because of that they can't be packed in the Mplayer basic codec pack.

Basically in this "how to" we are going to show how to add a additional pack of codecs (Windows codecs), in which the RMVB codec is included.

First off all, let's start by installing the Mplayer, using apt-get:

$ sudo apt-get install mplayer

Now that the mplayer is installed let's download the the pack, at:

ftp://opensys.linuxpackages.net/pub/Slackware-10.1/jay/mplayer/MPlayer_codecs-20050412-i686-1jto.tgz


Extract the MPlayer_codecs-20050412-i686-1jto.tgz like this:

$ mkdir /tmp/codecs
$ cd /tmp/codecs
$ tar -zxvf /.../MPlayer_codecs-20050412-i686-1jto.tgz

Now we have all the extracted content of MPlayer_codecs-20050412-i686-1jto.tgz in /tmp/codecs.

The next step is to copy the codecs to the rigth place, so that Mplayer can use them,
that place is the directory /usr/lib/win32 (which probably doesn't exist). To do that just do like this:


$ sudo mkdir /usr/lib/win32
$ sudo cp /tmp/codecs/usr/lib/codecs/* /usr/lib/win32

And that's it, now you can play RMVB files along with many others.

Just one more thing, cleaning up the extracted codecs:

$ sudo rm -rf /tmp/codecs

All set! Enjoy :)