From: Anthony Minessale Date: Fri, 7 Oct 2011 15:51:02 +0000 (-0500) Subject: only require user and pass in gateway when register is true X-Git-Tag: v1.2-rc1~27^2~357 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=9e4ca2c2a720ead557e87f4732f495f541d3f3ef;p=thirdparty%2Ffreeswitch.git only require user and pass in gateway when register is true --- 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)) {