Problem with Ivcomming calls

Hello,
I have last version of FreePBX.
The outgoing calls is OK, but I have a trouble with Incomming.
The asterisk and X-lite soft phone is behind NAT.
IP address of the Asterisk server is 10.0.0.240/255.255.255.0
In my sip_general_custom.conf I add these lines:

externhost = XXX.XXX.XXX.XXX ; My External IP 
externrefresh = 60
bindport = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
localnet = 10.0.0.0/255.255.255.0

Here is a snapshot of the Trunk and Inbounde Route:
http://www.picvalley.net/v.php?p=u/1655/6878103755399137821243854106wkDmL12vAOB5c4UnNVkm.JPG

http://www.picvalley.net/v.php?p=u/2646/10534044203904095831243854109s4vDwgugxBQ5HgcNdbT1.JPG

When I try to make a call from outside telephone, in my Asterisk*CLI nothing is comming.An other side is busy tone.
Please help.

This looks as NAT issue.
Try to set qualify=yes in your peer details and check if the incoming INVITE reaches your server.

I try to add “qualify=yes” in Peers Details in Trunks, also in the User Details in Incomming Settings , but not is happend.
In my Router I forward UDP-5060 to 5061 to my Asterisk internal IP(10.0.0.240)
The CLI is stay empty.

Can you check with your provider how they see your SIP registration? We need to see the string like contact@address:port

Make sure you have sip debug enabled for that peer.

My mistake, I forgot to set debug for this peer.After that:

<--- SIP read from 212.116.145.19:5060 --->
INVITE sip:[email protected] SIP/2.0
Record-Route: <sip:212.116.145.19;lr=on;ftag=5B282A04-3E0;nat=yes>
Via: SIP/2.0/UDP 212.116.145.19;branch=z9hG4bKedf6.0c327f7.0
Via: SIP/2.0/UDP 212.116.145.6:5060;rport=52681;branch=z9hG4bKBDD881534
Remote-Party-ID: "35932XXXXXX " <sip:35932XXXXXX@ITDNET>;party=calling;screen=no;privacy=off
From: "359XXXXXXX " <sip:35932XXXXX@ITDNET>;tag=5B282A04-3E0
To: <sip:[email protected]>
Date: Mon, 01 Jun 2009 13:27:30 GMT
Call-ID: CAB30EFA-4DE611DE-B486EB50-9800209F@ITDNET
Supported: 100rel,timer,resource-priority,replaces
Min-SE:  1800
Cisco-Guid: 3400172442-1306923486-3028413264-2550145183
User-Agent: Cisco-SIPGateway/IOS-12.x
Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER
CSeq: 101 INVITE
Timestamp: 1243862850
Contact: <sip:[email protected]:5060>
Expires: 180
Allow-Events: telephone-event
Max-Forwards: 67
Content-Type: application/sdp
Content-Disposition: session;handling=required
Content-Length: 330

v=0
o=CiscoSystemsSIP-GW-UserAgent 7744 2716 IN IP4 212.116.145.6
s=SIP Call
c=IN IP4 212.116.145.6
t=0 0
m=audio 18316 RTP/AVP 8 0 18 101
c=IN IP4 212.116.145.6
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=direction:passive

<------------->
--- (23 headers 14 lines) ---
Sending to 212.116.145.19 : 5060 (no NAT)
Using INVITE request as basis request - CAB30EFA-4DE611DE-B486EB50-9800209F@ITDNET
Found peer 'CoolBox511'
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 18
Found RTP audio format 101
Peer audio RTP is at port 212.116.145.6:18316
Found audio description format PCMA for ID 8
Found audio description format PCMU for ID 0
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - 0xc (ulaw|alaw), peer - audio=0x10c (ulaw|alaw|g729)/video=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 212.116.145.6:18316
Looking for s in from-CoolBox511 (domain XXX.XXX.XXX.XXX (My IP))

<--- Reliably Transmitting (no NAT) to 212.116.145.19:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 212.116.145.19;branch=z9hG4bKedf6.0c327f7.0;received=212.116.145.19
Via: SIP/2.0/UDP 212.116.145.6:5060;rport=52681;branch=z9hG4bKBDD881534
From: "35932XXXXXX " <sip:35932XXXXXX@ITDNET>;tag=5B282A04-3E0
To: <sip:[email protected]>;tag=as35ad7e9c
Call-ID: CAB30EFA-4DE611DE-B486EB50-9800209F@ITDNET
CSeq: 101 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog 'CAB30EFA-4DE611DE-B486EB50-9800209F@ITDNET' in 32000 ms (Method: INVITE)
ubuntu*CLI>
<--- SIP read from 212.116.145.19:5060 --->
ACK sip:[email protected] (My IP) SIP/2.0
Via: SIP/2.0/UDP 212.116.145.19;branch=z9hG4bKedf6.0c327f7.0
From: "35932XXXXXX " <sip:35932XXXXXX@ITDNET>;tag=5B282A04-3E0
Call-ID: CAB30EFA-4DE611DE-B486EB50-9800209F@ITDNET
To: <sip:[email protected]>;tag=as35ad7e9c
CSeq: 101 ACK
Max-Forwards: 70
Content-Length: 0


<------------->
--- (8 headers 0 lines) ---
Really destroying SIP dialog 'CAB30EFA-4DE611DE-B486EB50-9800209F@ITDNET' Method: ACK

In my log file :

[Jun  1 16:26:18] NOTICE[5310] chan_sip.c: Call from '35932XXXXXX' to extension 's' rejected because extension not found.

put “context=from-trunk” into your PEER Details

Please look the screenshot:

http://www.picvalley.net/v.php?p=u/2646/10534044203904095831243854109s4vDwgugxBQ5HgcNdbT1.JPG

In User Details, I have: context=from-trunk.

Please look into my answer. I’m not talking about “User Details”.

OK, I understand.Tomorow mornig I try to change in peer details: context=from-CoolBoxx511 to context=from-internal.But from my memorys, in this case I don’t make a Outgoing calls.After this attempt, I post the results.Thank You very much in advance for Your help.

After I cahnge the context=from-trunk everythig is OK.
Thank You very much for Your help.