asterisk / asterisk

The official Asterisk Project repository.
https://www.asterisk.org
Other
1.97k stars 924 forks source link

[bug]: Unexpected control subclass '14' #696

Closed bobnil closed 1 month ago

bobnil commented 1 month ago

Severity

Trivial

Versions

20.6.0, master

Components/Modules

main/file.c

Operating Environment

Debian 12.2.0-14

Frequency of Occurrence

Constant

Issue Description

Getting the Unexpected control subclass '14' when originating a call.

Steps to reproduce:

Add this to the dialplan:

[asterisk-api-test]

exten => noanswer,1,NoOp()
same => n,Progress()
same => n,Playtones(ring)
same => n,Wait(60)
same => n,Hangup()

exten => answer,1,NoOp()
same => n,Answer()
same => n,Playback(vm-goodbye)
same => n,Wait(1)
same => n,Hangup()

At the Asterisk command line:

Reload the dialplan:

dialplan reload

Then originate a call:

originate local/answer@asterisk-api-test extension noanswer@asterisk-api-test

A warning similar to the following appears:

[Apr  5 21:15:58] WARNING[19269][C-00000029]: file.c:1773 waitstream_core: Unexpected control subclass '14'

Looking at the latest code downloaded from github, the warning occurs because no matching AST_CONTROL_xxx can be found.

Looking at frame.h value 14 corresponds to AST_CONTROL_PROGRESS = 14.

In file.c there is a switch statement that lists several values to be ignored. AST_CONTROL_PROGRESS is not in that list, which is why the warning appears. Given that AST_CONTROL_RINGING and AST_CONTROL_ANSWER are ignored, it is likely that AST_CONTROL_PROGRESS can also be added to the list of values to be ignored.

Suggested edit of main/file.c

@@ -1766,6 +1766,7 @@ static int waitstream_core(struct ast_channel *c,
                                case AST_CONTROL_PVT_CAUSE_CODE:
                                case AST_CONTROL_FLASH:
                                case AST_CONTROL_WINK:
+                               case AST_CONTROL_PROGRESS:
                                case -1:
                                        /* Unimportant */
                                        break;

It looks like a similar change should be made in main/channel.c, which has a similar switch statement:

@@ -3321,6 +3321,7 @@ int ast_waitfordigit_full(struct ast_channel *c, int timeout_ms, const char *bre
                                case AST_CONTROL_HOLD:
                                case AST_CONTROL_UNHOLD:
                                case AST_CONTROL_FLASH:
+                               case AST_CONTROL_PROGRESS:
                                case -1:
                                        /* Unimportant */
                                        break;

Relevant log output

[Apr  5 20:58:58] WARNING[19245][C-00000027]: file.c:1773 waitstream_core: Unexpected control subclass '14'

Asterisk Issue Guidelines

jcolp commented 1 month ago

Do you plan on putting up a pull request for this change?

InterLinked1 commented 1 month ago

Do you plan on putting up a pull request for this change?

If there's not one already, I can go ahead and put one up, I've noticed this as well.

bobnil commented 1 month ago

I'm not comfortable enough to do the pull request, so go ahead.