Failed to write data to channel monitor write stream

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Failed to write data to channel monitor write stream

Postby mdvitel » Thu Dec 12, 2024 11:39 am

Hi,

I am running a auto dial campaign with remote agent whenever calls get bridge below error getting started, I read the some post in which mentioned to check disk space and permission but in my case both are ok , for the security purpose I have replace the server ip in below log with 192.168.2.112 , please help how can we fix this issue

Code: Select all
> 0x7f245003a290 -- Strict RTP learning after remote address set to: 192.168.2.112:10034
    -- SIP/192.168.2.112-00000004 answered SIP/Vitel173-00000003
    -- Channel SIP/192.168.2.112-00000004 joined 'simple_bridge' basic-bridge <97c6011e-0c7e-4d64-b2c5-c61b5234cbb5>
    -- Channel SIP/Vitel173-00000003 joined 'simple_bridge' basic-bridge <97c6011e-0c7e-4d64-b2c5-c61b5234cbb5>
       > 0x7f245003a290 -- Strict RTP switching to RTP target address 192.168.2.112:10034 as source
[Dec 12 07:30:10] WARNING[10811][C-0000000a]: file.c:293 ast_writestream: Translated frame write failed
[Dec 12 07:30:10] WARNING[10811][C-0000000a]: channel.c:5493 ast_write_stream: Failed to write data to channel monitor write stream
[Dec 12 07:30:10] WARNING[10811][C-0000000a]: file.c:293 ast_writestream: Translated frame write failed
[Dec 12 07:30:10] WARNING[10811][C-0000000a]: channel.c:5493 ast_write_stream: Failed to write data to channel monitor write stream
[Dec 12 07:30:10] WARNING[10811][C-0000000a]: file.c:293 ast_writestream: Translated frame write failed
[Dec 12 07:30:10] WARNING[10811][C-0000000a]: channel.c:5493 ast_write_stream: Failed to write data to channel monitor write stream
[Dec 12 07:30:10] WARNING[10811][C-0000000a]: file.c:293 ast_writestream: Translated frame write failed
[Dec 12 07:30:10] WARNING[10811][C-0000000a]: channel.c:5493 ast_write_stream: Failed to write data to channel monitor write stream
[Dec 12 07:30:10] WARNING[10811][C-0000000a]: file.c:293 ast_writestream: Translated frame write failed
[Dec 12 07:30:10] WARNING[10811][C-0000000a]: channel.c:5493 ast_write_stream: Failed to write data to channel monitor write stream
[Dec 12 07:30:10] WARNING[10811][C-0000000a]: file.c:293 ast_writestream: Translated frame write failed


Code: Select all
[root@localhost ~]# df -h
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             4.0M     0  4.0M   0% /dev
tmpfs                1.8G     0  1.8G   0% /dev/shm
tmpfs                731M   23M  709M   4% /run
/dev/mapper/rl-root   28G  8.7G   20G  32% /
/dev/xvda1           960M  308M  653M  33% /boot
tmpfs                366M  4.0K  366M   1% /run/user/0


Code: Select all
[root@localhost ~]# ll /var/spool/asterisk/
total 0
drwxrwxrwx  2 root root  6 Nov 19 09:22 dictate
drwxrwxrwx  2 root root  6 Nov 19 09:22 meetme
drwxrwxrwx  3 root root 17 Dec 12 07:44 monitor
drwxrwxrwx 10 root root 96 Dec 12 07:55 monitorDONE
drwxrwxrwx  2 root root  6 Nov 19 09:38 outgoing
drwxrwxrwx  2 root root  6 Nov 19 09:22 recording
drwxrwxrwx  2 root root  6 Nov 19 09:22 system
drwxrwxrwx  2 root root  6 Nov 19 09:22 tmp
drwxrwxrwx  3 root root 21 Nov 19 09:22 voicemail


Asterisk 16.30.1-vici
VERSION: 2.14-931a
BUILD: 241113-2002
PHP 8.3.13 (cli) (built: Oct 22 2024 18:39:14) (NTS gcc x86_64)
mysql Ver 15.1 Distrib 10.5.22-MariaDB, for Linux (x86_64) using EditLine wrapper
OS: "Rocky Linux" VERSION="9.4 (Blue Onyx)"

[edited - williamconley - code blocks for legibility]
mdvitel
 
Posts: 7
Joined: Tue Dec 03, 2024 6:46 am

Re: Failed to write data to channel monitor write stream

Postby ambiorixg12 » Thu Dec 12, 2024 9:40 pm

I'm not a C developer, but by checking the line that references the warning

if (ast_channel_monitor(chan)->state == AST_MONITOR_RUNNING) {
if (ast_writestream(ast_channel_monitor(chan)->read_stream, f) < 0)
ast_log(LOG_WARNING, "Failed to write data to channel monitor read stream\n");
}
}

This issue could be caused by various underlying OS-level or network-related problems, especially since it only happens with remote agents in your case. Some potential causes include:

File descriptor exhaustion
Out of memory conditions
Network issues (if write_stream is network-based)
Resource limits (e.g., process or thread limits)
High system load (CPU or memory saturation)

You can discard Disk I/O issues and Permission errors as causes, since you have already checked these.
ambiorixg12
 
Posts: 457
Joined: Tue Sep 17, 2013 10:35 pm

Re: Failed to write data to channel monitor write stream

Postby mdvitel » Fri Dec 13, 2024 4:49 am

Thanks for the reply
I am sorry to say that I also don't know the C program, I have to change anything in code ?
cpu load, memory and network are also ok
[root@localhost ~]# ulimit -a
real-time non-blocking time (microseconds, -R) unlimited
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 14453
max locked memory (kbytes, -l) 8192
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 14453
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
mdvitel
 
Posts: 7
Joined: Tue Dec 03, 2024 6:46 am

Re: Failed to write data to channel monitor write stream

Postby carpenox » Fri Dec 13, 2024 5:36 am

chown your perms to the asterisk user for /var/spool/asterisk
Alma Linux 9.5 | SVN Version: 3920 | DB Schema Version: 1725 | Asterisk 18.26.0 | PHP8
https://dialer.one -:- 1-833-DIALER-1 -:- https://linktr.ee/CyburDial -:- WA: +19549477572
DC: https://discord.gg/DVktk6smbh -:- TG: https://t.me/+wkDmkF9U4aUxOGYx
carpenox
 
Posts: 2584
Joined: Wed Apr 08, 2020 2:02 am
Location: St Petersburg, FL

Re: Failed to write data to channel monitor write stream

Postby mdvitel » Fri Dec 13, 2024 8:51 am

carpenox wrote:chown your perms to the asterisk user for /var/spool/asterisk


still same warning getting

[root@localhost asterisk]# useradd -M -s /bin/bash asterisk
sudo chown -R asterisk:asterisk /var/spool/asterisk
[root@localhost ~]# cd /var/spool/asterisk
[root@localhost asterisk]# ls
dictate meetme monitor monitorDONE outgoing recording system tmp voicemail
[root@localhost asterisk]# ls -ltr
total 0
drwxrwxrwx 2 asterisk asterisk 6 Nov 19 09:22 dictate
drwxrwxrwx 2 asterisk asterisk 6 Nov 19 09:22 meetme
drwxrwxrwx 2 asterisk asterisk 6 Nov 19 09:22 system
drwxrwxrwx 2 asterisk asterisk 6 Nov 19 09:22 tmp
drwxrwxrwx 2 asterisk asterisk 6 Nov 19 09:22 recording
drwxrwxrwx 3 asterisk asterisk 21 Nov 19 09:22 voicemail
drwxrwxrwx 2 asterisk asterisk 6 Nov 19 09:38 outgoing
drwxrwxrwx 3 asterisk asterisk 17 Dec 13 05:12 monitor
drwxrwxrwx 10 asterisk asterisk 96 Dec 13 05:13 monitorDONE
mdvitel
 
Posts: 7
Joined: Tue Dec 03, 2024 6:46 am

Re: Failed to write data to channel monitor write stream

Postby carpenox » Fri Dec 13, 2024 9:04 am

are you writing to that directory with /etc/astguiclient.conf ?

# Paths used by astGUIclient
PATHhome => /usr/share/astguiclient
PATHlogs => /var/log/astguiclient
PATHagi => /var/lib/asterisk/agi-bin
PATHweb => /var/www/html
PATHsounds => /var/lib/asterisk/sounds
PATHmonitor => /var/spool/asterisk/monitor
PATHDONEmonitor => /var/spool/asterisk/monitorDONE
Alma Linux 9.5 | SVN Version: 3920 | DB Schema Version: 1725 | Asterisk 18.26.0 | PHP8
https://dialer.one -:- 1-833-DIALER-1 -:- https://linktr.ee/CyburDial -:- WA: +19549477572
DC: https://discord.gg/DVktk6smbh -:- TG: https://t.me/+wkDmkF9U4aUxOGYx
carpenox
 
Posts: 2584
Joined: Wed Apr 08, 2020 2:02 am
Location: St Petersburg, FL

Re: Failed to write data to channel monitor write stream

Postby mdvitel » Fri Dec 13, 2024 10:00 am

yes here it is my conf file /etc/astguiclient.conf

# Paths used by astGUIclient
PATHhome => /usr/share/astguiclient
PATHlogs => /var/log/astguiclient
PATHagi => /var/lib/asterisk/agi-bin
PATHweb => /var/www/html
PATHsounds => /var/lib/asterisk/sounds
PATHmonitor => /var/spool/asterisk/monitor
PATHDONEmonitor => /var/spool/asterisk/monitorDONE

# The IP address of this machine
VARserver_ip => 192.168.2.112

# Database connection information
VARDB_server => localhost
VARDB_database => asterisk
VARDB_user => cron
VARDB_pass => 1234
VARDB_custom_user => custom
VARDB_custom_pass => custom1234
VARDB_port => 3306

# Cold-Storage Database connection information (optional)
VARCS_server =>
VARCS_database => asterisk_coldstorage
VARCS_user => coldstorage
VARCS_pass => cs1234
VARCS_port => 3306
mdvitel
 
Posts: 7
Joined: Tue Dec 03, 2024 6:46 am

Re: Failed to write data to channel monitor write stream

Postby williamconley » Fri Dec 13, 2024 10:26 am

Previous post:

Having investigated further, I discovered that the issue is related to PRI Callerid settings in extensions.conf.

http://eflo.net/VICIDIALforum/viewtopic.php?f=4&t=40435
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20415
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Failed to write data to channel monitor write stream

Postby mdvitel » Fri Dec 13, 2024 12:51 pm

williamconley wrote:Previous post:

Having investigated further, I discovered that the issue is related to PRI Callerid settings in extensions.conf.

http://eflo.net/VICIDIALforum/viewtopic.php?f=4&t=40435


earlier we were using custom caller id in dialplan before posting here but not now

exten => _9864X.,1,AGI(agi://127.0.0.1:4577/call_log)
same => n,Dial(${Vitel173}/${EXTEN:4},${CAMPDTO},To)
same => n,Hangup()
mdvitel
 
Posts: 7
Joined: Tue Dec 03, 2024 6:46 am

Re: Failed to write data to channel monitor write stream

Postby williamconley » Fri Dec 13, 2024 11:51 pm

${CAMPDTO}

Have you verified that removing this does not resolve the issue? This is the only "odd" thing I find in the dialplan. Note that Vicidial sets the timeout in code, so you could be conflicting by setting this yourself. Honestly I don't think so, but it's a lot easier to remove it for testing than trace the code. And linux often breaks rules regardless of how "right" we think we are that we should be able to do something. LOL

Have you modified any asterisk ".conf" files manually? (If you aren't positive about that response diff them to the originals in /usr/src/astguiclient/trunk)

What method(s) are you using for Caller ID?

Does this ALWAYS happen, or only "once in a while" or "most of the time", or "only on certain campaigns ..." or ...? any predictability would be useful information.

What is the filename of these files set to (campaign/ingroup settings)? Have you altered the filename settings? Are these inbound or outbound, manual or autodialed or all (for the errors)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20415
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Failed to write data to channel monitor write stream

Postby mdvitel » Sat Dec 14, 2024 8:48 am

williamconley wrote:
${CAMPDTO}

Have you verified that removing this does not resolve the issue? This is the only "odd" thing I find in the dialplan. Note that Vicidial sets the timeout in code, so you could be conflicting by setting this yourself. Honestly I don't think so, but it's a lot easier to remove it for testing than trace the code. And linux often breaks rules regardless of how "right" we think we are that we should be able to do something. LOL

Have you modified any asterisk ".conf" files manually? (If you aren't positive about that response diff them to the originals in /usr/src/astguiclient/trunk)

What method(s) are you using for Caller ID?

Does this ALWAYS happen, or only "once in a while" or "most of the time", or "only on certain campaigns ..." or ...? any predictability would be useful information.

What is the filename of these files set to (campaign/ingroup settings)? Have you altered the filename settings? Are these inbound or outbound, manual or autodialed or all (for the errors)



Thanks William to guide all the things, I will check all the thing as you guided and will share the feedback
mdvitel
 
Posts: 7
Joined: Tue Dec 03, 2024 6:46 am

Re: Failed to write data to channel monitor write stream

Postby mdvitel » Mon Dec 16, 2024 11:09 am

still same issue,
i tried with new created campaign also, caller id in campaign settings,
I have removed CAMPDTO and keep 60 , still same
warning only coming when enabling recording in campaign , if I turn off the recording then error not coming,

exten => _9864X.,1,AGI(agi://127.0.0.1:4577/call_log)
same => n,Dial(${Vitel173}/${EXTEN:4},60,tTo)
same => n,Hangup()

After connecting the calls agent transferring the External Extension: 786786

exten => _786786,1,NoOp(answered)
same => n,Set(user_id=2)
same => n,Set(prompt_id=1)
same => n,SIPAddHeader(X-MY-VAR1:${user_id})
same => n,SIPAddHeader(X-MY-VAR2:${prompt_id})
same => n,ExecIf($["${DialedNumber}"=""]?Set(DialedNumber=${EXTEN}))
same => n,Dial(SIP/${DialedNumber}@192.168.2.114,60,tTo)
same => n,Hangup()
mdvitel
 
Posts: 7
Joined: Tue Dec 03, 2024 6:46 am

Re: Failed to write data to channel monitor write stream

Postby williamconley » Mon Dec 16, 2024 2:08 pm

removed CAMPDTO and keep 60


That wasn't the test. I was not trying to see if your variable was incorrect, but that ANY number in that location might interfere with Vicidial's termination protocol. LIke I said, it should not matter, but leaving that field empty is our normal and that doesn't match what you're doing by putting either a variable or any number in that position. Leave it out. Two commas, nothing between.

warning only coming when enabling recording in campaign , if I turn off the recording then error not coming,


This however, likely means that variable or 60 is 100% unrelated.

What is the recording filename set to in your campaign and/or ingroup? Does this fail with recording on inbound/outbound/both?

And now we have to know your installation method, since it's very likely an installation issue. Rocky linux is not a Vicibox install, so the location of your installation instructions is now relevant. Plus why you're NOT using the Vicibox installer (which may have saved you from this problem entirely). You'll need to be sure all your recording folders exist and have the correct permissions, of course.

Code: Select all
/var/spool/asterisk # ll -R
.:
total 32
drwxr-x---  2 asterisk asterisk 4096 Aug  2 20:13 dictate
drwxr-x---  2 asterisk asterisk 4096 Aug  2 20:13 meetme
drwxrwxrwt  2 root     root       40 Dec 16 06:30 monitor
drwxr-xr-x 10 wwwrun   root     4096 Aug  4 15:52 monitorDONE
drwxr-xr-x  2 root     root     4096 Aug  4 15:53 outgoing
drwxr-x---  2 asterisk asterisk 4096 Aug  2 20:13 recording
drwxr-x---  2 asterisk asterisk 4096 Aug  2 20:13 system
drwxr-x---  2 asterisk asterisk 4096 Aug  2 20:13 tmp
drwxr-x---  3 asterisk asterisk 4096 Aug  2 20:13 voicemail


Code: Select all
./monitorDONE:
total 32
drwxr-xr-x 2 root root 4096 Aug  4 15:52 FTP
drwxr-xr-x 2 root root 4096 Aug  4 15:52 FTP2
drwxr-xr-x 2 root root 4096 Aug  4 15:52 GPG
drwxr-xr-x 2 root root 4096 Aug  4 15:52 GSM
drwxr-xr-x 2 root root 4096 Aug  4 15:52 GSW
drwxr-xr-x 2 root root 4096 Aug  4 15:52 MP3
drwxr-xr-x 2 root root 4096 Aug  4 15:52 OGG
drwxr-xr-x 2 root root 4096 Aug  4 15:52 ORIG


Note that these permissions are based on users from Vicibox 11 (OpenSuSE Leap 15.5)

Plus these Matching entries in your /etc/astguclient.conf file:

Code: Select all
PATHmonitor => /var/spool/asterisk/monitor
PATHDONEmonitor => /var/spool/asterisk/monitorDONE
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20415
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 89 guests