aboutsummaryrefslogtreecommitdiffstats
path: root/cdr
diff options
context:
space:
mode:
Diffstat (limited to 'cdr')
-rw-r--r--cdr/cdr_pgsql.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cdr/cdr_pgsql.c b/cdr/cdr_pgsql.c
index 7a38d1064..f06eee881 100644
--- a/cdr/cdr_pgsql.c
+++ b/cdr/cdr_pgsql.c
@@ -140,6 +140,9 @@ static int pgsql_log(struct ast_cdr *cdr)
AST_RWLIST_TRAVERSE(&psql_columns, cur, list) {
/* For fields not set, simply skip them */
ast_cdr_getvar(cdr, cur->name, &value, buf, sizeof(buf), 0, 0);
+ if (strcmp(cur->name, "calldate") == 0 && !value) {
+ ast_cdr_getvar(cdr, "start", &value, buf, sizeof(buf), 0, 0);
+ }
if (!value) {
if (cur->notnull && !cur->hasdefault) {
/* Field is NOT NULL (but no default), must include it anyway */