[Asterisk-code-review] feat: AudioSocket channel and application (...asterisk[master])

Joshua Colp asteriskteam at digium.com
Wed Oct 16 06:57:23 CDT 2019


Joshua Colp has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/11579 )

Change subject: feat: AudioSocket channel and application
......................................................................


Patch Set 20: Code-Review-1

(3 comments)

https://gerrit.asterisk.org/#/c/11579/20/apps/app_audiosocket.c 
File apps/app_audiosocket.c:

https://gerrit.asterisk.org/#/c/11579/20/apps/app_audiosocket.c@113 
PS20, Line 113: 
              : 	writeFormat = ast_channel_writeformat(chan);
              : 	ao2_ref(writeFormat, +1);
              : 	readFormat = ast_channel_readformat(chan);
              : 	ao2_ref(readFormat, +1);
Not something that needs to be done, but you can always use ao2_bump instead of a pattern like this.


https://gerrit.asterisk.org/#/c/11579/20/apps/app_audiosocket.c@198 
PS20, Line 198: 		ast_waitfor_nandfds(&chan, 1, &svc, 1, NULL, &outfd, &ms);
Instead of ast_waitfor above you would use this instead and then based on the result you would know whether the channel needed to be read or the audiosocket file descriptor.

If the function returned a channel you read the channel. If the function returned a file descriptor you read the audiosocket.


https://gerrit.asterisk.org/#/c/11579/20/channels/chan_audiosocket.c 
File channels/chan_audiosocket.c:

https://gerrit.asterisk.org/#/c/11579/20/channels/chan_audiosocket.c@210 
PS20, Line 210: 		ast_free(instance);
I think this will cause a file descriptor leak in the case where chan fails to get allocated.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11579
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ie866e6c4fa13178ec76f2a6971ad3590a3a588b5
Gerrit-Change-Number: 11579
Gerrit-PatchSet: 20
Gerrit-Owner: Seán C. McCord <ulexus at gmail.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Seán C. McCord <ulexus at gmail.com>
Gerrit-Comment-Date: Wed, 16 Oct 2019 11:57:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191016/3302d9cf/attachment-0001.html>


More information about the asterisk-code-review mailing list