Is it possible to use fwconsole to adjust SIP settings (NAT settings, External Address)?

Hi everyone,

I am trying to set up Freepbx 16 via a post-installation script in Terraform.
Is it possible to set SIP settings → NAT settings → External Address (from the GUI) using fwconsole? I can run fwconsole setting -l but I cannot find any value related to that.

Or would I rather need to run an INSERT query in the database? What would be in that case the relevant table and column(s)?

Thank you in advance for any hints.

Best,
Anthony

Just post exactly what you are attempting to do, don’t assume anyone knows anything about “Terraform”

you can adjust mysql kvstore tables and fwconsole reload after. you can also modify using fwconsole kvstore but you can absolutely mess up your system if you don’t know what you’re doing

A good example by @billsimon

Thank you! It is great that fwconsole kvstore would allow you to do that. Indeed, I partially solved the issue by adding

fwconsole kvstore --action set --key externip --value ${IP_ADDRESS} Sipsettings

to my post-deployment script.

However, as I continued with other NAT settings, such as “Local Networks”, I haven’t managed to set it up due to nested keys:

"localnets": [
        {
            "net": "0.0.0.0",
            "mask": "24"
        }
    ],

I would like to change the “net” and “mask”, but I don’t know how to access the key.
I tried:

  • fwconsole kvstore --action set --key localnets --value [{"net": "10.1.0.5", "mask": "24"}] Sipsettings
  • fwconsole kvstore --action set --key localnets[0] --value {"net": "10.1.0.5", "mask": "24"} Sipsettings
  • fwconsole kvstore --action set --key localnets[0].net --value "10.1.0.5" Sipsettings

where only the latest one returned no error, but also set the key value in this way:
"localnets[0].net": "10.1.0.5",

What would be the correct way of dealing with array values for some keys?
Thanks

fwconsole kvstore --action set --key localnets --value '[{"net":"10.1.0.5","mask":"24"},{"net":...}]'

Thanks a lot for all the great hints.
The complete solution looks as follows:

fwconsole kvstore --action set --key externip --value ${publicip} Sipsettings
fwconsole kvstore --action set --key localnets --value '[{"net":"${subnet}","mask":"24"}]' Sipsettings

(in case it may help anyone in the future).
The ${variable} syntax is the way how variables are passed in terraform from the “azurerm_virtual_machine_extension” resource to a custom script.

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