Active Topics

 


Reply
Thread Tools
Posts: 53 | Thanked: 12 times | Joined on Mar 2010
#1
HI everyone,

Mobilicity is my provider, and it doesn't support incoming Unicode messages yet. Instead, it displays each unicode character as a pair of characters from GSM 03.38.

I want to write a bit of code to detect this and to display these messages as proper unicode on my phone.

How do I intercept incoming SMS messages and modify their content?
 

The Following User Says Thank You to stas123 For This Useful Post:
Captwheeto's Avatar
Posts: 302 | Thanked: 193 times | Joined on Oct 2008 @ England
#2
Look into working with the dbus? I wish I knew too, I'd like to grep and less my messages but I don't think they're stored plaintext anywhere.

I don't actually know much about this but hope someone else can help
 
Posts: 1,341 | Thanked: 708 times | Joined on Feb 2010
#3
look how SMScon does it
 

The Following User Says Thank You to zimon For This Useful Post:
Posts: 958 | Thanked: 483 times | Joined on May 2010
#4
does SMScon modify the messages and reinsert them into the inbox? i'm looking for a solution to this. reason the operator i'm on sends missed call smses with the phone number of the person who called. problem is, it doesn't do a lookup against my phone book so i have no idea who's calling until i tap on the number.

i'm trying to write a bit of code to watch for incoming smses, grab the body of the sms, then check a few things like FROM and body of the text to figure out if it's in the right format before doing a phone book lookup and injecting the contact's name into the sms.
 
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#5
Listen on dbus for incoming txt message. Then read txt from inbox sqlite db, make changes then write it back to sql db.
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 

The Following User Says Thank You to vi_ For This Useful Post:
Posts: 958 | Thanked: 483 times | Joined on May 2010
#6
finally got around to writing the code in python. the aboe suggestion doesn't work. my dbus handler is called first before the sms is inserted into the sqlite db. i have to use time.sleep() to poll the db...not a good approach. any ideas anyone??

race condition problem. sigh.
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#7
Hi droll,

here is a small python example that uses the "NewEvent" signal
from rtcom-eventlogger. This example reads incoming messages
from the db and changes the messagetext to uppercase.
BUT, the conversion app is listening on the "NewEvent"
signal too, and it reads the message before you can change it.
So you have to close and reopen the conversation app, to
see the new updated text.

Code:
import dbus, gobject
import sqlite3 as db
from dbus.mainloop.glib import DBusGMainLoop

con = None
def new_msg_func(id, local_uid, remote_uid, remote_ebook_uid, group_uid, service):
  #handle only chat/sms events
  if service != "RTCOM_EL_SERVICE_SMS" and service!="RTCOM_EL_SERVICE_CHAT":
     return
  
  cur = con.cursor()
  # select free_text (message body) and outgoing/incoming flag
  cur.execute("select free_text,outgoing from events where id = ?", (id,));
  data = cur.fetchone()

  #incoming (0) or outgoing (1) message?
  if data[1] == 0:
    # update message
    cur.execute("update events set free_text = ? where id = ?", (data[0].upper(), id))
 

dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
bus.add_signal_receiver(new_msg_func, dbus_interface="rtcomeventlogger.signal", signal_name="NewEvent")
con = db.connect('/home/user/.rtcom-eventlogger/el-v1.db', isolation_level=None)
loop = gobject.MainLoop()
loop.run()
 

The Following 3 Users Say Thank You to nicolai For This Useful Post:
Posts: 958 | Thanked: 483 times | Joined on May 2010
#8
thanx nicolai! got your code patches into mine in 3 minutes and it works like a charm! danke danke

as for the conversation app issue, it is a small annoyance for the app i am writing. i have a theory on how to force it to refresh but since i'm new to python, it'll take me a while to hack something up.

nevertheless, thanks again!

Last edited by droll; 2012-04-07 at 10:42.
 

The Following User Says Thank You to droll For This Useful Post:
Posts: 958 | Thanked: 483 times | Joined on May 2010
#9
it's actually a small pet project that i did with a carry over history from the windows mobile 6 days. the script is mostly done and works quite well. but since you are on harmattan, i doubt it would work for you. sorry.
 
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#10
Originally Posted by Sorrow View Post
[s]droll
Im' eager to see your app for putting Contact name into "missed call" sms. Wanted!
This would be nice feature to have, and I'm *very* glad that we might have this for Maemo
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 
Reply


 
Forum Jump


All times are GMT. The time now is 20:47.