[asterisk-dev] Request for testing: team/russell/chan_refcount

Russell Bryant russell at digium.com
Thu Dec 27 14:20:26 CST 2007


Greetings,

I have a branch that is ready for testing.  It converts struct ast_channel over
to astobj2.  Instead of a single linked list, the channels are stored in a hash
table.  The hash value is based on the channel's name since the most common
lookup done for a channel is by name.

This set of changes is mostly for performance.  However, since it includes
reference counting of the object, as well, it makes ensuring that an ast_channel
doesn't go away much easier by just holding a reference instead of having to
hold the channel lock.  Channel lookups by name are now be _much_ faster.
Traversing the channel list in any way is now _much_ faster, as well.

This set of changes affects the core channel handling in Asterisk, so there
isn't any specific set of things that need to be tested.  Pretty much any usage
of Asterisk will exercise these changes in some way.  The types of failures that
I would expect to see, if any, are crashes, or perhaps more likely, channels
that don't go away (entries in "core show channels" that stick around).

If you have some free time, throw the code on a test server and see what
happens.  I still have some more documentation work to complete, but the code is
done, as far as I know.

svn co http://svn.digium.com/svn/asterisk/team/russell/chan_refcount

diffstat of this branch versus trunk:

 apps/app_channelredirect.c |    6
 apps/app_chanspy.c         |   47 +-
 apps/app_directed_pickup.c |   26 +
 apps/app_minivm.c          |    2
 apps/app_mixmonitor.c      |   25 -
 apps/app_pickupchan.c      |   22 -
 apps/app_senddtmf.c        |   12
 apps/app_softhangup.c      |   41 +-
 apps/app_voicemail.c       |   12
 apps/app_zapscan.c         |   52 ++-
 channels/chan_agent.c      |   13
 channels/chan_local.c      |    4
 channels/chan_zap.c        |   16
 funcs/func_logic.c         |   10
 funcs/func_odbc.c          |   16
 include/asterisk/app.h     |   10
 include/asterisk/astobj2.h |   22 +
 include/asterisk/cdr.h     |   45 ++
 include/asterisk/channel.h |  104 ++++--
 include/asterisk/compat.h  |    1
 include/asterisk/lock.h    |   26 -
 include/asterisk/manager.h |    2
 include/asterisk/pbx.h     |   26 +
 main/astobj2.c             |   38 ++
 main/audiohook.c           |    5
 main/channel.c             |  751 +++++++++++++++++++--------------------------
 main/cli.c                 |   81 +++-
 main/devicestate.c         |    5
 main/logger.c              |    4
 main/manager.c             |  127 +++++--
 main/pbx.c                 |   25 +
 res/res_agi.c              |   16
 res/res_features.c         |  134 +++++---
 res/res_monitor.c          |   89 +++--
 res/snmp/agent.c           |   57 ++-
 35 files changed, 1080 insertions(+), 792 deletions(-)

-- 
Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.



More information about the asterisk-dev mailing list