<div dir="ltr">Hi <span style="white-space:pre-wrap">Răzvan,</span><div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">Thanks for your answer.<br></span><div><br></div><div>I ended up using onreply_route and checking if ($rs == "200") to increment connect_calls and then event_route[E_ACC_CDR]  to decrement connected_calls. <br></div></div><div><br></div><div>multiple local tests are giving expected behavior, will need to test on production to confirm though.</div><div><br></div><div>Thanks a lot for your help.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 18, 2017 at 9:47 AM, Răzvan Crainea <span dir="ltr"><<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <tt>Hi, Khalil!<br>
    </tt><br>
    <tt><tt>To be honest, I think this event was initially made to be
        used with the MI dlg_end_dlg command, which only terminates a
        dialog. However, you could </tt> run 'opensipsctl fifo
      dlg_list' and match the hash_id and hash_entry against the
      returned values, and then identify the callid.<br>
      <br>
      If you would also like to receive the callid in the event, please
      open a feature request[1].<br>
      <br>
      [1] <a class="m_2004486892090274457moz-txt-link-freetext" href="https://github.com/OpenSIPS/opensips/issues" target="_blank">https://github.com/OpenSIPS/<wbr>opensips/issues</a><br>
      <br>
      Best regards,<br>
    </tt>
    <pre class="m_2004486892090274457moz-signature" cols="72">Răzvan Crainea
OpenSIPS Developer
<a class="m_2004486892090274457moz-txt-link-abbreviated" href="http://www.opensips-solutions.com" target="_blank">www.opensips-solutions.com</a></pre><div><div class="h5">
    <div class="m_2004486892090274457moz-cite-prefix">On 09/15/2017 10:46 PM, Khalil
      Khamlichi wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div class="h5">
      <div dir="ltr">
        <div>Hi everyone, </div>
        <div><br>
        </div>
        <div>I am trying to understand dialog module eventing system.</div>
        <div><br>
        </div>
        <div>I have added this route :</div>
        <div><br>
        </div>
        <div><br>
        </div>
        event_route[E_DLG_STATE_<wbr>CHANGED] {
        <div><br>
        </div>
        <div>   
          fetch_event_params("$avp(a);$<wbr>avp(b);$avp(c);$avp(d);$avp(e)<wbr>;$avp(f)");</div>
        <div><br>
        </div>
        <div>    cache_raw_query("redis:0", "PUBLISH serv1
          fetch_event_params=$avp(a),$<wbr>avp(b),$avp(c),$avp(d),$avp(e)<wbr>,$avp(f)",
          "$avp(res)");</div>
        <div><br>
        </div>
        <div>}<br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>so for each event I can watch an entry </div>
        <div><br>
        </div>
        <div>
          <div>1505503997.413642 [0 <a href="http://127.0.0.1:39734" target="_blank">127.0.0.1:39734</a>] "PUBLISH"
            "serv1"
            "fetch_event_params=3917,<wbr>339471624,1,3,<null>,<null>"</div>
          <div>1505503997.524535 [0 <a href="http://127.0.0.1:39762" target="_blank">127.0.0.1:39762</a>] "PUBLISH"
            "serv1"
            "fetch_event_params=3917,<wbr>339471624,3,4,<null>,<null>"</div>
          <div>1505504018.809746 [0 <a href="http://127.0.0.1:39840" target="_blank">127.0.0.1:39840</a>] "PUBLISH"
            "serv1"
            "fetch_event_params=3917,<wbr>339471624,4,5,<null>,<null>"<br>
          </div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>I understand that </div>
        <div><br>
        </div>
        <div>a = hash_id of dialog</div>
        <div>b= hash_entry of dialog</div>
        <div>c = old_state </div>
        <div>d = new_state</div>
        <div>e & f = do not exist and here just to prove that they
          do not exist.</div>
        <div><br>
        </div>
        <div>but I don't understand how to use the information of a
          & b to track dialogs ? if there a function that when fed
          those parameters gives us callid for example ? <br>
        </div>
        <div><br>
        </div>
        <div>Thanks in advance.</div>
        <div><br>
        </div>
        <div>Kkh</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="m_2004486892090274457mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><pre>______________________________<wbr>_________________
Users mailing list
<a class="m_2004486892090274457moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a class="m_2004486892090274457moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>