ModMyMotoModMyiModMyGphone







  Apple Forums | ModMyi.com | iPhone, iPod, Mac, OS X, Mods, More > 3rd Party Apps For iPhone | iPod Touch > 3rd Party Apps Requests
Reply
 
LinkBack Thread Tools Display Modes
  #31 (permalink)  
Old 07-31-2008, 10:23 AM
Green Apple
 
Join Date: Oct 2007
Posts: 87
Thanks: 1
Thanked 6 Times in 5 Posts

I don't know what the scheme for the db is, but I'm sure it probably has a column for number/sender etc, so that should be do-able.

Have you been able to play the sound? You can remove the condition around the playaudio command to make sure that is working?

Also you should run a ps -ax to make sure that smsnotify is being auto-launched by the daemon? Once you make any changes to the file you have to kill that pid and then the daemon will relaunch the new one
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #32 (permalink)  
Old 07-31-2008, 10:29 AM
Green Apple
 
Join Date: Sep 2007
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts

Quote:
Originally Posted by IvanRaide View Post
Have you been able to play the sound? ....
Also you should run a ps -ax to make sure that smsnotify is being auto-launched by the daemon? ...
NO... NO SOUND AT ALL. Maybe its my audio file. It's an .aiff file, but will try one of the default files the iPhone has.

And YES, verified its running and being auto-launched.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #33 (permalink)  
Old 07-31-2008, 11:53 AM
Green Apple
 
Join Date: Oct 2007
Posts: 87
Thanks: 1
Thanked 6 Times in 5 Posts

My 'play' command is working. You might want to try alarm.aiff (from the iphone) (thats the one I'm using) as a test.

Also, ssh into that dir and run the command locally (like './play alarm.aiff) and see if play works, that SHOULD work. (remember to use the new PLAY not the old playaudio)

I have my sound working, just NOT the condition.

I got it to WORK, FINALLY!

Just like playaudio, sqlite3 doesn't work either. You need to use Erica's NEW sqlite3. I thought I had already tested that, but that was it!!

So, does anyone know if they have build a new 'vibrate' function?

Last edited by IvanRaide; 07-31-2008 at 11:53 AM. Reason: Automerged Doublepost
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #34 (permalink)  
Old 07-31-2008, 12:37 PM
Green Apple
 
Join Date: Sep 2007
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts

Hmmm.. Play is not working.

iPhone:/usr/bin/smsnotify root# ./play alarm.aiff
Killed


Play and the alarm.aiff files are in this directory.

Last edited by interstink; 07-31-2008 at 12:55 PM.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #35 (permalink)  
Old 07-31-2008, 02:40 PM
Green Apple
 
Join Date: Oct 2007
Posts: 87
Thanks: 1
Thanked 6 Times in 5 Posts

'killed' is what I would get when I was running playaudio? You have the new Erica Utilities? If you run the 'play' in bin does it give you a 'killed'?

You have the permissions on 'play' set (755 and root:wheel, etc)? Not sure if its needed, but I set execute permission on alarm.aiff as well?
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #36 (permalink)  
Old 07-31-2008, 03:51 PM
Green Apple
 
Join Date: Sep 2007
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts

Quote:
Originally Posted by IvanRaide View Post
'killed' is what I would get when I was running playaudio? You have the new Erica Utilities? If you run the 'play' in bin does it give you a 'killed'?

You have the permissions on 'play' set (755 and root:wheel, etc)? Not sure if its needed, but I set execute permission on alarm.aiff as well?
I did install the latest Erica's Util. With the PLAY. I think I have Beta 11 now.

Yes permissions are set on ALL files.

UPDATE: GOT IT WORKING!!! Decided to REinstall sqlite and Erica's using Cydia.

Now... I found the sms.db database structure. Can you point me in the right direction for the select to get the number then see if its equal to 5551515



TABLE message
ROWID (INTEGER PRIMARY KEY AUTOINCREMENT)
Auto-incrementing field/counter

address (TEXT)
International-formatted foreign address
(18005551212)

date (INTEGER)
OSX-epoch based datetime, convertable via date -r
(1187200801)

text (TEXT)
Content of text message
(This is the text message)

flags (INTEGER)
Flags controlling the type of record
2 - Message sent from address to iPhone
3 - Message sent from iPhone to address
129 - Message log erased from iPhone but addressee still in SMS index

replace (INTEGER)
Unknown, always 0 in my case

svc_center (TEXT)
service center, seems null in my case

Last edited by interstink; 07-31-2008 at 03:51 PM. Reason: Automerged Doublepost
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #37 (permalink)  
Old 07-31-2008, 04:22 PM
What's Jailbreak?
 
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
How to do alerts by number.

Hi all, I'm fighting this problem with OS 2.0 too.

It's easy to get the number out of the sms table so that you can selectively alert for particular senders. Change the command to:

sqlite3 /private/var/mobile/Library/SMS/sms.db 'select count(*) from message where flags=0 and address="xyz"'

where xyz is your number. For me, it's formatted as +447(...). You can find the number like so:

sqlite3 /private/var/mobile/Library/SMS/sms.db 'select address from message where text like "%TEST PHRASE%";'

Replace 'TEST PHRASE' with a word that you've put into a test SMS message. You'll get a list of numbers with that word. Select the one you'll be getting your important messages from and plug it in as xyz above.

Further, while there doesn't appear to be a vibrate utility yet, the Erica Utilities 'play' command works fine for sounds. It's installable through Cydia, just like sqlite3. This is what I'm using:

play /private/var/stash/Ringtones.4JvOkg/Alarm.m4r &
sleep 3
kill $!

This will play the 'alarm' sound for 3 seconds.

All of this works fine. The problem that I haven't solved yet is that I can't find a way to make the phone either not sleep or wake up at a given time. Even with launchd running the daemon properly, the phone will still sleep and that's that. I've tried it with launchd running a script that loops, simply running that looping script, and by having launchd run a script that checks once and exits. Nothing will keep the phone awake.

I've done a lot of searching and have not found a way to make the phone stay awake--even people doing apps at the UI level are having trouble. You can, if you're diligent about turning the phone off, turn off auto-locking any any number of previously mentioned methods will work, using the stuff I've just posted. But that's no fun!
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #38 (permalink)  
Old 07-31-2008, 05:19 PM
Green Apple
 
Join Date: Sep 2007
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts

I did it like this:

noc=`$sql /private/var/mobile/Library/SMS/sms.db 'select address from message where address=5551515'`;
if [ "$noc" = 5551515 ]
then
$playaudio $NOCaudiofile &

Seems to work! But then you have to delete the message to get the audio to stop, so I need to add the count in there too.

OK... DONE for now... With CUSTOM Alerts!

This script will check to see if you get a match (51511212 is the number im matching in sample) and then repeat every 10 seconds. Nice for people monitoring servers. If you get a NEW text message thats NOT a match then it will simple play your default SMS sound in settings | sounds on the iPhone.

I left the "Count" so it will stop alerting when you view the Text Message, otherwise it continues to alert until you delete the message. Looks like I may expand this a bit more, but for now I have repeating NOC (Network Operations Center alerts).


#!/bin/sh
smsnpath=/usr/bin/smsnotify
sql=$smsnpath/sqlite3
playaudio=$smsnpath/play
nocaudiofile=$smsnpath/NOCalarm.m4a

while test 1
do
n=`$sql /private/var/mobile/Library/SMS/sms.db 'select count(*) from message where flags=0'`;
noc=`$sql /private/var/mobile/Library/SMS/sms.db 'select address from message where address=5151212'`;
if [ "$n" -gt 0 ] && [ "$noc" = 51511212 ]
then
$playaudio $nocaudiofile &
fi
sleep 10
done

Better ways of doing this? Please share...

Quote:
Originally Posted by bhuga View Post

...The problem that I haven't solved yet is that I can't find a way to make the phone either not sleep or wake up at a given time. Even with launchd running the daemon properly, the phone will still sleep and that's that. I've tried it with launchd running a script that loops, simply running that looping script, and by having launchd run a script that checks once and exits. Nothing will keep the phone awake.

I've done a lot of searching and have not found a way to make the phone stay awake--even people doing apps at the UI level are having trouble. You can, if you're diligent about turning the phone off, turn off auto-locking any any number of previously mentioned methods will work, using the stuff I've just posted. But that's no fun!
Seems the receipt of an SMS trigers the phone out of "deep" sleep and my repeat alarms are working. Had my phone sleeping over ten minutes and send a test, seemed to work fine.

Last edited by interstink; 07-31-2008 at 05:19 PM. Reason: Automerged Doublepost
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #39 (permalink)  
Old 07-31-2008, 10:11 PM
Green Apple
 
Join Date: Oct 2007
Posts: 87
Thanks: 1
Thanked 6 Times in 5 Posts

I had an SMS that I left unread and let the phone enter deep sleep. Even though i have push email on, the phone would periodically enter a lighter sleep, enough for SMSNofity to ping once or twice. The interval was around 1/2 hour but sometimes like 10 minutes, so something wakes it up a bit. I think it might be the iMAP idle timeout/heartbeat that wakes the device, but basically, this will eventually wake up a little to give some type of continuing notification system, (though NOT a great one)

Erica's new tools include something called 'notificationWatcher', which watches for standard or Core telephone notifications, but I'm not entirely clear on how you would use it?
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #40 (permalink)  
Old 07-31-2008, 10:53 PM
Green Apple
 
Join Date: Sep 2007
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts

I would also like some documentation for the watcher app.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #41 (permalink)  
Old 08-01-2008, 12:57 AM
iPhone? More like MyPhone
 
Join Date: Apr 2008
Device + Firmware: iPhone
Posts: 139
Thanks: 20
Thanked 0 Times in 0 Posts

I purchased the unlimited version of Kate for $45 because doing all the stuff for SMSnotify seemed way too complicated for me. I've been happy with it ever since. I changed the reminder sound to a custom one so that I can hear it even when I sleep, since the default ones were pretty quiet and short. I recommend Kate.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #42 (permalink)  
Old 08-01-2008, 04:03 AM
What's Jailbreak?
 
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

Quote:
while test 1
do
n=` /private/var/mobile/Library/SMS/sms.db 'select count(*) from message where flags=0'`;
noc=` /private/var/mobile/Library/SMS/sms.db 'select address from message where address=5151212'`;
if [ "" -gt 0 ] && [ "" = 51511212 ]
then
&
fi
sleep 10
done

Better ways of doing this? Please share...
Yes, as I posted, what you want is:
Code:
n=`sql /private/var/mobile/Library/SMS/sms.db 'select count(*) from message where flags=0 AND address=5151212'`
Your version says 'Play a sound if I have any unread messages and a message from the noc'. My version is 'Play a sound if I have an unread message *from the noc*.

Quote:
I had an SMS that I left unread and let the phone enter deep sleep. Even though i have push email on, the phone would periodically enter a lighter sleep, enough for SMSNofity to ping once or twice. The interval was around 1/2 hour but sometimes like 10 minutes, so something wakes it up a bit. I think it might be the iMAP idle timeout/heartbeat that wakes the device, but basically, this will eventually wake up a little to give some type of continuing notification system, (though NOT a great one)
While I could make the phone wake up, and it would play a few messages, it would always go back to 'deep sleep' and mine was not waking up. As I don't use the apple email stuff (I use the gmail stuff, which does not poll), I'm not waking up on anything, but I'll check into that. Thanks.

Quote:
Erica's new tools include something called 'notificationWatcher', which watches for standard or Core telephone notifications, but I'm not entirely clear on how you would use it?
I didn't actually see this binary in the package from Cydia, even though it's on the list on her website. I was curious too.

Quote:
Originally Posted by dis1krazyazn View Post
I purchased the unlimited version of Kate for $45 because doing all the stuff for SMSnotify seemed way too complicated for me. I've been happy with it ever since. I changed the reminder sound to a custom one so that I can hear it even when I sleep, since the default ones were pretty quiet and short. I recommend Kate.
I looked this up and it's exactly what I want. Does it work on a Gen-1 Iphone running the new software, if Jailbroken?

Last edited by bhuga; 08-01-2008 at 04:03 AM. Reason: Automerged Doublepost