![]() |
Modify (mangle) incoming SMS messages?
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? |
Re: Modify (mangle) incoming SMS messages?
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 |
Re: Modify (mangle) incoming SMS messages?
look how SMScon does it
|
Re: Modify (mangle) incoming SMS messages?
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. |
Re: Modify (mangle) incoming SMS messages?
Listen on dbus for incoming txt message. Then read txt from inbox sqlite db, make changes then write it back to sql db.
|
Re: Modify (mangle) incoming SMS messages?
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. |
Re: Modify (mangle) incoming SMS messages?
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 |
Re: Modify (mangle) incoming SMS messages?
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! |
Re: Modify (mangle) incoming SMS messages?
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.
|
Re: Modify (mangle) incoming SMS messages?
Quote:
|
Re: Modify (mangle) incoming SMS messages?
i face a different issue now. i hv managed to find a way for the conversation app to update itself. however. i hv issues with the yellow notification bubble.
first, it shows the old contentof the sms. i can live with that. but when i tap on it, it opens up a conversation view for the new sms and it shows the old content as well even though the sqlite db has been updated and the conversation ui too has been updated to show the new contents of the sms. some kinda caching going on?? |
Re: Modify (mangle) incoming SMS messages?
which component / class handles all this?
is there a way i can force the conversation / thread view for the sms to be updated?? it seems disconnected from the main conversation view (the one that shows the list of smses). |
Re: Modify (mangle) incoming SMS messages?
1 Attachment(s)
i checked dbus and saw the RefreshHint signal being issued when i do some stuff in the conversations app to change the underlying messages. manually issuing this signal with dbus-send does nothing. sigh.
guess this will have to be a limitation that i have to live with. :( to anyone interested in this little script, i've attached it in this message. btw, i don't take credit for a lot of the code inside. i'm new to python so i just went around piecing bits and pieces of other people's work. :) installation is simple enough. drop to x-term and run it in the background like so "python NameLookup.py &" it currently watches for incoming smses from "Maxis" and "Voicemail". that's the way it works for the telcos where i live anyway. i could change it to be more generic and watch for any sms messages that has phone numbers in the body and do a name lookup if people are interested. thanks. |
Re: Modify (mangle) incoming SMS messages?
1 Attachment(s)
fixed some stoopid bugs in the script during text parng. here is the updated version.
i've also changed the behaviour so that any incoming smses with phone numbers in them gets the name lookup treatment. probably more useful to everyone. hv a nice day :) |
Re: Modify (mangle) incoming SMS messages?
Works on DiGi (MY)... ^_^
|
Re: Modify (mangle) incoming SMS messages?
thank you. oi, reply to the draw something request la.... :P
|
All times are GMT. The time now is 05:46. |
vBulletin® Version 3.8.8