Allow IAX to lookup hosts from a master hosts file and reduce the

polling frequency for NEW commands.
This commit is contained in:
Jonathan Naylor
2024-11-01 16:36:53 +00:00
parent 724a44e0c4
commit a2f0d1c81c
12 changed files with 432 additions and 307 deletions

View File

@@ -303,3 +303,17 @@ void CFMRAWNetwork::enable(bool enabled)
m_enabled = enabled;
}
std::string CFMRAWNetwork::getAddress()
{
if (m_addrLen == 0U)
return "NONE";
char buffer1[250U];
char buffer2[250U];
int ret = ::getnameinfo((sockaddr*)&m_addr, m_addrLen, buffer1, 250, buffer2, 250, NI_NUMERICHOST | NI_NUMERICSERV);
if (ret != 0)
return "NONE";
return std::string(buffer1);
}