TNG 4 Asterisk CSV Import Interface.

Moderators: Leon van Heerden, Luanda_Junzi, Belinda Frick, Lee Hendricks

TNG 4 Asterisk CSV Import Interface.

Postby Belinda Frick » Mon Nov 15, 2010 1:25 pm

Note: If TNG and Asterisk is on the running on the same PC, it must run as the same user to avoid access problems.

You can run the command ls -la to check the user and group

Configuration in TNG:

Log into TNG - General Settings - Communication Configuration
NB: (Take note of the settings before making the changes.)

Under 'Asterisk Interface Method', please change the following:

  • Asterisk Manager Interface - Import from CSV file
  • Specify the location of the csv files you wish to import.
  • Click 'Apply Changes' to these settings,

TNG will now read the information from the specified location. Navigate
to the Call list page - the total record count will increase.

If not, please check TNG logs for errors.

Required: Asterisk 1.2.

On the General Settings page, you can specify whether you want to use the Asterisk manager interface or the Asterisk CSV option, if the CSV file option is selected then it still uses the manager interface as this is where we get the extensions from Asterisk in order to determine proper call direction. If the Asterisk CSV option is selected, you also need to specify the location and file name of the CSV file.

The format of the CSV required is the cdr-custom. Asterisk has two option cdr-custom and master, both writes out a file named master.csv. Be sure to use the file in the cdr-custom folder.

Code: Select all
In /etc/asterisk is a cdr_custom.conf file.
In /etc/asterisk/cdr.conf is a [general] section this must be enable=yes.

Any additions to this file will be read into TNG and once a day,
the file will be moved away.

PLEASE NOTE: For evaluations versions, the CSV file must not contain any information prior to the installation date or more than 30 days into the future.

Required: Asterisk 1.4

In Asterisk 1.4.17 we found that in addition to the cdr.conf and cdr_manager.conf
changes you need to go and comment in the mappings in /etc/asterisk/cdr_custom.conf
(This could be by default in asterisk 1.2.x) in addition you need to check cdr_custom.conf

Mappings for custom config file:

To get your csv output in a format tailored to your liking, uncomment the following
and look for the output in the cdr-custom/Master.csv file (usually in /var/log/asterisk).

Code: Select all

Master.csv => "${CDR(clid)}","${CDR(src)}","${CDR(dst)}","${CDR(dcontext)}","${CDR(channel)}",

Here is an exmple of what the output will look like:

Code: Select all
"","369","*55","sip-internal","""JP Campher"" <369>","SIP/369-0819a5e8","","MusicOnHold","default","2007-11-16 09:46:13","2007-11-16 09:46:13","2007-11-16 09:46:17",4,4,"ANSWERED","DOCUMENTATION"
"","0215924037","4500","ext-queues","""PSTN-0215924037"" <0215924037>","SIP/","SIP/308-081a2238","Queue","4500|t|||40","2007-11-16 14:27:16","2007-11-16 14:27:16","2007-11-16 14:27:44",28,28,"ANSWERED","DOCUMENTATION"

Please note:

The trunk values needs to be an IP address or start with "trunk_", for example
trunk_telkom1, to qualify as a trunk. Then TNG will think it is trunk and work
Belinda Frick
Posts: 3792
Joined: Fri Nov 12, 2010 4:25 pm

Return to Support Archive's (TNG)

Who is online

Users browsing this forum: No registered users and 1 guest