404 Not Found [RESOLVED]

Hi.
I’m running Asterisk SVN-branch-1.8-r331578M. I’m getting not found error mostly i sending calls to asterisk. my configration is as below

extenstion.usr

[code]context NIC-NIKE-505-01 {
_50X. => {
Dial(SIP/${EXTEN:2}@192.168.0.13:5060,120);
Hangup();
}
_51X. => {
Dial(SIP/${EXTEN:2}@192.168.0.16:5060,120);
Hangup();
}
}

[/code]

extensions.ael

[code]context 198276790 {
_50X. => {
Dial(IAX2/NIC-NIKE-505-01/${EXTEN},60);
Congestion();
}

_51X.	=> {
	Dial(IAX2/NIC-NIKE-505-01/${EXTEN},60);
	Congestion();
}

}[/code]

sip.conf

[code][198.27.67.90]
type=friend
host=198.27.67.90
context=198276790
call-limit=90

[/code]

SIP DEBUG

[code]<— SIP read from UDP:198.27.67.90:5061 —>
INVITE sip:5050582266270@188.166.42.31;user=phone SIP/2.0
Via: SIP/2.0/UDP 198.27.67.90:5061;rport;branch=z9hG4bK-1452200248-3843144968-1416655780-3635550674
From: sip:5@198.27.67.90:5061;user=phone;tag=4234858808-3843144968-1416655780-3635550674
To: sip:5050582266270@188.166.42.31;user=phone
Call-ID: 38d16b2408bd11e5a4737054d219b2d8@198.27.67.90
CSeq: 1 INVITE
Contact: sip:5@198.27.67.90:5061;user=phone
Content-Type: application/sdp
Allow: ACK, BYE, CANCEL, INFO, INVITE, OPTIONS, REFER, REGISTER, UPDATE
Max-Forwards: 70
User-Agent: MERA MVTS3G v.4.3.0-34
Cisco-Guid: 3949742632-146674149-2956292180-3532626974
Content-Length: 196

v=0
o=- 1433204449 1433204449 IN IP4 198.27.67.90
s=-
c=IN IP4 198.27.67.90
t=0 0
m=audio 57730 RTP/AVP 18
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=sendrecv
a=silenceSupp:off - - - -
<------------->
— (13 headers 10 lines) —
Sending to 198.27.67.90:5061 (no NAT)
Using INVITE request as basis request - 38d16b2408bd11e5a4737054d219b2d8@198.27.67.90
No matching peer for ‘5’ from ‘198.27.67.90:5061’
== Using SIP RTP CoS mark 5
Found RTP audio format 18
Found audio description format G729 for ID 18
Capabilities: us - 0x101 (g723|g729), peer - audio=0x100 (g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x100 (g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 198.27.67.90:57730
Looking for 5050582266270 in default (domain 188.166.42.31)

<— Reliably Transmitting (no NAT) to 198.27.67.90:5061 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 198.27.67.90:5061;branch=z9hG4bK-1452200248-3843144968-1416655780-3635550674;received=198.27.67.90;rport=5061
From: sip:5@198.27.67.90:5061;user=phone;tag=4234858808-3843144968-1416655780-3635550674
To: sip:5050582266270@188.166.42.31;user=phone;tag=as328acc1d
Call-ID: 38d16b2408bd11e5a4737054d219b2d8@198.27.67.90
CSeq: 1 INVITE
Server: MS Thin Technologies Termination Solution
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘38d16b2408bd11e5a4737054d219b2d8@198.27.67.90’ in 32000 ms (Method: INVITE)

<— SIP read from UDP:198.27.67.90:5061 —>
ACK sip:5050582266270@188.166.42.31;user=phone SIP/2.0
Via: SIP/2.0/UDP 198.27.67.90:5061;rport;branch=z9hG4bK-1452200248-3843144968-1416655780-3635550674
From: sip:5@198.27.67.90:5061;user=phone;tag=4234858808-3843144968-1416655780-3635550674
To: sip:5050582266270@188.166.42.31;user=phone;tag=as328acc1d
Call-ID: 38d16b2408bd11e5a4737054d219b2d8@198.27.67.90
CSeq: 1 ACK
Max-Forwards: 70
User-Agent: MERA MVTS3G v.4.3.0-34
Content-Length: 0
[/code]

Do sip show peers and confirm that the device is actually defined.

Although the use of friend here is not the problem, with any supported version of asterisk, with the value of user it is trying to match, it is never going to behave differently from peer, and there are few cases where peer is not the better choice.

There were changes in the detailed operation of friend in obsolete versions of Asterisk, and your user agent has been overridden, so I can’t work out which version your are using. I’m not sure if they would cause it not to operate in peer mode for incoming calls, though.

Hi,

in Peers the NIC-NIKE-505-01 is online.

Name Transport Host Status Direction Will expire NIC-NIKE-505-01 TCP X.X.X.X (IP REMOVED) Registered Outgoing 147

Name/username              Host                                    Dyn Forcerport ACL Port     Status
198.27.67.90               198.27.67.90                                        5060     Unmonitored

Asterisk receives the call even with PEER type & friend as well just tried both.

It is actually using the non-standard port 5061, which won’t match your 5060.

If it is using different in and out addresses, you will need tow peers. If it is consistently using 5061, you need to specify that. If it is using variable port numbers, you may need to consider using insecure=port.

Hi,
Thank you for your reply. Tried using insecure=port but it didn’t worked as well.

updated the sip.conf


[general]
context=default
allowoverlap=no
bindport=5060
insecure=port
bindaddr=0.0.0.0
disallow=all
allow=g723
allow=g729
srvlookup=no
allowguest=no
alwaysauthreject=yes

[198.27.67.90]
type=friend
insecure=port
host=198.27.67.90
context=198276790
call-limit=16


[176.9.37.251]
type=friend
insecure=port
host=176.9.60.231
context=198276790
call-limit=16


Tried using different SIP Soft Switch & error has changed to 488

<--- SIP read from UDP:176.9.37.251:5060 --->
INVITE sip:5050585455047@188.166.42.31 SIP/2.0
Via: SIP/2.0/UDP 176.9.37.251:5060;branch=z9hG4bK3e98e0895cf59a87
From: "50075758475" <sip:50075758475@176.9.37.251>;tag=25bb93fc2f98968e
To: <sip:5050585455047@188.166.42.31>
Contact: <sip:50075758475@176.9.37.251:5060>
Call-ID: 3d7e3ebb3446a0921f2aa6bc00019a1f@176.9.37.251
CSeq: 1 INVITE
Max-Forwards: 70
User-Agent: VOS2009 V2.1.1.5
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, UPDATE
Content-Length: 234
ontent-Type: application/sdp

v=0
o=- 0 0 IN IP4 176.9.37.251
s=VOS2009
c=IN IP4 176.9.37.251
t=0 0
m=audio 32478 RTP/AVP 98 3 101
a=rtpmap:98 iLBC/8000
a=fmtp:98 mode=20
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
<------------->
--- (12 headers 12 lines) ---
Sending to 176.9.37.251:5060 (no NAT)
Using INVITE request as basis request - 3d7e3ebb3446a0921f2aa6bc00019a1f@176.9.37.251
Found peer '176.9.37.251' for '50075758475' from 176.9.37.251:5060
  == Using SIP RTP CoS mark 5
Found RTP audio format 98
Found RTP audio format 3
Found RTP audio format 101
Found audio description format iLBC for ID 98
Found audio description format GSM for ID 3
Found audio description format telephone-event for ID 101
Capabilities: us - 0x101 (g723|g729), peer - audio=0x402 (gsm|ilbc)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x0 (nothing)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)

<--- Reliably Transmitting (no NAT) to 176.9.37.251:5060 --->
SIP/2.0 488 Not acceptable here
Via: SIP/2.0/UDP 176.9.37.251:5060;branch=z9hG4bK3e98e0895cf59a87;received=176.9.37.251
From: "50075758475" <sip:50075758475@176.9.37.251>;tag=25bb93fc2f98968e
To: <sip:5050585455047@188.166.42.31>;tag=as3788601b
Call-ID: 3d7e3ebb3446a0921f2aa6bc00019a1f@176.9.37.251
CSeq: 1 INVITE
Server: MS Thin Technologies Termination Solution
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '3d7e3ebb3446a0921f2aa6bc00019a1f@176.9.37.251' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:176.9.37.251:5060 --->
ACK sip:5050585455047@188.166.42.31 SIP/2.0
Via: SIP/2.0/UDP 176.9.37.251:5060;branch=z9hG4bK3e98e0895cf59a87
From: "50075758475" <sip:50075758475@176.9.37.251>;tag=25bb93fc2f98968e
To: <sip:5050585455047@188.166.42.31>;tag=as3788601b
User-Agent: VOS2009 V2.1.1.5
CSeq: 1 ACK
Call-ID: 3d7e3ebb3446a0921f2aa6bc00019a1f@176.9.37.251
Contact: <sip:50075758475@176.9.37.251:5060>
Max-Forwards: 70
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
eally destroying SIP dialog '3d7e3ebb3446a0921f2aa6bc00019a1f@176.9.37.251' Method: ACK

<--- SIP read from UDP:176.9.37.251:5060 --->
INVITE sip:5050585455047@188.166.42.31 SIP/2.0
Via: SIP/2.0/UDP 176.9.37.251:5060;branch=z9hG4bK5aa02bf51e69f429
From: "50075758475" <sip:50075758475@176.9.37.251>;tag=7f43509528402194
To: <sip:5050585455047@188.166.42.31>
Contact: <sip:50075758475@176.9.37.251:5060>
Call-ID: 4c833d753950d0961f2aa6bc00019a20@176.9.37.251
CSeq: 1 INVITE
Max-Forwards: 70
User-Agent: VOS2009 V2.1.1.5
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, INFO, UPDATE
Content-Length: 234
ontent-Type: application/sdp

v=0
o=- 0 0 IN IP4 176.9.37.251
s=VOS2009
c=IN IP4 176.9.37.251
t=0 0
m=audio 32486 RTP/AVP 98 3 101
a=rtpmap:98 iLBC/8000
a=fmtp:98 mode=20
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
<------------->
--- (12 headers 12 lines) ---
Sending to 176.9.37.251:5060 (no NAT)
Using INVITE request as basis request - 4c833d753950d0961f2aa6bc00019a20@176.9.37.251
Found peer '176.9.37.251' for '50075758475' from 176.9.37.251:5060
  == Using SIP RTP CoS mark 5
Found RTP audio format 98
Found RTP audio format 3
Found RTP audio format 101
Found audio description format iLBC for ID 98
Found audio description format GSM for ID 3
Found audio description format telephone-event for ID 101
Capabilities: us - 0x101 (g723|g729), peer - audio=0x402 (gsm|ilbc)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x0 (nothing)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)

<--- Reliably Transmitting (no NAT) to 176.9.37.251:5060 --->
SIP/2.0 488 Not acceptable here
Via: SIP/2.0/UDP 176.9.37.251:5060;branch=z9hG4bK5aa02bf51e69f429;received=176.9.37.251
From: "50075758475" <sip:50075758475@176.9.37.251>;tag=7f43509528402194
To: <sip:5050585455047@188.166.42.31>;tag=as17cb1123
Call-ID: 4c833d753950d0961f2aa6bc00019a20@176.9.37.251
CSeq: 1 INVITE
Server: MS Thin Technologies Termination Solution
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '4c833d753950d0961f2aa6bc00019a20@176.9.37.251' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:176.9.37.251:5060 --->
ACK sip:5050585455047@188.166.42.31 SIP/2.0
Via: SIP/2.0/UDP 176.9.37.251:5060;branch=z9hG4bK5aa02bf51e69f429
From: "50075758475" <sip:50075758475@176.9.37.251>;tag=7f43509528402194
To: <sip:5050585455047@188.166.42.31>;tag=as17cb1123
User-Agent: VOS2009 V2.1.1.5
CSeq: 1 ACK
Call-ID: 4c833d753950d0961f2aa6bc00019a20@176.9.37.251
Contact: <sip:50075758475@176.9.37.251:5060>
Max-Forwards: 70
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
Really destroying SIP dialog '4c833d753950d0961f2aa6bc00019a20@176.9.37.251' Method: ACK

You have no codecs in common.

Hi,
Thank you i didn’t see that part. with remote SIP port 5060 it works good but with non standard port it give 404 error tried insecure=port as well but didn’t worked any suggestions ?

Specify the port number in sip.conf.

Hi,
Tried

calls does not pass when rport=5061 or anything else it only passes to 5060. Any suggestions ?

The first one is invalid. How is Asterisk to know which of the two ports to send to?

The second one works when we use it. Use the command already given to find out if it is being honoured, and if not list it in context, so we can see if it is in the right place.