From c45b30924cb1ab365d78992dd556b7ec251756f2 Mon Sep 17 00:00:00 2001 From: Infactum Date: Thu, 16 Dec 2021 20:03:36 +0300 Subject: [PATCH] Update gateway.cpp possible out of range fix --- tg2sip/gateway.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tg2sip/gateway.cpp b/tg2sip/gateway.cpp index 0e79fcb..104260d 100755 --- a/tg2sip/gateway.cpp +++ b/tg2sip/gateway.cpp @@ -253,7 +253,7 @@ namespace state_machine::actions { ctx.ext_phone = ext.substr(1, std::string::npos); } else if (is_digits(ext)) { try { - ctx.user_id = std::stoi(ext); + ctx.user_id = std::stol(ext); } catch (const std::invalid_argument &e) { ext_valid = false; } catch (const std::out_of_range &e) { @@ -906,4 +906,4 @@ void Gateway::process_event(const TSipEvent &event) { delete *iter; bridges.erase(iter); } -} \ No newline at end of file +}