where does fusionpbx store gateway settings

Status
Not open for further replies.

ehrenmann1977

New Member
Mar 7, 2023
4
0
1
47
hi
i want to understand where fusionpbx stores the gateway settings and user settings? is it in database ? and how can i dump it to automate creating it later on.
 

Amit Iyer

Member
Feb 6, 2018
56
11
8
29
Hi,

FusionPBX stores the data in the postgres database, Table :v_gateways
To Dump it and automate it you will need to create an API on the basis of domain_uuid and other fields.
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,414
376
83
Hi,
FusionPBX does use a PostgreSQL database by default. The are many database admin tools available that will allow you to explore the database. However the quickest way to look is with the command line if you are logged in a root.

1. Su to postgres:
Code:
root@test1:~# su - postgres

2. Run psql:
Code:
postgres@test1:~$ psql fusionpbx
psql (11.5 (Debian 11.5-1+deb10u1))
Type "help" for help.

fusionpbx=#

3. List all the tables tables:
Code:
fusionpbx=# \dt

4. List of relations
 Schema |              Name               | Type  |   Owner  
--------+---------------------------------+-------+-----------
 public | v_access_control_nodes          | table | fusionpbx
 public | v_access_controls               | table | fusionpbx
 public | v_apps                          | table | fusionpbx
 public | v_bridges                       | table | fusionpbx
 public | v_call_block                    | table | fusionpbx
 public | v_call_broadcasts               | table | fusionpbx
 public | v_call_center_agents            | table | fusionpbx
 public | v_call_center_queues            | table | fusionpbx
 public | v_call_center_tiers             | table | fusionpbx
 public | v_call_flows                    | table | fusionpbx
 public | v_call_recordings               | table | fusionpbx
 public | v_conference_centers            | table | fusionpbx
 public | v_conference_control_details    | table | fusionpbx
 public | v_conference_controls           | table | fusionpbx
 public | v_conference_profile_params     | table | fusionpbx
 public | v_conference_profiles           | table | fusionpbx
 public | v_conference_rooms              | table | fusionpbx
 public | v_conference_session_details    | table | fusionpbx
 public | v_conference_sessions           | table | fusionpbx
 public | v_conference_users              | table | fusionpbx
 public | v_conferences                   | table | fusionpbx
 public | v_contact_addresses             | table | fusionpbx
 public | v_contact_attachments           | table | fusionpbx
...

5. Look at the structure of a specific table:
Code:
fusionpbx-# \d v_gateways
                    Table "public.v_gateways"
        Column        |  Type   | Collation | Nullable | Default
----------------------+---------+-----------+----------+---------
 gateway_uuid         | uuid    |           | not null |
 domain_uuid          | uuid    |           |          |
 gateway              | text    |           |          |
 username             | text    |           |          |
 password             | text    |           |          |
 distinct_to          | text    |           |          |
 auth_username        | text    |           |          |
 realm                | text    |           |          |
 from_user            | text    |           |          |
 from_domain          | text    |           |          |
 proxy                | text    |           |          |
 register_proxy       | text    |           |          |
 outbound_proxy       | text    |           |          |
 expire_seconds       | numeric |           |          |
 register             | text    |           |          |
 register_transport   | text    |           |          |
 retry_seconds        | numeric |           |          |
 extension            | text    |           |          |
 ping                 | text    |           |          |
 caller_id_in_from    | text    |           |          |
 supress_cng          | text    |           |          |
 sip_cid_type         | text    |           |          |
 codec_prefs          | text    |           |          |
 channels             | numeric |           |          |
 extension_in_contact | text    |           |          |
 context              | text    |           |          |
 profile              | text    |           |          |
 hostname             | text    |           |          |
 enabled              | text    |           |          |
 description          | text    |           |          |
Indexes:
    "v_gateways_pkey" PRIMARY KEY, btree (gateway_uuid)

6. Look at the data in a table:
Code:
fusionpbx=# select * from v_gateways;

             gateway_uuid             |             domain_uuid              |    gateway    | username |     password     | distinct_to | auth_username |         realm         | from_user |     from_domain      |        proxy         | register_proxy | outbound_proxy | expire_seconds | register | register_transport | retry_seconds |  extension   | ping | caller_id_in_from | supress_cng | sip_cid_type |  codec_prefs   | channels | extension_in_contact | context | profile  | hostname | enabled |                    description                  
--------------------------------------+--------------------------------------+---------------+----------+------------------+-------------+---------------+-----------------------+-----------+----------------------+----------------------+----------------+----------------+----------------+----------+--------------------+---------------+--------------+------+-------------------+-------------+--------------+----------------+----------+----------------------+---------+----------+----------+---------+---------------------------------------------------
 0b364571-f0c5-422d-9960-4a11772cb4a4 | 624b76e1-df58-45d5-a380-4bc5d2e95389 | MY_PROVIDER  | ME-123456 | nhdfyr74bgst3     |             |               | me.myprovider.co.uk  |           | me.myprovider.co.uk | me.myprovider.co.uk |                |                |            800 | false    |                    |            30 | auto_to_user |      | true              |             |              |                |        0 |                      | public  | external |          | true    | Gateway My Prodider (trunk1) Main

It's as simple as that!

Cheers Adrian.
 
Status
Not open for further replies.