- /* hunt channel */
- ret = channel = hunt_bchannel();
- if (ret < 0)
- goto no_channel;
-
- /* open channel */
- ret = seize_bchannel(channel, 1);
- if (ret < 0) {
- no_channel:
- mncc = create_mncc(MNCC_REJ_REQ, p_m_g_callref);
- gsm_trace_header(p_m_mISDNport, this, MNCC_REJ_REQ, DIRECTION_OUT);
- mncc->fields |= MNCC_F_CAUSE;
- mncc->cause.coding = 3;
- mncc->cause.location = 1;
- mncc->cause.value = 34;
- add_trace("cause", "coding", "%d", mncc->cause.coding);
- add_trace("cause", "location", "%d", mncc->cause.location);
- add_trace("cause", "value", "%d", mncc->cause.value);
- add_trace("reason", NULL, "no channel");
- end_trace();
- send_and_free_mncc(p_m_g_instance, mncc->msg_type, mncc);
- new_state(PORT_STATE_RELEASE);
- trigger_work(&p_m_g_delete);
- return;
- }
- bchannel_event(p_m_mISDNport, p_m_b_index, B_EVENT_USE);
- if (bchannel_open(p_m_b_index))
- goto no_channel;
-