Asterisk and a Cisco FXO Gateway

Holy smokes!  I just had to document this because it's been driving me insane for days!!!

If you have a Cisco gateway with FXO port and you are connecting to an Asterisk@home server, here's how to set up the SIP trunk in AMP:

In the Outgoing settings only:
allow=ulaw
context=from-pstn
disallow=all
dtmfmode=rfc2833
host=192.168.169.2
insecure=very
ipaddr=192.168.169.2
type=peer

Couple things to note here.  I believe the host and ipaddr must be the IP Address of the router.  It's possible that a host name defined in DNS or the hosts file would work also.  The other key elements are type=peer and insecure=very.  Without those two Asterisk won't accept the incoming SIP traffic as "known" and it will kick it to the curb, or the bogon-calls context if you have it defined.

From there it's a matter of defining the "Inbound Routing".