Error In Asterisk stasis/p:channel: scheduled tasks

Hi, i have one asterisk pbx system whit 50 users… any time, i have received this warning:

WARNING[41496][C-0000069c] taskprocessor.c: The ‘stasis/m:cache_pattern:1/channel:all-00000139’ task processor queue reached 500 scheduled tasks again.
WARNING[41514][C-0000069c] taskprocessor.c: The ‘stasis/m:cache_pattern:1/channel:all-00000139’ task processor queue reached 500 scheduled tasks again.

I check task, and i have 880 task in queue… The problem is the user can´t make calls…

How i can fix it? thanx for help :slight_smile:

Not the same exact crash error, but it makes me wonder if anything changed in recent FreePBX updates that may lead to task processor overload.

Thanx for your help…

i dont have more experience in asterisk… But i need to solve this.

what can we try? Can you change the number of tasks and upload it?

My asterisk have 8 cores and 8gb ram. Has a load on cpu of 12 %…

If i run command: asterisk -rvx “core show taskprocessors” i have “359 taskprocessors”. But i see the error on full log:
[2021-04-27 09:18:37] WARNING[111903][C-000000a5] taskprocessor.c: The ‘stasis/m:cache_pattern:1/channel:all-00000139’ task processor queue reached 500 scheduled tasks again.

Any idea are welcome!

After several days reading, reviewing and testing, I have managed to lower the load of the processor tasks.
I leave it here in case someone else has the problem and the solution will serve you. There are still a few days to try, but it looks good:

When I run the command: asterisk -rvx “core show taskprocessors”
I get the following lines:

pjsip / outsess / 9002-00001078
pjsip / outsess / 9002-0000106c
pjsip / outsess / 9002-0000107f
pjsip / outsess / 9002-00001084
pjsip / outsess / 9002-00001069
pjsip / outsess / 9002-0000107e
pjsip / outsess / SIP01-00000ae7

Extension 9002 is answering a call but it has about 25 outgoing sessions open … The number of tasks is increasing and those tasks are never finished. Little by little the number of tasks increases until reaching the limit.

Reading through the forum, I saw a post from Hawkeye in which he says:
Clearly showed the MWI Subscription Type in advanced settings of all pjsip extensions MUST be set to Solicited.

Give it a try and see if it fixes your issue.

I have tried it by changing the configuration of all the extensions and for now the tasks are released well … I will wait a few days to confirm that it is the definitive solution

1 Like

Does the MWI Subscription relate to BLF functionality or just the VM light indicator?

Well, I have no idea what it does exactly, maybe someone else can tell us something else

MWI is message waiting indicator, and strictly for notifying if voicemail is waiting.

2 Likes

I continue with the problems, can someone help me or tell me how I can find out what is happening with the switchboard?

it seems that tasks are left unfinished. I don’t know if I can close them by command and thus release the list of tasks or see that the switchboard is overflowing. I have about 20 queues and about 60 agents. If a queue reaches 30 waiting calls, the party begins …

Thanx!

Tasks aren’t being left unfinished in Asterisk, if they were you’d be having more serious issues. They’re being processed at a rate slower than they are being created. It’s entirely possible that it’s your specific usage of queues which is producing a lot of tasks. I don’t have a guide or anything on how to investigate or determine what is going on, it’s usually environment/usage pattern specific and requires deep looking at things and understanding what is going on.

jcolp, Thanx for your time

What can I look at … I know that the problem starts when a specific queue reaches 30 waiting calls … but I don’t know what to do. The only thing I see is that the number of tasks increases from 250 to 690 that is right now … and there are only two calls in queue … the problem has me very confused. Add that I am a newbie to astrisk

What types of queues are you you using? And to understand how so many tasks can be created - each time a device state changes (they start ringing or go to in use), that’s a task. Each queue updating member status, that’s a task. Dialing a member and things changing, that’s 1 or more tasks. It adds up and if you’re doing something like a ring all, then that’s a huge number.

I am using the queues that are created by default asterisk (13.36.0). The rest of the options have been configured by someone else. I can give you a screenshot to understand a little more how it is configured … But what you say must be happening, since in the tasks I see the same extension up to 30 - 50 times

Thanks 4 help

I can’t speak for FreePBX, so if you are actually referring to FreePBX someone else would have to comment on what defaults and such are however if configured otherwise then you’d need to show that. If it’s a ring all, then I could certainly see things happening.

OK, thanks a lot. Any help is welcome, whatever the source.
Ring strategic: last call agent
Skip busy agents: yes
I understand your question, but I don’t know what data you showed … is there any place where they explain how to configure the queues correctly?

Good morning, here I continue to review the problem. If I run in ssh the command asterisk -r I see the following:

[2021-05-18 11:48:45] WARNING[56343][C-0000057b]: chan_sip.c:23
132 func_header_read: This function can only be used on SIP channels.
[2021-05-18 11:48:45] WARNING[56343][C-0000057b]: chan_sip.c:23132 func_header_read: This function can only be used on SIP channels.
[2021-05-18 11:48:45] WARNING[56343][C-0000057b]: chan_sip.c:23132 func_header_read: This function can only be used on SIP channels.
[2021-05-18 11:48:45] WARNING[56343][C-0000057b]: chan_sip.c:23132 func_header_read: This function can only be used on SIP channels.
[2021-05-18 11:48:45] ERROR[56343][C-0000057b]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
[2021-05-18 11:48:45] ERROR[56343][C-0000057b]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
[2021-05-18 11:48:45] ERROR[56343][C-0000057b]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.
[2021-05-18 11:48:45] ERROR[56343][C-0000057b]: res_pjsip_header_funcs.c:454 func_read_header: This function requires a PJSIP channel.

From what it gives me to understand the problem I have with the tasks is generated by the queue that throws these messages at me. I receive the calls in the queue by Sip and it is delivered to the extensions that are pjsip.

I suppose that in the header there will be some value that it does not interpret and that is why I get so many lines of error in the logs, upload the tasks and others …

The calls can be answered, but if there are many, the switchboard collapses and does not allow any more calls to enter and not be able to make any to the outside.

How can I test or solve the problem?

Thank you

That message is normal in FreePBX, it’s caused by a PJSIP function being used on a non-PJSIP channel. It is not the source of the tasks.

Well, the logs flood me …

What can I look at or where can I start to investigate?

it has me very clueless. Thanks for your help

In the end after hours of review, I have located the problem and I have solved it.

The switchboard was collapsing because it ran out of RTP ports for audio, when the queues were full, they left us without channels, which did not allow us to make internal or external calls. Someone left the configuration with only 100 ports and that’s why it crashed. I have expanded the ports and everything works correctly.

I leave it here in case it helps someone else. Thanks for your help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.