Finding/Extracting certain Extn Settings from CLI


I have a shell script which I use to extract various Extn related settings from both the Database & Config files within FPBX as appropriate & presents them in a single table view for convenience. This works fine currently, however, I would like to include some additional settings but I can’t seem to find where they’re located.

I can find these values within the AdminGUI/UCP, but does anyone know where/how I can extract them via the CLI (so I can then incorporate them into my script);

  1. Extn Ring Time - How long an Extn Rings before switching to On-NoAnswer optional Destination (NOT same setting as FMFM Ring Time). I know there’s a Global Default value in ‘Advanced Settings’, but its the per Extn value I’m after (if its been set to something other than Default).

  2. FindMe/FollowMe - Whether this feature is Enabled/Disabled for a given Extn (I can see the configured FMFM values for each Extn within the ‘findmefollow’ DB table, but not whether they’re actually enabled/disabled for a given Extn - FMFM records seem to exist for ALL Extns, regardless of whether the feature is enabled or not).

  3. Unconditional Call Forwarding - Whether this feature is Enabled/Disabled for a given Extn & if so, what forwarding Tel No is being used.

Any assistance/pointers with the above would be greatly appreciated.

(Lorne Gaetz) #2

All values are available from the AstDB

> database show ampuser 6003/ringtimer
/AMPUSER/6003/ringtimer                           : 66
1 results found.
> database show ampuser 6003/followme/ddial
/AMPUSER/6003/followme/ddial                      : DIRECT
1 results found.
> database show ampuser 6003/followme/ddial
/AMPUSER/6003/followme/ddial                      : EXTENSION

Unconditional, unavailable and busy respectively

> database show CF 6002
/CF/6002                                          : 445566
1 results found.
> database show CFU
/CFU/6002                                         : 2233
1 results found.
> database show CFB 6002
/CFB/6002                                         : 1122
1 results found.


Thanks Lorne, that’s a great help.

I’m not familiar with the Asterisk DB, but this has given me a good start to it. It appears to reference values like the Windows Registry, in that it uses a Family & Key to identify a given value (like Windows Reg Hive & Key). I’ve experimented with a combination of ‘database show’ & ‘database get’ to see what’s available & extract the specific values I want in the following way.

Show ALL Values relating to Extn 200;

asterisk -x “database show” | grep ‘/200’

Show all Values relating to Extn 200 in AMPUSER family only;

asterisk -x “database show AMPUSER 200”

Get specific values relating to Extn 200;

asterisk -x “database get AMPUSER 200/cidname”
asterisk -x “database get AMPUSER 200/ringtimer”
asterisk -x “database get AMPUSER 200/followme/ddial”
asterisk -x “database get CF 200”

Assuming I’ve not misunderstood anything in my examples above, I think I’m good to go.

(Lorne Gaetz) #4

Broadly correct. I often grep the output of ‘database show’ when I’m not sure what I’m looking for, you can usually narrow things down that way.

(system) closed #5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.