B2BUA can edit SIP messages attributes?

My UAC seems to send a wrong SIP message with attribute:

a=recvonly

Any way to tell asterisk to edit the SIP message to a=sendrecv?

It seems very unlikely that a=recvonly is in error. Please provide the full protocol logs and the nature of the UAC.

Given that is not a likely error, I doubt Asterisk has any workarounds.

Being a B2BUA is not relevant here. Only Asterisk’s role as a UAS is relevant.

Thanks for teply, the UAC is a Dahua VTH, this device is bad, but vendor support is even worst: last year headquarters recognized the device is not SIP compliant but still sell it as is because: “not enought users reported problems to solve them”.

In this case if you call this VTH it establish a two way communications, but if it’s the VTH that call another one, it add this a=recvonly and result in one way comunication.

You didn’t mention this was only the video stream. I also note that there is what may be a re-INVITE. Are you sure that is not adding the other direction.

I was hoping to solve one problem at time, right now this device do:

  • one way audio call
  • after 2 seconds from answer it turn off the video

I attach a complete packet log of the call if it help (remove .txt to open with wireshark)

vth_call.pkt.txt (20.1 KB)

Based on the original screenshot, the audio offer is sendrecv. There is a problem though in that the video port number is unusable, as it conflicts with the implied RTCP port number for the audio stream. That might well break the audio.

You didn’t say you were using FreePBX. That may limit your options, although I don’t think there are any options for the brokeness that I see. I additionally noticed that it is is sending both recvonly and sendrecv, at the same time, for the same stream.

Generally we want to see the logs from Asterisk (pjsip set logger on, and verbose 5 or more), as the format is familiar and it gives an idea of how Asterisk is interpreting the situation.

Thanks for the informations, I’ve tried to see the rtcp on wireshark but it seems empty.

In the screenshot as far I understand video should use port 20001 and audio port 20000.

I’ve enabled asterisk debug:

rtcp set stats on
rtcp set debug on


RTCP Debugging Enabled
    -- Added contact 'sip:101@10.168.5.140:5060' to AOR '101' with expiration of 60 seconds
  == Contact 101/sip:101@10.168.5.140:5060 has been deleted
    -- Contact 101/sip:101@10.168.5.140:5060 is now Reachable.  RTT: 5.832 msec
  == Setting global variable 'SIPDOMAIN' to '10.168.5.130'
  == Using SIP RTP Audio TOS bits 184
  == Using SIP RTP Audio TOS bits 184 in TCLASS field.
  == Using SIP RTP Audio CoS mark 5
  == Using SIP RTP Video TOS bits 136
  == Using SIP RTP Video TOS bits 136 in TCLASS field.
  == Using SIP RTP Video CoS mark 4
    -- Executing [200@from-internal:1] GotoIf("PJSIP/101-00000062", "1?ext-local,200,1:followme-check,200,1") in new stack
    -- Goto (ext-local,200,1)
    -- Executing [200@ext-local:1] Set("PJSIP/101-00000062", "__RINGTIMER=15") in new stack
    -- Executing [200@ext-local:2] ExecIf("PJSIP/101-00000062", "0?Set(__CWIGNORE=)") in new stack
    -- Executing [200@ext-local:3] Macro("PJSIP/101-00000062", "exten-vm,novm,200,0,0,0") in new stack
    -- Executing [s@macro-exten-vm:1] Macro("PJSIP/101-00000062", "user-callerid,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("PJSIP/101-00000062", "TOUCH_MONITOR=1651877976.98") in new stack
    -- Executing [s@macro-user-callerid:2] Set("PJSIP/101-00000062", "AMPUSER=101") in new stack
    -- Executing [s@macro-user-callerid:3] Set("PJSIP/101-00000062", "HOTDESCKCHAN=101-00000062") in new stack
    -- Executing [s@macro-user-callerid:4] Set("PJSIP/101-00000062", "HOTDESKEXTEN=101") in new stack
    -- Executing [s@macro-user-callerid:5] Set("PJSIP/101-00000062", "HOTDESKCALL=0") in new stack
    -- Executing [s@macro-user-callerid:6] ExecIf("PJSIP/101-00000062", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [s@macro-user-callerid:7] ExecIf("PJSIP/101-00000062", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-user-callerid:8] GotoIf("PJSIP/101-00000062", "0?report") in new stack
    -- Executing [s@macro-user-callerid:9] ExecIf("PJSIP/101-00000062", "1?Set(REALCALLERIDNUM=101)") in new stack
    -- Executing [s@macro-user-callerid:10] Set("PJSIP/101-00000062", "AMPUSER=101") in new stack
    -- Executing [s@macro-user-callerid:11] GotoIf("PJSIP/101-00000062", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:12] Set("PJSIP/101-00000062", "AMPUSERCIDNAME=101 - PORTINERIA  UFFICI") in new stack
    -- Executing [s@macro-user-callerid:13] ExecIf("PJSIP/101-00000062", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [s@macro-user-callerid:14] GotoIf("PJSIP/101-00000062", "0?report") in new stack
    -- Executing [s@macro-user-callerid:15] Set("PJSIP/101-00000062", "AMPUSERCID=101") in new stack
    -- Executing [s@macro-user-callerid:16] Set("PJSIP/101-00000062", "__DIAL_OPTIONS=HhTtr") in new stack
    -- Executing [s@macro-user-callerid:17] Set("PJSIP/101-00000062", "CALLERID(all)="101 - PORTINERIA  UFFICI" <101>") in new stack
    -- Executing [s@macro-user-callerid:18] ExecIf("PJSIP/101-00000062", "0?Set(CUSDIAL=200)") in new stack
    -- Executing [s@macro-user-callerid:19] ExecIf("PJSIP/101-00000062", "0?Set(CALLERID(all)="101 - PORTINERIA  UFFICI" <101>)") in new stack
    -- Executing [s@macro-user-callerid:20] GotoIf("PJSIP/101-00000062", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:21] ExecIf("PJSIP/101-00000062", "0?Set(GROUP(concurrency_limit)=101)") in new stack
    -- Executing [s@macro-user-callerid:22] ExecIf("PJSIP/101-00000062", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@macro-user-callerid:23] NoOp("PJSIP/101-00000062", "Macro Depth is 2") in new stack
    -- Executing [s@macro-user-callerid:24] GotoIf("PJSIP/101-00000062", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,25)
    -- Executing [s@macro-user-callerid:25] GotoIf("PJSIP/101-00000062", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:26] ExecIf("PJSIP/101-00000062", "1?Set(__CALLEE_ACCOUNCODE=)") in new stack
    -- Executing [s@macro-user-callerid:27] Set("PJSIP/101-00000062", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:28] GotoIf("PJSIP/101-00000062", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,44)
    -- Executing [s@macro-user-callerid:44] Set("PJSIP/101-00000062", "CALLERID(number)=101") in new stack
    -- Executing [s@macro-user-callerid:45] Set("PJSIP/101-00000062", "CALLERID(name)=101 - PORTINERIA  UFFICI") in new stack
    -- Executing [s@macro-user-callerid:46] GotoIf("PJSIP/101-00000062", "0?cnum") in new stack
    -- Executing [s@macro-user-callerid:47] Set("PJSIP/101-00000062", "CDR(cnam)=101 - PORTINERIA  UFFICI") in new stack
    -- Executing [s@macro-user-callerid:48] Set("PJSIP/101-00000062", "CDR(cnum)=101") in new stack
    -- Executing [s@macro-user-callerid:49] Set("PJSIP/101-00000062", "CHANNEL(language)=it") in new stack
    -- Executing [s@macro-exten-vm:2] Set("PJSIP/101-00000062", "RingGroupMethod=none") in new stack
    -- Executing [s@macro-exten-vm:3] Set("PJSIP/101-00000062", "__EXTTOCALL=200") in new stack
    -- Executing [s@macro-exten-vm:4] Set("PJSIP/101-00000062", "__PICKUPMARK=200") in new stack
    -- Executing [s@macro-exten-vm:5] Set("PJSIP/101-00000062", "RT=") in new stack
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
    -- Executing [s@macro-exten-vm:6] ExecIf("PJSIP/101-00000062", "0?Macro(vm,novm,DIRECTDIAL,)") in new stack
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
    -- Executing [s@macro-exten-vm:7] ExecIf("PJSIP/101-00000062", "0?MacroExit()") in new stack
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
    -- Executing [s@macro-exten-vm:8] ExecIf("PJSIP/101-00000062", "0?Gosub(ext-intercom,*80200,1())") in new stack
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
    -- Executing [s@macro-exten-vm:9] ExecIf("PJSIP/101-00000062", "0?MacroExit()") in new stack
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
    -- Executing [s@macro-exten-vm:10] ExecIf("PJSIP/101-00000062", "0?ChanSpy(PJSIP/200,q)") in new stack
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
    -- Executing [s@macro-exten-vm:11] ExecIf("PJSIP/101-00000062", "0?MacroExit()") in new stack
[2022-05-07 00:59:36] WARNING[8553][C-00000035]: chan_sip.c:23279 func_header_read: This function can only be used on SIP channels.
    -- Executing [s@macro-exten-vm:12] ExecIf("PJSIP/101-00000062", "0?Macro(vm,novm,DIRECTDIAL,)") in new stack
    -- Executing [s@macro-exten-vm:13] ExecIf("PJSIP/101-00000062", "0?MacroExit()") in new stack
    -- Executing [s@macro-exten-vm:14] ExecIf("PJSIP/101-00000062", "0?Gosub(ext-intercom,*80200,1())") in new stack
    -- Executing [s@macro-exten-vm:15] ExecIf("PJSIP/101-00000062", "0?MacroExit()") in new stack
    -- Executing [s@macro-exten-vm:16] ExecIf("PJSIP/101-00000062", "0?ChanSpy(PJSIP/200,q)") in new stack
    -- Executing [s@macro-exten-vm:17] ExecIf("PJSIP/101-00000062", "0?MacroExit()") in new stack
    -- Executing [s@macro-exten-vm:18] Gosub("PJSIP/101-00000062", "sub-record-check,s,1(exten,200,dontcare)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("PJSIP/101-00000062", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("PJSIP/101-00000062", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("PJSIP/101-00000062", "NOW=1651877976") in new stack
    -- Executing [s@sub-record-check:4] Set("PJSIP/101-00000062", "__DAY=07") in new stack
    -- Executing [s@sub-record-check:5] Set("PJSIP/101-00000062", "__MONTH=05") in new stack
    -- Executing [s@sub-record-check:6] Set("PJSIP/101-00000062", "__YEAR=2022") in new stack
    -- Executing [s@sub-record-check:7] Set("PJSIP/101-00000062", "__TIMESTR=20220507-005936") in new stack
    -- Executing [s@sub-record-check:8] Set("PJSIP/101-00000062", "__FROMEXTEN=101") in new stack
    -- Executing [s@sub-record-check:9] Set("PJSIP/101-00000062", "__MON_FMT=wav") in new stack
    -- Executing [s@sub-record-check:10] NoOp("PJSIP/101-00000062", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("PJSIP/101-00000062", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("PJSIP/101-00000062", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("PJSIP/101-00000062", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("PJSIP/101-00000062", "5?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("PJSIP/101-00000062", "1?sub-record-check,exten,1") in new stack
    -- Goto (sub-record-check,exten,1)
    -- Executing [exten@sub-record-check:1] NoOp("PJSIP/101-00000062", "Exten Recording Check between 101 and 200") in new stack
    -- Executing [exten@sub-record-check:2] Set("PJSIP/101-00000062", "CALLTYPE=internal") in new stack
    -- Executing [exten@sub-record-check:3] ExecIf("PJSIP/101-00000062", "0?Set(CALLTYPE=)") in new stack
    -- Executing [exten@sub-record-check:4] Set("PJSIP/101-00000062", "CALLEE=dontcare") in new stack
    -- Executing [exten@sub-record-check:5] ExecIf("PJSIP/101-00000062", "0?Set(CALLEE=dontcare)") in new stack
    -- Executing [exten@sub-record-check:6] GotoIf("PJSIP/101-00000062", "0?callee") in new stack
    -- Executing [exten@sub-record-check:7] GotoIf("PJSIP/101-00000062", "1?caller") in new stack
    -- Goto (sub-record-check,exten,13)
    -- Executing [exten@sub-record-check:13] Set("PJSIP/101-00000062", "RECMODE=dontcare") in new stack
    -- Executing [exten@sub-record-check:14] ExecIf("PJSIP/101-00000062", "0?Set(RECMODE=dontcare)") in new stack
    -- Executing [exten@sub-record-check:15] ExecIf("PJSIP/101-00000062", "1?Set(RECMODE=dontcare)") in new stack
    -- Executing [exten@sub-record-check:16] Gosub("PJSIP/101-00000062", "recordcheck,1(dontcare,internal,200)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("PJSIP/101-00000062", "Starting recording check against dontcare") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("PJSIP/101-00000062", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [recordcheck@sub-record-check:3] Return("PJSIP/101-00000062", "") in new stack
    -- Executing [exten@sub-record-check:17] Return("PJSIP/101-00000062", "") in new stack
    -- Executing [s@macro-exten-vm:19] GotoIf("PJSIP/101-00000062", "1?macrodial") in new stack
    -- Goto (macro-exten-vm,s,25)
    -- Executing [s@macro-exten-vm:25] GosubIf("PJSIP/101-00000062", "0?clrheader,1()") in new stack
    -- Executing [s@macro-exten-vm:26] Macro("PJSIP/101-00000062", "dial-one,,HhTtr,200") in new stack
    -- Executing [s@macro-dial-one:1] Set("PJSIP/101-00000062", "DEXTEN=200") in new stack
    -- Executing [s@macro-dial-one:2] ExecIf("PJSIP/101-00000062", "0?Set(__EXTTOCALL=200)") in new stack
    -- Executing [s@macro-dial-one:3] Set("PJSIP/101-00000062", "DIALSTATUS_CW=") in new stack
    -- Executing [s@macro-dial-one:4] GosubIf("PJSIP/101-00000062", "0?screen,1()") in new stack
    -- Executing [s@macro-dial-one:5] GosubIf("PJSIP/101-00000062", "0?cf,1()") in new stack
    -- Executing [s@macro-dial-one:6] GotoIf("PJSIP/101-00000062", "1?skip1") in new stack
    -- Goto (macro-dial-one,s,9)
    -- Executing [s@macro-dial-one:9] GotoIf("PJSIP/101-00000062", "0?nodial") in new stack
    -- Executing [s@macro-dial-one:10] GotoIf("PJSIP/101-00000062", "0?continue") in new stack
    -- Executing [s@macro-dial-one:11] Set("PJSIP/101-00000062", "EXTHASCW=ENABLED") in new stack
    -- Executing [s@macro-dial-one:12] GotoIf("PJSIP/101-00000062", "0?next1:cwinusebusy") in new stack
    -- Goto (macro-dial-one,s,24)
    -- Executing [s@macro-dial-one:24] GotoIf("PJSIP/101-00000062", "0?next3:continue") in new stack
    -- Goto (macro-dial-one,s,26)
    -- Executing [s@macro-dial-one:26] GotoIf("PJSIP/101-00000062", "0?nodial") in new stack
    -- Executing [s@macro-dial-one:27] GosubIf("PJSIP/101-00000062", "1?dstring,1():dlocal,1()") in new stack
    -- Executing [dstring@macro-dial-one:1] Set("PJSIP/101-00000062", "DSTRING=") in new stack
    -- Executing [dstring@macro-dial-one:2] Set("PJSIP/101-00000062", "DEVICES=200") in new stack
    -- Executing [dstring@macro-dial-one:3] ExecIf("PJSIP/101-00000062", "0?Return()") in new stack
    -- Executing [dstring@macro-dial-one:4] ExecIf("PJSIP/101-00000062", "0?Set(DEVICES=00)") in new stack
    -- Executing [dstring@macro-dial-one:5] Set("PJSIP/101-00000062", "LOOPCNT=1") in new stack
    -- Executing [dstring@macro-dial-one:6] Set("PJSIP/101-00000062", "ITER=1") in new stack
    -- Executing [dstring@macro-dial-one:7] Set("PJSIP/101-00000062", "THISDIAL=PJSIP/200") in new stack
    -- Executing [dstring@macro-dial-one:8] GotoIf("PJSIP/101-00000062", "0?docheck") in new stack
    -- Executing [dstring@macro-dial-one:9] NoOp("PJSIP/101-00000062", "Debug: Found PJSIP Destination PJSIP/200") in new stack
    -- Executing [dstring@macro-dial-one:10] GotoIf("PJSIP/101-00000062", "0?doset") in new stack
    -- Executing [dstring@macro-dial-one:11] NoOp("PJSIP/101-00000062", "Debug: Updating PJSIP Destination with PJSIP_DIAL_CONTACTS") in new stack
    -- Executing [dstring@macro-dial-one:12] Set("PJSIP/101-00000062", "THISDIAL=PJSIP/200/sip:200@10.168.5.138:5062") in new stack
    -- Executing [dstring@macro-dial-one:13] ExecIf("PJSIP/101-00000062", "0?Set(DIALSTATUS=CHANUNAVAIL)") in new stack
    -- Executing [dstring@macro-dial-one:14] GotoIf("PJSIP/101-00000062", "0?skipset") in new stack
    -- Executing [dstring@macro-dial-one:15] Set("PJSIP/101-00000062", "DSTRING=PJSIP/200/sip:200@10.168.5.138:5062&") in new stack
    -- Executing [dstring@macro-dial-one:16] Set("PJSIP/101-00000062", "ITER=2") in new stack
    -- Executing [dstring@macro-dial-one:17] GotoIf("PJSIP/101-00000062", "0?begin") in new stack
    -- Executing [dstring@macro-dial-one:18] ExecIf("PJSIP/101-00000062", "0?Return()") in new stack
    -- Executing [dstring@macro-dial-one:19] Set("PJSIP/101-00000062", "DSTRING=PJSIP/200/sip:200@10.168.5.138:5062") in new stack
    -- Executing [dstring@macro-dial-one:20] Return("PJSIP/101-00000062", "") in new stack
    -- Executing [s@macro-dial-one:28] GotoIf("PJSIP/101-00000062", "0?nodial") in new stack
    -- Executing [s@macro-dial-one:29] GotoIf("PJSIP/101-00000062", "0?skiptrace") in new stack
    -- Executing [s@macro-dial-one:30] GosubIf("PJSIP/101-00000062", "1?ctset,1():ctclear,1()") in new stack
    -- Executing [ctset@macro-dial-one:1] Set("PJSIP/101-00000062", "DB(CALLTRACE/200)=101") in new stack
    -- Executing [ctset@macro-dial-one:2] Return("PJSIP/101-00000062", "") in new stack
    -- Executing [s@macro-dial-one:31] Set("PJSIP/101-00000062", "D_OPTIONS=HhTtr") in new stack
    -- Executing [s@macro-dial-one:32] GosubIf("PJSIP/101-00000062", "0?func-set-sipheader,s,1(Alert-Info,)") in new stack
    -- Executing [s@macro-dial-one:33] NoOp("PJSIP/101-00000062", "Blind Transfer: , Attended Transfer: , User: 101, Alert Info: ") in new stack
    -- Executing [s@macro-dial-one:34] ExecIf("PJSIP/101-00000062", "1?Set(ALERT_INFO=)") in new stack
    -- Executing [s@macro-dial-one:35] ExecIf("PJSIP/101-00000062", "0?Set(ALERT_INFO=)") in new stack
    -- Executing [s@macro-dial-one:36] ExecIf("PJSIP/101-00000062", "0?Set(ALERT_INFO=)") in new stack
    -- Executing [s@macro-dial-one:37] ExecIf("PJSIP/101-00000062", "0?Set(ALERT_INFO=Normal;volume=)") in new stack
    -- Executing [s@macro-dial-one:38] ExecIf("PJSIP/101-00000062", "0?Set(ALERT_INFO=Normal;volume=)") in new stack
    -- Executing [s@macro-dial-one:39] GosubIf("PJSIP/101-00000062", "0?func-set-sipheader,s,1(Alert-Info,)") in new stack
    -- Executing [s@macro-dial-one:40] ExecIf("PJSIP/101-00000062", "0?Set(CHANNEL(musicclass)=)") in new stack
    -- Executing [s@macro-dial-one:41] GosubIf("PJSIP/101-00000062", "0?qwait,1()") in new stack
    -- Executing [s@macro-dial-one:42] Set("PJSIP/101-00000062", "__CWIGNORE=") in new stack
    -- Executing [s@macro-dial-one:43] Set("PJSIP/101-00000062", "__KEEPCID=TRUE") in new stack
    -- Executing [s@macro-dial-one:44] GotoIf("PJSIP/101-00000062", "0?usegoto,1") in new stack
    -- Executing [s@macro-dial-one:45] GotoIf("PJSIP/101-00000062", "0?godial") in new stack
    -- Executing [s@macro-dial-one:46] Gosub("PJSIP/101-00000062", "sub-presencestate-display,s,1(200)") in new stack
    -- Executing [s@sub-presencestate-display:1] Goto("PJSIP/101-00000062", "state-not_set,1") in new stack
    -- Goto (sub-presencestate-display,state-not_set,1)
    -- Executing [state-not_set@sub-presencestate-display:1] Set("PJSIP/101-00000062", "PRESENCESTATE_DISPLAY=") in new stack
    -- Executing [state-not_set@sub-presencestate-display:2] Return("PJSIP/101-00000062", "") in new stack
    -- Executing [s@macro-dial-one:47] Set("PJSIP/101-00000062", "CONNECTEDLINE(name,i)=200 - CITOFONO DI TEST") in new stack
    -- Executing [s@macro-dial-one:48] Set("PJSIP/101-00000062", "CONNECTEDLINE(num)=200") in new stack
    -- Executing [s@macro-dial-one:49] Set("PJSIP/101-00000062", "D_OPTIONS=HhTtr") in new stack
    -- Executing [s@macro-dial-one:50] Macro("PJSIP/101-00000062", "dialout-one-predial-hook,") in new stack
    -- Executing [s@macro-dialout-one-predial-hook:1] MacroExit("PJSIP/101-00000062", "") in new stack
    -- Executing [s@macro-dial-one:51] ExecIf("PJSIP/101-00000062", "0?Set(D_OPTIONS=HhtrI)") in new stack
    -- Executing [s@macro-dial-one:52] ExecIf("PJSIP/101-00000062", "0?Set(CWRING=r(callwaiting)):Set(CWRING=)") in new stack
    -- Executing [s@macro-dial-one:53] NoOp("PJSIP/101-00000062", "") in new stack
    -- Executing [s@macro-dial-one:54] ExecIf("PJSIP/101-00000062", "0?Set(D_OPTIONS=HhTtrg)") in new stack
    -- Executing [s@macro-dial-one:55] Dial("PJSIP/101-00000062", "PJSIP/200/sip:200@10.168.5.138:5062,,HhTtrb(func-apply-sipheaders^s^1)") in new stack
    -- PJSIP/200-00000063 Internal Gosub(func-apply-sipheaders,s,1) start
    -- Executing [s@func-apply-sipheaders:1] NoOp("PJSIP/200-00000063", "Applying SIP Headers to channel PJSIP/200-00000063") in new stack
    -- Executing [s@func-apply-sipheaders:2] Set("PJSIP/200-00000063", "TECH=PJSIP") in new stack
    -- Executing [s@func-apply-sipheaders:3] Set("PJSIP/200-00000063", "SIPHEADERKEYS=") in new stack
    -- Executing [s@func-apply-sipheaders:4] While("PJSIP/200-00000063", "0") in new stack
    -- Jumping to priority 12
    -- Executing [s@func-apply-sipheaders:13] Return("PJSIP/200-00000063", "") in new stack
  == Spawn extension (from-internal, 200, 1) exited non-zero on 'PJSIP/200-00000063'
    -- PJSIP/200-00000063 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
    -- Called PJSIP/200/sip:200@10.168.5.138:5062
  == Using SIP RTP Audio TOS bits 184
  == Using SIP RTP Audio TOS bits 184 in TCLASS field.
  == Using SIP RTP Audio CoS mark 5
  == Using SIP RTP Video TOS bits 136
  == Using SIP RTP Video TOS bits 136 in TCLASS field.
  == Using SIP RTP Video CoS mark 4
    -- PJSIP/200-00000063 is ringing
    -- PJSIP/200-00000063 is ringing
       > 0x7f349801f500 -- Strict RTP learning after remote address set to: 10.168.5.138:11816
       > 0x7f349801b1a0 -- Strict RTP learning after remote address set to: 10.168.5.138:11818
    -- PJSIP/200-00000063 answered PJSIP/101-00000062
       > 0x7f34900248a0 -- Strict RTP learning after remote address set to: 10.168.5.140:20000
       > 0x7f34900e7720 -- Strict RTP learning after remote address set to: 10.168.5.140:20001
    -- Channel PJSIP/200-00000063 joined 'simple_bridge' basic-bridge <8fb8623a-ab85-4ced-b43c-4514568ad614>
    -- Channel PJSIP/101-00000062 joined 'simple_bridge' basic-bridge <8fb8623a-ab85-4ced-b43c-4514568ad614>
       > 0x7f349801b1a0 -- Strict RTP switching to RTP target address 10.168.5.138:11818 as source
       > 0x7f349801f500 -- Strict RTP switching to RTP target address 10.168.5.138:11816 as source
       > 0x7f34900e7720 -- Strict RTP switching to RTP target address 10.168.5.140:20001 as source
       > 0x7f34900248a0 -- Strict RTP learning after remote address set to: 10.168.5.140:20000
       > 0x7f34900248a0 -- Strict RTP switching to RTP target address 10.168.5.140:20000 as source
       > 0x7f349801f500 -- Strict RTP learning complete - Locking on source address 10.168.5.138:11816
       > 0x7f349801b1a0 -- Strict RTP learning complete - Locking on source address 10.168.5.138:11818
* Sent RTCP RR to 10.168.5.138:11819
   Our SSRC: 1078259941
   Report block:
     Their SSRC: 1004816822
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 489
     IA jitter: 2.3040
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
* Sent RTCP SR to 10.168.5.138:11817
   Our SSRC: 1801716922
   Sent(NTP): 1651877981.629403
   Sent(RTP): 23648
   Sent packets: 157
   Sent octets: 25120
   Report block:
     Their SSRC: 1591188525
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 3039
     IA jitter: 0.0215
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
* Sent RTCP SR to 10.168.5.140:20001
   Our SSRC: 1703045254
   Sent(NTP): 1651877981.629792
   Sent(RTP): 486080
   Sent packets: 269
   Sent octets: 43040
   Report block:
     Their SSRC: 1748335879
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 1680
     IA jitter: 0.0000
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
       > 0x7f34900248a0 -- Strict RTP learning complete - Locking on source address 10.168.5.140:20000
* Sent RTCP RR to 10.168.5.138:11819
   Our SSRC: 1078259941
   Report block:
     Their SSRC: 1004816822
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 998
     IA jitter: 1.4040
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
* Sent RTCP SR to 10.168.5.138:11817
   Our SSRC: 1801716922
   Sent(NTP): 1651877986.631528
   Sent(RTP): 60608
   Sent packets: 388
   Sent octets: 62080
   Report block:
     Their SSRC: 1591188525
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 3269
     IA jitter: 0.0216
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
* Sent RTCP SR to 10.168.5.140:20001
   Our SSRC: 1703045254
   Sent(NTP): 1651877986.631936
   Sent(RTP): 522880
   Sent packets: 499
   Sent octets: 79840
   Report block:
     Their SSRC: 1748335879
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 1911
     IA jitter: 0.0000
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
* Sent RTCP RR to 10.168.5.138:11819
   Our SSRC: 1078259941
   Report block:
     Their SSRC: 1004816822
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 1481
     IA jitter: 2.2880
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
* Sent RTCP SR to 10.168.5.138:11817
   Our SSRC: 1801716922
   Sent(NTP): 1651877991.629575
   Sent(RTP): 97568
   Sent packets: 619
   Sent octets: 99040
   Report block:
     Their SSRC: 1591188525
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 3501
     IA jitter: 0.0215
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
* Sent RTCP SR to 10.168.5.140:20001
   Our SSRC: 1703045254
   Sent(NTP): 1651877991.629770
   Sent(RTP): 560000
   Sent packets: 731
   Sent octets: 116960
   Report block:
     Their SSRC: 1748335879
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 2142
     IA jitter: 0.0000
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
* Sent RTCP RR to 10.168.5.138:11819
   Our SSRC: 1078259941
   Report block:
     Their SSRC: 1004816822
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 1990
     IA jitter: 2.3030
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
* Sent RTCP SR to 10.168.5.138:11817
   Our SSRC: 1801716922
   Sent(NTP): 1651877996.628985
   Sent(RTP): 134368
   Sent packets: 849
   Sent octets: 135840
   Report block:
     Their SSRC: 1591188525
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 3731
     IA jitter: 0.0215
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
* Sent RTCP SR to 10.168.5.140:20001
   Our SSRC: 1703045254
   Sent(NTP): 1651877996.632020
   Sent(RTP): 596800
   Sent packets: 961
   Sent octets: 153760
   Report block:
     Their SSRC: 1748335879
     Fraction lost: 0
     Cumulative loss: 0
     Highest seq no: 2372
     IA jitter: 0.0000
     Their last SR: 0
     DLSR: 0.0000 (sec)
 
    -- Channel PJSIP/200-00000063 left 'simple_bridge' basic-bridge <8fb8623a-ab85-4ced-b43c-4514568ad614>
    -- Channel PJSIP/101-00000062 left 'simple_bridge' basic-bridge <8fb8623a-ab85-4ced-b43c-4514568ad614>
  == Spawn extension (macro-dial-one, s, 55) exited non-zero on 'PJSIP/101-00000062' in macro 'dial-one'
  == Spawn extension (macro-exten-vm, s, 26) exited non-zero on 'PJSIP/101-00000062' in macro 'exten-vm'
  == Spawn extension (ext-local, 200, 3) exited non-zero on 'PJSIP/101-00000062'
    -- Executing [h@ext-local:1] Macro("PJSIP/101-00000062", "hangupcall,") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("PJSIP/101-00000062", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] ExecIf("PJSIP/101-00000062", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:4] NoOp("PJSIP/101-00000062", "PJSIP/200-00000063 montior file= ") in new stack
    -- Executing [s@macro-hangupcall:5] GotoIf("PJSIP/101-00000062", "1?skipagi") in new stack
    -- Goto (macro-hangupcall,s,7)
    -- Executing [s@macro-hangupcall:7] Hangup("PJSIP/101-00000062", "") in new stack
  == Spawn extension (macro-hangupcall, s, 7) exited non-zero on 'PJSIP/101-00000062' in macro 'hangupcall'
  == Spawn extension (ext-local, h, 1) exited non-zero on 'PJSIP/101-00000062'
    -- Added contact 'sip:101@10.168.5.140:5060' to AOR '101' with expiration of 60 seconds
  == Contact 101/sip:101@10.168.5.140:5060 has been deleted
    -- Contact 101/sip:101@10.168.5.140:5060 is now Reachable.  RTT: 11.134 msec

Freepbx is asterisk based, but if you see all this as “broken”, I believe my only option is to throw out the window dahua device.

Thank you, BR

Audio should use 20000, audio RTCP should use 20001. Video should use… whoops, conflict.

1 Like

But solutions that would work with pure asterisk may be difficult to apply without conflicting with the way in which FreePBX uses Asterisk.

Thanks for explanation, I’m tempted to try out bare asterisk, as freepbx got many features I don’t actually use.

Actually in freepbx I’ve found the same settings of asterisk: RTP Port Ranges START (10000) and END (30000).

May ask you last question, Is it the UAC that establish which ports to use?

Each side controls its own ports, and tells the other what it has chosen.

So if I cannot control this on each UAC I cannot do anything about it.