]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
inbound_context and inbound_dialplan vars in regged user to direct callflow
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 31 Oct 2007 22:26:54 +0000 (22:26 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 31 Oct 2007 22:26:54 +0000 (22:26 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6113 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index 1b27fc89d084a8b5164712bcdd76c4ef4e07363d..fe0f4df473264fbaacba4fbb632af92856fe7256 100644 (file)
@@ -1919,6 +1919,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
        const char *destination_number = NULL;
        const char *from_user = NULL, *from_host = NULL;
        const char *context = NULL;
+       const char *dialplan = NULL;
        char network_ip[80];
        switch_event_t *v_event = NULL;
        uint32_t sess_count = switch_core_session_count();
@@ -2128,6 +2129,9 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
                }
        }
 
+       if (!context) {
+               context = switch_channel_get_variable(channel, "inbound_context");
+       }
 
        if (!context) {
                if (profile->context && !strcasecmp(profile->context, "_domain_")) {
@@ -2137,9 +2141,13 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
                }
        }
 
+       if (!(dialplan = switch_channel_get_variable(channel, "inbound_dialplan"))) {
+               dialplan = profile->dialplan;
+       }
+
        tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
                                                                                                                 from_user,
-                                                                                                                profile->dialplan,
+                                                                                                                dialplan,
                                                                                                                 displayname,
                                                                                                                 from_user,
                                                                                                                 network_ip,