osmux: Document func and return different rc upon osmux init failure

Change-Id: Id8593bc374b598e63a70c60ac256273b9d99ba6e
This commit is contained in:
Pau Espin 2019-05-08 15:35:36 +02:00
parent 182ca3bad4
commit 9fb8ddf00e
1 changed files with 6 additions and 1 deletions

View File

@ -671,12 +671,17 @@ uint32_t mgcp_rtp_packet_duration(struct mgcp_endpoint *endp,
rtp->codec->frame_duration_den;
}
/*! Initializes osmux socket if not yet initialized. Parses Osmux CID from MGCP line.
* \param[in] endp Endpoint willing to initialize osmux
* \param[in] line Line X-Osmux from MGCP header msg to parse
* \returns OSMUX CID, -1 for wildcard, -2 on parse error, -3 on osmux initalize error
*/
static int mgcp_osmux_setup(struct mgcp_endpoint *endp, const char *line)
{
if (!endp->cfg->osmux_init) {
if (osmux_init(OSMUX_ROLE_BSC, endp->cfg) < 0) {
LOGPENDP(endp, DLMGCP, LOGL_ERROR, "Cannot init OSMUX\n");
return -1;
return -3;
}
LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "OSMUX socket has been set up\n");
}