[Asterisk-code-review] ARI channels: exposed channel driver's unique id (which is the Call-I... (asterisk[master])
Kevin Harwell
asteriskteam at digium.com
Tue Apr 26 15:31:51 CDT 2022
Attention is currently required from: Moritz Fain.
Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/18413 )
Change subject: ARI channels: exposed channel driver's unique id (which is the Call-ID for SIP/PJSIP) to ARI channel resource as 'pvt_id'
......................................................................
Patch Set 6: Code-Review-1
(7 comments)
Patchset:
PS6:
This need an CHANGES entry. Please see the following for more information:
https://wiki.asterisk.org/wiki/display/AST/CHANGES+and+UPGRADE.txt
File channels/chan_pjsip.c:
https://gerrit.asterisk.org/c/asterisk/+/18413/comment/df0fe31c_f2bf070e
PS6, Line 575: ast_channel_snapshot_invalidate_segment(chan, AST_CHANNEL_SNAPSHOT_INVALIDATE_BASE);
I wonder if this should moved into the ast_channel_tech_pvt_set call itself. Putting it here means it won't invalidate for other channel drivers.
https://gerrit.asterisk.org/c/asterisk/+/18413/comment/592945b7_bd32be23
PS6, Line 1277: if (!channel || !uniqueid) {
Is it possible for channel to be NULL here?
File include/asterisk/stasis_channels.h:
https://gerrit.asterisk.org/c/asterisk/+/18413/comment/f9187770_06c56a67
PS6, Line 108: AST_STRING_FIELD(pvt_uniqueid); /*!< Channel drivers unique id */
Adding the field in this way breaks ABI compatibility. Declare it instead at the end of the struct using the AST_STRING_FIELD_EXTENDED(pvt_uniqueid);
See stringfields.h for more info
File main/stasis_channels.c:
https://gerrit.asterisk.org/c/asterisk/+/18413/comment/112c2af8_0ad253d3
PS6, Line 287: ast_string_field_set(snapshot, pvt_uniqueid, ast_strdupa(ast_channel_tech(chan)->get_pvt_uniqueid(chan)));
There should be no reason to duplicate the string here before passing it into "set", so should be okay to remove that call.
https://gerrit.asterisk.org/c/asterisk/+/18413/comment/23fb0ae7_14a86c7d
PS6, Line 289: ast_string_field_set(snapshot, pvt_uniqueid, ast_channel_uniqueid(chan));
I'm torn having it default to the channel's 'uniqueid'. I kinda lean toward if one is not specified then just set it to an empty string as they do kind of represent two separate things. Thoughts?
File tests/test_stasis_channels.c:
https://gerrit.asterisk.org/c/asterisk/+/18413/comment/847729c3_98c0e4ae
PS6, Line 287: "pvt_id", ast_channel_uniqueid(chan),
If it's changed to default to an empty string (see previous comment) the test will also need updating.
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18413
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I7cc6e7a9d29efe74bc27811d788dac20fe559b87
Gerrit-Change-Number: 18413
Gerrit-PatchSet: 6
Gerrit-Owner: Moritz Fain <moritz at fain.io>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: Moritz Fain <moritz at fain.io>
Gerrit-Comment-Date: Tue, 26 Apr 2022 20:31:51 +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/20220426/c2d67357/attachment-0001.html>
More information about the asterisk-code-review
mailing list