Recieving vCards (Business cards)

Recieving vCards (Business cards) SearchSearch
Author Message
Chris Brodie
Posted on Wednesday, August 20, 2003 - 01:50 pm:   

I have a 6310i Bluetooth as a GSM Modem and I want to be able to recieve vCards and then send them to a http page to proccess.

Everything works fine with the 2 way SMS but it just won't pick up any vCards..

Is this possible.

Kind Regards
Bryce Norwood - NowSMS Support
Posted on Friday, September 05, 2003 - 03:56 pm:   

Hi Chris,

If I understand you correctly, you want to be able to have vCards sent to a Nokia 6310i which is connected to a Now SMS/MMS Gateway ... and you want those messages to be received and routed to an HTTP script for processing.

This is possible, but it's a bit tricky. Let me explain.

First, you're going to need to use the v5.0 release (which is still in beta, but quite stable ... details and download at http://www.nowsms.com/beta5).

The reason that you need to do this is because when Nokia phones (and maybe some other brands, but this capability is primarily used by Nokia) send vCards, they are sent out as a binary SMS message.

Older versions of NowSMS would receive binary SMS messages, but would only store those received messages in the SMS-IN directory. They would not be forwarded to a "2-way" command.

Beginning with the v5.0 release, it is possible to route binary SMS messages to a "2-way" command. The following information from the readme.txt file explains this:


quote:

* Allow received binary messages to be processed by a 2-way command. Note that no binary messages will be passed to a 2-way command unless the 2-way command includes a replaceable parameter setting named "@@Binary@@". This replaceable parameter will be set to "1" for binary messages, and "0" for text messages. Additional replaceable parameters supported include @@DCS@@, @@PID@@ and @@UDH@@ (user data header).




Ok. So now you've got binary data coming to your command ... how do you know its a vCard, and how do you process it?

Well, luckily the vCard format is very simple.

The UDH is going to look like this: 06050423F4xxxx (where xxxx is any value)

It is possible that the UDH could contain other options ... but if you did a substring search on "050423F4" then that should be sufficient for identifying the message as a binary vcard.

The "@@FULLSMS@@" variable will contain the binary data for the vCard. Basically, it will be a hex representation of each character in the vcard, and that data needs to be converted to text.

For example, here's a sample vCard from the Nokia Smart Messaging specification:

424547494E3A56434152440D0A56455253494F4E3A322E310D0A4E3A536D6974683B4D696B650D0A 54454C3B505245463A2B35353531323334350D0A454E443A56434152440D0A

This translates to:

BEGIN:VCARD
VERSION:2.1
N:Smith, Mike
TEL;PREF:+55512345
END:VCARD

42 = B
45 = E
47 = G
49 = I
4E = N
3A = :
...

Granted, this is a little tricky, but I hope this helps.

-bn