Channel allocation failed

Home » Asterisk Users » Channel allocation failed
Asterisk Users 2 Comments

Hello List!

My Asterisk stopped making SIP-calls today, I could call from external, and
saw Call coming in over PRI, but calling the SIP/Device
wont work. I saw 5 open channels – all chan_spy. Only a restart helped.

In the messages-file i found from yesterday:

[Mar 4 17:28:01] NOTICE[25769] app_chanspy.c: Attaching SIP/209-0000170fto
SIP/210-0000170e
[Mar 4 17:29:38] NOTICE[25790] app_chanspy.c: Attaching SIP/209-00001715
to SIP/210-00001714
[Mar 4 17:31:06] NOTICE[25812] app_chanspy.c: Attaching SIP/209-0000171c
to SIP/210-0000171a
[Mar 4 17:31:19] ERROR[25818] acl.c: Cannot create socket
[Mar 4 17:31:19] ERROR[25818] res_timing_timerfd.c: Failed to create
timerfd timer: Too many open files
[Mar 4 17:31:19] WARNING[25818] channel.c: Channel allocation failed:
Can’t create alert pipe! Try increasing max file descriptors with ulimit -n
[Mar 4 17:31:19] WARNING[25818] chan_sip.c: Unable to allocate AST channel
structure for SIP channel
[Mar 4 17:31:19] WARNING[25818] channel.c: Channel allocation failed:Can’t
create alert pipe! Try increasing max file descriptors with ulimit -n
[Mar 4 17:31:19] WARNING[25818] chan_sip.c: Unable to allocate AST channel
structure for SIP channel
[Mar 4 17:31:20] ERROR[3685] acl.c: Cannot create socket
[Mar 4 17:31:20] ERROR[3685] acl.c: Cannot create socket
[Mar 4 17:31:23] NOTICE[25812] app_chanspy.c: Attaching SIP/209-0000171c
to SIP/212-00001718
[Mar 4 17:31:27] ERROR[3685] acl.c: Cannot create socket
[Mar 4 17:31:27] ERROR[3703] res_timing_timerfd.c: Failed to create
timerfd timer: Too many open files
[Mar 4 17:31:27] WARNING[25808] res_rtp_asterisk.c: RTP Read error: Bad
file descriptor. Hanging up.
[Mar 4 17:31:34] NOTICE[25824] app_chanspy.c: Attaching SIP/209-00001724
to SIP/210-00001722
[Mar 4 17:31:42] NOTICE[25824] app_chanspy.c: Attaching SIP/209-00001724
to SIP/205-0000171d
[Mar 4 17:32:47] NOTICE[3685] chan_sip.c: Got OK on REFER Notify message
[Mar 4 17:35:41] NOTICE[25861] app_chanspy.c: Attaching
SIP/209-0000172a to SIP/210-00001729

I’m not sure what’s going wrong? My ulimit should by unlimited.

yours
christian gansberger

2 thoughts on - Channel allocation failed

  • The log messages seem quite clear what the problem is: you ran out of
    available file descriptors. It even mentions what you should do and what
    the command is: raise the amount of available file descriptors with
    ulimit -n.

    Regards,
    Patrick

  • Yes, I can give a higher ulimit, but I want to know why there were so much
    fd’s.

    As I found out yesterday, the reason of running out of available file
    descriptors was:
    Some Agents in the Callcenter made ChanSpy on several Calls, but they
    didn’t stop spying with *-key, just hangup the phone, and keep starting new
    chanspy’s.
    So Asterisk keeps the Channel open when user just hangs up the phone.

    My ChanSpy context looks like this:

    [spy]
    exten => *9,1,Answer
    exten => *9,2,ChanSpy(SIP)
    exten => *9,3,Hangup
    exten => h,1,Hangup

    In the CLI there were several ChanSpy listed, although nobody was spying. I
    tried to remove the channels with:
    hangup request SIP/channelname

    but nothing happend, I was not able to remove the Channels, only a restart
    did the trick.

    yours
    christian