[Asterisk-code-review] res pjsip/configuration: Fix a variety of default value prob... (asterisk[master])

Matt Jordan asteriskteam at digium.com
Sat Jul 11 12:22:25 CDT 2015


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/873

Change subject: res_pjsip/configuration: Fix a variety of default value problems
......................................................................

res_pjsip/configuration: Fix a variety of default value problems

This patch fixes some bad default value handling in the following
settings:

* The 'message_context' and 'accountcode' settings are not mandatory. As
  such, we can allow their stringfield values to be empty.
* The 'media_encryption' setting applies a default value of 'none' to
  the setting, which it then can't parse or understand. Since the value
  is documented to be 'no', this will now apply that as the default
  value.

Change-Id: Ib9be7f97a7a5b9bc7aee868edf5acf38774cff83
---
M res/res_pjsip/pjsip_configuration.c
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/73/873/1

diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index d4fa152..e2e5e06 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -700,7 +700,7 @@
 
 static const char *media_encryption_map[] = {
 	[AST_SIP_MEDIA_TRANSPORT_INVALID] = "invalid",
-	[AST_SIP_MEDIA_ENCRYPT_NONE] = "none",
+	[AST_SIP_MEDIA_ENCRYPT_NONE] = "no",
 	[AST_SIP_MEDIA_ENCRYPT_SDES] = "sdes",
 	[AST_SIP_MEDIA_ENCRYPT_DTLS] = "dtls",
 };
@@ -1926,8 +1926,8 @@
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "g726_non_standard", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.g726_non_standard));
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "redirect_method", "user", redirect_handler, NULL, NULL, 0, 0);
 	ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "set_var", "", set_var_handler, set_var_to_str, set_var_to_vl, 0, 0);
-	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "message_context", "", OPT_STRINGFIELD_T, 1, STRFLDSET(struct ast_sip_endpoint, message_context));
-	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "accountcode", "", OPT_STRINGFIELD_T, 1, STRFLDSET(struct ast_sip_endpoint, accountcode));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "message_context", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, message_context));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "accountcode", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, accountcode));
 
 	if (ast_sip_initialize_sorcery_transport()) {
 		ast_log(LOG_ERROR, "Failed to register SIP transport support with sorcery\n");

-- 
To view, visit https://gerrit.asterisk.org/873
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9be7f97a7a5b9bc7aee868edf5acf38774cff83
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list