]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3886 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 7 Feb 2012 17:25:23 +0000 (11:25 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 7 Feb 2012 17:25:23 +0000 (11:25 -0600)
src/switch_event.c

index 7e8a8676ba5e0c61b249aecc89c5cbe8f7419e1d..25bab3185aa3d997adb694b7cf192aa16455da4d 100644 (file)
@@ -85,6 +85,7 @@ static switch_mutex_t *EVENT_QUEUE_MUTEX = NULL;
 static switch_hash_t *CUSTOM_HASH = NULL;
 static int THREAD_COUNT = 0;
 static int SYSTEM_RUNNING = 0;
+static uint64_t EVENT_SEQUENCE_NR = 0;
 #ifdef SWITCH_EVENT_RECYCLE
 static switch_queue_t *EVENT_RECYCLE_QUEUE = NULL;
 static switch_queue_t *EVENT_HEADER_RECYCLE_QUEUE = NULL;
@@ -1740,6 +1741,10 @@ SWITCH_DECLARE(void) switch_event_prep_for_delivery_detailed(const char *file, c
        switch_size_t retsize;
        switch_time_t ts = switch_micro_time_now();
 
+       switch_mutex_lock(EVENT_QUEUE_MUTEX);
+       EVENT_SEQUENCE_NR++;
+       switch_mutex_unlock(EVENT_QUEUE_MUTEX);
+
 
        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Name", switch_event_name(event->event_id));
        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Core-UUID", switch_core_get_uuid());
@@ -1757,6 +1762,7 @@ SWITCH_DECLARE(void) switch_event_prep_for_delivery_detailed(const char *file, c
        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Calling-File", switch_cut_path(file));
        switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Event-Calling-Function", func);
        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Event-Calling-Line-Number", "%d", line);
+       switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Event-Sequence", "%" SWITCH_UINT64_T_FMT, (uint64_t) EVENT_SEQUENCE_NR);
 
 
 }