Asterisk replies"404 Not Found" incoming calls?

if i call from sip user agent A(506) to sip user agent B(502) so it says “404 Not Found”. But when i call from sip user agent B to sip user agent A there is not any problem. What can be reason?
Opensips, opensipsctl ul show output:
AOR:: 506
Contact:: sip:506@10.0.0.102:5094 Q=
Expires:: 290
Callid:: 102bcb68-0-13e6-4f005900-f3da856-4f005900
Cseq:: 832
User-agent:: ES310 DS312 V2.2.7.6 3283
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Socket:: udp:10.0.0.25:5060
Methods:: 5695

AOR:: 502
Contact:: sip:502@10.0.0.25:5061 Q=
Expires:: 69
Callid:: 4f2aa85f0c4c6359424e9be030c6e70d@127.0.1.1
Cseq:: 155
User-agent:: FPBX-13.0.99(13.8.0)
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Socket:: udp:10.0.0.25:5060
Methods:: 4294967295

Asterisk, general settings of sip_conf file output:

vmexten=*97
context=from-sip-external
callerid=Unknown
disallow=all
allow=alaw
allow=ulaw
rtpend=20000
callevents=yes
rtpstart=10000
bindport=5061
bindaddr=0.0.0.0
jbenable=no
rtpholdtimeout=300
notifyhold=yes
notifyringing=yes
registerattempts=0
registertimeout=20
srvlookup=no
rtptimeout=30
rtpkeepalive=0
videosupport=no
minexpiry=60
maxexpiry=3600
maxcallbitrate=384
allowguest=yes
g726nonstandard=no
canreinvite=no
checkmwi=10
defaultexpiry=120
nat=force_rport,comedia
externip=PUBLIC_IP
ALLOW_SIP_ANON=no
localnet=10.0.0.0/255.255.255.0

If i run asterisk 192.168.150.0 network so there is not any problem. Soon before i have added another router under 10.0.0.9 (i added 192.168.150.0 network under 10.0.0.0 network)so i have changed asterisk host ip from 10.0.0.25 to 192.168.150.90, sip client B ip changed to 192.168.150.101, sip client A ip changed to 192.168.150.102 so everything worked fine.

Asterisk has problem with 10.0.0.0 network? Or asterisk has a bug about trunk configuration?

Anyone can not answer my question?

If you post the console output someone may be able to help, but as it is only a short period of time has passed since your original post.

Console debug informations. I entered these commands.
CLI>sip debug peer 502
CLI>sip debug peer Trunk502

Console output:
Really destroying SIP dialog ‘1191766996@10.0.0.101’ Method: OPTIONS

<— SIP read from UDP:10.0.0.101:5098 —>
OPTIONS sip:10.0.0.25:5061 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.101:5098;branch=z9hG4bK291891526
From: “502” sip:502@10.0.0.25:5061;tag=680593452
To: sip:10.0.0.25:5061
Call-ID: 886459809@10.0.0.101
CSeq: 1 OPTIONS
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Accept: application/sdp
Max-Forwards: 70
User-Agent: Yealink SIP-T28P 2.70.23.2 00:15:65:13:76:a7
Expires: 120
Content-Length: 0

<------------->
— (12 headers 0 lines) —
Sending to 10.0.0.101:5098 (NAT)
Looking for s in from-sip-external (domain 10.0.0.25)

<— Transmitting (NAT) to 10.0.0.101:5098 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.0.101:5098;branch=z9hG4bK291891526;received=10.0.0.101;rport=5098
From: “502” sip:502@10.0.0.25:5061;tag=680593452
To: sip:10.0.0.25:5061;tag=as4f674f8a
Call-ID: 886459809@10.0.0.101
CSeq: 1 OPTIONS
Server: FPBX-13.0.156(13.8.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:10.0.0.25:5061
Accept: application/sdp
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘886459809@10.0.0.101’ in 32000 ms (Method: OPTIONS)

<— SIP read from UDP:10.0.0.101:5098 —>
OPTIONS sip:10.0.0.25:5061 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.101:5098;branch=z9hG4bK622622239
From: “502” sip:502@10.0.0.25:5061;tag=1939074788
To: sip:10.0.0.25:5061
Call-ID: 1603496449@10.0.0.101
CSeq: 1 OPTIONS
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
Accept: application/sdp
Max-Forwards: 70
User-Agent: Yealink SIP-T28P 2.70.23.2 00:15:65:13:76:a7
Expires: 120
Content-Length: 0

<------------->
— (12 headers 0 lines) —
Sending to 10.0.0.101:5098 (NAT)
Looking for s in from-sip-external (domain 10.0.0.25)

<— Transmitting (NAT) to 10.0.0.101:5098 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.0.101:5098;branch=z9hG4bK622622239;received=10.0.0.101;rport=5098
From: “502” sip:502@10.0.0.25:5061;tag=1939074788
To: sip:10.0.0.25:5061;tag=as7ce045a3
Call-ID: 1603496449@10.0.0.101
CSeq: 1 OPTIONS
Server: FPBX-13.0.156(13.8.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: sip:10.0.0.25:5061
Accept: application/sdp
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog ‘1603496449@10.0.0.101’ in 32000 ms (Method: OPTIONS)
Really destroying SIP dialog ‘840474079@10.0.0.101’ Method: OPTIONS
Reliably Transmitting (no NAT) to 10.0.0.101:5098:
OPTIONS sip:502@10.0.0.101:5098 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.25:5061;branch=z9hG4bK27272db2
Max-Forwards: 70
From: “Unknown” sip:Unknown@10.0.0.25:5061;tag=as1c0e06c2
To: sip:502@10.0.0.101:5098
Contact: sip:Unknown@10.0.0.25:5061
Call-ID: 606a11642ac24c1a3717b0605a7bb17d@10.0.0.25:5061
CSeq: 102 OPTIONS
User-Agent: FPBX-13.0.156(13.8.0)
Date: Wed, 13 Jul 2016 14:03:45 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<— SIP read from UDP:10.0.0.101:5098 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.0.25:5061;branch=z9hG4bK27272db2
From: “Unknown” sip:Unknown@10.0.0.25:5061;tag=as1c0e06c2
To: sip:502@10.0.0.101:5098;tag=1451497391
Call-ID: 606a11642ac24c1a3717b0605a7bb17d@10.0.0.25:5061
CSeq: 102 OPTIONS
User-Agent: Yealink SIP-T28P 2.70.23.2 00:15:65:13:76:a7
Content-Length: 0

<------------->
— (8 headers 0 lines) —
Really destroying SIP dialog ‘606a11642ac24c1a3717b0605a7bb17d@10.0.0.25:5061’ Method: OPTIONS

Your console output doesn’t show a call, nor does it show Asterisk responding with a 404 to an INVITE request.

Please post the console output showing the issue you’re trying to get an answer for.

I have posted wireshark log. Wireshark file added to dropbox.

Problem can be in opensips?

Please don’t provide links to pcaps or log files on other sites. Those things tend to disappear, which makes it hard for people who may come across this discussion later to know what was going on.

(Plus, I don’t like downloading and opening other people’s files. No offense @the_passerby, but you’re just passing by and I like to be careful.)

Please get a CLI capture of the issue, including your SIP debug, and paste it formatted as code into a reply here.