<div dir="ltr">Hi Robert, <div><br></div><div>Thanks for your idea, the only issue is that it involves polling the server and I don't want to go that path. actually with my solution the results were quite good and precise, the reason is that a 200 OK is always an established call and an <span style="font-size:12.8px">E_ACC_CDR is always an end to a successful call and never to another status of a call, and on both places we have access to all dialog variables and/or acc_extra variables.</span></div><div><br></div><div>Again, Thanks for your idea.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 19, 2017 at 3:26 PM, Mundkowsky, Robert <span dir="ltr"><<a href="mailto:rmundkowsky@ets.org" target="_blank">rmundkowsky@ets.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div class="m_1707845154588388774WordSection1">
<p class="MsoNormal"><a name="m_1707845154588388774__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Using E_DLG_STATE_CHANGED to keep a count of active dialogs seems reasonable. If you want the callerID, you would use the “hash_id
of dialog” and the “b= hash_entry of dialog” to look up the dialog in the table and get more info like the callerid. You use the dlg_list command to look up data in the table. I don’t know if you could do this in the openSIPS config file alone, you likely
have to have a script that is called to query the table, parse the data you want, ….<u></u><u></u></span></a></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Looks like the key is of the form:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><hash_id>:< hash_entry> like “1527:459551172” below<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Example of details from dlg_list:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">rmundkowsky: ~$ /export/Apps/opensips/sbin/<wbr>opensipsctl fifo dlg_list<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">database engine 'MYSQL' loaded<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Control engine 'FIFO' loaded<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">entering fifo_cmd dlg_list<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">dialog:: hash=1527:459551172 dialog_id=6558874612164<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> state:: 3<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> user_flags:: 0<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> timestart:: 1505826879<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> datestart:: 2017-09-19 09:14:39<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> timeout:: 1505848479<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> dateout:: 2017-09-19 15:14:39<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> callid:: 28456fb41ba510f57257de424e73eb<wbr>4c@XX.XX.XX.XX:5060<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> from_uri:: sip:opensips@XX.XXX.XX.XX<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> to_uri:: sip:7800@XX.XX.XX.XX:5060<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> caller_tag:: as7e7bed90<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> caller_contact:: sip:ZZZ@ XX.XX.XX.XX:5060<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> callee_cseq:: 0<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> caller_route_set::<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> caller_bind_addr:: udp:XX.XX.XX.XX:5060<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> caller_sdp::<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> CALLEES::<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> callee::<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> callee_tag:: 255851520<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> callee_contact:: sip:YYY@ XX.XX.XX.XX:5090;transport=udp<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> caller_cseq:: 102<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> callee_route_set::<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> callee_bind_addr:: udp: XX.XX.XX.XX:5060<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"> callee_sdp::<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">FIFO command was:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">:dlg_list:osips_rply_e7e14d04<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Robert<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Users [mailto:<a href="mailto:users-bounces@lists.opensips.org" target="_blank">users-bounces@lists.<wbr>opensips.org</a>]
<b>On Behalf Of </b>Khalil Khamlichi<br>
<b>Sent:</b> Tuesday, September 19, 2017 8:54 AM<br>
<b>To:</b> OpenSIPS users mailling list <<a href="mailto:users@lists.opensips.org" target="_blank">users@lists.opensips.org</a>><br>
<b>Subject:</b> Re: [OpenSIPS-Users] trying to understand the E_DLG_STATE_CHANGED<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi Răzvan,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks for your answer.<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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. <u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">multiple local tests are giving expected behavior, will need to test on production to confirm though.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks a lot for your help.<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Mon, Sep 18, 2017 at 9:47 AM, Răzvan Crainea <<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<p class="MsoNormal"><tt><span style="font-size:10.0pt">Hi, Khalil!</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
</span><br>
<tt><span style="font-size:10.0pt">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 run 'opensipsctl fifo dlg_list' and match the hash_id and hash_entry against
the returned values, and then identify the callid.</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<br>
<tt>If you would also like to receive the callid in the event, please open a feature request[1].</tt><br>
<br>
<tt>[1] <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FOpenSIPS%2Fopensips%2Fissues&data=02%7C01%7Crmundkowsky%40ets.org%7Cf9c8eab9cdfd4fae4aa608d4ff5dedd6%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C636414226270892544&sdata=FECgaKsHHG0bJ27vaswQ3Kv8mIs%2B%2FEIWA0BhlexCT5w%3D&reserved=0" target="_blank">
https://github.com/OpenSIPS/<wbr>opensips/issues</a></tt><br>
<br>
<tt>Best regards,</tt><br>
<br>
</span><u></u><u></u></p>
<pre>Răzvan Crainea<u></u><u></u></pre>
<pre>OpenSIPS Developer<u></u><u></u></pre>
<pre><a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.opensips-solutions.com&data=02%7C01%7Crmundkowsky%40ets.org%7Cf9c8eab9cdfd4fae4aa608d4ff5dedd6%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C636414226270892544&sdata=FfiJVQW07fhERDG5EmsgIAKTnzaXJ5B4Hiq%2BK69mtXk%3D&reserved=0" target="_blank">www.opensips-solutions.com</a><u></u><u></u></pre>
<div>
<div>
<div>
<p class="MsoNormal">On 09/15/2017 10:46 PM, Khalil Khamlichi wrote:<u></u><u></u></p>
</div>
</div>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<div>
<p class="MsoNormal">Hi everyone, <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I am trying to understand dialog module eventing system.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I have added this route :<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">event_route[E_DLG_STATE_<wbr>CHANGED] { <u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> fetch_event_params("$avp(a);$<wbr>avp(b);$avp(c);$avp(d);$avp(e)<wbr>;$avp(f)");<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> 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)");<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">}<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">so for each event I can watch an entry <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal">1505503997.413642 [0 <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2F127.0.0.1%3A39734&data=02%7C01%7Crmundkowsky%40ets.org%7Cf9c8eab9cdfd4fae4aa608d4ff5dedd6%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C636414226270892544&sdata=FoTX7qqZpovv0ja%2FlUUhMA7FvyZZOe%2BGTfL3ctrTf4c%3D&reserved=0" target="_blank">
127.0.0.1:39734</a>] "PUBLISH" "serv1" "fetch_event_params=3917,<wbr>339471624,1,3,<null>,<null>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">1505503997.524535 [0 <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2F127.0.0.1%3A39762&data=02%7C01%7Crmundkowsky%40ets.org%7Cf9c8eab9cdfd4fae4aa608d4ff5dedd6%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C636414226270892544&sdata=vUKqSbhQPhk1%2BL0RxMbzh9vXBVGVXh0EVc0B2Y3UnQA%3D&reserved=0" target="_blank">
127.0.0.1:39762</a>] "PUBLISH" "serv1" "fetch_event_params=3917,<wbr>339471624,3,4,<null>,<null>"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">1505504018.809746 [0 <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2F127.0.0.1%3A39840&data=02%7C01%7Crmundkowsky%40ets.org%7Cf9c8eab9cdfd4fae4aa608d4ff5dedd6%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C636414226270892544&sdata=eIDCVWWXFKxhVM7omnhPa%2B4ndAMIMz40F5vei%2F3GwVw%3D&reserved=0" target="_blank">
127.0.0.1:39840</a>] "PUBLISH" "serv1" "fetch_event_params=3917,<wbr>339471624,4,5,<null>,<null>"<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I understand that <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">a = hash_id of dialog<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">b= hash_entry of dialog<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">c = old_state <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">d = new_state<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">e & f = do not exist and here just to prove that they do not exist.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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 ? <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks in advance.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Kkh<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
</div>
</div>
<pre>______________________________<wbr>_________________<u></u><u></u></pre>
<pre>Users mailing list<u></u><u></u></pre>
<pre><a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><u></u><u></u></pre>
<pre><a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.opensips.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fusers&data=02%7C01%7Crmundkowsky%40ets.org%7Cf9c8eab9cdfd4fae4aa608d4ff5dedd6%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C636414226270892544&sdata=Rp8lS4VMOZ%2BT1mYLh6TLJg1o5zQ3QMIHpr2IZCs0GSo%3D&reserved=0" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><u></u><u></u></pre>
</blockquote>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.opensips.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fusers&data=02%7C01%7Crmundkowsky%40ets.org%7Cf9c8eab9cdfd4fae4aa608d4ff5dedd6%7C0ba6e9b760b34fae92f37e6ddd9e9b65%7C0%7C0%7C636414226270892544&sdata=Rp8lS4VMOZ%2BT1mYLh6TLJg1o5zQ3QMIHpr2IZCs0GSo%3D&reserved=0" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
<br>
<hr>
<p>This e-mail and any files transmitted with it may contain privileged or confidential information. It is solely for use by the individual for whom it is intended, even if addressed incorrectly. If you received this e-mail in error, please notify the sender;
do not disclose, copy, distribute, or take any action in reliance on the contents of this information; and delete it from your system. Any other use of this e-mail is prohibited.</p>
<br>
<p>Thank you for your compliance.</p>
<hr>
</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>