1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-03 02:22:25 +01:00

[sim800l] Fixed ignoring incoming calls. (#10865)

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
Vladimir Makeev
2025-09-29 17:08:51 +04:00
committed by Jesse Hills
parent c95180504a
commit 158a59aa83

View File

@@ -288,11 +288,15 @@ void Sim800LComponent::parse_cmd_(std::string message) {
if (item == 3) { // stat if (item == 3) { // stat
uint8_t current_call_state = parse_number<uint8_t>(message.substr(start, end - start)).value_or(6); uint8_t current_call_state = parse_number<uint8_t>(message.substr(start, end - start)).value_or(6);
if (current_call_state != this->call_state_) { if (current_call_state != this->call_state_) {
ESP_LOGD(TAG, "Call state is now: %d", current_call_state); if (current_call_state == 4) {
if (current_call_state == 0) ESP_LOGV(TAG, "Premature call state '4'. Ignoring, waiting for RING");
this->call_connected_callback_.call(); } else {
this->call_state_ = current_call_state;
ESP_LOGD(TAG, "Call state is now: %d", current_call_state);
if (current_call_state == 0)
this->call_connected_callback_.call();
}
} }
this->call_state_ = current_call_state;
break; break;
} }
// item 4 = "" // item 4 = ""