]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
set extension=auto_to_user in gateway to make destination equal to user
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 29 Sep 2009 02:07:17 +0000 (02:07 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 29 Sep 2009 02:07:17 +0000 (02:07 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15010 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index 91fb54a8908cd7abbdaaaa2687b6748d6601fa95..799baf3319acb295d156b1dcc270f91bd570a439 100644 (file)
@@ -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++;