Page 3 of 3 FirstFirst 123
Results 41 to 53 of 53

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Repeating SMS and email Alerts - (LIKE PHONEALARM for WM!)

  1. #41
    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.

  2. #42
    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*.

    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.

    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; 2008-08-01 at 11:03 AM. Reason: Automerged Doublepost

  3. #43
    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; 2008-08-01 at 01:52 PM.

  4. #44
    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.

  5. #45
    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; 2008-08-01 at 03:47 PM.

  6. #46
    Quote Originally Posted by bhuga
    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?
    I would think so. But just incase, you can email them at [email protected] to ask. After I first purchased Kate, it wouldn't show in my settings, so I had to email them for that and they replied within the next couple of hours. Their support is really good and they always replied back to me within a day.

    In case you do get it, I'll tell you ahead of time that the reminder sound is actually SIMToolKitGeneralBeef.caf in /System/Library/Audio/UISounds. And then any .caf files you put under /var/mobile/Library/RiPDev/Sounds can actually just be the custom sms sounds for when you first receive a text. It's a waaay quicker than overwriting the default sms-received files for setting your sms sounds to a custom one. So that's another cool thing I love too
    Last edited by dis1krazyazn; 2008-08-01 at 09:13 PM.

  7. #47
    Default Check emails too
    I found the mail database and from there you can look for unread messages with different attributes.

    if [ `echo 'select count(*) from messages where read="0" and _to like "[email protected]%";' | sqlite3 /var/mobile/Library/Mail/Envelope\ Index` -gt 0 ]

    In this example it checks for email going to a dedicated yahoo push email box. But you can query for other attributes:

    strings /var/mobile/Library/Mail/Envelope\ Index | less
    SQLite format 3
    messages
    H{[r
    Hw{C
    Ktablemessagesmessages

    CREATE TABLE messages (ROWID INTEGER PRIMARY KEY AUTOINCREMENT,
    remote_id INTEGER,
    sender,
    subject,
    _to,
    cc,
    date_sent INTEGER,
    date_received INTEGER,
    sort_order INTEGER,
    mailbox INTEGER,
    remote_mailbox INTEGER,
    original_mailbox INTEGER,
    flags INTEGER,
    read,
    flagged,
    deleted,
    size INTEGER,
    color,
    encoding,
    content_type)

    So you should be able to filter by subject, sender, etc or any combination

    I have no idea how to do it, but it would be nice to have a configuration file where you could setup filters to notify on.

  8. #48
    here is the original SMSnotify 2.0 (.sh) file jusy for reference


    #!/bin/bash

    SMSNOTIFY_PATH=/usr/local/smsnotify

    while test 1
    do
    if [ `echo 'select count(*) from message where flags=0;' | sqlite3 /var/mobile/Library/SMS/sms.db` -gt 0 ]
    then
    #Each parameter to vibrate is 1 more vibration, so vibrate 3 times
    $SMSNOTIFY_PATH/vibrate 1 1
    sleep 3
    fi
    if [ `echo 'select count(*) from voicemail where flags & 1 == 0;' | sqlite3 /var/mobile/Library/Voicemail/voicemail.db` -gt 0 ]
    then
    #vibrate 2 times
    $SMSNOTIFY_PATH/vibrate 1
    sleep 3
    fi
    #This program sleeps for 5 seconds then checks how long it's been sleeping. If it's been more than 10 seconds the phone has slept and it exits, allowing the loop to continue
    $SMSNOTIFY_PATH/waitforsleep
    done

  9. #49
    Does anyone know if there is a way to detect if the silent switch is activated through the command line? I added "play alert.caf" to my smsnotify script, but it will play the alert even if the phone is on vibrate only. I'd like to put an if statement around that play line and only play it if it's supposed to be making sounds.

    I wonder if this could be done through Erica's deviceinfo -a program. In the help it says you can do deviceinfo -a backlight-level and others from the "io registry" I wonder if the silent switch is in the io registry? How do I find what values are there to look at?
    Last edited by jkusnetz; 2008-08-12 at 01:24 AM. Reason: Automerged Doublepost

  10. #50
    I tried to do a time check within this script. Unable to set time restrictions. I tried using the DATE command and parse out the time/HOUR which works, but doesnt work witin this script. Anyone have ideas how to add...

    if HOUR > 23 (11:00pm)
    do this
    else do this

    thanks...

  11. #51
    Having a strange issue now... Not sure if this was an issue before...

    When smsnotify is triggered to play a sound, it seems to lower the volume of the iphone to medium level. when I go check it in the sound settings, the sound level is indeed at half volume. This happens every time I get notified using smsnotify.

    Is this the PLAY file from Erica's utility doing this?

  12. #52
    Quote Originally Posted by interstink View Post
    Having a strange issue now... Not sure if this was an issue before...

    When smsnotify is triggered to play a sound, it seems to lower the volume of the iphone to medium level. when I go check it in the sound settings, the sound level is indeed at half volume. This happens every time I get notified using smsnotify.

    Is this the PLAY file from Erica's utility doing this?
    this happens to me to. but I think SMSNotifty's alert volume gose off the ipod.apps level cause if u max that ipod.apps volume it reflects that in the smsnotify's audio alert... that make sense, give it a try you'll see

  13. #53
    Livin the iPhone Life
    Join Date
    May 2008
    Posts
    8,021
    Thanks
    102
    Thanked 789 Times in 731 Posts

    Everything is working as advertised .......... but ...............

    I was customizing smsnotify.sh script for my preference and while running ps -ax I noticed the following process right after vibrate exits:

    352 ?? 0:01.07 /System/Library/CoreServices/ReportCrash

    It appears vibrate is causing a crash (if I read this correctly), although I am unable to locate a log entry anyplace.

    I used this simple test to verify the crash:

    From WinSCP (/usr/local/smsnotify directory) / Commands / Open Terminal
    Enter the following command:
    ./vibrate & ps -ax;sleep 1;ps -ax

    Notice the RemoteCrash (pid 352) :

    /usr/local/smsnotify$ ./vibrate & ps -ax;sleep 1;ps -ax
    PID TTY TIME CMD
    1 ?? 0:01.59 /sbin/launchd
    12 ?? 0:00.64 /usr/sbin/mDNSResponder -launchd
    13 ?? 0:01.21 /usr/sbin/notifyd
    14 ?? 0:01.22 /usr/sbin/syslogd
    15 ?? 0:05.91 /usr/sbin/configd
    19 ?? 0:00.27 /usr/sbin/update
    20 ?? 0:02.77 /usr/libexec/lockdownd
    23 ?? 0:01.65 /System/Library/PrivateFrameworks/IAP.framework/Support/iapd
    24 ?? 0:00.42 /usr/sbin/fairplayd
    25 ?? 0:27.66 /System/Library/CoreServices/SpringBoard.app/SpringBoard
    29 ?? 0:01.27 /usr/sbin/BTServer
    41 ?? 0:02.49 /System/Library/PrivateFrameworks/CoreTelephony.framework/Support/CommCenter
    50 ?? 0:01.00 /var/stash/Applications/MobilePhone.app/MobilePhone
    131 ?? 0:01.49 /usr/sbin/sshd -i
    132 ?? 0:00.78 -sh
    339 ?? 0:00.21 /usr/libexec/amfid
    344 ?? 0:00.89 /usr/sbin/mediaserverd
    350 ?? 0:00.05 (vibrate)
    351 ?? 0:00.01 ps -ax
    PID TTY TIME CMD
    1 ?? 0:01.60 /sbin/launchd
    12 ?? 0:00.64 /usr/sbin/mDNSResponder -launchd
    13 ?? 0:01.21 /usr/sbin/notifyd
    14 ?? 0:01.22 /usr/sbin/syslogd
    15 ?? 0:05.91 /usr/sbin/configd
    19 ?? 0:00.27 /usr/sbin/update
    20 ?? 0:02.77 /usr/libexec/lockdownd
    23 ?? 0:01.65 /System/Library/PrivateFrameworks/IAP.framework/Support/iapd
    24 ?? 0:00.42 /usr/sbin/fairplayd
    25 ?? 0:27.66 /System/Library/CoreServices/SpringBoard.app/SpringBoard
    29 ?? 0:01.27 /usr/sbin/BTServer
    41 ?? 0:02.49 /System/Library/PrivateFrameworks/CoreTelephony.framework/Support/CommCenter
    50 ?? 0:01.00 /var/stash/Applications/MobilePhone.app/MobilePhone
    131 ?? 0:01.49 /usr/sbin/sshd -i
    132 ?? 0:00.78 -sh
    339 ?? 0:00.24 /usr/libexec/amfid
    344 ?? 0:00.89 /usr/sbin/mediaserverd
    352 ?? 0:01.07 /System/Library/CoreServices/ReportCrash
    354 ?? 0:00.01 ps -ax

    I think we have a problem (apparently with vibrate)

    Ideas? Solutions?

    (Note: Just in case was I wasn't clear --- it does vibrate!! )

    Mes
    Last edited by Mes; 2008-09-22 at 10:19 PM.

Page 3 of 3 FirstFirst 123
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •