capi.c: Prepare for handling outbound calls
This commit is contained in:
parent
98d65dbb2e
commit
a9535f21f2
16
capi.c
16
capi.c
|
@ -82,8 +82,9 @@ static void cb_disconnected(capi_connection *cp, int localdisconnect, unsigned r
|
|||
LOGP(DCAPI, LOGL_DEBUG, "%s(local=%d, reason=0x%04x, reason_b3=0x%04x)\n", __func__, localdisconnect, reason, reason_b3);
|
||||
|
||||
cst = capiconn_getpriv(cp);
|
||||
OSMO_ASSERT(cst);
|
||||
if (cst->bch->ops.fini)
|
||||
if (!cst)
|
||||
return;
|
||||
if (cst->bch && cst->bch->ops.fini)
|
||||
cst->bch->ops.fini(cst);
|
||||
talloc_free(cst);
|
||||
}
|
||||
|
@ -133,7 +134,16 @@ static void cb_incoming(capi_connection *cp, unsigned contr, unsigned cipvalue,
|
|||
|
||||
static void cb_connected(capi_connection *cp, _cstruct NCPI)
|
||||
{
|
||||
printf("connected: %s\n", conninfo(cp));
|
||||
struct call_state *cst = capiconn_getpriv(cp);
|
||||
struct bchan_handler *bch = cst->bch;
|
||||
|
||||
LOGP(DCAPI, LOGL_NOTICE, "connected: %s\n", conninfo(cp));
|
||||
|
||||
if (bch->ops.init) {
|
||||
int rc = bch->ops.init(cst);
|
||||
if (rc < 0)
|
||||
capiconn_disconnect(cp, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* user plane data received */
|
||||
|
|
Loading…
Reference in New Issue