<p></p>
<p>Hello I have problem with Kamailio presence,i have configure my kamailio.cfg to handle dialog presence and facing issue in case of subs_db_mode = 2 in case of mode 2 facing following presence issue.</p>
<ol>
<li>after hangup presence is still up</li>
<li>sometimes stuck in ringing state</li>
<li>sometime presence not came..etc</li>
</ol>
<p>but in case of subs_db_mode = 3 (DB ONLY) mode presence working fine not facing any issue with this mode.</p>
<p>I noticed that sometimes Kamailio will throw following message during PUBLISH processesing and it will not generate appropriate NOTIFY i also verify in active watcher subscription is thare for that user and also proper entry in dialog table.</p>
<p>MSG during PUBLISH processesing and it will not generate appropriate NOTIFY</p>
<p>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</p>
<p>kamailio.cfg param</p>
<p>modparam("pua", "db_url", DBURL_KAMAILIO)<br>
modparam("pua", "db_mode", 2)<br>
modparam("pua", "update_period", 100)<br>
modparam("pua", "dlginfo_increase_version", 1)<br>
modparam("pua", "default_expires", 3600)<br>
modparam("pua", "fetch_rows", 1000)<br>
modparam("pua", "outbound_proxy", SERVER_IP)</p>
<p>modparam("dialog", "db_url", DBURL_KAMAILIO )<br>
modparam("dialog", "db_mode", 1)<br>
modparam("dialog", "db_update_period", 260)<br>
modparam("dialog", "db_fetch_rows", 500)</p>
<p>modparam("pua_dialoginfo", "include_callid", 1)<br>
modparam("pua_dialoginfo", "send_publish_flag", 8)<br>
modparam("pua_dialoginfo", "caller_confirmed", 0)<br>
modparam("pua_dialoginfo", "include_tags", 1)<br>
modparam("pua_dialoginfo", "use_pubruri_avps", 1)<br>
modparam("pua_dialoginfo", "include_localremote", 1)<br>
modparam("pua_dialoginfo", "override_lifetime", 300)<br>
modparam("pua_dialoginfo", "pubruri_caller_avp", "$avp(s:puburis_caller)")<br>
modparam("pua_dialoginfo", "pubruri_caller_dlg_var", "pubruri_caller")<br>
modparam("pua_dialoginfo", "pubruri_callee_dlg_var", "pubruri_callee")<br>
modparam("pua_dialoginfo", "pubruri_callee_avp", "$avp(s:puburis_callee)")</p>
<p>modparam("presence_dialoginfo", "force_single_dialog", 1)<br>
modparam("presence", "db_table_lock_type", 0)<br>
modparam("presence", "db_url", DBURL_KAMAILIO)<br>
modparam("presence", "db_update_period", 5)<br>
modparam("presence", "send_fast_notify", 1)<br>
modparam("presence", "clean_period", 100)<br>
modparam("presence", "subs_db_mode", 2)<br>
//modparam("presence", "subs_db_mode", 3)<br>
modparam("presence", "timeout_rm_subs", 1) //new/<br>
//modparam("presence", "notifier_processes", 2) //new//<br>
modparam("presence", "notifier_poll_rate", 20) //new//<br>
modparam("presence", "waitn_time",1)<br>
modparam("presence", "fetch_rows", 1000)<br>
modparam("presence", "presentity_table", "presentity")<br>
modparam("presence", "active_watchers_table", "active_watchers")<br>
modparam("presence", "watchers_table", "watchers")<br>
modparam("presence", "max_expires", 3600)</p>
<p>modparam("presence_xml", "db_url", DBURL_KAMAILIO)<br>
modparam("presence_xml", "force_active", 1)</p>
<p>logic for presence</p>
<p>request_route {</p>
<pre><code>    if(is_method("PUBLISH") || is_method("SUBSCRIBE")) {
            route(HANDLE_PRESENCE);
    }
</code></pre>
<p>}</p>
<p>route[HANDLE_PRESENCE] {</p>
<pre><code>    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;
</code></pre>
<p>}</p>
<p>route[RELAY] {</p>
<pre><code>    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();
    }
</code></pre>
<p>}</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2540">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZIS5DB7HHCEWBIYXRDSN27JZANCNFSM4THRJGDQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZOFR2JTGNYZRBM3BZTSN27JZA5CNFSM4THRJGD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4K6INAWA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2540",
"url": "https://github.com/kamailio/kamailio/issues/2540",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>