[asterisk-dev] [Code Review] ast_callerid restructuring

rmudgett at digium.com rmudgett at digium.com
Thu Jun 10 18:16:33 CDT 2010


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



/trunk/apps/app_setcallerid.c
<https://reviewboard.asterisk.org/r/702/#comment4654>

    Red spot



/trunk/channels/chan_misdn.c
<https://reviewboard.asterisk.org/r/702/#comment4655>

    Red spot


- rmudgett


On 2010-06-10 17:13:55, rmudgett wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/702/
> -----------------------------------------------------------
> 
> (Updated 2010-06-10 17:13:55)
> 
> 
> Review request for Asterisk Developers and Mark Michelson.
> 
> 
> Summary
> -------
> 
> The purpose of this patch is to eliminate struct ast_callerid since it has
> turned into a miscellaneous collection of various party information.
> 
> Eliminate struct ast_callerid and replace it with the following struct
> organization:
> 
> struct ast_party_name {
> 	char *str;
> 	int char_set;
> 	int presentation;
> 	unsigned char valid;
> };
> struct ast_party_number {
> 	char *str;
> 	int plan;
> 	int presentation;
> 	unsigned char valid;
> };
> struct ast_party_subaddress {
> 	char *str;
> 	int type;
> 	unsigned char odd_even_indicator;
> 	unsigned char valid;
> };
> struct ast_party_id {
> 	struct ast_party_name name;
> 	struct ast_party_number number;
> 	struct ast_party_subaddress subaddress;
> 	char *tag;
> };
> struct ast_party_dialed {
> 	struct {
> 		char *str;
> 		int plan;
> 	} number;
> 	struct ast_party_subaddress subaddress;
> 	int transit_network_select;
> };
> struct ast_party_caller {
> 	struct ast_party_id id;
> 	char *ani;
> 	int ani2;
> };
> 
> Note that the "XXX_" prepended to the name and number members in
> ast_party_id in the diff are to ensure that all code has been converted
> and will be renamed when committed.
> 
> 
> The new organization adds some new information as well.
> 
> * The party name and number now have their own presentation value that can
> be manipulated independently.  ISDN supplies the presentation value for
> the name and number at different times with the possibility that they
> could be different.
> 
> * The party name and number now have a valid flag.  Before this change the
> name or number string could be empty if the presentation were restricted.
> Most channel drivers assume that the name or number is then simply not
> available instead of indicating that the name or number was restricted.
> 
> * The party name now has a character set value.  SIP and Q.SIG have the
> ability to indicate what character set a name string is using so it could
> be presented properly.
> 
> * The dialed party now has a numbering plan value that could be useful to
> have available.
> 
> The various channel drivers will need to be updated to support the new
> core features as needed.  They have simply been converted to supply
> current functionality at this time.
> 
> 
> The following items of note were either corrected or enhanced:
> 
> * The CONNECTEDLINE() and REDIRECTING() dialplan functions were
> consolidated into func_callerid.c to share party id handling code.
> 
> * CALLERPRES() is now deprecated because the name and number have their
> own presentation values.
> 
> * Fixed app_alarmreceiver.c write_metadata().  The workstring[] could
> contain garbage.  It also can only contain the caller id number so using
> ast_callerid_parse() on it is silly.  There was also a typo in the
> CALLERNAME if test.
> 
> * Fixed app_rpt.c using ast_callerid_parse() on the channel's caller id
> number string.  ast_callerid_parse() alters the given buffer which in this
> case is the channel's caller id number string.  Then using
> ast_shrink_phone_number() could alter it even more.
> 
> * Fixed caller ID name and number memory leak in chan_usbradio.c.
> 
> * Fixed uninitialized char arrays cid_num[] and cid_name[] in
> sig_analog.c.
> 
> * Protected access to a caller channel with lock in chan_sip.c.
> 
> * Clarified intent of code in app_meetme.c sla_ring_station() and
> dial_trunk().  Also made save all caller ID data instead of just the name
> and number strings.
> 
> * Simplified cdr.c set_one_cid().  It hand coded the ast_callerid_merge()
> function.
> 
> * Corrected some weirdness with app_privacy.c's use of caller
> presentation.
> 
> 
> Diffs
> -----
> 
>   /trunk/UPGRADE.txt 269894 
>   /trunk/addons/chan_ooh323.c 269894 
>   /trunk/apps/app_alarmreceiver.c 269894 
>   /trunk/apps/app_amd.c 269894 
>   /trunk/apps/app_dial.c 269894 
>   /trunk/apps/app_directed_pickup.c 269894 
>   /trunk/apps/app_disa.c 269894 
>   /trunk/apps/app_dumpchan.c 269894 
>   /trunk/apps/app_fax.c 269894 
>   /trunk/apps/app_followme.c 269894 
>   /trunk/apps/app_macro.c 269894 
>   /trunk/apps/app_meetme.c 269894 
>   /trunk/apps/app_minivm.c 269894 
>   /trunk/apps/app_osplookup.c 269894 
>   /trunk/apps/app_parkandannounce.c 269894 
>   /trunk/apps/app_privacy.c 269894 
>   /trunk/apps/app_queue.c 269894 
>   /trunk/apps/app_readexten.c 269894 
>   /trunk/apps/app_rpt.c 269894 
>   /trunk/apps/app_setcallerid.c 269894 
>   /trunk/apps/app_sms.c 269894 
>   /trunk/apps/app_stack.c 269894 
>   /trunk/apps/app_talkdetect.c 269894 
>   /trunk/apps/app_voicemail.c 269894 
>   /trunk/apps/app_while.c 269894 
>   /trunk/apps/app_zapateller.c 269894 
>   /trunk/channels/chan_agent.c 269894 
>   /trunk/channels/chan_console.c 269894 
>   /trunk/channels/chan_dahdi.c 269894 
>   /trunk/channels/chan_gtalk.c 269894 
>   /trunk/channels/chan_h323.c 269894 
>   /trunk/channels/chan_iax2.c 269894 
>   /trunk/channels/chan_jingle.c 269894 
>   /trunk/channels/chan_local.c 269894 
>   /trunk/channels/chan_mgcp.c 269894 
>   /trunk/channels/chan_misdn.c 269894 
>   /trunk/channels/chan_oss.c 269894 
>   /trunk/channels/chan_phone.c 269894 
>   /trunk/channels/chan_sip.c 269894 
>   /trunk/channels/chan_skinny.c 269894 
>   /trunk/channels/chan_unistim.c 269894 
>   /trunk/channels/chan_usbradio.c 269894 
>   /trunk/channels/chan_vpb.cc 269894 
>   /trunk/channels/sig_analog.h 269894 
>   /trunk/channels/sig_analog.c 269894 
>   /trunk/channels/sig_pri.c 269894 
>   /trunk/channels/sig_ss7.c 269894 
>   /trunk/funcs/func_blacklist.c 269894 
>   /trunk/funcs/func_callerid.c 269894 
>   /trunk/funcs/func_connectedline.c 269894 
>   /trunk/funcs/func_dialplan.c 269894 
>   /trunk/funcs/func_redirecting.c 269894 
>   /trunk/include/asterisk/callerid.h 269894 
>   /trunk/include/asterisk/channel.h 269894 
>   /trunk/main/app.c 269894 
>   /trunk/main/callerid.c 269894 
>   /trunk/main/ccss.c 269894 
>   /trunk/main/cdr.c 269894 
>   /trunk/main/cel.c 269894 
>   /trunk/main/channel.c 269894 
>   /trunk/main/cli.c 269894 
>   /trunk/main/dial.c 269894 
>   /trunk/main/features.c 269894 
>   /trunk/main/file.c 269894 
>   /trunk/main/manager.c 269894 
>   /trunk/main/pbx.c 269894 
>   /trunk/res/res_agi.c 269894 
>   /trunk/res/snmp/agent.c 269894 
>   /trunk/tests/test_substitution.c 269894 
> 
> Diff: https://reviewboard.asterisk.org/r/702/diff
> 
> 
> Testing
> -------
> 
> Compile testing.  SIP and ISDN Q.SIG calls with CONNECTEDLINE, REDIRECTING, and CALLERID values set and read.
> 
> 
> Thanks,
> 
> rmudgett
> 
>




More information about the asterisk-dev mailing list