Internal call auto stopped after ~7 seconds

Guys, I really need your help, I dont know why my problem appear to me:

I have FreePBX server that register SIP trunk with Vonage, I success to:

  1. Create sip extension, because I can not make outoging call by pjsip, so I decided to use sip.
  2. Login into Zoipoer5 success
  3. Make call to my real number: 8439331xxxx, then I can see the incoming call from my phone
  4. After answer, I can hear the sound, but after ~7 seconds, my incoming call auto shut down in Iphone, after that I see into sngrep, I see the call state is still In call. I upload the content of it here:

Then here is all my asterisk log:

Connected to Asterisk 17.9.3 currently running on vedaxdev (pid = 238218)
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
       > 0x7f8e7c0a6b70 -- Strict RTP learning after remote address set to: 14.248.80.28:35858
    -- Executing [84393318881@from-internal:1] Macro("SIP/1000-000000ed", "user-callerid,LIMIT,EXTERNAL,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/1000-000000ed", "TOUCH_MONITOR=1713855867.1224") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/1000-000000ed", "CHANCONTEXT=") in new stack
    -- Executing [s@macro-user-callerid:3] Set("SIP/1000-000000ed", "CHANCONTEXT=") in new stack
    -- Executing [s@macro-user-callerid:4] Set("SIP/1000-000000ed", "CHANEXTENCONTEXT=1000-000000ed") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/1000-000000ed", "CHANEXTEN=1000-000000ed") in new stack
    -- Executing [s@macro-user-callerid:6] Set("SIP/1000-000000ed", "CALLERID(number)=1000") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/1000-000000ed", "AMPUSER=1000") in new stack
    -- Executing [s@macro-user-callerid:8] Set("SIP/1000-000000ed", "HOTDESCKCHAN=1000-000000ed") in new stack
    -- Executing [s@macro-user-callerid:9] Set("SIP/1000-000000ed", "HOTDESKEXTEN=1000") in new stack
    -- Executing [s@macro-user-callerid:10] Set("SIP/1000-000000ed", "HOTDESKCALL=0") in new stack
    -- Executing [s@macro-user-callerid:11] ExecIf("SIP/1000-000000ed", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [s@macro-user-callerid:12] ExecIf("SIP/1000-000000ed", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-user-callerid:13] GotoIf("SIP/1000-000000ed", "0?report") in new stack
    -- Executing [s@macro-user-callerid:14] ExecIf("SIP/1000-000000ed", "1?Set(REALCALLERIDNUM=1000)") in new stack
    -- Executing [s@macro-user-callerid:15] Set("SIP/1000-000000ed", "AMPUSER=1000") in new stack
    -- Executing [s@macro-user-callerid:16] GotoIf("SIP/1000-000000ed", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:17] Set("SIP/1000-000000ed", "AMPUSERCIDNAME=1000") in new stack
    -- Executing [s@macro-user-callerid:18] ExecIf("SIP/1000-000000ed", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [s@macro-user-callerid:19] GotoIf("SIP/1000-000000ed", "0?report") in new stack
    -- Executing [s@macro-user-callerid:20] Set("SIP/1000-000000ed", "AMPUSERCID=1000") in new stack
    -- Executing [s@macro-user-callerid:21] Set("SIP/1000-000000ed", "__DIAL_OPTIONS=HhTtr") in new stack
    -- Executing [s@macro-user-callerid:22] Set("SIP/1000-000000ed", "CALLERID(all)="1000" <1000>") in new stack
    -- Executing [s@macro-user-callerid:23] ExecIf("SIP/1000-000000ed", "0?Set(CUSDIAL=)") in new stack
    -- Executing [s@macro-user-callerid:24] ExecIf("SIP/1000-000000ed", "0?Set(CALLERID(all)="1000" <1000>)") in new stack
    -- Executing [s@macro-user-callerid:25] GotoIf("SIP/1000-000000ed", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:26] ExecIf("SIP/1000-000000ed", "1?Set(GROUP(concurrency_limit)=1000)") in new stack
    -- Executing [s@macro-user-callerid:27] ExecIf("SIP/1000-000000ed", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@macro-user-callerid:28] NoOp("SIP/1000-000000ed", "Macro Depth is 1") in new stack
    -- Executing [s@macro-user-callerid:29] GotoIf("SIP/1000-000000ed", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,30)
    -- Executing [s@macro-user-callerid:30] GotoIf("SIP/1000-000000ed", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,48)
    -- Executing [s@macro-user-callerid:48] Set("SIP/1000-000000ed", "CALLERID(number)=1000") in new stack
    -- Executing [s@macro-user-callerid:49] Set("SIP/1000-000000ed", "CALLERID(name)=1000") in new stack
    -- Executing [s@macro-user-callerid:50] GotoIf("SIP/1000-000000ed", "0?cnum") in new stack
    -- Executing [s@macro-user-callerid:51] Set("SIP/1000-000000ed", "CDR(cnam)=1000") in new stack
    -- Executing [s@macro-user-callerid:52] Set("SIP/1000-000000ed", "CDR(cnum)=1000") in new stack
    -- Executing [s@macro-user-callerid:53] Set("SIP/1000-000000ed", "CHANNEL(language)=en") in new stack
    -- Executing [84393318881@from-internal:2] Gosub("SIP/1000-000000ed", "sub-record-check,s,1(out,84393318881,dontcare)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("SIP/1000-000000ed", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("SIP/1000-000000ed", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("SIP/1000-000000ed", "NOW=1713855867") in new stack
    -- Executing [s@sub-record-check:4] Set("SIP/1000-000000ed", "__DAY=23") in new stack
    -- Executing [s@sub-record-check:5] Set("SIP/1000-000000ed", "__MONTH=04") in new stack
    -- Executing [s@sub-record-check:6] Set("SIP/1000-000000ed", "__YEAR=2024") in new stack
    -- Executing [s@sub-record-check:7] Set("SIP/1000-000000ed", "__TIMESTR=20240423-070427") in new stack
    -- Executing [s@sub-record-check:8] Set("SIP/1000-000000ed", "__FROMEXTEN=1000") in new stack
    -- Executing [s@sub-record-check:9] Set("SIP/1000-000000ed", "__MON_FMT=wav") in new stack
    -- Executing [s@sub-record-check:10] NoOp("SIP/1000-000000ed", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("SIP/1000-000000ed", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("SIP/1000-000000ed", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("SIP/1000-000000ed", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("SIP/1000-000000ed", "3?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("SIP/1000-000000ed", "1?sub-record-check,out,1") in new stack
    -- Goto (sub-record-check,out,1)
    -- Executing [out@sub-record-check:1] NoOp("SIP/1000-000000ed", "Outbound Recording Check from 1000 to 84393318881") in new stack
    -- Executing [out@sub-record-check:2] Set("SIP/1000-000000ed", "RECMODE=dontcare") in new stack
    -- Executing [out@sub-record-check:3] ExecIf("SIP/1000-000000ed", "1?Goto(routewins)") in new stack
    -- Goto (sub-record-check,out,7)
    -- Executing [out@sub-record-check:7] Gosub("SIP/1000-000000ed", "recordcheck,1(dontcare,out,84393318881)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("SIP/1000-000000ed", "Starting recording check against dontcare") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("SIP/1000-000000ed", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [recordcheck@sub-record-check:3] Return("SIP/1000-000000ed", "") in new stack
    -- Executing [out@sub-record-check:8] Return("SIP/1000-000000ed", "") in new stack
    -- Executing [84393318881@from-internal:3] Set("SIP/1000-000000ed", "_ROUTEID=7") in new stack
    -- Executing [84393318881@from-internal:4] Set("SIP/1000-000000ed", "_ROUTENAME=to-vonage") in new stack
    -- Executing [84393318881@from-internal:5] Set("SIP/1000-000000ed", "MOHCLASS=default") in new stack
    -- Executing [84393318881@from-internal:6] ExecIf("SIP/1000-000000ed", "0?Set(TRUNKCIDOVERRIDE=12085654999)") in new stack
    -- Executing [84393318881@from-internal:7] Set("SIP/1000-000000ed", "_CALLERIDNAMEINTERNAL=1000") in new stack
    -- Executing [84393318881@from-internal:8] Set("SIP/1000-000000ed", "_CALLERIDNUMINTERNAL=1000") in new stack
    -- Executing [84393318881@from-internal:9] Set("SIP/1000-000000ed", "_EMAILNOTIFICATION=FALSE") in new stack
    -- Executing [84393318881@from-internal:10] Set("SIP/1000-000000ed", "_NODEST=") in new stack
    -- Executing [84393318881@from-internal:11] Macro("SIP/1000-000000ed", "dialout-trunk,1,84393318881,,off") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("SIP/1000-000000ed", "DIAL_TRUNK=1") in new stack
    -- Executing [s@macro-dialout-trunk:2] ExecIf("SIP/1000-000000ed", "0?Set(DIAL_OPTIONS=Hhtr)") in new stack
    -- Executing [s@macro-dialout-trunk:3] GosubIf("SIP/1000-000000ed", "0?sub-pincheck,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:4] ExecIf("SIP/1000-000000ed", "0?Set(CALLERID(num)=1000)") in new stack
    -- Executing [s@macro-dialout-trunk:5] GotoIf("SIP/1000-000000ed", "0?disabletrunk,1") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("SIP/1000-000000ed", "DIAL_NUMBER=84393318881") in new stack
    -- Executing [s@macro-dialout-trunk:7] Set("SIP/1000-000000ed", "DIAL_TRUNK_OPTIONS=HhTtr") in new stack
    -- Executing [s@macro-dialout-trunk:8] Set("SIP/1000-000000ed", "OUTBOUND_GROUP=OUT_1") in new stack
    -- Executing [s@macro-dialout-trunk:9] Set("SIP/1000-000000ed", "DIAL_TRUNK_OPTIONS=T") in new stack
    -- Executing [s@macro-dialout-trunk:10] GotoIf("SIP/1000-000000ed", "1?nomax") in new stack
    -- Goto (macro-dialout-trunk,s,12)
    -- Executing [s@macro-dialout-trunk:12] GotoIf("SIP/1000-000000ed", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:13] Macro("SIP/1000-000000ed", "outbound-callerid,1") in new stack
    -- Executing [s@macro-outbound-callerid:1] NoOp("SIP/1000-000000ed", "1000") in new stack
    -- Executing [s@macro-outbound-callerid:2] NoOp("SIP/1000-000000ed", "") in new stack
    -- Executing [s@macro-outbound-callerid:3] NoOp("SIP/1000-000000ed", "off") in new stack
    -- Executing [s@macro-outbound-callerid:4] ExecIf("SIP/1000-000000ed", "0?Set(CALLERPRES(name-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:5] ExecIf("SIP/1000-000000ed", "0?Set(CALLERPRES(num-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:6] Set("SIP/1000-000000ed", "HOTDESCKCHAN=1000-000000ed") in new stack
    -- Executing [s@macro-outbound-callerid:7] Set("SIP/1000-000000ed", "HOTDESKEXTEN=1000") in new stack
    -- Executing [s@macro-outbound-callerid:8] Set("SIP/1000-000000ed", "HOTDESKCALL=0") in new stack
    -- Executing [s@macro-outbound-callerid:9] ExecIf("SIP/1000-000000ed", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [s@macro-outbound-callerid:10] ExecIf("SIP/1000-000000ed", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-outbound-callerid:11] Set("SIP/1000-000000ed", "ALLOWTHISROUTE=NO") in new stack
    -- Executing [s@macro-outbound-callerid:12] ExecIf("SIP/1000-000000ed", "0?Set(ALLOWTHISROUTE=YES)") in new stack
    -- Executing [s@macro-outbound-callerid:13] ExecIf("SIP/1000-000000ed", "0?Hangup()") in new stack
    -- Executing [s@macro-outbound-callerid:14] ExecIf("SIP/1000-000000ed", "0?Set(REALCALLERIDNUM=1000)") in new stack
    -- Executing [s@macro-outbound-callerid:15] ExecIf("SIP/1000-000000ed", "0?Set(AMPUSER=1000)") in new stack
    -- Executing [s@macro-outbound-callerid:16] GotoIf("SIP/1000-000000ed", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,20)
    -- Executing [s@macro-outbound-callerid:20] Set("SIP/1000-000000ed", "USEROUTCID=1000") in new stack
    -- Executing [s@macro-outbound-callerid:21] Set("SIP/1000-000000ed", "EMERGENCYCID=1000") in new stack
    -- Executing [s@macro-outbound-callerid:22] ExecIf("SIP/1000-000000ed", "0?Set(EMERGENCYCID=)") in new stack
    -- Executing [s@macro-outbound-callerid:23] Set("SIP/1000-000000ed", "TRUNKOUTCID=111") in new stack
    -- Executing [s@macro-outbound-callerid:24] GotoIf("SIP/1000-000000ed", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,30)
    -- Executing [s@macro-outbound-callerid:30] ExecIf("SIP/1000-000000ed", "1?Set(CALLERID(all)=111)") in new stack
    -- Executing [s@macro-outbound-callerid:31] ExecIf("SIP/1000-000000ed", "1?Set(CALLERID(all)=1000)") in new stack
    -- Executing [s@macro-outbound-callerid:32] ExecIf("SIP/1000-000000ed", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:33] ExecIf("SIP/1000-000000ed", "0?Set(CALLERID(all)=1000)") in new stack
    -- Executing [s@macro-outbound-callerid:34] ExecIf("SIP/1000-000000ed", "0?Set(CALLERID(all)=1000)") in new stack
    -- Executing [s@macro-outbound-callerid:35] Set("SIP/1000-000000ed", "TIOHIDE=no") in new stack
    -- Executing [s@macro-outbound-callerid:36] ExecIf("SIP/1000-000000ed", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:37] ExecIf("SIP/1000-000000ed", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:38] ExecIf("SIP/1000-000000ed", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:39] ExecIf("SIP/1000-000000ed", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:40] Set("SIP/1000-000000ed", "CDR(outbound_cnum)=1000") in new stack
    -- Executing [s@macro-outbound-callerid:41] Set("SIP/1000-000000ed", "CDR(outbound_cnam)=") in new stack
    -- Executing [s@macro-dialout-trunk:14] GosubIf("SIP/1000-000000ed", "1?sub-flp-1,s,1()") in new stack
    -- Executing [s@sub-flp-1:1] ExecIf("SIP/1000-000000ed", "0?Return()") in new stack
    -- Executing [s@sub-flp-1:2] ExecIf("SIP/1000-000000ed", "0?Return()") in new stack
    -- Executing [s@sub-flp-1:3] Return("SIP/1000-000000ed", "") in new stack
    -- Executing [s@macro-dialout-trunk:15] Set("SIP/1000-000000ed", "OUTNUM=84393318881") in new stack
    -- Executing [s@macro-dialout-trunk:16] Set("SIP/1000-000000ed", "custom=SIP/vonage") in new stack
    -- Executing [s@macro-dialout-trunk:17] ExecIf("SIP/1000-000000ed", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
    -- Executing [s@macro-dialout-trunk:18] ExecIf("SIP/1000-000000ed", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
    -- Executing [s@macro-dialout-trunk:19] Macro("SIP/1000-000000ed", "dialout-trunk-predial-hook,") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/1000-000000ed", "") in new stack
    -- Executing [s@macro-dialout-trunk:20] GotoIf("SIP/1000-000000ed", "0?bypass,1") in new stack
    -- Executing [s@macro-dialout-trunk:21] ExecIf("SIP/1000-000000ed", "1?Set(CONNECTEDLINE(num,i)=84393318881)") in new stack
    -- Executing [s@macro-dialout-trunk:22] ExecIf("SIP/1000-000000ed", "1?Set(CONNECTEDLINE(name,i)=CID:1000)") in new stack
    -- Executing [s@macro-dialout-trunk:23] ExecIf("SIP/1000-000000ed", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)1000)") in new stack
    -- Executing [s@macro-dialout-trunk:24] GotoIf("SIP/1000-000000ed", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:25] ExecIf("SIP/1000-000000ed", "0?Set(DIAL_TRUNK_OPTIONS=)") in new stack
    -- Executing [s@macro-dialout-trunk:26] Set("SIP/1000-000000ed", "HASH(__SIPHEADERS,Alert-Info)=unset") in new stack
    -- Executing [s@macro-dialout-trunk:27] Dial("SIP/1000-000000ed", "SIP/vonage/84393318881,300,Tb(func-apply-sipheaders^s^1,(1))U(sub-send-obroute-email^84393318881^84393318881^1^1713855867^^1000)") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- SIP/vonage-000000ee Internal Gosub(func-apply-sipheaders,s,1(1)) start
    -- Executing [s@func-apply-sipheaders:1] NoOp("SIP/vonage-000000ee", "Applying SIP Headers to channel SIP/vonage-000000ee") in new stack
    -- Executing [s@func-apply-sipheaders:2] Set("SIP/vonage-000000ee", "TECH=SIP") in new stack
    -- Executing [s@func-apply-sipheaders:3] Set("SIP/vonage-000000ee", "SIPHEADERKEYS=Alert-Info") in new stack
    -- Executing [s@func-apply-sipheaders:4] While("SIP/vonage-000000ee", "1") in new stack
    -- Executing [s@func-apply-sipheaders:5] Set("SIP/vonage-000000ee", "sipheader=unset") in new stack
    -- Executing [s@func-apply-sipheaders:6] ExecIf("SIP/vonage-000000ee", "1?SIPRemoveHeader(Alert-Info:)") in new stack
    -- Executing [s@func-apply-sipheaders:7] ExecIf("SIP/vonage-000000ee", "0?Set(PJSIP_HEADER(remove,Alert-Info)=)") in new stack
    -- Executing [s@func-apply-sipheaders:8] ExecIf("SIP/vonage-000000ee", "0?Set(sipheader=<http://127.0.0.1>;info=unset)") in new stack
    -- Executing [s@func-apply-sipheaders:9] ExecIf("SIP/vonage-000000ee", "0?Set(sipheader=<http://127.0.0.1>unset)") in new stack
    -- Executing [s@func-apply-sipheaders:10] ExecIf("SIP/vonage-000000ee", "0?SIPAddHeader(Alert-Info:unset)") in new stack
    -- Executing [s@func-apply-sipheaders:11] ExecIf("SIP/vonage-000000ee", "0?Set(PJSIP_HEADER(add,Alert-Info)=unset)") in new stack
    -- Executing [s@func-apply-sipheaders:12] EndWhile("SIP/vonage-000000ee", "") in new stack
    -- Executing [s@func-apply-sipheaders:4] While("SIP/vonage-000000ee", "0") in new stack
    -- Executing [s@func-apply-sipheaders:13] Return("SIP/vonage-000000ee", "") in new stack
  == Spawn extension (nexmo, 84393318881, 1) exited non-zero on 'SIP/vonage-000000ee'
    -- SIP/vonage-000000ee Internal Gosub(func-apply-sipheaders,s,1(1)) complete GOSUB_RETVAL=
    -- Called SIP/vonage/84393318881
       > 0x7f8eb4039bb0 -- Strict RTP learning after remote address set to: 192.168.1.1:7076
    -- SIP/vonage-000000ee is making progress passing it to SIP/1000-000000ed
       > 0x7f8e7c0a6b70 -- Strict RTP qualifying stream type: audio
       > 0x7f8e7c0a6b70 -- Strict RTP switching source address to 192.168.1.3:35858
       > 0x7f8eb4039bb0 -- Strict RTP switching to RTP target address 192.168.1.1:7076 as source
       > 0x7f8e7c0a6b70 -- Strict RTP learning complete - Locking on source address 192.168.1.3:35858
    -- SIP/vonage-000000ee answered SIP/1000-000000ed
    -- SIP/vonage-000000ee Internal Gosub(sub-send-obroute-email,s,1(84393318881,84393318881,1,1713855867,,1000)) start
    -- Executing [s@sub-send-obroute-email:1] GotoIf("SIP/vonage-000000ee", "0?sendEmail") in new stack
    -- Executing [s@sub-send-obroute-email:2] NoOp("SIP/vonage-000000ee", "email notifications disabled..exiting.") in new stack
    -- Executing [s@sub-send-obroute-email:3] Return("SIP/vonage-000000ee", "") in new stack
  == Spawn extension (nexmo, , 1) exited non-zero on 'SIP/vonage-000000ee'
    -- SIP/vonage-000000ee Internal Gosub(sub-send-obroute-email,s,1(84393318881,84393318881,1,1713855867,,1000)) complete GOSUB_RETVAL=
    -- Channel SIP/vonage-000000ee joined 'simple_bridge' basic-bridge <150b2180-4056-4859-a66e-455368676fa4>
    -- Channel SIP/1000-000000ed joined 'simple_bridge' basic-bridge <150b2180-4056-4859-a66e-455368676fa4>
       > 0x7f8eb4039bb0 -- Strict RTP learning complete - Locking on source address 192.168.1.1:7076
[2024-04-23 07:05:11] NOTICE[238279]: chan_sip.c:29981 check_rtp_timeout: Disconnecting call 'SIP/vonage-000000ee' for lack of RTP activity in 31 seconds
    -- Channel SIP/vonage-000000ee left 'simple_bridge' basic-bridge <150b2180-4056-4859-a66e-455368676fa4>
    -- Channel SIP/1000-000000ed left 'simple_bridge' basic-bridge <150b2180-4056-4859-a66e-455368676fa4>
  == Spawn extension (macro-dialout-trunk, s, 27) exited non-zero on 'SIP/1000-000000ed' in macro 'dialout-trunk'
  == Spawn extension (from-internal, 84393318881, 11) exited non-zero on 'SIP/1000-000000ed'
    -- Executing [h@from-internal:1] Macro("SIP/1000-000000ed", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("SIP/1000-000000ed", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] ExecIf("SIP/1000-000000ed", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:4] Hangup("SIP/1000-000000ed", "") in new stack
  == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/1000-000000ed' in macro 'hangupcall'
  == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/1000-000000ed'

I got hang up after a fews time when iphone auto turn off the call
Below is my sip setting:

We’ll make a couple of attempts to fix this, otherwise we should switch back to pjsip, which is generally easier to configure and debug.

In Asterisk SIP Settings, chan_sip tat, set IP Configuration to Static IP. If Override External IP does not show correctly, input your public IPv4 address there. After Submit and Apply Config, you must restart Asterisk.

If you still have trouble, as the Asterisk command prompt, type
sip set debug on
make a failing test call, paste the Asterisk log for the call at pastebin.com and post the link here.
If possible, take the log from /var/log/asterisk/full, rather than scraping the console output.

Also, is your PBX in Idaho, Vietnam, or somewhere else?

1 Like

Hi there, thanks you for give me the light when I stucking with this :slight_smile:

I tried to change IP Configuration to Static IP + sip set debug on, then make the call again, this problem still appear, i created the log here, thanks you a lots

Here is asterisk -rvvv full log for the call:
https://pastebin.freepbx.org/view/f4b09228

Here is the /var/log/asterisk/full log( too large so I zipped from .text file, and modify extension to tgz)

freepbx call error.tgz (1.1 MB)

My PBX in VietNam bro, this is just a test PBX, if you want to check I can give you the link of PBX and admin info, please help me, thanks you so much

The pastebin link gives a 404 error, but I was able to read the Asterisk log attachment ok.

I don’t understand why your Asterisk is still showing its 192.168.1.7 private IP in the Via and Contact headers – do you have anything related to NAT in the trunk config? Or something strange in Asterisk SIP Settings?

However, since the REGISTER request also shows a private IP in Contact (which the provider would be unable to reach), I made a test call to see how it would be handled and was surprised that it worked ok.

So I suspect that you have a SIP ALG in your router/firewall, which might be causing the problem on outgoing calls. Make/model? Any VoIP-related settings? Does it have any settings related to SIP?

Also, what went wrong when you tried to set up the trunk with pjsip? That might also be ALG related?

1 Like

You need to explain what the addresses represent in your wireshark/sngrep, but 192.168.1.1 is typically used for routers, and typically should not be seen. In any case, it has come from the OK form 216.147.3.1, which you have not provided to us.

I would say 192.168.1.1. has a broken SIP Appliation Level Gateway. Most of these are broken and they should be disabled.

1 Like

Hi, thanks you, I not good at speaking and listening English, so when you talk to me I can not hear all your voices, the call from number → my PBX work ok, the problem is only call from PBX to realnumber

I have a window at 192.168.1.7, which deployed Asterisk here(using ubuntu). I dont know why 192.168.1.7 is private IP because I just learning PBX using youtube tutorial. And in this window, I clear all thing that related to firewall:

  1. Turn off ufw
  2. Clear all about iptables chain rules
  3. Clear all about fail2ban
    About SIP + NAT setting, I give the picture above in the first questions. Feel free to ask me everything if I do it wrong please.

I will explain why I need to use sip instead of pjsip below:

  1. I am use Vonage provide to register SIP trunking, this required exactly my extension SIP endpoint to forward the call to this SIP address. eg: If I have pjsip extension like this:
  2. Before that, I tried to use pjsip information to forward the call, eg: sip:[email protected], but it’s never working, if I changed to sip:[email protected]:yyyyyy like above, it’s work. But the problem is each time I register this 1000 extension, the port result changed dynamic, so each time register, I need to change the SIP address to forward the call → I dont want this, I need static SIP address
  3. OK, now when I switch to using chan_sip, with the same information( 1000/1000). I can forward the call with statis address: sip:[email protected], that is the reason I am using sip instead of pjsip

I am very happy when getting your help, can I give you the FreePBX address + login information for better check? I still stucking with this and can not find solution, so please help me thanks you. I gave you information with message now

Hi @david55, 216.147.3.1 is the IP of the SIP trunking provider, mean sip.nexmo.com, I can give you the PBX information to check this.

I would say 192.168.1.1. has a broken SIP Appliation Level Gateway. Most of these are broken and they should be disabled.
→ I build the PBX system inside the window machine, which IP address local: 192.168.1.7, because I am using ssh to login into this. Can you provide me what I need to do now? I still dont know it because I just learning about FreePBX + Asterisk :), thanks so much

I explained the image in first question
192.168.1.7: IP of the window which installed PBX
216.147.3.1: IP of SIP trunk provider
192.168.1.1: IP of my Zoiper5

The SIP trunk provider is sending a contact header pointing to a private address, or the router between you and the provider has a SIP ALG problem.

I would definitely get chan_pjsip working as I’m more confident about what has to be done to work round broken Contact headers for that, and I think FreePBX has the work around enabled by default.

In any case, the full contents of the OK, from the provider, is really needed, to try to understand why you are being given the wrong contact address.

1 Like

Hi, as I explain before, I can not get pjsip to work with my trunk provider, as below:
I am use Vonage provide to register SIP trunking, this required exactly my extension SIP endpoint to forward the call to this SIP address. eg: If I have pjsip extension like this:

username-password: 1000-1000
address: asterisk.xxx.xx

  • When registered success thoughr Janus SIP(Janus WebRTC Server (multistream): SIP Gateway Demo), I will get the sip address inside asterisk -rvvv pjsip show endpoints: sip:[email protected]:yyyyyy, while xxx… is janus.conf.meetecho.com IP , address, then yyyyy is random port*

  • Before that, I tried to use pjsip information to forward the call, eg: sip:[email protected], but it’s never working, if I changed to sip:[email protected]:yyyyyy like above, it’s work. But the problem is each time I register this 1000 extension, the port result changed dynamic, so each time register, I need to change the SIP address to forward the call → I dont want this, I need static SIP address*

  • OK, now when I switch to using chan_sip, with the same information( 1000/1000). I can forward the call with statis address: sip:[email protected], that is the reason I am using sip instead of pjsip*

That’s all the step that take me to use sip instead of pjsip, if you have another way to make pjsip work, please help me, thanks you.
About ALG problem, i dont know how to detect/solve this? Can you give me some tutorial? Thanks

Read the router manual. Try to work out what they call SIP ALG. Turn it off in the router.

However having the full contents of the 200 OK message will help people judge whether that is the real problem, or whether the provider is broken.

Thanks I will check this :slight_smile:

Sending an OPTIONS request to nexmo server from here, it does correctly return a received tag in the Via header, which is missing when seen by your PBX. That makes it quite certain that a SIP ALG has corrupted the traffic. What is the make/model of your router/firewall?

1 Like

Hmm, sorry I forgot the FreePBX build on Docker with --net=host, do you think it’s cause SIP ALG?

And about the make/model of router/firewall, I will check it at next day of work.

Didn’t somebody already respond to you in another thread that using docker for this is going to lead to all sorts of problems?

1 Like

No, I just face this problem now, before that with Docker I face other problem, but now it’s solved