File.c: Failed to write frame

Hi,

I’ve upgraded my FreePBX/Asterisk install to 2.5.0rc1.1 and have the following issue.

I use DISA to dial into my Asterisk box, use 411 to enter the directory and the call back out.

This has been working for several months.

After upgrading today if I hang up the call while a prompt is being read to me “Welcome to the phone book …” then I get the error -

[Aug 14 12:34:09] WARNING[32669] file.c: Failed to write frame

written to /var/log/asterisk/full over and over until the disk fills up. Restarting Asterisk stops the errors.

I’m running Asterisk v1.4.21.2 and RC1 for FreePBX (the issue started when I upgraded yesterday)

Also, the system is running on CentOS5.2 inside an OpenVZ VPS.

Obviously the error is being caused by Asterisk and I’m not sure why a FreePBX upgrade would cause this but they coincided hence my reason for posting here.

Thanks, Matt

hmm - it may be worth manually installing the 2.4 disa over the current one and doing a reload to see if the diaplan change in DISA has anything to do with it, although it has clear hints of being asterisk related as well. It would also be worth downgrading to a different version of asterisk (or upgrading …) to see if that has any effect.

Hi Philippe,

Thanks for the quick response. I was actually running Asterisk v1.4.21.1 when this started happening and, hoping an upgrade of Asterisk would fix it, I upgraded to v1.4.21.2.

I’ll have a go at installing v2.4 DISA and let you know what happens.

Matt

Just a quick update, not downgraded DISA yet but wondered what error Asterisk was actually reporting so ran it with high verbose and this is what I get repeated over and over at the Asterisk console when hanging up -

pbdirectory: loop = 1
– <Local/411@from-internal-b14d,2> Playing ‘pbdirectory/first-three-letters-entry’ (language ‘en’)
– Playing ‘dir-nomatch’ (escape_digits=) (sample_offset 0)

Matt

Philippe,

Good guess! Downgrading to version 2.4.0.3 of DISA solved my issue.

Interestingly all that appears on the * console now is

pbdirectory: loop = 0
– <SIP/17772324064-b77254d8> Playing ‘pbdirectory/first-three-letters-entry’ (language ‘en’)

So I guess it’s something to do with loop=1 in the new version.

Not sure if this constitutes a bug or is just peculiar to my install. If you need me to do anything more just let me know.

Thanks for your help - Matt

I think there may some other issue going on with your system, possibly a corrupted sound file such as dir-nomatch or something. I tested your scenario using the new disa to dial 411 and I can interact with it fine, no errors or anything. And the error is clearly related with an issue accessing that sound file. It would appear it hit a ‘while (true)’ type loop asking for information and each time it asks, it hits the error so you never hear it and get the chance to respond, so it keeps trying resulting in that loop and the error. I would investigate further as there may be other issues on your system and what ever you have changed just masked the behavior.

I run trixbox and found those huge log files as well. Going through the logs and e-mails I’ve found what seems to be a clue!

[Sep 15 13:54:08] VERBOSE[4155] logger.c: == Parsing ‘/etc/asterisk/manager.conf’: [Sep 15 13:54:08] VERBOSE[4155] logger.c: Found
[Sep 15 13:54:08] ERROR[4155] config.c: *********************************************************
[Sep 15 13:54:08] ERROR[4155] config.c: *********** YOU SHOULD REALLY READ THIS ERROR ***********
[Sep 15 13:54:08] ERROR[4155] config.c: Future versions of Asterisk will treat a #include of a file that does not exist as an error, and will fail t
o load that configuration file. Please ensure that the file ‘manager_additional.conf’ exists, even if it is empty.
[Sep 15 13:54:08] ERROR[4155] config.c: *********** YOU SHOULD REALLY READ THIS ERROR ***********
[Sep 15 13:54:08] ERROR[4155] config.c: *********************************************************
[Sep 15 13:54:08] ERROR[4155] config.c: *********************************************************
[Sep 15 13:54:08] ERROR[4155] config.c: *********** YOU SHOULD REALLY READ THIS ERROR ***********
[Sep 15 13:54:08] ERROR[4155] config.c: Future versions of Asterisk will treat a #include of a file that does not exist as an error, and will fail t
o load that configuration file. Please ensure that the file ‘manager_custom.conf’ exists, even if it is empty.
[Sep 15 13:54:08] ERROR[4155] config.c: *********** YOU SHOULD REALLY READ THIS ERROR ***********
[Sep 15 13:54:08] ERROR[4155] config.c: *********************************************************

I will test this and report back!

these are notes on what I found and an attempted solution. I copied and pasted from our wiki, so sorry if format is not clear. but this info may help someone. http://www.fantinibakery.com/fbc-wiki/FreePbx

  • on 2010-11-13 phone system logs were hourly rotating.
  • this was in log, 10,000+
[Jan 13 14:13:15] VERBOSE[5623] logger.c:     -- Playing 'dir-nomatch'
(escape_digits=) (sample_offset 0)
[Jan 13 14:13:16] WARNING[5623] file.c: Failed to write frame
[Jan 13 14:13:16] WARNING[5623] file.c: File dir-intro-fnln-oper does not exist
in any format
[Jan 13 14:13:16] WARNING[5623] file.c: Unable to open dir-intro-fnln-oper
(format 0x4 (ulaw)): No such f
ile or directory


[Jan 13 15:17:09] VERBOSE[5623] logger.c:     -- Playing 'dir-nomatch' (escape_digits=)
(sample_offset 0)
[Jan 13 15:17:09] WARNING[5623] file.c: Failed to write frame
[Jan 13 15:17:09] WARNING[5623] file.c: Failed to write frame
[Jan 13 15:17:09] VERBOSE[5623] logger.c:     --  Playing
'dir-intro-fnln-oper' (language 'en')
  • attempted solution. time will tell if ok
  • install missing sound file.

: sound file used in pgm
/var/lib/asterisk/agi-bin/directory
: orig source file at
/usr/src/Asterisk-1.4.21.1/freepbx-2.6.0RC2/docs/README.directory
: so it is a freepbx file
: missing sound file found at
ls /usr/src/Asterisk-1.4.21.1/freepbx-2.6.0RC2/amp_conf/sounds
dir-intro-fnln.gsm dir-intro-fnln-oper.gsm dir-intro-fn-oper.gsm dir-intro-oper.gsm

: so
cp /usr/src/Asterisk-1.4.21.1/freepbx-2.6.0RC2/amp_conf/sounds/* /var/lib/asterisk/sounds/

  • also see /usr/src/Asterisk-1.4.21.1/freepbx-2.6.0RC2/docs/README.directory

Which script did you change?

Thanks

I had the same situation here with Asterisk 1.4.39.1

by fixing the scripts not to loop when a user hangs up, got rid of the errors generated in the log file and filling up disk space.
previously code was:

do{
$result = $agi->get_data(“audio_folder/options”,5000,1);
$option = $result[‘result’];
if($option == ‘1’){
$done = TRUE;
}
}while(!$done);

so if user hangs up in the middle of the sound file played, it would "crash"
just needed to add some stuff to exit by seing that there is no user input, something like:

$counter = 0;
do{
$result = $agi->get_data(“audio_folder/options”,5000,1);
$option = $result[‘result’];
if($option == ‘1’){
$done = TRUE;
$counter = 0;
}
if ($counter > 3) exit;
$counter++;
}while(!$done);

so if user does not input anything script will terminate after 3 more tries (as it was needed for the program here).

Hope that explains a bit more how I have fixed it.