Rabu, 30 November 2011

network configuration in ubuntu

Ethernet Interfaces

Ethernet interfaces are identified by the system using the naming convention of ethX, where X represents a numeric value. The first Ethernet interface is typically identified as eth0, the second as eth1, and all others should move up in numerical order.

Identify Ethernet Interfaces

To quickly identify all available Ethernet interfaces, you can use the ifconfig command as shown below.
ifconfig -a | grep eth
eth0      Link encap:Ethernet  HWaddr 00:15:c5:4a:16:5a
Another application that can help identify all network interfaces available to your system is the lshw command. In the example below, lshw shows a single Ethernet interface with the logical name of eth0 along with bus information, driver details and all supported capabilities.
sudo lshw -class network
  *-network
       description: Ethernet interface
       product: BCM4401-B0 100Base-TX
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: eth0
       version: 02
       serial: 00:15:c5:4a:16:5a
       size: 10MB/s
       capacity: 100MB/s
       width: 32 bits
       clock: 33MHz
       capabilities: (snipped for brevity)
       configuration: (snipped for brevity)
       resources: irq:17 memory:ef9fe000-ef9fffff

Ethernet Interface Logical Names

Interface logical names are configured in the file /etc/udev/rules.d/70-persistent-net.rules. If you would like control which interface receives a particular logical name, find the line matching the interfaces physical MAC address and modify the value of NAME=ethX to the desired logical name. Reboot the system to commit your changes.
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:c5:4a:16:5a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:c5:4a:16:5b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

Ethernet Interface Settings

ethtool is a program that displays and changes Ethernet card settings such as auto-negotiation, port speed, duplex mode, and Wake-on-LAN. It is not installed by default, but is available for installation in the repositories.
sudo apt-get install ethtool
The following is an example of how to view supported features and configured settings of an Ethernet interface.
sudo ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Half 1000baseT/Full 
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: d
        Current message level: 0x000000ff (255)
        Link detected: yes
Changes made with the ethtool command are temporary and will be lost after a reboot. If you would like to retain settings, simply add the desired ethtool command to a pre-up statement in the interface configuration file /etc/network/interfaces.
The following is an example of how the interface identified as eth0 could be permanently configured with a port speed of 1000Mb/s running in full duplex mode.
auto eth0
iface eth0 inet static
pre-up /usr/sbin/ethtool -s eth0 speed 1000 duplex full
[Note]
Although the example above shows the interface configured to use the static method, it actually works with other methods as well, such as DHCP. The example is meant to demonstrate only proper placement of the pre-up statement in relation to the rest of the interface configuration.

IP Addressing

The following section describes the process of configuring your systems IP address and default gateway needed for communicating on a local area network and the Internet.

Temporary IP Address Assignment

For temporary network configurations, you can use standard commands such as ip, ifconfig and route, which are also found on most other GNU/Linux operating systems. These commands allow you to configure settings which take effect immediately, however they are not persistent and will be lost after a reboot.
To temporarily configure an IP address, you can use the ifconfig command in the following manner. Just modify the IP address and subnet mask to match your network requirements.
sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0
To verify the IP address configuration of eth0, you can use the ifconfig command in the following manner.
ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:15:c5:4a:16:5a  
          inet addr:10.0.0.100  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::215:c5ff:fe4a:165a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:466475604 errors:0 dropped:0 overruns:0 frame:0
          TX packets:403172654 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2574778386 (2.5 GB)  TX bytes:1618367329 (1.6 GB)
          Interrupt:16 
To configure a default gateway, you can use the route command in the following manner. Modify the default gateway address to match your network requirements.
sudo route add default gw 10.0.0.1 eth0
To verify your default gateway configuration, you can use the route command in the following manner.
route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.255.0   U     1      0        0 eth0
0.0.0.0         10.0.0.1        0.0.0.0         UG    0      0        0 eth0
If you require DNS for your temporary network configuration, you can add DNS server IP addresses in the file /etc/resolv.conf. The example below shows how to enter two DNS servers to /etc/resolv.conf, which should be changed to servers appropriate for your network. A more lengthy description of DNS client configuration is in a following section.
nameserver 8.8.8.8
nameserver 8.8.4.4
If you no longer need this configuration and wish to purge all IP configuration from an interface, you can use the ip command with the flush option as shown below.
ip addr flush eth0
[Note]
Flushing the IP configuration using the ip command does not clear the contents of /etc/resolv.conf. You must remove or modify those entries manually.

Dynamic IP Address Assignment (DHCP Client)

To configure your server to use DHCP for dynamic address assignment, add the dhcp method to the inet address family statement for the appropriate interface in the file /etc/network/interfaces. The example below assumes you are configuring your first Ethernet interface identified as eth0.
auto eth0
iface eth0 inet dhcp
By adding an interface configuration as shown above, you can manually enable the interface through the ifup command which initiates the DHCP process via dhclient.
sudo ifup eth0
To manually disable the interface, you can use the ifdown command, which in turn will initiate the DHCP release process and shut down the interface.
sudo ifdown eth0

Static IP Address Assignment

To configure your system to use a static IP address assignment, add the static method to the inet address family statement for the appropriate interface in the file /etc/network/interfaces. The example below assumes you are configuring your first Ethernet interface identified as eth0. Change the address, netmask, and gateway values to meet the requirements of your network.
auto eth0
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1
By adding an interface configuration as shown above, you can manually enable the interface through the ifup command.
sudo ifup eth0
To manually disable the interface, you can use the ifdown command.
sudo ifdown eth0

Loopback Interface

The loopback interface is identified by the system as lo and has a default IP address of 127.0.0.1. It can be viewed using the ifconfig command.
ifconfig lo
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2718 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2718 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:183308 (183.3 KB)  TX bytes:183308 (183.3 KB)
By default, there should be two lines in /etc/network/interfaces responsible for automatically configuring your loopback interface. It is recommended that you keep the default settings unless you have a specific purpose for changing them. An example of the two default lines are shown below.
auto lo
iface lo inet loopback

Name Resolution

Name resolution as it relates to IP networking is the process of mapping IP addresses to hostnames, making it easier to identify resources on a network. The following section will explain how to properly configure your system for name resolution using DNS and static hostname records.

DNS Client Configuration

To configure your system to use DNS for name resolution, add the IP addresses of the DNS servers that are appropriate for your network in the file /etc/resolv.conf. You can also add an optional DNS suffix search-lists to match your network domain names.
Below is an example of a typical configuration of /etc/resolv.conf for a server on the domain "example.com" and using two public DNS servers.
search example.com
nameserver 8.8.8.8
nameserver 8.8.4.4
The search option can also be used with multiple domain names so that DNS queries will be appended in the order in which they are entered. For example, your network may have multiple sub-domains to search; a parent domain of example.com, and two sub-domains, sales.example.com and dev.example.com.
If you have multiple domains you wish to search, your configuration might look like the following.
search example.com sales.example.com dev.example.com
nameserver 8.8.8.8
nameserver 8.8.4.4
If you try to ping a host with the name of server1, your system will automatically query DNS for its Fully Qualified Domain Name (FQDN) in the following order:
  1. server1.example.com
  2. server1.sales.example.com
  3. server1.dev.example.com
If no matches are found, the DNS server will provide a result of notfound and the DNS query will fail.

Static Hostnames

Static hostnames are locally defined hostname-to-IP mappings located in the file /etc/hosts. Entries in the hosts file will have precedence over DNS by default. This means that if your system tries to resolve a hostname and it matches an entry in /etc/hosts, it will not attempt to look up the record in DNS. In some configurations, especially when Internet access is not required, servers that communicate with a limited number of resources can be conveniently set to use static hostnames instead of DNS.
The following is an example of a hosts file where a number of local servers have been identified by simple hostnames, aliases and their equivalent Fully Qualified Domain Names (FQDN's).
127.0.0.1 localhost
127.0.1.1 ubuntu-server
10.0.0.11 server1 vpn server1.example.com
10.0.0.12 server2 mail server2.example.com
10.0.0.13 server3 www server3.example.com
10.0.0.14 server4 file server4.example.com
[Note]
In the above example, notice that each of the servers have been given aliases in addition to their proper names and FQDN's. Server1 has been mapped to the name vpn, server2 is referred to as mail, server3 as www, and server4 as file.

Name Service Switch Configuration

The order in which your system selects a method of resolving hostnames to IP addresses is controlled by the Name Service Switch (NSS) configuration file /etc/nsswitch.conf. As mentioned in the previous section, typically static hostnames defined in the systems /etc/hosts file have precedence over names resolved from DNS. The following is an example of the line responsible for this order of hostname lookups in the file /etc/nsswitch.conf.
hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
  • files first tries to resolve static hostnames located in /etc/hosts.
  • mdns4_minimal attempts to resolve the name using Multicast DNS.
  • [NOTFOUND=return] means that any response of notfound by the preceeding mdns4_minimal process should be treated as authoritative and that the system should not try to continue hunting for an answer.
  • dns represents a legacy unicast DNS query.
  • mdns4 represents a Multicast DNS query.
To modify the order of the above mentioned name resolution methods, you can simply change the hosts: string to the value of your choosing. For example, if you prefer to use legacy Unicast DNS versus Multicast DNS, you can change the string in /etc/nsswitch.conf as shown below.
hosts:          files dns [NOTFOUND=return] mdns4_minimal mdns4

Bridging

Bridging multiple interfaces is a more advanced configuration, but is very useful in multiple scenarios. One scenario is setting up a bridge with multiple network interfaces, then using a firewall to filter traffic between two network segments. Another scenario is using bridge on a system with one interface to allow virtual machines direct access to the outside network. The following example covers the latter scenario.
Before configuring a bridge you will need to install the bridge-utils package. To install the package, in a terminal enter:
sudo apt-get install bridge-utils
Next, configure the bridge by editing /etc/network/interfaces:
auto lo
iface lo inet loopback

auto br0
iface br0 inet static
        address 192.168.0.10
        network 192.168.0.0
        netmask 255.255.255.0
        broadcast 192.168.0.255
        gateway 192.168.0.1
        bridge_ports eth0
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp off
[Note]
Enter the appropriate values for your physical interface and network.
Now restart networking to enable the bridge interface:
sudo /etc/init.d/networking restart
The new bridge interface should now be up and running. The brctl provides useful information about the state of the bridge, controls which interfaces are part of the bridge, etc. See man brctl for more information.

Konfigurasi static di Centos

sedikit ringkasan jika kita ingin mengkonfigurasi TCP/IP manual di centos. disini kita akan mengubah jaringan dari dhcp menjadi static.
berikut ini konfigurasi untuk dhcp :
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes



1. langsung saja perintah untuk mengkonfigurasi seperti dibawah ini:

[root@localhost LJK03]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
# Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
BROADCAST=192.168.4.255
NETWORK=192.168.4.0
NETMASK=225.225.225.0
IPADDR=192.168.4.65
GATEWAY=192.168.4.1

hanya merubah bootproto nya saja dan menambahkan Broadcast, netmask, network, Ipadrres dan gateway.

2. merestart service network

[root@localhost LJK03]# /sbin/service network restart
hasilnya seperti ini :
[root@localhost LJK03]# /sbin/service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]

INSTALLASI A2BILLING DI TRIXBOX

Instalasi ini telah diuji pada versi Trixbox 2.2, versi sebelumnya dari Trixbox perlu memiliki A2Billing dihapus.
Peringatan biasa berlaku, misalnya penulis tidak bertanggung jawab atas kerusakan dilakukan untuk instalasi yang sudah ada.
Ini juga mengasumsikan bahwa ini adalah instalasi default dalam hal password database.
Panduan ini akan membawa Anda sejauh membuat panggilan pada A2Billing dan menyediakan dasar untuk eksperimentasi dan belajar, tetapi untuk topik yang lebih maju seperti panggilan balik, routing dan penagihan DID, dan penyesuaian lainnya, maka ada dokumentasi yang tersedia, link ke beberapa yang di bagian bawah halaman ini.

Scripted Trixbox Instal

Jika Anda memilih untuk menggunakan installer script ini akan mengkonfigurasi menginstal FRESH Trixbox dengan A2b v1.3 Beta
Untuk menggunakan jenis berikut setelah login ke Trixbox:
 
 cd ~ /
 wget http://www.efirehost.com/a2b_trixbox_2.2_installer_FRESH.sh
 sh a2b_trixbox_2.2_installer_FRESH.sh

Setelah script yang selesai Anda HARUS lanjutkan dengan mengklik DI SINI (jangan gulir ke bawah)

Hapus sisa-sisa menginstal A2Billing tua di Trixbox

Dalam versi sebelumnya dari 2,2 Trixbox, versi yang jauh lebih tua dari A2Billing telah terinstal, dan sebelum melanjutkan dengan langkah-langkah berikut, sisa-sisa A2Billing lama harus dihapus.
Direktori dan file yang akan dihapus adalah sebagai berikut: -
  • / var/www/html/a2billing /
  • / var/www/html/a2customer /
  • / var/lib/asterisk/agi-bin/a2billing.php
  • / var/lib/asterisk/agi-bin/libs_a2billing /
  • / etc/asterisk/additional_a2billing_iax.conf
  • / etc/asterisk/additional_a2billing_sip.conf
Login ke Trixbox, baik melalui sesi SSH atau langsung melalui keyboard dan monitor.
  rm / etc/asterisk/a2billing.conf
Drop database lama (jika ada)
  mysqladmin drop-mya2billing-u root-ppassw0rd

Instal PHP-PCNTL - sebuah persyaratan A2Billing

 wget http://dfn.dl.sourceforge.net/sourceforge/phprpms/php-pcntl-4.3.11-2.5.1.i386.rpm

 rpm-iv php-4.3.11-pcntl-2.5.1.i386.rpm 

Dapatkan A2Billing

Sekarang versi terbaru dari A2Billing. Pada saat penulisan ini adalah 1,3 Beta 1
http://a2billing.net/download.php?get=a2billing-v1-3-Beta.tar.gz
Salin file ke / root / kemudian Untar itu: -
NB. Sebuah aplikasi yang berguna untuk memindahkan, menyalin dan mengedit file pada mesin linux dan memindahkan file dari Windows ke Linux adalah WinSCP http://winscp.net
 tar zxfv a2billing-v1-3-Beta.tar.gz

Instal Database A2Billing

cd 1.3.0-Beta/DataBase/mysql/Mysql-3.x_4.x/

echo "GRANT ALL PRIVILEGES ON *.* TO 'a2billinguser'@'localhost' IDENTIFIED BY 'a2billing' WITH GRANT OPTION;" | mysql -ppassw0rd

mysqladmin create mya2billing -u a2billinguser -pa2billing

mysql mya2billing -u a2billinguser -pa2billing < a2billing-mysql-schema-MYSQL.3.X-4.X_v1.3.0.sql

Instal User Interface

 cd ..
 cd ..
 cd ..

 mv ./A2Billing_UI / var/www/html/A2Billing_UI 
 mv ./A2BCustomer_UI / / var/www/html/A2BCustomer_UI 

Menginstal file konfigurasi default a2billing

 mv a2billing.conf / etc/asterisk/a2billing.conf

Instal AGI yang

 cd A2Billing_AGI

 mv a2billing.php /var/lib/asterisk/agi-bin/a2billing.php

 libs_a2billing mv /var/lib/asterisk/agi-bin

Instal suara tambahan yang diperlukan.

 cd ..
 cd /addons/sound/

 mv * /var/lib/asterisk/sound/

Setup dan file conf IAX SIP

 cd /etc/asterisk/
 touch additional_a2billing_iax.conf
 touch additional_a2billing_sip.conf
 touch extensions_a2billing.conf

Mengatur hak akses dan ownersip

 chmod 666 / etc/asterisk/additional_a2billing_iax.conf
 chmod 666 / etc/asterisk/additional_a2billing_sip.conf
 chmod 666 / etc/asterisk/extensions_a2billing.conf

 chown-R asterisk:asterisk /etc/asterisk/
 chown-R asterisk:asterisk /var/www/html/
 chown-R asterisk:asterisk /var/lib/asterisk/

Tugas berikutnya adalah mengedit file conf agar sesuai dengan instalasi Trixbox

Mengedit File Conf ke Setelan A2Billing

Ini mengasumsikan instalasi Trixbox standar

Mengedit A2Billing.conf

Para a2billing.conf file, yang terletak di / etc / asterisk / adalah di mana semua default yang ditetapkan untuk sistem A2Billing. Disarankan bahwa sebagian besar default yang tersisa sebagai adalah, kecuali jika Anda mencoba untuk mencapai sesuatu yang spesifik. Perubahan ke file tersebut, ketika disimpan memiliki efek instan pada perilaku A2Billing.
File ini dapat diedit dengan menggunakan editor favorit Anda, seperti vi, melalui WinSCP atau melalui Config Mengedit disertakan dengan Trixbox.

Bagian database

comment out dbtype = postgres
remove the ; from ;dbtype = mysql
akan terlihat seperti ini: 
 
  [Database]
 hostname = localhost
 port = 5432
 user = a2billinguser
 password = a2billing
 dbname = mya2billing
 ; Dbtype = postgres
 dbtype = mysql

Parameter Connection Manager

Pada bagian webui, mengidentifikasi parameter Manajer sambungan. Hal ini memungkinkan A2Billing untuk berkomunikasi dengan Asterisk.
Nilai di sini harus ditetapkan untuk sama seperti yang di manager.conf, dan file yang terkait. Dalam kasus Trixbox, kita memiliki sebuah entri untuk a2billinguser di manager_custom.conf. Parameter yang ada: -
  • username = a2billinguser
  • secret = a2billing
Jadi kita perlu mengedit kredensial manajer sambungan a2billing.conf untuk mencocokkan mereka yang manager_custom.conf sehingga terlihat seperti ini: 
 
; MANAGER CONNECTION PARAMETERS
manager_host = localhost
manager_username = a2billinguser
manager_secret = a2billing

Sekarang simpan a2billing.conf
Ada banyak pilihan lain yang bisa diubah dalam a2billing.conf, dan mereka cukup baik didokumentasikan dan berkomentar dalam file.

Termasuk

Selama proses instalasi, tiga file baru diciptakan: -
  • additional_a2billing_sip.conf - SIP friends
  • additional_a2billing_iax.conf - IAX Friends
  • extensions_a2billing.conf - A2Billing contexts
Kita perlu memastikan bahwa nilai-nilai dalam file tersebut dijemput oleh Asterisk.
Edit / etc / asterisk / sip.conf dan termasuk additional_a2billing_sip.conf sehingga beberapa baris terakhir terlihat sip.conf seperti ini: 
 
 ; #, in this configuration file, is NOT A COMMENT. This is exactly
; how it should be.
#include sip_nat.conf
#include sip_custom.conf
#include sip_additional.conf
#include additional_a2billing_sip.conf 

 Kemudian lakukan yang sama untuk iax.conf sehingga terlihat seperti ini
 
#include iax_registrations_custom.conf
#include iax_registrations.conf
#include iax_custom.conf
#include iax_additional.conf
#include additional_a2billing_iax.conf

 NB - Jika menggunakan FreePBX 2.3, maka jangan mengedit  iax.conf, tapi menciptakan dua file baru: - 
sip_custom.conf, yang harus berisi # include additional_a2billing_sip.conf
dan
iax_custom.conf yang berisi # include additional_a2billing_iax.conf
 
Anda kemudian harus mengatur kepemilikan: 
chown asterisk:asterisk /etc/asterisk/iax_custom.conf 
chown asterisk:asterisk /etc/asterisk/sip_custom.conf
 
Akhirnya, kita perlu menyertakan extensions_a2billing.conf di extensions_custom.conf
Extensions_custom.conf mengedit dan menambahkan # include extensions_a2billing.conf bawah lainnya termasuk, sehingga terlihat seperti ini: 
 
 # Include extensions_trixbox.conf
 # Include extensions_hud.conf
 # Include extensions_a2billing.conf

A2Billing Konteks

Dalam extensions_a2billing.conf, tambahkan baris berikut: -
[a2billing]

exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,DeadAGI(a2billing.php|1)
exten => _X.,n,Hangup


NB. Perhatikan 1 setelah a2billing.php - The 1 mengacu pada yang agi-conf untuk digunakan dalam a2billing.conf jika Anda ingin a2billing bereaksi dengan cara yang berbeda untuk segalanya standar, menyalin dari agi-conf1 ke akhir file, dan paste pada akhir file, kemudian mengubah nama baru agi-conf untuk agi-conf2. Default baru Anda kemudian dapat disebut dengan (a2billing.php | 2)
Simpan file ini, dan mengeluarkan kembali pada Asterisk untuk menerapkan file konfigurasi baru tanda bintang.
Anda sekarang memiliki platform A2Billing dasar mengatur, jadi kita perlu membuat beberapa default di A2Billing GUI.

Menyiapkan A2Billing_UI

Sebelum kita dapat mulai menambahkan account ke sistem, kita perlu mengatur beberapa default dasar dalam Graphical User Interface.
Ini set instruksi hanya menyediakan sistem kerja dasar tanpa embel-embel.
Jika petunjuk di atas telah berjalan dengan baik, Anda harus bisa login ke portal Administrasi A2Billing yang akan ditemukan di http:// <your_ip_address> / A2Billing_UI /
Anda akan disajikan dengan username dan password masukkan: -
  • username = root
  • sandi - myroot
Password lainnya yang setup secara default adalah admin dan mypassword. Jelas, itu adalah ide yang baik untuk mengubah.
Klik Administrator pada sidebar, administrator menunjukkan -> mengedit

Trunks

Untuk membuat panggilan keluar, maka perlu untuk menciptakan sebuah batang.
Hal ini diasumsikan bahwa Anda sudah memiliki batang yang bekerja di Trixbox / FreePBX, dan koper ini dapat digunakan dalam A2Billing.
Mengidentifikasi nama batang di FreePBX - dalam hal ini, kita akan berasumsi MYIAXTEL disebut dengan
  • Pada Sidebar, Trunks -> Add trunk
  • Berikan bagasi nama yang berguna - misalnya dalam kasus ini, MYIAXTEL_Trunk
  • Masukkan jenis batang yang Anda gunakan di FreePBX (SIP / IAX2 / ZAP) dan masukkan jenis bagasi di "Tek Provider" Dalam kasus ini, kita akan menganggap itu sebuah batang IAX, jadi masukkan IAX2.
  • Pada bagian IP Provider, cukup ketik nama bagasi Anda telah didirikan di FreePBX. Dalam contoh MYIAXTEL
  • Klik "mengkonfirmasi data" di sudut kanan bawah layar

Buat Beberapa Tarif

Ada sejumlah langkah untuk menciptakan tingkat. Hubungan adalah sebagai berikut.
  • Satu pelanggan / Kartu memiliki satu rencana panggilan
  • Rencana Panggilan dapat memiliki banyak Kartu Tingkat
  • Kartu Tingkat dapat memiliki Tarif Banyak.
Buat Rencana Panggilan
  • Pada sidebar, klik Ratecard -> Buat rencana panggilan
  • Berikan rencana panggilan nama, misalnya StandardCallPlan
  • Anda memiliki dua pilihan, LCR dan LCD - LCR akan rute panggilan di tingkat termurah untuk Anda, dan LCD akan rute panggilan pada tingkat termurah bagi pelanggan.
  • Tinggalkan Paket set "Tidak Tawarkan Paket" karena kami belum membuat satu belum.
  • Hapus Awalan Inter harus di set ke yes jika Anda penyedia VoIP menuntut bahwa angka-angka akan diputar dalam format IETF. Serahkan saja NO jika Anda hanya ingin panggilan keluar seperti.
  • Kami akan menganggap dalam kasus ini bahwa Anda memiliki penyedia VoIP misalnya yang menuntut format yang IETF untuk dial Inggris Anda akan panggil 44 xxx xxx xxx daripada 0044 ... atau 01144 ... sehingga mengatur Awalan Inter Hapus untuk YES dan klik konfirmasi data.
Buat Ratecard Baru
Kami sekarang harus membuat ratecard baru. Untuk tujuan demonstrasi, kita akan menyebutnya StandardRates
  • Klik "Buat Ratecard baru" di sidebar.
  • Dalam TariffName masukkan StandardRates
  • Pilih MYIAXTEL_trunk di bidang bagasi dan konfirmasi data.
Tambahkan Kartu Rencana Tingkat ke Call
Kembali dan klik "Daftar Rencana Panggilan" dan jika semuanya berjalan dengan baik masih, Anda akan melihat StandardCallPlan terdaftar. Klik Edit pada akhir baris, dan pada boittom halaman, dalam dropdown, pilih StandardRates dibuat sebelumnya Klik Add, dan konfirmasi data.
Ketika Anda mendapatkan harga dari penyedia yang berbeda, mereka dapat ditambahkan ke dalam rencana panggilan dan dipilih atas dasar harga.
Tambahkan Beberapa Tarif
Kami sekarang harus menambahkan beberapa tingkat. Harga dapat diimpor dalam jumlah besar dari file CSV, atau diketik dalam satu pada suatu waktu. Jika tingkat untuk tujuan tidak ada, maka A2Billing tidak dapat memberikan panggilan.
Setiap kode panggilan untuk setiap tujuan perlu ditambahkan. Hal ini penting untuk akurat dengan kode panggilan. Sebagai contoh, jika ada tujuan, katakanlah premium dinilai kode panggilan di Afrika Timur bahwa Anda berada di bawah pengisian, seseorang dapat membuat banyak uang dengan biaya Anda.
Sayangnya, tidak ada daftar kode definitif panggilan dengan rincian yang memadai yang bisa saya temukan di internet. Namun, operator seluler Anda harus dapat menyediakan Anda dengan daftar kode panggilan dan biaya yang mereka buat.
Daftar negara dengan kode panggilan disertakan dengan A2Billing bawah Misc - Awalan> Browse. Namun daftar ini, tidak memperhitungkan tujuan akun seperti Bilangan Nilai Handphone dan Premium.
Jadi untuk saat ini, kami uji melalui VoIP, kami penyedia VoIP menuntut agar kita mengirim mereka digit dalam format IETF, dan kami ingin membuat panggilan keluar pertama atas A2Billing ke nomor nasional Inggris. Nasional Inggris nomor hanya dimulai dengan baik 441 atau 442
Jadi kita akan menambahkan tingkat pertama. Asumsikan penagihan ke detik terdekat, biaya adalah 1 US sen per menit dan kami menjual pada 2 sen per menit. Kita mengasumsikan semuanya dalam dolar AS untuk saat ini karena kita tidak mengubah mata uang default.
NB. Untuk mengubah mata uang default, Edit base_currency a2billing.conf <currency = dari choice> Anda Setiap mata uang memiliki pengenal 3 huruf unik. Untuk menemukan identitas, klik Penagihan -> Daftar Mata Uang di sidebar, kemudian berburu untuk negara Anda. Ketika a2billing.conf disimpan, Anda dapat memperbarui nilai tukar mata uang di layar.
  • Klik Ratecard -> Tambahkan Tingkat
  • Pilih ratecard yang Anda menambahkan tingkat ke dalam dropdown ratecard
  • Masukkan awalan panggilan sebagai 441-442. Hal ini akan memungkinkan setiap panggilan keluar sebagai 441 ... dan 442 ...
  • Masukkan nama untuk tujuan - Inggris Nasional
  • Mengatur tingkat membeli - dalam hal ini 0,01
  • Mengatur durasi minimal - mengasumsikan 1 seperti dalam 1 detik
  • Mengatur Blok Penagihan Buyrate, asumsikan 1 lagi. Jika Anda chaged ke menit terdekat, kemudian meletakkan 60.
  • Taruh dalam tingkat penjualan - 0,02
  • Durasi Sellrate min - 1
  • Blok sellrate Penagihan - 1 untuk penagihan per detik.
  • Biaya menghubungkan dan melepaskan muatan dapat dibiarkan kosong untuk saat ini
  • Biarkan Trunk untuk tidak didefinisikan, seperti yang kita definisikan sebelumnya untuk ratecard secara keseluruhan.
  • dan akhirnya mengkonfirmasi data.
Sistem ini sekarang siap untuk menciptakan pelanggan, dan membuat panggilan pertama.

Menciptakan Pelanggan Pertama

Pelanggan dapat dibuat satu per satu dari antarmuka Admin, dibuat dalam massal dari layar admin, atau dibuat dari pelanggan pendaftaran halaman di http:// <Your_IP_Address>> / A2Billing_UI/Signup
Dalam rangka untuk menciptakan pelanggan dari halaman pendaftaran, email keluar harus bekerja (tipe setup-mail dari command line)
Dalam contoh ini - kita akan menciptakan pelanggan baru dari antarmuka admin.
  • Pelanggan Klik -> Buat Pelanggan
  • Tambahkan keseimbangan, misalnya 10
  • Pilih StandardCallPlan kita buat sebelumnya
  • Diaktifkan = yes
  • Signup Konfirmasi = yes
  • Masukkan Nama Anda dan alamat email di bidang yang sesuai
  • dan mengkonfirmasi data.

Buat Account SIP

Asumsikan kita menggunakan telepon SIP untuk tujuan demonstrasi. Prinsip yang sama berlaku untuk telepon IAX juga.
  • Dalam pelanggan Daftar, klik tombol SIP
  • Klik "Hasilkan Additional_A2Billing.conf
  • Klik untuk reload server asterisk.
  • Klik Pelanggan -> Daftar Teman SIP, dan harus ada entri baru di sana.
  • Klik edit di akhir baris.
Anda telepon SIP harus dikonfigurasi dengan parameter berikut: -
  • Hostname adalah Alamat IP dari Trixbox Anda
  • Ekstensi Anda / Nama pengguna akan menjadi angka di Bidang "Username"
  • Rahasia Anda akan menjadi angka di Bidang "Rahasia"
  • Dan memastikan bahwa modus DTMF adalah sama pada telepon Anda seperti di bidang DTMFMODE.
Telepon Anda sekarang harus didaftarkan ke server Asterisk. Anda dapat memeriksa ini dengan melihat layar Info Asterisk di Trixbox.

Membuat panggilan

Ada satu perubahan kecil untuk dibuat untuk a2billing.conf dalam aplikasi ini - set "use_dnid = yes" di a2billing.conf dan menyimpan file.
Dial nomor yang ingin mencoba - dalam contoh kita, Anda hanya dapat memanggil nomor yang diawali dengan 441, dan 442 atau 00441 atau 00442. Pengaturan panggilan Rencananya akan strip nomor awalan internasional dari panggilan, jika mereka ada.
Tekan mengirim, dan Anda akan mendengar keseimbangan Anda saat ini, jumlah menit Anda dapat memanggil tujuan itu, dan kemudian jika semuanya telah berjalan dengan baik, maka Anda harus terhubung ke ujung jauh.

Membuat A2Billing diakses dari dunia luar

Dalam rangka untuk panggilan ke A2Billing dari dunia luar, kita akan membutuhkan DID menunjuk Trixbox, atau bahkan saluran telepon biasa.
Kami menangkap panggilan Rute Inbound di Trixbox / FreePBX dan kirim ke A2Billing.
Karena FreePBX hanya memungkinkan Anda untuk mengirim panggilan ke konteks kustom yang diawali dengan "Custom" dalam kita perlu menambahkan konteks kustom dalam ekstensi-a2billing.conf
Jadi dalam mengedit konfigurasi, vi atau editor teks favorit Anda, tambahkan baris berikut ke ekstensi-a2billing.conf sehingga seluruh file terlihat seperti ini: -
 [a2billing]

exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,DeadAGI(a2billing.php|1)
exten => _X.,n,Hangup

[custom-a2billing]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n,DeadAGI(a2billing.php|1)
exten => _X.,n,Hangup

 Lalu pergi ke Rute Inbound di FreePBX / Trixbox dan menambahkan rute inbound baru 
  • Masukkan DID dalam jumlah DID.
  • Pilih App Kustom: tombol radio dan di bidang Aplikasi Kustom masukkan string berikut: -
custom-a2billing,${EXTEN},1
  • kemudian menyerahkan dan menerapkan perubahan konfigurasi.
NB. Dalam versi FreePBX 2.4 dan yang lebih besar, ada modul baru yang disebut Tujuan Kustom bawah bagian alat. String di atas harus dimasukkan ke dalam tujuan khusus, maka akan muncul sebagai dropdown di rute inbound, dan dari bagian lain seperti IVR dan Pengumuman.
Anda harus dapat memanggil nomor tersebut, dan Anda akan mendengar, "Silakan masukkan nomor rekening Anda" Ketik nomor kartu Anda. Itu adalah bidang pertama dalam A2Billing -> Pelanggan -> Daftar Pelanggan -> Edit
Saldo Anda kemudian akan membacakan kepada Anda, maka Anda dapat memanggil nomor tersebut, durasi maksimal akan membacakan kepada Anda, maka Anda harus terhubung ke nomor yang dipanggil.
NB. Anda harus menambahkan nomor akses Anda ke no_auth_dnid di a2billing.conf, sehingga A2B tahu untuk tidak pernah mencoba untuk menghubungi nomor ini keluar.

Lampiran

Instalasi proftpd di CentOS

Proftpd adalah salah satu aplikasi utk transfer file menggunakan ftp (file transfer protocol). Salah satu kegunaan proftpd adalah utk download maupun upload file ke dalam web server ato server. Sebelum instalasi pastikan paket gcc sudah terinstal, untuk instalasinya seperti di bawah ini:

1. Pastikan paket gcc sudah ada, ini berguna utk install paket proftpd.
[root@localhost ~]# rpm -qa gcc*
gcc-gnat-4.1.2-42.el5
gcc-c++-4.1.2-42.el5
gcc-objc-4.1.2-42.el5
gcc-java-4.1.2-42.el5
gcc-4.1.2-42.el5
gcc-gfortran-4.1.2-42.el5
gcc-objc++-4.1.2-42.el5

2. Download proftpd.
[root@localhost downloads]# wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.4rc3.tar.gz

3. Extract proftpd yg sudah di download.
[root@localhost downloads]# tar zxvf proftpd-1.3.2rc1.tar.gz
[root@localhost downloads]# cd proftpd-1.3.2rc1.tar.gz

4. Install proftpd
[root@localhost proftpd-1.3.2rc1]# ./configure
[root@localhost proftpd-1.3.2rc1]# make
[root@localhost proftpd-1.3.2rc1]# make install

5. Membuat user proftpd
[root@localhost proftpd-1.3.2rc1]# useradd proftpd -s /dev/null

6. Membuat direktori utk ftp
[root@localhost proftpd-1.3.2rc1]# mkdir /home/ftp

7. Edit beberapa baris utk setting proftpd.
[root@localhost proftpd-1.3.2rc1]# nano /usr/local/etc/proftpd.conf
# This is a basic ProFTPD configuration file (rename it to
# ‘proftpd.conf’ for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# “nobody” and “ftp” for normal operation and anon.
ServerName                      “ProFTPD centos”
ServerType                      standalone
DefaultServer                   on
# Port 21 is the standard FTP port.
Port                            21
# Don’t use IPv6 support by default.
# UseIPv6                               off
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022
# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances                    30
# Set the user and group under which the server will run.
User                            proftpd
Group                           proftpd

# To cause every FTP user to be “jailed” (chrooted) into their home
# directory, uncomment this line.
#DefaultRoot ~
# Normally, we want files to be overwriteable.
AllowOverwrite          on
# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit>
# A basic anonymous configuration, no upload directories.  If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
<Anonymous /home/ftp>
User                          ftp
Group                         ftp
# We want clients to be able to login with “anonymous” as well as “ftp”
UserAlias                     anonymous ftp
# Limit the maximum number of anonymous logins
MaxClients                    10
# We want ‘welcome.msg’ displayed at login, and ‘.message’ displayed
# in each newly chdired directory.
DisplayLogin                  welcome.msg
DisplayChdir                  .message
# Limit WRITE everywhere in the anonymous chroot
<Limit WRITE>
DenyAll
</Limit>
</Anonymous>

8.  Jalankan service proftpd.
[root@localhost proftpd-1.3.2rc1]# /usr/local/sbin/proftpd

9. Apakah service sudah berjalan dapat menjalankan perintah ini:
[root@localhost proftpd-1.3.2rc1]# ps aux | grep proftpd
proftpd   2188  0.0  0.4   2716  1096 ?        Ss   21:56   0:00 proftpd:
(accepting connections)

10. Setelah semua berhasil dengan baik kita akan coba login ke dalam ftp server menggunakan user=rivkhi dgn password=rivkhi dan user anonymous tanpa password.
User rivkhi
[root@localhost proftpd-1.3.2rc1]# ftp localhost
Connected to localhost.localdomain.
220 ProFTPD 1.3.2rc1 Server (ProFTPD centos) [127.0.0.1]
500 AUTH not understood
500 AUTH not understood
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): rivkhi
331 Password required for rivkhi
Password:
230 User rhesa logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 “/home/rivkhi” is the current directory
ftp> ls
227 Entering Passive Mode (127,0,0,1,198,73).
150 Opening ASCII mode data connection for file list
drwxr-xr-x   2 rivkhi    rivkhi        4096 Oct 13 19:18 Desktop
drwxrwxr-x   7 rivkhi    rivkhi        4096 Oct 21 13:23 rpm
226 Transfer complete
ftp> quit
221 Goodbye.
User anonymous
[root@localhost proftpd-1.3.2rc1]# ftp localhost
Connected to localhost.localdomain.
220 ProFTPD 1.3.2rc1 Server (ProFTPD centos) [127.0.0.1]
500 AUTH not understood
500 AUTH not understood
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): anonymous
331 Anonymous login ok, send your complete email address as your password
Password:
230 Anonymous access granted, restrictions apply
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 “/” is the current directory
ftp> ls
227 Entering Passive Mode (127,0,0,1,210,74).
150 Opening ASCII mode data connection for file list
226 Transfer complete
ftp> quit
221 Goodbye.