diff --git a/modules/msilo/msilo.c b/modules/msilo/msilo.c
index 903b3cf..476c0de 100644
--- a/modules/msilo/msilo.c
+++ b/modules/msilo/msilo.c
@@ -62,9 +62,13 @@
 #include "../../parser/contact/parse_contact.h"
 #include "../../parser/parse_allow.h"
 #include "../../parser/parse_methods.h"
+#include "../../parser/msg_parser.h"
 #include "../../resolve.h"
 #include "../../usr_avp.h"
 #include "../../mod_fix.h"
+#include "../../dprint.h"
+#include "../../globals.h"
+#include "../../dset.h"
 
 #include "../../modules/tm/tm_load.h"
 
@@ -185,6 +189,7 @@ int check_message_support(struct sip_msg* msg);
 
 /** TM callback function */
 static void m_tm_callback( struct cell *t, int type, struct tmcb_params *ps);
+static void m_tm_callback_on_delivered_event( struct cell *t, int type, struct tmcb_params *ps);
 
 static cmd_export_t cmds[]={
 	{"m_store",  (cmd_function)m_store_2, 0, 0, 0, REQUEST_ROUTE | FAILURE_ROUTE},
@@ -281,6 +286,17 @@ static int bind_msilo(msilo_api_t* api)
 	return 0;
 }
 
+/* where to go for the local request route ("msilo:on-delivered") */
+static int msilo_event_on_delivered=-1; /* default disabled */
+
+typedef struct msilo_notification_event
+{
+  struct sip_msg *req;
+  int mid;
+} msilo_notification_event_t;
+
+static msilo_notification_event_t *msilo_make_request(str *ruri, str *to, str *from, str *hdr, int mid);
+
 /**
  * init module function
  */
@@ -480,6 +496,11 @@ static int mod_init(void)
 	if(ms_outbound_proxy.s!=NULL)
 		ms_outbound_proxy.len = strlen(ms_outbound_proxy.s);
 
+        /* check if the on-delivered route event exists or not */
+	msilo_event_on_delivered=route_lookup(&event_rt, "msilo:on-delivered");
+	if (msilo_event_on_delivered>=0 && event_rt.rlist[msilo_event_on_delivered]==0)
+		msilo_event_on_delivered=-1; /* disable */
+
 	return 0;
 }
 
@@ -839,7 +860,7 @@ static int m_store(struct sip_msg* msg, str *owner_s)
 	db_vals[nr_keys].val.blob_val.len = extra_hdrs.len;
 
 	nr_keys++;
-	
+
 	if(msilo_dbf.insert(db_con, db_keys, db_vals, nr_keys) < 0)
 	{
 		LM_ERR("failed to store message\n");
@@ -971,7 +992,7 @@ static int m_dump(struct sip_msg* msg, str* owner_s)
 	uac_req_t uac_r;
 	str str_vals[5], hdr_str, body_str, extra_hdrs_str, tmp_extra_hdrs;
 	time_t rtime;
-	
+
 	/* init */
 	ob_key = &sc_mid;
 
@@ -1096,8 +1117,7 @@ static int m_dump(struct sip_msg* msg, str* owner_s)
 		SET_STR_VAL(str_vals[2], db_res, i, 3); /* body */
 		SET_STR_VAL(str_vals[3], db_res, i, 4); /* ctype */
 		SET_STR_VAL(str_vals[4], db_res, i, 6); /* stored hdrs */
-		rtime = 
-			(time_t)RES_ROWS(db_res)[i].values[5/*inc time*/].val.int_val;
+		rtime = (time_t)RES_ROWS(db_res)[i].values[5/*inc time*/].val.int_val;
 		
 		if (ms_extra_hdrs != NULL) {
 		    if (fixup_get_svalue(msg, (gparam_p)*ms_extra_hdrs_sp,
@@ -1145,7 +1165,7 @@ static int m_dump(struct sip_msg* msg, str* owner_s)
 		if(tmp_extra_hdrs.len>0)
 			pkg_free(tmp_extra_hdrs.s);
 			
-		LM_DBG("msg [%d-%d] for: %.*s\n", i+1, mid,	pto->uri.len, pto->uri.s);
+		LM_DBG("msg [%d-%d] for: %.*s\n", i+1, mid, pto->uri.len, pto->uri.s);
 			
 		/** sending using TM function: t_uac */
 		body_str.len = 1024;
@@ -1166,14 +1186,19 @@ static int m_dump(struct sip_msg* msg, str* owner_s)
 		uac_r.headers = &hdr_str;
 		uac_r.body = (n<0)?&str_vals[2]:&body_str;
 		uac_r.cb_flags = TMCB_LOCAL_COMPLETED;
-		uac_r.cb  = m_tm_callback;
-		uac_r.cbp = (void*)(long)mid;
-
-		tmb.t_request(&uac_r,  /* UAC Req */
-					  &str_vals[1],  /* Request-URI */
-					  &str_vals[1],  /* To */
-					  &str_vals[0],  /* From */
-					  (ms_outbound_proxy.s)?&ms_outbound_proxy:0 /* ob uri */
+                uac_r.cbp = (void*)msilo_make_request(&str_vals[1] /* ruri */,
+                                                      &str_vals[1] /* to */,
+                                                      &str_vals[0] /* from */,
+                                                      &hdr_str,
+                                                      mid);
+
+		uac_r.cb  = m_tm_callback_on_delivered_event;
+
+                tmb.t_request(&uac_r, /* UAC Req */
+				      &str_vals[1],  /* Request-URI */
+				      &str_vals[1],  /* To */
+				      &str_vals[0],  /* From */
+				      (ms_outbound_proxy.s)?&ms_outbound_proxy:0 /* ob uri */
 			);
 	}
 
@@ -1334,6 +1359,69 @@ done:
 	return;
 }
 
+/**
+ * TM callback function - delete message from database if was sent OK and execute
+ * the msilo:on-delivered event route
+ */
+void m_tm_callback_on_delivered_event(struct cell *t, int type, struct tmcb_params *ps)
+{
+        msilo_notification_event_t *event;
+
+	if(ps->param==NULL || *ps->param == NULL)
+	{
+		LM_DBG("message id not received\n");
+		goto done;
+	}
+
+        event = (msilo_notification_event_t*)*ps->param;
+
+        LM_DBG(">>>>>>> msilo_notification_event %p\n", event);
+
+	LM_DBG("completed with status %d [mid: %d]\n", ps->code, event->mid);
+	if(!db_con)
+	{
+		LM_ERR("db_con is NULL\n");
+		goto done;
+	}
+	if(ps->code >= 300)
+	{
+		LM_DBG("message <%d> was not sent successfully\n", event->mid);
+		msg_list_set_flag(ml, event->mid, MS_MSG_ERRO);
+		goto done;
+	}
+
+	LM_DBG("message <%d> was sent successfully\n", event->mid);
+	msg_list_set_flag(ml, event->mid, MS_MSG_DONE);
+
+        /* execute the msilo:on-delivered event route */
+        if(unlikely(msilo_event_on_delivered>=0))
+        {
+                int sflag_bk;
+                int backup_route_type;
+                struct run_act_ctx ctx;
+
+                LM_DBG("executing event_route[msilo:on-delivered] (%d)\n", msilo_event_on_delivered);
+
+                sflag_bk = getsflags();
+                backup_route_type = get_route_type();
+
+                set_route_type(EVENT_ROUTE);
+                init_run_actions_ctx(&ctx);
+                LM_DBG("event_route[msilo:on-delivered] event->req=%p)\n", event->req);
+                run_top_route(event_rt.rlist[msilo_event_on_delivered], event->req, &ctx);
+
+                set_route_type(backup_route_type);
+                setsflagsval(sflag_bk);
+
+                shm_free(event->req->buf);
+                shm_free(event->req);
+                shm_free(event);
+        }
+
+done:
+	return;
+}
+
 void m_send_ontimer(unsigned int ticks, void *param)
 {
 	db_key_t db_keys[2];
@@ -1620,3 +1708,94 @@ int check_message_support(struct sip_msg* msg)
 	return -1;
 }
 
+#define FAKED_SIP_MSG "MESSAGE %.*s SIP/2.0\r\nVia: SIP/2.0/UDP 127.0.0.1\r\nFrom: <%.*s>;tag=123\r\nTo: <%.*s>\r\nCall-ID: 123\r\n%.*s\r\nCSeq: 1 MESSAGE\r\nContent-Length: 0\r\n\r\n"
+#define FAKED_SIP_MSG_LEN (sizeof(FAKED_SIP_MSG)-1)
+static unsigned int _faked_msg_no = 1;
+
+static msilo_notification_event_t *msilo_make_request(str *ruri, str *to, str *from, str *hdr, int mid)
+{
+  msilo_notification_event_t *ret = NULL;
+  struct sip_msg *msg = NULL;
+  char *buff = NULL;
+  int buff_len = 0;
+
+  if ((ret = shm_malloc(sizeof(msilo_notification_event_t))) == NULL)
+  {
+    LM_ERR("Out of pkg memory");
+    goto out;
+  }
+
+  memset(ret, 0, sizeof(msilo_notification_event_t));
+
+  if ((msg = shm_malloc(sizeof(struct sip_msg))) == NULL)
+  {
+    LM_ERR("Out of pkg memory");
+    shm_free(ret);
+    ret = NULL;
+    goto out;
+  }
+
+  LM_DBG(">>>>>>> msilo_sip_msg at %p\n", msg);
+
+  memset(msg, 0, sizeof(struct sip_msg));
+
+  buff_len = FAKED_SIP_MSG_LEN + ruri->len + to->len + from->len + hdr->len + 1;
+
+  if ((buff = shm_malloc(buff_len)) == NULL)
+  {
+    LM_ERR("Out of pkg memory");
+    shm_free(msg);
+    shm_free(ret);
+    ret = NULL;
+    goto out;
+  }
+
+  memset(buff, 0, buff_len);
+
+  msg->id = 1 + _faked_msg_no++;
+  msg->pid = my_pid();
+  memset(&msg->tval, 0, sizeof(struct timeval));
+  clear_branches();
+
+  msg->buf = buff;
+  msg->len = buff_len-1;
+
+  snprintf( msg->buf, buff_len-1, FAKED_SIP_MSG, ruri->len, ruri->s,
+                                               from->len, from->s,
+                                               to->len, to->s,
+                                               hdr->len, hdr->s );
+  msg->buf[buff_len-1] = '\0';
+
+  LM_DBG(">>>>>>> msilo_event_msg[%d]: %s <<<<<<<<", msg->len, msg->buf);
+
+  msg->set_global_address = default_global_address;
+  msg->set_global_port = default_global_port;
+
+  if (parse_msg(msg->buf, msg->len, msg) != 0)
+  {
+    LM_ERR("parse_msg failed\n");
+    shm_free(buff);
+    shm_free(msg);
+    shm_free(ret);
+    ret = NULL;
+    goto out;
+  }
+
+  msg->rcv.proto = PROTO_UDP;
+  msg->rcv.src_port = 5060;
+  msg->rcv.src_ip.u.addr32[0] = 0x7f000001;
+  msg->rcv.src_ip.af = AF_INET;
+  msg->rcv.src_ip.len = 4;
+  msg->rcv.dst_port = 5060;
+  msg->rcv.dst_ip.u.addr32[0] = 0x7f000001;
+  msg->rcv.dst_ip.af = AF_INET;
+  msg->rcv.dst_ip.len = 4;
+
+  ret->req = msg;
+  ret->mid = mid;
+
+out:
+  LM_DBG(">>>>>>> msilo_notification_event %p\n", ret);
+  return ret;
+}
+
