]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add time stamp to app_log
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 16 May 2011 18:41:52 +0000 (13:41 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 16 May 2011 18:41:52 +0000 (13:41 -0500)
src/include/switch_core.h
src/switch_core_session.c
src/switch_ivr.c

index 80add3ab288a3e013da967893882c9f3f3846d29..ee890a80c91ca02d23d1550d015b8c5c070c86f8 100644 (file)
@@ -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;
 };
 
index 8d4a2851f3bbc56b69901ecb8e44ca005d4b1ee2..ade22d2f3278b44f4c2ec4271f5d82411d28e356 100644 (file)
@@ -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) {
index 2f0066f4155b144ab6263731c139b4121b494de1..94fa0651ba977b9f3a743ba8350517c49245f163 100644 (file)
@@ -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);
                }
        }