Skip to content

Commit

Permalink
ctrl_tcp: use new bevent API
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Aug 12, 2024
1 parent 0a753af commit d9e3fde
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/ctrl_tcp/ctrl_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,14 @@ static void tcp_conn_handler(const struct sa *peer, void *arg)
/*
* Relay UA events
*/
static void ua_event_handler(struct ua *ua, enum ua_event ev,
struct call *call, const char *prm, void *arg)
static void event_handler(enum ua_event ev, struct bevent *event, void *arg)
{
struct ctrl_st *st = arg;
struct mbuf *buf = mbuf_alloc(1024);
struct re_printf pf = {print_handler, buf};
struct odict *od = NULL;
int err;
(void)ev;

buf->pos = NETSTRING_HEADER_SIZE;

Expand All @@ -268,7 +268,7 @@ static void ua_event_handler(struct ua *ua, enum ua_event ev,
return;

err = odict_entry_add(od, "event", ODICT_BOOL, true);
err |= event_encode_dict(od, ua, ev, call, prm);
err |= odict_encode_bevent(od, event);
if (err) {
warning("ctrl_tcp: failed to encode event (%m)\n", err);
goto out;
Expand Down Expand Up @@ -393,7 +393,7 @@ static int ctrl_init(void)
if (err)
return err;

err = uag_event_register(ua_event_handler, ctrl);
err = bevent_register(event_handler, ctrl);
if (err)
return err;

Expand All @@ -407,7 +407,7 @@ static int ctrl_init(void)

static int ctrl_close(void)
{
uag_event_unregister(ua_event_handler);
bevent_unregister(event_handler);
message_unlisten(baresip_message(), message_handler);
ctrl = mem_deref(ctrl);

Expand Down

0 comments on commit d9e3fde

Please sign in to comment.