login | register
Tue 02 of Dec, 2008 [03:14 UTC]

voip-info.org

AreskiCC CallingCard Application The idiots guide

Created by: terchris,Last modification on Thu 27 of Oct, 2005 [15:00 UTC] by areski


IMPORTANT : The new version of AreskiCC have changed his name -> "A2Billing"

Please for a followup of the project go to the appropriate pages :








The idiots guide to installing AreskiCC CallingCard Application
This guide is for those who have no knowledge of Areski, postgres and hardly any knowledge of Linux.
I wrote it because I had to figure out the hard way. If you want to test AreskiCC, but have no idea on how to do so then this guide is for you.

To have a common starting point I start after the installation of Asterisk at Home version 0.6. This gives you a Linux system and a running Asterisk server.
I assume that you run all commands as the root user (the Linux gurus will tell you that you should avoid using the root user. But this guide is not for them)

If you have questions that you are afraid to ask then remember �There are no stupid questions, just stupid answers�

terchris 31Jul05 There is a version 2 of the Idiots's guide created by gsummey AreskiCC CallingCard Application The idiots guideV2


The information I'm missing is marked (==> ... ) Please update if you know how.

Install Areski

1) Install postgres sql server.
Postgres is not installed so you must install it yourself. Type:
yum install rh-postgresql-server
You will get output like this:
�
I will do the following:
[ install: rh-postgresql-server 7.3.9-2.i386 ]
I will install/upgrade these to satisfy the dependencies:
[deps: rh-postgresql 7.3.9-2.i386]
[deps: rh-postgresql-libs 7.3.9-2.i386]
Is this ok [y/N]: y
�
Installed: rh-postgresql-server 7.3.9-2.i386
Dep Installed: rh-postgresql 7.3.9-2.i386 rh-postgresql-libs 7.3.9-2.i386
Transaction(s) Complete

2) Install php-pgsql
Areski needs php-pgsql and you install it by typing:
 yum install php-pgsql
You will get output like this:
...
[install: php-pgsql 4.3.2-19.ent.i386]
Is this ok [y/N]: y
..
Installed: php-pgsql 4.3.2-19.ent.i386
Transaction(s) Complete


3) download Areski source

3.1 Create a temporary install dir
mkdir /usr/src/areski
and move to the newly created dir.
cd /usr/src/areski

3.2 Download the source
Copy and paste line by line to the commend line and press enter
wget http://areski.net/areskicc-doc/Areski_AGI_v1.1.tar.gz
wget http://areski.net/areskicc-doc/AreskiCC_UI_v1.1.tar.gz
wget http://areski.net/areskicc-doc/AreskiCC.psql

3.3 unpack the source
Copy and paste line by line to the commend line and press enter
tar -zxvf Areski_AGI_v1.1.tar.gz
tar -zxvf AreskiCC_UI_v1.1.tar.gz

4) The instructions for installing AreskiCC is not written for people like us.
I comment each step so that it is possible to do for us idiots.
The install file is in /usr/src/areski/Areski_AGI/INSTALL.txt
You open the file by using the vi editor. Type
vi /usr/src/areski/Areski_AGI/INSTALL.txt
(to get out of vi hit Esc and type q! at the : prompt)

I repeat the steps installation guide here with full path related to where the software is downloaded.

4.1 Place the entire content directory into your agi-bin directory.
cp /usr/src/areski/Areski_AGI/areskicc.php /var/lib/asterisk/agi-bin/.
cp -r /usr/src/areski/Areski_AGI/libs_areskcc/phpagi /var/lib/asterisk/agi-bin/.
cp -r /usr/src/areski/Areski_AGI/libs_areskcc/db_php_lib /var/lib/asterisk/agi-bin/.

4.2 Make sure the script is runnable
chmod +x /var/lib/asterisk/agi-bin/areskicc.php

4.3 (step is missing in INSATLL.txt I left it to have the same numbering)


4.4. Copy the sounds files
cp -r /usr/src/areski/Areski_AGI/sounds/* /var/lib/asterisk/sounds/.
You will get a overwrite message. Answer y and hit enter
cp: overwrite `/var/lib/asterisk/sounds/./vm-and.gsm'? y
cp: overwrite `/var/lib/asterisk/sounds/./vm-goodbye.gsm'? y

4.5. Create a Database use DB_areskicc.psql for postgres
a) The database is not started automatically. Start it by typing
/etc/init.d/rhdb start
You should see this output:
Initializing database: [ OK ]
Starting PostgreSQL - Red Hat Edition service: [ OK ]

(==>how to start it at boot time? If someone knows then please insert this important part)
With Redhat usually one would use: chkconfig
Example: chkconfig rhdb on

With Gentoo:
rc-update add servicenamegoeshere default

b) verify that the database is running
Log in as postgres user by typing
su - postgres
you will get this prompt:
-bash-2.05b$
create a database by typing
createdb mydb
you should get this output:
CREATE DATABASE
delete the database by typing
dropdb mydb
You shoud get this output:
DROP DATABASE
type exit to return to root user



c) Install the database from the DB_areskicc.psql file

Try this (and sorry for my english(Gool)):
4.5.1) Add NEW user with username ... (user1 sample)
postgres@asterisk:/etc/asterisk$ createuser -W
4.5.2) Login to any existing database and check is it user added
4.5.2.a) login
postgres@asterisk:/etc/asterisk$ psql -d mydb (where mydb is database from 4.5.b)
4.5.2.b) Check
mydb=# \du
4.5.2.b.1) Sample output:
List of database users
User name | User ID |         Attributes

user1     |     100 |
postgres |       1  | superuser, create database
(2 rows)
4.5.3) Ok, user added, now we must set user attributes:
4.5.3.a)mydb=# ALTER USER user1 CREATEDB;
(note, thet symbol ; MUST BE at the end of command)
4.5.3.b) Check user atributes:
  mydb=# \du
4.5.3.b.1) Sample output:
List of database users
User name | User ID |         Attributes

user1     |     100 |create database
postgres |       1  | superuser, create database
(2 rows)

4.5.4) Exit from database
(type "\q")
and create NEW database "areskicc2" for user user1
  postgres@asterisk:/etc/asterisk$ psql -d areskicc2 -U user1
4.5.4.1) check is it ok
login to database:
   postgres@asterisk:/etc/asterisk$ psql -d areskicc2
type
   areskicc2=# \l+
Sample output
List of databases
  Name    |  Owner   | Encoding  |        Description

areskicc2  | user1     | SQL_ASCII |
template1 | postgres | SQL_ASCII | Default template database
(2 rows)
Now exit from DB (type "\q")
4.5.5) Import data from AreskiCC.psql to database areskicc2
psql -d areskicc2 -f /usr/src/areski/AreskiCC.psql
4.5.5.1) check is it ok
psql -d areskicc2
areskicc2=# \dt
Sample output:
           List of relations
Schema |        Name         | Type  |  Owner

public | call                | table | postgres
public | callerid            | table | postgres
public | card                | table | postgres
public | country             | table | postgres
public | countryprefix       | table | postgres
public | internationalprefix | table | postgres
public | logpayment          | table | postgres
public | logrefill           | table | postgres
public | provider            | table | postgres
public | providerdestination | table | postgres
public | providerrate        | table | postgres
public | reseller            | table | postgres
public | resellercard        | table | postgres
public | sale                | table | postgres
public | tariff              | table | postgres
public | tariffrate          | table | postgres
public | trunk               | table | postgres
public | ui_authen           | table | postgres
(18 rows)

4.5.5.2 Now ALL is ok. Try login to You database areskicc2 with your username
(first you must exit from db, type "\q") :)

postgres@asterisk:/etc/asterisk$ psql -d areskicc2 -U user1

If you have errors "cant connect / bad autorisation ...." try edit postgres config file:
root@asterisk:# vi /etc/postgresql/pg_hba.conf
(in my system i'm add string
local areskicc2 user1 trust)
Beware to add this rule as the first one! Otherwise an other rule could be applied and will reject your authentication.
Don't forgot restart postgres daemon after change postgres config:
root@asterisk:/etc/init.d# ./postgresql restart

Now drink some beer (or tea) and GO TO p. 4.6 (:biggrin:)
Regards, Gool.


d) Test that the database is imported
Do a select * from <tablename> �
(==> I�ll write this when I have got info on how to import the database.)

"#> su postgres
%> psql -U chosen_username -W chosen_database -f database_file.sql
"

4.6. Setup your Database into the application
Edit db_php_lib/defines.php files
vi /var/lib/asterisk/agi-bin/db_php_lib/defines.php
The file looks like this:

               define ("HOST", "localhost");
               define ("PORT", "5432");
               define ("USER", "areski");
               define ("PASS", "areski");
               define ("DBNAME", "areskicc2");
               define ("DB_TYPE", "postgres");         // mysql or postgres

               define ("FSROOT", "/var/lib/asterisk/agi-bin/");

               define ("LIBDIR", FSROOT."db_php_lib/");

               define ("LEN_CARDNUMBER", "10");        //lenght of the cardnumber (amount of digits)

Since we are just going to get the thing up and running we leave the file as is.

4.7 Setup the callingcard application into Asterisk
       Edit extension.conf (/etc/asterisk/extension.conf)
       Add the following link to the appropriate context

       ; CallingCard application
       exten => _X.,1,Answer
       exten => _X.,2,Wait,2
       exten => _X.,3,DeadAGI,areskicc.php
       exten => _X.,4,Wait,2
       exten => _X.,5,Hangup
(==>I have not yet figured out where this should go so that AMP is not messed up)

4.8 RELOAD ASTERISK
You do this by typing
asterisk ï¿½rvv
On the CLI prompt you type reload
To exit type exit


5 Test it
Dial .. and ...
(==> missing)

6 Installation of the web interface
The web interface is downloaded into /usr/src/areski/AreskiCC_UI
Go there by typing
cd /usr/src/areski/AreskiCC_UI

6.1 Copy the files so that the web server can get to them
Create directory for Aresikicc by typing:
mkdir /var/www/html/areskicc
Copy by typing
cp -r * /var/www/html/areskicc

6.2 Ensure that you have create the Database AreskiCC.psql (for postgres)
We did this is step 5. so we don�t need to do it again.

6.3 Setup your Database into the application
We did not change the file in 4.6 so we can skip this as well.

6.4 Modify php.ini !!
Important step : modify the file php.ini (usually in /etc/... ) and find the line
"register_globals = Off"
and set it at
"register_globals = On"

If you skip this step, you won't see anything except "logout" after the login page, whatever login/password you type in.

6.5 Have fun :D
This part we will not skip.

7. Testing the system
(==> missing)


Comments

Comments Filter
222

333Re : Areski Calling Card Software on Asteriskathome 9 GUI Login errors :(

by cosmocid, Thursday 17 of January, 2008 [08:57:25 UTC]
It worked perfect...
222

333config Areski and Cisco

by areacodeman, Saturday 10 of September, 2005 [08:31:11 UTC]
I have a cisco AS5300 with 4 E1cards then i want to use Asterisk for a calling card solution. I will receive the calls from the costumers and E1 connected to the CISCO asterisk will be used only as the calling card solution, then after billing check, PINcode check the calls will be forwarded over the internet by the CISCO to be terminated.
How do i have to configure the CISCO and Asterisk?
Thanks for your help
222

333postgresql database creaton??????

by tafilaj, Saturday 04 of June, 2005 [02:12:33 UTC]
can someone pls explain how tha database is created as by defauld the posgres does not alowe creating databases in a apsolute path.

and

A BIG PLEASE TO CHAMMOUD

could you explain how did you instal areskicc as many of us are having problems.
this would hellp so much for everyone.

thank you
222

333Problems at GUI Login Page

by iaxbox, Wednesday 11 of May, 2005 [20:05:34 UTC]
When I try to login using the username and password existing for Postgresql database users, I get the following error.

Warning: pg_pconnect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host localhost and accepting TCP/IP connections on port 5432? . in /var/www/html/areskicc/lib/DB-modules/phplib_postgres.php on line 66
Database error: Link-ID == false, pconnect failed
PostgreSQL Error: 0 ()

Warning: pg_pconnect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host localhost and accepting TCP/IP connections on port 5432? . in /var/www/html/areskicc/lib/DB-modules/phplib_postgres.php on line 66
Database error: Link-ID == false, pconnect failed
PostgreSQL Error: 0 ()

Warning: pg_errormessage(): supplied argument is not a valid PostgreSQL link resource in /var/www/html/areskicc/lib/DB-modules/phplib_postgres.php on line 99

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/areskicc/lib/DB-modules/phplib_postgres.php:66) in /var/www/html/areskicc/lib/module.access.php on line 66

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/areskicc/lib/DB-modules/phplib_postgres.php:66) in /var/www/html/areskicc/lib/module.access.php on line 67


Any clues?

Seshu Kanuri
222

333Re: Re : Areski Calling Card Software on Asteriskathome 9 GUI Login errors :(

by Kuehner, Monday 09 of May, 2005 [20:07:16 UTC]
You have to be sure that in defines.php the FSROOT is set correctly. In my file there were two lines... I deleted the uncommented one and uncommented the other. Make sure that the path is the path of the areskicc-UI (eg. /var/www/areskicc/) is correctly.

That was your error. Now I have another problem: When I want to make a login, the module.access.php wants to send a request which is like this:

SELECT userID, perms, confaddcust, groupID, a FROM secauth WHERE login = test AND password = test

(´secauth´ I changed to secauth)

...but in my psql-database there isn't a table called secauth.

Any hints?

Sebastian Kühner
222

333Areski Calling Card Software on Asteriskathome 9 GUI Login errors :(

by MartinO'Shield, Monday 18 of April, 2005 [21:44:27 UTC]

I followed the directions above thanks to Areski, terchris, and Gool,
(thanks alot to Gool!!!), for installing the Areski Calling Card platform on
AsteriskatHome 9, and get the following errors after I log into the Areski GUI:


Warning: main(/var/www/html/all/Open_AreskiCC/AreskiCC_UI/lib/DB-modules/phplib_postgres.php): failed to open stream: No such file or directory in /var/www/html/areskicc/lib/defines.php on line 32

Warning: main(): Failed opening '/var/www/html/all/Open_AreskiCC/AreskiCC_UI/lib/DB-modules/phplib_postgres.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/areskicc/lib/defines.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/areskicc/lib/defines.php:32) in /var/www/html/areskicc/lib/module.access.php on line 43

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/areskicc/lib/defines.php:32) in /var/www/html/areskicc/lib/module.access.php on line 45

Fatal error: Cannot instantiate non-existent class: db_sql in /var/www/html/areskicc/lib/defines.php on line 40

If canyone can assist, I would greatly appreaciate it!! :)

Sincerely,

Martin O'Shield
1-877-238-5956

222

333I need a Calling Card Platform to Handel 500 - 1000 simultaneous calls per week

by MartinO'Shield, Saturday 26 of March, 2005 [16:30:25 UTC]
Hello,


I am interested in using the AreskiCC software to handel between
500 - 1000 calling cards per week.

Has anyone done this using this software?

I will be building the boxes myself - maybey some Dual Xeon Processors, or AMD Sim processors which are the equal, 1 - 2 gig ram per box, and mabey a 100 gig harddrive in each.


Sincerely,

Martin O'Shield
1-877-238-5956
martinOshield@yahoo.com

222

333Re: Re: Re: still don't know how to use AreskiCC

by chammoud, Tuesday 22 of March, 2005 [22:49:29 UTC]
you can import thr database Areskicc.psq by executing psql namedb
222

333Re: Re: still don't know how to use AreskiCC

by chammoud, Monday 21 of March, 2005 [15:13:59 UTC]
I e-mailed areski, the AreskiCC owner, and he surprisingly answered me back within three hours. But the answer was still unsatisfactory. Here is the main point:

"Anyway now just define with IAX.conf or SIP.conf
the entries of your caller (can be from pstn or sip/iax friends)
and define the appropriate context where you setup
the callingcard (extensions.conf)" Areski

i e-mailed him again to walk me through a process of setting-up one calling card configuration and i hope he e-mails me again. i created a database DB_AreskiCC.psql and created a calling card in TABLE card as i followed the AreskiCC_DB example.

it might help if you visit www.areski.net and ask him to post some helpful notes on this site you created. he even listed his phone number. i might give him a call lwhen ii become hopeless.



222

333Re: still don't know how to use AreskiCC

by terchris, Sunday 20 of March, 2005 [15:57:37 UTC]
Then we are in the same boat. I have not figured out how to make AreskiCC work myself. I decided to make it work and make The Idiots guide as I did it myself. I have not managed to get it working myself yet. But when I do I will update. I did put a guide that was not fully working because I wanted people like you to comment and put your knowledge into it. This so that we together created the Idiots guide.