SIP inbound call to my freePBX 15 through pjpsip trunk drops after 33 seconds

Hi guys i have a freePBX 15 installed and i setup PJPSIP trunk on it adding the ip address on a remote PBX also, specify the fixed public ip address of that remote PBX and also set context=from-internal

-Now this remote PBX will call the local extensions of my freepBX directly by SIP and teh calls works perfectly good audio and connected, problem it drops after 33 seconds

  • tried multiple times and calls really drops on all extensions

anyone can help how to workaround this please

A drop at that time in the call is nearly always due to the ACK message not getting through. A possibility is that you have the PJSIP trunk set to “rewrite contact” which you would generally not want on a trunk.

please can you help on how to correct this please

im getting this on my logs

[
– Channel PJSIP/SFDC-00000109 left ‘simple_bridge’ basic-bridge <6fc959a9-0b27-4802-b27c-00b480366eec>
– Channel PJSIP/5109-0000010a left ‘simple_bridge’ basic-bridge <6fc959a9-0b27-4802-b27c-00b480366eec>
== Spawn extension (macro-dial-one, s, 56) exited non-zero on ‘PJSIP/SFDC-00000109’ in macro ‘dial-one’
== Spawn extension (macro-exten-vm, s, 26) exited non-zero on ‘PJSIP/SFDC-00000109’ in macro ‘exten-vm’
== Spawn extension (ext-local, 5109, 2) exited non-zero on ‘PJSIP/SFDC-00000109’
– Executing [[email protected]:1] Macro(“PJSIP/SFDC-00000109”, “hangupcall,”) in new stack
– Executing [[email protected]:1] GotoIf(“PJSIP/SFDC-00000109”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [[email protected]:3] ExecIf(“PJSIP/SFDC-00000109”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [[email protected]:4] NoOp(“PJSIP/SFDC-00000109”, "PJSIP/5109-0000010a montior file= ") in new stack
– Executing [[email protected]:5] GotoIf(“PJSIP/SFDC-00000109”, “1?skipagi”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [[email protected]:7] Hangup(“PJSIP/SFDC-00000109”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 7) exited non-zero on ‘PJSIP/SFDC-00000109’ in macro ‘hangupcall’
== Spawn extension (ext-local, h, 1) exited non-zero on ‘PJSIP/SFDC-00000109’

This is what I am recommending you check - in your Trunk settings - PJSIP Settings - Advanced.

@billsimon

its currently - NO on my setting now

You may need to set this to YES for handling NAT.

do you have PBX .? can i request if we can test on my freepBX for you to dial my local extensions to see if it works

No because this won’t fix the issue if there is a problem on the other PBX sending calls to you. This was explained (like other things) in IRC to you earlier today. @billsimon is correct about the ACK which means you need to verify with the admins of the other PBX that A) They got your 200 OK for the INVITE and B) They sent the ACK to the PBX.

@BlazeStudios but my client wont accept it the problem on there end coz he have existing like 4 more freePBX box sending calls and he does not have this cut off problem, so he insist to check my system, coz all other 3 PBX who have tested on him works all good :frowning:

Did I say the problem was on their end? No. I said verify with them that things are happening how they are supposed to be.

Also, how are they your client but you are connecting to them and they have other PBX systems they are doing this with? This is a rather backwards way of handling client endpoint connections.

As well, you’re using the “from-internal” context on this and they are sending calls to local/internal extensions so this is more a “Intra-Company” so why can’t all sides be working together to make sure their calls are being handled right?

@BlazeStudios

understood, we already had session and make test calls on my freePBX and they can dial on local but still got drop 33 seconds, and they said might be with my NAT/firewall i need to troubleshoot coz with there other partner setup all there calls are passing to there respective freePBX, :frowning: im tied up on troubleshooting on my end

Use sngrep on both sides to examine the SIP being sent between the PBXes. Both servers should be seeing the same sequence of SIP messages between them. The calling server’s ACK message is not getting back to the callee. You will have to examine that message to figure out why.

1 Like

Yeah, we went over this in IRC (been going on for days now). No access to the PBX systems sending the calls to this PBX. Oh and there are two, so the calls could be coming from one or the other.

This sounds like another situation where the OP needs to get on the Asterisk CLI and

*CLI> module load res_magic.so

and use the special magic module since without being able to actually troubleshoot we are all wasting our time.

@ruben23 at least use sngrep on your own server and verify what we think your Asterisk is seeing. You should see the incoming call connect and then your server keeps sending 200 OK repeatedly back to the calling server because it gets no ACK from the caller. After 30 seconds your server will send BYE. If you examine the 200 OK you should take a look at the Contact: header there and see what you are sending the caller. That’s the path he’s trying to use to send you your ACK.

2 Likes

@billsimon

ok install sngrep on the command line now

This is my Log when the calls comes in to my freePBX until it hit 30 seconds and dropped

== Setting global variable ‘SIPDOMAIN’ to ‘YYYY.YYYY.YYYY.YYYY’ ----------------------------------------------> MY FREEPBX IPADDRESS
– Executing [[email protected]:1] Set(“PJSIP/Cuda-00000113”, “__RINGTIMER=15”) in new stack
– Executing [[email protected]:2] Macro(“PJSIP/Cuda-00000113”, “exten-vm,5136,5136,0,0,0”) in new stack
– Executing [[email protected]:1] Macro(“PJSIP/Cuda-00000113”, “user-callerid,”) in new stack
– Executing [[email protected]:1] Set(“PJSIP/Cuda-00000113”, “TOUCH_MONITOR=1586230312.275”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/Cuda-00000113”, “AMPUSER=undef”) in new stack
– Executing [[email protected]:3] Set(“PJSIP/Cuda-00000113”, “HOTDESCKCHAN=Cuda-00000113”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/Cuda-00000113”, “HOTDESKEXTEN=Cuda”) in new stack
– Executing [[email protected]:5] Set(“PJSIP/Cuda-00000113”, “HOTDESKCALL=0”) in new stack
– Executing [[email protected]:6] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(HOTDESKCALL=1)”) in new stack
– Executing [[email protected]:7] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(CALLERID(name)=)”) in new stack
– Executing [[email protected]:8] GotoIf(“PJSIP/Cuda-00000113”, “0?report”) in new stack
– Executing [[email protected]:9] ExecIf(“PJSIP/Cuda-00000113”, “1?Set(REALCALLERIDNUM=undef)”) in new stack
– Executing [[email protected]:10] Set(“PJSIP/Cuda-00000113”, “AMPUSER=”) in new stack
– Executing [[email protected]:11] GotoIf(“PJSIP/Cuda-00000113”, “0?limit”) in new stack
– Executing [[email protected]:12] Set(“PJSIP/Cuda-00000113”, “AMPUSERCIDNAME=”) in new stack
– Executing [[email protected]:13] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(__CIDMASQUERADING=TRUE)”) in new stack
– Executing [[email protected]:14] GotoIf(“PJSIP/Cuda-00000113”, “1?report”) in new stack
– Goto (macro-user-callerid,s,22)
– Executing [[email protected]:22] NoOp(“PJSIP/Cuda-00000113”, “Macro Depth is 2”) in new stack
– Executing [[email protected]:23] GotoIf(“PJSIP/Cuda-00000113”, “1?report2:macroerror”) in new stack
– Goto (macro-user-callerid,s,24)
– Executing [[email protected]:24] GotoIf(“PJSIP/Cuda-00000113”, “0?continue”) in new stack
– Executing [[email protected]:25] ExecIf(“PJSIP/Cuda-00000113”, “1?Set(__CALLEE_ACCOUNCODE=)”) in new stack
– Executing [[email protected]:26] Set(“PJSIP/Cuda-00000113”, “__TTL=64”) in new stack
– Executing [[email protected]:27] GotoIf(“PJSIP/Cuda-00000113”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,43)
– Executing [[email protected]:43] Set(“PJSIP/Cuda-00000113”, “CALLERID(number)=undef”) in new stack
– Executing [[email protected]:44] Set(“PJSIP/Cuda-00000113”, “CALLERID(name)=Toy Store”) in new stack
– Executing [[email protected]:45] GotoIf(“PJSIP/Cuda-00000113”, “0?cnum”) in new stack
– Executing [[email protected]:46] Set(“PJSIP/Cuda-00000113”, “CDR(cnam)=Toy Store”) in new stack
– Executing [[email protected]:47] Set(“PJSIP/Cuda-00000113”, “CDR(cnum)=undef”) in new stack
– Executing [[email protected]:48] Set(“PJSIP/Cuda-00000113”, “CHANNEL(language)=en”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/Cuda-00000113”, “RingGroupMethod=none”) in new stack
– Executing [[email protected]:3] Set(“PJSIP/Cuda-00000113”, “__EXTTOCALL=5136”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/Cuda-00000113”, “__PICKUPMARK=5136”) in new stack
– Executing [[email protected]:5] Set(“PJSIP/Cuda-00000113”, “RT=15”) in new stack
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
– Executing [[email protected]:6] ExecIf(“PJSIP/Cuda-00000113”, “0?Macro(vm,5136,DIRECTDIAL,)”) in new stack
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
– Executing [[email protected]:7] ExecIf(“PJSIP/Cuda-00000113”, “0?MacroExit()”) in new stack
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
– Executing [[email protected]:8] ExecIf(“PJSIP/Cuda-00000113”, “0?Gosub(ext-intercom,*805136,1())”) in new stack
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
– Executing [[email protected]:9] ExecIf(“PJSIP/Cuda-00000113”, “0?MacroExit()”) in new stack
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
– Executing [[email protected]:10] ExecIf(“PJSIP/Cuda-00000113”, “0?ChanSpy(PJSIP/5136,q)”) in new stack
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
– Executing [[email protected]:11] ExecIf(“PJSIP/Cuda-00000113”, “0?MacroExit()”) in new stack
[2020-04-07 11:31:52] WARNING[15842][C-00000100]: chan_sip.c:23160 func_header_read: This function can only be used on SIP channels.
– Executing [[email protected]:12] ExecIf(“PJSIP/Cuda-00000113”, “0?Macro(vm,5136,DIRECTDIAL,)”) in new stack
– Executing [[email protected]:13] ExecIf(“PJSIP/Cuda-00000113”, “0?MacroExit()”) in new stack
– Executing [[email protected]:14] ExecIf(“PJSIP/Cuda-00000113”, “0?Gosub(ext-intercom,*805136,1())”) in new stack
– Executing [[email protected]:15] ExecIf(“PJSIP/Cuda-00000113”, “0?MacroExit()”) in new stack
– Executing [[email protected]:16] ExecIf(“PJSIP/Cuda-00000113”, “0?ChanSpy(PJSIP/5136,q)”) in new stack
– Executing [[email protected]:17] ExecIf(“PJSIP/Cuda-00000113”, “0?MacroExit()”) in new stack
– Executing [[email protected]:18] Gosub(“PJSIP/Cuda-00000113”, “sub-record-check,s,1(exten,5136,dontcare)”) in new stack
– Executing [[email protected]:1] GotoIf(“PJSIP/Cuda-00000113”, “0?initialized”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/Cuda-00000113”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [[email protected]:3] Set(“PJSIP/Cuda-00000113”, “NOW=1586230312”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/Cuda-00000113”, “__DAY=07”) in new stack
– Executing [[email protected]:5] Set(“PJSIP/Cuda-00000113”, “__MONTH=04”) in new stack
– Executing [[email protected]:6] Set(“PJSIP/Cuda-00000113”, “__YEAR=2020”) in new stack
– Executing [[email protected]:7] Set(“PJSIP/Cuda-00000113”, “__TIMESTR=20200407-113152”) in new stack
– Executing [[email protected]:8] Set(“PJSIP/Cuda-00000113”, “__FROMEXTEN=undef”) in new stack
– Executing [[email protected]:9] Set(“PJSIP/Cuda-00000113”, “__MON_FMT=wav”) in new stack
– Executing [[email protected]:10] NoOp(“PJSIP/Cuda-00000113”, “Recordings initialized”) in new stack
– Executing [[email protected]:11] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [[email protected]:12] Set(“PJSIP/Cuda-00000113”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [[email protected]:13] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [[email protected]:14] GotoIf(“PJSIP/Cuda-00000113”, “5?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [[email protected]:17] GotoIf(“PJSIP/Cuda-00000113”, “1?sub-record-check,exten,1”) in new stack
– Goto (sub-record-check,exten,1)
– Executing [[email protected]:1] NoOp(“PJSIP/Cuda-00000113”, “Exten Recording Check between undef and 5136”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/Cuda-00000113”, “CALLTYPE=internal”) in new stack
– Executing [[email protected]:3] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(CALLTYPE=)”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/Cuda-00000113”, “CALLEE=dontcare”) in new stack
– Executing [[email protected]:5] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(CALLEE=dontcare)”) in new stack
– Executing [[email protected]:6] GotoIf(“PJSIP/Cuda-00000113”, “0?callee”) in new stack
– Executing [[email protected]:7] GotoIf(“PJSIP/Cuda-00000113”, “1?caller”) in new stack
– Goto (sub-record-check,exten,13)
– Executing [[email protected]:13] Set(“PJSIP/Cuda-00000113”, “RECMODE=”) in new stack
– Executing [[email protected]:14] ExecIf(“PJSIP/Cuda-00000113”, “1?Set(RECMODE=dontcare)”) in new stack
– Executing [[email protected]:15] ExecIf(“PJSIP/Cuda-00000113”, “1?Set(RECMODE=dontcare)”) in new stack
– Executing [[email protected]:16] Gosub(“PJSIP/Cuda-00000113”, “recordcheck,1(dontcare,internal,5136)”) in new stack
– Executing [[email protected]:1] NoOp(“PJSIP/Cuda-00000113”, “Starting recording check against dontcare”) in new stack
– Executing [[email protected]:2] Goto(“PJSIP/Cuda-00000113”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [[email protected]:3] Return(“PJSIP/Cuda-00000113”, “”) in new stack
– Executing [[email protected]:17] Return(“PJSIP/Cuda-00000113”, “”) in new stack
– Executing [[email protected]:19] GotoIf(“PJSIP/Cuda-00000113”, “1?macrodial”) in new stack
– Goto (macro-exten-vm,s,25)
– Executing [[email protected]:25] GosubIf(“PJSIP/Cuda-00000113”, “0?clrheader,1()”) in new stack
– Executing [[email protected]:26] Macro(“PJSIP/Cuda-00000113”, “dial-one,15,HhTtr,5136”) in new stack
– Executing [[email protected]:1] Set(“PJSIP/Cuda-00000113”, “DEXTEN=5136”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/Cuda-00000113”, “__CRM_SOURCE=undef”) in new stack
– Executing [[email protected]:3] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(__EXTTOCALL=5136)”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/Cuda-00000113”, “DIALSTATUS_CW=”) in new stack
– Executing [[email protected]:5] GosubIf(“PJSIP/Cuda-00000113”, “0?screen,1()”) in new stack
– Executing [[email protected]:6] GosubIf(“PJSIP/Cuda-00000113”, “0?cf,1()”) in new stack
– Executing [[email protected]:7] GotoIf(“PJSIP/Cuda-00000113”, “1?skip1”) in new stack
– Goto (macro-dial-one,s,10)
– Executing [[email protected]:10] GotoIf(“PJSIP/Cuda-00000113”, “0?nodial”) in new stack
– Executing [[email protected]:11] GotoIf(“PJSIP/Cuda-00000113”, “0?continue”) in new stack
– Executing [[email protected]:12] Set(“PJSIP/Cuda-00000113”, “EXTHASCW=ENABLED”) in new stack
– Executing [[email protected]:13] GotoIf(“PJSIP/Cuda-00000113”, “0?next1:cwinusebusy”) in new stack
– Goto (macro-dial-one,s,25)
– Executing [[email protected]:25] GotoIf(“PJSIP/Cuda-00000113”, “0?next3:continue”) in new stack
– Goto (macro-dial-one,s,27)
– Executing [[email protected]:27] GotoIf(“PJSIP/Cuda-00000113”, “0?nodial”) in new stack
– Executing [[email protected]:28] GosubIf(“PJSIP/Cuda-00000113”, “1?dstring,1():dlocal,1()”) in new stack
– Executing [[email protected]:1] Set(“PJSIP/Cuda-00000113”, “DSTRING=”) in new stack
– Executing [[email protected]:2] Set(“PJSIP/Cuda-00000113”, “DEVICES=5136”) in new stack
– Executing [[email protected]:3] ExecIf(“PJSIP/Cuda-00000113”, “0?Return()”) in new stack
– Executing [[email protected]:4] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(DEVICES=136)”) in new stack
– Executing [[email protected]:5] Set(“PJSIP/Cuda-00000113”, “LOOPCNT=1”) in new stack
– Executing [[email protected]:6] Set(“PJSIP/Cuda-00000113”, “ITER=1”) in new stack
– Executing [[email protected]:7] Set(“PJSIP/Cuda-00000113”, “THISDIAL=PJSIP/5136”) in new stack
– Executing [[email protected]:8] GotoIf(“PJSIP/Cuda-00000113”, “0?docheck”) in new stack
– Executing [[email protected]:9] NoOp(“PJSIP/Cuda-00000113”, “Debug: Found PJSIP Destination PJSIP/5136”) in new stack
– Executing [[email protected]:10] GotoIf(“PJSIP/Cuda-00000113”, “0?doset”) in new stack
– Executing [[email protected]:11] NoOp(“PJSIP/Cuda-00000113”, “Debug: Updating PJSIP Destination with PJSIP_DIAL_CONTACTS”) in new stack
– Executing [[email protected]:12] Set(“PJSIP/Cuda-00000113”, “THISDIAL=PJSIP/5136/sip:[email protected]:30018;rinstance=c8bc8a0c1cf18a52”) in new stack
– Executing [[email protected]:13] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(DIALSTATUS=CHANUNAVAIL)”) in new stack
– Executing [[email protected]:14] GotoIf(“PJSIP/Cuda-00000113”, “0?skipset”) in new stack
– Executing [[email protected]:15] Set(“PJSIP/Cuda-00000113”, “DSTRING=PJSIP/5136/sip:[email protected]:30018;rinstance=c8bc8a0c1cf18a52&”) in new stack
– Executing [[email protected]:16] Set(“PJSIP/Cuda-00000113”, “ITER=2”) in new stack
– Executing [[email protected]:17] GotoIf(“PJSIP/Cuda-00000113”, “0?begin”) in new stack
– Executing [[email protected]:18] ExecIf(“PJSIP/Cuda-00000113”, “0?Return()”) in new stack
– Executing [[email protected]:19] Set(“PJSIP/Cuda-00000113”, “DSTRING=PJSIP/5136/sip:[email protected]:30018;rinstance=c8bc8a0c1cf18a52”) in new stack
– Executing [[email protected]:20] Return(“PJSIP/Cuda-00000113”, “”) in new stack
– Executing [[email protected]:29] GotoIf(“PJSIP/Cuda-00000113”, “0?nodial”) in new stack
– Executing [[email protected]:30] GotoIf(“PJSIP/Cuda-00000113”, “0?skiptrace”) in new stack
– Executing [[email protected]:31] GosubIf(“PJSIP/Cuda-00000113”, “0?ctset,1():ctclear,1()”) in new stack
– Executing [[email protected]:1] NoOp(“PJSIP/Cuda-00000113”, "Deleting: CALLTRACE/5136 ") in new stack
– Executing [[email protected]:2] Return(“PJSIP/Cuda-00000113”, “”) in new stack
– Executing [[email protected]:32] Set(“PJSIP/Cuda-00000113”, “D_OPTIONS=HhTtr”) in new stack
– Executing [[email protected]:33] GosubIf(“PJSIP/Cuda-00000113”, “0?func-set-sipheader,s,1(Alert-Info,)”) in new stack
– Executing [[email protected]:34] NoOp(“PJSIP/Cuda-00000113”, "Blind Transfer: , Attended Transfer: , User: , Alert Info: ") in new stack
– Executing [[email protected]:35] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(ALERT_INFO=)”) in new stack
– Executing [[email protected]:36] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(ALERT_INFO=)”) in new stack
– Executing [[email protected]:37] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(ALERT_INFO=)”) in new stack
– Executing [[email protected]:38] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(ALERT_INFO=Normal;volume=)”) in new stack
– Executing [[email protected]:39] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(ALERT_INFO=Normal;volume=)”) in new stack
– Executing [[email protected]:40] GosubIf(“PJSIP/Cuda-00000113”, “0?func-set-sipheader,s,1(Alert-Info,)”) in new stack
– Executing [[email protected]:41] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(CHANNEL(musicclass)=)”) in new stack
– Executing [[email protected]:42] GosubIf(“PJSIP/Cuda-00000113”, “0?qwait,1()”) in new stack
– Executing [[email protected]:43] Set(“PJSIP/Cuda-00000113”, “__CWIGNORE=”) in new stack
– Executing [[email protected]:44] Set(“PJSIP/Cuda-00000113”, “__KEEPCID=TRUE”) in new stack
– Executing [[email protected]:45] GotoIf(“PJSIP/Cuda-00000113”, “0?usegoto,1”) in new stack
– Executing [[email protected]:46] GotoIf(“PJSIP/Cuda-00000113”, “1?godial”) in new stack
– Goto (macro-dial-one,s,51)
– Executing [[email protected]:51] Macro(“PJSIP/Cuda-00000113”, “dialout-one-predial-hook,”) in new stack
– Executing [[email protected]:1] MacroExit(“PJSIP/Cuda-00000113”, “”) in new stack
– Executing [[email protected]:52] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(D_OPTIONS=HhtrI)”) in new stack
– Executing [[email protected]:53] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(CWRING=r(callwaiting)):Set(CWRING=)”) in new stack
– Executing [[email protected]:54] NoOp(“PJSIP/Cuda-00000113”, “”) in new stack
– Executing [[email protected]:55] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(D_OPTIONS=HhTtrg)”) in new stack
– Executing [[email protected]:56] Dial(“PJSIP/Cuda-00000113”, “PJSIP/5136/sip:[email protected]:30018;rinstance=c8bc8a0c1cf18a52,15,HhTtrb(func-apply-sipheaders^s^1)”) in new stack
– PJSIP/5136-00000114 Internal Gosub(func-apply-sipheaders,s,1) start
– Executing [[email protected]:1] ExecIf(“PJSIP/5136-00000114”, “0?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)”) in new stack
– Executing [[email protected]:2] NoOp(“PJSIP/5136-00000114”, “Applying SIP Headers to channel PJSIP/5136-00000114”) in new stack
– Executing [[email protected]:3] Set(“PJSIP/5136-00000114”, “TECH=PJSIP”) in new stack
– Executing [[email protected]:4] Set(“PJSIP/5136-00000114”, “SIPHEADERKEYS=”) in new stack
– Executing [[email protected]:5] While(“PJSIP/5136-00000114”, “0”) in new stack
– Jumping to priority 13
– Executing [[email protected]:14] Return(“PJSIP/5136-00000114”, “”) in new stack
== Spawn extension (from-internal, 5136, 1) exited non-zero on ‘PJSIP/5136-00000114’
– PJSIP/5136-00000114 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
– Called PJSIP/5136/sip:[email protected]:30018;rinstance=c8bc8a0c1cf18a52
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio TOS bits 184 in TCLASS field.
== Using SIP RTP Audio CoS mark 5
– PJSIP/5136-00000114 is ringing
– PJSIP/5136-00000114 is ringing
> 0x7f7f64212190 – Strict RTP learning after remote address set to: 49.149.110.51:30834
– PJSIP/5136-00000114 answered PJSIP/Cuda-00000113
> 0x7f7fc40095d0 – Strict RTP learning after remote address set to: XXX.XXX.XXX.XXX:17718 -------------------------> IP ADDRESS OF CLIENT PBX
– Channel PJSIP/5136-00000114 joined ‘simple_bridge’ basic-bridge <01cb7d74-630e-49d3-8532-a6e8baa9a6ae>
– Channel PJSIP/Cuda-00000113 joined ‘simple_bridge’ basic-bridge <01cb7d74-630e-49d3-8532-a6e8baa9a6ae>
> 0x7f7f64212190 – Strict RTP qualifying stream type: audio
> 0x7f7f64212190 – Strict RTP switching source address to 49.149.110.51:30332
> 0x7f7fc40095d0 – Strict RTP switching to RTP target address XXX.XX.XXX.XXX:17718 as source ------------------------> IP ADDRESS OF CLIENT PBX
[2020-04-07 11:31:54] WARNING[20431]: res_pjsip_pubsub.c:3305 pubsub_on_rx_publish_request: No registered publish handler for event presence
[2020-04-07 11:31:54] WARNING[28139]: res_pjsip_pubsub.c:776 subscription_get_handler_from_rdata: No registered subscribe handler for event presence.winfo
> 0x7f7f64212190 – Strict RTP learning complete - Locking on source address 49.149.110.51:30332
> 0x7f7fc40095d0 – Strict RTP learning complete - Locking on source address XX.XXX.XX.XX:17718 ------------------> IP ADDRESS OF CLIENT PBX
– Channel PJSIP/Cuda-00000113 left ‘simple_bridge’ basic-bridge <01cb7d74-630e-49d3-8532-a6e8baa9a6ae>
– Channel PJSIP/5136-00000114 left ‘simple_bridge’ basic-bridge <01cb7d74-630e-49d3-8532-a6e8baa9a6ae>
== Spawn extension (macro-dial-one, s, 56) exited non-zero on ‘PJSIP/Cuda-00000113’ in macro ‘dial-one’
== Spawn extension (macro-exten-vm, s, 26) exited non-zero on ‘PJSIP/Cuda-00000113’ in macro ‘exten-vm’
== Spawn extension (from-internal, 5136, 2) exited non-zero on ‘PJSIP/Cuda-00000113’
– Executing [[email protected]:1] Macro(“PJSIP/Cuda-00000113”, “hangupcall”) in new stack
– Executing [[email protected]:1] GotoIf(“PJSIP/Cuda-00000113”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [[email protected]:3] ExecIf(“PJSIP/Cuda-00000113”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [[email protected]:4] NoOp(“PJSIP/Cuda-00000113”, "PJSIP/5136-00000114 montior file= ") in new stack
– Executing [[email protected]:5] GotoIf(“PJSIP/Cuda-00000113”, “1?skipagi”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [[email protected]:7] Hangup(“PJSIP/Cuda-00000113”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 7) exited non-zero on ‘PJSIP/Cuda-00000113’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘PJSIP/Cuda-00000113’

My sngrep

                                               Call flow for 6sJbT8-22O6PVkcxXqnZzA.. (Color by Request/Response)
                                                        xSUBSCRIBE sip:[email protected];transport=udp SIP/2.0
       49.149.110.51:31127            125.212.37.68:5060xVia: SIP/2.0/UDP 192.168.1.6:47266;branch=z9hG4bK-524287-1---f832a0b0e8bfc82e
      qqqqqqqqqqwqqqqqqqqq          qqqqqqqqqqwqqqqqqqqqxCall-ID: 6sJbT8-22O6PVkcxXqnZzA..

13:15:32.510814 x SUBSCRIBE x xFrom: sip:[email protected];transport=udp;tag=ac5b4408
+0.000796 x qqqqqqqqqqqqqqqqqqqqqqqqqq> x xTo: sip:[email protected];transport=udp
13:15:32.511610 x 401 Unauthorized x xCSeq: 1 SUBSCRIBE
+0.126355 x <qqqqqqqqqqqqqqqqqqqqqqqqqq x xMax-Forwards: 70
13:15:32.637965 x SUBSCRIBE x xContact: sip:[email protected]:47266;transport=udp
+0.000572 x qqqqqqqqqqqqqqqqqqqqqqqqqq> x xExpires: 600
13:15:32.638537 x 489 Bad Event x xAccept: application/watcherinfo+xml
x <qqqqqqqqqqqqqqqqqqqqqqqqqq x xUser-Agent: Z 3.15.40006 rv2.8.20
x x xEvent: presence.winfo
x x xAllow-Events: presence,kpml,talk
x x xContent-Length: 0

This packet is not relevant to your issue.
At the Asterisk command prompt, type
pjsip set logger on
and make a test call in. The SIP trace will appear in the Asterisk log, along with the regular entries. Find the section covering the call, redact as desired, paste it at https://pastebin.freepbx.org and post the link here.

The most important thing to look for is the Contact header in the 200 OK response to the incoming INVITE. It should contain the public IP address of the PBX.

1 Like

@Stewart1

The extension being dial is 5136 and the extension from remote PBX who dial is extension 0354

here is the logs when the calls cut off after 30 seconds

https://pastebin.freepbx.org/view/b5421a72