How to add function to NOWSMS?

How to add function to NOWSMS? SearchSearch
Author Message
Zhang Xin
New member
Username: Amy_z_x

Post Number: 1
Registered: 03-2004
Posted on Friday, March 05, 2004 - 08:45 am:   

I have to add a "wireless villege ID" field to "send WAP vCard" session for my project, but how do I include this field's information to the Data field in the http output? I am looking forwards to your reply.. thank you very much!!!
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1977
Registered: 10-2002
Posted on Friday, March 05, 2004 - 04:10 pm:   

Hi Zhang Xin,

For the "Send WAP vCard" function, we do all of the encoding in JavaScript within the web form.

Probably the easiest thing to do would be to edit "Send WAP vCard.htm". And another field to the form for the Wireless Village ID.

Then edit the "submitForm" JavaScript function.

Let's say that you added a field to the form with a field name of "vCardWVID". In the "submitForm" function, you could check to see if this field is non-blank, and then add it to the vCard before it gets encoded.

I don't know what the field name is for the Wireless Village ID within a vCard, so I just left some ??? in the example below.

Look for the area where the vCard is built by the form, and just add in the extra field ...



textResponse = "BEGIN:VCARD\r\nVERSION:2.1\r\nN:";
textResponse += document.forms[0].vCardName.value;
textResponse += "\r\nTEL;PREF:";
textResponse += document.forms[0].vCardPhone.value;
if (document.forms[0].vCardWVID.value.length) {
textResponse += "\r\n????WVID????:";

textResponse += document.forms[0].vCardWVID.value;

}
textResponse += "\r\nEND:VCARD";
Zhang Xin
New member
Username: Amy_z_x

Post Number: 2
Registered: 03-2004
Posted on Monday, March 08, 2004 - 01:53 am:   

thank you so much!!!!!!!!!!!
Zhang Xin
New member
Username: Amy_z_x

Post Number: 3
Registered: 03-2004
Posted on Monday, March 08, 2004 - 06:49 am:   

Hi,
After I change according to what you suggest, NOWSMS can send the extra information to nokia 6220, but the phone itself doesnot display the wireless village ID, instead it append it to the end of phone number.
I would like to ask is this a problem of the handphone itself, or anywhere I can modify so that the handphone will display it correctly? thanks again~~
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 1985
Registered: 10-2002
Posted on Tuesday, March 09, 2004 - 01:27 pm:   

Hi Zhang Xin,

Where is this extra information for including the wireless village id in a vCard documented?

If you can point me to a reference, I'll take a closer look, but I have not seen a vCard extension documented for including a Wireless Village ID.

-bn
Zhang Xin
New member
Username: Amy_z_x

Post Number: 4
Registered: 03-2004
Posted on Friday, March 12, 2004 - 02:17 am:   

Hi, Bryce,

I later find out the problem myself too, but as a matter of fact, I don't know the parameter for WVID either. But this projet use nokia 6220 to test, in 6220, it has userID which is the same as WVID, is there any chance that you will know the parameter for userID in nokia 6220? I try to look for the spec, but cannot find it...:-(
Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 2151
Registered: 10-2002
Posted on Thursday, March 18, 2004 - 03:29 am:   

Hi Zhang Xin,

I'm sure you thought that I forgot about you and moved on.

However, while I don't have a Nokia 6220, I noticed that the Nokia 6820 also supports Wireless Village.

So, I sent a vCard that included a WV userID from the 6820 to a GSM modem to find out how it was encoded.

The header is "X-WV-ID:wv:userid" ... the extra ":" is strange, but perhaps there are different name spaces within WV.

So modify the form as I suggested above, to add a field to the form with a field name of "vCardWVID".

Then modify the JavaScript in the form something like this:

textResponse = "BEGIN:VCARD\r\nVERSION:2.1\r\nN:";
textResponse += document.forms[0].vCardName.value;
textResponse += "\r\nTEL;PREF:";
textResponse += document.forms[0].vCardPhone.value;
if (document.forms[0].vCardWVID.value.length) {
textResponse += "\r\nX-WV-ID:wv:";

textResponse += document.forms[0].vCardWVID.value;

}
textResponse += "\r\nEND:VCARD";