The ModMyTM Family of Sites:
ModMyMotoModMyiModMyGphone




 
 
Register or Connect with Facebook

2.2 Unlock / Jailbreak OS X | Discuss AppStore Apps | Browse / Search Cydia | MMi Cydia Stats




  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > 3rd Party Apps Requests
Reply
 
LinkBack Thread Tools Display Modes
  #31 (permalink)  
Old 07-31-2008, 09:23 AM
Green Apple
 
Join Date: Oct 2007
Posts: 96
Thanks: 1
Thanked 10 Times in 9 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, 09:29 AM
Green Apple
 
Join Date: Sep 2007
Posts: 94
Thanks: 0
Thanked 2 Times in 2 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, 10:53 AM
Green Apple
 
Join Date: Oct 2007
Posts: 96
Thanks: 1
Thanked 10 Times in 9 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 10:53 AM.. Reason: Automerged Doublepost
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #34 (permalink)  
Old 07-31-2008, 11:37 AM
Green Apple
 
Join Date: Sep 2007
Posts: 94
Thanks: 0
Thanked 2 Times in 2 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 11:55 AM..
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #35 (permalink)  
Old 07-31-2008, 01:40 PM
Green Apple
 
Join Date: Oct 2007
Posts: 96
Thanks: 1
Thanked 10 Times in 9 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, 02:51 PM
Green Apple
 
Join Date: Sep 2007
Posts: 94
Thanks: 0
Thanked 2 Times in 2 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 02:51 PM.. Reason: Automerged Doublepost
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #37 (permalink)  
Old 07-31-2008, 03: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, 04:19 PM
Green Apple
 
Join Date: Sep 2007
Posts: 94
Thanks: 0
Thanked 2 Times in 2 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 04:19 PM.. Reason: Automerged Doublepost
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #39 (permalink)  
Old 07-31-2008, 09:11 PM
Green Apple
 
Join Date: Oct 2007
Posts: 96
Thanks: 1
Thanked 10 Times in 9 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, 09:53 PM
Green Apple
 
Join Date: Sep 2007
Posts: 94
Thanks: 0
Thanked 2 Times in 2 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 07-31-2008, 11:57 PM
iPhone? More like MyPhone
 
Join Date: Apr 2008
Device + Firmware: iPhone
Posts: 146
Thanks: 20
Thanked 2 Times in 2 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, 03: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 03:03 AM.. Reason: Automerged Doublepost
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #43 (permalink)  
Old 08-01-2008, 05:42 AM
Green Apple
 
Join Date: Sep 2007
Posts: 94
Thanks: 0
Thanked 2 Times in 2 Posts

Quote:
Originally Posted by bhuga View Post
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*.
What value would this return as the If statement is not working... when checking for if [ "" -gt 0 ] or the other.

Actually, my code works... checks If there is a new message from NOC play repeat sound, otherwise it plays the default sound ONCE. Maybe just symantics, but it will NOT play repeat for anything message unless it's from NOC.

I will try this code as well. I did try using simular code before but it seemed to sound the repeat for all new mail. Will try again. Thanks...

Last edited by interstink; 08-01-2008 at 05:52 AM..
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #44 (permalink)  
Old 08-01-2008, 06:25 AM
What's Jailbreak?
 
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

Quote:
Originally Posted by interstink View Post
What value would this return as the If statement is not working... when checking for if [ "" -gt 0 ] or the other.

Actually, my code works... checks If there is a new message from NOC play repeat sound, otherwise it plays the default sound ONCE. Maybe just symantics, but it will NOT play repeat for anything message unless it's from NOC.

I will try this code as well. I did try using simular code before but it seemed to sound the repeat for all new mail. Will try again. Thanks...
n will be the number of messages unread from the NOC.

I'm sorry, but your code will behave the same for any unread message if you have a message from the NOC at all. Try not deleting a NOC message and sending yourself another one, from another phone.

The total code should be (you can remove the playaudio and sql variables if you install Erica's Utilities):

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

while test 1
do
n=` /private/var/mobile/Library/SMS/sms.db 'select count(*) from message where flags=0 and address=5151212'`;
if [ "" -gt 0 ]
then
  &
fi
sleep 10
done
I also needed to kill the play command, as it looped the ringtone for me. See my earlier post.
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
  #45 (permalink)  
Old 08-01-2008, 06:36 AM
Green Apple
 
Join Date: Sep 2007
Posts: 94
Thanks: 0
Thanked 2 Times in 2 Posts

Quote:
Originally Posted by bhuga View Post
n will be the number of messages unread from the NOC.

I'm sorry, but your code will behave the same for any unread message if you have a message from the NOC at all. Try not deleting a NOC message and sending yourself another one, from another phone.

The total code should be (you can remove the playaudio and sql variables if you install Erica's Utilities):

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

while test 1
do
n=` /private/var/mobile/Library/SMS/sms.db 'select count(*) from message where flags=0 and address=5151212'`;
if [ "" -gt 0 ]
then
  &
fi
sleep 10
done
I also needed to kill the play command, as it looped the ringtone for me. See my earlier post.

OH... I see what you mean. Its rare I need to worry about new messages after a NOC warning. But I think I did notice that. Your code didnt work...

BUT... This code Works!


#!/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 and address=5151212'`;
if [ "$n" -gt 0 ]
then
$playaudio $nocaudiofile &
fi
sleep 10
done

Last edited by interstink; 08-01-2008 at 07:47 AM..
Digg StumbleUpon Delicious Reddit Newsvine Google Yahoo Thanks Reply With Quote
Reply

  Apple Forums & iPhone Forums, Mods, Hacks, News, Themes, Downloads, and more! | ModMyi.com > 3rd Party Apps For iPhone | iPod Touch > 3rd Party Apps Requests

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


Go to Top
ModMyI

All times are GMT -6. The time now is 02:58 PM. Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 | Dedicated Server Hosting by SingleHop | Copyright © 2007-09 by ModMy, LLC. All rights reserved.

RSS / Contact Us / / ModMyi Home / Archive / Privacy Statement / Top


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408