There was a question today on IRC:
Here's a quick and dirty answer:
To export just a particular domains did numbers:
Results will be in /tmp/didnumbers.csv. Obviously, change mydomain.pbx.com to suit.
Anyone know if it's possible to export a complete list of DIDs from FusionPBX system wide? Trying to do a mass number porting and this would make my life alot easier
Here's a quick and dirty answer:
Code:
sudo -u postgres psql -d fusionpbx -c "\copy (select destination_number from v_destinations) to '/tmp/didnumbers.csv' with csv";
To export just a particular domains did numbers:
Code:
sudo -u postgres psql -d fusionpbx -c "\copy (select destination_number from v_destinations INNER JOIN v_domains on v_destinations.domain_uuid=v_domains.domain_uuid where v_domains.domain_name = 'mydomain.pbx.com') to '/tmp/didnumbers.csv' with csv";
Results will be in /tmp/didnumbers.csv. Obviously, change mydomain.pbx.com to suit.