} else {
/* append to tail of list */
gsm->mncc_q_tail->next = qe;
+ gsm->mncc_q_tail = qe;
}
gsm->mncc_lfd.when |= LCR_FD_WRITE;
/* FIXME: the caller should provide this */
switch (msg_type) {
case GSM_TCHF_FRAME:
- len = 33;
+ len = sizeof(struct gsm_data_frame) + 33;
break;
default:
len = sizeof(struct gsm_mncc);
/* close MNCC socket */
static int mncc_fd_close(struct lcr_fd *lfd)
{
+ class Port *port;
+ class Pgsm_bs *pgsm_bs = NULL;
+ struct lcr_msg *message;
+
+ printf("mncc_sock: closing\n");
close(lfd->fd);
unregister_fd(lfd);
lfd->fd = -1;
while (mncc_q_dequeue())
;
- /* FIXME: free all the calls that were running through the MNCC interface */
+ /* free all the calls that were running through the MNCC interface */
+ port = port_first;
+ while(port) {
+ if ((port->p_type & PORT_CLASS_GSM_MASK) == PORT_CLASS_GSM_BS) {
+ pgsm_bs = (class Pgsm_bs *)port;
+ message = message_create(pgsm_bs->p_serial, ACTIVE_EPOINT(pgsm_bs->p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE);
+ message->param.disconnectinfo.cause = 27; // temp. unavail.
+ message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
+ message_put(message);
+ pgsm_bs->new_state(PORT_STATE_RELEASE);
+ trigger_work(&pgsm_bs->p_m_g_delete);
+ }
+ port = port->next;
+ }
/* FIXME: start a re-connect timer */