<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageBodySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;">Hi,
<div><br /></div>
<div>Sql statement returns:</div>
<div><br /></div>
<div>
<div>mysql> select count(*) from accounting.cdr;</div>
<div>+----------+</div>
<div>| count(*) |</div>
<div>+----------+</div>
<div>|     8877 |</div>
<div>+----------+</div>
<div>1 row in set (0.00 sec)</div>
</div>
<div><br /></div>
<div>When i select last row from cdr table, it returns:</div>
<div><br /></div>
<div>
<div><br /></div>
<div>mysql> select * from accounting.cdr order by start_time desc limit 1\G</div>
<div>*************************** 1. row ***************************</div>
<div>                                  id: 10946</div>
<div>                         update_time: 2017-04-04 11:55:03</div>
<div>                      source_user_id: 45542209-1c07-4069-bb9b-f8ed9d11c560</div>
<div>                  source_provider_id: 2</div>
<div>       source_external_subscriber_id: </div>
<div>         source_external_contract_id: 0003597001</div>
<div>                   source_account_id: 261</div>
<div>                         source_user: 0003597001</div>
<div>                       source_domain: sip00.XXXXXXX.com</div>
<div>                          source_cli: XXXXXXXXXXX</div>
<div>                         source_clir: 0</div>
<div>                           source_ip: 10.0.17.48</div>
<div>                         source_gpp0: NULL</div>
<div>                         source_gpp1: NULL</div>
<div>                         source_gpp2: NULL</div>
<div>                         source_gpp3: NULL</div>
<div>                         source_gpp4: NULL</div>
<div>                         source_gpp5: NULL</div>
<div>                         source_gpp6: NULL</div>
<div>                         source_gpp7: NULL</div>
<div>                         source_gpp8: NULL</div>
<div>                         source_gpp9: NULL</div>
<div>                 destination_user_id: 0</div>
<div>             destination_provider_id: 5</div>
<div>  destination_external_subscriber_id: </div>
<div>    destination_external_contract_id: </div>
<div>              destination_account_id: 0</div>
<div>                    destination_user: XXXXXXXXXXX</div>
<div>                  destination_domain: YYY.YYY.YYY.YYY</div>
<div>             destination_user_dialed: XXXXXXXXXX</div>
<div>                 destination_user_in: XXXXXXXXXX</div>
<div>               destination_domain_in: sip00.XXXXX.com</div>
<div>                    destination_gpp0: NULL</div>
<div>                    destination_gpp1: NULL</div>
<div>                    destination_gpp2: NULL</div>
<div>                    destination_gpp3: NULL</div>
<div>                    destination_gpp4: NULL</div>
<div>                    destination_gpp5: NULL</div>
<div>                    destination_gpp6: NULL</div>
<div>                    destination_gpp7: NULL</div>
<div>                    destination_gpp8: NULL</div>
<div>                    destination_gpp9: NULL</div>
<div>                      peer_auth_user: </div>
<div>                     peer_auth_realm: </div>
<div>                           call_type: call</div>
<div>                         call_status: ok</div>
<div>                           call_code: 200</div>
<div>                           init_time: 1491298656.210</div>
<div>                          start_time: 1491298679.704</div>
<div>                            duration: 2.873</div>
<div>                             call_id: 907020824-5060-14@BA.A.BH.EI</div>
<div>                 source_carrier_cost: 0.166600</div>
<div>                source_reseller_cost: 0.166600</div>
<div>                source_customer_cost: 0.166600</div>
<div>            source_carrier_free_time: 0</div>
<div>           source_reseller_free_time: 0</div>
<div>           source_customer_free_time: 0</div>
<div>       source_carrier_billing_fee_id: 41270</div>
<div>      source_reseller_billing_fee_id: 41270</div>
<div>      source_customer_billing_fee_id: 41270</div>
<div>      source_carrier_billing_zone_id: 2094</div>
<div>     source_reseller_billing_zone_id: 2094</div>
<div>     source_customer_billing_zone_id: 2094</div>
<div>            destination_carrier_cost: 0.000000</div>
<div>           destination_reseller_cost: 0.000000</div>
<div>           destination_customer_cost: 0.000000</div>
<div>       destination_carrier_free_time: 0</div>
<div>      destination_reseller_free_time: 0</div>
<div>      destination_customer_free_time: 0</div>
<div>  destination_carrier_billing_fee_id: NULL</div>
<div> destination_reseller_billing_fee_id: NULL</div>
<div> destination_customer_billing_fee_id: NULL</div>
<div> destination_carrier_billing_zone_id: NULL</div>
<div>destination_reseller_billing_zone_id: NULL</div>
<div>destination_customer_billing_zone_id: NULL</div>
<div>                 frag_carrier_onpeak: NULL</div>
<div>                frag_reseller_onpeak: NULL</div>
<div>                frag_customer_onpeak: NULL</div>
<div>                       is_fragmented: NULL</div>
<div>                               split: 0</div>
<div>                            rated_at: 2017-04-04 11:38:16</div>
<div>                       rating_status: ok</div>
<div>                         exported_at: 2017-04-04 11:55:03</div>
<div>                       export_status: ok</div>
<div>1 row in set (0.09 sec)</div>
</div>
</div>
<div name="messageSignatureSection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
<div><br /></div>
<div>Searching kamailio-proxy.log, the only strange thing i see is this line:</div>
<div><br /></div>
<div><span style="font-family: Menlo; font-size: 11px;">Apr  4 11:37:36 sip00 proxy[11007]: NOTICE: <script>: Setting acc destination-leg for uuid '0': '0|||0|XXXXXXXXX|0|YYYYYYYYYYY|ZZZ.ZZZ.ZZZ.ZZ|YYYYYYYYYYY|sip00.XXXXXXXX.com|1|||||||||||' - R=sip:YYYYYYYYYYY@ZZZ.ZZZ.ZZZ.ZZZ:5060;transport=udp ID=907020824-5060-14@BA.A.BH.EI UA='Grandstream HT701 1.0.8.2'</span><br /></div>
<div><br /></div>
<div>where it's appear that acc dst-leg is not set.</div>
<div><br /></div>
<div>I do a select on kamailio.acc table filtering where rows have blank dst_leg, and it returns 67000+ rows from 169000 rows that table has. </div>
<div><br /></div>
<div>I don't know what is next step.</div>
<div><br /></div>
<div>Regards</div>
<div><br /></div>
<div>
<p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><br /></p>
</div>
<div><br /></div>
</div>
<div name="messageReplySection" style="font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, sans-serif;"><br />
On 29 may 2017 14:43 +0200, Andreas Granig <agranig@sipwise.com>, wrote:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #1abc9c;">Hi,<br />
<br />
You can try a "select count(*) from accounting.cdr" in MySQL to see how<br />
many records you have there, since this is where mediator puts its<br />
results to. Fetch some random ones and check them in detail, e.g. taking<br />
the call_id column and grep for it in kamailio-proxy.log to see what's<br />
going on.<br />
<br />
Andreas<br />
<br />
On 05/29/2017 01:06 PM, David Martínez wrote:<br />
<blockquote type="cite" style="margin: 5px 5px; padding-left: 10px; border-left: thin solid #e67e22;">Hi,<br />
<br />
Since some days ago, cdr stops working. Seeing whats happening I noticed<br />
that mediator service was not running. So i started it and then i see<br />
this on cdr.log file:<br />
<br />
/May 24 13:31:31 sip00 mediator[28631]: Locking process./<br />
/May 24 13:31:31 sip00 mediator[28631]: Daemonizing process./<br />
/May 24 13:31:31 sip00 mediator[28632]: Writing pid file./<br />
/May 24 13:31:31 sip00 mediator[28632]: ACC acc database<br />
host='localhost', port='3306', user='kamailio', name='kamailio'/<br />
/May 24 13:31:31 sip00 mediator[28632]: CDR acc database<br />
host='localhost', port='3306', user='mediator', name='accounting'/<br />
/May 24 13:31:31 sip00 mediator[28632]: PROV database host='localhost',<br />
port='3306', user='mediator', name='provisioning'/<br />
/May 24 13:31:31 sip00 mediator[28632]: STATS database host='localhost',<br />
port='3306', user='mediator', name='stats'/<br />
/May 24 13:31:31 sip00 mediator[28632]: Setting up mysql connections./<br />
/May 24 13:31:31 sip00 mediator[28632]: Up and running, daemonized=1,<br />
pid-path='/var/run/mediator.pid', interval=10/<br />
/May 24 13:37:12 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 24 13:37:22 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 24 13:37:32 sip00 mediator[28632]: Overall 93418 CDRs created so far./<br />
/May 24 13:43:06 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 24 13:43:16 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 24 13:43:26 sip00 mediator[28632]: Overall 186855 CDRs created so far./<br />
<br />
After some days, i see that log says:<br />
<br />
/May 29 11:06:31 sip00 mediator[28632]: Overall 118815884 CDRs created<br />
so far./<br />
/May 29 11:13:55 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 29 11:14:05 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 29 11:14:15 sip00 mediator[28632]: Overall 118916574 CDRs created<br />
so far./<br />
/May 29 11:21:10 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 29 11:21:20 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 29 11:21:30 sip00 mediator[28632]: Overall 119017291 CDRs created<br />
so far./<br />
/May 29 11:28:18 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 29 11:28:28 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 29 11:28:38 sip00 mediator[28632]: Overall 119118049 CDRs created<br />
so far./<br />
/May 29 11:34:32 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 29 11:34:42 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 29 11:34:52 sip00 mediator[28632]: Overall 119218842 CDRs created<br />
so far./<br />
/May 29 11:41:24 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 29 11:41:34 sip00 mediator[28632]: Lost connection to SQL server<br />
during query, retrying.../<br />
/May 29 11:41:44 sip00 mediator[28632]: Overall 119319664 CDRs created<br />
so far./<br />
/<br />
/<br />
/<br />
/<br />
I think that our system is too young to have that number of calls, so i<br />
search log file when mediator stops and i see:<br />
<br />
/Apr 4 11:38:08 sip00 mediator[3948]: Overall 3038 CDRs created so far./<br />
/Apr 4 11:38:32 sip00 mediator[3948]: Overall 3039 CDRs created so far./<br />
/Apr 4 11:38:45 sip00 mediator[3948]: Overall 3040 CDRs created so far./<br />
/Apr 4 11:38:58 sip00 mediator[3948]: Error getting acc callids: Server<br />
shutdown in progress/<br />
/Apr 4 11:38:58 sip00 mediator[3948]: Shutting down./<br />
/Apr 4 11:38:58 sip00 mediator[3948]: Successfully shut down./<br />
/Apr 4 11:38:58 sip00 mediator[3948]: Unlocking mediator./<br />
/<br />
/<br />
/ /I searched on mailing list (using google cache, because server is<br />
down now) and i didn’t found how to debug mediator.<br />
<br />
Can anyone help?<br />
<br />
Regards<br />
<br />
<br />
_______________________________________________<br />
Spce-user mailing list<br />
Spce-user@lists.sipwise.com<br />
https://lists.sipwise.com/listinfo/spce-user<br />
<br /></blockquote>
_______________________________________________<br />
Spce-user mailing list<br />
Spce-user@lists.sipwise.com<br />
https://lists.sipwise.com/listinfo/spce-user<br /></blockquote>
</div>
</body>
</html>