From 7a85fa67fea6676d8cbe4692840be48c01008005 Mon Sep 17 00:00:00 2001 From: Christian Spielberger Date: Thu, 31 Oct 2024 17:50:19 +0100 Subject: [PATCH] menu: emit bevent for dnd reject --- modules/menu/menu.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/menu/menu.c b/modules/menu/menu.c index 686e3c202..06a6f2d33 100644 --- a/modules/menu/menu.c +++ b/modules/menu/menu.c @@ -688,11 +688,16 @@ static void event_handler(enum ua_event ev, struct bevent *event, void *arg) case UA_EVENT_SIPSESS_CONN: if (menu.dnd) { - (void)sip_treply(NULL, uag_sip(), msg, 480, - "Temporarily Unavailable"); + const uint16_t scode = 480; + const char *reason = "Temporarily Unavailable"; + + (void)sip_treply(NULL, uag_sip(), msg, scode, reason); + info("menu: incoming call from %r <%r> rejected: " - "480 Temporarily Unavailable\n", - &msg->from.dname, &msg->from.auri); + "%u %s\n", + &msg->from.dname, &msg->from.auri, scode, reason); + bevent_sip_msg_emit(UA_EVENT_MODULE, msg, + "menu,rejected,%u %s", scode, reason); bevent_stop(event); break; }