From 06440fa591ae07aa113084787561de58adb89a96 Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Wed, 4 Dec 2013 17:51:11 +0100 Subject: [PATCH] merge changes from 'master' into 1.7 --- debian/changelog | 8 ++++++++ mediator.h | 1 - medmysql.c | 5 ++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index f990081..d742d15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +ngcp-mediator (1.7.1) unstable; urgency=low + + [ Kirill Solomko ] + * [f89c788] MT#5257 - only distint acc records are selected per callid, + removed unused acc.id field selection + + -- Kirill Solomko Tue, 04 Dec 2013 17:47:34 +0100 + ngcp-mediator (1.7.0) unstable; urgency=low [ agranig ] diff --git a/mediator.h b/mediator.h index 9d7e3cd..8633a1f 100644 --- a/mediator.h +++ b/mediator.h @@ -64,7 +64,6 @@ typedef struct { char callid[256]; char timestamp[24]; double unix_timestamp; - u_int64_t med_id; u_int8_t valid; med_method_t method; char sip_method[32]; diff --git a/medmysql.c b/medmysql.c index 588745c..91f7e07 100644 --- a/medmysql.c +++ b/medmysql.c @@ -9,8 +9,8 @@ /*#define MED_CALLID_QUERY "(select a.callid, a.time from acc a, acc b where a.callid = b.callid and a.method = 'INVITE' and b.method = 'BYE' group by callid) union (select callid, time from acc where method = 'INVITE' and sip_code != '200') order by time asc limit 0,200000"*/ #define MED_CALLID_QUERY "select a.callid from acc a left join acc b on a.callid = b.callid and b.method = 'BYE' where a.method = 'INVITE' and (a.sip_code != '200' or b.id is not null) group by a.callid limit 0,200000" -#define MED_FETCH_QUERY "select sip_code, sip_reason, method, callid, time, time_hires, " \ - "src_leg, dst_leg, id " \ +#define MED_FETCH_QUERY "select distinct sip_code, sip_reason, method, callid, time, time_hires, " \ + "src_leg, dst_leg " \ "from acc where callid = '%s' order by time_hires asc" #define MED_LOAD_PEER_QUERY "select h.ip, h.host, g.peering_contract_id " \ @@ -242,7 +242,6 @@ int medmysql_fetch_records(med_callid_t *callid, e->unix_timestamp = atof(row[5]); g_strlcpy(e->src_leg, row[6], sizeof(e->src_leg)); g_strlcpy(e->dst_leg, row[7], sizeof(e->dst_leg)); - e->med_id = atoll(row[8]); e->valid = 1; if (check_shutdown())