How to achieve HTTP Header Enrichment using Now WAP

How to achieve HTTP Header Enrichment using Now WAP SearchSearch
Author Message
Zeeshan Riaz
New member
Username: Zeeshanriaz

Post Number: 1
Registered: 07-2011
Posted on Tuesday, July 19, 2011 - 11:27 pm:   

We are using NowWap since more than 2 years now.
Some applications we are developing, or 3rd parties that we work with, require the MSISDN to be available in WAP header. You have this feature in the WAP gateway, so we have ticked that box. Now the problem is that some handset browsers, like Opera Mini is stripping off the X-MSISDN header.

Our sister company Digicel Jamaica have solved this by inserting a cookie. I believe they have a WAP gateway from Ericsson. The cookie contains the MSISDN (in my case 6797015945) stuffed with 3’s (in my case 363739373031353934353). This way the MSISDN is passed through Opera Mini and get deciphered by the receiving application, by stripping off the 3’s again.

Would you be able to something like this?
We will appriciate your support.

Zeeshan
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3348
Registered: 08-2008
Posted on Wednesday, July 20, 2011 - 04:55 pm:   

Hi Zeeshan,

In the latest version of NowWAP (2011 version), we support a built-in option that adds a Cookie header for the MSISDN.

To enable this option, edit WAPGW.INI, and under the [WAPGW] header, add MsisdnCookieHeaders=Yes

This setting will cause NowWAP to insert a cookie header of the following format:

Cookie: User-Identity-Forward-MSISDN=6797015945

This will be the actual MSISDN, not one padded with 3's.

If you need to use a different cookie name, or use this odd 3's padding, this is technically possible, but more complicated. It would involve writing a script (such as in PHP) that used the HTTP Header Enrichment callback interface described at http://www.nowsms.com/nowwap-and-http-header-enrichment.

Basically, the request would parse the "PhoneNumber" parameter ($_REQUEST['PhoneNumber'] from a PHP script). It would pad the numbers with 3's, and then return a Cookie: header in the text of the response.

It's easier if you can use the built-in cookie header support.

The 3's padding is very odd. We have several installations with customers using our MMSC with an Ericsson WAP gateway, and some installations have the 3's padding, while others do not. The MsisdnCookieHeaders=Yes was added for a customer migrating from an Ericsson gateway to NowWAP. In that customer's case, there was no 3's padding of the MSISDN, but I have seen it in other installations because we have a configuration setting in the MMSC to support this format when parsing the MSISDN header.

--
Des
NowSMS Support
Zeeshan Riaz
New member
Username: Zeeshanriaz

Post Number: 2
Registered: 07-2011
Posted on Wednesday, July 20, 2011 - 10:39 pm:   

Thanks for your prompt response. We will try and test this one and will get back to this forum.
Zeeshan Riaz
New member
Username: Zeeshanriaz

Post Number: 8
Registered: 07-2011
Posted on Tuesday, August 02, 2011 - 11:27 pm:   

Hi Team,
Now we have downloaded new version of NowWap and have added MsisdnCookieHeaders=Yes into configuration file. We have connected the session and everything looks fine. Kindly let us know how can we make sure we are getting required information as listed above in http headers.

Regards,
Zeeshan
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3372
Registered: 08-2008
Posted on Wednesday, August 03, 2011 - 12:45 am:   

Hi Zeeshan,

If you can't confirm it in your appplication, you can enable the debug log in NowWAP, which will log al of the HTTP headers.

There cam be a lot of data to sift to, as it logs every request.

To enable this debug log, edit the WAPGW.INI file, and under the [WAPGW] header, add Debug=Yes. This will result in a WAPDEBUG.LOG file being generated in that same directory.

Alternatively, WireShark is an extremely good application that can be used to intercept network traffic, so that you can see what is actually being sent over the network.

--
Des
NowSMS Support
Zeeshan Riaz
New member
Username: Zeeshanriaz

Post Number: 10
Registered: 07-2011
Posted on Wednesday, August 03, 2011 - 01:04 am:   

Yes, It was already configured. I have checked that debug file and find out following.

(16) - 10:07:43:687 Host m.facebook.com receives Radius MSISDN Information
(16) - 10:07:43:890 GET /?w2m&refsrc=http%3A%2F%2Fwww.facebook.com%2F&_rdr HTTP/1.1
Accept: text/html,text/css,multipart/mixed,application/java-archive, application/java, application/x-java-archive, text/vnd.sun.j2me.app-descriptor, application/vnd.oma.drm.message, application/vnd.oma.drm.content, application/vnd.oma.dd+xml, application/vnd.oma.drm.rights+xml, application/vnd.oma.drm.rights+wbxml, application/x-nokia-widget, */*
Accept-Charset: iso-8859-1, utf-8; q=0.7, *; q=0.7
Accept-Encoding: gzip, deflate, x-gzip, identity; q=0.9
Accept-Language: en;q=1.0,ar;q=0.5,fr;q=0.5,fa;q=0.5,ur;q=0.5
Cookie2: $Version=1
User-Agent: Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95/30.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
x-wap-profile: "http://nds1.nds.nokia.com/uaprof/NN95-1r100.xml"
X-Nokia-MusicShop-Version: 1.0.0
X-Nokia-MusicShop-Bearer: GPRS/3G
Connection: Keep-Alive
X-MSISDN: 6797118504
X-WAP-3GPP-SGSN-MCC-MNC: 54202
X-WAP-3GPP-SGSN-ADDRESS: 202.129.228.5
X-WAP-3GPP-RAT-TYPE: 2
X-WAP-3GPP-IMSI: 542020001809532
Cookie: datr=T4nLTTH3-OwnZslqQuGEhOl6; User-Identity-Forward-MSISDN=6797118504;User-Identity-Forward-IMSI=5420200018095 32
X-Forwarded-For: 192.168.93.128
X-WAP-Client-IP: 192.168.93.128
Host: m.facebook.com

I think it will help. Will get back to you if we need something else.

Regards,
Zeeshan
Zeeshan Riaz
New member
Username: Zeeshanriaz

Post Number: 11
Registered: 07-2011
Posted on Thursday, August 04, 2011 - 11:56 pm:   

Hi Team,
Going through the debug file, we see something like this; kindly let us know how we can read this.
(16) - 8:20:30:921 04 4C 01 B4 82 AD 00 75 D4 9D 1D 21 02 12 3C 01 L u ! <
(16) - 8:20:30:921 9F A2 94 86 28 06 00 00 00 01 32 0A 31 35 30 38 ( 2 1508
(16) - 8:20:30:921 66 62 32 63 33 06 00 00 00 01 2D 06 00 00 00 02 fb2c3 -
(16) - 8:20:30:921 29 06 00 00 00 00 37 06 4E 3B 00 11 1F 0C 36 37 ) 7 N; 67
(16) - 8:20:30:921 39 37 32 34 33 36 31 39 08 06 C0 A8 5D A0 2C 12 97243619 ] ,
(16) - 8:20:30:921 63 61 38 31 65 34 30 36 31 35 30 38 66 62 32 63 ca81e4061508fb2c
(16) - 8:20:30:921 04 06 0A 96 70 09 07 06 00 00 00 07 1E 10 74 72 p tr
(16) - 8:20:30:921 69 61 6C 32 2E 63 6F 72 70 61 70 6E 20 0A 47 47 ial2.corpapn GG
(16) - 8:20:30:921 53 4E 39 38 31 31 3D 06 00 00 00 05 06 06 00 00 SN9811=
(16) - 8:20:30:921 00 02 E0 0A 45 02 02 00 21 04 92 F1 E1 06 15 08 E !
(16) - 8:20:30:921 FB 2C E2 06 00 00 00 08 E3 06 CA 81 E4 06 E4 06 ,
(16) - 8:20:30:921 CA 81 E4 05 1A 17 00 00 28 AF 01 11 35 34 32 30 ( 5420
(16) - 8:20:30:921 32 30 30 30 31 32 34 30 32 39 31 1A 0C 00 00 28 20001240291 (
(16) - 8:20:30:921 AF 02 06 15 08 FB 2C 1A 0C 00 00 28 AF 03 06 00 , (
(16) - 8:20:30:921 00 00 00 1A 0C 00 00 28 AF 04 06 0A 96 6F 0C 1A ( o
(16) - 8:20:30:921 23 00 00 28 AF 05 1D 30 35 2D 32 33 36 33 31 66 # ( 05-23631f
(16) - 8:20:30:921 39 33 39 36 35 38 35 38 37 34 66 62 35 38 35 38 9396585874fb5858
(16) - 8:20:30:921 30 30 1A 0C 00 00 28 AF 06 06 CA 81 E4 05 1A 0C 00 (
(16) - 8:20:30:921 00 00 28 AF 07 06 CA 81 E4 06 1A 0D 00 00 28 AF ( (
(16) - 8:20:30:921 08 07 35 34 32 30 32 1A 0D 00 00 28 AF 09 07 35 54202 ( 5
(16) - 8:20:30:921 34 32 30 32 1A 09 00 00 28 AF 0A 03 35 1A 09 00 4202 ( 5
(16) - 8:20:30:921 00 28 AF 0C 03 30 1A 0C 00 00 28 AF 0D 06 30 38 ( 0 ( 08
(16) - 8:20:30:921 30 30 1A 0D 00 00 28 AF 12 07 35 34 32 30 32 1A 00 ( 54202
(16) - 8:20:30:921 09 00 00 28 AF 15 03 01 1A 10 00 00 28 AF 16 0A ( (
(16) - 8:20:30:921 01 45 F2 20 00 05 80 E8 1A 0A 00 00 28 AF 17 04 E (
(16) - 8:20:30:921 84 00 1A 09 00 00 28 AF 1A 03 00 1A 0E 00 00 71 ( q
(16) - 8:20:30:921 F0 03 08 48 75 61 77 65 69 1A 0B 00 00 71 F0 04
Regards,
Zeeshan
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3391
Registered: 08-2008
Posted on Friday, August 05, 2011 - 03:25 pm:   

Hi Zeeshan,

Without additional context, I couldn't tell you.

For some protocols, the debug log contains a hex dump of received packets.

I don't know if that is a RADIUS packet or a WAP WSP packet. Additional log entries around it would tell me.

And I wouldn't attempt to decode it manually unless I was troubleshooting a specific problem that related to this data.

If you want to do your own packet decoding, I would strongly recommend WireShark (www.wireshark.org). It contains a packet sniffer and decoder that is invaluable for understanding these protocols.

--
Des
NowSMS Support