AsteriskAvi Code
Status: Beta
Brought to you by:
salzh
| File | Date | Author | Commit |
|---|---|---|---|
| app_avi.c | 2011-03-04 | salzh | [r2] add source codes |
| app_avi.so | 2011-01-11 | salzh | [r1] |
| avi.c | 2011-03-04 | salzh | [r2] add source codes |
| avi.h | 2011-03-04 | salzh | [r2] add source codes |
| aviplay.jpg | 2011-03-04 | salzh | [r2] add source codes |
| makefile | 2011-03-04 | salzh | [r2] add source codes |
| readme | 2011-03-04 | salzh | [r2] add source codes |
compile:
make
install:
copy app_avi.so to /usr/lib/asterisk/modules and reload asterisk
ChangeLog: This version fixed some bugs in aviplay and add avisave support!
Warning: app_avi.so is still Beta Version and successfully tested for asterisk version 1.4.x, 1.6.2.x on OS 32-bit AS5
version 1.6.1.1 may not display video for the sake of bugs of chan_sip.c.
AVIplay current only support avi file with h263 video codec and g711 audio codec.
Many more codecs will be added soon. Howerver, you can get proper avi from other format file by ffmpeg:
'ffmpeg -y -i inputvideo -vcodec h263 -s 352x288 -acodec pcm_alaw -ac 1 -ar 8000 output.avi'
"AVIplay(filename,audiointval,syncintval,debug,display,options): Play AVI file to user. \n"
"\n"
"audiointval: unit is us, and default is 18000\n"
"syncintval: unit is s, and default is 2\n"
"debug: 0|1, default is 0\n"
"display: 0|1|2, 0-display video and audio, 1-only video, 2-only audio\n"
"Available options:\n"
" 'n(x)': number of digits (x) to wait for \n"
" 'S(x)': set variable of name x (with DTMFs) rather than go to extension \n"
" 's(x)': set digits, which should stop playback \n"
"\n"
"Available options:\n"
" 'n(x)': number of digits (x) to wait for \n"
" 'S(x)': set variable of name x (with DTMFs) rather than go to extension \n"
" 's(x)': set digits, which should stop playback \n"
"\n"
"Examples:\n"
" AVIplay(/tmp/video.avi,18000,2,0,0,'xx') play video file to user\n"
" AVIplay(/tmp/video.avi,18000,2,0,0,'n(3)') play video file to user and wait for 3 digits \n"
" AVIplay(/tmp/video.avi,18000,2,0,0,'n(3)S(BLAH)') play video file to user and wait for 3 digits and \n"
" set them as value of variable BLAH\n"
" AVIplay(/tmp/video.avi,18000,2,0,0,'n(3)s(#)') play video file, wait for 3 digits or break on '#' \n";
" AVIsave(filename,[options]): Record AVI file
"Available options:"
" 'v': activate loopback of video"
" 'd': debug(0|1), default is 0"
"Note: waiting for video I frame also activate video loopback mode."
"Examples:"
" AVIsave(/tmp/video.avi) record video to selected file"
" AVIsave(/tmp/video.avi,v,d) activate loopback of video";
configuration:
-Examples
sip.conf:
videosupport=yes
disallow=all
allow=alaw
allow=ulaw
allow=h263
extensions.conf:
[from-internal]
exten => 1236,1,Answer
exten => 1236,n,aviplay(/root/output.avi,19000,4,0,0,'n(4)S(BLAH)')
exten => 1236,n,noop(BLAH: ${BLAH))
exten => 1236,n,goto(${BLAH},1)
exten => 1236,n,Hangup
Any suggestion is welcome. Please contact to me "salzh <zhongxiang721@gmail.com>"