AGWA / sms-over-xmpp

XMPP Component (XEP-0114) to send and receive SMS
Other
77 stars 10 forks source link

Support caller ID #9

Closed mndrix closed 7 years ago

mndrix commented 7 years ago

When an SMS arrives, it'd be nice if the server could handle caller ID and pass that info along to the XMPP client. Try using some of the following:

One should be able to write static caller ID into the config file or specify an external script that's executed to generate caller ID info.

mndrix commented 7 years ago

It looks like Conversations supports XEP-0172. That's also easy to implement so it could be a good place to start.

mndrix commented 7 years ago

XEP-0172: User Nickname

I did a test implementation which generated stanzas like this:

<message
  xmlns="jabber:component:accept"
  id="ejkw5k6nazxsiggkjnhrkdwoea" 
  from="+13075551212@sms.example.com"
  to="joe@example.com"
  type="chat">
    <body>First incoming</body>
    <nick xmlns="http://jabber.org/protocol/nick">John Doe</nick>
</message>

Despite several variations on the XML and variations in roster status this did not show "John Doe" anywhere in any client I tried.

Before abandoning this XEP, I want to make sure that we're handling subscriptions correctly. Conversations requires mutual subscriptions before displaying nick names. Prosody's roster shows ["subscription"] = "to" where I would have expected ["subscription"] = "both". This suggests that there's more to do related to #13

mndrix commented 7 years ago

Now that mutual presence subscriptions are in place (commit 154676d1f93bee3a83ff19ec18e249586456234f), Conversations uses <nick> for the display name in my tests. Time to add real support for XEP-0172.

mndrix commented 7 years ago

At this point, I'm convinced that I can't make progress on this issue until #18 is done.

mndrix commented 7 years ago

This is working pretty well in Conversations via XEP-0172 and an external script that does caller ID based on my address books.

I'll leave this issue open as I try to implement some kind of caller ID support for XMPP clients that don't support nicknames.

mndrix commented 7 years ago

After using this for a while, results in Conversations have been spotty. Sometimes caller ID works. Sometimes it doesn't. Time to investigate some of the other options. I think XEP-0054 is a good candidate to try next.

mndrix commented 7 years ago

Summarizing XEP-0054 vcard-temp:

We add <feature var='vcard-temp'/> to our list of disco features.

Client requests a vcard:

<iq from='john@example.com/phone'
    id='v1'
    to='+13075551212@sms.example.com'
    type='get'>
  <vCard xmlns='vcard-temp'/>
</iq>

sms-over-xmpp responds with the details from caller ID:

<iq from='+13075551212@sms.example.com' 
    to='john@example.com/phone' 
    type='result'
    id='v1'>
  <vCard xmlns='vcard-temp'>
    <FN>Susie Sheep</FN>
  </vCard>
</iq>

The spec makes some other requirements, but that's the essence.

mndrix commented 7 years ago

XEP-0084 User Avatar has no mechanism for providing a user name. We can't use it to support caller ID.

mndrix commented 7 years ago

We have pretty good support for caller ID at this point. Future work will be on follow-up issues.