maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [ANNOUNCE] Web2SMS (https://talk.maemo.org/showthread.php?t=55835)

gri 2010-08-05 09:44

Re: [ANNOUNCE] Web2SMS
 
Quote:

Originally Posted by DaSilva (Post 776323)
The last version is great!
I have only one question/request:
Could you change the display of the remaining free SMS from a prediction (on update) to a real check (online)? Maybe you can make this optional in the settings menu but sometimes I am not sure if a message was really sent and then I have to close web2sms and start it again to see if the counter has changed.
Thanks!

In some future this will be an option, yes. The counter only changes once the message has been received by your recipient. As this does not always happen in some seconds, the new amount is only predicted. There are ways to find out if a message has failed to deliver, is on delivery or was received. But to detect these states a timed request has to be sent which costs both battery and traffic.

I'm going on holidays next week for about one month, so don't expect any updates in that time :)

maya 2010-08-09 22:51

Re: [ANNOUNCE] Web2SMS
 
ok, installed the new version and now I can add the numbers of contacts. Send to a contact works fine, but sending to two or more contacts are not being sent.

hcm 2010-09-02 16:34

Re: [ANNOUNCE] Web2SMS
 
Hi,

this is a great project!
I'd like to contribute by adding a sipgate.de plugin in python.
Is there any documentation about the python-plugin support? Maybe some example plugin?
I found the provider_test.py in SVN, but
- saving the Username & Password doesn't work (although the code seems to be present)
- what is the UUID used for, how should I chose one for my own plugin?
- also some other info might be nice, e.g. how I can use different message-types

Hopefully somebody can give me some hints, then I'll probably come back with a sipgate.de plugin :) (7,9ct worldwide SMS with your own number as sender)

hcm 2010-09-04 10:24

Re: [ANNOUNCE] Web2SMS
 
Hi again,

ok, I figured out some things, and it's already kind-of-working. But I still need some things to be able to release it:

- How should I chose the UUID?
- How can I throw error messages to the GUI?
- How to use the account-balance stuff?

Which of the plugins is the most "complete" one (i.e. with balance, different message types, multiple receipients, good error checking & reporting, etc)?
I don't have accounts for any of these providers, but if I know the most complete plugin, I would create an account to be able to figure stuff out for myself…

And another enhancement request:
Would it be possible to distinguish SMS sent by this tool from normal SMS in the eventlogger-database? Maybe by using the "flag" column (is this column used by any builtin programs?)…
Would be nice, because I have a certain amount of free SMS, and I'd like to check how many I've already used…

NightShift79 2010-09-04 16:49

Re: [ANNOUNCE] Web2SMS
 
I just gave web2sms v.0.1.2-8 a try with O2germany.
and it seems to work properly. nice one!

But your O2germany web support misses some features.

- scheduled sms
- anonymous sms
- Set Text to show as Sender
- flash sms

Are you going to implement these anytime soon?

regards.

gri 2010-09-06 18:35

Re: [ANNOUNCE] Web2SMS
 
Quote:

Originally Posted by hcm (Post 806985)
How should I chose the UUID?

Just create a new one: http://www.famkruithof.net/uuid/uuidgen

Quote:

Originally Posted by hcm (Post 806985)
How can I throw error messages to the GUI?

If your class is derived from web2sms.ProviderInterface, you should be able to call "self.error.emit('text')".

Quote:

Originally Posted by hcm (Post 806985)
How to use the account-balance stuff?

Simply emit "self.balanceReply.emit('text')"

Quote:

Originally Posted by hcm (Post 806985)
Which of the plugins is the most "complete" one (i.e. with balance, different message types, multiple receipients, good error checking & reporting, etc)?
I don't have accounts for any of these providers, but if I know the most complete plugin, I would create an account to be able to figure stuff out for myself…

The only plugin which lacks error checking when sending is o2online. All plugins except betamax and biteSMS support account balance. Multiple recipients are supported by sloono, o2online and biteSMS. You can take most plugins except o2online as reference, this one is the oldest and has a lot of unneeded code.

To make sure your plugin works, you should consider writing it in c++. The python support may work but has never been tested (you would be the first one :) ) Saving of the settings in the example plugin doesn't work because I don't really do python and therefore don't know how to use the QDataStream there :)

Quote:

Originally Posted by hcm (Post 806985)
And another enhancement request:
Would it be possible to distinguish SMS sent by this tool from normal SMS in the eventlogger-database? Maybe by using the "flag" column (is this column used by any builtin programs?)…
Would be nice, because I have a certain amount of free SMS, and I'd like to check how many I've already used…

I don't know without checking and I'm too tired now (jetlag). I'll check that soon. But you could also save a counter in your plugin settings.

hcm 2010-09-06 20:34

Re: [ANNOUNCE] Web2SMS
 
1 Attachment(s)
Thanks for your reply!

The emit-stuff doesn't work in the loadSettings-Routine, that confused me…
Probably the Login-Code should be moved to another Routine, are there any login/initialization-Routines called once when starting the plugin and once when the settings are changed?

Anyway, it's working for me, the error checking is not very complete yet, but if a balance is shown, the connection to the server is established, and sending SMS should work (and if the balance changes, your SMS has been sent definately)

I can only test when I want to send some SMS, because its not for free (but cheaper, especially in foreign countries)

I didn't implement multiple receipients, yet.
I didn't try SMS with more than 160 chars, yet.

Feel free to test & report back :)

to use it, remove the .txt ending and save it in /opt/web2sms/providers/

gri 2010-09-07 16:52

Re: [ANNOUNCE] Web2SMS
 
Quote:

Originally Posted by hcm (Post 808922)
The emit-stuff doesn't work in the loadSettings-Routine, that confused me…
Probably the Login-Code should be moved to another Routine, are there any login/initialization-Routines called once when starting the plugin and once when the settings are changed?

In case of your code: The SipgateProviderPlugin instance is created on program startup and the SipgateProvider instance is created when clicking on the account and the view changes to the message view (or the options are shown). Directly after creation of SipgateProvider, the settings are loaded. This happens before any signal is being connected to the provider. That's why your emits won't work there. SaveSettings is called when the program quits or you choose another provider from the main screen. Also login() is called when the screen changes to the message screen but there are the signals connected and logout() when changing the provider or the program quits. Login() can return if it's asynchronous or synchronous. Asynchronous shows up a progress dialog and waits until loginReply is emitted.

Edit:
I don't know if you missed it, but you should not initialize inside loadSettings() and saveSettings(). Take a look at the sip files here to see which classes and functions are available in python here. Especially take a look at the ProviderInterface base class. The example I wrote some time ago does not even use everything available.

DaSilva 2010-09-07 17:31

Re: [ANNOUNCE] Web2SMS
 
The fake remaining SMS counter for o2 has a few problems:

- After sending a SMS with 160 characters it calculates two SMS
- A SMS to more than one recipient is only counted as one SMS

Could you please add a real (optional) check? Currently I often close and start web2sms again just to make sure that the last message was sent...
Thanks in advance.

hcm 2010-09-08 15:08

Re: [ANNOUNCE] Web2SMS
 
Quote:

Originally Posted by gri (Post 809759)
In case of your code: The SipgateProviderPlugin instance is created on program startup and the SipgateProvider instance is created when clicking on the account and the view changes to the message view (or the options are shown). Directly after creation of SipgateProvider, the settings are loaded. This happens before any signal is being connected to the provider. That's why your emits won't work there. SaveSettings is called when the program quits or you choose another provider from the main screen. Also login() is called when the screen changes to the message screen but there are the signals connected and logout() when changing the provider or the program quits. Login() can return if it's asynchronous or synchronous. Asynchronous shows up a progress dialog and waits until loginReply is emitted.

Edit:
I don't know if you missed it, but you should not initialize inside loadSettings() and saveSettings(). Take a look at the sip files here to see which classes and functions are available in python here. Especially take a look at the ProviderInterface base class. The example I wrote some time ago does not even use everything available.

Thanks for the explanation :) Really appreciated :)

I'm not really a python-programmer, more like a hacker ;) That's why I have some problems structuring the code the correct "python-way".

But I think I got the idea and will make the necessary changes, as well as add some more error-checking. (Maybe tomorrow, otherwise I'll be out for a week)

BTW, in case of an error while sending a message, should the sendMessageReply or error-Signal be emitted first? (For login, it's probably the same with loginReply and error)


All times are GMT. The time now is 04:14.

vBulletin® Version 3.8.8