Revision
15010
Author
anthm
Date
2009-09-28 21:07:17 -0500 (Mon, 28 Sep 2009)

Log Message

set extension=auto_to_user in gateway to make destination equal to user

Modified Paths

Diff

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++;