Problem connecting asterisk (sip client) with sip server out

Hi
I have problem connecting to sip server fom asteisk.asterisk is behind the nat.
in the asterisk console i am getting
Aug 24 11:06:53 NOTICE[2348]: chan_sip.c:5372 sip_reg_timeout: – Registration for '8278298238@sip.net2phone.com’ timed out, trying again (Attempt #1)
when i type sip show peers i am getting
account/8278298238 66.33.157.12 N 5060 UNREACHABLE
can anyone help me in soleving the problem.i have given my sip and extension file
thanks in advance
prabhakar

SIP.CONF
[general]

port = 5060
bindaddr = 0.0.0.0
context = test
register => 8278298238:3112@sip.net2phone.com:8060
useragent=X-Lite release 1103m
[account]
disallow=all
nat=yes
allow=ulaw
allow=alaw
type=friend
username=8278298238
secret=3112
host=sip.net2phone.com
dtmfmode=inband
qualify=1000
context=test

EXTENSION.CONF

[test]
exten => 123,1,Dial(SIP/prabhu)
exten => 123,2,Hangup()
exten => 12144322621,1,Dial(SIP/account)
exten => 124,1,Dial(SIP/prabha)

Do you have port 8060 routed to port 5060 internally? In your post of the config, you have: register => 8278298238:3112@sip.net2phone.com:8060

Is this how it is supposed to be?

It can also be your firewall/NAT. Make sure you have good NAT.

you must port forward thru NAT ports 5060 and the RTP range (defined in rtp.conf). You don’t need 10k ports, 10000-10100 will do fine. (10000-20000 is default).

You also need to configure externip= and localnet= in sip.conf

also for your extensions.conf you might wanna put something like

exten => _1NXXNXXXXXX,1,Dial(SIP/account/${EXTEN}).

${EXTEN} is replaced with the exten being dialed, so if you dialed 1-212-345-6789 it would dial SIP/account/12123456789, which is a correct destination. Dialing just sip/account does not tell your provider what to call, just that there is a call. this is useful for SIP phones, not useful for providers.

thanks guys!!

hi
thanks for a great help
i am still having the problem
i modified sip.conf as u told
externnip=66.33.146.12 ;address of the sip provider
(i am sure what Address that we’re going to put in outbound SIP messages)
localnet=192.168.1.0/255.255.255.0/local ip address of the network

i forwarded all the ports to the asterisk server

register => 8278298238:3112@sip.net2phone.com:8060
is this a correct statement

thanks again in advance
prabhakar

externip= has to be YOUR external IP address.

thank yuou for your reply.
i couldnt able to connect even after trying all the steps
i bought a static ip addres and tried with this configuration
what is the configuration to use while going for static ip address.
i used the below configuration and tried

SIP.CONF configuration file set up
[general]
port = 5060
bindaddr = 0.0.0.0
context = test
register => 8278298238:3112@sip.net2phone.com:8060
useragent=X-Lite release 1103m
[account]
disallow=all
allow=ulaw
allow=alaw
type=friend
username=8278298238
secret=3112
host=sip.net2phone.com
dtmfmode=inband
qualify=1000
context=default

i am getting this message

Aug 28 10:29:49 NOTICE[2445]: chan_sip.c:5372 sip_reg_timeout: – Registration for '8278298238@sip.net2phone.com’ timed out, trying again (Attempt #1)

Asterisk*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
account/8278298238 66.33.146.12 5060 UNREACHABLE
1 sip peers [0 online , 1 offline]

I dunno what to do :frowning:
Thanks in advance

I was having similar problem with xlite and when I changed to snom’s softphone, it connected perfect and also sends the dtmf signals correctly (which is still not possible with xlite). Just my trial and error guess, I am not an expert.

hi guys

my account is registered now but only problem is i cant able to make calls

this is my error

Executing Dial(“SIP/prabhakar-baf6”, “SIP/account/”) in new stack
– Called account/
Sep 6 14:10:30 NOTICE[3020]: chan_sip.c:9685 handle_response_invite: Failed to authenticate on INVITE to '“prabhakar” sip:prabhakar@125.22.242.107;tag=as080d9531’
Sep 6 14:10:30 NOTICE[3020]: chan_sip.c:9685 handle_response_invite: Failed to authenticate on INVITE to ‘“prabhakar” sip:prabhakar@125.22.242.107;tag=as080d9531’

my extension file is

exten => _XXXXXXXXXXXX,1,Dial(SIP/account/${EXTEN})
exten => _XXXXXXNXXXXX,2,Hangup()

my sip.conf is

[general]
port = 5060
bindaddr = 0.0.0.0
register => 51007:xxxxxx@xxxxxxx.xxx
context = default

[account]
disallow=all
allow=ulaw
allow=alaw
type=friend
username=51007
secret=xxxxx
host=xxxxxxx.xxx
dtmfmode=inband
qualify=1000

it will helpful if you let me know

cheers
prabhakar

seems like the problem is with the user/pass of your sip account…

try changing [account] to [51007] or whatever your acct number is. That or maybe add user=51007 i think might work… then dial(SIP/51007/${EXTEN})…