osmux_send_dummy: Avoid logging incorrectly and sending if osmux not enabled

Port from openbsc 37a0307b6193c9b108cfd1aa2a88517a8b5cb907.
Change-Id: Iabc84cb482a425d4a6c2bb08c20b2e02a5a86b36
This commit is contained in:
Pau Espin 2018-10-16 15:45:56 +02:00
parent 9ecceb651b
commit 11b4810142
1 changed files with 8 additions and 0 deletions

View File

@ -641,12 +641,20 @@ int osmux_send_dummy(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn)
LOGP(DLMGCP, LOGL_ERROR,
"Could not activate osmux for conn:%s\n",
mgcp_conn_dump(conn->conn));
return 0;
}
LOGP(DLMGCP, LOGL_ERROR,
"Osmux CID %u for %s:%u is now enabled\n",
conn->osmux.cid, inet_ntoa(conn->end.addr),
endp->cfg->osmux_port);
}
if(conn->osmux.state != OSMUX_STATE_ENABLED) {
LOGP(DLMGCP, LOGL_ERROR,
"OSMUX dummy to %s CID %u: Osmux not enabled on endpoint 0x%x state %d\n",
inet_ntoa(conn->end.addr), conn->osmux.cid,
ENDPOINT_NUMBER(endp), conn->osmux.state);
return 0;
}
LOGP(DLMGCP, LOGL_DEBUG,
"sending OSMUX dummy load to %s CID %u\n",
inet_ntoa(conn->end.addr), conn->osmux.cid);