if firstPortNum = vbNullString then
firstPortNum = 0
end if
if numOfPorts = vbNullString then
numOfPorts = 0
end if
if geographicalPosition = vbNullString then
geographicalPosition = 0
end if
Set oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceId, ManagedEntityId)
If numOfPorts > 0 Then
For i = 0 To numOfPorts - 1
Set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Audiocodes.GW.Management.Pack.Trunk.Analog']$")
Call oInst.AddProperty("$MPElement[Name='NetworkLibrary!System.NetworkManagement.Node']/DeviceKey$", oArgs(7))
Call oInst.AddProperty("$MPElement[Name='Audiocodes.GW.Management.Pack.Module']/IPAddress$", moduleIP)
Call oInst.AddProperty("$MPElement[Name='Audiocodes.GW.Management.Pack.Module']/KeyOID$", moduleID)
Call oInst.AddProperty("$MPElement[Name='Audiocodes.GW.Management.Pack.Trunk']/GatewayIP$", moduleIP)
Call oInst.AddProperty("$MPElement[Name='Audiocodes.GW.Management.Pack.Trunk']/Index$", CStr(firstPortNum + i))
Call oInst.AddProperty("$MPElement[Name='Audiocodes.GW.Management.Pack.Trunk']/KeyOID$", "1.3.6.1.4.1.5003.9.10.8.2.20.1.1.2." & CStr(firstPortNum + i))
Call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", geographicalPosition & ": Analog Trunk #" & CStr(firstPortNum + i + 1))
Call oDiscoveryData.AddInstance(oInst)
Next
End If