FreePBX to FreePBX - SIP Trunk Call Recording Not Working

I have two FreePBX boxes peered together with a SIP trunk but call recording does not work. Can someone direct me to how I might enable this?

What recording options are you using?

Hi Dave. In the Call Recording module I set destination as the SIP trunk and Choose Force as recording mode.

If it helps, here is the PEER details for the SIP trunk:

type=friend
trunk=yes
qualify=yes
nat=never
host=XXXXXXXXXX
dtmfmode=rfc2833
disallow=all
context=from-internal
allow=g722&ulaw&alaw
accountcode=XXXXXXXXX

FreePBX 15.0.16.51
Asterisk 16.6.2

I saw another thread suggesting adding this into extensions_custom file:

[macro-trnk-record]
exten => s,1,MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MIXMON_FORMAT},a,${MIXMON_POST})
exten => s,n,Set(__MON_FMT=${IF($["${MIXMON_FORMAT}"="wav49"]?WAV:${MIXMON_FORMAT})})
exten => s,n,Set(__REC_STATUS=INITIALIZED)
exten => s,n,Set(NOW=${EPOCH})
exten => s,n,Set(__DAY=${STRFTIME(${NOW},,%d)})
exten => s,n,Set(__MONTH=${STRFTIME(${NOW},,%m)})
exten => s,n,Set(__YEAR=${STRFTIME(${NOW},,%Y)})
exten => s,n,Set(__TIMESTR=${YEAR}${MONTH}${DAY}-${STRFTIME(${NOW},,%H%M%S)})
exten => s,n,Set(__FROMEXTEN=${IF($[${LEN(${AMPUSER})}]?${AMPUSER}:${IF($[${LEN(${REALCALLERIDNUM})}]?${REALCALLERIDNUM}:unknown)})})
exten => s,n,Set(__CALLFILENAME=${ARG1}-${ARG2}-${FROMEXTEN}-${TIMESTR}-${UNIQUEID})
exten => s,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => s,n,Set(MONITOR_FILENAME=${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME})
exten => s,n,MixMonitor(${MONITOR_FILENAME}.${MIXMON_FORMAT},${MONITOR_OPTIONS},${MIXMON_POST})
exten => s,n,Set(__REC_STATUS=RECORDING)
exten => s,n,Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT})
exten => s,n,MacroExit()

However, I’m unsure how to call upon this from my SIP trunk settings.

I don’t see how that’s going to help you.

If you were going to do this, you’d set the Trunk ‘context’ to this context. Remember, the context setting is only useful for incoming calls.

On the advanced settings in the Outbound Route, you’ll find “Call Recording”, you should set the recording options to “Force”. This will record everything going through that outbound route.

On the advanced settings in the Outbound Route, you’ll find “Call Recording”, you should set the recording options to “Force”. This will record everything going through that outbound route.

Thanks - that helped with outgoing calls from the second PBX to the first PBX, however I’m still not able to record calls routed from first PBX to second PBX. Any ideas on this one? Note that I’m trying to implement all call recordings only on first PBX.

I’m not going to spend the next week guessing. You’ve provided almost no information in your original request and now you’re saying “Nope - guess again”. That’s the point where I stop helping.

1 Like

Jeez, didnt need to be so rude about it. I wasn’t trying to be an asshole, Dave…

What other information WOULD help other than the fact, it is not recording?

  • the setup is a simple SIP peering trunk fro one PBX to the other, no authentication.

  • calls being routed from box 1 to box 2 dont seem to get recorded, but calls from box 2 to box 1 now do get recorded after enabling the call recording option you suggested in outbound route advanced options.

  • I have enabled all the call recording options I can find relating to the trunk so I’m a little stuck in the water here.

If you could be more specific as to what would be useful to know I would be happy to oblige.

https://wiki.freepbx.org/display/SUP/Providing+Great+Debug is always a good start.

Show us what you are seeing in the logs and help us understand how your system is currently configured. From there, we can piece together likely courses of action that may be able to solve your problem. Specifically, we will need to see what happens with a call (from the ‘full’ log) when the recording should be getting kicked off.

Thanks Dave - more information as requested.

  • Below is the call trace, inbound DID 6467775070 coming in from our upstream trunk of VOYAGER-AKL, being sent directly out another SIP trunk CUSTOMER-RURALWIRELESS.

[May 5 10:18:30] == Using SIP RTP TOS bits 184
[May 5 10:18:30] == Using SIP RTP CoS mark 5
[May 5 10:18:30] – Executing [6467775070@from-trunk:1] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__DIRECTION=INBOUND”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:2] Gosub(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “sub-record-check,s,1(in,6467775070,dontcare)”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:1] GotoIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “0?initialized”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:2] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__REC_STATUS=INITIALIZED”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:3] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “NOW=1588630710”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:4] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__DAY=05”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:5] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__MONTH=05”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:6] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__YEAR=2020”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:7] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__TIMESTR=20200505-101830”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:8] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__FROMEXTEN=unknown”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:9] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__MON_FMT=wav”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:10] NoOp(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “Recordings initialized”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:11] ExecIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “0?Set(ARG3=dontcare)”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:12] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “REC_POLICY_MODE_SAVE=”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:13] ExecIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “0?Set(REC_STATUS=NO)”) in new stack
[May 5 10:18:30] – Executing [s@sub-record-check:14] GotoIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “2?checkaction”) in new stack
[May 5 10:18:30] – Goto (sub-record-check,s,17)
[May 5 10:18:30] – Executing [s@sub-record-check:17] GotoIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “1?sub-record-check,in,1”) in new stack
[May 5 10:18:30] – Goto (sub-record-check,in,1)
[May 5 10:18:30] – Executing [in@sub-record-check:1] NoOp(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “Inbound Recording Check to 6467775070”) in new stack
[May 5 10:18:30] – Executing [in@sub-record-check:2] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “FROMEXTEN=unknown”) in new stack
[May 5 10:18:30] – Executing [in@sub-record-check:3] ExecIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “9?Set(FROMEXTEN=063554182)”) in new stack
[May 5 10:18:30] – Executing [in@sub-record-check:4] Gosub(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “recordcheck,1(dontcare,in,6467775070)”) in new stack
[May 5 10:18:30] – Executing [recordcheck@sub-record-check:1] NoOp(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “Starting recording check against dontcare”) in new stack
[May 5 10:18:30] – Executing [recordcheck@sub-record-check:2] Goto(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “dontcare”) in new stack
[May 5 10:18:30] – Goto (sub-record-check,recordcheck,3)
[May 5 10:18:30] – Executing [recordcheck@sub-record-check:3] Return(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “”) in new stack
[May 5 10:18:30] – Executing [in@sub-record-check:5] Return(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:3] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “CHANNEL(tonezone)=nz”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:4] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__FROM_DID=6467775070”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:5] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “CDR(did)=6467775070”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:6] ExecIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “0 ?Set(CALLERID(name)=063554182)”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:7] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__MOHCLASS=”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:8] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__REVERSAL_REJECT=FALSE”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:9] GotoIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “1?post-reverse-charge”) in new stack
[May 5 10:18:30] – Goto (from-trunk,6467775070,11)
[May 5 10:18:30] – Executing [6467775070@from-trunk:11] NoOp(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:12] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__CALLINGNAMEPRES_SV=allowed_not_screened”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:13] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “__CALLINGNUMPRES_SV=allowed_not_screened”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:14] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “CALLERID(name-pres)=allowed_not_screened”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:15] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “CALLERID(num-pres)=allowed_not_screened”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:16] NoOp(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “CallerID Entry Point”) in new stack
[May 5 10:18:30] – Executing [6467775070@from-trunk:17] Goto(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “ext-trunk,15,1”) in new stack
[May 5 10:18:30] – Goto (ext-trunk,15,1)
[May 5 10:18:30] – Executing [15@ext-trunk:1] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “TDIAL_STRING=SIP/CUSTOMER-RURALWIRELESS”) in new stack
[May 5 10:18:30] – Executing [15@ext-trunk:2] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “DIAL_TRUNK=15”) in new stack
[May 5 10:18:30] – Executing [15@ext-trunk:3] Goto(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “ext-trunk,tdial,1”) in new stack
[May 5 10:18:30] – Goto (ext-trunk,tdial,1)
[May 5 10:18:30] – Executing [tdial@ext-trunk:1] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “OUTBOUND_GROUP=OUT_15”) in new stack
[May 5 10:18:30] – Executing [tdial@ext-trunk:2] GotoIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “1?nomax”) in new stack
[May 5 10:18:30] – Goto (ext-trunk,tdial,4)
[May 5 10:18:30] – Executing [tdial@ext-trunk:4] ExecIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “1?Set(CALLERPRES(name-pres)=allowed_not_screened)”) in new stack
[May 5 10:18:30] – Executing [tdial@ext-trunk:5] ExecIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “1?Set(CALLERPRES(num-pres)=allowed_not_screened)”) in new stack
[May 5 10:18:30] – Executing [tdial@ext-trunk:6] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “DIAL_NUMBER=6467775070”) in new stack
[May 5 10:18:30] – Executing [tdial@ext-trunk:7] GosubIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “0?sub-flp-15,s,1()”) in new stack
[May 5 10:18:30] – Executing [tdial@ext-trunk:8] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “OUTNUM=6467775070”) in new stack
[May 5 10:18:30] – Executing [tdial@ext-trunk:9] Set(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “DIAL_TRUNK_OPTIONS=Ttr”) in new stack
[May 5 10:18:30] – Executing [tdial@ext-trunk:10] Dial(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “SIP/CUSTOMER-RURALWIRELESS/6467775070,300,Ttr”) in new stack
[May 5 10:18:30] == Using SIP RTP TOS bits 184
[May 5 10:18:30] == Using SIP RTP CoS mark 5
[May 5 10:18:30] – Called SIP/CUSTOMER-RURALWIRELESS/6467775070
[May 5 10:18:30] – SIP/UPSTREAM-VOYAGER-RIC-00005b48 is ringing
[May 5 10:18:30] – SIP/CUSTOMER-RURALWIRELESS-00005b4a answered SIP/UPSTREAM-VOYAGER-AKL-00005b49
[May 5 10:18:30] – Channel SIP/CUSTOMER-RURALWIRELESS-00005b4a joined ‘simple_bridge’ basic-bridge
[May 5 10:18:30] – Channel SIP/UPSTREAM-VOYAGER-AKL-00005b49 joined ‘simple_bridge’ basic-bridge
[May 5 10:18:31] – SIP/UPSTREAM-VOYAGER-RIC-00005b48 answered SIP/92-00005b47
[May 5 10:18:31] – Executing [s@macro-send-obroute-email:1] GotoIf(“SIP/UPSTREAM-VOYAGER-RIC-00005b48”, “0?sendEmail”) in new stack
[May 5 10:18:31] – Executing [s@macro-send-obroute-email:2] NoOp(“SIP/UPSTREAM-VOYAGER-RIC-00005b48”, “email notifications disabled…exiting.”) in new stack
[May 5 10:18:31] – Executing [s@macro-send-obroute-email:3] MacroExit(“SIP/UPSTREAM-VOYAGER-RIC-00005b48”, “”) in new stack
[May 5 10:18:31] – Channel SIP/UPSTREAM-VOYAGER-RIC-00005b48 joined ‘simple_bridge’ basic-bridge
[May 5 10:18:31] – Channel SIP/92-00005b47 joined ‘simple_bridge’ basic-bridge

  • Asterisk 16.6.2 / FreePBX 15.0.16.51

  • In the Call Recording module, ALL trunks are set to Force recording

  • In Outbound Routes, ALL routes are set to Force recording

  • Currently everything else seems to be recording properly, EXCEPT calls going to SIP trunk labelled CUSTOMER-RURALWIRELESS.

[quote=“asianman, post:11, topic:66837”]
[May 5 10:18:30] – Executing [s@sub-record-check:11] ExecIf(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “0?Set(ARG3=dontcare)”) in new stack

[May 5 10:18:30] – Executing [in@sub-record-check:4] Gosub(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “recordcheck,1(dontcare,in,6467775070)”) in new stack
[May 5 10:18:30] – Executing [recordcheck@sub-record-check:1] NoOp(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “Starting recording check against dontcare”) in new stack
[May 5 10:18:30] – Executing [recordcheck@sub-record-check:2] Goto(“SIP/UPSTREAM-VOYAGER-AKL-00005b49”, “dontcare”) in new stack[/quote]

These lines tells us that you have configured the system to only record inbound calls when the operator intervenes (typically using *1). Instead of being set to Force, the system thinks the option is set to “don’t care”, which is not what you want.

It looks like you missed setting the recording options for the “voyager” trunk.

How is the call getting routed? What extension is the call going to that it gets dropped onto the ruralwireless outbound route?

Hi Dave

Yeah, I did notice that, however in the Call Recording module, the trunk is already set to record Force. So I’m not sure why it’s not picking it up.

Have also included screenshot of inbound route for the DID 6467775070 - going straight out to another SIP trunk which leads to the other FreePBX box. No extension configured.

That only works the when you route your call flow through the module. The recording options for your calls are on the actual trunk. What setting are you using in the Outbound Route associated with your RURALWIRELESS Outbound Route → Additional Settings?

I’m pretty sure I asked you this question almost a week ago.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.