Summary:ASTERISK-05416: calls to ast_request_and_dial should have a uniform way to inherit variables from a parent channel when necessary
Reporter:BJ Weschke (bweschke)Labels:
Date Opened:2005-11-01 13:08:01.000-0600Date Closed:2008-01-15 15:53:25.000-0600
Versions:Frequency of
Environment:Attachments:( 0) parkandannounce-inheritance.2.patch
( 1) parkandannounce-inheritance.patch
Description: outgoing_helper struct has been modified to contain a parent_channel pointer that, when used with __ast_request_and_dial, the channel inheritance function will be called against it. app_parkandannounce is one of the applications that needs this and the fix for that app is included in this patch.
Comments:By: Kevin P. Fleming (kpfleming) 2005-11-01 15:28:49.000-0600

Review notes:

1) The formatting of the changes in channel.c seems to be off; you are adding if statements but not indenting the conditional statements. Also, are these necessary? The current code just runs these functions regardless of whether all the fields in the oh structure are populated or not...

2) There is no need to individually set all the fields of the oh structure to NULL; just memset() the whole thing to zeros.

By: BJ Weschke (bweschke) 2005-11-01 15:43:49.000-0600

Formatting is fixed in new patch. They weren't previously necessary because LOAD_OH in pbx.c was the only code that seemed to be populating oh and using __ast_request_and_dial, but if I start memsetting oh to zero's and don't have them in there, I think I'm going to segfault, no? The setting of cid_num and cid_name from oh struct also seems a waste of an instruction because it's going to get reset with the function parameters regardless as soon as you clear that conditional brace if oh exists.

By: Kevin P. Fleming (kpfleming) 2005-11-01 16:20:15.000-0600

Your analysis is correct.

Committed to CVS HEAD, thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:53:25.000-0600

Repository: asterisk
Revision: 6935

U   trunk/ChangeLog
U   trunk/apps/app_parkandannounce.c
U   trunk/channel.c
U   trunk/include/asterisk/channel.h

r6935 | kpfleming | 2008-01-15 15:53:24 -0600 (Tue, 15 Jan 2008) | 2 lines

issue ASTERISK-5416