tgalal / yowsup

The WhatsApp lib
GNU General Public License v3.0
7.03k stars 2.23k forks source link

send and exit demo is erroring out at (@ProtocolEntityCallback("ack") #1739

Closed ragowthaman closed 7 years ago

ragowthaman commented 7 years ago

Hi :- I was able to use EcoClient, yowsup-cli without any trouble. Thanks for the awesomework. However, I could not get send and exit demo client work.

When I send the message via

yowsupsendstack = YowsupSendStack(("91xxxxxxxxx", "xOAcj45Ovxxxxxxx"), [("91xxxxxxx", "est mes")]) 
yowsupsendstack.start()

It errors out saying (traceback is below)

However, when I print ack entity, it seems to have received an acknowledgement from recipent.

ACK:
ID: 1472180096-1
Class: message
From: 919003832999@s.whatsapp.net
timestamp: 1472180096

timestamp on message and ack entity are exactly same.

Message:
ID: 1472180096-1
To: 919003832999@s.whatsapp.net
Type:  text
Timestamp: 1472180096
Body: est mes

Sending message via cli and pywhatsapp works just fine. I appreciate any help or pointer to resolve this issue.

Traceback:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/gramasamy/Software/apps/vidhaikalam/instance/send_stack.py", line 31, in start
    self.stack.loop()
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/stacks/yowstack.py", line 196, in loop
    asyncore.loop(*args, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 216, in loop
    poll_fun(timeout, map)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 156, in poll
    read(obj)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 83, in read
    obj.handle_read_event()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/asyncore.py", line 449, in handle_read_event
    self.handle_read()
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/network/layer.py", line 102, in handle_read
    self.receive(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/network/layer.py", line 110, in receive
    self.toUpper(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/stanzaregulator/layer.py", line 29, in receive
    self.processReceived()
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/stanzaregulator/layer.py", line 49, in processReceived
    self.toUpper(oneMessageData)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/auth/layer_crypt.py", line 65, in receive
    self.toUpper(payload)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/coder/layer.py", line 35, in receive
    self.toUpper(node)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/logger/layer.py", line 14, in receive
    self.toUpper(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/axolotl/layer_control.py", line 44, in receive
    self.toUpper(protocolTreeNode)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/__init__.py", line 189, in receive
    s.receive(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/axolotl/layer_receive.py", line 44, in receive
    self.toUpper(protocolTreeNode)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/__init__.py", line 189, in receive
    s.receive(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/__init__.py", line 125, in receive
    recv(node)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/protocol_acks/layer.py", line 17, in recvAckNode
    self.toUpper(IncomingAckProtocolEntity.fromProtocolTreeNode(node))
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/__init__.py", line 76, in toUpper
    self.__upper.receive(data)
  File "/Users/gramasamy/Software/virtualenvs/vidhaikalam/lib/python2.7/site-packages/yowsup/layers/interface/interface.py", line 80, in receive
    self.entity_callbacks[entityType](entity)
  File "/Users/gramasamy/Software/apps/vidhaikalam/instance/send_layer.py", line 60, in onAck
    raise KeyboardInterrupt()
KeyboardInterrupt
ragowthaman commented 7 years ago

....../instance/send_layer.py is nothing buy layer.py of send example

jlguardi commented 7 years ago

This interrupt is the expected working flow when message is sent and acked. Read send_layer.py carefully.

ragowthaman commented 7 years ago

Thanks J@jlguardi. But the message is not sent. Or to be precise it is NOT received at the receivers phone. That's what troubling a bit.

jlguardi commented 7 years ago

Comment out the raise KeyboardInterrupt() line and keep de application running to see if retry is gotten. Remember to post logs.