Added new AsteriskVersions to determineVersion()
Added up to Asterisk v17. Added an attempt at getting newer versions too.
This commit is contained in:
parent
acd9e885cc
commit
3adadb1c63
|
@ -1681,6 +1681,31 @@ namespace AsterNET.Manager
|
||||||
VAR_DELIMITER = new char[] { ',' };
|
VAR_DELIMITER = new char[] { ',' };
|
||||||
return Manager.AsteriskVersion.ASTERISK_13;
|
return Manager.AsteriskVersion.ASTERISK_13;
|
||||||
}
|
}
|
||||||
|
else if (version.StartsWith("14."))
|
||||||
|
{
|
||||||
|
VAR_DELIMITER = new char[] { ',' };
|
||||||
|
return Manager.AsteriskVersion.ASTERISK_14;
|
||||||
|
}
|
||||||
|
else if (version.StartsWith("15."))
|
||||||
|
{
|
||||||
|
VAR_DELIMITER = new char[] { ',' };
|
||||||
|
return Manager.AsteriskVersion.ASTERISK_15;
|
||||||
|
}
|
||||||
|
else if (version.StartsWith("16."))
|
||||||
|
{
|
||||||
|
VAR_DELIMITER = new char[] { ',' };
|
||||||
|
return Manager.AsteriskVersion.ASTERISK_16;
|
||||||
|
}
|
||||||
|
else if (version.StartsWith("17."))
|
||||||
|
{
|
||||||
|
VAR_DELIMITER = new char[] { ',' };
|
||||||
|
return Manager.AsteriskVersion.ASTERISK_17;
|
||||||
|
}
|
||||||
|
else if (version.IndexOf('.') >= 2)
|
||||||
|
{
|
||||||
|
VAR_DELIMITER = new char[] { ',' };
|
||||||
|
return Manager.AsteriskVersion.ASTERISK_Newer;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
throw new ManagerException("Unknown Asterisk version " + version);
|
throw new ManagerException("Unknown Asterisk version " + version);
|
||||||
}
|
}
|
||||||
|
@ -1697,9 +1722,12 @@ namespace AsterNET.Manager
|
||||||
string line1;
|
string line1;
|
||||||
line1 = (string)showVersionFilesResult[0];
|
line1 = (string)showVersionFilesResult[0];
|
||||||
if (line1 != null && line1.StartsWith("File"))
|
if (line1 != null && line1.StartsWith("File"))
|
||||||
|
{
|
||||||
|
VAR_DELIMITER = new char[] { '|' };
|
||||||
return AsteriskVersion.ASTERISK_1_2;
|
return AsteriskVersion.ASTERISK_1_2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return AsteriskVersion.ASTERISK_1_0;
|
return AsteriskVersion.ASTERISK_1_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue