Asterisk to asterisk server problem

hi to all
I am trying to communicate between two asterisk servers.
my configurations are

AT SERVER1

sip.conf
[general]
bindport=5060
bindaddr=0.0.0.0
allow=all
allow=ulaw
allow=ilbc
context=ECP
localnet=192.168.0.1
localmask=255.255.255.0

[949] ;phone1
type=friend
username=949
secret=ashok
host=192.168.0.56
callerid=abhijeet<949>

[950] ;phone2
type=friend
username=950
secret=ashok
host=192.168.0.221
callerid=nikhila<950>

iax.conf

[general]
port=5036
bindaddr=0.0.0.0
disallow=all
allow=ilbc
allow=ulaw
allow=alaw
iaxcompat=yes
bandwidth=low
register => asterisk1:ashok@192.168.0.11:5036
tos=lowdelay

[asterisk2]
type=friend
auth=md5
secret=ashok
host=dynamic
context=local
defaultip=192.168.0.11
qualify=yes

extensions.conf
[ECP]

exten=>949,1,dial(SIP/949,20)
exten=>949,2,voicemail,u949
exten=>950,1,dial(SIP/950,20)
exten=>950,2,voicemail,u950

exten => _XXX,1,dial(IAX2/asterisk1:ashok@192.168.0.11/${EXTEN}@local,20)

AT SERVER 2

sip.conf
[general]
bindport=5060
bindaddr=0.0.0.0
allow=all
allow=ulaw
allow-ilbc
context=ECP
localnet=192.168.0.1
localmask=255.255.255.0

[449]
type=friend
username=449
secret=ashok
host=192.168.0.53
callerid=ashok<449>

[450]
type=friend
username=450
secret=ashok
host=192.168.0.22
callerid=pramod<450>

iax.conf

[general]
port=5036
bindaddr=0.0.0.0
disallow=all
allow=ilbc
allow=ulaw
allow=alaw

iaxcompat=yes
bandwidth=low

register =>asterisk2:ashok@192.168.0.54:5036
tos=lowdelay

[asterisk1]
type=friend
auth=md5
secret=ashok
host=dynamic
context=local
defaultip=192.168.0.54
qualify=yes

extensions.conf
[ECP]
exten =>449,1,MP3Player(/etc/asterisk/01.mp3)
exten=>449,2,dial(SIP/449,20)
exten=>449,3,voicemail,u449
exten=>450,1,dial(SIP/450,20)
exten=>450,2,voicemail,u450

exten => _XXX,1,dial(IAX2/asterisk2:ashok@192.168.0.54/${EXTEN}@local,20)

server1 sip clients are 449, 450
server2 sip clients are 949, 950

now the problem is when i try to call 450 (which is client for server1) from 449(which is also client for server1) no call is connecting and displaying message like

Jul 14 11:16:57 NOTICE[3290]: chan_sip.c:10469 handle_request_invite: Failed toauthenticate user "unknown"sip:192.168.0.53;tag=18044740591300383641

when i dial 450(client for server1) from 949 (client for server2) its diallling…working

and same problem with the server2 clients …

please help me

thanks in advance

What version of * are you running?
I will say in sip.conf under general remove the localnet and localmask settings you have and add the following:

externip=XXX.XXX.XXX [size=75]<–(your external/WAN/Public IP address)[/size]
localnet=192.168.0.1/255.255.255.0

…then use the following for your extension authentication config

[449]
type=friend
username=449
secret=ashok
host=dynamic
defaultip=192.168.0.53
context=ECP
callerid=ashok<449>

[450]
type=friend
username=450
secret=ashok
host=dynamic
defaultip=192.168.0.22
context=ECP
callerid=pramod<450>

…then in extensions.conf adjust the [ECP] context to the one below:
The format used below is dynamic such that it dials any 3-digit entered eliminating the need to enter a line for each 3-digit, if unanswered, it then goes to that number’s voicemail under the assigned voicemail context indicated after the @ sign.

extensions.conf

[ECP]
exten=>_XXX,1,dial(SIP/${EXTEN},20)
exten=>_XXX,2,voicemail,u${EXTEN}@default [size=75]<–replace ‘default’ with name of your voicemail context in voicemail.conf[/size]

exten => _XXX,1,dial(IAX2/asterisk1:ashok@192.168.0.11/${EXTEN}@local,20)

This should work.