Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

Convert CDR ip address from hex

Hello ,

is anyone can send me please a formula (in c ov VB) to convert the ip address from the cdr to a "normal" one

2 REPLIES

Re: Convert CDR ip address from hex

Here's what I use in my custom CDR Access DB:

Public Function IPConvert(IPDec As Long) As Variant

IPHex = Hex(IPDec)

If IPDec = 0 Then IPHex = "00000000"

If Len(IPHex) < 8 Then IPHex = "0" & IPHex

Octet1 = CDec("&H" & Right(IPHex, 2))

Octet2 = CDec("&H" & Mid(IPHex, 5, 2))

Octet3 = CDec("&H" & Mid(IPHex, 3, 2))

Octet4 = CDec("&H" & Left(IPHex, 2))

IPConvert = Octet1 & "." & Octet2 & "." & Octet3 & "." & Octet4

End Function

New Member

Re: Convert CDR ip address from hex

thanks

557
Views
0
Helpful
2
Replies
CreatePlease to create content