Index: conf/sofia.conf.xml =================================================================== --- conf/sofia.conf.xml (revision 4930) +++ conf/sofia.conf.xml (working copy) @@ -10,6 +10,8 @@ + + Index: src/mod/endpoints/mod_sofia/mod_sofia.c =================================================================== --- src/mod/endpoints/mod_sofia/mod_sofia.c (revision 4930) +++ src/mod/endpoints/mod_sofia/mod_sofia.c (working copy) @@ -878,7 +878,9 @@ } profile = gateway_ptr->profile; - tech_pvt->gateway_from_str = switch_core_session_strdup(nsession, gateway_ptr->register_from); + if (gateway_ptr->force_fromuser) { + tech_pvt->gateway_from_str = switch_core_session_strdup(nsession, gateway_ptr->register_from); + } if (!strchr(dest, '@')) { tech_pvt->dest = switch_core_session_sprintf(nsession, "sip:%s@%s", dest, gateway_ptr->register_proxy + 4); } else { Index: src/mod/endpoints/mod_sofia/sofia.c =================================================================== --- src/mod/endpoints/mod_sofia/sofia.c (revision 4930) +++ src/mod/endpoints/mod_sofia/sofia.c (working copy) @@ -676,7 +676,7 @@ if ((gateway = switch_core_alloc(profile->pool, sizeof(*gateway)))) { char *register_str = "true", *scheme = "Digest", *realm = NULL, - *username = NULL, *password = NULL, *extension = NULL, *proxy = NULL, *context = "default", *expire_seconds = "3600"; + *username = NULL, *password = NULL, *force_fromuser = "false", *extension = NULL, *proxy = NULL, *context = "default", *expire_seconds = "3600"; gateway->pool = profile->pool; gateway->profile = profile; @@ -698,6 +698,8 @@ username = val; } else if (!strcmp(var, "password")) { password = val; + } else if (!strcmp(var, "force-fromuser")) { + force_fromuser = val; } else if (!strcmp(var, "extension")) { extension = val; } else if (!strcmp(var, "proxy")) { @@ -741,6 +743,7 @@ gateway->register_realm = switch_core_strdup(gateway->pool, realm); gateway->register_username = switch_core_strdup(gateway->pool, username); gateway->register_password = switch_core_strdup(gateway->pool, password); + gateway->force_fromuser = switch_true(force_fromuser); gateway->register_from = switch_core_sprintf(gateway->pool, "sip:%s@%s", username, realm); gateway->register_contact = switch_core_sprintf(gateway->pool, "sip:%s@%s:%d", extension, profile->sipip, profile->sip_port); Index: src/mod/endpoints/mod_sofia/mod_sofia.h =================================================================== --- src/mod/endpoints/mod_sofia/mod_sofia.h (revision 4930) +++ src/mod/endpoints/mod_sofia/mod_sofia.h (working copy) @@ -176,6 +176,7 @@ char *register_realm; char *register_username; char *register_password; + switch_bool_t force_fromuser; char *register_from; char *register_contact; char *register_to;