]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
only require user and pass in gateway when register is true
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 7 Oct 2011 15:51:02 +0000 (10:51 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 7 Oct 2011 15:51:02 +0000 (10:51 -0500)
src/mod/endpoints/mod_sofia/sofia.c

index f3ab8c48ef2c8223af378dfd240d74fa87115437..2e94993ed0f19a8703ad31e61f0480df02bf0d25 100644 (file)
@@ -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)) {