<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Seasons greetings!<br>
    <br>
    I've implemented BLF using presence, presence_dialoginfo and
    pua_dialoginfo and, provided there is only one dialed branch, it
    works as expected.<br>
    <br>
    However, I do allow multiple registrations and, as soon as I have
    two or more contacts registered and parallel forking of calls, BLF
    does not work correctly in respect of the called party.<br>
    <br>
    I'm running OpenSIPS <b>3.1.1</b> and what I'm seeing, when
    parallel forking takes place, is as follows:<br>
    <br>
    <u>1. NOTIFY messages are issued for both branches with unique
      dialog id's:</u><br>
    <pre><dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="18"          entity=<a class="moz-txt-link-rfc2396E" href="sip:swt37@vpbx2.switchtel.co.za">"sip:swt37@vpbx2.switchtel.co.za"</a> state="partial"><dialog id="d474b07f-8b7f-4d7a-ac0a-232d2eae250b.1" call-id="d474b07f-8b7
4d7a-ac0a-232d2eae250b" local-tag="e3p0t2anp8" remote-tag="a0d7dc85-c814-4941-95a5-d97038eb9314" direction="recipient"><state>early</state><remote><identity><a class="moz-txt-link-freetext" href="sip:11@vpbx2.switchtel.co.za">sip:11@vpbx2.switchtel.co.za</a></identity><target uri=
<a class="moz-txt-link-abbreviated" href="mailto:ip:11@vpbx2.switchtel.co.za">ip:11@vpbx2.switchtel.co.za</a>"/></remote><local><identity><a class="moz-txt-link-freetext" href="sip:swt37@vpbx2.switchtel.co.za">sip:swt37@vpbx2.switchtel.co.za</a></identity><target uri=<a class="moz-txt-link-rfc2396E" href="sip:swt37@vpbx2.switchtel.co.za">"sip:swt37@vpbx2.switchtel.co.za"</a>/></local></dialog></dialog-info>

<?xml version="1.0"?>
<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="19"          entity=<a class="moz-txt-link-rfc2396E" href="sip:swt37@vpbx2.switchtel.co.za">"sip:swt37@vpbx2.switchtel.co.za"</a> state="partial"><dialog id="d474b07f-8b7f-4d7a-ac0a-232d2eae250b.0" call-id="d474b07f-8b7
4d7a-ac0a-232d2eae250b" local-tag="1196739183" remote-tag="a0d7dc85-c814-4941-95a5-d97038eb9314" direction="recipient"><state>early</state><remote><identity><a class="moz-txt-link-freetext" href="sip:11@vpbx2.switchtel.co.za">sip:11@vpbx2.switchtel.co.za</a></identity><target uri=
<a class="moz-txt-link-abbreviated" href="mailto:ip:11@vpbx2.switchtel.co.za">ip:11@vpbx2.switchtel.co.za</a>"/></remote><local><identity><a class="moz-txt-link-freetext" href="sip:swt37@vpbx2.switchtel.co.za">sip:swt37@vpbx2.switchtel.co.za</a></identity><target uri=<a class="moz-txt-link-rfc2396E" href="sip:swt37@vpbx2.switchtel.co.za">"sip:swt37@vpbx2.switchtel.co.za"</a>/></local></dialog></dialog-info>

</pre>
    At this stage, BLF is behaving as one would expect, and the light
    indicates that the extension is ringing.<br>
    Then I answer the call.<br>
    <br>
    <u>2. NOTIFY messages are issued for both branches, one "confirmed"
      and one "terminated""</u><br>
    <pre><?xml version="1.0"?>
<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="20"          entity=<a class="moz-txt-link-rfc2396E" href="sip:swt37@vpbx2.switchtel.co.za">"sip:swt37@vpbx2.switchtel.co.za"</a> state="partial"><dialog id="d474b07f-8b7f-4d7a-ac0a-232d2eae250b.0" call-id="d474b07f-8b7
4d7a-ac0a-232d2eae250b" local-tag="1196739183" remote-tag="a0d7dc85-c814-4941-95a5-d97038eb9314" direction="recipient"><state>confirmed</state><remote><identity><a class="moz-txt-link-freetext" href="sip:11@vpbx2.switchtel.co.za">sip:11@vpbx2.switchtel.co.za</a></identity><target
i=<a class="moz-txt-link-rfc2396E" href="sip:11@vpbx2.switchtel.co.za">"sip:11@vpbx2.switchtel.co.za"</a>/></remote><local><identity><a class="moz-txt-link-freetext" href="sip:swt37@vpbx2.switchtel.co.za">sip:swt37@vpbx2.switchtel.co.za</a></identity><target uri=<a class="moz-txt-link-rfc2396E" href="sip:swt37@vpbx2.switchtel.co.za">"sip:swt37@vpbx2.switchtel.co.za"</a>/></local></dialog></dialog-info>

<?xml version="1.0"?>
<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="21"          entity=<a class="moz-txt-link-rfc2396E" href="sip:swt37@vpbx2.switchtel.co.za">"sip:swt37@vpbx2.switchtel.co.za"</a> state="partial"><dialog id="d474b07f-8b7f-4d7a-ac0a-232d2eae250b.1" call-id="d474b07f-8b7
4d7a-ac0a-232d2eae250b" local-tag="e3p0t2anp8" remote-tag="a0d7dc85-c814-4941-95a5-d97038eb9314" direction="recipient"><state>terminated</state><remote><identity><a class="moz-txt-link-freetext" href="sip:11@vpbx2.switchtel.co.za">sip:11@vpbx2.switchtel.co.za</a></identity><target
ri=<a class="moz-txt-link-rfc2396E" href="sip:11@vpbx2.switchtel.co.za">"sip:11@vpbx2.switchtel.co.za"</a>/></remote><local><identity><a class="moz-txt-link-freetext" href="sip:swt37@vpbx2.switchtel.co.za">sip:swt37@vpbx2.switchtel.co.za</a></identity><target uri=<a class="moz-txt-link-rfc2396E" href="sip:swt37@vpbx2.switchtel.co.za">"sip:swt37@vpbx2.switchtel.co.za"</a>/></local></dialog></dialog-info>
</pre>
    The above behavior is as one would expect; it has correctly notified
    that one branch was answered and the other terminated.<br>
    However, what follows is where the problem comes in.<br>
    <br>
    <u>3. NOTIFY message is immediately issued with "full" state:</u><br>
    <pre><?xml version="1.0"?>
<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="22"          state="full" entity=<a class="moz-txt-link-rfc2396E" href="sip:swt37@vpbx2.switchtel.co.za">"sip:swt37@vpbx2.switchtel.co.za"</a>/>
</pre>
    After this, the BLF light goes from flashing (indicating that it was
    in the ringing state) to indicating that the extension is available
    again, despite the fact that it is on an active call.<br>
    <br>
    When one then hangs up the call, no PUBLISH message is generated
    internally by OpenSIPS nor is any NOTIFY message sent.<br>
    <br>
    <br>
    It appears that the presence server thinks that the call terminated
    as soon as one of the branches terminated and is unaware that the
    other branch confirmed.<br>
    <br>
    I'm at a loss as to what I've done wrong or how to correct it.<br>
    <br>
    <br>
    The moment I deregister the additional contacts (so that only a
    single contact remains for the subscriber and no parallel forking
    takes place), everything works perfectly again.<br>
    <br>
    Any advice on how I can resolve this would be greatly appreciated.<br>
    <br>
    <br>
    Regards<br>
    Gregory Massel<br>
  </body>
</html>