PFLAG_PRESENCE_DISABLE_EARLY,
PFLAG_CONFIRM_BLIND_TRANSFER,
PFLAG_THREAD_PER_REG,
+ PFLAG_MWI_USE_REG_CALLID,
/* No new flags below this line */
PFLAG_MAX
} PFLAGS;
sofia_destination_t *sofia_glue_get_destination(char *data);
void sofia_glue_free_destination(sofia_destination_t *dst);
switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *user, const char *host, const char *event, const char *contenttype,
- const char *body, const char *o_contact, const char *network_ip);
+ const char *body, const char *o_contact, const char *network_ip, const char *call_id);
char *sofia_glue_get_extra_headers(switch_channel_t *channel, const char *prefix);
void sofia_glue_set_extra_headers(switch_core_session_t *session, sip_t const *sip, const char *prefix);
char *sofia_glue_get_extra_headers_from_event(switch_event_t *event, const char *prefix);
mod_sofia_globals.msg_queue_len = idx + 1;
if (!mod_sofia_globals.msg_queue) {
- switch_queue_create(&mod_sofia_globals.msg_queue, SOFIA_MSG_QUEUE_SIZE * mod_sofia_globals.cpu_count, mod_sofia_globals.pool);
+ switch_queue_create(&mod_sofia_globals.msg_queue, SOFIA_MSG_QUEUE_SIZE * mod_sofia_globals.max_msg_queues, mod_sofia_globals.pool);
}
} else {
sofia_clear_pflag(profile, PFLAG_CONFIRM_BLIND_TRANSFER);
}
+ } else if (!strcasecmp(var, "mwi-use-reg-callid")) {
+ if (switch_true(val)) {
+ sofia_set_pflag(profile, PFLAG_MWI_USE_REG_CALLID);
+ } else {
+ sofia_clear_pflag(profile, PFLAG_MWI_USE_REG_CALLID);
+ }
} else if (!strcasecmp(var, "presence-proto-lookup")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_PRESENCE_MAP);
} else {
sofia_clear_pflag(profile, PFLAG_CONFIRM_BLIND_TRANSFER);
}
+ } else if (!strcasecmp(var, "mwi-use-reg-callid")) {
+ if (switch_true(val)) {
+ sofia_set_pflag(profile, PFLAG_MWI_USE_REG_CALLID);
+ } else {
+ sofia_clear_pflag(profile, PFLAG_MWI_USE_REG_CALLID);
+ }
} else if (!strcasecmp(var, "presence-proto-lookup")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_PRESENCE_MAP);
}
switch_status_t sofia_glue_send_notify(sofia_profile_t *profile, const char *user, const char *host, const char *event, const char *contenttype,
- const char *body, const char *o_contact, const char *network_ip)
+ const char *body, const char *o_contact, const char *network_ip, const char *call_id)
{
char *id = NULL;
nua_handle_t *nh;
TAG_IF(user_via, SIPTAG_VIA_STR(user_via)),
SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
TAG_IF(event, SIPTAG_EVENT_STR(event)),
+ TAG_IF(call_id, SIPTAG_CALL_ID_STR(call_id)),
TAG_IF(contenttype, SIPTAG_CONTENT_TYPE_STR(contenttype)), TAG_IF(body, SIPTAG_PAYLOAD_STR(body)), TAG_END());
switch_safe_free(contact);
}
if (for_everyone) {
- 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',call_id "
"from sip_registrations where hostname='%q' and profile_name='%q' and mwi_user='%q' and mwi_host='%q'",
stream.data, mod_sofia_globals.hostname, profile->name, user, host);
} 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',call_id "
"from sip_registrations where hostname='%q' and profile_name='%q' and call_id='%q'",
stream.data, mod_sofia_globals.hostname, profile->name, call_id);
}
const char *body = argv[5];
const char *o_contact = argv[2];
const char *network_ip = argv[4];
+ const char *call_id = argv[6];
char *profile_name = argv[3];
struct mwi_helper *h = (struct mwi_helper *) pArg;
}
}
- sofia_glue_send_notify(profile, user, host, event, contenttype, body, o_contact, network_ip);
+ if (!sofia_test_pflag(profile, PFLAG_MWI_USE_REG_CALLID)) {
+ call_id = NULL;
+ }
+
+ sofia_glue_send_notify(profile, user, host, event, contenttype, body, o_contact, network_ip, call_id);
if (ext_profile) {
sofia_glue_release_profile(ext_profile);
event = "reboot";
}
- sofia_glue_send_notify(profile, user, host, event, contenttype, body, contact, network_ip);
+ sofia_glue_send_notify(profile, user, host, event, contenttype, body, contact, network_ip, NULL);
}
int sofia_sla_dialog_del_callback(void *pArg, int argc, char **argv, char **columnNames)