log to which handler an incoming call is routed

This commit is contained in:
Harald Welte 2022-04-15 20:18:35 +02:00
parent 7de4f058f3
commit 88e00cbc78
1 changed files with 8 additions and 2 deletions

10
capi.c
View File

@ -93,9 +93,11 @@ static void cb_incoming(capi_connection *cp, unsigned contr, unsigned cipvalue,
struct bchan_handler *bch;
int rc;
printf("incoming call: %s (0x%x) %s -> %s\n", conninfo(cp), cipvalue, calling, called);
/* we should call capiconn_{accept,ignore,reject} */
LOGP(DCAPI, LOGL_INFO, "incoming call: %s (0x%x) %s -> %s\n",
conninfo(cp), cipvalue, calling, called);
bch = bchan_handler_for_call(cipvalue, called);
if (bch) {
struct call_state *cst = talloc_zero(g_ctx, struct call_state);
@ -121,8 +123,12 @@ static void cb_incoming(capi_connection *cp, unsigned contr, unsigned cipvalue,
capiconn_reject(cp);
}
capiconn_setpriv(cp, cst);
} else
LOGP(DCAPI, LOGL_NOTICE, "call CIP=%u MSN=%s routed to handler '%s'\n", cipvalue, called,
bch->name);
} else {
LOGP(DCAPI, LOGL_NOTICE, "call CIP=%u MSN=%s has no handler, ignoring\n", cipvalue, called);
capiconn_ignore(cp);
}
}
static void cb_connected(capi_connection *cp, _cstruct NCPI)