[asterisk-dev] [Code Review]: app_queue log membername when state_interface is set for ADDMEMBER and REMOVEMEMBER events.

jamuel reviewboard at asterisk.org
Sun Jul 10 23:18:43 CDT 2011



> On July 3, 2011, 11:25 a.m., irroot wrote:
> > This is looking good few minor changes ... this has caused me some problems and elborate SQL has worked arround it.
> > 
> > good job think its almost there.
> > 
> > Greg

Thank you for the review.  I've refactored my patch based on your suggestions.


> On July 3, 2011, 11:25 a.m., irroot wrote:
> > http://svn.asterisk.org/svn/asterisk/trunk/apps/app_queue.c, lines 6752-6754
> > <https://reviewboard.asterisk.org/r/1286/diff/4/?file=17354#file17354line6752>
> >
> >     keep the name and variable consistent see above also maintain the convention of _ not -.

changed to log_membername_as_agent as mentioned above.


> On July 3, 2011, 11:25 a.m., irroot wrote:
> > http://svn.asterisk.org/svn/asterisk/trunk/apps/app_queue.c, lines 7906-7914
> > <https://reviewboard.asterisk.org/r/1286/diff/4/?file=17354#file17354line7906>
> >
> >     Someone took a kid to the office and gave them a red marker.

Good thing it was dry erase marker.


> On July 3, 2011, 11:25 a.m., irroot wrote:
> > http://svn.asterisk.org/svn/asterisk/trunk/configs/queues.conf.sample, lines 68-73
> > <https://reviewboard.asterisk.org/r/1286/diff/4/?file=17355#file17355line68>
> >
> >     maintain naming / variable / separator consistency.

Done.


> On July 3, 2011, 11:25 a.m., irroot wrote:
> > http://svn.asterisk.org/svn/asterisk/trunk/apps/app_queue.c, lines 7587-7605
> > <https://reviewboard.asterisk.org/r/1286/diff/4/?file=17354#file17354line7587>
> >
> >     See Above.

Done.


> On July 3, 2011, 11:25 a.m., irroot wrote:
> > http://svn.asterisk.org/svn/asterisk/trunk/apps/app_queue.c, lines 954-956
> > <https://reviewboard.asterisk.org/r/1286/diff/4/?file=17354#file17354line954>
> >
> >     rather match this to the option in queues.conf to maintain consistancy.

Changed logmembername to log_membername_as_agent globally.


> On July 3, 2011, 11:25 a.m., irroot wrote:
> > http://svn.asterisk.org/svn/asterisk/trunk/apps/app_queue.c, lines 5728-5745
> > <https://reviewboard.asterisk.org/r/1286/diff/4/?file=17354#file17354line5728>
> >
> >     This should probably be a new function as you repeat it bellow twice rather put repetitive blocks into a function.
> >     
> >     it would be better to use load_realtime_queue(name) to find the queue as there is no guarantee the queue you looking for is loaded into memory.
> >     
> >     
> >

Created function find_member_by_queuename_and_interface that returns a struct member or NULL (if not found).


> On July 3, 2011, 11:25 a.m., irroot wrote:
> > http://svn.asterisk.org/svn/asterisk/trunk/apps/app_queue.c, lines 7930-7948
> > <https://reviewboard.asterisk.org/r/1286/diff/4/?file=17354#file17354line7930>
> >
> >     See Above.

Done.


- jamuel


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


On July 10, 2011, 11:08 p.m., jamuel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1286/
> -----------------------------------------------------------
> 
> (Updated July 10, 2011, 11:08 p.m.)
> 
> 
> Review request for Asterisk Developers, Tilghman Lesher, leifmadsen, opticron, and irroot.
> 
> 
> Summary
> -------
> 
> app_queue logs the events ADDMEMBER and REMOVEMEMBER with the agent field set to the interface value rather than the membername value when a member is added with a state_interface value set.  However all other member related queue events are logged with the membername when a state_interface is set. It would seem that these ADD/REMOVE MEMBER events should log the agent field in the same manner. 
> 
> This patch addresses the original issue reported in https://issues.asterisk.org/jira/browse/ASTERISK-14769 by providing a queues.conf general configuration option log_membername_as-agent. Setting log_membername_as_agent = yes will cause the membername to be logged in the agent field for ADDMEMBER and REMOVEMEMBER queue events if a state_interface has been set.
> 
> The default value (log_membername_as_agent = no) does not alter the existing logging for the ADDMEMBER and REMOVEMEMBER events to maintain existing (buggy) behavior for the sake of backwards compatibility. 
> 
> 
> This addresses bug https://issues.asterisk.org/jira/browse/ASTERISK-14769.
>     https://issues.asterisk.org/jira/browse/https://issues.asterisk.org/jira/browse/ASTERISK-14769
> 
> 
> Diffs
> -----
> 
>   http://svn.asterisk.org/svn/asterisk/trunk/apps/app_queue.c 327410 
>   http://svn.asterisk.org/svn/asterisk/trunk/configs/queues.conf.sample 327410 
> 
> Diff: https://reviewboard.asterisk.org/r/1286/diff
> 
> 
> Testing
> -------
> 
> Tested add, remove, pause, unpause via AMI, CLI, and Dialplan apps and see the correct log output to queue_log.  Also tested with log_membername_as_agent omitted to insure backward compatibility for those queues.conf that might not be updated for this new option. 
> 
> Sample test plan (add and remove)
> ---------------------------------
> 
> set log_membername_as_agent = yes in queues.conf
> 
> AMI:
> ====
> Action: QueueAdd
> Queue: 4152000400
> Interface: Local/4152000501 at from-internal/n
> Penalty: 0
> Paused: 0
> MemberName: Edward Frank
> 
> Action: QueueRemove
> Queue: 4152000400
> Interface: Local/4152000501 at from-internal/n
> 
> 
> Action: QueueAdd
> Queue: 4152000400
> Interface: Local/4152000501 at from-internal/n
> 
> Action: QueueRemove
> Queue: 4152000400
> Interface: Local/4152000501 at from-internal/n
> 
> 
> CLI:
> ====
> > queue add member Local/4152000501 at from-internal/n to 4152000400 penalty 0 as "Edward Frank" state_interface Sip/SOFTJPS
> > queue remove member Local/4152000501 at from-internal/n from 4152000400
> 
> > queue add member Local/4152000501 at from-internal/n to 4152000400
> > queue remove member Local/4152000501 at from-internal/n from 4152000400
> 
> Dialplan:
> =========
> 
> [from-test]
> exten => 1234,1,AddQueueMember(4152000400,Local/4152000501 at from-internal/n,0,,Edward Davis,Sip/SOFTJPS)
> exten => 1234,n,RemoveQueueMember(4152000400,Local/4152000501 at from-internal/n)
> exten => 1234,n,Hangup()
> 
> exten => 5678,1,AddQueueMember(4152000400,Local/4152000501 at from-internal/n,0)
> exten => 5678,n,RemoveQueueMember(4152000400,Local/4152000501 at from-internal/n)
> exten => 5678,n,Hangup()
> 
> 
> Rinse and repeat with log_membername_as_agent = no
> Repeat with log_membername_as_agent omitted.
> 
> 
> Thanks,
> 
> jamuel
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110711/7af4b0d3/attachment-0001.htm>


More information about the asterisk-dev mailing list