[asterisk-dev] [Code Review] 4466: logger: Replace 'struct ast_callid' with unsigned int's.

Corey Farrell reviewboard at asterisk.org
Thu Mar 12 20:12:53 CDT 2015


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

(Updated March 12, 2015, 8:12 p.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers.


Changes
-------

Committed in revision 432834


Bugs: ASTERISK-24833
    https://issues.asterisk.org/jira/browse/ASTERISK-24833


Repository: Asterisk


Description
-------

The logger currently uses an AO2 to store a callid (int).  This patch changes callid's to 'unsigned int'.  AO2 is not needed for callid's.

This also fixes a theoretical infinate loop if a callid is subjected to an extra unreference but left in threadstorage.  If ast_log tries getting an already released callid from threadstorage, ao2_ref will log an error.  This would cause ast_log to try grabbing a reference to the callid again (same thread).  The probability of this is very low and requires other code to be broken, but it's not impossible.

Change in behaviour: currently the first callid == 0.  This patch changes the first callid to 1 since 0 now represents the lack of callid.


Diffs
-----

  /trunk/res/ari/resource_bridges.c 432661 
  /trunk/main/pbx.c 432661 
  /trunk/main/logger.c 432661 
  /trunk/main/features.c 432661 
  /trunk/main/dial.c 432661 
  /trunk/main/core_unreal.c 432661 
  /trunk/main/core_local.c 432661 
  /trunk/main/cli.c 432661 
  /trunk/main/channel_internal_api.c 432661 
  /trunk/main/channel.c 432661 
  /trunk/main/bridge_channel.c 432661 
  /trunk/main/bridge_basic.c 432661 
  /trunk/main/bridge.c 432661 
  /trunk/main/autoservice.c 432661 
  /trunk/include/asterisk/logger.h 432661 
  /trunk/include/asterisk/core_unreal.h 432661 
  /trunk/include/asterisk/channel.h 432661 
  /trunk/include/asterisk/bridge_channel.h 432661 
  /trunk/include/asterisk/bridge.h 432661 
  /trunk/channels/sip/include/sip.h 432661 
  /trunk/channels/sip/include/dialog.h 432661 
  /trunk/channels/sip/dialplan_functions.c 432661 
  /trunk/channels/sig_ss7.c 432661 
  /trunk/channels/sig_pri.c 432661 
  /trunk/channels/sig_analog.c 432661 
  /trunk/channels/chan_sip.c 432661 
  /trunk/channels/chan_motif.c 432661 
  /trunk/channels/chan_iax2.c 432661 
  /trunk/channels/chan_dahdi.c 432661 
  /trunk/channels/chan_bridge_media.c 432661 
  /trunk/apps/confbridge/conf_chan_announce.c 432661 
  /trunk/apps/app_mixmonitor.c 432661 
  /trunk/UPGRADE.txt 432661 

Diff: https://reviewboard.asterisk.org/r/4466/diff/


Testing
-------

Ran a couple tests against chan_sip and chan_iax2, visually inspected log files.
My dev system doesn't build chan_dahdi (ever), so Matt Jordan verified it still compiles.


Thanks,

Corey Farrell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150313/aae6ad5d/attachment.html>


More information about the asterisk-dev mailing list