Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DTMF does not work in v1.3.0 #54

Open
dkovik opened this issue Jan 13, 2022 · 1 comment
Open

DTMF does not work in v1.3.0 #54

dkovik opened this issue Jan 13, 2022 · 1 comment

Comments

@dkovik
Copy link

dkovik commented Jan 13, 2022

After switching to version 1.3.0, DTMF from Telagram to Sip does not work.

@dkovik
Copy link
Author

dkovik commented Jan 14, 2022

Hi Infactum,
I have commented 2 lines in the process_event function inside the gateway.cpp and the DTMF started to work again.

The DTMF numbers are received, via Telegram chat.

However I still do not know if my changes do not have some unwanted side effect as I really do not understand the code.

void Gateway::process_event(td::td_api::object_ptr<td::td_api::updateNewMessage> update_message) {
      auto &sender = update_message->message_->sender_id_;
      //if (sender->get_id() == td_api::messageSenderUser::ID)
      //    return;
      auto user = static_cast<const td_api::messageSenderUser *>(sender.get());
  
      std::vector<Bridge *> matches;
      for (auto bridge : bridges) {
          if (bridge->ctx->user_id == user->user_id_) {
              matches.emplace_back(bridge);
          }   
      }   
  
      if (matches.size() > 1) {
          logger_->error("ambiguous message from {}", user->user_id_);
          return;
      } else if (matches.size() == 1) {
          TRACE(logger_, "routing message to ctx {}", matches[0]->ctx->id());
          matches[0]->sm->process_event(update_message);
      }   
  
  }

I have commented (removed)

if (sender->get_id() == td_api::messageSenderUser::ID)
    return;

So the functions

matches[0]->sm->process_event(update_message);

gets called and the DTMF starts to work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant