From 4e0f40d7c6c47561bc7fd507a2f5f90290a5e929 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 11 Jul 2012 17:25:45 -0500 Subject: [PATCH] update --- .../applications/mod_conference/mod_conference.c | 14 +++++++++++--- src/mod/endpoints/mod_sofia/sofia.c | 7 ++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 6bd8353755..8017126748 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -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); } diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 423757d655..49bdb95534 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -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);