diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index a8d9324a46..f01aaf2914 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -141,8 +141,10 @@ void sofia_sub_check_gateway(sofia_profile_t *profile, time_t now) gw_sub_ptr->expires_str = "0"; } - user_via = sofia_glue_create_external_via(NULL, gateway_ptr->profile, gateway_ptr->register_transport); - + if (sofia_glue_check_nat(gateway_ptr->profile, gateway_ptr->register_proxy)) { + user_via = sofia_glue_create_external_via(NULL, gateway_ptr->profile, gateway_ptr->register_transport); + } + switch (ostate) { case SUB_STATE_NOSUB: break;