mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
FS-5498
This commit is contained in:
@@ -1108,7 +1108,7 @@ static void our_sofia_event_callback(nua_event_t event,
|
||||
sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), NULL);
|
||||
auth_res = sofia_reg_parse_auth(profile, authorization, sip, de,
|
||||
(char *) sip->sip_request->rq_method_name, tech_pvt->key, strlen(tech_pvt->key), network_ip, NULL, 0,
|
||||
REG_INVITE, NULL, NULL, NULL);
|
||||
REG_INVITE, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
if ((auth_res != AUTH_OK && auth_res != AUTH_RENEWED)) {
|
||||
@@ -7763,6 +7763,7 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
|
||||
char network_ip[80];
|
||||
char proxied_client_ip[80];
|
||||
switch_event_t *v_event = NULL;
|
||||
switch_xml_t x_user = NULL;
|
||||
uint32_t sess_count = switch_core_session_count();
|
||||
uint32_t sess_max = switch_core_session_limit(0);
|
||||
int is_auth = 0, calling_myself = 0;
|
||||
@@ -8000,10 +8001,13 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
|
||||
if (!strcmp(network_ip, profile->sipip) && network_port == profile->sip_port) {
|
||||
calling_myself++;
|
||||
} else {
|
||||
if (sofia_reg_handle_register(nua, profile, nh, sip, de, REG_INVITE, key, sizeof(key), &v_event, NULL, NULL)) {
|
||||
if (sofia_reg_handle_register(nua, profile, nh, sip, de, REG_INVITE, key, sizeof(key), &v_event, NULL, NULL, &x_user)) {
|
||||
if (v_event) {
|
||||
switch_event_destroy(&v_event);
|
||||
}
|
||||
if (x_user) {
|
||||
switch_xml_free(x_user);
|
||||
}
|
||||
|
||||
if (sip->sip_authorization || sip->sip_proxy_authorization) {
|
||||
goto fail;
|
||||
@@ -8086,15 +8090,6 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
|
||||
switch_channel_set_variable(channel, "sip_looped_call", "true");
|
||||
}
|
||||
|
||||
if (v_event) {
|
||||
switch_event_header_t *hp;
|
||||
|
||||
for (hp = v_event->headers; hp; hp = hp->next) {
|
||||
switch_channel_set_variable(channel, hp->name, hp->value);
|
||||
}
|
||||
switch_event_destroy(&v_event);
|
||||
}
|
||||
|
||||
if (sip->sip_from && sip->sip_from->a_url) {
|
||||
from_user = sip->sip_from->a_url->url_user;
|
||||
from_host = sip->sip_from->a_url->url_host;
|
||||
@@ -8841,6 +8836,25 @@ void sofia_handle_sip_i_invite(switch_core_session_t *session, nua_t *nua, sofia
|
||||
switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
|
||||
}
|
||||
|
||||
if (x_user) {
|
||||
const char *user = NULL, *domain = NULL;
|
||||
|
||||
if (v_event) {
|
||||
user = switch_event_get_header(v_event, "username");
|
||||
domain = switch_event_get_header(v_event, "domain_name");
|
||||
}
|
||||
|
||||
printf("W00t!!!!\n");
|
||||
switch_ivr_set_user_xml(session, NULL, user, domain, x_user);
|
||||
switch_xml_free(x_user);
|
||||
x_user = NULL;
|
||||
}
|
||||
|
||||
if (v_event) {
|
||||
switch_event_destroy(&v_event);
|
||||
}
|
||||
|
||||
|
||||
tech_pvt->sofia_private = sofia_private;
|
||||
tech_pvt->nh = nh;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user