Setting up Streaming an Asterisk Channel: Difference between revisions
Dubiousjim (talk | contribs) (Category:Telephony) |
(→Setup Icecast Ices Source: use internal link) |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{Delete | Draft for more than two year}} | |||
{{Draft}} | {{Draft}} | ||
= Streaming an Asterisk Channel HOW-TO = | = Streaming an Asterisk Channel HOW-TO = | ||
Line 17: | Line 18: | ||
== Setup Asterisk Ices Application == | == Setup Asterisk Ices Application == | ||
First of all, we need to install asterisk : | |||
{{Cmd|apk add asterisk}} | |||
As we are planning to use MeetMe functions we also need a timer : | |||
{{Cmd|apk add dahdi-linux dahdi-linux-grsec asterisk-dahdi}} | |||
We then need to make sure the module is loaded at startup: | |||
{{Cmd|echo dahdi >> /etc/modules-load.d/dahdi.conf}} | |||
Asterisk runs by default under the asterisk user. The dahdi pseduo device's owner is root. We need to change that : | |||
{{Cmd|chown asterisk:root /dev/dahdi/*}} | |||
Note : every time you'll reboot the rights will be reset. So you need to put that command into a script that runs after a startup. | |||
Finally add asterisk as a startup service : | |||
{{Cmd|rc-update add asterisk}} | |||
Optionnaly we could install the samples for asterisk : | |||
{{Cmd|apk add asterisk-sample-config}} | |||
Don't forget to reboot to load the dahdi modules (see note above). | |||
== Setup Icecast Ices Source == | == Setup Icecast Ices Source == | ||
Ices2 package is in Edge/testing repository (see [[Edge]] to activate it). | |||
{{Cmd|apk add ices2}} | |||
<small>Alternatively you can compile it from the source. | |||
For that we need the compiler's package : | |||
{{Cmd|apk add alpine-sdk}} | |||
Then we need the appropriate dependencies for ices to compile : | |||
{{Cmd|apk add libshout-dev libogg-dev libvorbis-dev libxml2-dev}} | |||
We get the source code : | |||
{{Cmd|cd /root | |||
wget http://downloads.us.xiph.org/releases/ices/ices-2.0.2.tar.gz}} | |||
Decompress : | |||
{{Cmd|tar -zxvf ices-2.0.2.tar.gz}} | |||
Compile and install : | |||
{{Cmd|cd ices-2.0.2 | |||
./configure | |||
make | |||
make install}}</small> | |||
== Setup Icecast2 Service == | == Setup Icecast2 Service == | ||
There is already a package build for Icecast2 : | |||
{{Cmd|apk add icecast}} | |||
We add Icecast server at startup : | |||
{{Cmd|rc-update add icecast}} | |||
Edit /etc/icecast.xml to your needs. | |||
{{Todo|Add sample config here}} | |||
Icecast runs by default as Icecast user. In some cases it might be usefull to run as Asterisk user : | |||
{{Cmd|chown -R asterisk:asterisk /var/log/icecast* | |||
chown -R asterisk:asterisk /usr/local/share/icecast*}} | |||
And change these settings in icecast.xml : | |||
{{Cat|/etc/icecast.xml|<changeowner> | |||
<user>asterisk</user> | |||
<group>asterisk</group> | |||
</changeowner>}} | |||
{{Note| Note : If you are planning on using the <authentication type=url> option, make sure you install the package version icecast≥2.3.3-r7 in edge repositories (to install edge repository see [[Edge]] ).}} | |||
== Using Media Players == | == Using Media Players == |
Latest revision as of 01:28, 25 August 2023
This material is proposed for deletion ... Draft for more than two year
(Discuss) |
This material is work-in-progress ... Do not follow instructions here until this notice is removed. |
Streaming an Asterisk Channel HOW-TO
Introduction
The Asterisk is well known as VoIP service. Obviously, the nature of VoIP technology requires a real time communication, which makes certain requirements to a network connectivity layer in such regards as link speed/bandwidth, IP packet prioritization/control and network latency.
In some cases it is desireable to provide at least one way communication possibility. For example, this idea could be used to give an ability at least "to listen" to a corporate work meeting/conferece, which is organized by means Asterisk MeetMe conference feature to those Remote Locations that still have relatively poor network connectivity layer with a Head Office. Another application is streaming an Asterisk channel to the Internet.
How does it work?
The Asterisk is used with conjunction with sound streaming software such as Icecast2 server. The streaming technology provides "caching/buffering" capabilities. So broadcasted/recieved sound is being buffered, which helps overall sound quality to remain high surviving most of problems in network bandwidth and latencies.
The Asterisk system places an automatic call to connect two extensions. One extension provides an Asterisk channel sound (MusicOnHold, Playback, MeetMe adn etc.), the second one starts the Asterisk Ices application and merges sound to it. The Ices Application depends on Icecast Ices, which is a source of sound to Icecast2 service.
After sound is merged to Icecast Service by means Icecast Ices and Asterisk Ices Applications it could be listened as ogg sound stream by WinAmp, VLC media players. The stream cache parameter should be ajusted according local needs to achieve the acceptable sound quality.
Setup Asterisk Ices Application
First of all, we need to install asterisk :
apk add asterisk
As we are planning to use MeetMe functions we also need a timer :
apk add dahdi-linux dahdi-linux-grsec asterisk-dahdi
We then need to make sure the module is loaded at startup:
echo dahdi >> /etc/modules-load.d/dahdi.conf
Asterisk runs by default under the asterisk user. The dahdi pseduo device's owner is root. We need to change that :
chown asterisk:root /dev/dahdi/*
Note : every time you'll reboot the rights will be reset. So you need to put that command into a script that runs after a startup.
Finally add asterisk as a startup service :
rc-update add asterisk
Optionnaly we could install the samples for asterisk :
apk add asterisk-sample-config
Don't forget to reboot to load the dahdi modules (see note above).
Setup Icecast Ices Source
Ices2 package is in Edge/testing repository (see Edge to activate it).
apk add ices2
Alternatively you can compile it from the source. For that we need the compiler's package :
apk add alpine-sdk
Then we need the appropriate dependencies for ices to compile :
apk add libshout-dev libogg-dev libvorbis-dev libxml2-dev
We get the source code :
cd /root wget http://downloads.us.xiph.org/releases/ices/ices-2.0.2.tar.gz
Decompress :
tar -zxvf ices-2.0.2.tar.gz
Compile and install :
cd ices-2.0.2 ./configure make make install
Setup Icecast2 Service
There is already a package build for Icecast2 :
apk add icecast
We add Icecast server at startup :
rc-update add icecast
Edit /etc/icecast.xml to your needs.
Icecast runs by default as Icecast user. In some cases it might be usefull to run as Asterisk user :
chown -R asterisk:asterisk /var/log/icecast* chown -R asterisk:asterisk /usr/local/share/icecast*
And change these settings in icecast.xml :
Contents of /etc/icecast.xml