Author Topic: Using Call Accounting Mate with Asterisk - Must read  (Read 53651 times)

Administrator

  • Administrator
  • Super User
  • *****
  • Offline Offline
  • Posts: 171
    • View Profile
Using Call Accounting Mate with Asterisk - Must read
« on: April 07, 2005, 08:14:53 AM »
*** NOTE:  CAM now recommends connectivity to Asterisk using ODBC.  You can find step by step instructions in our CAM Startup and Installation Guide available in our download page ****

http://www.callaccounting.ws/download.htm








This  post  contains instructions on how to interface the CDR of Asterisk with Call Accounting
Mate. It is assumed that you are familiar with Asterisk and Linux in general. You should also have
a Windows machine already installed with Call Accounting Mate. You can download the latest copy of
Call Accounting Mate from www.callaccounting.ws .

To enable Asterisk to be used with Call Accounting Mate an Asterisk module needs to be loaded on the
Asterisk server. Call Accounting Mate ships with the module source files needed to create the Asterisk
loadable module. It also contains the Red Hat binary module in compiled form. If you are not using Red Hat,
you need to follow steps 1-11 below. If you are using Red Hat, you can skip the compile process and
follow steps 5 - 11. The asterisk files are located in c:\bill\asterisk where you installed the Call Accounting
mate. The files contained in this directory are :
 
   cdr.conf            - configuration file for Asterisk CDR
   cdr_camate       - The source code file
   Makefile            - 
   cdr_camate.so   - Asterisk loadable module for Red Hat. You may need to recompile (below 1-5) if you
                            are not using Red Hat.


Instructions
----------------
1. You must have gcc installed on the asterisk machine. To check if GCC is installed, type the follwing
   in command line

         > gcc -v
 
   You will get version of software or error if the software is not installed.

2. Copy all the files from c:\bill\asterisk on the Call Accounting Mate machine to any directory on your
    Asterisk server.


3. Compile the source. Change to the directory (chdir) where you unziped the module files and type gmake. To
    compile, type gmake :

   > gmake

4. You should now have a file called cdr_camate.so created in the same directory. This is the Asterisk loadable
    module.
 
5. Open asterisk.conf file. This file is located either in  /etc/asterisk/ or in  /usr/local/etc/asterisk/
    Locate the line with a path to astmoddir. The line should be similar to below :

   astmoddir => /usr/local/lib/asterisk/modules

   Remember the value of astmoddir parameter. It is a file path where all Asterisk loadable modules are located.

6. Copy cdr_camate.so to that path.

7. Open file modules.conf in same directory where asterisk.conf is (usually /etc/asterisk).

    Find a section [modules] and add following string to the end of section.

    load => cdr_camate.so
   
    This loads the Call Accounting Mate CDR module the next time Asterisk starts.


8. Copy cdr.conf to the directory that contains asterisk.conf (usually /etc/asterisk).

   Open the file and change values of hostname and port parameters to point to your CAM software.
   Hostname is either the computer name which can be resolved to an ip address or the ip address of the computer
   running the Call Accounting Mate. Port is the port on which Call Accounting Mate is running. To check the port
   that Call Accounting Mate is running on, access the Call Accounting Mate interface and click on
   Configuration --> Web Config. You should see the value under the "Port".

9. Stop and Start Asterisk. Try making a call using the Asterisk system. Once the call is completed,
    you should see the CDR data in Call Accounting Mate.

10. To check if CDR is received by Call Accounting Mate, Select Views --> Live --> Raw function in Call
     Accounting Mate. If you see the CDR, the connection between Call Accounting Mate and Asterisk is complete.

11. On Call Accounting Mate, you need to specify the correct driver to be used. Select
     Configuration --> Pbx Communication. Add a new PBX ID. PBX Name and description can be anything. Select
     Port tab, set the port to "Asterisk". Now select the driver tab and set the PBX driver to Asterisk.
     This enables the right parser to be loaded in Call Accounting Mate. The parser is used to interpret or map
     the Asterisk CDR to the correct Call Accounting Mate fields.
   

If you face any problems, start another thread with the description of your problem.

« Last Edit: August 02, 2006, 03:13:24 PM by Administrator »

gmenarvino

  • Newbie
  • *
  • Offline Offline
  • Posts: 4
    • View Profile
Re: Using Call Accounting Mate with Asterisk - Must read
« Reply #1 on: March 27, 2006, 05:42:19 PM »
Hi there!

i was trying to compile the module to get this working for my asterisk@home 2.7 running centOS 4.3 Kernel 2.6.9.34-ELsmp.
After compile it I get:

root@localhost accounting]# gmake
cdr_camate.c: In function `load_config':
cdr_camate.c:181: warning: implicit declaration of function `ast_load'
cdr_camate.c:181: warning: assignment makes pointer from integer without a cast
cdr_camate.c:226: warning: implicit declaration of function `ast_destroy'
cdr_camate.c: In function `cdr_post':
cdr_camate.c:396: warning: int format, long int arg (arg 8)
cdr_camate.c:396: warning: int format, long int arg (arg 9)
cdr_camate.c:396: warning: int format, long int arg (arg 8)
cdr_camate.c:396: warning: int format, long int arg (arg 9)
[root@localhost accounting]#

Then I can see the .so module in the same directory but when I copy it where the modules are located (/usr/lib/asterisk/modules/)
and follow the instruccions of the ducoment I cannot get asterisk started:

[root@localhost accounting]# tail /var/log/asterisk/full
Mar 27 19:19:05 VERBOSE[3787] logger.c:   == Registered application 'WaitForRing'
Mar 27 19:19:05 VERBOSE[3787] logger.c:  [app_zapscan.so]Mar 27 19:19:05 VERBOSE[3787] logger.c:  [app_zapscan.so] => (Scan Zap channels application)
Mar 27 19:19:05 VERBOSE[3787] logger.c:   == Registered application 'ZapScan'
Mar 27 19:19:05 VERBOSE[3787] logger.c:  [app_db.so]Mar 27 19:19:05 VERBOSE[3787] logger.c:  [app_db.so] => (Database Access Functions)
Mar 27 19:19:05 VERBOSE[3787] logger.c:   == Registered application 'DBget'
Mar 27 19:19:05 VERBOSE[3787] logger.c:   == Registered application 'DBput'
Mar 27 19:19:05 VERBOSE[3787] logger.c:   == Registered application 'DBdel'
Mar 27 19:19:05 VERBOSE[3787] logger.c:   == Registered application 'DBdeltree'
Mar 27 19:19:05 VERBOSE[3787] logger.c:  [cdr_camate.so]Mar 27 19:19:05 WARNING[3787] loader.c: /usr/lib/asterisk/modules/cdr_camate.so: undefined symbol: ast_load
Mar 27 19:19:05 WARNING[3787] loader.c: Loading module cdr_camate.so failed!
[root@localhost accounting]#


Do you ave any ideas?
Please let me know
Thanks
Gaston

gmenarvino

  • Newbie
  • *
  • Offline Offline
  • Posts: 4
    • View Profile
Re: Using Call Accounting Mate with Asterisk - Must read
« Reply #2 on: March 27, 2006, 06:56:38 PM »
By the way the file cdr_camate.so that should be there after the installation is not there, so I couldn't use it.
Thanks

gmenarvino

  • Newbie
  • *
  • Offline Offline
  • Posts: 4
    • View Profile
Re: Using Call Accounting Mate with Asterisk - Must read
« Reply #3 on: March 27, 2006, 11:52:31 PM »
Hello, after taking some time reading the Make File I was able to resolve the issue.

Thanks

poison

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
    • View Profile
    • Email
Re: Using Call Accounting Mate with Asterisk - Must read
« Reply #4 on: August 01, 2006, 08:06:46 PM »
loader.c: /usr/lib/asterisk/modules/cdr_camate.so: undefined symbol: ast_load

This is what I get after I build the cdr-camate.so and put it in the directory above and try to start asterisk

neilcperry

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
    • View Profile
    • Email
Re: Using Call Accounting Mate with Asterisk - Must read
« Reply #5 on: September 11, 2007, 09:26:07 AM »
"Posted by: gmenarvino 
Insert Quote
Hello, after taking some time reading the Make File I was able to resolve the issue.

Thanks"

gmenarvino, could you please share what you did to resolve the issue...I'm having the same issue.

Thanks in advance.

Neil

mnail

  • Newbie
  • *
  • Offline Offline
  • Posts: 2
    • View Profile
Re: Using Call Accounting Mate with Asterisk - Must read - Fix!!
« Reply #6 on: January 31, 2008, 01:47:50 PM »
"cdr_camate.c:181: warning: implicit declaration of function `ast_load'
cdr_camate.c:181: warning: assignment makes pointer from integer without a cast
cdr_camate.c:226: warning: implicit declaration of function `ast_destroy'"

Change line 181
Original
cf = ast_load(cf_file);
Modified
cf = ast_config_load(cf_file);

And line 226
Original
ast_destroy(cf);
Modified
ast_config_destroy(cf);

Then redo - make clean && make

Then copy the callmate.so over to your lib/asterisk/modules directory

Enjoy!

Compliments of Moritz BMW

oxydables

  • Newbie
  • *
  • Offline Offline
  • Posts: 1
    • View Profile
    • Email
Re: Using Call Accounting Mate with Asterisk - Must read
« Reply #7 on: March 02, 2008, 04:44:12 PM »
Hi all,

I'm not able to install the cdr_camate.so module into my Asterisk. I have more errors then the one you talked about bellow.

The compilation gives me this errors :
Code: [Select]
cdr_camate.c: In function âload_configâ:
cdr_camate.c:190: warning: assignment discards qualifiers from pointer target type
cdr_camate.c:198: warning: assignment discards qualifiers from pointer target type
cdr_camate.c:202: warning: assignment discards qualifiers from pointer target type
cdr_camate.c:206: warning: assignment discards qualifiers from pointer target type
cdr_camate.c:211: warning: assignment discards qualifiers from pointer target type
cdr_camate.c:215: warning: assignment discards qualifiers from pointer target type
cdr_camate.c:221: warning: assignment discards qualifiers from pointer target type
cdr_camate.c: In function âcdr_postâ:
cdr_camate.c:396: warning: format â%dâ expects type âintâ, but argument 8 has type âlong intâ
cdr_camate.c:396: warning: format â%dâ expects type âintâ, but argument 9 has type âlong intâ
cdr_camate.c:396: warning: format â%dâ expects type âintâ, but argument 8 has type âlong intâ
cdr_camate.c:396: warning: format â%dâ expects type âintâ, but argument 9 has type âlong intâ

And when I put the generated cdr_camate.so in the /usr/lib/asterisk/modules/ directory and try to load it on Asterisk i get this :

Code: [Select]
srv-AST*CLI> module load cdr_camate.so
[Mar  2 22:42:10] WARNING[4407]: loader.c:375 load_dynamic_module: Module 'cdr_camate.so' did not register itself during load
[Mar  2 22:42:10] WARNING[4407]: loader.c:646 load_resource: Module 'cdr_camate.so' could not be loaded.

Thank you in advance for your response.

OxY


D.stype

  • qwert
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
    • ICQ Messenger - 255878435
    • View Profile
    • qwert
Using Call Accounting Mate with Asterisk Must read
« Reply #8 on: August 27, 2009, 08:17:06 AM »
Hello...

Is it possible to modify this extensions.conf entry:

exten => 0/12,1,PageLocal/21page&Local/31page&Local/41page&Local/51paged

to use ConfBridge instead of Page? I cant see how it can be implemented the asterisk CLI command help being the only resource I have...

Thanks