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]