ERROR: netsock2.c:263 ast_sockaddr_resolve: getaddrin

Here’s my setup:

TELES.MGC (203.208.XXX.XXX) ----> Asterisk 1.8.5.0 (120.50.XXX.XXX)

Any calls from the teles to my asterisk box shows forbidden due to the ff. error:

<— SIP read from UDP:203.208.XXX.XXX:5060 —>
INVITE sip:63908589XXXX@120.50.XXX.XXX:5060 SIP/2.0
Via: SIP/2.0/UDP 203.208.XXX.XXX:5060 ;branch=z9hG4bK00151747E28819B33E289DF4D894
From: “6565132897” sip:6565132897@203.208.XXX.XXX;tag=2RUVP51EWV30000E1D01051u0002TAZ16ZKKPA
To: sip:63908589XXXX@120.50.XXX.XXX
Call-ID: 88471500e217-517f9b79-479cb2ec-ee85478-6f641a4@127.0.0.1
CSeq: 37501 INVITE
Contact: sip:6565132897@203.208.XXX.XXX:5060
Allow-Events: refer
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, INFO, REFER, NOTIFY, SUBSCRIBE, UPDATE
Content-Type: application/sdp
Max-Forwards: 70
Supported: timer, replaces
User-Agent: TELES.MGC
Content-Length: 303

v=0
o=- 1627418002075370497 1 IN IP4 203.208.XXX.XXX
s=-
c=IN IP4 203.208.204.107
t=0 0
m=audio 38746 RTP/AVP 18 4 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=yes;bitrate=6.3
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=silenceSupp:off - - - -
<------------->
— (14 headers 13 lines) —

voipsw01*CLI>
[color=#FF0000][2013-04-30 18:22:48] ERROR[2797]: netsock2.c:263 ast_sockaddr_resolve: getaddrinfo(“203.208.XXX.XXX”, "5060 ", …): Servname not supported for ai_socktype[/color]

voipsw01*CLI>
Sending to 203.208.XXX.XXX:5060 (NAT)
Using INVITE request as basis request - 88471500e217-517f9b79-479cb2ec-ee85478-6f641a4@127.0.0.1
Found peer ‘6565132897’ for ‘6565132897’ from 203.208.XXX.XXX:5060

<— Reliably Transmitting (NAT) to 203.208.XXX.XXX:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 203.208.XXX.XXX:5060 ;branch=z9hG4bK00151747E28819B33E289DF4D894;received=203.208.XXX.XXX;rport=5060
From: “6565132897” sip:6565132897@203.208.XXX.XXX;tag=2RUVP51EWV30000E1D01051u0002TAZ16ZKKPA
T
voipsw01*CLI>
o: sip:63908589XXXX@120.50.XXX.XXX;tag=as57e38a6a
Call-ID: 88471500e217-517f9b79-479cb2ec-ee85478-6f641a4@127.0.0.1
CSeq: 37501 INVITE
Server: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="38abd4b2"
Content-Length: 0

This error seems new to me. Is there something to do on Teles end or mine, please help

Thanks in Advance

This post could help you. viewtopic.php?f=1&t=85652

hmmm… is say’s something to fix on the the source or origin of the call, thanks anyway, appreciate it.

Any second thoughts?

There is a bogus space in the port number. This appears to be the result of a space, before the “;” , in the Via header. I haven’t checked the official SIP syntax to see whether this is allowed.

Hi David,

Are you suggesting too that this something needs to be fixed on call origination?

Thanks

It is either an error with the call origination or a bug in Asterisk, which will require source code changes. Which one depends on whether the SIP RFC allows a space in that place. Putting a space there is an odd thing to do, so the originator really ought to remove it, even if it is technically legal.

Thanks david, is there some version of asterisk that can defeat this kind of issue? I can afford a roll-back or upgrade since the origin already advise that they are sending same call to multiple provider without any issues since they quote that their system is following the RFC 3261.

Can you suggest as your personal opinion the toughest version of asterisk.

Thanks

Hi

The problem I had when I had this error message, was that I was trying to connect a phone to my voip network from outside the network (i.e. over the internet). I had to enable the NAT settings in the extension in AsteriskNOW, i,e, NAT = Yes

Also in the phone config files,

Nat=1 needs to be used along with the external ip address of the remote location.

This worked for me…

Thanks
Andrew