Add extra IAX debugging and remove an extraneous ACK.

This commit is contained in:
Jonathan Naylor
2024-08-05 17:38:43 +01:00
parent 03b06a3875
commit 0943090e60
2 changed files with 8 additions and 6 deletions

View File

@@ -409,8 +409,6 @@ void CFMIAXNetwork::clock(unsigned int ms)
m_rxFrames++;
m_iSeqNo = iSeqNo + 1U;
writeAck(addr, addrLen, ts);
uint16_t method = getIEUInt16(buffer, length, IAX_IE_AUTHMETHODS);
if ((method & IAX_AUTH_MD5) == 0x00U) {
LogError("IAX Gateway wanted something other than MD5 authentication = 0x%02X", method);
@@ -1091,18 +1089,18 @@ bool CFMIAXNetwork::writeRegReq()
HCRYPTHASH hHash = 0;
if (!::CryptCreateHash(m_provider, CALG_MD5, 0, 0, &hHash)) {
printf("CryptCreateHash failed: %ld\n", ::GetLastError());
LogError("CryptCreateHash failed: %ld", ::GetLastError());
return false;
}
if (!::CryptHashData(hHash, (BYTE*)password.c_str(), DWORD(password.size()), 0)) {
printf("CryptHashData failed: %ld\n", ::GetLastError());
LogError("CryptHashData failed: %ld", ::GetLastError());
return false;
}
DWORD cbHash = 16U;
if (!::CryptGetHashParam(hHash, HP_HASHVAL, hash, &cbHash, 0)) {
printf("CryptGetHashParam failed: %ld\n", ::GetLastError());
LogError("CryptGetHashParam failed: %ld", ::GetLastError());
return false;
}
@@ -1115,12 +1113,16 @@ bool CFMIAXNetwork::writeRegReq()
hash[8U], hash[9U], hash[10U], hash[11U],
hash[12U], hash[13U], hash[14U], hash[15U]);
LogMessage("FMIAXNetwork: \"%s\" + \"%s\" = \"%.*s\"", m_seed.c_str(), m_password.c_str(), 32, text);
setIEString(buffer, pos, IAX_IE_MD5_RESULT, text, 32U);
#else
char hash[MD5_DIGEST_STRING_LENGTH];
::MD5Data((uint8_t*)password.c_str(), password.size(), hash);
LogMessage("FMIAXNetwork: \"%s\" + \"%s\" = \"%.*s\"", m_seed.c_str(), m_password.c_str(), MD5_DIGEST_STRING_LENGTH - 1U, hash);
setIEString(buffer, pos, IAX_IE_MD5_RESULT, hash, MD5_DIGEST_STRING_LENGTH - 1U);
#endif
}

View File

@@ -19,6 +19,6 @@
#if !defined(VERSION_H)
#define VERSION_H
const char* VERSION = "20240711";
const char* VERSION = "20240805";
#endif