Outbound destination rings, trunk reports no answer

FreePBX 13.0.98
Inbound no problem, both iax2 and sip
Outbound calls rings at destination (sip and iax).
No audio
Outbound Peer details

host=did.voip.les.net
context=from-trunk
type=friend
insecure=very
nat=yes
canreinvite=no
username=P2590466915
secret=???

– Executing [5127626397@from-internal:1] Macro(“PJSIP/223-00000005”, “user-callerid,LIMIT”) in new stack
– Executing [s@macro-user-callerid:1] Set(“PJSIP/223-00000005”, “TOUCH_MONITOR=1459678087.30”) in new stack
– Executing [s@macro-user-callerid:2] Set(“PJSIP/223-00000005”, “AMPUSER=223”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“PJSIP/223-00000005”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“PJSIP/223-00000005”, “1?Set(REALCALLERIDNUM=223)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“PJSIP/223-00000005”, “AMPUSER=223”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“PJSIP/223-00000005”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:7] Set(“PJSIP/223-00000005”, “AMPUSERCIDNAME=223”) in new stack
– Executing [s@macro-user-callerid:8] GotoIf(“PJSIP/223-00000005”, “0?report”) in new stack
– Executing [s@macro-user-callerid:9] Set(“PJSIP/223-00000005”, “AMPUSERCID=223”) in new stack
– Executing [s@macro-user-callerid:10] Set(“PJSIP/223-00000005”, “__DIAL_OPTIONS=Ttr”) in new stack
– Executing [s@macro-user-callerid:11] Set(“PJSIP/223-00000005”, “CALLERID(all)=“223” <223>”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“PJSIP/223-00000005”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:13] ExecIf(“PJSIP/223-00000005”, “1?Set(GROUP(concurrency_limit)=223)”) in new stack
– Executing [s@macro-user-callerid:14] ExecIf(“PJSIP/223-00000005”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [s@macro-user-callerid:15] GotoIf(“PJSIP/223-00000005”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,29)
– Executing [s@macro-user-callerid:29] Set(“PJSIP/223-00000005”, “CALLERID(number)=223”) in new stack
– Executing [s@macro-user-callerid:30] Set(“PJSIP/223-00000005”, “CALLERID(name)=223”) in new stack
– Executing [s@macro-user-callerid:31] Set(“PJSIP/223-00000005”, “CDR(cnum)=223”) in new stack
– Executing [s@macro-user-callerid:32] Set(“PJSIP/223-00000005”, “CDR(cnam)=223”) in new stack
– Executing [s@macro-user-callerid:33] Set(“PJSIP/223-00000005”, “CHANNEL(language)=en”) in new stack
– Executing [5127626397@from-internal:2] Set(“PJSIP/223-00000005”, “ROUTEUSER=223”) in new stack
– Executing [5127626397@from-internal:3] GotoIf(“PJSIP/223-00000005”, “1?notblind”) in new stack
– Goto (from-internal,5127626397,6)
– Executing [5127626397@from-internal:6] GotoIf(“PJSIP/223-00000005”, “1?restrictedroute-c4ca4238a0b923820dcc509a6f75849b,5127626397,2:outbound-allroutes,5127626397,2”) in new stack
– Goto (restrictedroute-c4ca4238a0b923820dcc509a6f75849b,5127626397,2)
– Executing [5127626397@restrictedroute-c4ca4238a0b923820dcc509a6f75849b:2] Gosub(“PJSIP/223-00000005”, “sub-record-check,s,1(out,5127626397,dontcare)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“PJSIP/223-00000005”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“PJSIP/223-00000005”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“PJSIP/223-00000005”, “NOW=1459678087”) in new stack
– Executing [s@sub-record-check:4] Set(“PJSIP/223-00000005”, “__DAY=03”) in new stack
– Executing [s@sub-record-check:5] Set(“PJSIP/223-00000005”, “__MONTH=04”) in new stack
– Executing [s@sub-record-check:6] Set(“PJSIP/223-00000005”, “__YEAR=2016”) in new stack
– Executing [s@sub-record-check:7] Set(“PJSIP/223-00000005”, “__TIMESTR=20160403-050807”) in new stack
– Executing [s@sub-record-check:8] Set(“PJSIP/223-00000005”, “__FROMEXTEN=223”) in new stack
– Executing [s@sub-record-check:9] Set(“PJSIP/223-00000005”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“PJSIP/223-00000005”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“PJSIP/223-00000005”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“PJSIP/223-00000005”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“PJSIP/223-00000005”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“PJSIP/223-00000005”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“PJSIP/223-00000005”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] NoOp(“PJSIP/223-00000005”, “Outbound Recording Check from 223 to 5127626397”) in new stack
– Executing [out@sub-record-check:2] Set(“PJSIP/223-00000005”, “RECMODE=dontcare”) in new stack
– Executing [out@sub-record-check:3] ExecIf(“PJSIP/223-00000005”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [out@sub-record-check:7] Gosub(“PJSIP/223-00000005”, “recordcheck,1(dontcare,out,5127626397)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“PJSIP/223-00000005”, “Starting recording check against dontcare”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“PJSIP/223-00000005”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [recordcheck@sub-record-check:3] Return(“PJSIP/223-00000005”, “”) in new stack
– Executing [out@sub-record-check:8] Return(“PJSIP/223-00000005”, “”) in new stack
– Executing [5127626397@restrictedroute-c4ca4238a0b923820dcc509a6f75849b:3] ExecIf(“PJSIP/223-00000005”, “0 ?Set(CDR(accountcode)=)”) in new stack
– Executing [5127626397@restrictedroute-c4ca4238a0b923820dcc509a6f75849b:4] Set(“PJSIP/223-00000005”, “MOHCLASS=default”) in new stack
– Executing [5127626397@restrictedroute-c4ca4238a0b923820dcc509a6f75849b:5] Set(“PJSIP/223-00000005”, “_NODEST=”) in new stack
– Executing [5127626397@restrictedroute-c4ca4238a0b923820dcc509a6f75849b:6] Macro(“PJSIP/223-00000005”, “dialout-trunk,2,5127626397,off”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“PJSIP/223-00000005”, “DIAL_TRUNK=2”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“PJSIP/223-00000005”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“PJSIP/223-00000005”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“PJSIP/223-00000005”, “DIAL_NUMBER=5127626397”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“PJSIP/223-00000005”, “DIAL_TRUNK_OPTIONS=Ttr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“PJSIP/223-00000005”, “OUTBOUND_GROUP=OUT_2”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“PJSIP/223-00000005”, “0?nomax”) in new stack
– Executing [s@macro-dialout-trunk:8] GotoIf(“PJSIP/223-00000005”, “0?chanfull”) in new stack
– Executing [s@macro-dialout-trunk:9] GotoIf(“PJSIP/223-00000005”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“PJSIP/223-00000005”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“PJSIP/223-00000005”, “outbound-callerid,2”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“PJSIP/223-00000005”, “0?Set(CALLERPRES(name-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“PJSIP/223-00000005”, “0?Set(CALLERPRES(num-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:3] ExecIf(“PJSIP/223-00000005”, “0?Set(REALCALLERIDNUM=223)”) in new stack
– Executing [s@macro-outbound-callerid:4] GotoIf(“PJSIP/223-00000005”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,7)
– Executing [s@macro-outbound-callerid:7] Set(“PJSIP/223-00000005”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“PJSIP/223-00000005”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:9] Set(“PJSIP/223-00000005”, “TRUNKOUTCID=5124992121”) in new stack
– Executing [s@macro-outbound-callerid:10] GotoIf(“PJSIP/223-00000005”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,15)
– Executing [s@macro-outbound-callerid:15] ExecIf(“PJSIP/223-00000005”, “1?Set(CALLERID(all)=5124992121)”) in new stack
– Executing [s@macro-outbound-callerid:16] ExecIf(“PJSIP/223-00000005”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:17] ExecIf(“PJSIP/223-00000005”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:18] ExecIf(“PJSIP/223-00000005”, “0?Set(CALLERPRES(name-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:19] ExecIf(“PJSIP/223-00000005”, “0?Set(CALLERPRES(num-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:20] Set(“PJSIP/223-00000005”, “CDR(outbound_cnum)=5124992121”) in new stack
– Executing [s@macro-outbound-callerid:21] Set(“PJSIP/223-00000005”, “CDR(outbound_cnam)=”) in new stack
[2016-04-03 05:08:07] WARNING[1599]: func_cdr.c:352 cdr_write_callback: CDR requires a value (CDR(variable)=value)
– Executing [s@macro-dialout-trunk:12] GosubIf(“PJSIP/223-00000005”, “0?sub-flp-2,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“PJSIP/223-00000005”, “OUTNUM=5127626397”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“PJSIP/223-00000005”, “custom=SIP/P2590466915”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“PJSIP/223-00000005”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
– Executing [s@macro-dialout-trunk:16] ExecIf(“PJSIP/223-00000005”, “0?Set(DIAL_TRUNK_OPTIONS=M(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:17] Macro(“PJSIP/223-00000005”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“PJSIP/223-00000005”, “”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“PJSIP/223-00000005”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:19] ExecIf(“PJSIP/223-00000005”, “1?Set(CONNECTEDLINE(num,i)=5127626397)”) in new stack
– Executing [s@macro-dialout-trunk:20] ExecIf(“PJSIP/223-00000005”, “1?Set(CONNECTEDLINE(name,i)=CID:5124992121)”) in new stack
– Executing [s@macro-dialout-trunk:21] ExecIf(“PJSIP/223-00000005”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)5124992121)”) in new stack
– Executing [s@macro-dialout-trunk:22] GotoIf(“PJSIP/223-00000005”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:23] Dial(“PJSIP/223-00000005”, “SIP/P2590466915/5127626397,300,”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/P2590466915/5127626397
[2016-04-03 05:08:39] WARNING[1982]: chan_sip.c:4022 retrans_pkt: Retransmission timeout reached on transmission [email protected]:5061 for seqno 102 (Critical Request) – See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 32001ms with no response
[2016-04-03 05:08:39] WARNING[1982]: chan_sip.c:4051 retrans_pkt: Hanging up call [email protected]:5061 - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).
– SIP/P2590466915-00000015 is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
– Executing [s@macro-dialout-trunk:24] NoOp(“PJSIP/223-00000005”, “Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 18”) in new stack
– Executing [s@macro-dialout-trunk:25] GotoIf(“PJSIP/223-00000005”, “0?continue,1:s-CONGESTION,1”) in new stack
– Goto (macro-dialout-trunk,s-CONGESTION,1)
– Executing [s-CONGESTION@macro-dialout-trunk:1] Set(“PJSIP/223-00000005”, “RC=18”) in new stack
– Executing [s-CONGESTION@macro-dialout-trunk:2] Goto(“PJSIP/223-00000005”, “18,1”) in new stack
– Goto (macro-dialout-trunk,18,1)
– Executing [18@macro-dialout-trunk:1] Goto(“PJSIP/223-00000005”, “s-NOANSWER,1”) in new stack
– Goto (macro-dialout-trunk,s-NOANSWER,1)
– Executing [s-NOANSWER@macro-dialout-trunk:1] NoOp(“PJSIP/223-00000005”, “Dial failed due to trunk reporting NOANSWER - giving up”) in new stack
– Executing [s-NOANSWER@macro-dialout-trunk:2] Progress(“PJSIP/223-00000005”, “”) in new stack
– Executing [s-NOANSWER@macro-dialout-trunk:3] Playback(“PJSIP/223-00000005”, “number-not-answering,noanswer”) in new stack
– <PJSIP/223-00000005> Playing ‘number-not-answering.ulaw’ (language ‘en’)
– Executing [s-NOANSWER@macro-dialout-trunk:4] Congestion(“PJSIP/223-00000005”, “20”) in new stack
[2016-04-03 05:08:40] WARNING[14505][C-00000012]: channel.c:4856 ast_prod: Prodding channel ‘PJSIP/223-00000005’ failed
== Spawn extension (macro-dialout-trunk, s-NOANSWER, 4) exited non-zero on ‘PJSIP/223-00000005’ in macro ‘dialout-trunk’
== Spawn extension (restrictedroute-c4ca4238a0b923820dcc509a6f75849b, 5127626397, 6) exited non-zero on ‘PJSIP/223-00000005’
– Executing [h@restrictedroute-c4ca4238a0b923820dcc509a6f75849b:1] Hangup(“PJSIP/223-00000005”, “”) in new stack
== Spawn extension (restrictedroute-c4ca4238a0b923820dcc509a6f75849b, h, 1) exited non-zero on ‘PJSIP/223-00000005’
– Remote UNIX connection
– Remote UNIX connection disconnected
– Remote UNIX connection
– Remote UNIX connection disconnected
localhost*CLI>

You are getting no reply from the next hop device on the outgoing side. If the final destination rang, it suggests that you have a firewall or NAT problem preventing responses reaching your machine.

Also, one would not normally use both the PJSIP and SIP channel drivers and, as far as I know, insecure=very is ignored on any version of chan_sip that is contemporary with PJSIP. If the sip.conf entry is truly only for outgoing calls, the insecure parameter has no effect and there is never a case where type=friend is better than type=peer.

canreinvite is deprecated and may be ignored on such versions.
The yes parameter for nat is deprecated.

If you are inside NAT, the default nat= setting is often enough, but you do need to tell Asterisk how to find your external address. The lack of an external address should not stop responses going to the right address, although it might just stop rport being set to cause the peer to ignore the port in the Via parameter.

If you are running both SIP and PJSIP on the same port only one of them will actually get it, so that might also explain why the response is being lost.

Thank you David,
I understand some of your reply.
I am reloading the iso, and going to only add 1 iax2 softphone first and see if I can get inbound and outbound working.

I believe my problem lies with trying to use the ancient aastra scripts.
To get that package’s auto discovery to work I have to use the legacy sip channel option. And then manually edit the phones sip entry and the generated tftpboot config file to use port 5061.

Once again Thank you Thank You.