Post Call Recording script not executing

PBX Version:15.0.17.64
PBX Distro: 12.7.8-2107-3.sng7
Asterisk Version: 18.6.0

The Post Call Recording script that had been running for long, suddenly stopped working.

bash /var/lib/asterisk/bin/emailrecording.sh ^{YEAR} ^{MONTH} ^{DAY} ^{TIMESTR} ^{CALLFILENAME}.^{MIXMON_FORMAT} ^{CHANNEL}

Calls are being recorded on demand but are not sent to the email recipient set in the Voice Mail email address.

Solutions mentioned in other posts haven’t helped.

Any ideas please?

Thanks

Which version of the Call Recording module are you using?

15.0.7.22 i have seen the specific post unfortunately it didn’t help.

Call recording works fine but the script is not run.

Any ideas please?

Additionally tried to download v16.0.10 from edge but it is not there:
doing fwconsole ma --edge upgrade callrecording i get “callrecording is the same as the online version, unable to upgrade”

thanks

It seems to be working for me.

VERBOSE[39980][C-00000002] app_mixmonitor.c: MixMonitor close filestream (mixed)
VERBOSE[39980][C-00000002] app_mixmonitor.c: Executing [bash /var/lib/asterisk/bin/emailrecording.sh 2021 12 21 20211221-052140 q-9000-6406-20211221-052140-1640082100.1.wav PJSIP/6406-00000001]
VERBOSE[39980][C-00000002] app_mixmonitor.c: End MixMonitor Recording PJSIP/6406-00000001

Can you please provide a call trace via pastebin?

https://wiki.freepbx.org/display/SUP/Providing+Great+Debug#ProvidingGreatDebug-AsteriskLogs-PartII


With that being said, I do see one error in the logs which what I think is related to the recent work from @sholinaty

Log:

VERBOSE[39978][C-00000002] pbx.c: Executing [recordcheck@sub-record-check:17] Set("PJSIP/6406-00000001", "__CALLFILENAME=q-9000-6406-20211221-052140-1640082100.1") in new stack
WARNING[39978][C-00000002] func_strings.c: EVAL requires an argument: EVAL(<string>)
VERBOSE[39978][C-00000002] pbx.c: Executing [recordcheck@sub-record-check:18] MixMonitor("PJSIP/6406-00000001", "2021/12/21/q-9000-6406-20211221-052140-1640082100.1.wav,ai(LOCAL_MIXMON_ID),bash /var/lib/asterisk/bin/emailrecording.sh ^{YEAR} ^{MONTH} ^{DAY} ^{TIMESTR} ^{CALLFILENAME}.^{MIXMON_FORMAT} ^{CHANNEL}") in new stack

The actual dialplan:

17. Set(__CALLFILENAME=${ARG2}-${ARG3}-${FROMEXTEN}-${TIMESTR}-${UNIQUEID}) [extensions_additional.conf:812]
18. MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MON_FMT},a${EVAL(${MONITOR_REC_OPTION})}i(LOCAL_MIXMON_ID)${MIXMON_BEEP},${EVAL(${MIXMON_POST})}) [extensions_additional.conf:813]

Thank you for your assistance. Kindly allow for some time until i prepare the call trace and send to you.

@PitzKey i havent had time to get a fix going for the “EVAL requires an argument” line (yet)… been swamped over the holiday season.
its probably something as simple as using a ${mixmon_post || “”} to catch the cases where the variables are not defined in /etc/asterisk/globals_custom.conf

that being said, if you don’t have it set, the “error” doesn’t affect anything, because you don’t have them set anyway ( so there’s nothing to do).

so the question is…
do I do this once… or each of the ~5 times those variables are called…

${EVAL( isset(${MIXMON_POST}) ? ${MIXMON_POST} : "")}
or
$MIXMON_POST = isset(${MIXMON_POST}) ? ${MIXMON_POST} : "";

how are you passing/calling this script? is that your “mixmon_post” in /etc/asterisk/globals_custom.conf ?

and are you on a custom install? or "Sangoma linux?

Hello thank you for your response
System is:

PBX Version:15.0.17.64
PBX Distro: 12.7.8-2107-3.sng7
Asterisk Version: 18.6.0

I am using the Post Call Recording script from Advanced settings in Freepbx.

It has been working very fine for years.

Calls are being recorded but the script is not working any longer in order to send the email with the attached recording to the respective user.

It doesn’t even work for simple scripts following the end of an on-demand recording.

Thanks a lot

oddly, i dont see that as an item in My “Advanced Settings” pane…
any chance you can post a screenshot?

you could try downgrading your CallRecording module to
15.0.7.20: FREEI-3368 Removed hidden input field ‘view’ from the form
and see if that solves it… that version is before my recent work, which would likely tell us if it was my code or your platform.

I’ve got some time later in the week to try and get a fix going for the “eval requires” issues.

at the bottom of your web UI… what version of FreePBX?
Screen Shot 2021-12-21 at 8.40.58 AM

ohhhh. you have “override readonly settings” and “Display readonly settings” on.

can you try adding this to /etc/asterisk/globals_custom.conf ?

SS=$
MIXMON_POST = bash /var/lib/asterisk/bin/emailrecording.sh ${SS}{YEAR} ${SS}{MONTH} ${SS}{DAY} ${SS}{TIMESTR} ${SS}{CALLFILENAME}.${SS}{MIXMON_FORMAT} ${SS}{CHANNEL}

Then issue a fwconsole reload

does that fix it?

PBX Version:15.0.17.64
PBX Distro: 12.7.8-2107-3.sng7
Asterisk Version: 18.6.0

do you mean i should downgrade or should i first add
SS=$
MIXMON_POST = bash /var/lib/asterisk/bin/emailrecording.sh ${SS}{YEAR} ${SS}{MONTH} ${SS}{DAY} ${SS}{TIMESTR} ${SS}{CALLFILENAME}.${SS}{MIXMON_FORMAT} ${SS}{CHANNEL}

to
/etc/asterisk/globals_custom.conf

i would suggest trying to add those 2 lines
then fwconsole reload
then test

if it fails, remove those 2 lines
fwconsole reload
then try downgrading the callRecording module (likely 2 versions) to 15.0.7.20

ok i already have added the line to the file. I cannot reload now since the system is being heavily used.

/etc/asterisk/globals_custom.conf was empty by the way.

I will follow your instructions and revert.

Much appreciated

yep. globals_custom.conf will be empty at first. this is normal.

if i reload now active calls will be dropped correct? if not i could reload now so that we get things going

to the best of my knowledge, RELOAD does not drop. RESTART does.

Why not add it in the GUI? When you hover over that little helper, it tells you how to format the variables so you don’t need the extra variables to get the dollar signs.

he has it in the gui, and its not being run… was trying to diagnose it.

also, it seems to be explicitly flagged as a “Read Only” variable… was trying to wolf-fence where the problem was.