Install TNG4asterisk Centos

Web based, multi-user, Telephone Management System with budget management and barring control

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

Install TNG4asterisk Centos

Postby Luanda_Junzi » Sun Jul 24, 2016 9:05 pm

This forums post covers two aspects :

    1.TNG install in Centos
    2.PABX configuration

TNG install in Centos

  1. This is a TNG install on 64 bit,you will need to install libraries below. TNG is a 32 bit application.
    Centos Libries
    Code: Select all
    yum install Centos libs32
    yum install libgcc_s.so.1
    yum install zlib.i686
    yum install libgcc.i686

  2. Download tng4asterisk_setup_linux_1.0.7.0
    Code: Select all
    wget http://www.datatex.co.za/wp-content/uploads/2016/09/TNG4ASTERISK_setup_Linux_1.0.7.0.rpm

  3. Install tng instructions

    Code: Select all
    rpm -i tng4asterisk_setup_linux_1.0.7.0.rpm

    • Follow the prompts.
    • All fields required must be filled .
    • Once tng 1.0.7.0 is running upgrade to version 1.1.1.11
  4. To upgrade to TNG 1.1+ :

      Required:
      • Make sure that your TNG's subscription has not expired (See License Page).
      • Make sure everyone is logged out of TNG.
    • Upgrade to tng4asterisk 1.1.1.11

      Download the update:
      Code: Select all
      wget http://www.tnglive.co.za/downloads/tnglive-update-1_1_1_11


      Make it executable
      Code: Select all
      chmod 777 tnglive-update-1_1_1_11


      Run the update:
      Code: Select all
      ./tnglive-update-1_1_1_11


      Log in and check TNG subscription is not expired.

    • Upgrade to tng 1.1.1.12

      Download Telkom Rates 2014 update and upgrade:
      Code: Select all
      wget http://www.datatex.co.za/wp-content/uploads/2016/06/tnglive-update-1_1_1_12_2014.txt

      Code: Select all
      chmod 777 tng-update-1_1_1_12_2014

      Code: Select all
      ./tng-update-1_1_1_12_2014

Pabx Config.

TNG connects to Asterisk via the network to the Asterisk Manager Interface (AMI). The AMI normally runs on TCP port 5038 on the Asterisk machine.

    Step 1: Enable the Asterisk Manager Interface
    Step 2: Add a user for TNG
    Step 3: Enable CDR on Asterisk
    Step 4: Enable CDR via the AMI
    Step 5: Force Asterisk to reload the configuration
    Step 6: Configure TNG
    Step 7: Check that TNG has connected successfully

    Explanation of log entries

Steps:

  • Step 1: Enable the Asterisk Manager Interface

    We first ensure that the AMI is enabled.

    File /etc/asterisk/manager.conf
    Code: Select all
    [general]
    enabled = yes
    port = 5038
    bindaddr = 0.0.0.0

    You should not enable the AMI on a public IP address.
    If you do, people on the Internet will be able to connect to
    the AMI and may cause problems.

    Block this TCP port with iptables (or other firewall software).

  • Step 2: Add a user for TNG
    The default Asterisk has a manager_custom.conf file, which
    is included from /etc/asterisk/manager.conf. Usually, additional
    users are configured in this file.

    For example, if we want to use login "tng", password "test",
    and TNG will connect from IP 192.168.0.4, this would be the
    configuration:

    File /etc/asterisk/manager_custom.conf
    Code: Select all
    [tng]
    secret=tng
    deny=0.0.0.0/0.0.0.0
    permit=192.168.0.4/255.255.255.255
    read=system,command
    write=system,command


    Historically we used these settings, but it caused High CPU Usage.
    read=system,call,log,verbose,command,agent,user
    write=system,call,log,verbose,command,agent,user

    You can make the login and password anything you want,
    as long as TNG is configured to use the same login and password.

  • Step 3: Enable CDR on Asterisk
    File /etc/asterisk/cdr.conf
    Code: Select all
    [general]
    enabled=yes


  • Step 4: EnableTo enable CDR CSV logging

    To enable CDR CSV logging to /var/log/asterisk/cdr-csv/Master.csv add the following to /etc/asterisk/cdr.conf

    Code: Select all
    [general]
    enable=yes
    loggingsafeshutdown=yes

    [csv]
    usegmtime=yes
    loguniqueid=yes
    loguserfield=yes


  • Step 5: Force Asterisk to reload the configuration


    Asterisk 13.x.x versions you need to load the cdr_custom module

    Code: Select all
    asterisk -rx 'cdr show status'


    Code: Select all
    Call Detail Record (CDR) settings
    ----------------------------------
      Logging:                    Enabled
      Mode:                       Simple
      Log unanswered calls:       No
      Log congestion:             No

    * Registered Backends
      -------------------
        csv
        Adaptive ODBC
       


    Code: Select all
    asterisk -rx 'module load cdr_custom.so'


    Code: Select all
    Call Detail Record (CDR) settings
    ----------------------------------
      Logging:                    Enabled
      Mode:                       Simple
      Log unanswered calls:       No
      Log congestion:             No

    * Registered Backends
      -------------------
        cdr-custom
        csv
        Adaptive ODBC


    Code: Select all
    amportal a r

    Results
    Code: Select all
    Please wait...
    Successfully reloaded

    If the module is there, configure your TNG with the login and password
    you set in Step 2.

    which explicitly specify which modules to reload.
    TNG should now be able to connect to Asterisk.

  • Step 6: Configure TNG
    Make sure that TNG is installed.

    Login on TNG using a web browser, and click on the
    "General Settings" icon (a gear and spanner) on the
    main page.

    TNG will prompt for a "technical" password. Enter the
    technical password and search on the screen for the
    Asterisk Interface configuration.

    Here you enter the IP address of the Asterisk server,
    AMI port (default 5038), Login and password that you
    configured in Step 2.

    Click any of the "Apply Changes" buttons to save.

  • Step 7: Check that TNG has connected successfully
    Back on Asterisk, at the command-line, check that TNG has connected:

    Code: Select all
    root@asterisk:/etc/asterisk# asterisk -rx "show manager connected"
      Username         IP Address
      tng              192.168.0.5


    If you don't see this, check the TNG log file for
    error messages.

  • Explanation of log entries

    Look for these messages to check settings
    Code: Select all
    Setting AMI Host :192.168.0.4
    Setting AMI Port :5038                 
    Setting AMI Login Name :tng     


    • Error message
      Code: Select all
      AMI Exception:ConnectToAsterisk: Socket Error # 10061[13][10]Connection refused.


      Explanation: Failed to connect to AMI
      Reason: Incorrect IP or port, or a firewall

      tngforAsterisk-notconnected.PNG

    • Error messages
      Code: Select all
      AMI Exception:Disconnected.
      AMI Exception:Send: Action: Login[13][10]Username: tng[13][10]Secret: test[13][10] - Socket Error # 10057[13][10]Socket is not connected.
      AMI connected to port 5038 on 192.168.0.4


      Explanation: Successful connect, connection was closed almost immediately
      Reason: Incorrect login or password

    SAMPLE FORMAT

    Code: Select all
    "0000000000","0000000000","s"  ,"all-hangup","Zap/1-1","SIP/5006-091feb88","Dial","SIP/5006|60","2007-11-09 11:24:32","2007-11-09 11:24:32","2007-11-09 11:24:35","3","3","ANSWERED","DOCUMENTATION","","1194600272.3176","2021"

TNG Master.csv formart

TNG 4 Asterisk CSV Import Interface.
Luanda_Junzi
 
Posts: 142
Joined: Wed Feb 25, 2015 2:30 pm

Return to TNG

Who is online

Users browsing this forum: No registered users and 1 guest

cron