i tired of fixing calls

This commit is contained in:
onysd 2026-07-20 16:47:21 +03:00
parent 46afb97396
commit 157b82b5f5
7 changed files with 46 additions and 148 deletions

View file

@ -5,6 +5,7 @@ import (
"errors"
"github.com/iamxvbaba/td/tg"
"go.uber.org/zap"
appphone "telesrv/internal/app/phone"
"telesrv/internal/domain"
@ -221,6 +222,15 @@ func (r *Router) onPhoneDiscardCall(ctx context.Context, req *tg.PhoneDiscardCal
return nil, groupCallInvalidErr()
}
}
// 诊断:记录被叫/主叫挂断的 reason 与时机(相对 confirm)。用于定位「接听即断」类问题——
// hangup 通常是用户主动挂断或客户端 tgcalls 失败;disconnect/missed 是媒体/振铃超时。
if r.log != nil {
r.log.Info("phone discardCall",
zap.Int64("user_id", userID),
zap.Int64("call_id", req.Peer.ID),
zap.String("reason", string(reason)),
)
}
call, already, err := r.deps.Phone.DiscardCallWithSlug(ctx, userID, req.Peer.ID, req.Peer.AccessHash, reason, reasonSlug, req.Duration)
if err != nil {
return nil, phoneCallErr(err)