X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=gsm_bs.cpp;h=e25732aacc7c5ae00255af97e5f299676c35dd66;hp=259e8a9b06e31f2a481b7a81c90bcbca4b511ace;hb=16445870043275f7d5a0b7aa9a1abfa9e8a5c249;hpb=0345a55ca7308efdcebee25ec90ef0f11f78810e diff --git a/gsm_bs.cpp b/gsm_bs.cpp index 259e8a9..e25732a 100644 --- a/gsm_bs.cpp +++ b/gsm_bs.cpp @@ -93,6 +93,7 @@ void Pgsm_bs::start_dtmf_ind(unsigned int msg_type, unsigned int callref, struct add_trace("keypad", NULL, "%c", mncc->keypad); end_trace(); resp = create_mncc(MNCC_START_DTMF_RSP, p_m_g_callref); + resp->fields |= MNCC_F_KEYPAD; resp->keypad = mncc->keypad; send_and_free_mncc(p_m_g_instance, resp->msg_type, resp); @@ -563,6 +564,20 @@ void Pgsm_bs::message_setup(unsigned int epoint_id, int message_id, union parame memcpy(&p_capainfo, ¶m->setup.capainfo, sizeof(p_capainfo)); memcpy(&p_redirinfo, ¶m->setup.redirinfo, sizeof(p_redirinfo)); + /* no GSM MNCC connection */ + if (gsm->mncc_lfd.fd < 0) { + gsm_trace_header(p_m_mISDNport, this, MNCC_SETUP_REQ, DIRECTION_OUT); + add_trace("failure", NULL, "No MNCC connection."); + end_trace(); + message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE); + message->param.disconnectinfo.cause = 27; // temp. unavail. + message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL; + message_put(message); + new_state(PORT_STATE_RELEASE); + trigger_work(&p_m_g_delete); + return; + } + /* no number */ if (!p_dialinginfo.id[0]) { gsm_trace_header(p_m_mISDNport, this, MNCC_SETUP_REQ, DIRECTION_OUT); @@ -917,7 +932,7 @@ static int mncc_fd_write(struct lcr_fd *lfd, void *inst, int idx) return mncc_fd_close(lfd); if (rc < 0) return rc; - if (rc < qe->len) + if (rc < (int)qe->len) return -1; /* dequeue the successfully sent message */ qe2 = mncc_q_dequeue(); @@ -990,7 +1005,7 @@ static int socket_retry_cb(struct lcr_timer *timer, void *instance, int index) int gsm_bs_init(void) { gsm->sun.sun_family = AF_UNIX; - strcpy(gsm->sun.sun_path, "/tmp/bsc_mncc"); + SCPY(gsm->sun.sun_path, "/tmp/bsc_mncc"); memset(&gsm->socket_retry, 0, sizeof(gsm->socket_retry)); add_timer(&gsm->socket_retry, socket_retry_cb, NULL, 0);