Looking for help to diagnose SIP connections using NAT

I have a working asterisk system that I am trying to extend to receive calls from a reputable PSTN service provider.
I believe I am having configuration issues at my end, but I can’t figure out from the asterisk SIP documentation what is not configured correctly.

I have a local network behind a firewall with NAT. The system can communicate to SIP devices within my local
network. My asterisk box has an IP address of I am attempting to communicate with a provider who
has supplied an IP address (which I configured in /etc/hosts). I can “ping” my provider successfully with the commands:
% ping provider
% ping sip.provider.com

I can not seem to get asterisk to correctly initiate communication to my provider’s system. I have included snippits
from SIP.CONF as well as short snippits from the asterisk console. In particular, I don’t know where the address is coming from (it is not related to my provider or my local LAN). I am also confused at the line
"Contact: sip:s@" (as this reflects my local LAN).

I use a DYN-DNS service to register a DNS name for my home network (through a cable provider)

I am trying to piece together exactly how the SIP configuration settings (below) relate to the diagnostic messages I am
observing in the asterisk console. Can anyone offer any suggestions?

;---- Configuration from SIP.CONF
;---- Register statement
register => MYNUMBER:MYSECRET@provider

;---- Provider declaration

;---- Diagnostic messages from Console
;---- Timeout attempting to register
Mar 3 08:43:26 NOTICE[4187]: chan_sip.c:5473 sip_reg_timeout: – Registration for ‘MYNUMBER@provider’ timed out, trying again (Attempt #1)
Mar 3 08:43:26 WARNING[4187]: chan_sip.c:1994 create_addr: No such host: provider
Destroying call '5390a71d47d46836534ab578753edade@’
Mar 3 08:43:26 WARNING[4187]: chan_sip.c:5556 transmit_register: Probably a DNS error for registration to MYNUMBER

;---- Additional diagnostic from “sip debug”
– Re-registration for MYNUMBER@provider
REGISTER 12 headers, 0 lines
Reliably Transmitting (NAT) to
REGISTER sip:provider SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK55e4449b;rport
From: sip:MYNUMBER@provider;tag=as1fc9375c
To: sip:MYNUMBER@provider
Call-ID: 6f9198b251da74036d997e8c5760fa06@
User-Agent: Asterisk PBX
Max-Forwards: 70
Expires: 120
Contact: sip:s@
Event: registration
Content-Length: 0

Some providers have some settings that are specific to them so I would say first stop is to contact your provider to give you their own specific setting so that you can input your connection info. SOme providers do post their connection settings on their website. Then when it comes to other issues on your end you can get more explanations from the following link; forums.digium.com/viewtopic.php? … ight=drwho

shouldnt externhost/localnet be in general, not the peer definition?