From 9e4ca2c2a720ead557e87f4732f495f541d3f3ef Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 7 Oct 2011 10:51:02 -0500 Subject: [PATCH] only require user and pass in gateway when register is true --- src/mod/endpoints/mod_sofia/sofia.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index f3ab8c48ef..2e94993ed0 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -2416,14 +2416,16 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) } } - if (zstr(username)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: username param is REQUIRED!\n"); - goto skip; - } + if (switch_true(register_str)) { + if (zstr(username)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: username param is REQUIRED!\n"); + goto skip; + } - if (zstr(password)) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: password param is REQUIRED!\n"); - goto skip; + if (zstr(password)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR: password param is REQUIRED!\n"); + goto skip; + } } if (zstr(from_user)) {