maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] HeySms - Send and receive sms on your computer (https://talk.maemo.org/showthread.php?t=84705)

titilambert 2012-06-07 15:23

Re: [Announce] HeySms - Send and receive sms on your computer
 
Quote:

Originally Posted by benny1967 (Post 1218966)
OK, there's somthing fishy here - but I need more input from other users and XMPP-experts before I call it a bug:

HeySMS (1.2.0-1) works fine when used together with Pidgin. (There is a message in the Pidgin debug window that looks like an error, but it doesn't seem to have any effect; the message is "jabber: XML parser error for BonjourJabberConversation 0x8ff0ac0: Domain 1, code 5, level 3: Extra content at the end of the document" and is issued after every SMS that's either sent or received.)

When used with Empathy, though, only some contacts/senders work. SMS-messages from other contacts never get through. What happens is that the contact appears in Empathy when the SMS comes in, but disappears immediately. The content of the SMS is not transmitted to the PC. Empathy then disconnects the link local account.

I tried to find something that the non-working contacts have in common. I found it: a space character. Messages from numbers that are not in my address book always work because they create a contact that consists of numbers only, no spaces. Messages from contacts that I stored as "Mum" or "David" also always work. Messages from contacts that have a space in either first or last name ("David jun.") or have both first and last name filled in ("David Miller") never work.
I changed existing entries in the address book to verify this, I'm almost 100% certain that the issue is the space character.

This made me check the XML that's sent. I found something like this:

Code:

<message from="David Miller" to="benny@myhome" type="chat" id="798420758213">
<body>Test</body>
<html xmlns="http://jabber.org/protocol/xhtml-im">
<body xmlns="http://www.w3.org/1999/xhtml">Test</body>
</html>
</message>

Please not the "from" in the first line. Is this valid in XMPP? IIRC a space character is not, while a "@" followed by a host name is mandatory. I'm not sure, though, especially when Link Local messaging is involved.

Could it be that Pidgin is more forgiving about such issues than Empathy and that in fact the XMPP created by HeySMS is buggy?

Or is the XMPP message created by HeySMS correct and there's a bug in Empathy or the underlying telepathy framework?

I'd love to get it working with Empathy, because it's much better integrated with my Gnome desktop.

Hello !

When I started HeySms, i remember to get an error like this with Kopete ! But I didn't reproduce the bug with Pidgin ... So i think that was one of countless bigs of kopete ... ;)

So, I just need to know how "encode" space character and I think I have the same bug with accented characters ...

titilambert 2012-06-07 15:42

Re: [Announce] HeySms - Send and receive sms on your computer
 
Maybe a urlencode ???
=> From="firstname%20lastname" ???

foobar 2012-06-07 16:03

Re: [Announce] HeySms - Send and receive sms on your computer
 
Quote:

Originally Posted by benny1967 (Post 1218966)
Please not the "from" in the first line. Is this valid in XMPP?

Nope. :)
A valid XMPP address is either of:

* host
* node@host
* node@host/resource

Spaces are not allowed in neither host nor node.

I would recommend something like +xxxxx@n900/sender's name, where +xxxxx is the sender's number. You will have to apply the resourceprep profile of stringprep to the resource part (i.e. the sender's name) to avoid trouble with accents etc. Since sender number can be alphanumeric it might be a good idea to apply the nodeprep profile of stringprep to the node part, too. If you can guarantee that those alphanumeric numbers use ASCII characters only then you can skip that part. But if you get resourceprepping working then this shouldn't be difficult to add and might make things easier if non-ASCII numbers should turn up in the future. :)

titilambert 2012-06-07 16:11

Re: [Announce] HeySms - Send and receive sms on your computer
 
Quote:

Originally Posted by foobar (Post 1218991)
Nope. :)
A valid XMPP address is either of:

* host
* node@host
* node@host/resource

Spaces are not allowed in neither host nor node.

I would recommend something like +xxxxx@n900/sender's name, where +xxxxx is the sender's number. You will have to apply the resourceprep profile of stringprep to the resource part (i.e. the sender's name) to avoid trouble with accents etc. Since sender number can be alphanumeric it might be a good idea to apply the nodeprep profile of stringprep to the node part, too. If you can guarantee that those alphanumeric numbers use ASCII characters only then you can skip that part. But if you get resourceprepping working then this shouldn't be difficult to add and might make things easier if non-ASCII numbers should turn up in the future. :)

Thanks !
Is it possible to have "heysms@n900/sender1", "heysms@n900/sender2", ... ?
And how the contact will be shown in the pidgin/kopete/... client ?? "sender1" ? "heysms@n900/sender1"

benny1967 2012-06-07 16:11

Re: [Announce] HeySms - Send and receive sms on your computer
 
Quote:

Originally Posted by titilambert (Post 1218977)
So, I just need to know how "encode" space character and I think I have the same bug with accented characters ...

Maybe this - or something completely different. I don't know if you use existing code for the whole XMPP-thing or if you wrote it yourself. So I don't know which options you have. But as far as I understand (I'm not sure!), the identifier in the "from"-attribute and the name that is displayed in the chat client (Pidgin etc) are 2 different things.

First name, last name and nickname are not supposed to be part of the ID that is transmitted in the "from"-attribute. According to the specification, they are part of the DNS TXT record that mDNS publishes.

The ID that's used for the "from" (or "to") attribute will normally not show up in the chat client. It seems it's used as a fallback only if everything else fails... which is the case with HeySMS.

Do you have avahi-discover installed? It gives you a nice comparison. For example, both the desktop account and the regular N900 account show up under "iChat Presence" as somthing like this:

type '_presence._tcp'
name benny@myhome
domain 'local'
Host myhome.local / 10.0.0.160:5298,
TXT txtvers=1
TXT 1st=Oskar G.
TXT last=Welzl
TXT port.p2pj=5298
TXT status=avail
TXT node=libpurple
TXT ver=2.10.4
TXT vc=!
TXT phsh=8917af748c3a0d52c7a0aadda54bde740e8ac3c0

What I know is that this account, created in Pidgin, shows up as "Oskar G. Welzl" in every other XMPP Link Local enabled client I use. It does not show up as "benny", although "benny@myhome" is used in the "from"-/"to"-attributes that are used during the conversation. All these data fields preceded by TXT come from the DNS TXT record.

When I examine one of the accounts created by HeySMS with avahi-discover, most of these TXT fields don't exist. I only find:

TXT port.p2pj=5299
TXT version=1
TXT txtvers=1
TXT status=avail


So what I assume would be the right thing to do is:
Find a way to create these TXT fields from within your code. In case it's a known contact from the address book, fill in
TXT last
TXT nick
TXT 1st
accordingly. If the sender is not found in the address book, maybe use
TXT nick
only and put the number there.
Then, create an ID based on the hostname and the phone numer of the sender - you'll end up with something like "+123456@Nokia-N900-42-11". Use this ID within the XMPP-conversation to fill "From"/"To".

And, above all, wait for input from other folks here. I'm not a real expert in XMPP and zeroconf.

titilambert 2012-06-08 04:04

Re: [Announce] HeySms - Send and receive sms on your computer
 
Hello !
Fix is in devel repository ! 1.2.1-1
I think it fixes the compatibility with client like Empathy (normal clients :D )

I'm waiting for you comments !

Thanks all !

benny1967 2012-06-08 09:48

Re: [Announce] HeySms - Send and receive sms on your computer
 
Works with Empathy and all the various name combinations that had not worked last time. Sweet! This should be on every phone! :)

titilambert 2012-06-08 12:30

Re: [Announce] HeySms - Send and receive sms on your computer
 
Quote:

Originally Posted by benny1967 (Post 1219370)
Works with Empathy and all the various name combinations that had not worked last time. Sweet! This should be on every phone! :)

Yeah !!!
Imported to testing !

Thanks again !

(I use the "TXT nick" and i delete all special characters ...)

benny1967 2012-06-09 12:38

Re: [Announce] HeySms - Send and receive sms on your computer
 
Quote:

Originally Posted by titilambert (Post 1218087)
I just don't have N9 ...
I will present this application to meamo competition code 2012 to win a N9/N950 and port it ... :)

Thanks

Takes far too long. Somebody here with knowledge about Python on Harmattan should submit required patches to github now. :)

(Of course I still think you should win a N9 or N950 for this.)

darodi 2012-06-09 17:12

Re: [Announce] HeySms - Send and receive sms on your computer
 
Quote:

Originally Posted by titilambert (Post 1218698)
Hello !

I just made a new version which should work with all countries and all sms from all country ! :)
It's in devel repository : HERE

Please tell me if it's working for you guys !

I'm waiting your comment !

Thanks !

still not working with HeySms v1.2.1-1

Code:

contact1
new_message to  contact1
new_message content test
content  test
send_sms  test
to  +32477xxxxxx
sent pdu [17, 0 , 11 ......................
sms sent
end sending

at the same time, I get a yellow n900 notification "incorrect number".

Yet the phone number printed and the new code in createPDUmessage seems OK. I don't get it.


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

vBulletin® Version 3.8.8