Skip to content

Commit

Permalink
uag: add uag_reject() with log info
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Sep 5, 2024
1 parent 17d4c6b commit 3c49eb3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/baresip.h
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ void ua_close(void);
void ua_stop_all(bool forced);
int uag_hold_resume(struct call *call);
int uag_hold_others(struct call *call);
int uag_reject(const struct sip_msg *msg, uint16_t scode, const char *reason);
void uag_set_nodial(bool nodial);
bool uag_nodial(void);
void uag_set_exit_handler(ua_exit_h *exith, void *arg);
Expand Down
3 changes: 1 addition & 2 deletions modules/menu/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,7 @@ 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");
uag_reject(msg, 480, "Temporarily Unavailable");
break;
}

Expand Down
10 changes: 10 additions & 0 deletions src/uag.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ int uag_hold_others(struct call *call)
}


int uag_reject(const struct sip_msg *msg, uint16_t scode, const char *reason)
{
if (!msg)
return EINVAL;

info("uag: incoming call rejected: %u %s\n", scode, reason);
return sip_treply(NULL, uag_sip(), msg, scode, reason);
}


/**
* Find call with given id
*
Expand Down

0 comments on commit 3c49eb3

Please sign in to comment.