Global conferencing using VoIP and softphones
We built a global conferencing platform, using Asterisk ( open source VoIP server ) as a key component.
Our VoIP PBX is accessible via a GIZMO call ( ihelpit ), you can call any of the access numbers for our conferencing service, and then dial a user’s extension instead of a conference code. We use several VoIP trunk providers, such as Unlimitel, to transport calls into our system. Unlimitel and other providers sell VoIP trunks in many countries for a fixed monthly rate based on the number of call paths (maximum number of concurrent callers), usually somewhere between $7 to $25/month depending on the country.
The calls arrive into our Asterisk system via SIP, which plays a series of voice prompts, and to ask the caller for a conference number or extension. If the caller enters a 4-16 digit conference code (these are mnenomic codes like IHELPIT or 443578), the call is routed into our conferencing/telecasting and group messaging environment. If the caller enters a 5 digit extension, the caller is routed to someone’s Gizmo number. Conference calls will be recorded and made available via podcast so, even if you miss a conference, you can still listen to it later
Here is a list of features:
- access to conference calls is available via GIZMO softphones or by using a local extension
- the Conference call recording will be done centrally on the server automatically without user interaction
- the recorded files will be easy available as OGG files to all podcast members after the recording
Here are the details:
/etc/asterisk/sip.conf:
externip = you're_external_IP ; this is needed as asterisk has problem with the venet0 stuff otherwise
localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks
localnet=10.0.0.0/255.0.0.0 ; Also RFC1918
localnet=172.16.0.0/12 ; Another RFC1918 with CIDR notation
localnet=169.254.0.0/255.255.0.0 ;Zero conf local network
nat=yes
qualify=yes
canreinvite=no
After this global setup we configure for each of our podcasters one section, as shown here:
[firstPodcaster] ; this is also the user name
type=friend
context=sip
secret=the_password_of_this_user
callerid=”Your_Name” <1> ; it is recommended to use no spaces here, as we use this as part of the filename. You need the “, “ and < ,> exactly as show here
host=dynamic
dtmfmode=info
disallow=all
allow=alaw
callingpres=allowed_passed_screen
We only support alaw so every client uses G.711a and we don’t need to translate. I believe in the US you need to use G.711u and therefore ulaw. Now we need a conference room for which we add following line to /etc/asterisk/meetme.conf:
conf => 10
conf => 20
Now we need to tie that together with the dial plan in /etc/asterisk/extensions.conf:
[globals]
MONITOR_EXEC=/usr/local/bin/wavIn2ogg.sh
And add following section:
[sip]
; so we can talk directly with another
exten => 31,1,Dial(SIP/firstPodcaster,20,tr)
exten => 32,1,Dial(SIP/secondPodcaster,20,tr)
exten => 33,1,Dial(SIP/thirdPodcaster,20,tr)
; this conference room is not recorded, for preparations
exten => 10,1,Answer
exten => 10,2,Wait(1)
exten => 10,3,Meetme(10,s)
; this conference room records automatically
exten => 20,1,Answer
exten => 20,2,Wait(1)
exten => 20,3,Set(CALLFILENAME=podcast_X_${CALLERID(name)}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)})
exten => 20,4,Monitor(wav,${CALLFILENAME},m)
exten => 20,5,Meetme(20,s)
; from the demo code – useful to look at the quality of your connection
; Create an extension, 60, for evaluating echo latency.
exten => 60,1,Playback(demo-echotest) ; Let them know what's going on
exten => 60,n,Echo ; Do the echo test
exten => 60,n,Playback(demo-echodone) ; Let them know it's over
exten => 60,n,Goto(s,60) ; Start over
Now you can restart Asterisk and connect with you SIP client. Call 60 to check if the audio stream works in both directions (try it without firewall on the Asterisk server if don’t hear anything). After that go into the conference room 10 with 1 or 2 friends and test it. If that all works you can work on the recording stuff. Create following script /usr/local/bin/wavIn2ogg.sh (don’t forget chmod 755):
#!/bin/bash
# wavIn2ogg.sh - creates ogg of the input mono stream
# used for recording each participant in a meeting room separately
# Written by Robert Penz
SOX=/usr/bin/sox
NICE=/usr/bin/nice
InFile="$1"
OutFile="$2"
OggFile=`echo $3|sed s/.wav//`.ogg
FinalDir=/var/www/production
#test if input files exist
test ! -r $InFile && exit
test ! -r $OutFile && exit
$NICE -n 19 $SOX -t wav "$InFile" -t vorbis "$OggFile"
#remove input files if successfull
test -r "$OggFile" && rm "$InFile" "$OutFile"
# at last set the permissions and move it in an atomic way
chmod 644 "$OggFile"
mv "$OggFile" "$FinalDir/."
Create the directory /var/www/production and set the correct permissions:
# mkdir /var/www/production
# chown asterisk:www-data /var/www/production
Now go the the conference room 20 and say something and disconnect. If it worked you should see with your browser under http:///production/ the recorded OGG file(s). If there are none, take a look at /var/spool/asterisk/monitor/ if there are 2 WAV files. If so call the wavIn2ogg.sh script by hand and look for any errors.
So thats the end of the story – you’ve now a system for recording podcasts over the internet in a cool way! Any comments, ideas or questions? Post them here.
References:
http://robert.penz.name/53/howto-setup-asterisk-for-recording-a-podcast-...
http://mxdesign.net/VoIP/onfolio-files/Creating%20A%20Global%20PBX%20Wit...
