diff --git a/src/include/switch_core.h b/src/include/switch_core.h index 80add3ab28..ee890a80c9 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -57,6 +57,7 @@ SWITCH_BEGIN_EXTERN_C struct switch_app_log { char *app; char *arg; + switch_time_t stamp; struct switch_app_log *next; }; diff --git a/src/switch_core_session.c b/src/switch_core_session.c index 8d4a2851f3..ade22d2f32 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -2010,6 +2010,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t * log->arg = switch_core_session_strdup(session, expanded); } + log->stamp = switch_time_now(); + for (lp = session->app_log; lp && lp->next; lp = lp->next); if (lp) { diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 2f0066f415..94fa0651ba 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -2068,6 +2068,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_generate_xml_cdr(switch_core_session_ goto error; } for (ap = app_log; ap; ap = ap->next) { + char tmp[128]; if (!(x_application = switch_xml_add_child_d(x_apps, "application", app_off++))) { goto error; @@ -2075,6 +2076,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_generate_xml_cdr(switch_core_session_ switch_xml_set_attr_d(x_application, "app_name", ap->app); switch_xml_set_attr_d(x_application, "app_data", ap->arg); + + switch_snprintf(tmp, sizeof(tmp), "%" SWITCH_TIME_T_FMT, ap->stamp); + switch_xml_set_attr_d(x_application, "app_stamp", tmp); } }