Skip to content

Commit

Permalink
menu: emit bevent for dnd reject
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Nov 4, 2024
1 parent cf3a2af commit 7a85fa6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions modules/menu/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7a85fa6

Please sign in to comment.