Extension registeration

Hi

I would like to know how do I go about checking the last time an extension has been active on the PBX to use the extension and avoid using an extension that may be in use

On Thursday 10 April 2025 at 10:44:35, Campmega via Asterisk Community wrote:

I would like to know how do I go about checking the last time an extension
has been active on the PBX to use the extension and avoid using an
extension that may be in use

Please define “active”.

Antony.


I lay awake all night wondering where the sun went, and then it dawned on me.

Please define “extension”, as you don’t seem to be using it in the sense that Asterisk uses it.

If you mean channel endpoint, associated with what would be considered a telephone instrument, or similar, which channel technology are you using?

By “in use”, do you mean it in the Asterisk sense (at least one active call associated with the device), or do you mean Asterisk’s “busy” state (device has reached its configure maximum number of calls)?

Asterisk will avoid calling devices that are “busy”, without your needing to take any steps. To explicitly check, you can use the DEVICE_STATE function. In both cases, for busy states, for VoIP endpoint, you will need to configure the channel driver with the the number of sessions that constitutes busy.

The last time a device was accessed is not recorded except in diagnostic logs, intended for human, not machine consumption, and subject to log level setting.

Ok

So the Sip Trunk has a dormant extension I need to check if they have been used before allocating the SIP Extension to a new user. I would like to know what command is used to check when the last SIP account was used on the PBX

Current version in use: Asterisk 13.10.0

There isn’t a command to do this. Once you have clarified what you mean, you would have to trawl historic CDRs, CELs, or diagnostic logs.

SIP trunk has no meaning in Asterisk or SIP. As used in FreePBX, it is mutually exclusive with an extension, so a trunk having an extension makes no sense. Are you talking about what the FreePBX people call a DID, i.e. a PSTN number that is routed via the corresponding SIP provider endpoint?

Asterisk 13 was end of life three and a half years ago. Asterisk 13.10 is almost 9 years old.

Yes I am referring to the free PBX with DID’s linked with internal extension for the office phones.

If you are using FreePBX, you would need to ask on https://community.freepbx.org/ although I think this will still come to custom analysis of log files.