[asterisk-dev] [Code Review] Dialplan function for manager account checks - AMI_CLIENT()

Olle E Johansson oej at edvina.net
Wed Nov 4 02:00:14 CST 2009



> On 2009-11-03 15:50:16, Russell Bryant wrote:
> > /trunk/main/manager.c, lines 5387-5397
> > <https://reviewboard.asterisk.org/r/421/diff/1/?file=7272#file7272line5387>
> >
> >     Since the operation being performed on each session is so small, it would actually be more efficient to implement this as an ao2_callback().

I take that as a suggestion, right. I just copied this code from another place in the file.


> On 2009-11-03 15:50:16, Russell Bryant wrote:
> > /trunk/main/manager.c, line 5389
> > <https://reviewboard.asterisk.org/r/421/diff/1/?file=7272#file7272line5389>
> >
> >     You have an init() without a destroy().  This will result in a reference leak on the sessions container.

Well, that highlighted the same error in many places. I've committed a fix to manager.c separately. Shows what happens if you copy existing code :-)


> On 2009-11-03 15:50:16, Russell Bryant wrote:
> > /trunk/main/manager.c, line 5392
> > <https://reviewboard.asterisk.org/r/421/diff/1/?file=7272#file7272line5392>
> >
> >     The use of if (!strcasecmp(...)) is more common than == 0.

Well, yes, but it's not wrong though :-) Will fix.


- Olle E


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/421/#review1244
-----------------------------------------------------------


On 2009-11-03 14:48:56, Olle E Johansson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/421/
> -----------------------------------------------------------
> 
> (Updated 2009-11-03 14:48:56)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Implementation of a dialplan function for checking manager accounts. I've made it extensible so that we can add other parameters when needed. Right now it only checks the number of logged in sessions for a manager account.
> 
> 
> Diffs
> -----
> 
>   /trunk/main/manager.c 227348 
> 
> Diff: https://reviewboard.asterisk.org/r/421/diff
> 
> 
> Testing
> -------
> 
> Tested on my Linux system and it reports manager logins properly - 0, 1 and 2 concurrent sessions...
> 
> 
> Thanks,
> 
> Olle E
> 
>




More information about the asterisk-dev mailing list