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 */
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;
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);
}
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);
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",
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");