vCard using OpenSMPP API

vCard using OpenSMPP API SearchSearch
Author Message
hesm hesm
New member
Username: Hsem

Post Number: 1
Registered: 11-2007
Posted on Sunday, November 11, 2007 - 09:38 pm:   

Hi,

Can someone please post the code that I can use to send a simple vCard to any mobile phone (Nokia/Motorola/Sony/etc) using Logica OpenSMPP API?

I'd really appreciate it. It's kinda urgent.

All my attempts have failed. At best the following code triggers the mobile phone to claim that it cannot support the format and if I change the data coding it just opens a blank message:

sms = new SubmitSM ();
sms.setSourceAddr (srcAddr);
sms.setDestAddr(destAddr);
sms.setProtocolId((byte) 0);
sms.setDataCoding((byte) 0xF5);
sms.setEsmClass((byte) Data.SM_UDH_GSM);

ByteBuffer ed = new ByteBuffer();
ed.appendByte((byte) 6); // UDH Length
ed.appendByte((byte) 5); // IE Identifier
ed.appendByte((byte) 4); // IE Data Length
ed.appendShort((short) 0x23F4 ); // Destination Port
ed.appendShort((short) 0x0000); // Originator Port

ed.appendString("BEGIN:VCARD\r\nVERSION:2.1\r\nN:mySurname;myName\r\nTEL;PREF:+1 119938338444\r\nEND:VCARD\r\n");

sms.setMessagePayload(ed);

session.submit(sms);