diff --git a/buildlib.sh b/buildlib.sh index 6fe729454b..1465935e2f 100755 --- a/buildlib.sh +++ b/buildlib.sh @@ -42,7 +42,7 @@ fi if [ -f $uncompressed/.complete ] ; then echo $uncompressed already installed - exit + exit 0 fi cd $uncompressed diff --git a/generic_mod.mk b/generic_mod.mk index 5761711588..ce56d3ef02 100644 --- a/generic_mod.mk +++ b/generic_mod.mk @@ -1,10 +1,9 @@ +all: $(MOD).so $(MOD).so: $(MOD).c $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o $(CC) $(SOLINK) $(MOD).o -o $(MOD).so $(LDFLAGS) -all: $(MOD).so - clean: rm -fr *.so *.o *~ diff --git a/modules.conf b/modules.conf index 15b6b40b59..64846313a4 100644 --- a/modules.conf +++ b/modules.conf @@ -14,3 +14,4 @@ mod_iaxchan #mod_codec_g729 mod_event_test mod_portaudio +mod_xmpp_event diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 57eae8d8c9..73dac14287 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -251,6 +251,8 @@ typedef apr_hash_index_t switch_hash_index_t; #define SWITCH_THREAD_FUNC APR_THREAD_FUNC #define switch_time_now apr_time_now #define switch_strftime apr_strftime +#define switch_rfc822_date apr_rfc822_date +#define switch_time_exp_gmt apr_time_exp_gmt #define switch_time_exp_get apr_time_exp_get #define switch_time_exp_lt apr_time_exp_lt #define switch_thread_create apr_thread_create diff --git a/src/mod/mod_codec_g729/Makefile b/src/mod/mod_codec_g729/Makefile index 07c49b7677..6657b4c1fa 100644 --- a/src/mod/mod_codec_g729/Makefile +++ b/src/mod/mod_codec_g729/Makefile @@ -1,12 +1,12 @@ CFLAGS += -I/usr/local/include/libg729 LDFLAGS +=-lg729 +all: $(MOD).so + $(MOD).so: $(MOD).c $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o $(CC) $(SOLINK) $(MOD).o -o $(MOD).so $(LDFLAGS) -lspeex -all: $(MOD).so - clean: rm -fr *.so *.o *~ diff --git a/src/mod/mod_exosip/Makefile b/src/mod/mod_exosip/Makefile index efdc2147dd..a0d0a1478b 100644 --- a/src/mod/mod_exosip/Makefile +++ b/src/mod/mod_exosip/Makefile @@ -7,6 +7,8 @@ else LINKER=$(CC) endif +all: depends $(MOD).so + depends: $(BASE)/buildlib.sh $(BASE) install jthread-1.1.2.tar.gz $(BASE)/buildlib.sh $(BASE) install jrtplib-3.3.0.tar.gz @@ -19,8 +21,6 @@ $(MOD).so: $(MOD).c $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o $(LINKER) $(SOLINK) -o $(MOD).so $(MOD).o $(LDFLAGS) -all: depends $(MOD).so - clean: rm -fr *.so *.o *~ diff --git a/src/mod/mod_iaxchan/Makefile b/src/mod/mod_iaxchan/Makefile index 19e56dfc67..be09c93a2d 100644 --- a/src/mod/mod_iaxchan/Makefile +++ b/src/mod/mod_iaxchan/Makefile @@ -1,5 +1,7 @@ LDFLAGS += -liax -L/usr/local/lib +all: depends $(MOD).so + depends: $(BASE)/buildlib.sh $(BASE) install iax --enable-newjb @@ -7,7 +9,6 @@ $(MOD).so: $(MOD).c $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o $(CC) $(SOLINK) -o $(MOD).so $(MOD).o $(LDFLAGS) -all: depends $(MOD).so clean: rm -fr *.so *.o *~ diff --git a/src/mod/mod_opalchan/Makefile b/src/mod/mod_opalchan/Makefile index 6064c58c9a..709a5b7bc5 100644 --- a/src/mod/mod_opalchan/Makefile +++ b/src/mod/mod_opalchan/Makefile @@ -1,12 +1,12 @@ #CFLAGS += -I/usr/src/common/src LDFLAGS += -liax +all: $(MOD).so + $(MOD).so: $(MOD).c $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o $(CC) $(SOLINK) -o $(MOD).so $(MOD).o $(LDFLAGS) -all: $(MOD).so - clean: rm -fr *.so *.o *~ diff --git a/src/mod/mod_portaudio/Makefile b/src/mod/mod_portaudio/Makefile index ad425b5a48..dea5a236db 100644 --- a/src/mod/mod_portaudio/Makefile +++ b/src/mod/mod_portaudio/Makefile @@ -1,6 +1,8 @@ LDFLAGS += -lportaudio -L/usr/local/lib MYOBJS = pablio.o ringbuffer.o +all: depends $(MOD).so + depends: $(BASE)/buildlib.sh $(BASE) install portaudio.tar.gz %.o: %.c @@ -10,7 +12,7 @@ $(MOD).so: $(MOD).c $(MYOBJS) $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o $(CC) $(SOLINK) -o $(MOD).so $(MOD).o $(MYOBJS) $(LDFLAGS) -all: depends $(MOD).so + clean: rm -fr *.so *.o *~ diff --git a/src/mod/mod_speexcodec/Makefile b/src/mod/mod_speexcodec/Makefile index f3c29c4391..44afd19f1b 100644 --- a/src/mod/mod_speexcodec/Makefile +++ b/src/mod/mod_speexcodec/Makefile @@ -1,3 +1,5 @@ +all: depends $(MOD).so + depends: $(BASE)/buildlib.sh $(BASE) install speex-1.1.11.1.tar.gz @@ -5,8 +7,6 @@ $(MOD).so: $(MOD).c $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o $(CC) $(SOLINK) $(MOD).o -o $(MOD).so $(LDFLAGS) -lspeex -all: depends $(MOD).so - clean: rm -fr *.so *.o *~ diff --git a/src/switch_core.c b/src/switch_core.c index fc8e82c38a..f25970f314 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -1412,11 +1412,13 @@ SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void { switch_thread *thread; switch_threadattr_t *thd_attr;; - switch_threadattr_create(&thd_attr, runtime.memory_pool); - switch_threadattr_detach_set(thd_attr, 1); switch_core_thread_session *ts; switch_memory_pool *pool = NULL; + switch_threadattr_create(&thd_attr, runtime.memory_pool); + switch_threadattr_detach_set(thd_attr, 1); + + if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) { switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Could not allocate memory pool\n"); return; diff --git a/src/switch_event.c b/src/switch_event.c index 8ffe30dfcd..36701efcef 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -478,12 +478,13 @@ SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func, return SWITCH_STATUS_FALSE; } - switch_time_exp_lt(&tm, switch_time_now()); - switch_strftime(date, &retsize, sizeof(date), "%Y-%m-%d", &tm); - switch_event_add_header(*event, "event_date", date); - switch_strftime(date, &retsize, sizeof(date), "%T", &tm); - switch_event_add_header(*event, "event_time", date); + switch_rfc822_date(date, switch_time_now()); + switch_event_add_header(*event, "event_date_gmt", date); + + switch_time_exp_lt(&tm, switch_time_now()); + switch_strftime(date, &retsize, sizeof(date), "%a, %d-%b-%Y %X", &tm); + switch_event_add_header(*event, "event_date_local", date); switch_event_add_header(*event, "event_file", file); switch_event_add_header(*event, "event_function", func);