View unanswered posts | View active topics It is currently Tue May 21, 2013 6:53 am



Reply to topic  [ 87 posts ]  Go to page: Previous  1, 2, 3, 4, 5, 6  Next
 Indigo-PhoneValet Integration 
Author Message

Joined: Mar 09, 2008
Posts: 183
Post 
That worked as well. I assume the log (and the results/events in script editor) will be empty until the target script dies?


Sun Nov 08, 2009 2:45 pm
Profile
User avatar

Joined: Nov 18, 2008
Posts: 1721
Location: Berkeley, CA
Post 
BillC wrote:That worked as well. I assume the log (and the results/events in script editor) will be empty until the target script dies?
Right. You can test it by killing the process. enter: ps ax|grep PhoneValet in the terminal. The process ID (PID) will be in column 1. Then just do: kill <PID>. For example: kill 1527

So, now you just need to go back to Indigo and figure out why you could not get your script to start from inside Indigo. Maybe the support guys will see something I did not. But, you might try:
Code: Select all
set cmdOut to do shell script "/Library/Application Support/Perceptive Automation/Test/testscpt-watcher.sh &"
log cmdOut
Then look in your Indigo log to see what was recorded. Maybe there will be a hint there.


Sun Nov 08, 2009 3:06 pm
Profile

Joined: Mar 09, 2008
Posts: 183
Post 
berkinet wrote:Then look in your Indigo log to see what was recorded. Maybe there will be a hint there.

Indigo log shows a null entry:
Code: Select all
2009-11-08 16:34:56   Script   


Sun Nov 08, 2009 3:40 pm
Profile
User avatar

Joined: Nov 18, 2008
Posts: 1721
Location: Berkeley, CA
Post 
Well. Try this. Add a line to the shell script so that it produces some output when it runs...
Code: Select all
#!/bin/sh
while [ true ]
do
   echo "Script Started"
   /usr/bin/osascript "/Library/Application Support/Perceptive Automation/Test/PhoneValet Background Script.scpt"
   echo "Script Finished"
   EXCODE=$?
   DATE='date'
   /usr/bin/osascript "/Library/Application Support/Perceptive Automation/Test/indigoLogger.scpt PhoneValet Background Script.scpt $EXCODE"
done
exit 0
You should then see "Script Started" and maybe "Script Ended" in your out.log file. That will let you know you at least got to the line above where the PhoneValet script is run.

If you try this, remove the "set cmdOut" to from the AS command line, also remove the log cmdOut. If you don't remove the set, Indigo will hang waiting for output.


Sun Nov 08, 2009 4:08 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6651
Location: Austin, Texas
Post 
berkinet wrote:Well. Try this. Add a line to the shell script so that it produces some output when it runs...
Code: Select all
#!/bin/sh
while [ true ]
do
   echo "Script Started"
   /usr/bin/osascript "/Library/Application Support/Perceptive Automation/Test/PhoneValet Background Script.scpt"
   echo "Script Finished"
   EXCODE=$?
   DATE='date'
   /usr/bin/osascript "/Library/Application Support/Perceptive Automation/Test/indigoLogger.scpt PhoneValet Background Script.scpt $EXCODE"
done
exit 0
You should then see "Script Started" and maybe "Script Ended" in your out.log file. That will let you know you at least got to the line above where the PhoneValet script is run.

If you try this, remove the "set cmdOut" to from the AS command line, also remove the log cmdOut. If you don't remove the set, Indigo will hang waiting for output.


I suspect the problem is the spaces in the script file name...

_________________
Jay (Indigo Support)
Image


Sun Nov 08, 2009 4:54 pm
Profile WWW

Joined: Jul 14, 2008
Posts: 30
Post Event Log error
Jay-

I'm the one that started the whole PhoneValet variables not updating thing...

This morning, I happened to notice the following in the Indigo Event Log:

Nov 11, 2009 5:40:09 AM
Error script error: in file "PhoneValet Attachments.scpt"
Error script error: PhoneValet got an error: AppleEvent timed out. (-1712)
Error error dispatching event to attachment script (-1753)


So I performed the "ps" command, and the script had stopped.

Hopefully this tells you something.

Take care!

Jeff


Wed Nov 11, 2009 10:07 am
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6651
Location: Austin, Texas
Post Re: Event Log error
JeffS wrote:Jay-

I'm the one that started the whole PhoneValet variables not updating thing...

This morning, I happened to notice the following in the Indigo Event Log:

Nov 11, 2009 5:40:09 AM
Error script error: in file "PhoneValet Attachments.scpt"
Error script error: PhoneValet got an error: AppleEvent timed out. (-1712)
Error error dispatching event to attachment script (-1753)


So I performed the "ps" command, and the script had stopped.

Hopefully this tells you something.

Take care!

Jeff


Thanks for the info. Was PhoneValet running also? That error sorta implies that PhoneValet wasn't responding to apple events for some reason...

_________________
Jay (Indigo Support)
Image


Wed Nov 11, 2009 10:45 am
Profile WWW

Joined: Jul 14, 2008
Posts: 30
Post Full "ps" command results
Jay-

The full results for the "ps" command:

Jeff$ ps -axwww | grep Indigo
144 ?? 1:49.62 /Library/Application Support/Perceptive Automation/Indigo 4/IndigoServer.app/Contents/MacOS/IndigoServer
153 ?? 3:48.21 /Applications/Indigo 4.app/Contents/MacOS/Indigo 4 -psn_0_57358
173 ?? 1:30.56 python /Library/Application Support/Perceptive Automation/Indigo 4/IndigoWebServer/IndigoWebServer.py -i1176 -w8176 -cfn
174 ?? 0:55.67 python /Library/Application Support/Perceptive Automation/Indigo 4/IndigoSqlClient/IndigoSqlClient.py -i1176
13488 ttys000 0:00.00 grep Indigo


PhoneValet is running, and taking calls. I could do a full restart and show you the results again if it would help.

Jeff


Wed Nov 11, 2009 10:54 am
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6651
Location: Austin, Texas
Post Re: Full "ps" command results
JeffS wrote:Jay-

The full results for the "ps" command:

Jeff$ ps -axwww | grep Indigo
144 ?? 1:49.62 /Library/Application Support/Perceptive Automation/Indigo 4/IndigoServer.app/Contents/MacOS/IndigoServer
153 ?? 3:48.21 /Applications/Indigo 4.app/Contents/MacOS/Indigo 4 -psn_0_57358
173 ?? 1:30.56 python /Library/Application Support/Perceptive Automation/Indigo 4/IndigoWebServer/IndigoWebServer.py -i1176 -w8176 -cfn
174 ?? 0:55.67 python /Library/Application Support/Perceptive Automation/Indigo 4/IndigoSqlClient/IndigoSqlClient.py -i1176
13488 ttys000 0:00.00 grep Indigo


PhoneValet is running, and taking calls. I could do a full restart and show you the results again if it would help.

Jeff


Nah, unfortunately it wouldn't. We're still stumped why these scripts are just quitting.

_________________
Jay (Indigo Support)
Image


Wed Nov 11, 2009 11:49 am
Profile WWW

Joined: Mar 09, 2008
Posts: 183
Post 
I finally got around to getting berkinet's scripts to work, and captured the error code when the PhoneValet script died. I don't think it's going to help much..."0" is a normal exit....at least his coding provides a way to automatically restart the background scripts.


Code: Select all
2009-12-28 19:41:01   Background Script   Script PhoneValetBackgroundScript.scpt died with exit code 0 and was restarted
2009-12-28 19:41:01   Script   PhoneValet Background Script started


Fri Jan 01, 2010 9:03 am
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6651
Location: Austin, Texas
Post 
BillC wrote:I finally got around to getting berkinet's scripts to work, and captured the error code when the PhoneValet script died. I don't think it's going to help much..."0" is a normal exit....at least his coding provides a way to automatically restart the background scripts.


Code: Select all
2009-12-28 19:41:01   Background Script   Script PhoneValetBackgroundScript.scpt died with exit code 0 and was restarted
2009-12-28 19:41:01   Script   PhoneValet Background Script started


Exactly what I found - nothing. It seems to have slowed in terms of how often they die, but it still is happening about once a week - and it's almost always ALL of my background scripts. We're looking at adding more process management to scripts that live in the background scripts folder for the next major revision of Indigo.

_________________
Jay (Indigo Support)
Image


Fri Jan 01, 2010 12:01 pm
Profile WWW

Joined: Mar 09, 2008
Posts: 183
Post Re: Indigo-PhoneValet Integration
New behavior (sort of): I'm seeing this, triggered by a new message, and cycled at ~20 sec intervals until I changed the message flag:
Code: Select all
Mar 9, 2010 9:39:12 AM
  PhoneValet         New voicemail from: XXXXXX
  Background Script  Script PhoneValetBackgroundScript.scpt died with exit code 0 and was restarted
  Script             PhoneValet Background Script started

Mar 9, 2010 9:39:35 AM
  Background Script  Script PhoneValetBackgroundScript.scpt died with exit code 0 and was restarted
  Script             PhoneValet Background Script started

Mar 9, 2010 9:39:56 AM
  Background Script  Script PhoneValetBackgroundScript.scpt died with exit code 0 and was restarted
  Script             PhoneValet Background Script started
 
Mar 9, 2010 9:40:17 AM /same entries/

Mar 9, 2010 9:40:38 AM /same entries/

Mar 9, 2010 9:40:59 AM /same entries/

Mar 9, 2010 9:41:20 AM /same entries/

Mar 9, 2010 9:41:41 AM /same entries/

Mar 9, 2010 9:42:01 AM /same entries/

Mar 9, 2010 9:42:22 AM /same entries/

Mar 9, 2010 9:42:44 AM /same entries/

Mar 9, 2010 9:43:05 AM /same entries/

Mar 9, 2010 9:43:26 AM /same entries/

Mar 9, 2010 9:43:47 AM /same entries/

Any more ideas?


Tue Mar 09, 2010 8:53 am
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6651
Location: Austin, Texas
Post Re: Indigo-PhoneValet Integration
Nope. We're really quite baffled why it happens and what causes it. Have you rebooted? It looks to me like something quite bad is going on in your case.

_________________
Jay (Indigo Support)
Image


Tue Mar 09, 2010 9:58 am
Profile WWW

Joined: Mar 09, 2008
Posts: 183
Post Re: Indigo-PhoneValet Integration
Yeah, weird, isn't it? That server (it's a mini still running OS X 10.5, by the way) was rebooted about a week ago. I'm going to reboot again. May try going to Snow Leopard, too.


Wed Mar 10, 2010 7:34 am
Profile

Joined: Mar 09, 2008
Posts: 183
Post Bug swatted!
Jay et al...

Finally got around to troubleshooting this (again!) and found the error that causes the script to die, plus another bug. It only was crashing when an unplayed message was present.

This line in the Phone Valet Background Script from the library:
Code: Select all
tell application "Play Sound" to play (alias alertSound) repeat (theNewCallCount - 1) at volume alertSoundVolume

needs to read:
Code: Select all
tell application "Play Sound" to play (alertSound) repeat (theNewCallCount) - 1 at volume alertSoundVolume


The "alias" was causing a "File not found" error. Moving the "-1" outside the parentheses cured the crash. Wish I was more fluent in Applescript....I think I'd have spotted that earlier.


Sun Aug 01, 2010 11:00 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 87 posts ]  Go to page: Previous  1, 2, 3, 4, 5, 6  Next

Who is online

Users browsing this forum: wiery and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.