From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Thu, 21 Nov 2019 13:41:38 +0100
Subject: [PATCH] core: main - executes callbacks on app ready and shutdown

---
 src/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main.c b/src/main.c
index a474f88..b1414a9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -683,6 +683,8 @@ static void sig_alarm_abort(int signo)
 
 static void shutdown_children(int sig, int show_status)
 {
+	sr_corecb_void_exec(app_shutdown);
+
 	kill_all_children(sig);
 	if (set_sig_h(SIGALRM, sig_alarm_kill) == SIG_ERR ) {
 		LM_ERR("could not install SIGALARM handler\n");
@@ -1787,6 +1789,7 @@ int main_loop(void)
 		cfg_ok=1;
 
 		*_sr_instance_started = 1;
+		sr_corecb_void_exec(app_ready);
 
 #ifdef EXTRA_DEBUG
 		for (r=0; r<*process_count; r++){
