<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Courier New \;color\:\#1F497D";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New",serif;
        color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;
        mso-fareast-language:EN-US;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle25
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi Daniel,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Sorry for the delay in replying. I’ve attached blf.cap which shows the “light stays on” scenario. You’ll see that the final NOTIFY (packet 43) is a “confirmed” rather than a “terminated” as per the PUBLISH  (packet
 41) that triggered it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I’ve also attached presentity.txt which is the contents of the DB before the pcap was taken.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">With regards to your question about the light going out after the entries in the table have expired, this does happen automatically. As soon as the table drops down to being empty (it takes a couple of minutes
 to fully clear), the light goes off. Subsequent calls will work correctly with BLF until it eventually stops working and the whole cycle repeats.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">I have repeated the test with subs_db_mode 0 and the same results occur. This is, in fact, the state it was in when the attached pcap was taken.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Do you think the problem is in the cleanup of the data or in the way the active dialog is matched against the set of data in the table? Happy to prod through the code with gdb if you can point me in the direction
 of where to start looking.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Cheers<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="mso-fareast-language:EN-GB">Phil</span><span style="font-size:7.5pt;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB"> Daniel-Constantin Mierla [mailto:miconda@gmail.com]
<br>
<b>Sent:</b> 19 January 2016 23:26<br>
<b>To:</b> Phil Lavin <phil.lavin@synety.com>; Kamailio (SER) - Users Mailing List <sr-users@lists.sip-router.org><br>
<b>Subject:</b> Re: [SR-Users] Strange PUA Behaviour<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Can you get a pcap for a case with the new config? Being traveling, but maybe I get a chance to look at it soon.<br>
<br>
Reading quickly on some docs, I noticed that subs_db_mode=3 and notifier_proceses=0 rise a conflict:<br>
<br>
<a href="http://www.kamailio.org/docs/modules/devel/modules/presence.html#presence.p.notifier_processes">http://www.kamailio.org/docs/modules/devel/modules/presence.html#presence.p.notifier_processes</a><br>
<br>
Can you try with subs_db_mode=0 and see if works different?<br>
<br>
Cheers,<br>
Daniel<span style="font-size:12.0pt;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<div>
<p class="MsoNormal">On 19/01/16 20:35, Phil Lavin wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="color:#1F497D">Just to follow this up with more recent results. I’ve simplified things and have been testing calling from a Kamailio registered UA to a phone on the PSTN. There’s only 1 dialog in Kamailio for this and the results
 are just as strange. BLF works for a while and then breaks. In this particular case, the light does not go off after the call.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">I have set subs_db_mode to 3 (new config below) and I can consistently reproduce the BLF light not turning off after the call has ended (the phone does not get sent a terminate). As soon as I truncate pua and
 presentity tables in the DB, the next call works fine.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("presence", "subs_db_mode", 3)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("presence", "notifier_processes", 0)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("presence", "db_url", DBURL)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("presence", "send_fast_notify", 0)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("presence", "db_update_period", 20)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("presence_xml", "db_url", DBURL)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("presence_xml", "force_active", 1)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("presence_dialoginfo", "force_single_dialog", 1)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("presence_dialoginfo", "force_dummy_dialog", 1)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("pua", "db_url", DBURL)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("pua", "db_mode", 2)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("pua", "update_period", 20)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("pua_dialoginfo", "send_publish_flag", FLT_DLGINFO)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New ;color:#1F497D",serif">modparam("pua_dialoginfo", "override_lifetime", 124)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Before I truncate, the tables both a good number of rows in each (70ish).</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Is it that they’re not being correctly cleaned up here?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB">Phil</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB"> sr-users [<a href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>]
<b>On Behalf Of </b>Phil Lavin<br>
<b>Sent:</b> 19 January 2016 18:11<br>
<b>To:</b> <a href="mailto:miconda@gmail.com">miconda@gmail.com</a>; Kamailio (SER) - Users Mailing List
<a href="mailto:sr-users@lists.sip-router.org"><sr-users@lists.sip-router.org></a><br>
<b>Subject:</b> Re: [SR-Users] Strange PUA Behaviour</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Below is the relevant presence/pua stuff. Let me know if I should be examining other tables.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">When the call ends, there are no dialogs remaining in the dialog table. A few things do hang around in the presentity and pua tables for a short period of time.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Regarding CLI changing, it does seem to do so. When the call is routed onto the billing platform, the CLI is changed to the local “extension” (e.g. 9989) on the leg that comes back to Kamailio, destined for the
 callee.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Regarding only advertising the leg going to the callee, not all calls will terminate on a UA registered against Kamailio (e.g. calls from a Kamailio registered UA to the PSTN). The more I think about it, determining
 the correct leg in all scenarios will be difficult.</span><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:EN-GB"><br>
<br>
<o:p></o:p></span></p>
<pre>-- <o:p></o:p></pre>
<pre>Daniel-Constantin Mierla<o:p></o:p></pre>
<pre><a href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre>
<pre>Book: SIP Routing With Kamailio - <a href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre>
<pre><a href="http://miconda.eu">http://miconda.eu</a><o:p></o:p></pre>
</div>
</body>
</html>