diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index c9e007a95b..376d5271ef 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1341,7 +1341,11 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) } if (switch_strlen_zero(realm)) { - realm = name; + if (switch_strlen_zero(proxy)) { + realm = name; + } else { + realm = proxy; + } } if (switch_strlen_zero(username)) {