User Tools

Site Tools


docs:guide-user:services:voip:asterisk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
docs:guide-user:services:voip:asterisk [2018/06/11 15:33]
sebastian [extensions.conf] fixed missing brackets
docs:guide-user:services:voip:asterisk [2018/09/26 15:10] (current)
sebastian added info about channel bridging module
Line 1: Line 1:
 ====== Asterisk ====== ====== Asterisk ======
 ===== Introduction ===== ===== Introduction =====
-[[https://​www.asterisk.org/​|Asterisk]] is an enterprise grade software PBX with a lot of features. Asterisk and most of its modules ​are available on OpenWrt. On routers with lantiq based SoCs it's possible to use built in analogue FXS ports with Asterisk, turning these devices into [[wp>​VoIP_gateway|VoIP gateways]] (see [[docs:​guide-user:​services:​voip:​asterisk:​chan-lantiq|chan-lantiq for Asterisk]]).+[[https://​www.asterisk.org/​|Asterisk]] is an open-source ​software PBX whose functionality can be extended by various modulesOpenWrt provides packages for Asterisk and most of its official ​modules ​via the telephony [[docs:​guide-developer:​feeds|feed]]. On routers with Lantiq ​SoCs it's possible to use built in analogue FXS ports with Asterisk, turning these devices into [[wp>​VoIP_gateway|VoIP gateways]] (see [[docs:​guide-user:​services:​voip:​asterisk:​chan-lantiq|chan-lantiq for Asterisk]])
 + 
 +This article focuses on Asterisk installation and basic SIP configuration on OpenWrt.
 ===== Installation ===== ===== Installation =====
 ==== Choosing an Asterisk version ==== ==== Choosing an Asterisk version ====
-Asterisk has standard and Long Term Support ​(LTS) releases. Have a look at [[https://​wiki.asterisk.org/​wiki/​display/​AST/​Asterisk+Versions|Asterisk versions]] on the Asterisk wiki for the current upstream support status. +Asterisk has standard and long term support ​(LTS) releases. Have a look at [[https://​wiki.asterisk.org/​wiki/​display/​AST/​Asterisk+Versions|Asterisk versions]] on the Asterisk wiki for the current upstream support status. 
-An OpenWrt release usually includes both the latest standart and LTS releases ​of Asterisk. If you're unsure which version you should install, pick the latest LTS release.+An OpenWrt release usually includes both the latest standart and LTS release ​of Asterisk. If you're unsure which version you should install, pick the latest LTS release.
  
 You can query the package table to get information about the Asterisk versions in OpenWrt, module names und their descriptions:​ [[https://​openwrt.org/​packages/​table/​start?​dataflt%5BName_pkg-dependencies*%7E%5D=asterisk13&​dataflt%5BCategoriess*%7E%5D=|Asterisk13]],​ [[https://​openwrt.org/​packages/​table/​start?​dataflt%5BName_pkg-dependencies*%7E%5D=asterisk15&​dataflt%5BCategoriess*%7E%5D=|Asterisk15]] You can query the package table to get information about the Asterisk versions in OpenWrt, module names und their descriptions:​ [[https://​openwrt.org/​packages/​table/​start?​dataflt%5BName_pkg-dependencies*%7E%5D=asterisk13&​dataflt%5BCategoriess*%7E%5D=|Asterisk13]],​ [[https://​openwrt.org/​packages/​table/​start?​dataflt%5BName_pkg-dependencies*%7E%5D=asterisk15&​dataflt%5BCategoriess*%7E%5D=|Asterisk15]]
Line 22: Line 24:
 Example command for an [[toh:​arcadyan:​vgv7510kw22|o2 Box 6431]]: Example command for an [[toh:​arcadyan:​vgv7510kw22|o2 Box 6431]]:
 <​code>​ <​code>​
-make image PROFILE=arcadyan_vgv7510kw22-nor PACKAGES="​kmod-ltq-tapi kmod-ltq-vmmc kmod-ltq-ifxos asterisk13 asterisk13-pjsip asterisk13-codec-alaw asterisk13-res-rtp-asterisk asterisk13-chan-lantiq"​+make image PROFILE=arcadyan_vgv7510kw22-nor PACKAGES="​kmod-ltq-tapi kmod-ltq-vmmc kmod-ltq-ifxos asterisk13 asterisk13-pjsip ​asterisk13-bridge-simple ​asterisk13-codec-alaw asterisk13-res-rtp-asterisk asterisk13-chan-lantiq"​
 </​code>​ </​code>​
  
Line 30: Line 32:
 Asterisk security advisories are announced here: [[https://​www.asterisk.org/​downloads/​security-advisories]] Asterisk security advisories are announced here: [[https://​www.asterisk.org/​downloads/​security-advisories]]
 ==== Modules ==== ==== Modules ====
-Only install modules you really need. Don't start by installing all Asterisk modules OpenWrt can offer just because you're too lazy to find out which ones are necessary. This not only wastes space, but also enlarges the possible attack surface.+Only install modules you really need, don't start by installing all Asterisk modules OpenWrt can offer. This not only wastes space, but also enlarges the possible attack surface
 + 
 +For basic SIP operation it's enough to install a RTP stack (''​*-res-rtp-asterisk''​),​ a channel bridging module (''​asterisk*-bridge-simple''​) and needed audio codecs (normally ''​*-codec-alaw''​ or ''​*-codec-ulaw''​) in addition to the SIP stack.
 ==== Firewall ==== ==== Firewall ====
 Don't expose SIP related ports on your WAN Interface. It's not necessary in most cases, but greatly affects security in a negative way. Don't expose SIP related ports on your WAN Interface. It's not necessary in most cases, but greatly affects security in a negative way.
Line 39: Line 43:
 ===== Configuration ===== ===== Configuration =====
 Asterisk configurations can differ to a great extend depending on provider/​hardware/​country,​ so it's difficult to provide generic configurations. Asterisk configurations can differ to a great extend depending on provider/​hardware/​country,​ so it's difficult to provide generic configurations.
-On OpenWrt, Asterisk configuration files can be found under ''/​etc/​asterisk/''​. The most important files are the dialplan (''​extensions.conf''​) and the SIP channel configuration (''​pjsip.conf''​ or ''​sip.conf''​). Location specific tone indications are set in ''​indications.conf''​. Links to the corresponding Asterisk-wiki-pages with details on configuration options ​ are given below, together with working examples, taken from [[https://​forum.lede-project.org/​t/​voip-configuration-for-asterisk13-pjsip-chan-lantiq-and-vodafone-germany/​9470|this forum thread]].+On OpenWrt, Asterisk configuration files can be found under ''/​etc/​asterisk/''​. The most important files are the dialplan (''​extensions.conf''​) and the SIP channel configuration (''​pjsip.conf''​ or ''​sip.conf''​). Location specific tone indications are set in ''​indications.conf''​. Links to the corresponding Asterisk-wiki-pages with details on configuration options ​ are given below, together with working examples, taken from [[https://​forum.openwrt.org/​t/​voip-configuration-for-asterisk13-pjsip-chan-lantiq-and-vodafone-germany/​9470|this forum thread]].
  
 After changing your Asterisk configuration,​ restart the server: ''/​etc/​init.d/​asterisk restart''​ After changing your Asterisk configuration,​ restart the server: ''/​etc/​init.d/​asterisk restart''​
Line 185: Line 189:
 If you plan to use Asterisk on a Lantiq device, see [[docs:​guide-user:​services:​voip:​asterisk:​chan-lantiq]] for detailed configuration examples. If you plan to use Asterisk on a Lantiq device, see [[docs:​guide-user:​services:​voip:​asterisk:​chan-lantiq]] for detailed configuration examples.
  
 +<code ini lantiq.conf>​
 +[interfaces]
 +channels = 2
 +per_channel_context = on
 +</​code>​
 +''​per_channel_context = on''​ is important, as it will place calls from the Lantiq FXS ports in contexts ''​lantiq1''​ and ''​lantiq2''​ instead of ''​default'',​ which should be avoided.
 ==== SQM/QoS ==== ==== SQM/QoS ====
-For VoIP you will need some form of traffic shaping to reduce latency. On OpenWrt the best choice is using [[docs:​guide-user:​network:​traffic-shaping:​sqm|SQM with cake]]. To prioritize VoIP traffic choose ''​layer_cake.qos''​ as the queue setup script. For more details read [[https://​forum.lede-project.org/​t/​simple-qos-for-voip/​10382|this forum thread]].+For VoIP you will need some form of traffic shaping to reduce latency. On OpenWrt the best choice is using [[docs:​guide-user:​network:​traffic-shaping:​sqm|SQM with cake]]. To prioritize VoIP traffic choose ''​layer_cake.qos''​ as the queue setup script. For more details read [[https://​forum.openwrt.org/​t/​simple-qos-for-voip/​10382|this forum thread]].
  
 More information on TOS/CoS values can be found in the [[https://​wiki.asterisk.org/​wiki/​display/​AST/​IP+Quality+of+Service|IP QoS article]] on the Asterisk Wiki. More information on TOS/CoS values can be found in the [[https://​wiki.asterisk.org/​wiki/​display/​AST/​IP+Quality+of+Service|IP QoS article]] on the Asterisk Wiki.
docs/guide-user/services/voip/asterisk.1528731237.txt.gz · Last modified: 2018/06/11 15:33 by sebastian