What is that timestamp? – Dial-Peers – Last Setup/Disconnect Time

Reading Time: 5 minutes

Being the geek I am, I was troubleshooting an issue one day where I wanted to see what dial-peer a certain digit string was hitting on a gateway. I saw something that simply intrigued my mind that took focus away until I figured it out. This “thing” I saw was irrelevant to what I was troubleshooting but once the problem was resolved I simply had to figure it out. I’m sure many of you experience that same thing throughout your days. So, this is what I’ve discovered. *Please note that this is not an official explanation of the item/output, it is simply my interpretation from time spent figuring out what it really meant.

Alright, enough small talk. So what is it? It’s the “Last Setup Time” and “Last Disconnect Time” in the Cisco “show dialplan number” command. Initially I ignored the output because I simply wanted to see what dialpeer was matched. However, when I started typing my next show command I looked up a couple of lines and saw these ridiculous strings of digits associated with the above labels. What are they? What do they mean?

First lets start with a sample of the output so you can see it. I’ve obviously faked the phone number I entered in the command and the router name, however the rest of the output is real output from my debugging session.

With the above output I’m going to focus on the Last Setup Time. If you look at this string many people familiar with I.T. might jump to the conclusion I did when I first looked at it. That conclusion is “maybe it’s epoch time”. Well, lets see.

If I go to a quick online epoch time convert the string “1283340034” is the equivalent to GMT: Wed, 01 Sep 2010 11:20:34 GMT. Or in my time zone: September 1, 2010 at 7:20:34 AM EDT. Considering I am writing this post on Sept 15, 2015 that doesn’t quite add up. At this point I took a quick look at the uptime on the router to see if maybe it was correlating to that.

Alright, so the router has been up for 21 weeks and some change. So does that string correlate from seconds to weeks? Let’s see. Knowing that 1 week is equal to 604800 seconds if we convert 1283340034 as seconds into weeks we get: 2121.924659392 weeks. Um….No?!

Maybe it’s in microseconds. 1 week is equal to 1.6534e-12 micro seconds so 1283340034 is the equivalent to 0.002121924659392 weeks. Yup, no way, that’s not it.

At this point it just ended up me just trying things until I figured out this random thing. If I dropped the last two digits, and starting converting the string down to weeks, take the leftover and convert it to days, take the leftovers from that and convert it to hours, and finally minutes, it turned out that it was extremely close to the uptime of the router. What this meant is that if I did this calculation on the digit string, subtracted it from the uptime, and took the difference off the current clock on the router, I would get the rough time that the dialpeer was last setup. Crazy! I’ll run through the calculation on this string below.

Take the Last SetupTime and drop the last two digits.
1283340034 = 12833400

Convert this number as seconds to weeks. (1 week = 604800 seconds)
This is 21.219246032
Write down the whole number as weeks.
21 weeks

Take the remaining decimal (.219246032) and convert it as weeks to days (1 week = 7 days)
This is 1.534722224
Write down the whole number as days
1 Day

Take the remaining decimal (.534722224) and convert it as days to hours (1 day = 24 Hours)
This is 12.833333376
Write down the whole number as hours
12 Hours

Convert the remaining decimal (.833333376) as hours to minutes (1 hours = 60 minutes)
This is 50.00000256
Write down the whole number as minutes
50 Minutes

This gives us 21 Weeks, 1 Day, 12 Hours, 50 Minutes as the last time this dial peer was Last Used for Setup

Find the difference between the uptime and the Last Setup Time we just calculated
1 Minutes in this case. (21 weeks, 1 day, 12 hours, 51 minutes minus 21 Weeks, 1 Day, 12 Hours, 50 Minutes)

Take the show clock and subtract the result of the difference
10:39:30.255 EDT Tue Sep 15 2015 minus 1 minute = the Last Setup Time as 10:38:30.255 On Tuesday Sep 15, 2015

I cannot find any documentation anywhere that indicated this calculation (or maybe even an easier way to do it) for this time stamp in the “show dialplan number #” output. I find it strange to need to drop the last two digits although they may represent 1/10s of a second. Anyone willing to prove that please do and let me know. Also interesting to me is the “.” at the end of the string. Only these timestamps have it making it either a curious artifact or a programmer that simply wanted to indicate an end to the line.

On another note, I kind of hate my brain for making be want to know the answer to this.

This same calculation would work for the last disconnect time. If you are going to do this calculation I recommend doing the “show dialplan..” “show ver | i uptime” and “show clock” as closely as possible.

 

Share this article:

Permanent link to this article: https://www.packetpilot.com/what-is-that-timestamp-dial-peers-last-setupdisconnect-time/