Problem incoming calls

hi,
i have a problem on incoming calls , i’ll explain :
I have to configure authentication on a trunk with ip for a GNR , my Asterisk PBX is on the local network ( 10.0.70.0/24 ) upstream I have a firewall with a public IP ( 151.XXX.XXX.XXX ), configured the trunk on asterisk :

version:
Asterisk 1.8.25.0
PBX Firmware:4.211.64-7
PBX Service Pack:1.0.0.0

the trunk is configured so:

type=peer
qualify=yes
nat=yes
insecure=very
host=77.XXX.XXX.XXX (PROVIDER VOIP)
disallow=all
allow=alaw&ulaw
externip=151.XXX.XXX.XXX (MY EXTERNAL)
localnet=10.0.70.0/255.255.255.0

when I insert the context “context = default”, the call will not receive.

inbound route to an extension ( 7098 )

and made ​​the rule that opens the firewall that is all pacchietti from IP ( 77.XXX.XXX.XXX ) will be accepted on my public ( 151.XXX.XXX.XXX ) with nat on IP asteroid that is local (10.0.70.234 ), obviously the PBX to any.

outgoing calls work correctly, but the problem is on incoming calls , answer the extension rings but can not hear anything , the voice is not heard it from one part of it on the other. I thought it was a problem of RTP ports but the firewall rule to accept anything from that IP and the wart on the local ip .

I have analyzed the logs of the firewall, but I do not understand anything about me an error :

------------------LOG------------------
Connected to Asterisk 1.8.25.0 currently running on localhost (pid = 31844)
Verbosity is at least 3
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [0984XXXXXX@from-trunk-sip-gnr_in:1] Set(“SIP/gnr_in-0000019f”, “GROUP()=OUT_6”) in new stack
– Executing [0984XXXXXX@from-trunk-sip-gnr_in:2] Goto(“SIP/gnr_in-0000019f”, “from-trunk,0984XXXXXX,1”) in new stack
– Goto (from-trunk,0984XXXXXX,1)
– Executing [0984XXXXXX@from-trunk:1] Set(“SIP/gnr_in-0000019f”, “__FROM_DID=0984XXXXXX”) in new stack
– Executing [0984XXXXXX@from-trunk:2] Gosub(“SIP/gnr_in-0000019f”, “app-blacklist-check,s,1()”) in new stack
– Executing [s@app-blacklist-check:1] GotoIf(“SIP/gnr_in-0000019f”, “0?blacklisted”) in new stack
– Executing [s@app-blacklist-check:2] Set(“SIP/gnr_in-0000019f”, “CALLED_BLACKLIST=1”) in new stack
– Executing [s@app-blacklist-check:3] Return(“SIP/gnr_in-0000019f”, “”) in new stack
– Executing [0984XXXXXX@from-trunk:3] Gosub(“SIP/gnr_in-0000019f”, “sub-record-cancel,s,1()”) in new stack
– Executing [s@sub-record-cancel:1] Set(“SIP/gnr_in-0000019f”, “__REC_POLICY_MODE=”) in new stack
– Executing [s@sub-record-cancel:2] ExecIf(“SIP/gnr_in-0000019f”, “1?Return()”) in new stack
– Executing [0984XXXXXX@from-trunk:4] Set(“SIP/gnr_in-0000019f”, “__REC_POLICY_MODE=never”) in new stack
– Executing [0984XXXXXX@from-trunk:5] Set(“SIP/gnr_in-0000019f”, “CDR(did)=0984XXXXXX”) in new stack
– Executing [0984XXXXXX@from-trunk:6] ExecIf(“SIP/gnr_in-0000019f”, “1 ?Set(CALLERID(name)=393XXXXXXXXX)”) in new stack
– Executing [0984XXXXXX@from-trunk:7] Set(“SIP/gnr_in-0000019f”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
– Executing [0984XXXXXX@from-trunk:8] Set(“SIP/gnr_in-0000019f”, “CALLERPRES()=allowed_not_screened”) in new stack
– Executing [0984XXXXXX@from-trunk:9] Goto(“SIP/gnr_in-0000019f”, “from-did-direct,7098,1”) in new stack
– Goto (from-did-direct,7098,1)
– Executing [7098@from-did-direct:1] Set(“SIP/gnr_in-0000019f”, “__RINGTIMER=15”) in new stack
– Executing [7098@from-did-direct:2] Macro(“SIP/gnr_in-0000019f”, “exten-vm,novm,7098,0,0,0”) in new stack
– Executing [s@macro-exten-vm:1] Macro(“SIP/gnr_in-0000019f”, “user-callerid,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/gnr_in-0000019f”, “TOUCH_MONITOR=1393408316.415”) in new stack
– Executing [s@macro-user-callerid:2] Set(“SIP/gnr_in-0000019f”, “AMPUSER=393XXXXXXXXX”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“SIP/gnr_in-0000019f”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“SIP/gnr_in-0000019f”, “1?Set(REALCALLERIDNUM=393XXXXXXXXX)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/gnr_in-0000019f”, “AMPUSER=”) in new stack
– Executing [s@macro-user-callerid:6] Set(“SIP/gnr_in-0000019f”, “AMPUSERCIDNAME=”) in new stack
– Executing [s@macro-user-callerid:7] GotoIf(“SIP/gnr_in-0000019f”, “1?report”) in new stack
– Goto (macro-user-callerid,s,15)
– Executing [s@macro-user-callerid:15] GotoIf(“SIP/gnr_in-0000019f”, “0?continue”) in new stack
– Executing [s@macro-user-callerid:16] Set(“SIP/gnr_in-0000019f”, “__TTL=64”) in new stack
– Executing [s@macro-user-callerid:17] GotoIf(“SIP/gnr_in-0000019f”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,28)
– Executing [s@macro-user-callerid:28] Set(“SIP/gnr_in-0000019f”, “CALLERID(number)=393XXXXXXXXX”) in new stack
– Executing [s@macro-user-callerid:29] Set(“SIP/gnr_in-0000019f”, “CALLERID(name)=393XXXXXXXXX”) in new stack
– Executing [s@macro-user-callerid:30] Set(“SIP/gnr_in-0000019f”, “CDR(cnum)=393XXXXXXXXX”) in new stack
– Executing [s@macro-user-callerid:31] Set(“SIP/gnr_in-0000019f”, “CDR(cnam)=393XXXXXXXXX”) in new stack
– Executing [s@macro-user-callerid:32] Set(“SIP/gnr_in-0000019f”, “CHANNEL(language)=en”) in new stack
– Executing [s@macro-exten-vm:2] Set(“SIP/gnr_in-0000019f”, “RingGroupMethod=none”) in new stack
– Executing [s@macro-exten-vm:3] Set(“SIP/gnr_in-0000019f”, “__EXTTOCALL=7098”) in new stack
– Executing [s@macro-exten-vm:4] Set(“SIP/gnr_in-0000019f”, “__PICKUPMARK=7098”) in new stack
– Executing [s@macro-exten-vm:5] Set(“SIP/gnr_in-0000019f”, “RT=”) in new stack
– Executing [s@macro-exten-vm:6] ExecIf(“SIP/gnr_in-0000019f”, “0?Macro(vm,novm,DIRECTDIAL,)”) in new stack
– Executing [s@macro-exten-vm:7] ExecIf(“SIP/gnr_in-0000019f”, “0?MacroExit()”) in new stack
– Executing [s@macro-exten-vm:8] Gosub(“SIP/gnr_in-0000019f”, “sub-record-check,s,1(exten,7098,)”) in new stack
– Executing [s@sub-record-check:1] Set(“SIP/gnr_in-0000019f”, “REC_POLICY_MODE_SAVE=never”) in new stack
– Executing [s@sub-record-check:2] GotoIf(“SIP/gnr_in-0000019f”, “1?check”) in new stack
– Goto (sub-record-check,s,7)
– Executing [s@sub-record-check:7] Set(“SIP/gnr_in-0000019f”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:8] GotoIf(“SIP/gnr_in-0000019f”, “1?next”) in new stack
– Goto (sub-record-check,s,11)
– Executing [s@sub-record-check:11] ExecIf(“SIP/gnr_in-0000019f”, “0?Return()”) in new stack
– Executing [s@sub-record-check:12] ExecIf(“SIP/gnr_in-0000019f”, “0?Set(__REC_POLICY_MODE=)”) in new stack
– Executing [s@sub-record-check:13] GotoIf(“SIP/gnr_in-0000019f”, “0?exten,1”) in new stack
– Executing [s@sub-record-check:14] Set(“SIP/gnr_in-0000019f”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:15] Set(“SIP/gnr_in-0000019f”, “NOW=1393408316”) in new stack
– Executing [s@sub-record-check:16] Set(“SIP/gnr_in-0000019f”, “__DAY=26”) in new stack
– Executing [s@sub-record-check:17] Set(“SIP/gnr_in-0000019f”, “__MONTH=02”) in new stack
– Executing [s@sub-record-check:18] Set(“SIP/gnr_in-0000019f”, “__YEAR=2014”) in new stack
– Executing [s@sub-record-check:19] Set(“SIP/gnr_in-0000019f”, “__TIMESTR=20140226-105156”) in new stack
– Executing [s@sub-record-check:20] Set(“SIP/gnr_in-0000019f”, “__FROMEXTEN=393XXXXXXXXX”) in new stack
– Executing [s@sub-record-check:21] Set(“SIP/gnr_in-0000019f”, “__CALLFILENAME=exten-7098-393XXXXXXXXX-20140226-105156-1393408316.415”) in new stack
– Executing [s@sub-record-check:22] Goto(“SIP/gnr_in-0000019f”, “exten,1”) in new stack
– Goto (sub-record-check,exten,1)
– Executing [exten@sub-record-check:1] GotoIf(“SIP/gnr_in-0000019f”, “1?callee”) in new stack
– Goto (sub-record-check,exten,8)
– Executing [exten@sub-record-check:8] GosubIf(“SIP/gnr_in-0000019f”, “0?record,1(exten,7098,393XXXXXXXXX)”) in new stack
– Executing [exten@sub-record-check:9] Return(“SIP/gnr_in-0000019f”, “”) in new stack
– Executing [s@macro-exten-vm:9] GotoIf(“SIP/gnr_in-0000019f”, “1?macrodial”) in new stack
– Goto (macro-exten-vm,s,15)
– Executing [s@macro-exten-vm:15] GosubIf(“SIP/gnr_in-0000019f”, “0?clrheader,1()”) in new stack
– Executing [s@macro-exten-vm:16] Macro(“SIP/gnr_in-0000019f”, “dial-one,Ttr,7098”) in new stack
– Executing [s@macro-dial-one:1] Set(“SIP/gnr_in-0000019f”, “DEXTEN=7098”) in new stack
– Executing [s@macro-dial-one:2] Set(“SIP/gnr_in-0000019f”, “DIALSTATUS_CW=”) in new stack
– Executing [s@macro-dial-one:3] GosubIf(“SIP/gnr_in-0000019f”, “0?screen,1()”) in new stack
– Executing [s@macro-dial-one:4] GosubIf(“SIP/gnr_in-0000019f”, “0?cf,1()”) in new stack
– Executing [s@macro-dial-one:5] GotoIf(“SIP/gnr_in-0000019f”, “1?skip1”) in new stack
– Goto (macro-dial-one,s,8)
– Executing [s@macro-dial-one:8] GotoIf(“SIP/gnr_in-0000019f”, “0?nodial”) in new stack
– Executing [s@macro-dial-one:9] GotoIf(“SIP/gnr_in-0000019f”, “0?continue”) in new stack
– Executing [s@macro-dial-one:10] Set(“SIP/gnr_in-0000019f”, “EXTHASCW=ENABLED”) in new stack
– Executing [s@macro-dial-one:11] GotoIf(“SIP/gnr_in-0000019f”, “0?next1:cwinusebusy”) in new stack
– Goto (macro-dial-one,s,23)
– Executing [s@macro-dial-one:23] GotoIf(“SIP/gnr_in-0000019f”, “1?next3:continue”) in new stack
– Goto (macro-dial-one,s,24)
– Executing [s@macro-dial-one:24] ExecIf(“SIP/gnr_in-0000019f”, “0?Set(DIALSTATUS_CW=BUSY)”) in new stack
– Executing [s@macro-dial-one:25] GotoIf(“SIP/gnr_in-0000019f”, “0?nodial”) in new stack
– Executing [s@macro-dial-one:26] GosubIf(“SIP/gnr_in-0000019f”, “1?dstring,1():dlocal,1()”) in new stack
– Executing [dstring@macro-dial-one:1] Set(“SIP/gnr_in-0000019f”, “DSTRING=”) in new stack
– Executing [dstring@macro-dial-one:2] Set(“SIP/gnr_in-0000019f”, “DEVICES=7098”) in new stack
– Executing [dstring@macro-dial-one:3] ExecIf(“SIP/gnr_in-0000019f”, “0?Return()”) in new stack
– Executing [dstring@macro-dial-one:4] ExecIf(“SIP/gnr_in-0000019f”, “0?Set(DEVICES=098)”) in new stack
– Executing [dstring@macro-dial-one:5] Set(“SIP/gnr_in-0000019f”, “LOOPCNT=1”) in new stack
– Executing [dstring@macro-dial-one:6] Set(“SIP/gnr_in-0000019f”, “ITER=1”) in new stack
– Executing [dstring@macro-dial-one:7] Set(“SIP/gnr_in-0000019f”, “THISDIAL=SIP/7098”) in new stack
– Executing [dstring@macro-dial-one:8] GosubIf(“SIP/gnr_in-0000019f”, “1?zap2dahdi,1()”) in new stack
– Executing [zap2dahdi@macro-dial-one:1] ExecIf(“SIP/gnr_in-0000019f”, “0?Return()”) in new stack
– Executing [zap2dahdi@macro-dial-one:2] Set(“SIP/gnr_in-0000019f”, “NEWDIAL=”) in new stack
– Executing [zap2dahdi@macro-dial-one:3] Set(“SIP/gnr_in-0000019f”, “LOOPCNT2=1”) in new stack
– Executing [zap2dahdi@macro-dial-one:4] Set(“SIP/gnr_in-0000019f”, “ITER2=1”) in new stack
– Executing [zap2dahdi@macro-dial-one:5] Set(“SIP/gnr_in-0000019f”, “THISPART2=SIP/7098”) in new stack
– Executing [zap2dahdi@macro-dial-one:6] ExecIf(“SIP/gnr_in-0000019f”, “0?Set(THISPART2=DAHDI/7098)”) in new stack
– Executing [zap2dahdi@macro-dial-one:7] Set(“SIP/gnr_in-0000019f”, “NEWDIAL=SIP/7098&”) in new stack
– Executing [zap2dahdi@macro-dial-one:8] Set(“SIP/gnr_in-0000019f”, “ITER2=2”) in new stack
– Executing [zap2dahdi@macro-dial-one:9] GotoIf(“SIP/gnr_in-0000019f”, “0?begin2”) in new stack
– Executing [zap2dahdi@macro-dial-one:10] Set(“SIP/gnr_in-0000019f”, “THISDIAL=SIP/7098”) in new stack
– Executing [zap2dahdi@macro-dial-one:11] Return(“SIP/gnr_in-0000019f”, “”) in new stack
– Executing [dstring@macro-dial-one:9] Set(“SIP/gnr_in-0000019f”, “DSTRING=SIP/7098&”) in new stack
– Executing [dstring@macro-dial-one:10] Set(“SIP/gnr_in-0000019f”, “ITER=2”) in new stack
– Executing [dstring@macro-dial-one:11] GotoIf(“SIP/gnr_in-0000019f”, “0?begin”) in new stack
– Executing [dstring@macro-dial-one:12] Set(“SIP/gnr_in-0000019f”, “DSTRING=SIP/7098”) in new stack
– Executing [dstring@macro-dial-one:13] Return(“SIP/gnr_in-0000019f”, “”) in new stack
– Executing [s@macro-dial-one:27] GotoIf(“SIP/gnr_in-0000019f”, “0?nodial”) in new stack
– Executing [s@macro-dial-one:28] GotoIf(“SIP/gnr_in-0000019f”, “0?skiptrace”) in new stack
– Executing [s@macro-dial-one:29] GosubIf(“SIP/gnr_in-0000019f”, “1?ctset,1():ctclear,1()”) in new stack
– Executing [ctset@macro-dial-one:1] Set(“SIP/gnr_in-0000019f”, “DB(CALLTRACE/7098)=393XXXXXXXXX”) in new stack
– Executing [ctset@macro-dial-one:2] Return(“SIP/gnr_in-0000019f”, “”) in new stack
– Executing [s@macro-dial-one:30] Set(“SIP/gnr_in-0000019f”, “D_OPTIONS=Ttr”) in new stack
– Executing [s@macro-dial-one:31] ExecIf(“SIP/gnr_in-0000019f”, “0?SIPAddHeader(Alert-Info: )”) in new stack
– Executing [s@macro-dial-one:32] ExecIf(“SIP/gnr_in-0000019f”, “0?SIPAddHeader()”) in new stack
– Executing [s@macro-dial-one:33] ExecIf(“SIP/gnr_in-0000019f”, “0?Set(CHANNEL(musicclass)=)”) in new stack
– Executing [s@macro-dial-one:34] GosubIf(“SIP/gnr_in-0000019f”, “0?qwait,1()”) in new stack
– Executing [s@macro-dial-one:35] Set(“SIP/gnr_in-0000019f”, “__CWIGNORE=”) in new stack
– Executing [s@macro-dial-one:36] Set(“SIP/gnr_in-0000019f”, “__KEEPCID=TRUE”) in new stack
– Executing [s@macro-dial-one:37] GotoIf(“SIP/gnr_in-0000019f”, “0?usegoto,1”) in new stack
– Executing [s@macro-dial-one:38] GotoIf(“SIP/gnr_in-0000019f”, “1?godial”) in new stack
– Goto (macro-dial-one,s,42)
– Executing [s@macro-dial-one:42] Dial(“SIP/gnr_in-0000019f”, “SIP/7098,Ttr”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/7098
– SIP/7098-000001a0 is ringing
– SIP/7098-000001a0 is ringing
– SIP/7098-000001a0 answered SIP/gnr_in-0000019f
[2014-02-26 10:52:04] WARNING[31871]: chan_sip.c:3983 retrans_pkt: Retransmission timeout reached on transmission SDsj5m101-fa964c5631452b55f7d194cfc8ffd0f4-ao92gd1 for seqno 1 (Critical Response) – See wiki.asterisk.org/wiki/display/ … nsmissions
Packet timed out after 6401ms with no response
[2014-02-26 10:52:04] WARNING[31871]: chan_sip.c:4012 retrans_pkt: Hanging up call SDsj5m101-fa964c5631452b55f7d194cfc8ffd0f4-ao92gd1 - no reply to our critical packet (see wiki.asterisk.org/wiki/display/ … nsmissions).
– Executing [h@macro-dial-one:1] Macro(“SIP/gnr_in-0000019f”, “hangupcall,”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/gnr_in-0000019f”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“SIP/gnr_in-0000019f”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] Hangup(“SIP/gnr_in-0000019f”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/gnr_in-0000019f’ in macro ‘hangupcall’
== Spawn extension (macro-dial-one, h, 1) exited non-zero on ‘SIP/gnr_in-0000019f’
== Spawn extension (macro-dial-one, s, 42) exited non-zero on ‘SIP/gnr_in-0000019f’ in macro ‘dial-one’
== Spawn extension (macro-exten-vm, s, 16) exited non-zero on ‘SIP/gnr_in-0000019f’ in macro ‘exten-vm’
== Spawn extension (from-did-direct, 7098, 2) exited non-zero on ‘SIP/gnr_in-0000019f’

but the problem still present.

if someone can help me.

thanks advance

You are using freepbx and you have issues with your network/nat settings. Your log show the retransmission issue so or your trunk or your phone can’t ack correctly to asterisk.

Remember the SIP protocol is based on requests and replies. Both sides send requests and wait for replies. Some of these requests are important. In a TCP/IP network many things can happen with IP packets. Firewalls, NAT devices, Session Border Controllers and SIP Proxys are in the signalling path and they will affect the call.

wiki.asterisk.org/wiki/display/ … nsmissions

GNU , don’t hijack the threads open a new thread!

how can I solve the problem with asterisk behind firewall?

Did you read this document wiki.asterisk.org/wiki/display/ … nsmissions ?

[quote]
Turn on SIP debug, try to understand the signalling that happens and see if you’re missing the reply to the INVITE or if the ACK gets lost. When you know what happens, you’ve taken the first step to track down the problem.

For NAT and Firewall problems, there are many documents to help you. Start with reading sip.conf.sample that is part of your Asterisk distribution.

The SIP signalling standard, including retransmissions and timers for these, is well documented in the IETF RFC 3261.[/quote]

[solved]
enough to put the external ip address in the menu settings-> asterisk sip settings rather than in the trunk.
thanks