提交 6a1feacc authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-3866 --resolve this should work now with send-message-query-on-register

上级 fdaa155b
...@@ -455,7 +455,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) ...@@ -455,7 +455,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
if ((pname = switch_event_get_header(event, "sofia-profile"))) { if ((pname = switch_event_get_header(event, "sofia-profile"))) {
profile = sofia_glue_find_profile(pname); profile = sofia_glue_find_profile(pname);
} }
if (!profile) { if (!profile) {
if (!host || !(profile = sofia_glue_find_profile(host))) { if (!host || !(profile = sofia_glue_find_profile(host))) {
char *sql; char *sql;
...@@ -464,7 +464,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) ...@@ -464,7 +464,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
sql = switch_mprintf("select profile_name from sip_registrations where hostname='%q' and (sip_host='%s' or mwi_host='%s')", sql = switch_mprintf("select profile_name from sip_registrations where hostname='%q' and (sip_host='%s' or mwi_host='%s')",
mod_sofia_globals.hostname, host, host); mod_sofia_globals.hostname, host, host);
if (list_profiles_full(NULL, NULL, &matches, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) { if (list_profiles_full(NULL, NULL, &matches, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {
switch_console_callback_match_node_t *m; switch_console_callback_match_node_t *m;
...@@ -492,6 +492,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) ...@@ -492,6 +492,7 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
} }
} }
if (profile->domain_name && strcasecmp(profile->domain_name, host)) { if (profile->domain_name && strcasecmp(profile->domain_name, host)) {
host = profile->domain_name; host = profile->domain_name;
} }
...@@ -548,8 +549,8 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event) ...@@ -548,8 +549,8 @@ static void actual_sofia_presence_mwi_event_handler(switch_event_t *event)
stream.data, mod_sofia_globals.hostname, profile->name, user, host); stream.data, mod_sofia_globals.hostname, profile->name, user, host);
} else if (call_id) { } else if (call_id) {
sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q' " sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,network_ip,'%q' "
"from sip_registrations where hostname='%q' and profile_name='%q' and mwi_user='%q' and mwi_host='%q' and call_id='%q'", "from sip_registrations where hostname='%q' and profile_name='%q' and call_id='%q'",
mod_sofia_globals.hostname, profile->name, stream.data, user, host, call_id); stream.data, mod_sofia_globals.hostname, profile->name, call_id);
} }
if (sql) { if (sql) {
......
...@@ -1651,7 +1651,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand ...@@ -1651,7 +1651,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
(reg_count == 1 && sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER))) { (reg_count == 1 && sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_FIRST_REGISTER))) {
if (switch_event_create(&s_mwi_event, SWITCH_EVENT_MESSAGE_QUERY) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&s_mwi_event, SWITCH_EVENT_MESSAGE_QUERY) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(s_mwi_event, SWITCH_STACK_BOTTOM, "Message-Account", "sip:%s@%s", mwi_user, mwi_host); switch_event_add_header(s_mwi_event, SWITCH_STACK_BOTTOM, "Message-Account", "sip:%s@%s", mwi_user, mwi_host);
switch_event_add_header_string(s_mwi_event, SWITCH_STACK_BOTTOM, "VM-Sofia-Pofile", profile->name); switch_event_add_header_string(s_mwi_event, SWITCH_STACK_BOTTOM, "VM-Sofia-Profile", profile->name);
switch_event_add_header_string(s_mwi_event, SWITCH_STACK_BOTTOM, "VM-Call-ID", call_id); switch_event_add_header_string(s_mwi_event, SWITCH_STACK_BOTTOM, "VM-Call-ID", call_id);
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论