SIP: Properly handle nil trunk. (#2291)

This commit is contained in:
Denys Smirnov
2023-12-04 10:21:21 -05:00
committed by GitHub
parent 02c28a5946
commit 1240c1670b
+3
View File
@@ -61,6 +61,9 @@ func (s *IOInfoService) GetSIPTrunkAuthentication(ctx context.Context, req *rpc.
if err != nil {
return nil, err
}
if trunk == nil {
return &rpc.GetSIPTrunkAuthenticationResponse{}, nil
}
return &rpc.GetSIPTrunkAuthenticationResponse{
Username: trunk.InboundUsername,
Password: trunk.InboundPassword,