Fixed issue in handling channel offer

When (exclusive or suggested) channel is offered, we must "seize" it, so that
it is linked with call instance. Still the channel might be changed on reply.
laforge/submodule
Andreas Eversberg 7 months ago
parent ef4950bd66
commit e1dcbb89db
  1. 7
      src/isdn/dss1.c
  2. 6
      src/isdn/isdn.c

@ -1516,14 +1516,15 @@ void setup_req(call_t *call, osmo_cc_msg_t *msg)
PDEBUG(DDSS1, DEBUG_INFO, "Codec %s selected for transmission.\n", call->codec->payload_name);
/* get channel */
rc = hunt_bchannel_out(call->isdn_ep, &call->b_channel, &call->b_exclusive);
rc = hunt_bchannel_out(call->isdn_ep, &channel, &exclusive);
if (rc < 0) {
PDEBUG(DDSS1, DEBUG_NOTICE, "There is no channel available on the interface.\n");
release_and_destroy(call, -rc, 0, 0);
return;
}
channel = call->b_channel;
exclusive = call->b_exclusive;
/* must seize it, if we gave a channel, so that requested channel is stored in call instance */
if (channel)
seize_bchannel(call, channel, exclusive);
/* creating pid */
call->l3_pid = request_new_pid(call->isdn_ep->ml3);

@ -511,8 +511,8 @@ int open_bchannel_out(call_t *call, unsigned int cmd, int channel, int exclusive
if (channel==-1 || call->b_channel==channel) {
call->b_exclusive = 1; // we are done
/* if channel was accepted, try to get it */
rc = seize_bchannel(call, channel, 1); // exclusively
/* if channel was accepted, seize_bchannel shall simply return, because given channel is already set */
rc = seize_bchannel(call, call->b_channel, 1); // exclusively
if (rc < 0) {
PDEBUG(DISDN, DEBUG_DEBUG, " -> result = replied channel not available\n");
return -47;
@ -531,7 +531,7 @@ int open_bchannel_out(call_t *call, unsigned int cmd, int channel, int exclusive
return -111; // protocol error
}
/* if channel was not accepted, try to get it */
/* if channel was not accepted, try to get a different one */
rc = seize_bchannel(call, channel, 1); // exclusively
if (rc < 0) {
PDEBUG(DISDN, DEBUG_DEBUG, " -> result = replied channel not available\n");

Loading…
Cancel
Save