From: Anthony Minessale Date: Tue, 29 Sep 2009 02:07:17 +0000 (+0000) Subject: set extension=auto_to_user in gateway to make destination equal to user X-Git-Tag: v1.0.6~1778 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8a748d32ab8023536e6936b5fef772059e6429d;p=thirdparty%2Ffreeswitch.git set extension=auto_to_user in gateway to make destination equal to user git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15010 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 91fb54a890..799baf3319 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -5190,7 +5190,13 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ switch_channel_set_variable(channel, "sip_gateway", gateway->name); if (gateway->extension) { - destination_number = switch_core_session_strdup(session, gateway->extension); + if (!strcasecmp(gateway->extension, "auto_to_user")) { + destination_number = sip->sip_to->a_url->url_user; + } else { + destination_number = switch_core_session_strdup(session, gateway->extension); + } + } else { + destination_number = sip->sip_to->a_url->url_user; } gateway->ib_calls++;