Remote Ext no Audio double NAT using PJSIP

We have remote users that have phones at home. What is the best way to handle NAT with those Exts to get Audio working? I’ve read through a ton of posts regarding this and I’m trying as much as I can to implement the things that seemed to work, but it just seems too situational.

I have my server behind NAT (fortigate with SIP ALG disabled) and of course at home they are behind NAT.

I recently have trialed 3CX and they seem to have some method to make it work with no hassle at all. Not sure how they are doing it though. I have a One-to-One policy on my firewall to my test FreePBX and ports 80-20000 forwarded on a dedicated static IP. I understand I don’t want all of those open permanently but for testing I have it setup as such.

Below is a trace from the log while placing one of those calls.

[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [400@from-internal:1] GotoIf(“PJSIP/342-0000004d”, “1?ext-local,400,1”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Goto (ext-local,400,1)
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [400@ext-local:1] Set(“PJSIP/342-0000004d”, “__RINGTIMER=15”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [400@ext-local:2] Macro(“PJSIP/342-0000004d”, “exten-vm,400,400,0,0,0”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-exten-vm:1] Macro(“PJSIP/342-0000004d”, “user-callerid,”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:1] Set(“PJSIP/342-0000004d”, “TOUCH_MONITOR=1463493035.108”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:2] Set(“PJSIP/342-0000004d”, “AMPUSER=342”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:3] GotoIf(“PJSIP/342-0000004d”, “0?report”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:4] ExecIf(“PJSIP/342-0000004d”, “1?Set(REALCALLERIDNUM=342)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:5] Set(“PJSIP/342-0000004d”, “AMPUSER=342”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:6] GotoIf(“PJSIP/342-0000004d”, “0?limit”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:7] Set(“PJSIP/342-0000004d”, “AMPUSERCIDNAME=Joshua Giese”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:8] GotoIf(“PJSIP/342-0000004d”, “0?report”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:9] Set(“PJSIP/342-0000004d”, “AMPUSERCID=342”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:10] Set(“PJSIP/342-0000004d”, “__DIAL_OPTIONS=Ttr”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:11] Set(“PJSIP/342-0000004d”, “CALLERID(all)=“Joshua Giese” <342>”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:12] GotoIf(“PJSIP/342-0000004d”, “0?limit”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:13] ExecIf(“PJSIP/342-0000004d”, “0?Set(GROUP(concurrency_limit)=342)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:14] ExecIf(“PJSIP/342-0000004d”, “0?Set(CHANNEL(language)=)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:15] GotoIf(“PJSIP/342-0000004d”, “0?continue”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:16] ExecIf(“PJSIP/342-0000004d”, “1?Set(__CALLEE_ACCOUNCODE=)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:17] Set(“PJSIP/342-0000004d”, “__TTL=64”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:18] GotoIf(“PJSIP/342-0000004d”, “1?continue”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Goto (macro-user-callerid,s,29)
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:29] Set(“PJSIP/342-0000004d”, “CALLERID(number)=342”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:30] Set(“PJSIP/342-0000004d”, “CALLERID(name)=Joshua Giese”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:31] Set(“PJSIP/342-0000004d”, “CDR(cnum)=342”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:32] Set(“PJSIP/342-0000004d”, “CDR(cnam)=Joshua Giese”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-user-callerid:33] Set(“PJSIP/342-0000004d”, “CHANNEL(language)=en”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-exten-vm:2] Set(“PJSIP/342-0000004d”, “RingGroupMethod=none”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-exten-vm:3] Set(“PJSIP/342-0000004d”, “__EXTTOCALL=400”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-exten-vm:4] Set(“PJSIP/342-0000004d”, “__PICKUPMARK=400”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-exten-vm:5] Set(“PJSIP/342-0000004d”, “RT=15”) in new stack
[2016-05-17 08:50:35] WARNING[21314][C-0000003c] chan_sip.c: This function can only be used on SIP channels.
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-exten-vm:6] ExecIf(“PJSIP/342-0000004d”, “0?Macro(vm,400,DIRECTDIAL,)”) in new stack
[2016-05-17 08:50:35] WARNING[21314][C-0000003c] chan_sip.c: This function can only be used on SIP channels.
[2016-05-17 08:50:35] WARNING[21314][C-0000003c] chan_sip.c: This function can only be used on SIP channels.
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-exten-vm:7] ExecIf(“PJSIP/342-0000004d”, “0?MacroExit()”) in new stack
[2016-05-17 08:50:35] WARNING[21314][C-0000003c] chan_sip.c: This function can only be used on SIP channels.
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-exten-vm:8] Gosub(“PJSIP/342-0000004d”, “sub-record-check,s,1(exten,400,dontcare)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:1] GotoIf(“PJSIP/342-0000004d”, “0?initialized”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:2] Set(“PJSIP/342-0000004d”, “__REC_STATUS=INITIALIZED”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:3] Set(“PJSIP/342-0000004d”, “NOW=1463493035”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:4] Set(“PJSIP/342-0000004d”, “__DAY=17”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:5] Set(“PJSIP/342-0000004d”, “__MONTH=05”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:6] Set(“PJSIP/342-0000004d”, “__YEAR=2016”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:7] Set(“PJSIP/342-0000004d”, “__TIMESTR=20160517-085035”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:8] Set(“PJSIP/342-0000004d”, “__FROMEXTEN=342”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:9] Set(“PJSIP/342-0000004d”, “__MON_FMT=wav”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:10] NoOp(“PJSIP/342-0000004d”, “Recordings initialized”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:11] ExecIf(“PJSIP/342-0000004d”, “0?Set(ARG3=dontcare)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:12] Set(“PJSIP/342-0000004d”, “REC_POLICY_MODE_SAVE=”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:13] ExecIf(“PJSIP/342-0000004d”, “0?Set(REC_STATUS=NO)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:14] GotoIf(“PJSIP/342-0000004d”, “5?checkaction”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Goto (sub-record-check,s,17)
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-record-check:17] GotoIf(“PJSIP/342-0000004d”, “1?sub-record-check,exten,1”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Goto (sub-record-check,exten,1)
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:1] NoOp(“PJSIP/342-0000004d”, “Exten Recording Check between 342 and 400”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:2] Set(“PJSIP/342-0000004d”, “CALLTYPE=internal”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:3] ExecIf(“PJSIP/342-0000004d”, “0?Set(CALLTYPE=)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:4] Set(“PJSIP/342-0000004d”, “CALLEE=dontcare”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:5] ExecIf(“PJSIP/342-0000004d”, “0?Set(CALLEE=dontcare)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:6] GotoIf(“PJSIP/342-0000004d”, “0?callee”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:7] GotoIf(“PJSIP/342-0000004d”, “1?caller”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Goto (sub-record-check,exten,13)
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:13] Set(“PJSIP/342-0000004d”, “RECMODE=dontcare”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:14] ExecIf(“PJSIP/342-0000004d”, “0?Set(RECMODE=dontcare)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:15] ExecIf(“PJSIP/342-0000004d”, “1?Set(RECMODE=dontcare)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:16] Gosub(“PJSIP/342-0000004d”, “recordcheck,1(dontcare,internal,400)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [recordcheck@sub-record-check:1] NoOp(“PJSIP/342-0000004d”, “Starting recording check against dontcare”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [recordcheck@sub-record-check:2] Goto(“PJSIP/342-0000004d”, “dontcare”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Goto (sub-record-check,recordcheck,3)
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [recordcheck@sub-record-check:3] Return(“PJSIP/342-0000004d”, “”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [exten@sub-record-check:17] Return(“PJSIP/342-0000004d”, “”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-exten-vm:9] GotoIf(“PJSIP/342-0000004d”, “1?macrodial”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Goto (macro-exten-vm,s,15)
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-exten-vm:15] GosubIf(“PJSIP/342-0000004d”, “0?clrheader,1()”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-exten-vm:16] Macro(“PJSIP/342-0000004d”, “dial-one,15,Ttr,400”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:1] Set(“PJSIP/342-0000004d”, “DEXTEN=400”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:2] Set(“PJSIP/342-0000004d”, “DIALSTATUS_CW=”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:3] GosubIf(“PJSIP/342-0000004d”, “0?screen,1()”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:4] GosubIf(“PJSIP/342-0000004d”, “0?cf,1()”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:5] GotoIf(“PJSIP/342-0000004d”, “1?skip1”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Goto (macro-dial-one,s,8)
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:8] GotoIf(“PJSIP/342-0000004d”, “0?nodial”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:9] GotoIf(“PJSIP/342-0000004d”, “0?continue”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:10] Set(“PJSIP/342-0000004d”, “EXTHASCW=ENABLED”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:11] GotoIf(“PJSIP/342-0000004d”, “0?next1:cwinusebusy”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Goto (macro-dial-one,s,23)
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:23] GotoIf(“PJSIP/342-0000004d”, “0?next3:continue”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Goto (macro-dial-one,s,25)
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:25] GotoIf(“PJSIP/342-0000004d”, “0?nodial”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:26] GosubIf(“PJSIP/342-0000004d”, “1?dstring,1():dlocal,1()”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:1] Set(“PJSIP/342-0000004d”, “DSTRING=”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:2] Set(“PJSIP/342-0000004d”, “DEVICES=400”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:3] ExecIf(“PJSIP/342-0000004d”, “0?Return()”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:4] ExecIf(“PJSIP/342-0000004d”, “0?Set(DEVICES=00)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:5] Set(“PJSIP/342-0000004d”, “LOOPCNT=1”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:6] Set(“PJSIP/342-0000004d”, “ITER=1”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:7] Set(“PJSIP/342-0000004d”, “THISDIAL=PJSIP/400”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:8] GosubIf(“PJSIP/342-0000004d”, “1?zap2dahdi,1()”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [zap2dahdi@macro-dial-one:1] ExecIf(“PJSIP/342-0000004d”, “0?Return()”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [zap2dahdi@macro-dial-one:2] Set(“PJSIP/342-0000004d”, “NEWDIAL=”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [zap2dahdi@macro-dial-one:3] Set(“PJSIP/342-0000004d”, “LOOPCNT2=1”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [zap2dahdi@macro-dial-one:4] Set(“PJSIP/342-0000004d”, “ITER2=1”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [zap2dahdi@macro-dial-one:5] Set(“PJSIP/342-0000004d”, “THISPART2=PJSIP/400”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [zap2dahdi@macro-dial-one:6] ExecIf(“PJSIP/342-0000004d”, “0?Set(THISPART2=DAHDIIP/400)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [zap2dahdi@macro-dial-one:7] Set(“PJSIP/342-0000004d”, “NEWDIAL=PJSIP/400&”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [zap2dahdi@macro-dial-one:8] Set(“PJSIP/342-0000004d”, “ITER2=2”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [zap2dahdi@macro-dial-one:9] GotoIf(“PJSIP/342-0000004d”, “0?begin2”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [zap2dahdi@macro-dial-one:10] Set(“PJSIP/342-0000004d”, “THISDIAL=PJSIP/400”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [zap2dahdi@macro-dial-one:11] Return(“PJSIP/342-0000004d”, “”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:9] GotoIf(“PJSIP/342-0000004d”, “0?docheck”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:10] NoOp(“PJSIP/342-0000004d”, “Debug: Found PJSIP Destination PJSIP/400, updating with PJSIP_DIAL_CONTACTS”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:11] Set(“PJSIP/342-0000004d”, “THISDIAL=PJSIP/400/sip:[email protected]:32032;rinstance=5ebdd0d92a609a55”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:12] GotoIf(“PJSIP/342-0000004d”, “0?skipset”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:13] Set(“PJSIP/342-0000004d”, “DSTRING=PJSIP/400/sip:[email protected]:32032;rinstance=5ebdd0d92a609a55&”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:14] Set(“PJSIP/342-0000004d”, “ITER=2”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:15] GotoIf(“PJSIP/342-0000004d”, “0?begin”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:16] ExecIf(“PJSIP/342-0000004d”, “0?Return()”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:17] Set(“PJSIP/342-0000004d”, “DSTRING=PJSIP/400/sip:[email protected]:32032;rinstance=5ebdd0d92a609a55”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [dstring@macro-dial-one:18] Return(“PJSIP/342-0000004d”, “”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:27] GotoIf(“PJSIP/342-0000004d”, “0?nodial”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:28] GotoIf(“PJSIP/342-0000004d”, “0?skiptrace”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:29] GosubIf(“PJSIP/342-0000004d”, “1?ctset,1():ctclear,1()”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [ctset@macro-dial-one:1] Set(“PJSIP/342-0000004d”, “DB(CALLTRACE/400)=342”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [ctset@macro-dial-one:2] Return(“PJSIP/342-0000004d”, “”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:30] Set(“PJSIP/342-0000004d”, “D_OPTIONS=Ttr”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:31] NoOp(“PJSIP/342-0000004d”, "Blind Transfer: , Attended Transfer: , User: 342, Alert Info: ") in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:32] ExecIf(“PJSIP/342-0000004d”, “1?Set(ALERT_INFO=)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:33] ExecIf(“PJSIP/342-0000004d”, “0?Set(ALERT_INFO=)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:34] ExecIf(“PJSIP/342-0000004d”, “0?Set(ALERT_INFO=)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:35] GosubIf(“PJSIP/342-0000004d”, “0?func-set-sipheader,s,1(Alert-Info,)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:36] ExecIf(“PJSIP/342-0000004d”, “0?Set(CHANNEL(musicclass)=)”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:37] GosubIf(“PJSIP/342-0000004d”, “0?qwait,1()”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:38] Set(“PJSIP/342-0000004d”, “__CWIGNORE=”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:39] Set(“PJSIP/342-0000004d”, “__KEEPCID=TRUE”) in new stack
[2016-05-17 08:50:35] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:40] GotoIf(“PJSIP/342-0000004d”, “0?usegoto,1”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:41] GotoIf(“PJSIP/342-0000004d”, “0?godial”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:42] Gosub(“PJSIP/342-0000004d”, “sub-presencestate-display,s,1(400)”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@sub-presencestate-display:1] Goto(“PJSIP/342-0000004d”, “state-not_set,1”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Goto (sub-presencestate-display,state-not_set,1)
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [state-not_set@sub-presencestate-display:1] Set(“PJSIP/342-0000004d”, “PRESENCESTATE_DISPLAY=”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [state-not_set@sub-presencestate-display:2] Return(“PJSIP/342-0000004d”, “”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:43] Set(“PJSIP/342-0000004d”, “CONNECTEDLINE(name,i)=TEST”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:44] Set(“PJSIP/342-0000004d”, “CONNECTEDLINE(num)=400”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:45] Set(“PJSIP/342-0000004d”, “D_OPTIONS=TtrI”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:46] Macro(“PJSIP/342-0000004d”, “dialout-one-predial-hook,”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dialout-one-predial-hook:1] MacroExit(“PJSIP/342-0000004d”, “”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:47] ExecIf(“PJSIP/342-0000004d”, “0?Set(D_OPTIONS=trII)”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-dial-one:48] Dial(“PJSIP/342-0000004d”, “PJSIP/400/sip:[email protected]:32032;rinstance=5ebdd0d92a609a55,15,TtrIb(func-apply-sipheaders^s^1)”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] app_stack.c: PJSIP/400-0000004e Internal Gosub(func-apply-sipheaders,s,1) start
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@func-apply-sipheaders:1] NoOp(“PJSIP/400-0000004e”, “Applying SIP Headers to channel”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@func-apply-sipheaders:2] Set(“PJSIP/400-0000004e”, “SIPHEADERKEYS=”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@func-apply-sipheaders:3] While(“PJSIP/400-0000004e”, “0”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] app_while.c: Jumping to priority 7
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@func-apply-sipheaders:8] Return(“PJSIP/400-0000004e”, “”) in new stack
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] app_stack.c: Spawn extension (from-internal, 400, 1) exited non-zero on ‘PJSIP/400-0000004e’
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] app_stack.c: PJSIP/400-0000004e Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] app_dial.c: Called PJSIP/400/sip:[email protected]:32032;rinstance=5ebdd0d92a609a55
[2016-05-17 08:50:36] VERBOSE[21314][C-0000003c] app_dial.c: Connected line update to PJSIP/342-0000004d prevented.
[2016-05-17 08:50:37] VERBOSE[21314][C-0000003c] app_dial.c: PJSIP/400-0000004e is ringing
[2016-05-17 08:50:38] NOTICE[62570] res_pjsip/pjsip_distributor.c: Request from ‘“3CX” sip:[email protected]’ failed for ‘172.21.66.12:5063’ (callid: [email protected]) - No matching endpoint found
[2016-05-17 08:50:38] NOTICE[3977] res_pjsip/pjsip_distributor.c: Request from ‘“3CX” sip:[email protected]’ failed for ‘172.21.66.12:5063’ (callid: [email protected]) - No matching endpoint found
[2016-05-17 08:50:38] NOTICE[56097] res_pjsip/pjsip_distributor.c: Request from ‘“3CX” sip:[email protected]’ failed for ‘172.21.66.12:5063’ (callid: [email protected]) - No matching endpoint found
[2016-05-17 08:50:38] NOTICE[49081] res_pjsip/pjsip_distributor.c: Request from ‘“3CX” sip:[email protected]’ failed for ‘172.21.66.12:5063’ (callid: [email protected]) - No matching endpoint found
[2016-05-17 08:50:40] VERBOSE[21314][C-0000003c] app_dial.c: PJSIP/400-0000004e answered PJSIP/342-0000004d
[2016-05-17 08:50:40] VERBOSE[21317][C-0000003c] bridge_channel.c: Channel PJSIP/400-0000004e joined ‘simple_bridge’ basic-bridge
[2016-05-17 08:50:40] VERBOSE[21314][C-0000003c] bridge_channel.c: Channel PJSIP/342-0000004d joined ‘simple_bridge’ basic-bridge
[2016-05-17 08:50:45] VERBOSE[21314][C-0000003c] bridge_channel.c: Channel PJSIP/342-0000004d left ‘simple_bridge’ basic-bridge
[2016-05-17 08:50:45] VERBOSE[21317][C-0000003c] bridge_channel.c: Channel PJSIP/400-0000004e left ‘simple_bridge’ basic-bridge
[2016-05-17 08:50:45] VERBOSE[21314][C-0000003c] app_macro.c: Spawn extension (macro-dial-one, s, 48) exited non-zero on ‘PJSIP/342-0000004d’ in macro ‘dial-one’
[2016-05-17 08:50:45] VERBOSE[21314][C-0000003c] app_macro.c: Spawn extension (macro-exten-vm, s, 16) exited non-zero on ‘PJSIP/342-0000004d’ in macro ‘exten-vm’
[2016-05-17 08:50:45] VERBOSE[21314][C-0000003c] pbx.c: Spawn extension (ext-local, 400, 2) exited non-zero on ‘PJSIP/342-0000004d’
[2016-05-17 08:50:45] VERBOSE[21314][C-0000003c] pbx.c: Executing [h@ext-local:1] Macro(“PJSIP/342-0000004d”, “hangupcall,”) in new stack
[2016-05-17 08:50:45] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-hangupcall:1] GotoIf(“PJSIP/342-0000004d”, “1?theend”) in new stack
[2016-05-17 08:50:45] VERBOSE[21314][C-0000003c] pbx.c: Goto (macro-hangupcall,s,3)
[2016-05-17 08:50:45] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-hangupcall:3] ExecIf(“PJSIP/342-0000004d”, “0?Set(CDR(recordingfile)=)”) in new stack
[2016-05-17 08:50:45] VERBOSE[21314][C-0000003c] pbx.c: Executing [s@macro-hangupcall:4] Hangup(“PJSIP/342-0000004d”, “”) in new stack
[2016-05-17 08:50:45] VERBOSE[21314][C-0000003c] app_macro.c: Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘PJSIP/342-0000004d’ in macro ‘hangupcall’
[2016-05-17 08:50:45] VERBOSE[21314][C-0000003c] pbx.c: Spawn extension (ext-local, h, 1) exited non-zero on 'PJSIP/342-0000004d

I’ve also found that when my remote ext dials into the building it will ring the signaling but if my HQ phone does the hangup my remote does not terminate. This is just the end of the log I missed the rest but it includes the hangup at HQ.

[2016-05-17 09:02:29] VERBOSE[21888][C-0000003d] pbx.c: Executing [s@func-apply-sipheaders:1] NoOp(“PJSIP/342-00000050”, “Applying SIP Headers to channel”) in new stack
[2016-05-17 09:02:29] VERBOSE[21888][C-0000003d] pbx.c: Executing [s@func-apply-sipheaders:2] Set(“PJSIP/342-00000050”, “SIPHEADERKEYS=”) in new stack
[2016-05-17 09:02:29] VERBOSE[21888][C-0000003d] pbx.c: Executing [s@func-apply-sipheaders:3] While(“PJSIP/342-00000050”, “0”) in new stack
[2016-05-17 09:02:29] VERBOSE[21888][C-0000003d] app_while.c: Jumping to priority 7
[2016-05-17 09:02:29] VERBOSE[21888][C-0000003d] pbx.c: Executing [s@func-apply-sipheaders:8] Return(“PJSIP/342-00000050”, “”) in new stack
[2016-05-17 09:02:29] VERBOSE[21888][C-0000003d] app_stack.c: Spawn extension (from-internal, 342, 1) exited non-zero on ‘PJSIP/342-00000050’
[2016-05-17 09:02:29] VERBOSE[21888][C-0000003d] app_stack.c: PJSIP/342-00000050 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
[2016-05-17 09:02:29] VERBOSE[21888][C-0000003d] app_dial.c: Called PJSIP/342/sip:[email protected]:5064
[2016-05-17 09:02:29] VERBOSE[21888][C-0000003d] app_dial.c: Connected line update to PJSIP/400-0000004f prevented.
[2016-05-17 09:02:29] VERBOSE[21888][C-0000003d] app_dial.c: PJSIP/342-00000050 is ringing
[2016-05-17 09:02:37] VERBOSE[21888][C-0000003d] app_dial.c: PJSIP/342-00000050 answered PJSIP/400-0000004f
[2016-05-17 09:02:37] VERBOSE[21891][C-0000003d] bridge_channel.c: Channel PJSIP/342-00000050 joined ‘simple_bridge’ basic-bridge <4f3f9d1e-f11f-4936-8acd-e21a04c7b64f>
[2016-05-17 09:02:37] VERBOSE[21888][C-0000003d] bridge_channel.c: Channel PJSIP/400-0000004f joined ‘simple_bridge’ basic-bridge <4f3f9d1e-f11f-4936-8acd-e21a04c7b64f>
[2016-05-17 09:02:40] VERBOSE[21891][C-0000003d] bridge_channel.c: Channel PJSIP/342-00000050 left ‘simple_bridge’ basic-bridge <4f3f9d1e-f11f-4936-8acd-e21a04c7b64f>
[2016-05-17 09:02:40] VERBOSE[21888][C-0000003d] bridge_channel.c: Channel PJSIP/400-0000004f left ‘simple_bridge’ basic-bridge <4f3f9d1e-f11f-4936-8acd-e21a04c7b64f>
[2016-05-17 09:02:40] VERBOSE[21888][C-0000003d] app_macro.c: Spawn extension (macro-dial-one, s, 48) exited non-zero on ‘PJSIP/400-0000004f’ in macro ‘dial-one’
[2016-05-17 09:02:40] VERBOSE[21888][C-0000003d] app_macro.c: Spawn extension (macro-exten-vm, s, 16) exited non-zero on ‘PJSIP/400-0000004f’ in macro ‘exten-vm’
[2016-05-17 09:02:40] VERBOSE[21888][C-0000003d] pbx.c: Spawn extension (from-internal, 342, 2) exited non-zero on ‘PJSIP/400-0000004f’
[2016-05-17 09:02:40] VERBOSE[21888][C-0000003d] pbx.c: Executing [h@from-internal:1] Macro(“PJSIP/400-0000004f”, “hangupcall”) in new stack
[2016-05-17 09:02:40] VERBOSE[21888][C-0000003d] pbx.c: Executing [s@macro-hangupcall:1] GotoIf(“PJSIP/400-0000004f”, “1?theend”) in new stack
[2016-05-17 09:02:40] VERBOSE[21888][C-0000003d] pbx.c: Goto (macro-hangupcall,s,3)
[2016-05-17 09:02:40] VERBOSE[21888][C-0000003d] pbx.c: Executing [s@macro-hangupcall:3] ExecIf(“PJSIP/400-0000004f”, “0?Set(CDR(recordingfile)=)”) in new stack
[2016-05-17 09:02:40] VERBOSE[21888][C-0000003d] pbx.c: Executing [s@macro-hangupcall:4] Hangup(“PJSIP/400-0000004f”, “”) in new stack
[2016-05-17 09:02:40] VERBOSE[21888][C-0000003d] app_macro.c: Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘PJSIP/400-0000004f’ in macro ‘hangupcall’
[2016-05-17 09:02:40] VERBOSE[21888][C-0000003d] pbx.c: Spawn extension (from-internal, h, 1) exited non-zero on ‘PJSIP/400-0000004f’

Double NAT is challenging.

If they are doing nothing but calling in, you can set up your system for inbound calls like normal.

If they need to be called and are calling in, the challenge is getting their end set up to allow inbound calls to be redirected to their phones.

When presented with this particular challenge, the easiest way is usually to set up a simple VPN for them and go to town that way. That way, they are just extensions on the “local network” and are nothing special.

Anyone with any idea by what means 3CX is making that work seamlessly? It makes sense that i could register and have my cell phone working over 4G, I could easily see that with their app there may be more going on there, but using my same phone at home with 3CX everything worked off the bat as well. Same firewall HQ side, same ports open 80-20000. There must be an elegant solution that doesn’t require me to setup vpn on users home phones?

Connecting your phone to your server through a firewall over the 4G network is not setting up a double-NAT network. It is setting up a single NAT network.

Connecting your cell phone using something like Zoiper on your cell phone, through your NATted house network is more like what we’re talking about, and that is a lot more challenging without some kind of VPN.

Connecting your phone over the IP network through a custom app that talks directly to a specific manufacturer’s VOIP phone switch is not what we do here. We are far more egalitarian, and typically lots cheaper.

What do you suppose the 3CX app is doing to make this work? Taking wagers on “setting up a simple VPN”? It could also be setting up a local proxy that routes all traffic over a specific port through the firewall (which is another definition of a simple VPN).

The fact that their app does the work for you doesn’t change the fact that something like a local VPN is the simplest way to set this up.

FreePBX builds in phone-level VPN services and supports them with the commercial EPM module for certain phones (IIRC). If you need commercial support for something like this, I’m sure the Sangoma folks would be more than willing to help you out.

That’s kind of what I suspect is going on there, but my remote desk phones also worked. Oh well I was just curious what your take might be.

I have what equates to an OpenSSL VPN setup with our Fortigate is that something I could easily link up with a Yealink phone? I know I’ve seen that the phones accept config files but from something like my Fortigate I’m not sure what I would need to do.

Sidebar I assume Sangoma is having Yealink manufacture their phones based on same look, but is the firmware different that allows anything neat? Haven’t looked at them any idea?

I don’t know why this would be a struggle. I have several servers behind NATs (with the NAT settings setup correctly in the sip settings page) and dozens of users all at home with different models of phone and different ISPs and different routers and they all work as if they were on the LAN.
The phones are obviously registering to an extension on the sever and they are doing all of the negotiations as I would expect. Every once in a while I will get someone who has SIP AGL turned on in their home router and you can tell because in the peers page their IP shows up as their LAN IP instead of their public IP so I have to have them turn that off.

What issues are you having?

The Yealinks only support OpenVPN but if you have the commercial modules for the FreePBX Distro it will set it all up for you. If not it’s not too hard to get setup. OpenVPN with Yealink is what we have been moving to for all of our systems.

From HQ to Remote or Remote to HQ all the ringing works as expected just no audio either direction. Hangup does not seem to work either direction either.

I will have to take the Commercial module into consideration it might just be the way to go. But for the sake of science I at least want to understand why I can’t make it work.

That’s interesting, usually you would at least get one way audio in these scenarios. Now I see that you’re using PJSIP and I don’t have a ton of experience with PJSIP, I still stick to ChanSIP for my production machines.

What do you see for your remote extensions in the peers page? That can tell you a lot, the public IP, if it says unreachable, unknown, etc…

Agreed one way audio has always been the norm for me as well ha ha ha! I will take a look at peers page and get back here. I opted for PJSIP specifically for multi device in an effort to get rid of Users and Devices mode in a current installation. Noted here Single Users Multiple Devices In ‘Extension Mode’ that PJSIP is required for that to work. Hopefully I can get it to work under these current conditions if not, multiple devices was more important. I can work around with VPN even if it’s not the way I’d necessarily like to go.

Has anyone gotten multiple registrations to work on PJSIP?I tried it out before a big system I just finished because I wanted multiple registrations but it would only ring the most recently registered phone and so I gave up on it.

Ah ha, just read the thread you linked, good to know. Will have to try it out again.

1 Like