Review Board 1.7.16

Extended maximum number of pickupgroups (callgroup/pickupgroup)

Review Request #2043 - Created July 13, 2012 and submitted

Guenther Kelleter
mjordan, mmichelson, tarimont
This patch adds the feature "Extended maximum number of pickupgroups (callgroup/pickupgroup)".

The feature is implemented as named pickup/call groups which can be used in parallel to but independent from the already known numbered call/pickup groups. Named groups will allow an unlimited number of pickup/call groups.
Named groups are configured with the keywords "namedcallgroup" and "namedpickupgroup" (conforming to "callgroup" and "pickupgroup").
A namedpickupgroup "4" does not match the callgroup number 4.

Additionally the behavior of the undirected pickup is changed so that the oldest ringing channel (creation time of the channel) is picked up when more than one channel could be picked up. This will be required by another new feature which is yet to be posted.

A few words to describe the implementation:
Names of named groups are collected in a container at configuration time of a user. This container will be copied (in fact referenced) around to the channels in parallel with the numbered groups bitfield.
When an undirected pickup is executed, the pickup and call groups are matched against each other, and the oldest target channel which matches is chosen. Notably there is almost no overhead for the named group handling when no pickup is executed, except referencing of the containers.
Call pickup tested for sip, dahdi and misdn channels. Reference counter handling of ao2_container (which includes the group names) checked with additional debug output.
Review request changed
Updated (July 31, 2012, 5:08 a.m.)
New patch against Rev 370598:

Introduced struct ast_namedgroups (opaque) to hide the ao2_container from users, so they have to use the named-group-API functions. Similar to the ast_channel_callid() handling as described by Thomas.
Moved referencing/unreferencing of ast_namedgroups objects into channel namedgroup setters.

Fixed a bug where the groupnames were hashed case sensitive but compared insensitive. It is intended that group names are case sensitive.
Fixed a bug where group names could be added more than once to a container, which is useless and wastes time during evaluation if groups match.
Ship it!
Posted (Aug. 2, 2012, 8:40 a.m.)
I'm giving this another ship it! Tilghman may want to have another look to see if it fulfills the requests he made.
  1. Go ahead and ship it. runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to