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__);
}
void ft_to_sngss7_grs (ftdm_channel_t * ftdmchan)
{
	SS7_FUNC_TRACE_ENTER (__FUNCTION__);
	
	sngss7_span_data_t 	*sngss7_span = ftdmchan->span->mod_data;
	sngss7_chan_data_t *sngss7_info = ftdmchan->call_data;
	
	SiStaEvnt grs;
	
	memset (&grs, 0x0, sizeof(grs));
	
	grs.rangStat.eh.pres	= PRSNT_NODEF;
	grs.rangStat.range.pres	= PRSNT_NODEF;
	grs.rangStat.range.val	= sngss7_span->tx_grs.range;
	
	sng_cc_sta_request (1,
						0,
						0,
						sngss7_span->tx_grs.circuit,
						0,
						SIT_STA_GRSREQ,
						&grs);
	
	SS7_INFO_CHAN(ftdmchan,"[CIC:%d]Tx GRS (%d:%d)\n",
							sngss7_info->circuit->cic,
							sngss7_info->circuit->cic,
							(sngss7_info->circuit->cic + sngss7_span->tx_grs.range));
	
	SS7_FUNC_TRACE_EXIT (__FUNCTION__);
return;
}
Ejemplo n.º 3
0
ftdm_status_t block_all_ckts_for_relay(uint32_t procId)
{
	int x;

	SS7_INFO("BLOcking all ckts on ProcID = %d\n", procId);

	/* we just lost connection to this procId, send out a block for all these circuits */
	x = (procId * 1000) + 1;
	while (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) {
	/**************************************************************************/
		if (g_ftdm_sngss7_data.cfg.isupCkt[x].type == VOICE) {
			/* send out a BLO */
			sng_cc_sta_request (1,
								0,
								0,
								g_ftdm_sngss7_data.cfg.isupCkt[x].id,
								0, 
								SIT_STA_CIRBLOREQ, 
								NULL);

		} /* 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;
}
void ft_to_sngss7_cgu(ftdm_channel_t * ftdmchan)
{
    SS7_FUNC_TRACE_ENTER (__FUNCTION__);

    sngss7_span_data_t 	*sngss7_span = ftdmchan->span->signal_data;
    sngss7_chan_data_t	*sngss7_info = ftdmchan->call_data;
    SiStaEvnt 			cgu;
    int					x = 0;


    memset (&cgu, 0x0, sizeof(cgu));

    /* fill in the circuit group supervisory message */
    cgu.cgsmti.eh.pres			= PRSNT_NODEF;
    cgu.cgsmti.typeInd.pres		= PRSNT_NODEF;
    cgu.cgsmti.typeInd.val		= sngss7_span->tx_cgu.type;

    /* fill in the range */
    cgu.rangStat.eh.pres 		= PRSNT_NODEF;
    cgu.rangStat.range.pres		= PRSNT_NODEF;
    cgu.rangStat.range.val 		= sngss7_span->tx_cgu.range;

    /* fill in the status */
    cgu.rangStat.status.pres	= PRSNT_NODEF;
    cgu.rangStat.status.len 	= ((sngss7_span->tx_cgu.range + 1) >> 3) + (((sngss7_span->tx_cgu.range + 1) & 0x07) ? 1 : 0);
    for(x = 0; x < cgu.rangStat.status.len; x++) {
        cgu.rangStat.status.val[x] = sngss7_span->tx_cgu.status[x];
    }

    sng_cc_sta_request (1,
                        0,
                        0,
                        sngss7_span->tx_cgu.circuit,
                        0,
                        SIT_STA_CGUREQ,
                        &cgu);

    SS7_INFO_CHAN(ftdmchan,"[CIC:%d]Tx CGU (%d:%d)\n",
                  sngss7_info->circuit->cic,
                  sngss7_info->circuit->cic,
                  (sngss7_info->circuit->cic + sngss7_span->tx_cgu.range));

    /* clean out the saved data */
    memset(&sngss7_span->tx_cgu, 0x0, sizeof(sngss7_group_data_t));


    SS7_FUNC_TRACE_EXIT (__FUNCTION__);
    return;
}
void ft_to_sngss7_lpa (ftdm_channel_t * ftdmchan)
{
	SS7_FUNC_TRACE_ENTER (__FUNCTION__);
	
	sngss7_chan_data_t *sngss7_info = ftdmchan->call_data;
	
	sng_cc_sta_request (1,
						sngss7_info->suInstId,
						sngss7_info->spInstId,
						sngss7_info->circuit->id,
						sngss7_info->globalFlg, 
						SIT_STA_LOOPBACKACK, 
						NULL);
	
	SS7_INFO_CHAN(ftdmchan,"[CIC:%d]Tx LPA\n", sngss7_info->circuit->cic);
	
	SS7_FUNC_TRACE_EXIT (__FUNCTION__);
return;
}
void ft_to_sngss7_uba (ftdm_channel_t * ftdmchan)
{
	SS7_FUNC_TRACE_ENTER (__FUNCTION__);
	
	sngss7_chan_data_t *sngss7_info = ftdmchan->call_data;
	
	sng_cc_sta_request (1,
						0,
						0,
						sngss7_info->circuit->id,
						sngss7_info->globalFlg, 
						SIT_STA_CIRUBLRSP, 
						NULL);
	
	SS7_INFO_CHAN(ftdmchan,"[CIC:%d]Tx UBA\n", sngss7_info->circuit->cic);
	
	SS7_FUNC_TRACE_EXIT (__FUNCTION__);
	return;
}
void ft_to_sngss7_gra (ftdm_channel_t * ftdmchan)
{
	SS7_FUNC_TRACE_ENTER (__FUNCTION__);
	
	sngss7_span_data_t *sngss7_span = ftdmchan->span->signal_data;
	sngss7_chan_data_t *sngss7_info = ftdmchan->call_data;
	SiStaEvnt	gra;
	
	/* clean out the gra struct */
	memset (&gra, 0x0, sizeof (gra));

	gra.rangStat.eh.pres = PRSNT_NODEF;

	/* fill in the range */	
	gra.rangStat.range.pres = PRSNT_NODEF;
	gra.rangStat.range.val = sngss7_span->rx_grs.range;

	/* fill in the status */
	gra.rangStat.status.pres = PRSNT_NODEF;
	gra.rangStat.status.len = ((sngss7_span->rx_grs.range + 1) >> 3) + (((sngss7_span->rx_grs.range + 1) & 0x07) ? 1 : 0); 
	
	/* the status field should be 1 if blocked for maintenace reasons 
	* and 0 is not blocked....since we memset the struct nothing to do
	*/
	
	/* send the GRA to LibSng-SS7 */
	sng_cc_sta_request (1,
						0,
						0,
						sngss7_span->rx_grs.circuit,
						0,
						SIT_STA_GRSRSP,
						&gra);
	
	SS7_INFO_CHAN(ftdmchan,"[CIC:%d]Tx GRA (%d:%d)\n",
							sngss7_info->circuit->cic,
							sngss7_info->circuit->cic,
							(sngss7_info->circuit->cic + sngss7_span->rx_grs.range));
	

	SS7_FUNC_TRACE_EXIT (__FUNCTION__);
	return;
}