Clear installation FreePBX 2.10, not working call recording

What i do:

  1. Download and install fresh .ISO

  2. Create 2 extensions (1007,1009)

  3. Set for both extensions
    Inbound External Calls Always
    Outbound External Calls Always
    Inbound Internal Calls Always
    Outbound Internal Calls Always

  4. Calling from 1009 to 1007.

See log:

[2012-08-01 17:07:51] VERBOSE[4256] pbx.c: – Executing [record@sub-record-check:5] Return(“SIP/1007-00000002”, “”) in new stack
[2012-08-01 17:07:51] VERBOSE[4257] app_mixmonitor.c: == Begin MixMonitor Recording SIP/1007-00000002
[2012-08-01 17:07:51] WARNING[4257] file.c: No such format ‘═кW

[2012-08-01 17:07:51] ERROR[4257] app_mixmonitor.c: Cannot open /var/spool/asterisk/monitor/2012/08/01/exten-1009-1007-20120801-170751-1343830071.2.═кW

mysql> select * from globals where variable=‘MIXMON_FORMAT’;
±--------------±------+
| variable | value |
±--------------±------+
| MIXMON_FORMAT | wav |
±--------------±------+

What i did wrong?

from your post

No such format '═кW

seems like you typo’d (or perhaps a random gamma ray fu).

From your mysql call,it should be ‘wav’.

I suggest you check your work in the FreePBX gui specific to “call recording format” again please. . .

I trying to change recording format. But no effect reach.
2 setup from ISO, 2 identical bugs.

check the md5sum of the iso image.

cat stablennn.iso|md5sum

and compare it with the published one. (you should always do that)

I have this same problem… it is a problem in the ISO – as I have tried it several times… with a vanilla box not changing anything and it still gives the same errors and don’t record.

The first guys post he didn’t misspell anything… it is a random character in the logs…

Here is an example of mine…

[2012-08-07 10:14:23] WARNING[5166] file.c: No such format 'H�� '
[2012-08-07 10:14:23] ERROR[5166] app_mixmonitor.c: Cannot open /var/spool/asterisk/monitor/2012/08/07/rg-500-5708981249-20120807-101201-1344348699.2622.H$

Does anyone know of a resolve ?

Having the same problem, 4 clean installs on 4 different servers.

I also have to alter the
/etc/xinetd.d/tftp for the tftp to work

Hi there,

Having the same problem here, using FreePBX-1.1010.210.62-i386-Full-1353368566.iso

The error message I got is:

file.c:1241 ast_writefile: No such format ‘<81>Ãó^W^V’

I’ve been struggling with this over the weekend now, but I’ve had no success.

Any suggestions anyone?

To me this seems like a wrong pointer operator use and strings in C. I was thinking of recompiling file.c, but I see the sources are not included with the FreePBX distro so I am kind of stuck.

Hi there,

I solved this by recompiling Asterisk with a small fix applied to apps/app_mixmonitor.c. Here are the steps I took in identifying and solving this, for everyone that might be interested.

  1. I identified the version of Asterisk used in the FreePBX distro in question typing “core show version” at the CLI. The output showed me it was Asterisk 10.10.0

  2. I downloaded the sources package of this version of Asterisk from http://downloads.asterisk.org/pub/telephony/asterisk/releases/ ; namely asterisk-10.10.0.tar.gz

  3. I started a new project in my IDE of choice and loaded the Asterisk sources as a project. I then used “Find in files” to locate all references to the ast_writefile function, defined in main/file.c. The problem was evidently in MixMonitor (the module taking care of call recording) so I easily identified the following:

/usr/src/asterisk-10.10.0/apps/app_mixmonitor.c:
359 }
360
361: if (!(*fs = ast_writefile(filename, ext, NULL, *oflags, 0, 0666))) {
362 ast_log(LOG_ERROR, “Cannot open %s.%s\n”, filename, ext);
363 *errflag = 1;

  1. The above is a fragment of the mixmonitor_save_prep function, declared in apps/app_mixmonitor.c. This is how the whole function looked like:

static void mixmonitor_save_prep(struct mixmonitor *mixmonitor, char *filename, struct ast_filestream **fs, unsigned int *oflags, int errflag)
{
/
Initialize the file if not already done so */
char *ext = NULL;
char *last_slash = NULL;
if (!ast_strlen_zero(filename)) {
if (!*fs && !*errflag && !mixmonitor->mixmonitor_ds->fs_quit) {
*oflags = O_CREAT | O_WRONLY;
*oflags |= ast_test_flag(mixmonitor, MUXFLAG_APPEND) ? O_APPEND : O_TRUNC;

		last_slash = strrchr(filename, '/');

		if ((ext = strrchr(filename, '.')) && (ext > last_slash)) {
			*(ext++) = '\0';
		} else {
			ext = "raw";
		}
		
		if (!(*fs = ast_writefile(filename, ext, NULL, *oflags, 0, 0666))) {
			ast_log(LOG_ERROR, "Cannot open %s.%s\n", filename, ext);
			*errflag = 1;
		} else {
			struct ast_filestream *tmp = *fs;
			mixmonitor->mixmonitor_ds->samp_rate = MAX(mixmonitor->mixmonitor_ds->samp_rate, ast_format_rate(&tmp->fmt->format));
		}
	}
}

}

  1. Because of the funny characters I got in the logs my initial hunch was that this was some erroneous use of the pointer operator in C. I thought this resulted in the ast_writefile function getting passed an address rather than the value found at that address (you know how strings in C are).

The function is determining the recording type based on the file extension, doing some string manipulation with the recording filename on rows 355-356. I don’t have much experience with debugging under linux and didn’t want to delve too deep in this, so I decided I will first try a quick and dirty fix. I hardcoded the value of the ext variable after the string manipulation part like this:

		if ((ext = strrchr(filename, '.')) && (ext > last_slash)) {
			*(ext++) = '\0';
		} else {
			ext = "raw";
		}

		/* UGLY FIX START: CALL RECORDING -  FORCE THE RECORDING FORMAT */
		ext = "wav";
		/* UGLY FIX END */
  1. I now had to recompile Asterisk and see if my suggested fix will work.

I pulled the Asterisk sources on the freepbx box:

[root@localhost ~]# cd /usr/src/
[root@localhost src]# wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-10.10.0.tar.gz
[root@localhost src]# tar xvfz asterisk-10.10.0.tar.gz
[root@localhost src]# cd asterisk-10.10.0/

I then used my text editor of choice to amend the app_mixmonitor.c file and apply the fix:

[root@localhost asterisk-10.10.0]# vim apps/app_mixmonitor.c

After saving the file it was then time to recompile:

[root@localhost asterisk-10.10.0]# ./configure

The configure script will complain that there are certain packages missing. These are the ones that did the trick for me:

[root@localhost asterisk-10.10.0]# yum install make
[root@localhost asterisk-10.10.0]# yum install ncurses-devel
[root@localhost asterisk-10.10.0]# yum install libxml2-devel
[root@localhost asterisk-10.10.0]# yum install sqlite-devel.i686

Finally you do make and make install:

[root@localhost asterisk-10.10.0]# make
[root@localhost asterisk-10.10.0]# make install

Upon installation completion make complained about some of the asterisk modules (it gave me the list but I did not save it) in the modules folder were not part of this installation (or something similar). I ignored this message and did a reboot on the PBX.

Miraculously call recording was working after the reboot. I had my PBX completely set up beforehand (the call recording was the final issue I had to address) so I managed to do some functional testing right after the recompile and everything seemed to be working as expeced.

I will now be deploying the newly setup PBX into production to replace an old trixbox CE install and I will update this thread if I notice any side effects.

I hope this helps!

DISCLAIMER Reproducing this solution may break or impair your FreePBX install so use at your own risk.

Guys

We have moved to Asterisk 10.11 on this. I am pretty sure it was a bug on 10.10.0. Please test with the latest Distro

I just installed the most recent distro “FreePBX-2.210.62-2-i386-Full-1355247397.iso” and I am experiencing this.

[2012-12-18 19:58:04] WARNING[22405]: file.c:1241 ast_writefile: No such format ‘Ãó’
[2012-12-18 19:58:04] ERROR[22405]: app_mixmonitor.c:518 mixmonitor_save_prep: Cannot open /var/spool/asterisk/monitor/2012/12/18/force-2504744124-unknown-20121218-195804-1355889483.84.Ãó

localhost*CLI> core show version
Asterisk 10.11.0 built by root @ jenkins5.schmoozecom.net on a i686 running Linux on 2012-12-11 03:31:08 UTC

This is isolated down to a bug in Asterisk 10-DigiumPhone branch which is the branch we use for Asterisk 10. We have opened a bug with Digium on it and they assured us it would be fixed before the FINAl release of 10 comes out which is 10.12. Which means its time for people to start getting onto 11 since 10 will no longer get bug fixes.

Hi,

I am also facing this problem, my freepbx distro is unable to save call recording with error like this:
[2013-01-14 11:25:07] ERROR[16365] app_mixmonitor.c: Cannot open /var/spool/asterisk/monitor/2013/01/14/out-113-4000-20130114-112507-1358151907.129.���

I initially used this iso file:
FreePBX-1.1010.210.62-i386-Full-1353368566.iso

I did “yum update” and my latest Asterisk version is:
[root@freepbx ~]# cat /etc/asterisk/freepbxdistro-version
1.1010.210.62-3

[root@freepbx ~]# asterisk -V
Asterisk 10.10.0
[root@freepbx ~]#

I have a feeling the problem could be related to Uni-Code characters, I did a locale command and this is what I get:

[root@freepbx ~]# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_EN.UTF-8
LC_CTYPE="en_EN.UTF-8"
LC_NUMERIC=en_GB.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_EN.UTF-8"
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES="en_EN.UTF-8"
LC_PAPER=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_ADDRESS=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_ALL=

Could the UTF (Double Byte Characters) is causing the problem?

Also, reference the previous post, how do I upgrade to Asterisk 10.12?

Thanks