[asterisk-dev] [Code Review] 2512: Move origination to dialing API
Joshua Colp
reviewboard at asterisk.org
Thu May 9 13:44:44 CDT 2013
> On May 9, 2013, 2 p.m., opticron wrote:
> > /trunk/main/pbx.c, lines 9931-9938
> > <https://reviewboard.asterisk.org/r/2512/diff/1/?file=37454#file37454line9931>
> >
> > These should be string fields.
As there are fixed limits it saves a second memory allocation, or potentially more. While that comes at the cost of some memory it's minor.
> On May 9, 2013, 2 p.m., opticron wrote:
> > /trunk/main/pbx.c, line 10210
> > <https://reviewboard.asterisk.org/r/2512/diff/1/?file=37454#file37454line10210>
> >
> > ast_dial_channel can return NULL.
In this case it can't. Prerun would have caused it to return early.
> On May 9, 2013, 2 p.m., opticron wrote:
> > /trunk/main/pbx.c, line 10265
> > <https://reviewboard.asterisk.org/r/2512/diff/1/?file=37454#file37454line10265>
> >
> > This should probably be moved below the thread creation.
Erm, I disagree. Starting up a thread with a data structure that is reference counted and not bumping up the reference count opens you up to potential race conditions, as it thinks it has a reference when it doesn't.
> On May 9, 2013, 2 p.m., opticron wrote:
> > /trunk/main/pbx.c, lines 10259-10260
> > <https://reviewboard.asterisk.org/r/2512/diff/1/?file=37454#file37454line10259>
> >
> > You may want to pull allocation and initialization of the pbx_outgoing struct into a separate allocation function to clean this up a bit.
Initialization isn't that much and isn't duplicated, I don't find myself leaning towards a separate function.
- Joshua
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2512/#review8531
-----------------------------------------------------------
On May 8, 2013, 6:52 p.m., Joshua Colp wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2512/
> -----------------------------------------------------------
>
> (Updated May 8, 2013, 6:52 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> This change adds a few minor features to the dialing API and moves origination to using it. As a result code duplication is reduced and readability has increased.
>
>
> Diffs
> -----
>
> /trunk/include/asterisk/dial.h 388010
> /trunk/main/dial.c 388010
> /trunk/main/manager_channels.c 388010
> /trunk/main/pbx.c 388010
>
> Diff: https://reviewboard.asterisk.org/r/2512/diff/
>
>
> Testing
> -------
>
> Tested various origination scenarios and confirmed they all work as expected.
>
>
> Thanks,
>
> Joshua Colp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130509/cd72a554/attachment-0001.htm>
More information about the asterisk-dev
mailing list