Reply
Thread Tools
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#1
I am changing a mobile (for our American friends: "cell") provider and have decided to take this opportunity to not migrate my old number but start afresh to get rid of all the spam. The trouble is, I've had that number for over 15 years and have no idea how many people and companies I do want to hear from have it.

So I concocted a plan to update my voicemail prompt with something like, "this number is no longer valid, please call XYZ instead".

However, the vast majority of my mobile communication by far - about 99.95% - is by SMS.

So my idea is, setting up one of my spare N900s with my old SIM and some app or a script or whatever that would automatically reply to any incoming SMS with a prompt to update their address book - and leaving it running for a year or so, or until the credit runs out, whichever comes sooner.

Now, I am aware of SMSCON but have no experience with it. Having read its wiki, I am not entirely convinced it is cut out for the job. I do not want to set up a master number and definitely cannot expect people sending me messages to include special codes in them. I just want it to autoreply to any incoming message with a predefined text. Kinda like an SMS equivalent of an "out of the office" email.

Any ideas? Before I take the SMSCON code and start hacking it into shape
 

The Following User Says Thank You to pichlo For This Useful Post:
Posts: 958 | Thanked: 3,426 times | Joined on Apr 2012
#2
See this for sending an SMS from a script; but I don't know how to trigger a script on an incoming message.
 

The Following 4 Users Say Thank You to taixzo For This Useful Post:
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#3
Thanks. I was planning to use smssend for the sending but your solution is just as good if not better as it does not require an extra package installed.

The remaining question is, how to trigger a command from receiving an SMS. I have a feeling that dbus might be somehow involved but despite having spent the last 25 years of my life writing software for a living, dbus remains a big mystery to me
 
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#4
(should be) definitely possible.
Phone control is the easy way to go for sending.

And for triggering you are right dbus Hyes, a big mistery ) is involved. Have a look at dbus-scripts-settings (a package). This allows all user configurable actions (scripts).
Unfortunately I do not know the syntax for incoming SMS.
But for calls something like this is working for me here.

~ $ cat /etc/dbus-scripts.d/call
# This file was generated by dbus-scripts-settings
# If you edit it by hand you might confuse the program,
# and you might lose your changes next time the program runs.

#:call_start
/opt/scripts/call_start.sh * * com.nokia.mce.signal sig_call_state_ind active normal

#:call_end
/opt/scripts/call_end.sh * * com.nokia.mce.signal sig_call_state_ind none normal
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
jellyroll's Avatar
Posts: 435 | Thanked: 684 times | Joined on Apr 2012 @ Netherlands 020
#5
http://smstools3.kekekasvi.com/
http://wammu.eu/

Last edited by jellyroll; 2015-07-19 at 16:31.
 

The Following 2 Users Say Thank You to jellyroll For This Useful Post:
Posts: 1,100 | Thanked: 2,797 times | Joined on Apr 2011 @ Netherlands
#6
The code can be literally found on the related wiki page (https://wiki.maemo.org/PyMaemo/Phone...d_SMS_examples)


HTML Code:
import gobject, dbus
from dbus.mainloop.glib import DBusGMainLoop
 
def handle_sms(pdu, msgcenter, somestring, sendernumber):
    print 'New message from %s' % sendernumber
 
DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
bus.add_signal_receiver(handle_sms, path='/com/nokia/phone/SMS',   dbus_interface='Phone.SMS', signal_name='IncomingSegment')
gobject.MainLoop().run()
I have not tested this, but I used to have a similar script to act on incoming phonecalls.
 

The Following 3 Users Say Thank You to ade For This Useful Post:
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#7
Originally Posted by ade View Post
HTML Code:
DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
bus.add_signal_receiver(handle_sms, path='/com/nokia/phone/SMS',   dbus_interface='Phone.SMS', signal_name='IncomingSegment')
gobject.MainLoop().run()
I have not tested this, but I used to have a similar script to act on incoming phonecalls.
Then with dbus-scripts something like
action-script.sh * * com.nokia.phone.sms IncomingSegment
should work, too.
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 
Posts: 1,038 | Thanked: 3,980 times | Joined on Nov 2010 @ USA
#8
Originally Posted by ade View Post
The code can be literally found on the related wiki page (https://wiki.maemo.org/PyMaemo/Phone...d_SMS_examples)


I have not tested this, but I used to have a similar script to act on incoming phonecalls.
I've read through that page looking for exactly this same thing and missed it, not really knowing what "IncomingSegment" meant. That and the disclaimer at the top and paucity of headings. And my total ignorance of dbus.

Maybe I can finally write that SMS Eliza-bot to chat with my wife when she texts me.
 

The Following User Says Thank You to robthebold For This Useful Post:
Posts: 1,038 | Thanked: 3,980 times | Joined on Nov 2010 @ USA
#9
Originally Posted by taixzo View Post
See this for sending an SMS from a script; but I don't know how to trigger a script on an incoming message.
This one requires the QtMobility library to be installed. When I was writing my "panic button" script, I didn't have that installed and instead of investigating further I used part of the python dbus script (two examples down from ssms.py on the "Phone control" page) instead.
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 08:35.