Hello, all have a problem with Kamailio presence, I have configured my kamailio.cfg to handle dialog presence and facing issue in case of subs_db_mode = 2 in case of mode 2 facing the following presence issue.
1. after hangup presence is still up 2. sometimes stuck in a ringing state 3. sometimes presence not came..etc
but in the case of subs_db_mode = 3 (DB ONLY) mode presence working fine not facing any issue with this mode.
I noticed that sometimes Kamailio will throw the following message during PUBLISH processing and it will not generate appropriate NOTIFY I also verify inactive watcher subscription is there for that user and also a proper entry in the dialog table.
MSG during PUBLISH processesing and it will not generate appropriate NOTIFY
Oct 30 07:42:10 NC-HOSTED-1 /usr/local/sbin/kamailio[2409]: DEBUG: presence [notify.c:1444]: publ_notify(): Could not find subs_dialog
kamailio.cfg param
modparam("pua", "db_url", DBURL_KAMAILIO) modparam("pua", "db_mode", 2) modparam("pua", "update_period", 100) modparam("pua", "dlginfo_increase_version", 1) modparam("pua", "default_expires", 3600) modparam("pua", "fetch_rows", 1000) modparam("pua", "outbound_proxy", SERVER_IP)
modparam("dialog", "db_url", DBURL_KAMAILIO ) modparam("dialog", "db_mode", 1) modparam("dialog", "db_update_period", 260) modparam("dialog", "db_fetch_rows", 500)
modparam("pua_dialoginfo", "include_callid", 1) modparam("pua_dialoginfo", "send_publish_flag", 8) modparam("pua_dialoginfo", "caller_confirmed", 0) modparam("pua_dialoginfo", "include_tags", 1) modparam("pua_dialoginfo", "use_pubruri_avps", 1) modparam("pua_dialoginfo", "include_localremote", 1) modparam("pua_dialoginfo", "override_lifetime", 300) modparam("pua_dialoginfo", "pubruri_caller_avp", "$avp(s:puburis_caller)") modparam("pua_dialoginfo", "pubruri_caller_dlg_var", "pubruri_caller") modparam("pua_dialoginfo", "pubruri_callee_dlg_var", "pubruri_callee") modparam("pua_dialoginfo", "pubruri_callee_avp", "$avp(s:puburis_callee)")
modparam("presence_dialoginfo", "force_single_dialog", 1) modparam("presence", "db_table_lock_type", 0) modparam("presence", "db_url", DBURL_KAMAILIO) modparam("presence", "db_update_period", 5) modparam("presence", "send_fast_notify", 1) modparam("presence", "clean_period", 100) modparam("presence", "subs_db_mode", 2) //modparam("presence", "subs_db_mode", 3) modparam("presence", "timeout_rm_subs", 1) //new/ //modparam("presence", "notifier_processes", 2) //new// modparam("presence", "notifier_poll_rate", 20) //new// modparam("presence", "waitn_time",1) modparam("presence", "fetch_rows", 1000) modparam("presence", "presentity_table", "presentity") modparam("presence", "active_watchers_table", "active_watchers") modparam("presence", "watchers_table", "watchers") modparam("presence", "max_expires", 3600)
modparam("presence_xml", "db_url", DBURL_KAMAILIO) modparam("presence_xml", "force_active", 1)
logic for presence
request_route {
if(is_method("PUBLISH") || is_method("SUBSCRIBE")) { route(HANDLE_PRESENCE); }
}
route[HANDLE_PRESENCE] {
if (! t_newtran()) { sl_reply_error(); exit; }
if(is_method("PUBLISH")) { handle_publish(); t_release(); } else if( is_method("SUBSCRIBE")) { handle_subscribe(); t_release(); } exit;
}
route[RELAY] {
if(is_method("INVITE|BYE|UPDATE|CANCEL|ACK")) { $avp(t_ext) = $tU ; $avp(domain) = $fd ; $avp(et) = $_s(sip:$avp(t_ext)@$avp(domain)) ; $avp(s:puburis_callee) = $avp(et); setflag(8); dlg_manage(); }
} I already report this issue in Kamailio git https://github.com/kamailio/kamailio/issues/2540