dotMobimobiThinkingmobiForgemobiReadyDeviceAtlasgoMobi
background image

Posted by yiyang1231 - 09 Jul 2008

pic
 yiyang1231
mobiForge Newbie
Posts: 4
Joined: 6 years ago
[offline]

Hello,
I have a lot of phone use the DeviceAtlas.
Some phones's HTTP_USER_AGENT can read.
But some phones's can't read it.
It is empty.
So I'm try to below:

$opera_header = "HTTP_X_OPERAMINI_PHONE_UA";
if (array_key_exists($operaHeader, $_SERVER)) {
  $ua = $_SERVER[$opera_header];
} else {
  $ua = $_SERVER['HTTP_USER_AGENT'];
}

But it is still empty.
Please help me.
Thanks

Posted by Scarex 6 years ago

pic
 Scarex
mobiForge Enthusiast
Posts: 18
Joined: 6 years ago
[offline]

Can you report what are these phones?

Salvatore Scarpina Telecom Italia SpA - Research & Trends Enabling Technologies for Innovation

Posted by yiyang1231 6 years ago

pic
 yiyang1231
mobiForge Newbie
Posts: 4
Joined: 6 years ago
[offline]

Nokia N71 and Song Ericsson K610i ...

It can be recognized a month ago, But now it just empty.
I don't know why.

Posted by adrian.hopebailie 6 years ago

pic
 adrian.hopebailie
Mobile Expert
Posts: 51
Joined: 6 years ago
[offline]

If the HTTP header has suddenly disappeared it would seem something has changed along the line of communication between the device and the script on the server.

This could be any number of things:

  1. A change in your web server setup
  2. Changes by the mobile service provider (started using a transcoder?)
  3. Changes to phone firmware

 I would suggest you do a dump of all headers and see if the User-Agent header is not stored under a new name (forwarded by a transcoder/proxy). You can then modify the script above to also look for the User-Agent under the new name.

In a blank php script try this code to print all the headers:

foreach($_SERVER as $k=>$v){
    echo "<strong>$k</strong>&nbsp;$v<br/>";
};
exit();


Visiting that script with the problem phones may give you some clues.

Adrian Hope-Bailie

Adrian Hope-Bailie
dotMobi

Posted by yiyang1231 6 years ago

pic
 yiyang1231
mobiForge Newbie
Posts: 4
Joined: 6 years ago
[offline]

Thanks adrian.hopebailie.
This is the result when I use Nokia 6300 to visit my website.
I'm sure there is not the HTTP_USER_AGENT.

[HTTP_HOST] => mo-call.mobi
[HTTP_ACCEPT] => application/vnd.wap.wmlscriptc, text/vnd.wap.wml, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/html, multipart/mixed, */*, text/x-vcard, text/x-vcalendar, image/gif, image/vnd.wap.wbmp
[HTTP_ACCEPT_CHARSET] => ISO-8859-1, US-ASCII, UTF-8; Q=0.8, ISO-10646-UCS-2; Q=0.6
[HTTP_ACCEPT_LANGUAGE] => zh-CN
[HTTP_DRM_VERSION] => 2.0
[HTTP_COOKIE2] => $Version="1"
[HTTP_ACCEPT_ENCODING] => gzip, deflate
[CONTENT_LENGTH] => 0
[HTTP_VIA] => WTP/1.1 BJBJ-PS-WAP2-GW01.bj2.monternet.com (Nokia WAP Gateway 4.0 CD3/ECD13_C/NWG4.0 CD3 ECD13_C 4.1.03)
[HTTP_X_FORWARDED_FOR] => 10.141.152.33
[HTTP_X_SOURCE_ID] => GGSN
[HTTP_X_NOKIA_CONNECTION_MODE] => TCP
[HTTP_X_UP_BEAR_TYPE] => GPRS
[HTTP_X_NOKIA_GATEWAY_ID] => NWG/4.1/Build4.1.03
[HTTP_COOKIE] => PHPSESSID=ce7ffebc674fcda2e99a035d887c787c;
[HTTP_CONNECTION] => keep-alive
[PATH] => /usr/local/bin:/usr/bin:/bin
[SERVER_SIGNATURE] => Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.3 mod_ssl/2.2.4 OpenSSL/0.9.8e Server at mo-call.mobi Port 80

[SERVER_SOFTWARE] => Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.3 mod_ssl/2.2.4 OpenSSL/0.9.8e
[SERVER_NAME] => mo-call.mobi
[SERVER_ADDR] => 192.168.2.2
[SERVER_PORT] => 80
[REMOTE_ADDR] => 221.130.33.135
[DOCUMENT_ROOT] => /var/www/mo-call.mobi
[SERVER_ADMIN] => [no address given]
[SCRIPT_FILENAME] => /var/www/mo-call.mobi/test.php
[REMOTE_PORT] => 34598
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] =>
[REQUEST_URI] => /test.php
[SCRIPT_NAME] => /test.php
[PHP_SELF] => /test.php
[REQUEST_TIME] => 1215657199
[argv] => Array
(
)

[argc] => 0

Posted by atrasatti 6 years ago

pic
 atrasatti
dotMobi logo
Mobile Genius
Posts: 325
Joined: 7 years ago
[offline]

If this is a device you own and can do your own testing, I suggest that you try to access your same site with the same device using a different mobile operator.
While I would be surprised that the Nokia WAP Gateway 4 removed your user-agent string, I think it is possible that some network appliance between your device and your site is removing it. Even if it's not very welcome to mobile developers, it is in the "rights" of a proxy to change the user-agent and the HTTP request headers to reflect its functionality.

Are you able to run this test? I could connect to your test page with my browser and I *do* see the user-agent string, so I don't think it's an issue on your site.
Is it possible for you to contact the mobile operator?

Posted by yiyang1231 6 years ago

pic
 yiyang1231
mobiForge Newbie
Posts: 4
Joined: 6 years ago
[offline]

Thanks atrasatti.
Now I'm not the same model mobile.
I will test it as you said.
Thanks again.

Posted by Brakanjan 6 years ago

pic
 Brakanjan
mobiForge Newbie
Posts: 6
Joined: 6 years ago
[offline]

Hi

I hope you can help I have a similar problem.

My php script
<?
echo $_SERVER["HTTP_USER_AGENT"]
?>

used to return the cell phone name in the heading. Now, a month later, I'm using the same phone (Nokia 6230i) and server and the message I get is:
Mozilla/5.0 (compatible OpenWeb.. etc
but not the name.

I've tried on several others phones, Nokia 5140i, Samsung J750, SEK700i.

However, on another mobile wap site in South Africa my phones get identified.

How can this be?

Posted by atrasatti 5 years ago

pic
 atrasatti
dotMobi logo
Mobile Genius
Posts: 325
Joined: 7 years ago
[offline]

Brakanjan wrote:

Hi

I hope you can help I have a similar problem.

My php script
<?
echo $_SERVER["HTTP_USER_AGENT"]
?>

used to return the cell phone name in the heading. Now, a month later, I'm using the same phone (Nokia 6230i) and server and the message I get is:
Mozilla/5.0 (compatible OpenWeb.. etc
but not the name.

I've tried on several others phones, Nokia 5140i, Samsung J750, SEK700i.

However, on another mobile wap site in South Africa my phones get identified.

How can this be?

This is a *really* slow reply, sorry about this.

OpenWeb is a proxy, I think your network operator has installed it and is masking the user-agent string from your site. You should contact the operator and see if they have a whitelist of sites and you should get all your sites whitelisted.

There is also a technical solution to this, and it involves setting some headers, that way the Openweb proxy should pass all the appropriate headers to you. See the article we wrote a few months ago, Setting HTTP headers to advise transcoding proxies.

I hope this helps.

Posted by tom101 5 years ago

pic
 tom101
mobiForge Newbie
Posts: 2
Joined: 5 years ago
[offline]

china mobile wap gateway removed useq agent and phone number.中国移动网关禁止对外现示手机型号和手机号码

Posted by atrasatti 5 years ago

pic
 atrasatti
dotMobi logo
Mobile Genius
Posts: 325
Joined: 7 years ago
[offline]

tom101 wrote:

china mobile wap gateway removed useq agent and phone number.

As far as I know you may get the User-Agent string and the other original headers if you sign an agreement with China Mobile. I do not know what the process and the requirements are, though.

Posted by dpowers 5 years ago

pic
 dpowers
mobiForge Newbie
Posts: 4
Joined: 6 years ago
[offline]

We have had this issue many times and it is almost always the networks changing the functionality of their software on their wap gateways or changing the software it's self and not configuring it the same.

In South Africa you usually need to ask the networks to white list your domain avoid them messing with it on your behalf and re factoring you code for you.

Posted by tom101 5 years ago

pic
 tom101
mobiForge Newbie
Posts: 2
Joined: 5 years ago
[offline]

china mobile self and the sector authority of china has been open, u want to get it? that is unlikely. money+money enter white list,than add a link in wap.monternet.com?unlikely.