]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 11 Jul 2012 22:25:45 +0000 (17:25 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 11 Jul 2012 22:25:45 +0000 (17:25 -0500)
src/mod/applications/mod_conference/mod_conference.c
src/mod/endpoints/mod_sofia/sofia.c

index 6bd8353755632310e819b1cf49379a6b96ab6c05..80171267481af18a4c8800144040847ed2d9a53f 100644 (file)
@@ -8028,11 +8028,17 @@ static void call_setup_event_handler(switch_event_t *event)
        char *domain = switch_event_get_header(event, "Target-Domain");
        char *dial_str = switch_event_get_header(event, "Request-Target");
        char *action = switch_event_get_header(event, "Request-Action");
+       char *ext = switch_event_get_header(event, "Request-Target-Extension");
+
+
+       if (!ext) ext = dial_str;
 
-       
        if (!zstr(conf) && !zstr(dial_str) && !zstr(action) && (conference = conference_find(conf, domain))) {
                switch_event_t *var_event;
                switch_event_header_t *hp;
+               char *key = NULL;
+
+               key = switch_mprintf("conf_%s_%s_%s", conference->name, conference->domain, ext);
 
                if (switch_test_flag(conference, CFLAG_RFC4579)) {
                        if (!strcasecmp(action, "call")) {
@@ -8047,14 +8053,16 @@ static void call_setup_event_handler(switch_event_t *event)
                                        }
                                }
                        
-                               switch_event_add_header(var_event, SWITCH_STACK_BOTTOM, "conference_dial_str", dial_str);
+                               switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "conference_dial_str", key);
 
                                conference_outcall_bg(conference, NULL, NULL, dial_str, 60, NULL, NULL, NULL, NULL, NULL, NULL, &var_event);
 
                        } else if (!strcasecmp(action, "end")) {
-                               switch_core_session_hupall_matching_var("conference_dial_str", dial_str, SWITCH_CAUSE_NORMAL_CLEARING);
+                               switch_core_session_hupall_matching_var("conference_dial_str", key, SWITCH_CAUSE_NORMAL_CLEARING);
                        }
                }
+
+               switch_safe_free(key);
                switch_thread_rwlock_unlock(conference->rwlock);
        }
 
index 423757d655defcda553394e01765bd19c102f562..49bdb9553412475e05482cf397f25b359b0a0228 100644 (file)
@@ -1192,12 +1192,15 @@ static void our_sofia_event_callback(nua_event_t event,
                if (session) {
                        sofia_handle_sip_i_refer(nua, profile, nh, session, sip, de, tags);
                } else {
-                       const char *req_user = NULL, *req_host = NULL, *action = NULL, *ref_by_user = NULL;
+                       const char *req_user = NULL, *req_host = NULL, *action = NULL, *ref_by_user = NULL, *ref_to_user = NULL, *ref_to_host = NULL;
                        char *refer_to = NULL, *referred_by = NULL, *method = NULL;
                        char *params = NULL;
                        switch_event_t *event;
 
                        if (sip->sip_refer_to) {
+                               ref_to_user = sip->sip_refer_to->r_url->url_user;
+                               ref_to_host = sip->sip_refer_to->r_url->url_host;
+
                                refer_to = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_refer_to);
                                if ((params = strchr(refer_to, ';'))) {
                                        *params++ = '\0';
@@ -1232,6 +1235,8 @@ static void our_sofia_event_callback(nua_event_t event,
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Target-Domain", req_host);
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Request-Action", action);
                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Request-Target", "sofia/%s/%s", profile->name, refer_to);
+                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Request-Target-Extension", ref_to_user);
+                               switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Request-Target-Domain", ref_to_host);
                                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Request-Sender", "sofia/%s/%s", profile->name, referred_by);
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "var_origination_caller_id_number", ref_by_user);
                                switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "var_origination_caller_id_name", ref_by_user);