select (case servicetype when 'transit' then substring_index(siptranslatedrequesturi, '@', 1) else substring_index(callingstationid, '@', 1) end ) as server_id, concat('syd1', '_2010_05_', radacctid) as unique_id, acctstarttime as calldate, substring_index(calledstationid, '@', 1) as did, (case servicetype when 'transit' then substring_index(callingstationid, '@', 1) else '' end ) as ani, substring_index(calledstationid, '@', 1) as dialed_number, destinationid as is_mobile, acctsessiontime as duration, acctsessiontime as billable_duration, price as billed_amount, price as customer_billed_amount, acctterminatecause as disposition, destinationid as country, 'symbio' as provider_type, (case servicetype when 'outgoing' then 'outbound' else 'inbound' end ) as direction, (case servicetype when 'outbound' then destinationid else '' end) as international, (case servicetype when 'transit' then substring_index(calledstationid, '@', 1) else destinationid end) as call_type from radacct201005;
Showing changes from previous revision. Removed | Added
