Difference between revisions of "VoIP: Cara Mengkonfigurasi Trunk di Asterisk"

From OnnoWiki
Jump to navigation Jump to search
(New page: Sumber: http://www.alkia.net/index.php/faqs/137-how-to-configure-sip-trunk-with-asterisk how to configure SIP trunk with Asterisk In order to enable voice call exchange between ...)
 
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
 +
Disain asterisk memisahkan antara in-bound dan out-bound call.
 +
In-bound call membutuhkan untuk di terima oleh SIP dan di arahkan ke context call plan.
 +
Out-bound call aplikasi dial membutuhkan profile spesifik di konfigurasi SIP atau registrasi ke tujuan.
  
how to configure SIP trunk with Asterisk
+
==Context==
  
+
Kesulitan utama dalam konfigurasi SIP trunking di asterisk adalah berbagai parameter di sip.conf dan sip_trunk.conf.
  
+
Pada contoh ini, kita akan membuat dua asterisk server
  
In order to enable voice call exchange between two PBX the straightforward protocol to use is SIP. It can allows device interconnection, regardless of their respective role, phone, proxy or gateway. This article explains how simply interconnecting two Asterisk PBX and could be used as a template in order to configure a SIP trunk between an Asterisk PBX and any other one available on the market.
+
* asterisk-bangkok
 +
* asterisk-paris
  
There is a separation by design in Asterisk between in-bound and out-bound calls. An in-bound call requires to be accepted by the SIP stack and oriented towards an call plan context. On the other hand, an out-bound call, the Dial application requires either a specific profile in the SIP configuration or a registration to the counterpart. We use registration when our IP address is dynamically allowed and can change, thus mainly for IP phones.
+
kedua-nya menggunakan IP address statik dalam jaringan yang sama.
  
Context
+
Dalam dial plan
  
The main complexity for SIP trunking configuration in Asterisk is the role of each parameter in the sip.conf file and sip_trunk.conf. In order to illustrate this article, we will use two Asterisk servers called respectivelly asterisk-bangkok  and asterisk-paris. They are both using a static IP address and sharing the same IP network (no NAT in the middle to interfere with the SIP protocol). In order to exchange calls between Bangkok and Paris, we have build prefixes in our dial plan, 91 is used to call Bangkok and 98 to call, the routing is really simple.
+
* 91 untuk menelepon Bangkok
 +
* 98 untuk menelepon Paris.
  
Simple configuration
+
==Konfigurasi Sederhana==
 +
 
 +
Untuk mengijinkan Paris untuk menelpon Bangkok. Konfigurasi pada masing-masing sip.conf
  
To start with, we need a configuration to allow calls to flow from Paris towards Bangkok. The configurations on both servers are the following, in sip.conf :
 
  
 
Bangkok
 
Bangkok
 
 
 
Paris
 
 
 
  [trunk-bangkok-paris]
 
  [trunk-bangkok-paris]
 
  type=peer
 
  type=peer
 
  host=asterisk-paris
 
  host=asterisk-paris
 
  context=from-asterisk-paris
 
  context=from-asterisk-paris
+
 
 +
Paris
  
 
  [trunk-paris-bangkok]
 
  [trunk-paris-bangkok]
Line 36: Line 40:
 
  host=asterisk-bangkok
 
  host=asterisk-bangkok
  
In the dial plan (extensions.conf) the call is leaving Paris with the following:
+
Pada dial plan (extensions.conf) call akan meninggalkan Paris dengan konfigurasi:
  
 
  exten => _91.,1,Set(CALLERID(num)=98${CALLERID(num)})
 
  exten => _91.,1,Set(CALLERID(num)=98${CALLERID(num)})
 
  exten => _91.,2,Dial(SIP/trunk-paris-bangkok/${EXTEN:2},20,rt)
 
  exten => _91.,2,Dial(SIP/trunk-paris-bangkok/${EXTEN:2},20,rt)
  
In order to respect our multi site dialing plan structure, we modify as the first action the caller identifier by perfixing it with the Paris prefix (98).
+
Agar memungkinkan struktur multi site dialin plan, kita memodifikasi caller ID dengan menambahkan Prefix Paris (98).
  
The Dial application is directeing the call to the SIP trunk named trunk-paris-bangkok, defined in the sip.conf file between [ ]. The trunk type is set to peer since we want to direct calls towards a specific IP address, defined in the host parameter, here set to asterisk-bangkok (see DNS or host table for resolution).
+
Aplikasi Dial akan me-redirect call ke SIP trunk yang bernama trunk-paris-bangkok, yang di definisikan di defined sip.conf. Tipe trunk di set sebagai peer karena kita menginginkan call untuk langsung ke IP address yang di definisikan di parameter host.
  
 
When a call needs to be established, a SIP INVITE message arrives on the Asterisk based in Bangkok. Asterisk looks in the SIP database for a profile which can accept this call, the IP address is used as the discriminator. The asterisk-paris profile match this requirement. The next action is to direct the call to the specified context and look for an extension match.
 
When a call needs to be established, a SIP INVITE message arrives on the Asterisk based in Bangkok. Asterisk looks in the SIP database for a profile which can accept this call, the IP address is used as the discriminator. The asterisk-paris profile match this requirement. The next action is to direct the call to the specified context and look for an extension match.
  
Call on the reverse path
+
==Call di Jalur Sebaliknya==
  
 
Now that a call can be placed from Paris to Bangkok, we need the reverse configuration in order for Bangkok to be able to call Paris. Required modification to our configuration are in bold below:
 
Now that a call can be placed from Paris to Bangkok, we need the reverse configuration in order for Bangkok to be able to call Paris. Required modification to our configuration are in bold below:
  
 
Bangkok
 
Bangkok
 
 
Paris
 
  
 
  [trunk-bangkok-paris]
 
  [trunk-bangkok-paris]
 
  type=peer
 
  type=peer
 
  host=asterisk-paris
 
  host=asterisk-paris
  context=from-asterisk-paris
+
  context=from-asterisk-paris
 +
 
 +
Paris
  
 
  [trunk-paris-bangkok]
 
  [trunk-paris-bangkok]
Line 71: Line 74:
 
  exten => _98.,2,Dial(SIP/trunk-bangkok-paris/${EXTEN:2},20,rt)
 
  exten => _98.,2,Dial(SIP/trunk-bangkok-paris/${EXTEN:2},20,rt)
  
Authenticated SIP trunk
+
==Authenticated SIP trunk==
  
 
It is sometimes required to authenticate calls routed from one PBX to another. Most of the time the main point is billing or tracking calls. Authenticating each call acts as an approval for the associated fees or constraints. Keep in mind that configuration is at the PBX level and not at the phone level and is not as strong as what we can do with X.509 certificates. Authentication for SIP is using a digest exchange and MD5 as the signature, therefore the secret exchanged between both entities is never exchanged in clear over the network.
 
It is sometimes required to authenticate calls routed from one PBX to another. Most of the time the main point is billing or tracking calls. Authenticating each call acts as an approval for the associated fees or constraints. Keep in mind that configuration is at the PBX level and not at the phone level and is not as strong as what we can do with X.509 certificates. Authentication for SIP is using a digest exchange and MD5 as the signature, therefore the secret exchanged between both entities is never exchanged in clear over the network.
Line 79: Line 82:
 
Bangkok
 
Bangkok
 
 
 
Paris
 
 
 
  [trunk-bangkok-paris]
 
  [trunk-bangkok-paris]
 
  type=peer
 
  type=peer
Line 88: Line 88:
 
  username=trunk-paris-bangkok
 
  username=trunk-paris-bangkok
 
  secret=strong_password
 
  secret=strong_password
+
 
 +
Paris
  
 
  [trunk-paris-bangkok]
 
  [trunk-paris-bangkok]
Line 99: Line 100:
 
The coloured parts should match in both configurations.
 
The coloured parts should match in both configurations.
  
Conclusion
+
==Conclusion==
  
 
A SIP trunk between two Asterisk PBX is as simple and allows to easily expand the IP telephony network. Interfacing an Asterisk with any other SIP PBX will require something similar, this is the case when connecting to an IP telephony provider. We will see in another article how to take care of the NAT issues and the impact on Asterisk configuration and the network infrastructure.
 
A SIP trunk between two Asterisk PBX is as simple and allows to easily expand the IP telephony network. Interfacing an Asterisk with any other SIP PBX will require something similar, this is the case when connecting to an IP telephony provider. We will see in another article how to take care of the NAT issues and the impact on Asterisk configuration and the network infrastructure.
Line 109: Line 110:
  
 
* http://www.alkia.net/index.php/faqs/137-how-to-configure-sip-trunk-with-asterisk
 
* http://www.alkia.net/index.php/faqs/137-how-to-configure-sip-trunk-with-asterisk
 +
 +
==Lebih Dalam==
 +
 +
* [[VoIP: Trunk]]
 +
* [[VoIP: Asterisk menerima Anonymous Call]]
 +
* [[VoIP: Asterisk route ke arah IP PBX lain dengan kode area]]
 +
* [[VoIP: Cara Mengkonfigurasi Trunk di Asterisk]]
 +
* [[VoIP: Cara Mengkonfigurasi Dial Out Melalui Trunk di Asterisk]]
 +
* [[VoIP: Asterisk forward call ke IP softswitch lain]]
 +
 +
===Asterisk Round Robin===
 +
 +
* [[VoIP: Astersk Dial Round Robin]]
 +
* [[VoIP: Asterisk pakai GotoIf]]
 +
 +
===OpenSIPS===
 +
 +
* [[VoIP: OpenSIPS route ke arah Asterisk]]
 +
* [[OpenSIPS: Rewrite URI]]
 +
* [[OpenSIPS: Rewritehostport]]
 +
 +
===OpenSIPS round robin===
 +
 +
* [[OpenSIPS: dispatcher]]
 +
 +
==Pranala Menarik==
 +
 +
* [[VoIP]]
 +
* [[OpenBTS]]
 +
 +
===Latar Belakang===
 +
 +
* [[Menjadikan VoIP dan 4G Legal]]
 +
* [[Sekitar VoIP Rakyat]]
 +
* [[VoIP: Dasar Hukum Internet Telepon]]
 +
* [[VoIP: Beberapa Skenario Topologi]]
 +
* [[VoIP: Pilihan Teknologi Internet Telepon]]
 +
* [[VoIP: Pengkodean Suara di Jaringan Komputer]]
 +
* [[VoIP: Konsep Video Conference]]
 +
 +
===Untuk Pemula===
 +
* [[VoIP: Kebutuhan Peralatan dan Software]]
 +
* [[VoIP: Internet Telepon PC ke PC]]
 +
 +
===Untuk Peneliti / Pencoba===
 +
* [[VoIP: Bandwidth Internet Telepon]]
 +
* [[VoIP: Softswitch / Server Internet Telepon]]
 +
* [[VoIP: Repository Software Internet Telepon]]
 +
* [[VoIP: Menghubungkan PSTN dan Selular]]
 +
 +
===Untuk Operator===
 +
* [[VoIP: Server Video Conference]]
 +
* [[VoIP: Software dan peralatan client Internet Telepon]]
 +
* [[VoIP: Penggunaan DAHDI]]
 +
* [[VoIP: Hardware Client VoIP]]
 +
* [[VoIP: Hardware Server VoIP]]
 +
* [[VoIP: Interkoneksi dan Alokasi Nomor Telepon]]
 +
* [[VoIP: Peering Antar Operator VoIP]]
 +
* [[VoIP: Menghubungkan PSTN dan Selular]]
 +
* [[VoIP: Trunk]]
 +
 +
===Topik Lanjut===
 +
* [[VoIP: ENUM untuk pengenalan nomor telepon di Internet Telepon]]
 +
* [[VoIP: Teknik Evaluasi Internet Telepon]]
 +
* [[VoIP: Troubleshooting]]
 +
* [[VoIP: Video Conference Server]]
 +
 +
===Buku Teknologi VoIP===
 +
* [[Onno W. Purbo]], "VoIP Cikal Bakal Telkom Rakyat", Infokomputer, 2007.
 +
* http://125.160.17.21/speedyorari/index.php?dir=ebook-voip
 +
* http://opensource.telkomspeedy.com/speedyorari/index.php?dir=ebook-voip
 +
 +
 +
[[Category: VoIP]]
 +
[[Category: Internet Telepon]]

Latest revision as of 19:55, 25 February 2014

Sumber: http://www.alkia.net/index.php/faqs/137-how-to-configure-sip-trunk-with-asterisk


Disain asterisk memisahkan antara in-bound dan out-bound call. In-bound call membutuhkan untuk di terima oleh SIP dan di arahkan ke context call plan. Out-bound call aplikasi dial membutuhkan profile spesifik di konfigurasi SIP atau registrasi ke tujuan.

Context

Kesulitan utama dalam konfigurasi SIP trunking di asterisk adalah berbagai parameter di sip.conf dan sip_trunk.conf.

Pada contoh ini, kita akan membuat dua asterisk server

  • asterisk-bangkok
  • asterisk-paris

kedua-nya menggunakan IP address statik dalam jaringan yang sama.

Dalam dial plan

  • 91 untuk menelepon Bangkok
  • 98 untuk menelepon Paris.

Konfigurasi Sederhana

Untuk mengijinkan Paris untuk menelpon Bangkok. Konfigurasi pada masing-masing sip.conf


Bangkok

[trunk-bangkok-paris]
type=peer
host=asterisk-paris
context=from-asterisk-paris

Paris

[trunk-paris-bangkok]
type=peer
host=asterisk-bangkok

Pada dial plan (extensions.conf) call akan meninggalkan Paris dengan konfigurasi:

exten => _91.,1,Set(CALLERID(num)=98${CALLERID(num)})
exten => _91.,2,Dial(SIP/trunk-paris-bangkok/${EXTEN:2},20,rt)

Agar memungkinkan struktur multi site dialin plan, kita memodifikasi caller ID dengan menambahkan Prefix Paris (98).

Aplikasi Dial akan me-redirect call ke SIP trunk yang bernama trunk-paris-bangkok, yang di definisikan di defined sip.conf. Tipe trunk di set sebagai peer karena kita menginginkan call untuk langsung ke IP address yang di definisikan di parameter host.

When a call needs to be established, a SIP INVITE message arrives on the Asterisk based in Bangkok. Asterisk looks in the SIP database for a profile which can accept this call, the IP address is used as the discriminator. The asterisk-paris profile match this requirement. The next action is to direct the call to the specified context and look for an extension match.

Call di Jalur Sebaliknya

Now that a call can be placed from Paris to Bangkok, we need the reverse configuration in order for Bangkok to be able to call Paris. Required modification to our configuration are in bold below:

Bangkok

[trunk-bangkok-paris]
type=peer
host=asterisk-paris
context=from-asterisk-paris		

Paris

[trunk-paris-bangkok]
type=peer
host=asterisk-bangkok
context=from-asterisk-bangkok

In Bangkok we also need a specific set of action to allow a call, prefixed by 98 to be routed towards Paris:

exten => _98.,1,Set(CALLERID(num)=91${CALLERID(num)})
exten => _98.,2,Dial(SIP/trunk-bangkok-paris/${EXTEN:2},20,rt)

Authenticated SIP trunk

It is sometimes required to authenticate calls routed from one PBX to another. Most of the time the main point is billing or tracking calls. Authenticating each call acts as an approval for the associated fees or constraints. Keep in mind that configuration is at the PBX level and not at the phone level and is not as strong as what we can do with X.509 certificates. Authentication for SIP is using a digest exchange and MD5 as the signature, therefore the secret exchanged between both entities is never exchanged in clear over the network.

Authentication is based on login and password validation. The password is called secret in the configuration and login is called username. The username is not mandatory and can be derived from the configuration, but specifying it is clearer and easier to troubleshoot in case of. Configuration changes are availabe below:

Bangkok

[trunk-bangkok-paris]
type=peer
host=asterisk-paris
context=from-asterisk-paris
username=trunk-paris-bangkok
secret=strong_password

Paris

[trunk-paris-bangkok]
type=peer
context=from-asterisk-bangkok
host=asterisk-bangkok
username=trunk-bangkok-paris
secret=strong_password

The coloured parts should match in both configurations.

Conclusion

A SIP trunk between two Asterisk PBX is as simple and allows to easily expand the IP telephony network. Interfacing an Asterisk with any other SIP PBX will require something similar, this is the case when connecting to an IP telephony provider. We will see in another article how to take care of the NAT issues and the impact on Asterisk configuration and the network infrastructure.



Referensi

Lebih Dalam

Asterisk Round Robin

OpenSIPS

OpenSIPS round robin

Pranala Menarik

Latar Belakang

Untuk Pemula

Untuk Peneliti / Pencoba

Untuk Operator

Topik Lanjut

Buku Teknologi VoIP