Giter Site home page Giter Site logo

dudanogueira / rocket.connect Goto Github PK

View Code? Open in Web Editor NEW
75.0 75.0 25.0 1.55 MB

Rocket Connect - An agnostic connector for Chat Platforms

License: MIT License

Dockerfile 0.95% Shell 0.81% Python 89.93% CSS 0.03% JavaScript 0.22% SCSS 0.08% HTML 5.84% Hack 2.07% PHP 0.08%
asterisk chatwoot facebook python rocketchat sip telegram voip whatsapp

rocket.connect's Introduction

rocket.connect's People

Contributors

crashbr avatar dependabot[bot] avatar diegoromal avatar dudanogueira avatar edgardmessias avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rocket.connect's Issues

[FEATURE] optional answer for no agent online

REGISTERING ROOM, {'success': False, 'error': 'Sorry, no online agents [no-agent-online]', 'errorType': 'no-agent-online'}

when this happens
1 - send a message to admin, as this incoming chat will be dismissed.
2 - optionally auto answer with no_agent_online_message

Reply

Ao utilizar o comando de reply, o rocket encaminha um link ao invés da mensagem original.

image

Make Department Optional

If the department is not provided at the connector config, the base connector will try to register, by sending a json with an empty department, and crashing.

Make it optional, and if no department configured, do not add an empty department to json

[TASK] Allow send message as visitor

After X seconds, if the last message is from the visitor, send a new message to a channel, or impersonating the user, in order to activate the unread status and notification,

Multiple livechat rooms created when image is sent

I could not reproduce this at docker local development, only in production. I will try to slow the latency somehow, or install a development at cloud

When a visitor send first an image, then a text, for some reason (Maybe latency?) two and sometimes 3 livechat rooms are created.

Messages from the agent on all those additional rooms will be delivered, but messages from the visitor will not. It will, however, get registered and set as not delivered.

To mitigate this problems, I will change the connector to, when getting multiple open room objects from the same visitor token at the same connector, choose the latest one. This is not a perfect solution, but at least the message will be delivered.

Edição do nome do contato no Rocket.Chat

Nas versões anteriores do Rocket.Connect, quais não informavam o nome do contato no WhatsApp, era possível editar o nome do contato no Rocket.Chat e nas próximas conversas aquele nome continuava, ajudando na identificação do cliente/empresa.
Hoje, com a alteração para que fosse possível identificar o nome que o contato tem no WhatsApp, essa opção de "editar" o nome ficou indisponível, se eu edito o nome no ROcket.Chat, nas próximas conversas é sobrescrito com as informações que vem do WhatsApp.

Suppress Names in WhatsApp Messages

Add possibility to suppress the name that appears when sending the message by WhatsApp, based on a Rocket.Chat username comma-separated list.

wppconnect: send vcar contact - welcome vcard

The vcard json needs to be adjusted so that when a contact speaks to the number in question, the person's number is collected and inserted as a parameter in the phone field, following the example in the documentation:

{
"phone": "556593077171",
"contactsId": "[email protected]",
"name": "Contact Name",
"isGroup": false
}

Texto do Connector

Seria importante conseguir pular linhas nas configurações de texto do connector (mensagem de encerramento, mensagem se o usuário liga por áudio, mensagem quando o agente “pega a conversa”, etc). Isso funciona se aplicar direto no json, mas na configuração da interface não obedece.

Tratar diferentes tipos de anexos

Assim como é com áudios e chamadas, seria muito interessante a possibilidade de tratarmos diferentes tipos de anexos com um texto padrão? a idéia seria ter duas opções:

  • Encaminhar para o RocketChat um texto padrão quando chaga determinado tipo de anexo à minha escolha e ter um texto "padrão geral" (Isso porque o bot não atua se o cliente manda uma foto, vídeo, pdf, etc direto)
  • Ter a opção de responder o cliente com um texto padrão, fazendo com que o RocketChat "ignore" aquele determinado tipo de anexo"

Externa url endereço invalido

tem uma '/' a mais nesse arquivo aqui rocket.connect/rocket_connect/plugins/wppconnect.py
na linha 1135 não tenho certeza se a linha 191 tb está com essa barra a mais.

external_url = f"{base_url}/omnichannel/current/{room.room_id}"
o correto seria isso aqui external_url = f"{base_url}omnichannel/current/{room.room_id}"

Build WppConnect ourselves

In order to have control of which version of wppconnect we will run, create a version and docker image ourselves using the same build CI/CD of Rocket.Connect.

Cover Base Pugin with tests

After the POC, we can now start writing some tests and changing the base plugin to cover it all.

  • all tests should reference their plugin name.
  • there should be default incoming, ingoing, outcoming and outgoing, and the test will be using those to assert true.
  • ....

Improve management commands

Allow management commands for: force_delivery, mark_delivered
also, on rc status, return undelivered totals

WAAUTOMATE: Sometimes, it cannot get pushname

File "/app/rocket_connect/instance/views.py", line 28, in connector_endpoint
return_response = connector.intake(request)
File "/app/rocket_connect/instance/models.py", line 144, in intake
return connector.incoming()
File "/app/rocket_connect/plugins/waautomate.py", line 267, in incoming
self.get_room()
File "/app/rocket_connect/plugins/base.py", line 284, in get_room
visitor_json = self.get_visitor_json()
File "/app/rocket_connect/plugins/base.py", line 213, in get_visitor_json
visitor_name = self.get_visitor_name()
File "/app/rocket_connect/plugins/waautomate.py", line 550, in get_visitor_name
push_name = sent.json().get("response", {}).get("pushname")

Exception Type: AttributeError at /connector/0ADE1CAA995C4FF5918D/
Exception Value: 'NoneType' object has no attribute 'get'
Request information:
USER: AnonymousUser

Connection refused right after "CONNECTOR CREATED: FACEBOOK CONNECTOR"

Oi Duda!
I had this error on the second installation command (docker-compose run).
I'm running this on a vanilla Ubuntu 20.04 droplet (I'll try on a 18 instance).

This was the full error:

rod@ubuntu-adq:~/rocket$ docker-compose -f local.yml run --rm django python manage.py dev_settings
WARNING: Some services (browser) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use `docker stack deploy` to deploy to a swarm.
Starting mailhog  ... done
Starting postgres ... done
PostgreSQL is available
SERVER CREATED
CONNECTOR CREATED:  {'external_token': 'CONNECTOR_EXTERNAL_TOKEN1', 'endpoint': 'http://waautomate1:8002', 'name': 'WA instance1', 'manager': 'manager1,agent1'}
CONNECTOR CREATED:  {'external_token': 'CONNECTOR_EXTERNAL_TOKEN2', 'endpoint': 'http://waautomate2:8002', 'name': 'WA instance2', 'manager': 'manager2,agent2'}
CONNECTOR CREATED:  FACEBOOK CONNECTOR
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection
    raise err
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.8/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1007, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.8/http/client.py", line 947, in send
    self.connect()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 200, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7ffab66153d0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='rocketchat', port=3000): Max retries exceeded with url: /api/v1/login (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffab66153d0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 31, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 371, in execute
    output = self.handle(*args, **options)
  File "/app/rocket_connect/instance/management/commands/dev_settings.py", line 218, in handle
    self.handle_rocketchat()
  File "/app/rocket_connect/instance/management/commands/dev_settings.py", line 101, in handle_rocketchat
    rocket = server.get_rocket_client()
  File "/app/rocket_connect/instance/models.py", line 31, in get_rocket_client
    rocket = RocketChat(user, pwd, server_url=self.url)
  File "/usr/local/lib/python3.8/site-packages/rocketchat_API/APISections/base.py", line 36, in __init__
    self.login(user, password)  # skipcq: PTC-W1006
  File "/usr/local/lib/python3.8/site-packages/rocketchat_API/APISections/base.py", line 120, in login
    login_request = requests.post(
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='rocketchat', port=3000): Max retries exceeded with url: /api/v1/login (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ffab66153d0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Create task to close messages with specific users for more then X seconds

a task will routinely run, and do:

What are the omnichannel chats, where the last message is from this specific users (last_message_users) and is older than last_message_users_seconds. The task will then send a (last_message_closing_message) and actually close the chat.

Use case: If the last message is from the bot, and it is more then 1 hour without the customer response, send a message (eg: Due to lack of interactions, we are closing this chat) and close the chat.

Ignorar departamento

A opção "Session taken alert ignore departments" parou de funcionar após atualizar para a última versão dev.

WAAUTOMATE: Sometimes, the message media is not decrypted

File "/app/rocket_connect/instance/views.py", line 41, in check_and_call
return func(request, *args, **kwargs)
File "/app/rocket_connect/instance/views.py", line 108, in server_detail_view
message.force_delivery()
File "/app/rocket_connect/envelope/models.py", line 50, in force_delivery
c.incoming()
File "/app/rocket_connect/plugins/waautomate.py", line 188, in incoming
data = self.decrypt_media(quoted_id)
File "/app/rocket_connect/plugins/base.py", line 416, in decrypt_media
data = decrypted_data_request.json()["response"].split(",")[1]

Exception Type: KeyError at /instance/server/D5F8141DB6D9449A8B8B
Exception Value: 'response'
Request information:

[FEATURE] Opções de verificar sessão via API

Seria interessante termos uma opção para monitorar o wppconnect: sessão ativa, parar, iniciar, etc todas via api, assim pode ser implementado via Rocket.Chat essas funçoes e também usarmos em um sistema de monitoramento(zabbix).

Problemas com mensagens "Grandes"

Ao enviar um vídeo, áudio, até mesmo um texto grande, o conector do wppconect trava e é preciso parar o container, "ler as mensagens" no whatsapp, e iniciar o container novamente.
Creio ser um problema com o wppconnect, estou investigando mais ingormações.

Rocket Connect Admin User/Password: admin/admin Not working

Hi the documentation says the default USER/PASSWORD is admin/admin but can't connect with that credentials

Doc referred :
https://rocketconnect.readthedocs.io/en/latest/howto.html#run-the-development-stack
Can you please tell me how to change it or has the default login been modified?
Thank you

Bug em grupos do whatsapp

Os grupos só carregam ao carregar as mensagens pela primeira vez e após isso não aparece grupos novos e nem mensagens em grupos já carregados.
Outro ponto é que não carrega os nomes dos grupos, fica só o ID dos grupos dificultando a diferenciação.

[BASE] CUSTOM CLOSE MESSAGE PER DEPARTMENT

If the chat is in a specific department, after closing, ignore the close message or send a custom message

This is due to some numbers also have welcome message, and this will give flexibility to choose not to send or to send a specific message

Remove the square bracket from the attendant's name.

I was thinking here about removing the bracket from the attendant's name when the customer is served.

Instead of [AgentName], keeping just "Agent Name", without the square bracket, would work better for me in WPPCONNECT.

Also, it would be interesting for the bot not to show its name, but when someone answers, show it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.