Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (15009 => 15010)
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c 2009-09-28 22:36:34 UTC (rev 15009)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c 2009-09-29 02:07:17 UTC (rev 15010)
@@ -5190,7 +5190,13 @@
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++;