void ft_to_sngss7_grs (ftdm_channel_t *fchan)
{
    SS7_FUNC_TRACE_ENTER (__FUNCTION__);

    sngss7_chan_data_t *cinfo = fchan->call_data;

    SiStaEvnt grs;

    ftdm_assert(sngss7_test_ckt_flag(cinfo, FLAG_GRP_RESET_TX) &&
                !sngss7_test_ckt_flag(cinfo, FLAG_GRP_RESET_SENT), "Incorrect flags\n");

    memset (&grs, 0x0, sizeof(grs));
    grs.rangStat.eh.pres    = PRSNT_NODEF;
    grs.rangStat.range.pres = PRSNT_NODEF;
    grs.rangStat.range.val  = cinfo->tx_grs.range;

    sng_cc_sta_request (1,
                        0,
                        0,
                        cinfo->tx_grs.circuit,
                        0,
                        SIT_STA_GRSREQ,
                        &grs);

    SS7_INFO_CHAN(fchan, "[CIC:%d]Tx GRS (%d:%d)\n",
                  cinfo->circuit->cic,
                  cinfo->circuit->cic,
                  (cinfo->circuit->cic + cinfo->tx_grs.range));

    memset(&cinfo->tx_grs, 0, sizeof(cinfo->tx_grs));

    sngss7_set_ckt_flag(cinfo, FLAG_GRP_RESET_SENT);

    SS7_FUNC_TRACE_EXIT (__FUNCTION__);
}
Exemplo n.º 2
0
/* FUNCTIONS ******************************************************************/
void handle_isup_t35(void *userdata)
{
    SS7_FUNC_TRACE_ENTER(__FUNCTION__);

    sngss7_timer_data_t *timer = userdata;
    sngss7_chan_data_t  *sngss7_info = timer->sngss7_info;
    ftdm_channel_t      *ftdmchan = sngss7_info->ftdmchan;

    /* now that we have the right channel...put a lock on it so no-one else can use it */
    ftdm_mutex_lock(ftdmchan->mutex);

    SS7_ERROR("[Call-Control] Timer 35 expired on CIC = %d\n", sngss7_info->circuit->cic);

    /* set the flag to indicate this hangup is started from the local side */
    sngss7_set_ckt_flag(sngss7_info, FLAG_LOCAL_REL);

    /* hang up on timer expiry */
    ftdmchan->caller_data.hangup_cause = 28;

    /* end the call */
    ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_CANCEL);

    /*unlock*/
    ftdm_mutex_unlock(ftdmchan->mutex);

    SS7_FUNC_TRACE_EXIT(__FUNCTION__);
    return;
}
Exemplo n.º 3
0
ftdm_status_t reconfig_all_ckts_for_relay(void)
{
	int x;
	sngss7_chan_data_t	*sngss7_info = NULL;

	/* go through all the circuits on our ProcId */
	x = (g_ftdm_sngss7_data.cfg.procId * 1000) + 1;
	while (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) {
	/**************************************************************************/
		if ( g_ftdm_sngss7_data.cfg.isupCkt[x].type == SNG_CKT_VOICE) {
			/* grab the private data structure */
			sngss7_info = g_ftdm_sngss7_data.cfg.isupCkt[x].obj;
			
			/* mark the circuit for re-configuration */
			sngss7_set_ckt_flag(sngss7_info, FLAG_CKT_RECONFIG);

			/* clear the relay flag */
			sngss7_clear_ckt_flag(sngss7_info, FLAG_RELAY_DOWN);
		}

		/* move to the next circuit */
		x++;
	/**************************************************************************/
	} /* while (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) */

	return FTDM_SUCCESS;
}
Exemplo n.º 4
0
ftdm_status_t enable_all_ckts_for_relay(void)
{
	sngss7_chan_data_t	*sngss7_info = NULL;
	sng_isup_inf_t		*sngIntf = NULL;
	ftdm_channel_t		*ftdmchan = NULL;
	int					x;

	SS7_INFO("Enabling all ckts becuase of Relay connection\n");

	x = (g_ftdm_sngss7_data.cfg.procId * 1000) + 1;
	while (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) {
	/**********************************************************************/
		/* make sure this is voice channel */
		if (g_ftdm_sngss7_data.cfg.isupCkt[x].type == VOICE) {
	
			/* get the ftdmchan and ss7_chan_data from the circuit */
			if (extract_chan_data(g_ftdm_sngss7_data.cfg.isupCkt[x].id, &sngss7_info, &ftdmchan)) {
				SS7_ERROR("Failed to extract channel data for circuit = %d!\n", g_ftdm_sngss7_data.cfg.isupCkt[x].id);
				x++;
				continue;
			}

			/* bring the relay_down flag down */
			sngss7_clear_ckt_flag(sngss7_info, FLAG_RELAY_DOWN);

			sngIntf = &g_ftdm_sngss7_data.cfg.isupIntf[g_ftdm_sngss7_data.cfg.isupCkt[x].infId];

			/* check if the interface is paused or resumed */
			if (sngss7_test_flag(sngIntf, SNGSS7_PAUSED)) {
				/* don't bring the channel resume flag up...the interface is down */
				SS7_DEBUG_CHAN(ftdmchan, "ISUP interface (%d) set to paused, not resuming channel\n", sngIntf->id);
			} else {
				SS7_DEBUG_CHAN(ftdmchan, "ISUP interface (%d) set to resume, resuming channel\n", sngIntf->id);
				/* throw the channel infId status flags to PAUSED ... they will be executed next process cycle */
				sngss7_set_ckt_flag(sngss7_info, FLAG_INFID_RESUME);
				sngss7_set_ckt_flag(sngss7_info, FLAG_INFID_PAUSED);
			}
		} /* if (g_ftdm_sngss7_data.cfg.isupCkt[x].type == VOICE) */

		/* move along */
		x++;
	/**********************************************************************/
	} /* while (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) */

	return FTDM_SUCCESS;
}
Exemplo n.º 5
0
ftdm_status_t disable_all_ckts_for_relay(void)
{
	sngss7_chan_data_t	*sngss7_info = NULL;
	ftdm_channel_t		*ftdmchan = NULL;
	int					x;	

	SS7_INFO("Disabling all ckts becuase of Relay loss\n");

	x = (g_ftdm_sngss7_data.cfg.procId * 1000) + 1;
	while (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) {
	/**********************************************************************/
		/* make sure this is voice channel */
		if (g_ftdm_sngss7_data.cfg.isupCkt[x].type == SNG_CKT_VOICE) {
	
			/* get the ftdmchan and ss7_chan_data from the circuit */
			if (extract_chan_data(g_ftdm_sngss7_data.cfg.isupCkt[x].id, &sngss7_info, &ftdmchan)) {
				SS7_ERROR("Failed to extract channel data for circuit = %d!\n", g_ftdm_sngss7_data.cfg.isupCkt[x].id);
				x++;
				continue;
			}

			/* throw the relay_down flag */
			sngss7_set_ckt_flag(sngss7_info, FLAG_RELAY_DOWN);

			/* throw the channel infId status flags to PAUSED ... they will be executed next process cycle */
			sngss7_clear_ckt_flag(sngss7_info, FLAG_INFID_RESUME);
			sngss7_set_ckt_flag(sngss7_info, FLAG_INFID_PAUSED);
		} /* if (g_ftdm_sngss7_data.cfg.isupCkt[x].type == SNG_CKT_VOICE) */

		/* move along */
		x++;
	/**********************************************************************/
	} /* while (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) */

	return FTDM_SUCCESS;
}