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

Joshua Colp asteriskteam at digium.com
Wed Oct 16 10:11:20 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 21: Code-Review-1

(3 comments)

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

https://gerrit.asterisk.org/#/c/11579/21/apps/app_audiosocket.c@114 
PS21, Line 114: 	ao2_bump(writeFormat = ast_channel_writeformat(chan));
              : 	ao2_bump(readFormat = ast_channel_readformat(chan));
You're silly.

writeFormat = ao2_bump(ast_channel_writeformat(chan));
readFormat = ao2_bump(ast_channel_readformat(chan));


https://gerrit.asterisk.org/#/c/11579/21/apps/app_audiosocket.c@197 
PS21, Line 197: 	targetChan = ast_waitfor_nandfds(&chan, 1, &svc, 1, NULL, &outfd, &ms);
              : 		if (targetChan) {
              : 			f = ast_read(targetChan);
              : 			if (!f) {
              : 				ast_log(LOG_ERROR, "Failed to receive frame from channel %s on AudioSocket\n",
              : 					chanName);
              : 				return -1;
              : 			}
This isn't right. It can be used on line 173 instead of ast_waitfor. When it returns you can then do the ast_read, frametype check, send frame if it got a channel. If it got a file descriptor instead then you do the audiosocket_receive_frame and write to channel.


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

https://gerrit.asterisk.org/#/c/11579/21/channels/chan_audiosocket.c@211 
PS21, Line 211: 		if (fd) {
This should be >= 0, or else you may close a negative file descriptor on an error case.



-- 
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: 21
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 15:11:20 +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/7021de4e/attachment.html>


More information about the asterisk-code-review mailing list