NOTE: The following is adapted from the page at https://www.voip.com/byod_install_asterisk.asp (with certain changes to work with FreePBX) but has not been tested. If you find any additional changes are necessary, please leave a comment stating what you had to change to make it work. Do not include comments in parenthesis when adding lines to the trunk configuration!
OUTGOING SETTINGS
Trunk Name: voipcom
PEER Details:
disallow=all
allow=ulaw
type=peer
user=username (your authentication User Name provided by voip.com)
host=domain (your domain provided by voip.com)
fromdomain=domain (your domain provided by voip.com)
fromuser=username (your authentication User Name provided by voip.com)
secret=password (your authentication Password provided by voip.com)
username=username (your authentication User Name provided by voip.com)
insecure=port,invite (or insecure=very only in Asterisk 1.2 & earlier)
context=from-trunk (DON'T change this unless you know what you are doing!!!)
authname=username (your authentication User Name provided by voip.com)
dtmfmode=inband
dtmf=inband (or try auto if you have touch-tone issues)
qualify=yes
(Also add the following line to PEER details if your system is behind a NAT firewall):
canreinvite=no
INCOMING SETTINGS NOT USED
Registration String: your authentication User Name:your authentication Password@your voip.com domain/your 11 digit number
Additional note: Voip.com tells you to add pedantic=no to sip.conf. This should NOT be necessary in FreePBX and in any case, you should not add it to sip.conf (because that file is "owned" by FreePBX), but rather to a custom file such as sip_custom.conf or sip_general_custom.conf (in the etc/asterisk directory). We advise trying to make the trunk work without this modification first, then only if it does not work you can try adding that line to one of the above-mentioned "custom" files.
Source: https://www.voip.com/byod_install_asterisk.asp (with required changes to work with FreePBX). Note that if you choose to use the dial plan settings shown on that page, the patterns you wish to allow should be placed in your outbound route, NOT added manually to extensions.conf. Use only the portion of the pattern(s) between "exten => _" and the first comma in the line (do NOT include the leading underscore).