I gave it a whirl, but I run CentOS, and there are a lot of dependencies that weren't in the system, and yum couldn't find. After about 15 minutes of it I realized this was going to become a mini-project that I didn't have time for at that moment.

Some of the fundamental stuff here is pure gold, though.

Jim

Simon P. Ditner wrote:
No responses? I'm so disenchanted.


On Tue, 10 Feb 2009, Simon P. Ditner wrote:

For your entertainment...

Usage:
./inject.sh 4165551212 'http://www.youtube.com/watch?v=ghWpAgFfgV0'

extensions.conf:
[inject-wav]
exten => s,1,Answer()
exten => s,n,Wait(1)
exten => s,n,Playback(${WAV})
exten => s,n,System(rm ${WAV}.wav)

[outbound]
exten => X.,1,Dial(SIP/tr...@${exten})

inject.sh:
#!/bin/sh
FILE=`tempfile`
EXTEN=$1
URL=$2

RES=`lynx -source "$URL" | grep fullscreenUrl | cut -d'&' -f4,8`
mplayer "http://www.youtube.com/get_video?$RES"; -dumpaudio -dumpfile $FILE-t.mp3
mpg123 -w $FILE-t.wav $FILE-t.mp3
sox $FILE-t.wav -c 1 -r 8000 -w $FILE.wav

# Remove temporary files
rm $FILE $FILE-t.wav $FILE-t.mp3

echo "Channel: Local/$ex...@outbound
MaxRetries: 1
RetryTime: 60
WaitTime: 30
Context: inject-wav
Extension: s
Priority: 1
Set: WAV=$FILE
" > /var/spool/asterisk/outgoing/inject-$EXTEN.call




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




--

--
Jim Van Meggelen
[email protected]
http://www.oreillynet.com/pub/au/2177

"A child is the ultimate startup, and I have three. This makes me rich."
                   Guy Kawasaki
--



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to