venomous0x / whatsapi Goto Github PK
View Code? Open in Web Editor NEWInterface to WhatsApp Messenger
Interface to WhatsApp Messenger
Warning: socket_read(): unable to read from socket [0]:
\src\php\whatsprot.class.php on line 140
$ret = socket_read( $this->_socket, 1024 );
In the decode.php there is a function decode. To prevent warnings about unknown variable $str you might want to add $str = null; before the foreach.
Well, this might be a stupid question, but I´ve spent a long time trying to figure what was I doing wrong, and finally...
Oh My God! It´s working!
But, my joy last only a few minutes, as I´m finding impossible to do anything. It´s just like if it couldn´t login.
print_r($wa) returns:
(
[_server:WhatsApp:private] => s.whatsapp.net
[_host:WhatsApp:private] => bin-short.whatsapp.net
[_Digest_Uri:WhatsApp:private] => xmpp/s.whatsapp.net
[_Realm:WhatsApp:private] => s.whatsapp.net
[_Qop:WhatsApp:private] => auth
[_contype:WhatsApp:private] => STREAM_CLIENT_PERSISTENT
[_accinfo:WhatsApp:private] =>
[_account_status:WhatsApp:private] =>
[_account_kind:WhatsApp:private] =>
[_account_creation:WhatsApp:private] =>
[_account_expiration:WhatsApp:private] =>
[_incomplete_message:WhatsApp:private] =>
[_number] => 34668XXX483
[_password] => 8a96a98e8da62XXXXX2d66e6eabee340
[_nickname] => Juan
[_socket] => Resource id #7
)
And PHP warns with every action:
Warning: socket_read(): unable to read from socket [10053]: Se ha anulado una conexión establecida por el software en su equipo host..
which, translated into english, would mean
Warning: socket_read(): unable to read from socket [10053]: An established conne ction was aborted by the software in your host machine.
As far as I know, that means the WhatsApp server is blocking my attempts of connection.
I promise I have done research through the internet, but this is definitely not working. Tried on my own computer, on a dedicated VPS, and in a laptop without firewall (software nor hardware)
Could you be so grateful to help me?
Thanks ^.^
(and if you consider i´ve done wrong asking here, try to be polite, I´ll do the same for you ;P)
Hi,
i have the issue that i am getting disconnected (without any message) when the mobile client on the cellphone goes online in WA.
What happens is that i get an empty line after [] Listen mode: - and then i am not able to receive messages sent after that.
Any ideas ?
This would be really cool, if ported to node.js!
Hello everyone,
I tried the WhatsAPI PHP, running within a Virtual Box.
I downloaded the latest Version 800 C90C.
Receiving Messages works well, what was really exciting!
But i can´t send any Message wit the API.
I use the IMEI of an Android 2 Phone.
Somebody else has experience with this problem?
Have a nice weekend.
falomundo
same as tittle
In Line 240 is curriently the value "l$dict" but this should be "last".
I found that out while compairing the code from WhatsAPI and wazapp.im source.
Hi,
I activated my account on an Android OS and by using md5(strrev(MYIMEI)) I could successfully log in to server and get the info of my account from that. But when I try to send the message I get no result and the return value of socket_read( $this->_socket, 1024 ) at every three times is null.
Has anyone any progress?
I have created my account just some days ago. Can it be a reason for the problem? I mean maybe they except different data from new users who use the last version (Version 2.7.8509)
tnx in advance
Wouldn't it be nice if there were a possibility to create a whatsapp account with the WhatsAPI? well actually i don't know if this is even possible...
I tried the python script, and the login seems to work (When I use the sendMessage function I get a Last seen: "long code here") But the message isn't sent (The receiver doesn't receive them.)
I used these parameters:
start("", "<md5 hashed(reversed EMEI)>")
sendMessage("1", "", "Does it work?")
For the i parameter I used a couple of numbers (1,2,3). I also tested it with other receivers.
Hey,
I am currently reversing the protocol too and wrote the Password generator like it's in the WindowsPhone App. Reverse the String and generate the (Digest)MD5 out of it.
I tried both, UDID and IMEI, both didn't worked. Have you any Idea what this could be?
Does anyone happen to have figured out how the password is generated for Blackberry devices?
Can anyone confirm whether md5(reverse(imei)) works or not?
While trying to send a message, with a valid password authentication (using an Android bound account), This pops up:
PHP Notice: Undefined property: WhatsProt::$challengeArray in ./WhatsAPI/src/php/whatsprot.class.php on line 119
With no other error message as far as I can tell from neither the WhatsApp servers nor from the code itself. I don't have another phone to test if any messages are being sent, but apparently, they aren't.
I'm having a hard time to pin down if $challengeArray
is correctly initialized, specifically for the "nonce" element.
Hello
the API work very well , but i m unable to send Arabic messages ( not delivered at all )
i changed the encoding from ANSI to UTF-8 and still same problem
Regards
I try to send messages to all subscriber
I use this code
for($i=0;$i<20;$i++)
{ $wa->Message(time()."-1","99999999999","".$i."");
sleep(1);
}
Error :
socket_send() [function.socket-send]: unable to write to socket [0]: An established connection was aborted by the software in your host machine.
Error :
Warning: socket_read() [function.socket-read]: unable to read from socket [0]: An established connection was aborted by the software in your host machine.
and send 2 messages only
Hello, anyone know how to do it on Updated Whatsapi?
I have seen #22
I know the code changes everything into UTF-8 but no idea about how to change for sending Chinese characters
Could you give me any guide so that I change some code to send Chinese characters?
I want to send Video Message I use same sending Image function but with putting video Link.
public function sendImage($msgid,$to,$path,$size,$link,$b64thumb){
$thumb_length = hex2str(_hex(strlen($b64thumb)));
$to_length = chr(mb_strlen($to,"UTF-8"));
$msgid_length = chr(mb_strlen($msgid));
$path_length = chr(mb_strlen($path));
$size_length = chr(mb_strlen($size)); // in bytes
$link_length = chr((strlen($link)));
$content = "\xF8\x08\x5D\xA0\xFA\xFC$to_length";
$content .= $to;
$content .= "\x8A\xA2\x1B\x43\xFC$msgid_length";
$content .= $msgid;
$content .= "\xF8\x02\xF8\x04\xBA\xBD\x4F\xF8\x01\xF8\x01\x8C\xF8\x0C\x5C\xBD\xB0\xA2\x44\xFC\x04\x66\x69\x6C\x65\xFC$path_length";
$content .= $path;
$content .= "\xFC\x04\x73\x69\x7A\x65\xFC$size_length";
$content .= $size;
$content .= "\xA5\xFC$link_length";
$content .= $link;
$content .= "\xFD\x00$thumb_length";
$content .= $b64thumb;
$total_length = hex2str(_hex(strlen($content)));
$msg ="";
$msg .= "$total_length";
$msg .= $content;
echo str2hex($msg);
$stream = $this->send($msg);
$this->read();
}
this is call sending Function
$link = "http://zzzzzzzzzzzz.com/v1.mp4";
$thumb = file_get_contents("demo/x3.jpg");
$b64thumb = base64_encode($thumb);
$wa->sendImage(time()."-1","99999999999","ccf7b9444a511639efd998260b712253.mp4","99999",$link,$b64thumb);
I think that the problem is in the $path ??
Thanks in Advanced
It seems login is not working again.
There is a way to return a boolean if the password and number is correct? How can i know?
I am from Chile (sorry for my english) and the login function doesn't work, y try a lot of numbers and combinations but nothing happens. I don't know if i log in but i can't send messages... I will sniff the official client latter when i have time. Other questions, the implemention nowadays of ssl doesn't affect this api?
You mentioned a Java port of your API, is it available yet?
I think the code only works for android, for ios is different. Read this article (is from 11 sept)
The password would be like md5(2*lan mac address) = md5(AA:BB:CC:DD:EE:FFAA:BB:CC:DD:EE:FF)
"because Apple does not allow third-party applications to access IMEI number".
(Sorry my english)
is it WA changing there system? or everybody works only me?
I cant seem to login or send any message using the php version.
my code:
require "whatsapp.v2.php";
$password = md5(strrev('0000MYIMEI'));
// DEMO OF USAGE
$wa = new WhatsApp("000PHONE", $password);
$wa->Connect();
$wa->Login();
$msg = $wa->Message(time()."-1","000PHONE","hello!!!");
the $msg returns NULL and the $wa returns this:
object(WhatsApp)#1 (13) { ["_server":"WhatsApp":private]=> string(14) "s.whatsapp.net" ["_host":"WhatsApp":private]=> string(22) "bin-short.whatsapp.net" ["_Digest_Uri":"WhatsApp":private]=> string(19) "xmpp/s.whatsapp.net" ["_Realm":"WhatsApp":private]=> string(14) "s.whatsapp.net" ["_Qop":"WhatsApp":private]=> string(4) "auth" ["_contype":"WhatsApp":private]=> string(24) "STREAM_CLIENT_PERSISTENT" ["_account_status":"WhatsApp":private]=> string(0) "" ["_account_kind":"WhatsApp":private]=> string(0) "" ["_account_creation":"WhatsApp":private]=> string(0) "" ["_account_expiration":"WhatsApp":private]=> string(0) "" ["_number"]=> string(12) "MYNUMBER" ["_password"]=> string(32) "MYPASSWORD" ["_socket"]=> resource(5) of type (Socket) }
Using the simple code:
Connect(); $wa->Login(); $wa->Message(time()."-1","+35191xxxxxxx","Testing!"); ?>It retrieves any amount of messages I send from my phone without any problem, but it gets stuck on the $this->read(); calls in Message() unless I set a timeout for it. In which case it stops receiving data and still doesn't send the message as intended.
I'm pondering a light mobile web client for people with older phones (2.5g with J2ME and browsers like Opera Mini 4-5), but am still struggling with the proof of concept.
Cheers.
Edit: Worth saying I already searched through similar issues and none of the presented solutions worked (both replacing some lines in the authentication call which didn't fix it and prevented me from logging in successfully and using this->read(); calls to flush out the messages buffer).
does it still work ? any version php or python ? and how am I supposed to get the password ? is it the same as for verification code ?
Currently the receiver gets only the sender number, not the sender nickname.
Tested on an iOS device. The number is on the notify bar while WhatsApp is in the background.
Looks like a WhatsAPI problem. Messages between Whatsapp work very well.
Also the auth with iPhone based accounts work very great (using the MAC address).
So, I can send, and recieve some data, but after sending the first message this happens.
Test123123123123123PHP Warning: socket_read(): unable to read from socket [54]: Connection reset by peer in
Hi,
I'm having problems while trying to get the last seen information. I've been able to connect/login, get the account info (active) and receive messages, but I can't send messages nor get the last seen, which for me, seems to be a problem within the requests.
Additional info:
Symbian 3rd
PHP version
Tried both, venomous0x and aesedepece source code.
Regards!
Hello,
I've been looking for something just like this and I can't wait to try it out!
But it seems you can't send msg to groups ? or How can we find the JID of a whatsapp group?
Thanks again for your awesome work!
How could we send special chars like ä, ö, ü (umlaute)?
hello,
how can i connect with iphone?
what password should i put?
im trying to use the example php but i only get strage chars
thanks
Hi
I just started got the newest files filled in my IMEI and Phonenumber
I can use the "whatsapp.php" to send and to read but
after it gets all new messages it returns Warning
Warning: socket_read(): unable to read from socket [0]: .....
c:\myfolder\php\whatsprot.class.php on line 140
it also does it in interactive chat with argument -i but messaging is no problem
Can i ignore this message or is there a better way to handle this?
Hi,
Does anyone know if there is anyway I can query Whatsapp for the device type (Android, Iphone, WM, BB etc...) given a telephone number?
Thanks very much in advance
Great job!
Best Regards
Alex
Hi,
Does someone have the unencrypted packet dumpfile (for wireshark). Because I think you have to send some information back if you get the client delivery report, but I can't check that now, because I don't have a dumpfile.
xTraXx
I want to know how should I get the last login of user, should I use "Subscribe" or lastSeen function ?
Thanks
why is login took time so long, then I fugured out with some debug log read twice/three times on login, last one took like 2 minutes.
get some reply like this, and I put str2hex , I dont know what it means.
[Custom] process k:0 v: H8�C1344924219-ping�:����q�� str2hex 20f80848388a43fc0f313334343932343231392d70696e67a23af801f80371bdac
I'm tried to write Arabic messages but every Arabic character appears like this �
how to solve this problem and Thanks in Advanced
I still have it works a few days before
but after the 2.8.3 update announced, it can't complete the login process anymore.
It so strange that the old version (2.6.10) on my phone is still fine.
anyone have the same issue?
same as title
iPhone-2.6.9-5222 is receiving messages begging to upgrade again, "Your upgrade will be free and will bring bug fixes and new features such as Group Icons!"
I'm writing a JavaScript client for WhatsApp which makes calls to a forked version of this API. I expect to publish and free it next week. You'll love it for sure :)
So the question to debate is:
Should it be hosted as a different project in Github?
I think so, but I'm likely to hear opinions from project's committers and followers as I am a democracy lover :P
(This issue report should be marked as resolved once we come to agreement or by the 4 of July)
Obviously I'm not smart enough to understand the usage of [-l] [-s ] [-i ] in the included tests/whatsapp.php (newest WhatsAPI version).
I edited the correct $sender and $imei for my iOS device (checked it under https://r.whatsapp.net/v1/exist.php?...) but I don't know how and which argv I should use. Over the URL like this? /tests/whatsapp.php?-s
Thanks for your help!
Hi!
I've tried with both php and python (also with ruby thorugh rubypython gem)
In php it works perfectly with a code like this:
Connect(); $wa->Login(); $wa->Message(time()."-1","34666332211","test!"); But can't make it work in python. My current code is like this: import whatsapi whatsapi.start("34666112233","reversedmd5edimei") whatsapi.sendMessage("1","34666332211","test!") Any clues?when i run example.php i only see strange characters
ø��8Š�ø�–ø�ø�~_ø��½§üXbm9uY2U9IjQ5MzA0NTc5MjU2MiIscW9wPSJhdXRoIixjaGFyc2V0PXV0Zi04LGFsZ29yaXRobT1tZDUtc2Vzcw==
account_info
Array ( [status] => active [kind] => free [creation] => 1346384382 [expiration] => 1377920382 ) #ø�™½§” R7#ü 13463843820ü 1377920382
ø�t8Š”+½¶
�ø�•ø�ø� ½ªø�ü�text½ª‚�ø��
003af8085da0fafc0c3538343136353734353034368aa21b43fc0c313334363339343837342d31f802f804babd4ff801f8018cf80216fc04686f6c61
In whatsapp.v2.php line 211 is a username embeded this should may changed.
If I guess right the byte after \xfc defined the length of the nickname followed by the name.
At the moment I have no idea if that is relevant but a static "Ahmed Mohd" for everyone seems to be wrong ;-)
Hello, I am able to Tx, and Rx messages, but I would like to put the final touch on there and that involves the Client delivery report.
Currently if I send a message from php to an actual WhatsApp, I get back a Client Delivery report, which is good.
But if I send a message from an actual WhatsApp to php, the actual WhatsApp never gets the client delivery report, and as such only gets 1 check mark, further more if I disconnect the php and reconnect, I will get the un-acknowledged messages again...
I was just wondering if anyone has successfully sent a Client Delivery report from php?
Thanks
hi, i really want send messages behind proxy, anyone know how to do it?
Is there any method that I can use to check if a number is in Whatsapp before sending a message.
Thanks for your help!!!
Great job
Fer
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.