maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   SMS from CLI (Command Line)? (https://talk.maemo.org/showthread.php?t=36148)

jchammons 2009-12-30 00:19

Re: SMS from CLI (Command Line)?
 
I was thinking about this yesterday and then saw this post on the side of the front page. Thank you! Thank you! Thank you!

白い熊 2009-12-30 09:39

Re: SMS from CLI (Command Line)?
 
Quote:

Originally Posted by shaunramos (Post 445928)
The script now would ask for the number and the message and can also schedule sending. Updated script is right here:
http://www.paraiso.dk/pymaemosms.txt.

Can you modify it, so it accepts these as arguments and doesn't stop execution and ask, so it can be used in shell scripts?

RDJEHV 2009-12-30 12:12

Re: SMS from CLI (Command Line)?
 
can something like this be made for sending sms trough a skype account from the n900 to any other phone?

houz 2009-12-30 16:18

Re: SMS from CLI (Command Line)?
 
Awesome work!

Thanks to both of you :)

shaunramos 2009-12-31 01:28

Re: SMS from CLI (Command Line)?
 
I made the script more interactive but you can of course change it so that it accepts arguments instead. Just use python's sys.argv. If i have the time, i will change it so that it can support both.

Also, if anyone is interested, i have made another sample script listens to incoming messages. I placed the link in the pymaemo wiki:
http://wiki.maemo.org/PyMaemo#Examples or you can also read it directly here: http://www.paraiso.dk/incomingsms.txt

regards,
shaun

morgon 2009-12-31 01:49

Re: SMS from CLI (Command Line)?
 
This is really good stuff, but would it be possible to organize this knowledge in a slightly different way?

I plan to use Perl when I get my N900 and so I don't need a lot of Python-code that (for me) just obscures the core information.

What I would like to have is bascially just a compendium of how the N900's functions (SMS-sending, SMS-receiving etc etc) maps to the D-Bus.

Something like: "for incoming SMS listen for 'IncomingSegment'-signals from /com/nokia/phone/SMS, interface Phone.SMS on the systembus".

Does such an overview already exist somewhere? (If not I will create it when I have time on the weekend).

白い熊 2009-12-31 11:32

Re: SMS from CLI (Command Line)?
 
Quote:

Originally Posted by shaunramos (Post 447465)
I made the script more interactive but you can of course change it so that it accepts arguments instead. Just use python's sys.argv. If i have the time, i will change it so that it can support both.

I'll take a look, haven't messed with Python so far...

Quote:

Also, if anyone is interested, i have made another sample script listens to incoming messages. I placed the link in the pymaemo wiki:
This is good stuff, haven't looked yet, but assumed you've utilized some dbus hooks, that get triggered when SMSes come in.

In case you've studied it, are you aware of which hooks could be used to catch call inception and call end.

I'm asking since I already programmed elisp code for Emacs's BBDB to initiate calling, and automatically record, who you've called etc. including the call time to BBDB database, however, I don't know which hooks to catch to check for actual call inception and end, so what happens to me now:

1. All calls are recorded as zero length, since Emacs dials the numer via dbus, which immediately exits, and Emacs catches this as call end time.
2. Even if the call doesn't connect, i.e. the line is busy, the user picks up, it gets recorded as a call made.

Therefore you need to somehow check for call start and end...

shaunramos 2010-01-02 00:41

Re: SMS from CLI (Command Line)?
 
Quote:

Originally Posted by 白い熊 (Post 447781)
I'll take a look, haven't messed with Python so far...



This is good stuff, haven't looked yet, but assumed you've utilized some dbus hooks, that get triggered when SMSes come in.

In case you've studied it, are you aware of which hooks could be used to catch call inception and call end.

I'm asking since I already programmed elisp code for Emacs's BBDB to initiate calling, and automatically record, who you've called etc. including the call time to BBDB database, however, I don't know which hooks to catch to check for actual call inception and end, so what happens to me now:

1. All calls are recorded as zero length, since Emacs dials the numer via dbus, which immediately exits, and Emacs catches this as call end time.
2. Even if the call doesn't connect, i.e. the line is busy, the user picks up, it gets recorded as a call made.

Therefore you need to somehow check for call start and end...

I use the dbus-monitor to check for hooks. Run the dbus-monitor, make a call, end the call. Stop the monitor and check the log. You should then be able to see the hooks you need.

regards,
shaun

pende 2010-01-02 11:34

Re: SMS from CLI (Command Line)?
 
Hi there,

I added some code and now you are able to send sms and receive a reply. Code is available for download here http://ztbsauer.com/sender.py

For now it replies only for one command but feel free to expand it for own needs.

hawaii 2010-01-10 03:04

Re: SMS from CLI (Command Line)?
 
I know the cellular stack supports it, are there any libraries for sending class 0 or "flash" SMS?


All times are GMT. The time now is 03:31.

vBulletin® Version 3.8.8