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)

krk969 2010-05-18 13:31

Re: SMS from CLI (Command Line)?
 
if I may suggest another option, Tpsession is even simpler to use in case it helps you. Its a wrapper over the telepathy libs, if you dont want to get your hands dirty ;)
http://tpsession.garage.maemo.org/

tremby 2010-05-18 14:12

Re: SMS from CLI (Command Line)?
 
Hmm, having had a look it looks nice but I don't even want to get my hands that dirty... If there were Python bindings on the other hand...

I actually just tried to install the Maemo SDK, thinking if it must be C it must be C, but am having no luck. That's a question for another thread, though.

ossipena 2010-05-18 14:17

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

Originally Posted by tremby (Post 664089)
I can't get the SMS script (http://www.paraiso.dk/pymaemosms.txt) working. I'm in the UK in case that matters and am feeding a number like
07123456789
and a message like
testing testing

It says "Message sent" but the phone I sent it to gets nothing. Any ideas what could be wrong?

There's also nothing new in the el.db file but perhaps I shouldn't be expecting anything there anyway when sending an SMS like this? (That's actually a major problem for me -- I will want my sent messages to appear in history.)

Thanks

it is some kind of a bug, number formatting function gives you errorenous data and message is not sent.

just copypaste the el.db code from gitorious?
www.gitorious.org/VertSMS

it is about 10 lines if I remember correctly. should be found in SMS.py

e: python bindings aren't a problem, you can use ctypes. But with rtcom API I haven't got anything working with storing the sms.

tremby 2010-05-18 14:22

Re: SMS from CLI (Command Line)?
 
Any idea how I can fix it?

And just so we're clear, the code you're pointing to is to add the SMS to the database, right?

Would the conversations app then have to be prodded to reload the database before the sent messages appear?

Thanks.

ossipena 2010-05-18 14:41

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

Originally Posted by tremby (Post 664225)
Any idea how I can fix it?

And just so we're clear, the code you're pointing to is to add the SMS to the database, right?

Would the conversations app then have to be prodded to reload the database before the sent messages appear?

Thanks.

I don't have any ideas yet. could you log the conversations dbus-output and the python scripts output when sending a message to 07 number?
(dbus-monitor > logfile.txt for example)

yes it adds it to database, there is small delay but don't know how it acts if conversations is open in background

tremby 2010-05-18 14:54

Re: SMS from CLI (Command Line)?
 
This is with the http://www.paraiso.dk/pymaemosms.txt script as is: http://sprunge.us/aIhe

This is with Cue's script back on page 6: http://sprunge.us/YMHI

I've replaced the number with 07XXXXXXXXX (same number of digits though).

ossipena 2010-05-19 06:02

Re: SMS from CLI (Command Line)?
 
update: there is now an API way to write stuff to rtcom eventlogger database!!! (million thankses again to frals and gri)

it can be found at newest push from gitorious.

should be straight in sms.py (green lines)

http://gitorious.org/vertsms/vertsms...faf78da4fed051

Patola 2010-06-26 17:27

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

Originally Posted by pende (Post 449749)
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.

pende,

thanks for your script. It works wonderfully... For non-accented messages. It seems your deoctify() function fails for accented messages, any plans to fix this?

KiberGus 2010-06-26 21:31

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

Originally Posted by Patola (Post 730414)
pende,

thanks for your script. It works wonderfully... For non-accented messages. It seems your deoctify() function fails for accented messages, any plans to fix this?

Many people tend to think, that English is the only language in the world and ascii is the only encoding. In real, SMS is not always hex encoded 7-bit ascii. You may need to convert it from GSM encoding to needed (UTF-8?) encoding. Or it can be in UCS encoding. Or it can be mysterious user defined encoding.
Many posts ago I've written correct solution for decoding SMS PDU:
http://kibergus.su/node/17
The only change is that gsmdecode.py is now in ussd4all package instead of ussd-common.
Use gsmdecode.decode_pdu() for decoding PDU.

sergulo 2010-11-30 16:41

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

Originally Posted by goodwill (Post 438487)
I used dbus_glib to do the job. To send your SMS, I can do something like this.
Code:

#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
#define MYTYPE (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_UCHAR_ARRAY))

DBusGConnection* dbus_conn;
DBusGProxy* dbus_proxy;

dbus_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
dbus_proxy = dbus_g_proxy_new_for_name(dbus_conn, "com.nokia.phone.SMS", "/com/nokia/phone/SMS/ba212ae1","com.nokia.csd.SMS.Outgoing");

GPtrArray* ptrarray;
GArray* array;
guchar values[] = {33,5,11,145,33,67,101,135,9,241,0,0,10,225,112,56,28,14,135,195,225,48};

ptrarray = g_ptr_array_new();
array = g_array_new(FALSE, FALSE, sizeof(guchar));

g_array_append_vals(array, values, sizeof(values)/sizeof(guchar));
g_ptr_array_add(ptrarray, (gpointer)array);

dbus_g_proxy_call_no_reply(dbus_proxy, "Send", MY_TYPE, ptrarray, G_TYPE_STRING,"",G_TYPE_INVALID);

g_ptr_array_free(ptrarray,TRUE);
g_object_unref(dbus_proxy);
dbus_g_connection_unref(dbus_conn);


Hello dear Goodwill

I have tried this example to send an sms via G-LIB library but currently I need to send an sms using "dbus_g_proxy_call" g-lib method. Unfortunately I got a Segmentation Failure (though sms is sent) when calling this:

GError* error;

dbus_g_proxy_call_no_reply(dbus_proxy, "Send", &error, MY_TYPE, ptrarray, G_TYPE_STRING,"",G_TYPE_INVALID);

Please could you please give a hint how to fix that or is there any way to send an sms with reply version.


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

vBulletin® Version 3.8.8