asterisk-dotnet 1.6.3.1 Fix Ping actionid with 1.6.0.10 version
asterisk 1.6 现在的版本是
Asterisk 1.6.2.21
问题 asterisk 1.6.0.10 的 Ping 命令返回时没有actionId,但Aserisk 1.6.2.21Ping 命令返回却有actionId。
详细看 :https://issues.asterisk.org/bug_view_advanced_page.php?bug_id=13993
补丁:
ManagerConnection.cs 1982 行改为
if (!string.IsNullOrEmpty(actionId))
{
int hash = Helper.GetInternalActionId(actionId).GetHashCode();
responseActionId = Helper.StripInternalActionId(actionId);
responseHandler = GetRemoveResponseHandler(hash);
if (response != null)
response.ActionId = responseActionId;
if (responseHandler != null)
{
}
else if (response == null && buffer.ContainsKey("ping") && buffer["ping"] == "Pong")
{
response = Helper.BuildResponse(buffer);
foreach (ResponseHandler pingHandler in pingHandlers.Values)
pingHandler.HandleResponse(response);
pingHandlers.Clear();
}
}
else if (response == null && buffer.ContainsKey("ping") && buffer["ping"] == "Pong")
{
response = Helper.BuildResponse(buffer);
foreach (ResponseHandler pingHandler in pingHandlers.Values)
pingHandler.HandleResponse(response);
pingHandlers.Clear();
}