switch_caller_profile_t *caller_profile, *ocp;
switch_app_log_t *app_log, *ap;
char *last_app = NULL, *last_arg = NULL;
- char start[80] = "", resurrect[80] = "", answer[80] = "", progress[80] = "", progress_media[80] = "", end[80] = "", tmp[80] = "", profile_start[80] =
- "";
+ char start[80] = "", resurrect[80] = "", answer[80] = "", progress[80] = "", progress_media[80] = "", end[80] = "", tmp[80] = "",
+ profile_start[80] = "";
int32_t duration = 0, legbillsec = 0, billsec = 0, mduration = 0, billmsec = 0, legbillmsec = 0, progressmsec = 0, progress_mediamsec = 0;
int32_t answersec = 0, answermsec = 0;
switch_time_t answerusec = 0;
if (caller_profile->times->resurrected) {
switch_time_exp_lt(&tm, caller_profile->times->resurrected);
- switch_strftime_nocheck(answer, &retsize, sizeof(resurrect), fmt, &tm);
+ switch_strftime_nocheck(resurrect, &retsize, sizeof(resurrect), fmt, &tm);
switch_channel_set_variable(channel, "resurrect_stamp", resurrect);
}
tt_created = (time_t) (caller_profile->times->created / 1000000);
mtt_created = (time_t) (caller_profile->times->created / 1000);
- tt_prof_created = (time_t) (caller_profile->times->profile_created / 1000000);
- mtt_prof_created = (time_t) (caller_profile->times->profile_created / 1000);
switch_snprintf(tmp, sizeof(tmp), "%" TIME_T_FMT, tt_created);
switch_channel_set_variable(channel, "start_epoch", tmp);
switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->created);
switch_channel_set_variable(channel, "start_uepoch", tmp);
+ tt_prof_created = (time_t) (caller_profile->times->profile_created / 1000000);
+ mtt_prof_created = (time_t) (caller_profile->times->profile_created / 1000);
switch_snprintf(tmp, sizeof(tmp), "%" TIME_T_FMT, tt_prof_created);
switch_channel_set_variable(channel, "profile_start_epoch", tmp);
switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->profile_created);
switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->progress_media);
switch_channel_set_variable(channel, "progress_media_uepoch", tmp);
-
tt_hungup = (time_t) (caller_profile->times->hungup / 1000000);
mtt_hungup = (time_t) (caller_profile->times->hungup / 1000);
switch_snprintf(tmp, sizeof(tmp), "%" TIME_T_FMT, tt_hungup);
switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, caller_profile->times->hungup);
switch_channel_set_variable(channel, "end_uepoch", tmp);
- uduration = caller_profile->times->hungup - caller_profile->times->created;
duration = (int32_t) (tt_hungup - tt_created);
mduration = (int32_t) (mtt_hungup - mtt_created);
+ uduration = caller_profile->times->hungup - caller_profile->times->created;
if (caller_profile->times->answered) {
billsec = (int32_t) (tt_hungup - tt_answered);
progress_mediausec = caller_profile->times->progress_media - caller_profile->times->created;
}
-
}
switch_channel_set_variable(channel, "last_app", last_app);
switch_snprintf(tmp, sizeof(tmp), "%d", billsec);
switch_channel_set_variable(channel, "billsec", tmp);
- switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, progresssec);
+ switch_snprintf(tmp, sizeof(tmp), "%d", progresssec);
switch_channel_set_variable(channel, "progresssec", tmp);
- switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, answersec);
+ switch_snprintf(tmp, sizeof(tmp), "%d", answersec);
switch_channel_set_variable(channel, "answersec", tmp);
- switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, progress_mediasec);
+ switch_snprintf(tmp, sizeof(tmp), "%d", progress_mediasec);
switch_channel_set_variable(channel, "progress_mediasec", tmp);
switch_snprintf(tmp, sizeof(tmp), "%d", legbillsec);
switch_snprintf(tmp, sizeof(tmp), "%d", answermsec);
switch_channel_set_variable(channel, "answermsec", tmp);
- switch_snprintf(tmp, sizeof(tmp), "%d", progressmsec);
+ switch_snprintf(tmp, sizeof(tmp), "%d", progress_mediamsec);
switch_channel_set_variable(channel, "progress_mediamsec", tmp);
switch_snprintf(tmp, sizeof(tmp), "%d", legbillmsec);