mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
minor presence tweaks
This commit is contained in:
parent
d5f47a87ce
commit
e6bfa118ec
@ -6957,7 +6957,7 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
|
||||
switch_uuid_t uuid;
|
||||
switch_codec_implementation_t read_impl = { 0 };
|
||||
switch_channel_t *channel = NULL;
|
||||
const char *force_rate = NULL, *force_interval = NULL;
|
||||
const char *force_rate = NULL, *force_interval = NULL, *presence_id = NULL;
|
||||
uint32_t force_rate_i = 0, force_interval_i = 0;
|
||||
|
||||
/* Validate the conference name */
|
||||
@ -6972,6 +6972,8 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
|
||||
switch_core_session_get_read_impl(session, &read_impl);
|
||||
channel = switch_core_session_get_channel(session);
|
||||
|
||||
presence_id = switch_channel_get_variable(channel, "presence_id");
|
||||
|
||||
if ((force_rate = switch_channel_get_variable(channel, "conference_force_rate"))) {
|
||||
if (!strcasecmp(force_rate, "auto")) {
|
||||
force_rate_i = read_impl.actual_samples_per_second;
|
||||
@ -7365,7 +7367,11 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c
|
||||
|
||||
conference->name = switch_core_strdup(conference->pool, name);
|
||||
|
||||
if ((name_domain = strchr(conference->name, '@'))) {
|
||||
if (presence_id && (name_domain = strchr(presence_id, '@'))) {
|
||||
name_domain++;
|
||||
conference->domain = switch_core_strdup(conference->pool, name_domain);
|
||||
} else if ((name_domain = strchr(conference->name, '@'))) {
|
||||
name_domain++;
|
||||
conference->domain = switch_core_strdup(conference->pool, name_domain);
|
||||
} else if (domain) {
|
||||
conference->domain = switch_core_strdup(conference->pool, domain);
|
||||
|
@ -1090,7 +1090,7 @@ static void actual_sofia_presence_event_handler(switch_event_t *event)
|
||||
}
|
||||
|
||||
if (!strcmp(proto, "dp")) {
|
||||
sql = switch_mprintf("update sip_presence set rpid='%q',status='%q' where hostname='%q' nad profile_name='%q' and "
|
||||
sql = switch_mprintf("update sip_presence set rpid='%q',status='%q' where hostname='%q' and profile_name='%q' and "
|
||||
"sip_user='%q' and sip_host='%q'",
|
||||
rpid, status, mod_sofia_globals.hostname, profile->name, euser, host);
|
||||
sofia_glue_execute_sql_now(profile, &sql, SWITCH_TRUE);
|
||||
@ -3299,7 +3299,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
|
||||
np.network_port, np.network_ip, orig_proto, full_to, to_tag);
|
||||
|
||||
switch_assert(sql != NULL);
|
||||
|
||||
|
||||
|
||||
if (mod_sofia_globals.debug_presence > 0 || mod_sofia_globals.debug_sla > 0) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "%s SUBSCRIBE %s@%s %s@%s\n%s\n",
|
||||
|
@ -3184,7 +3184,7 @@ SWITCH_DECLARE(char *) switch_ivr_check_presence_mapping(const char *exten_name,
|
||||
|
||||
for (x_domain = switch_xml_child(x_domains, "domain"); x_domain; x_domain = x_domain->next) {
|
||||
const char *dname = switch_xml_attr(x_domain, "name");
|
||||
if (!dname || strcasecmp(domain_name, dname)) continue;
|
||||
if (!dname || (strcasecmp(dname, "*") && strcasecmp(domain_name, dname))) continue;
|
||||
|
||||
for (x_exten = switch_xml_child(x_domain, "exten"); x_exten; x_exten = x_exten->next) {
|
||||
const char *regex = switch_xml_attr(x_exten, "regex");
|
||||
|
Loading…
x
Reference in New Issue
Block a user