Here is something i pilfered and prodded during the Haiti relief show. It works, but it is dog slow on my system. Takes 20 seconds to respond. I am prolly doing something wrong. I pretty much photoshopped the whole thing. You will need a Cepstral voice to use this properly. You will also have to make a sound file for the menu.
Noobs like me should be able to get a grip of whats going on looking at the code.
One of you Guru's will hack it up some more and make it so channel numbers can be entered and "record for 30 minutes" commands can be implemented.
Create control file
We need to make a file that translates into the apple events for the mac.
Create a text file and copy the stuff below into it.
------
Save it to your EyeTV Mac desktop as 'eyetv'
Copy File to Proper Location
Open up the app 'Terminal' on the Mac
Switch to root -
Enter your password (user password)
Enter the following commands to copy the file to the right place.
You should now be able to control EyeTV from the Terminal. Test it by entering the command to play/pause
Set Up SSH
if you don't know the ip address for your mac enter the following command in Terminal
look for "en0" then "inet" that should be your ip address. (or "en1). Write that down.
Or go into System Preferences/Network and look it up on the interface your using.
Now log into your asterisk box command line as root.
Now switch to the asterisk user.
Now enter
Hit return three times. Use default location, no passphrase
Copy the public key file to the Mac with EyeTV. Replace 'username' with your mac username and '192.168.1.100' with the mac's ip address (what you wrote down earlier)
Setup Dialplan
Now log into the Admin web page and go to Config Edit.
Open up 'extensions_custom.conf' and scroll to the bottom.
Paste below in
---
---
Make sure to change user=Username and eyetvhost=192.168.1.100 (marked changeme) above.
Save and hit 'Re-Read Configs'
Setup Extension
Now Navigate to the "Custom Destinatioins' Module under the Tools section.
Add a Custom Destination -
Now navigate to "Misc Application" under Setup.
add Misc Application - Description ETV Remote (or whatever you want)
After that you should be good to go.
Dial 393 (or whatever you used) and try it out.
Controls
The controls are
1 - Full Screen
2 - Volume Up
3 - Exit Full Screen
4 - Channel Down
5 - Play/Pause
6 - Channel Up
7 - Not Used
8 - Volume Down
9 - Not Used
0 - Mute
* - Start Recording
# - Stop Recording
I did a hack job from the following sources:
http://nerdvittles.com/index.php?p=159
http://support.elgato.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=3298
http://www.acmetech.com/extras/tips.html
hope I didn' t miss anything
enjoy
jpe
Noobs like me should be able to get a grip of whats going on looking at the code.
One of you Guru's will hack it up some more and make it so channel numbers can be entered and "record for 30 minutes" commands can be implemented.
Create control file
We need to make a file that translates into the apple events for the mac.
Create a text file and copy the stuff below into it.
------
Code:
#!/bin/sh
#
#
####################################
# EyeTV Control v0.1
# mangled by [email protected]
# Jan 22, 2010
#
# based on
# iTunes Command Line Control v1.1
# written by David Schlosnagle
# created 2001.11.08
# see: http://www.macosxhints.com/article.php?story=20011108211802830
# modifications by Wayne k. Walrath - http://www.acmetech.com/ [2004.06.01]
#
####################################
showHelp () {
echo "-----------------------------";
echo "EyeTV Command Line Interface";
echo "-----------------------------";
echo "Usage: `basename $0` <option>";
echo;
echo "Options:";
echo " play = Start playing EyeTV.";
echo " pause = Pause EyeTV.";
echo " playpause = Toggle Play/Pause EyeTV.";
echo " next = Go to the next channel.";
echo " prev = Go to the previous channel.";
echo " mute = Mute EyeTV' volume.";
echo " unmute = Unmute EyeTV' volume.";
echo " volup = Increase EyeTV' volume by 10%";
echo " voldown = Increase EyeTV' volume by 10%";
echo " stop = Stop EyeTV.";
echo " fullscreen = Enter Full Screen.";
echo " exitfullscreen = Exit Full Screen.";
}
if [ $# = 0 ]; then
showHelp;
fi
while [ $# -gt 0 ]; do
arg=$1;
case $arg in
"play" ) echo "Playing EyeTV.";
osascript -e 'tell application "EyeTV" to play';
break ;;
"pause" ) echo "Pausing EyeTV.";
osascript -e 'tell application "EyeTV" to pause';
break ;;
"playpause" ) echo "Toggle EyeTV Play/Pause.";
osascript -e 'tell application "EyeTV" to playpause';
break ;;
"next" ) echo "Going to next EyeTV channel." ;
osascript -e 'tell application "EyeTV" to channel_up';
break ;;
"prev" ) echo "Going to previous EyeTV channel.";
osascript -e 'tell application "EyeTV" to channel_down';
break ;;
"mute" ) echo "Muting EyeTV volume level.";
osascript -e 'tell application "EyeTV" to mute';
break ;;
"stop" ) echo "Stopping EyeTV.";
osascript -e 'tell application "EyeTV" to stop';
break ;;
"fullscreen" ) echo "EyeTV Entering Full Screen.";
osascript -e 'tell application "EyeTV" to enter full screen';
break ;;
"exitfullscreen" ) echo "EyeTV Exiting Full Screen";
osascript -e 'tell application "EyeTV" to exit full screen';
break ;;
"volup" ) echo "Raising EyeTV Volume.";
osascript -e 'tell application "EyeTV" to volume_up';
break ;;
"voldown" ) echo "Lowering EyeTV Volume.";
osascript -e 'tell application "EyeTV" to volume_down';
break ;;
"startrecord" ) echo "Start Recording EyeTV.";
osascript -e 'tell application "EyeTV" to start recording';
break ;;
"stoprecord" ) echo "Stop Recording EyeTV.";
osascript -e 'tell application "EyeTV" to stop recording';
break ;;
esac
done
Copy File to Proper Location
Open up the app 'Terminal' on the Mac
Switch to root -
Code:
sudo su
Enter the following commands to copy the file to the right place.
Code:
cd Desktop
cp eyetv /bin/eyetv
chmod +x /bin/eyetv
Code:
eyetv playpause
Set Up SSH
if you don't know the ip address for your mac enter the following command in Terminal
Code:
ifconfig
Or go into System Preferences/Network and look it up on the interface your using.
Now log into your asterisk box command line as root.
Now switch to the asterisk user.
Code:
su asterisk
Code:
ssh-keygen -t rsa
Copy the public key file to the Mac with EyeTV. Replace 'username' with your mac username and '192.168.1.100' with the mac's ip address (what you wrote down earlier)
Code:
scp /var/lib/asterisk/.ssh/id_rsa.pub [COLOR=DarkRed][B][I]username[/I][/B][/COLOR]@[COLOR=DarkRed][B][I]192.168.1.100[/I][/B][/COLOR]:/Users/[COLOR=DarkRed][B][I]username[/I][/B][/COLOR]/.ssh/authorized_keys
Now log into the Admin web page and go to Config Edit.
Open up 'extensions_custom.conf' and scroll to the bottom.
Paste below in
---
Code:
[eyetv-control]
exten => s,1,Answer
exten => s,n,NoOp(EyeTV Remote Control)
exten => s,n,set(user=[COLOR=DarkRed][I][B]username[/B][/I][/COLOR]) ; changeme
exten => s,n,set(eyetvhost=[B][I]192.168.1.100[/I][/B]) ; changeme
exten => s,n,Wait(1)
exten => s,n,background(texttospeech/EyeTV-Menu); prompt sound file location
exten => s,n,background(beep)
; 1 Enter Full Screen
exten => 1,1,Swift(Enter full screen.)
exten => 1,n,system(ssh ${user}@${eyetvhost} /bin/eyetv fullscreen)
exten => 1,n,goto(99,1)
; 2 Volume Up
exten => 2,1,Swift(Volume Up)
exten => 2,n,system(ssh ${user}@${eyetvhost} /bin/eyetv volup)
exten => 2,n,goto(99,1)
; 3 Exit Full Screen
exten => 3,1,Swift(Exit Full Screen)
exten => 3,n,system(ssh ${user}@${eyetvhost} /bin/eyetv exitfullscreen)
exten => 3,n,goto(99,1)
; 4 Channel Down
exten => 4,1,Swift(Channel Down)
exten => 4,n,system(ssh ${user}@${eyetvhost} /bin/eyetv prev)
exten => 4,n,goto(99,1)
; 5 Play/Pause
exten => 5,1,swift("Play Pause")
exten => 5,n,system(ssh ${user}@${eyetvhost} /bin/eyetv playpause)
exten => 5,n,goto(99,1)
; 6 Channel Up
exten => 6,1,Swift(Channel Up)
exten => 6,n,system(ssh ${user}@${eyetvhost} /bin/eyetv next)
exten => 6,n,goto(99,1)
; 7
exten => 7,1,Swift(Not Used)
;exten => 7,n,system(ssh ${user}@${eyetvhost} )
exten => 7,n,goto(99,1)
; 8 Volume Down
exten => 8,1,Swift(Volume Down)
exten => 8,n,system(ssh ${user}@${eyetvhost} /bin/eyetv voldown)
exten => 8,n,goto(99,1)
; 9
exten => 9,1,Swift(Not Used)
;exten => 9,n,system(ssh ${user}@${eyetvhost} )
exten => 9,n,goto(99,1)
; 0 Mute
exten => 0,Swift(Volume Mute)
exten => 0,n,system(ssh ${user}@${eyetvhost} /bin/eyetv mute)
exten => 0,n,goto(99,1)
; *
exten => 1,1,Swift(Start Recording)
exten => *,n,system(ssh ${user}@${eyetvhost} /bin/eyetv startrecord)
exten => *,n,goto(99,1)
; #
exten => 1,1,Swift(Stop Recording)
exten => #,n,system(ssh ${user}@${eyetvhost} /bin/eyetv stoprecord'
exten => #,n,goto(99,1)
exten => 99,1,NoOp(${SYSTEMSTATUS})
exten => 99,n,GotoIf($["${SYSTEMSTATUS}" = "APPERROR"]?99,6)
exten => 99,n,Swift(Successfully Executed)
exten => 99,n,goto(s,5)
exten => 99,n,background(im-sorry)
exten => 99,n,background(an-error-has-occured)
exten => 99,n,wait(1)
exten => 99,n,background(goodbye)
exten => 99,n,Hangup
exten => t,1,goto(s,1)
exten => h,1,Hangup
Make sure to change user=Username and eyetvhost=192.168.1.100 (marked changeme) above.
Save and hit 'Re-Read Configs'
Setup Extension
Now Navigate to the "Custom Destinatioins' Module under the Tools section.
Add a Custom Destination -
Code:
Custom Destination: eyetv-control,s,1
Description: EyeTV Control (or whatever you want)
add Misc Application - Description ETV Remote (or whatever you want)
Code:
Feature Code: 393 (eye (or whatever you want))
Destination: Custom Destination: EyeTV Control (or whatever you named it)
Dial 393 (or whatever you used) and try it out.
Controls
The controls are
1 - Full Screen
2 - Volume Up
3 - Exit Full Screen
4 - Channel Down
5 - Play/Pause
6 - Channel Up
7 - Not Used
8 - Volume Down
9 - Not Used
0 - Mute
* - Start Recording
# - Stop Recording
I did a hack job from the following sources:
http://nerdvittles.com/index.php?p=159
http://support.elgato.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=3298
http://www.acmetech.com/extras/tips.html
hope I didn' t miss anything
enjoy
jpe