summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorMatt Jordan <mjordan@digium.com>2015-07-08 16:35:36 -0500
committerMatt Jordan <mjordan@digium.com>2015-07-14 19:15:14 -0500
commitcd2213f1ae7ef14b9a7d50984a5dd4b431a8e195 (patch)
tree8d13d77e42e899cfa6d9a8aeb39b06ff8b79c5f3 /res
parent2e4bdbd78adb4df16af1132df8e58f464e039cd4 (diff)
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
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip/pjsip_configuration.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index 9a383a25a..90a2650c0 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -700,7 +700,7 @@ static int media_encryption_handler(const struct aco_option *opt, struct ast_var
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",
};
@@ -1925,8 +1925,8 @@ int ast_res_pjsip_initialize_configuration(const struct ast_module_info *ast_mod
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");