"full_via,expires,user_agent,accept,profile_name,network_ip"
" from sip_subscriptions where hostname='%q' and profile_name='%q' and "
"event='message-summary' and sub_to_user='%q' "
- "and (sip_host='%q' or presence_hosts like '%%%q%%')",
+ "and (sip_host='%q' or presence_hosts like '%%%q%%') and call_id='%q'",
to_host, mod_sofia_globals.hostname, profile->name,
- to_user, to_host, to_host))) {
+ to_user, to_host, to_host, call_id))) {
if (mod_sofia_globals.debug_presence > 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,