osmux: Allow to enforce using Osmux for the client
Some systems only want to use Osmux. In case only Osmux
should be used fail if it has not be offered/acked.
Client:
Verified On, Off and Only with X-Osmux: 3 and without this field.
<000b> mgcp_protocol.c:823 Osmux only and no osmux offered on 0x14
<000b> mgcp_protocol.c:884 Resource error on 0x14
NAT:
Not tested and implemented
Fixes: OW#1492
diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c
index ab98be1..e2bda3a 100644
--- a/openbsc/src/libmgcp/mgcp_protocol.c
+++ b/openbsc/src/libmgcp/mgcp_protocol.c
@@ -818,6 +818,10 @@
if (osmux_cid >= 0) {
endp->osmux.cid = osmux_cid;
endp->osmux.state = OSMUX_STATE_ACTIVATING;
+ } else if(endp->cfg->osmux == OSMUX_USAGE_ONLY) {
+ LOGP(DMGCP, LOGL_ERROR,
+ "Osmux only and no osmux offered on 0x%x\n", ENDPOINT_NUMBER(endp));
+ goto error2;
}
endp->allocated = 1;