-
Notifications
You must be signed in to change notification settings - Fork 41
RDKB-62810,RDKB-62812:Initialize the default variables for Virtual Voice Interface creation #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
0a3293d
18a8f27
9ec72c7
af6fb95
99fbc60
0ad0623
65c01cf
3caa07e
6440c35
241dcde
e3fcff2
62c3669
5893aed
72b32fb
0de112f
c3f88ae
b4546c7
52f8ccb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1449,6 +1449,18 @@ STATIC void addInSysCfgdDB (char *key, char *value) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set_syscfg_partner_values( value,"IPv6PrimaryDhcpServerOptions" ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Enabled")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1452
to
+1458
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1453
to
+1462
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| } | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| } | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| } | |
| } |
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new nested if-statements here omit braces, unlike the surrounding convention in this function (each key match uses a braced block). Please add braces around the new conditions to avoid future dangling-statement mistakes and keep style consistent.
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Enabled")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Enabled")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Enabled")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Enabled"); | |
| } | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_IfaceName")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_IfaceName"); | |
| } | |
| } | |
| if (0 == strcmp(key, "Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode")) | |
| { | |
| if (0 == IsValuePresentinSyscfgDB("VoiceSupport_Mode")) | |
| { | |
| set_syscfg_partner_values(value, "VoiceSupport_Mode"); | |
| } | |
| } |
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same concern as above: this change only affects apply_system_defaults.c, but PARTNER_DEFAULT_EXT builds use apply_system_defaults_syscfg.c + apply_system_defaults_helper.c instead. If SCXF10 (or any target needing these keys) uses PARTNER_DEFAULT_EXT, VoiceSupport_* updates won’t happen. Please replicate this mapping in the PARTNER_DEFAULT_EXT code path.
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing empty string validation before setting the value. The existing code pattern in this function consistently checks whether the string is not empty before calling set_syscfg_partner_values. For example, lines 3044 and 3059 check if the string's first character is not null terminator using conditions like "if(pridhcpoption[0]!='\0')". The new code checks if the pointer is not NULL but doesn't verify that the string is not empty, which could lead to setting empty values in the configuration.
| if(pVoiceSupportEnabled != NULL) | |
| if((pVoiceSupportEnabled != NULL) && (pVoiceSupportEnabled[0] != '\0')) |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary pointer nullification. Setting the local pointer to NULL after use (line 3107) is unnecessary and inconsistent with similar code patterns. The pointer is a local variable that goes out of scope at the end of the if block, so nullifying it serves no purpose. While some other code in this file does this (e.g., lines 3018, 3047), many newer patterns like lines 3150-3155 don't, and it's considered an anti-pattern as it provides no actual benefit for local variables with limited scope.
| pVoiceSupportEnabled = NULL; |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing else clause for error handling. The existing code pattern in this function consistently includes an else clause that prints an error message when the outer if condition fails (paramObjVal is NULL). For example, lines 3050-3053, 3065-3068, 3080-3083, and 3095-3098 all include an else clause with an APPLY_PRINT statement. The new code blocks should follow the same error handling pattern for consistency and debugging purposes.
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary pointer nullification. Setting the local pointer to NULL after use (line 3122) is unnecessary and inconsistent with similar code patterns. The pointer is a local variable that goes out of scope at the end of the if block, so nullifying it serves no purpose. While some other code in this file does this (e.g., lines 3018, 3047), many newer patterns like lines 3150-3155 don't, and it's considered an anti-pattern as it provides no actual benefit for local variables with limited scope.
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing empty string validation before setting the value. The existing code pattern in this function consistently checks whether the string is not empty before calling set_syscfg_partner_values. For example, lines 3044 and 3059 check if the string's first character is not null terminator using conditions like "if(pridhcpoption[0]!='\0')". The new code checks if the pointer is not NULL but doesn't verify that the string is not empty, which could lead to setting empty values in the configuration.
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing else clause for error handling. The existing code pattern in this function consistently includes an else clause that prints an error message when the outer if condition fails (paramObjVal is NULL). For example, lines 3050-3053, 3065-3068, 3080-3083, and 3095-3098 all include an else clause with an APPLY_PRINT statement. The new code blocks should follow the same error handling pattern for consistency and debugging purposes.
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing empty string validation before setting the value. The existing code pattern in this function consistently checks whether the string is not empty before calling set_syscfg_partner_values. For example, lines 3044 and 3059 check if the string's first character is not null terminator using conditions like "if(pridhcpoption[0]!='\0')". The new code checks if the pointer is not NULL but doesn't verify that the string is not empty, which could lead to setting empty values in the configuration.
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary pointer nullification. Setting the local pointer to NULL after use (line 3137) is unnecessary and inconsistent with similar code patterns. The pointer is a local variable that goes out of scope at the end of the if block, so nullifying it serves no purpose. While some other code in this file does this (e.g., lines 3018, 3047), many newer patterns like lines 3150-3155 don't, and it's considered an anti-pattern as it provides no actual benefit for local variables with limited scope.
| pVoiceSupportMode = NULL; |
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In apply_partnerId_default_values, the new VoiceSupport values are written to syscfg even when the JSON value is an empty string. Nearby parameters check for non-empty strings before applying defaults (e.g., StartupIPMode, DHCP options). Consider also verifying the cJSON item is a string and non-empty before calling set_syscfg_partner_values to avoid clobbering defaults with empty values.
| char *pVoiceSupportEnabled = NULL; | |
| pVoiceSupportEnabled = paramObjVal->valuestring; | |
| if(pVoiceSupportEnabled != NULL) | |
| { | |
| set_syscfg_partner_values(pVoiceSupportEnabled,"VoiceSupport_Enabled"); | |
| pVoiceSupportEnabled = NULL; | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportEnabled Value is NULL\n", __FUNCTION__ ); | |
| } | |
| } | |
| paramObjVal = cJSON_GetObjectItem(cJSON_GetObjectItem(partnerObj,"Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName"),"ActiveValue"); | |
| if(paramObjVal != NULL) | |
| { | |
| char *pVoiceSupportIfaceName = NULL; | |
| pVoiceSupportIfaceName = paramObjVal->valuestring; | |
| if(pVoiceSupportIfaceName != NULL) | |
| { | |
| set_syscfg_partner_values(pVoiceSupportIfaceName,"VoiceSupport_IfaceName"); | |
| pVoiceSupportIfaceName = NULL; | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportIfaceName Value is NULL\n", __FUNCTION__ ); | |
| } | |
| } | |
| paramObjVal = cJSON_GetObjectItem(cJSON_GetObjectItem(partnerObj,"Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode"),"ActiveValue"); | |
| if(paramObjVal != NULL) | |
| { | |
| char *pVoiceSupportMode = NULL; | |
| pVoiceSupportMode = paramObjVal->valuestring; | |
| if(pVoiceSupportMode != NULL) | |
| { | |
| set_syscfg_partner_values(pVoiceSupportMode,"VoiceSupport_Mode"); | |
| pVoiceSupportMode = NULL; | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportMode Value is NULL\n", __FUNCTION__ ); | |
| if(cJSON_IsString(paramObjVal) && (paramObjVal->valuestring != NULL) && (paramObjVal->valuestring[0] != '\0')) | |
| { | |
| set_syscfg_partner_values(paramObjVal->valuestring,"VoiceSupport_Enabled"); | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportEnabled Value is NULL or empty or not a string\n", __FUNCTION__ ); | |
| } | |
| } | |
| paramObjVal = cJSON_GetObjectItem(cJSON_GetObjectItem(partnerObj,"Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.InterfaceName"),"ActiveValue"); | |
| if(paramObjVal != NULL) | |
| { | |
| if(cJSON_IsString(paramObjVal) && (paramObjVal->valuestring != NULL) && (paramObjVal->valuestring[0] != '\0')) | |
| { | |
| set_syscfg_partner_values(paramObjVal->valuestring,"VoiceSupport_IfaceName"); | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportIfaceName Value is NULL or empty or not a string\n", __FUNCTION__ ); | |
| } | |
| } | |
| paramObjVal = cJSON_GetObjectItem(cJSON_GetObjectItem(partnerObj,"Device.X_RDKCENTRAL-COM_Epon_MTA.VoiceSupport.Mode"),"ActiveValue"); | |
| if(paramObjVal != NULL) | |
| { | |
| if(cJSON_IsString(paramObjVal) && (paramObjVal->valuestring != NULL) && (paramObjVal->valuestring[0] != '\0')) | |
| { | |
| set_syscfg_partner_values(paramObjVal->valuestring,"VoiceSupport_Mode"); | |
| } | |
| else | |
| { | |
| APPLY_PRINT("%s - VoiceSupportMode Value is NULL or empty or not a string\n", __FUNCTION__ ); |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing else clause for error handling. The existing code pattern in this function consistently includes an else clause that prints an error message when the outer if condition fails (paramObjVal is NULL). For example, lines 3050-3053, 3065-3068, 3080-3083, and 3095-3098 all include an else clause with an APPLY_PRINT statement. The new code blocks should follow the same error handling pattern for consistency and debugging purposes.
Copilot
AI
Feb 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation of the newly added VoiceSupport block is inconsistent with the surrounding code in this function (many adjacent statements are unindented or use a different tab depth). Please reformat this block to match the local indentation style to keep future edits safe and readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cVoiceRuleis limited to 64 bytes, but it is used to hold an entire iptables rule string from theVoiceIpRulesysevent key and then printed directly into the firewall script. Other sysevent-based firewall rule helpers (e.g.prepare_hotspot_gre_ipv4_ruleat firewall.c:10943) use aMAX_QUERY-sized buffer, so this smaller buffer risks truncating longer rules and generating malformed firewall lines; consider using the sameMAX_QUERY-sized buffer and pattern here.