[Asterisk-code-review] chan sip: 3PCC patch for AMI "SIPnotify" (asterisk[master])
Richard Mudgett
asteriskteam at digium.com
Mon Dec 11 12:52:52 CST 2017
Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/7461 )
Change subject: chan_sip: 3PCC patch for AMI "SIPnotify"
......................................................................
Patch Set 4: Code-Review-1
(3 comments)
https://gerrit.asterisk.org/#/c/7461/4/channels/chan_sip.c
File channels/chan_sip.c:
https://gerrit.asterisk.org/#/c/7461/4/channels/chan_sip.c@15602
PS4, Line 15602: if (!vars) {
: astman_send_error(s, m, "Message variables (vars) is NULL");
: return 0;
: }
:
I don't think this check is necessary and may actually be undesirable. The code doesn't require that there be Variable headers in the AMI action. I think the documentation of SIPnotify stating that it is required is in error.
https://gerrit.asterisk.org/#/c/7461/4/channels/chan_sip.c@15623
PS4, Line 15623: p = ao2_find(dialogs, &tmp_dialog, OBJ_POINTER);
OBJ_POINTER is deprecated and replaced with OBJ_SEARCH_OBJECT.
https://gerrit.asterisk.org/#/c/7461/4/channels/chan_sip.c@15683
PS4, Line 15683: dialog_unref(p, "bump down the count of p since we're done with it.");
: } else {
: sip_scheddestroy(p, SIP_TRANS_TIMEOUT);
: transmit_invite(p, SIP_NOTIFY, 0, 1, NULL);
: dialog_unref(p, "bump down the count of p since we're done with it.");
: }
The dialog_unref() is common code to both if clauses. It can be moved to after the if/else statement:
if (...) {
...
} else {
...
}
dialog_unref(p...)
--
To view, visit https://gerrit.asterisk.org/7461
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I5797ded4752acd966db6b13971284db684cc5ab4
Gerrit-Change-Number: 7461
Gerrit-PatchSet: 4
Gerrit-Owner: Yasuhiko Kamata <yasuhiko.kamata at nxtg.co.jp>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Yasuhiko Kamata <yasuhiko.kamata at nxtg.co.jp>
Gerrit-Comment-Date: Mon, 11 Dec 2017 18:52:52 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171211/1c8874ea/attachment.html>
More information about the asterisk-code-review
mailing list