Asterisk Video & VideoMail

From open-voip.org

Jump to: navigation, search

In this lesson we will use Asterisk for Video! I will use asterisk 1. and addons

Contents

Install Asterisk for Video

we will user asterisk version 1.4.26.2 and addons 1.4.9. note that the exact configuration may not work on other versions as Video is tricky in Asterisk. installtion instructions from scratch (including all dependencies) can be found at Asterisk Install

 cd /opt
 wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.4.26.2.tar.gz
 wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-addons-1.4.9.tar.gz
 tar -zxvf asterisk-1.4.26.2.tar.gz
 cd asterisk-1.4.26.2
 make clean
 ./configure
 make
 make install 
 cd ..
 tar -zxvf asterisk-addons-1.4.9.tar.gz 
 cd asterisk-addons-1.4.9 
  make clean
 ./configure
 make
 make install

Configure sip.conf

We must add the line videosupport=yes in order to support the video. Note that we use ond codec for audio ("ulaw") and one codec for video ("h263"). There are two users "1234" and "1235"

 [general]
 videosupport=yes
 disallow=all                    ; First disallow all codecs
 allow=ulaw                      ; The voice codec
 allow=h263                      ; The video Coded
 ;
 [1234]
 type=friend
 host=dynamic
 nat=yes
 mailbox=1234@inbound
 context=inbound
 username=1234
 secret=1234
 ;
 [1235]
 type=friend
 host=dynamic
 nat=yes
 mailbox=1235@inbound
 context=inbound
 username=1235
 secret=1235

Record and play video - extensions.conf

Now, let's make a dial plan that: 1. when dialing 7777 it will start recording from the webacam 2. after pressing # to end the recording, it will play "beep" 3. Play the recorded video and end the call in addition it allow calls beteen extensions (e.g. 1234 call 1235)

extensions.conf will be:

 [general]
 [globals]
 [inbound]
 exten => _X.,1,dial(SIP/${EXTEN})           ; dialing between extensions
 exten => _X.,2,hangup
 exten => 7777,1,record(mytest.wav)          ; record audio and video to a file "mytest"
 exten => 7777,2,playback(beep)
 exten => 7777,3,playback(mytest)            ; play the recorded file
 exten => 7777,4,hangup

The record will save 2 file: mytest.h263 for video mytest.wav for audio files will be saved at /var/lib/asterisk/sounds

Test a Video Call

We will use x-lite version "X-Lite_Win32_1011s_41150.exe" to test, other versions that I tried crushed or did not work for me... user configuration:

File:video_xlite_user.GIF

Video and Audio codec configuration:

File:video_xlite_codecs.GIF

Dial 7777 and press the "start" buttom to start sending video,press # when finish. you should see the recorded file you just did

File:video_xlite_main.GIF

Use voicemail as videomail

change the voicemail.conf as follow, note that there is only audio codec ("wav") and the video codec is not necessary. we will add two voicemail for our users 1234 and 1235:

 [general]
 format=wav
 [default]
 [inbound]
 1234 => 1234,mymail@mail.com
 1235 => 1235,mymail@mail.com

we will add voicemail dialing rules in our dial plan in the extensions.conf: 8888 to leave a message to videomail box 1234 9999 to retrieve messsages from box 1234

 [general]
 [globals]
 [inbound]
 exten => _X.,1,dial(SIP/${EXTEN})
 exten => _X.,2,hangup
 exten => 8888,1,voicemail(1234@inbound)
 eexten => 9999,1,voicemailmain(1234@inbound)
 exten => 7777,1,record(mytest.wav)
 exten => 7777,2,playback(beep)
 exten => 7777,3,playback(mytest)
 exten => 7777,4,hangup

reload asterisk and test: 1. Dial 8888,press the "start" video and leave a video message, press # to end. 2. Dial 9999, insert your password (1234) and listen to the video mail you just left. 3. you can now dial 9999 and record your video greeting (0 and 4 in the menues). dial 8888 to test it. messaged will be saved at: /var/spool/asterisk/voicemail/inbound/1234/INBOX three file will be saved for each message:

msg0001.wav
msg0001.h263
msg0001.txt
Personal tools