[asterisk-dev] [Code Review] 3191: channel uniqueid phase 1: convert string uniqueid values to structure with time

rmudgett reviewboard at asterisk.org
Thu Feb 6 16:23:33 CST 2014


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


You seem to be missing some files in the conversion.  test_cdr.c and test_cel.c call ast_channel_linkedid().


/branches/12/channels/chan_mgcp.c
<https://reviewboard.asterisk.org/r/3191/#comment20362>

    The comment isn't necessary here since you are actually fixing a bug.  Only in the commit message should this be noted.  As a reminder, you should note it in the description section of the review.



/branches/12/include/asterisk/channel.h
<https://reviewboard.asterisk.org/r/3191/#comment20367>

    Spacing



/branches/12/include/asterisk/channel.h
<https://reviewboard.asterisk.org/r/3191/#comment20364>

    How about changing the name to:
    ast_channel_id
    
    This way it doesn't have the same name as the ast_channel opaquification accessor function ast_channel_uniqueid().



/branches/12/include/asterisk/channel.h
<https://reviewboard.asterisk.org/r/3191/#comment20365>

    For alignment padding purposes you should put chars after ints.



/branches/12/include/asterisk/channel.h
<https://reviewboard.asterisk.org/r/3191/#comment20366>

    This is redundant since you are defining it earlier in this file.



/branches/12/include/asterisk/channel.h
<https://reviewboard.asterisk.org/r/3191/#comment20368>

    Delete



/branches/12/include/asterisk/channel.h
<https://reviewboard.asterisk.org/r/3191/#comment20369>

    ...is a struct...



/branches/12/include/asterisk/channel.h
<https://reviewboard.asterisk.org/r/3191/#comment20370>

    This function isn't creating a uniqueid struct it is returning the pointer of the oldest linkedid (a or b) passed in.



/branches/12/main/cel.c
<https://reviewboard.asterisk.org/r/3191/#comment20371>

    Just name it uniqueid.  Anything with tmp in it is a rather poor name although tmp_uniqueid is way better than just tmp.



/branches/12/main/cel.c
<https://reviewboard.asterisk.org/r/3191/#comment20372>

    Use ast_copy_string()



/branches/12/main/cel.c
<https://reviewboard.asterisk.org/r/3191/#comment20373>

    Use ast_copy_string()



/branches/12/main/channel.c
<https://reviewboard.asterisk.org/r/3191/#comment20374>

    Move this to after amaflags for padding.



/branches/12/main/channel_internal_api.c
<https://reviewboard.asterisk.org/r/3191/#comment20376>

    The parentheses are unnecessary.



/branches/12/main/channel_internal_api.c
<https://reviewboard.asterisk.org/r/3191/#comment20377>

    The parentheses are unnecessary.



/branches/12/main/channel_internal_api.c
<https://reviewboard.asterisk.org/r/3191/#comment20375>

    Optional:  These asserts should be checking the uniqueid passed in instead of after they have blown away any existing uniqueid.



/branches/12/main/channel_internal_api.c
<https://reviewboard.asterisk.org/r/3191/#comment20378>

    Use snprintf()



/branches/12/main/channel_internal_api.c
<https://reviewboard.asterisk.org/r/3191/#comment20379>

    Use snprintf()



/branches/12/res/ari/resource_channels.c
<https://reviewboard.asterisk.org/r/3191/#comment20382>

    Put the safe comment after this line.



/branches/12/res/res_stasis_snoop.c
<https://reviewboard.asterisk.org/r/3191/#comment20380>

    This looks like another bug fix.  You probably need to fix the line wrapping length here also.



/branches/12/res/res_stasis_snoop.c
<https://reviewboard.asterisk.org/r/3191/#comment20381>

    Put the safe comment after this line:
    strcpy(); /* Safe */


- rmudgett


On Feb. 5, 2014, 4:54 p.m., Scott Griepentrog wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3191/
> -----------------------------------------------------------
> 
> (Updated Feb. 5, 2014, 4:54 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-23120
>     https://issues.asterisk.org/jira/browse/ASTERISK-23120
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This is the first phase of channel uniqueid changes for ASTERISK-23120.
> 
> * ast_channel_uniqueid structure replaces ast_string values uniqueid and linkedid in channel structure
> 
>     struct ast_channel_uniqueid {
>       char unique_id[AST_MAX_UNIQUEID];   /*!< Unique Identifier - can be set on originate */
>       time_t creation_time;               /*!< Creation time */
>       int creation_unique;                /*!< sub-second unique value */
>     }
> 
> * ast_channel_linkedid() and ast_channel_uniqueid() now return ptr to struct, not char *
> 
> * all references to uniqueid & linkedid updated to either pass entire structure because full uniqueid with time must be propagated, or just the ->unique_id string element.
> 
> * an issue with argument order to ast_channel_alloc() in chan_mgcp.c was corrected.
> 
> * there should be a slight performance improvement by removing the ast_string handling of id's, but at the cost of +~300 bytes to the channel structure.
> 
> 
> Diffs
> -----
> 
>   /branches/12/res/stasis/control.c 407418 
>   /branches/12/res/stasis/app.c 407418 
>   /branches/12/res/snmp/agent.c 407418 
>   /branches/12/res/res_stasis_snoop.c 407418 
>   /branches/12/res/res_stasis_recording.c 407418 
>   /branches/12/res/res_stasis_playback.c 407418 
>   /branches/12/res/res_stasis.c 407418 
>   /branches/12/res/res_pjsip_refer.c 407418 
>   /branches/12/res/res_musiconhold.c 407418 
>   /branches/12/res/res_monitor.c 407418 
>   /branches/12/res/res_fax.c 407418 
>   /branches/12/res/res_agi.c 407418 
>   /branches/12/res/parking/parking_bridge_features.c 407418 
>   /branches/12/res/parking/parking_applications.c 407418 
>   /branches/12/res/ari/resource_channels.c 407418 
>   /branches/12/main/stasis_channels.c 407418 
>   /branches/12/main/stasis_bridges.c 407418 
>   /branches/12/main/pbx.c 407418 
>   /branches/12/main/manager.c 407418 
>   /branches/12/main/features.c 407418 
>   /branches/12/main/endpoints.c 407418 
>   /branches/12/main/core_unreal.c 407418 
>   /branches/12/main/channel_internal_api.c 407418 
>   /branches/12/main/channel.c 407418 
>   /branches/12/main/cel.c 407418 
>   /branches/12/main/bridge_channel.c 407418 
>   /branches/12/include/asterisk/channel_internal.h 407418 
>   /branches/12/include/asterisk/channel.h 407418 
>   /branches/12/funcs/func_channel.c 407418 
>   /branches/12/channels/chan_unistim.c 407418 
>   /branches/12/channels/chan_skinny.c 407418 
>   /branches/12/channels/chan_sip.c 407418 
>   /branches/12/channels/chan_pjsip.c 407418 
>   /branches/12/channels/chan_phone.c 407418 
>   /branches/12/channels/chan_oss.c 407418 
>   /branches/12/channels/chan_multicast_rtp.c 407418 
>   /branches/12/channels/chan_motif.c 407418 
>   /branches/12/channels/chan_mgcp.c 407418 
>   /branches/12/channels/chan_iax2.c 407418 
>   /branches/12/channels/chan_console.c 407418 
>   /branches/12/apps/app_voicemail.c 407418 
>   /branches/12/apps/app_queue.c 407418 
>   /branches/12/apps/app_minivm.c 407418 
>   /branches/12/apps/app_followme.c 407418 
>   /branches/12/apps/app_dumpchan.c 407418 
>   /branches/12/apps/app_confbridge.c 407418 
>   /branches/12/apps/app_chanspy.c 407418 
> 
> Diff: https://reviewboard.asterisk.org/r/3191/diff/
> 
> 
> Testing
> -------
> 
> Ran new linkedid_check test and received same results.  Also ran some bridge tests to check for asserts.
> 
> 
> Thanks,
> 
> Scott Griepentrog
> 
>

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


More information about the asterisk-dev mailing list