<p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11216">View Change</a></p><p>9 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11216/1/channels/chan_pjsip.c">File channels/chan_pjsip.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11216/1/channels/chan_pjsip.c@1909">Patch Set #1, Line 1909:</a> <code style="font-family:monospace,monospace">       if (!(session->channel) || !(chan = ast_channel_ref(session->channel))) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Why do you bump the reference count here on the channel and release it later?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11216/1/channels/chan_pjsip.c@1906">Patch Set #1, Line 1906:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> if (!(session = (struct ast_sip_session *)pjsip_evsub_get_mod_data(sub, refer_callback_module.id))) {<br>         return;<br>       }<br>     if (!(session->channel) || !(chan = ast_channel_ref(session->channel))) {<br>               return;<br>       }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">These days we do the assignment and checks separately, minor detail though.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11216/1/channels/chan_pjsip.c@1919">Patch Set #1, Line 1919:</a> <code style="font-family:monospace,monospace">          ast_debug(3, "Transfer accepted\n");</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This doesn't really provide any information or details about which transfer was accepted.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11216/1/channels/chan_pjsip.c@1933">Patch Set #1, Line 1933:</a> <code style="font-family:monospace,monospace">                               pjsip_evsub_terminate(sub, PJ_TRUE);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Will this not happen automatically?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11216/1/channels/chan_pjsip.c@1970">Patch Set #1, Line 1970:</a> <code style="font-family:monospace,monospace">                   /* If the subscription has terminated, return AST_TRANSFER_SUCCESS for 2XX. */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">A multiline comment is like:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">/* Hello<br> * How are you<br> * I'm well<br> */</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11216/1/channels/chan_pjsip.c@1976">Patch Set #1, Line 1976:</a> <code style="font-family:monospace,monospace">                        /* If the subscription is not terminated, terminate it now. */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Specify why you terminate the subscription.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11216/1/channels/chan_pjsip.c@1980">Patch Set #1, Line 1980:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">                            status = pjsip_evsub_initiate(sub, pjsip_get_subscribe_method(), 0, &tdata);<br>                              if (status == PJ_SUCCESS) {<br>                                   pjsip_evsub_send_request(sub, tdata);<br>                         }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think at the beginning of the function a comment detailing precisely how this works and the interaction between evsub and it would be needed.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11216/1/channels/chan_pjsip.c@1987">Patch Set #1, Line 1987:</a> <code style="font-family:monospace,monospace">                      ast_debug(3, "Transfer completed: %d %.*s (%s)\n", </code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This doesn't give any detail about what channel was transferred or anything like that.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11216/1/channels/chan_pjsip.c@2020">Patch Set #1, Line 2020:</a> <code style="font-family:monospace,monospace">   pjsip_evsub_set_mod_data(sub, refer_callback_module.id, session);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">What is the reference counting like for this? Is it always guaranteed that session will be valid when the callback is invoked?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11216">change 11216</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/11216"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: If6c27c757c66f71e8b75e3fe49da53ebe62395dc </div>
<div style="display:none"> Gerrit-Change-Number: 11216 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Dan Cropp <dan@amtelco.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 16 Apr 2019 12:53:25 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>