root/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_in.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. sngss7_con_ind
  2. sngss7_con_cfm
  3. sngss7_con_sta
  4. sngss7_rel_ind
  5. sngss7_rel_cfm
  6. sngss7_dat_ind
  7. sngss7_fac_ind
  8. sngss7_fac_cfm
  9. sngss7_umsg_ind
  10. sngss7_sta_ind
  11. sngss7_susp_ind
  12. sngss7_resm_ind
  13. sngss7_ssp_sta_cfm

   1 /*
   2  * Copyright (c) 2009, Konrad Hammel <konrad@sangoma.com>
   3  * All rights reserved.
   4  *
   5  * Redistribution and use in source and binary forms, with or without
   6  * modification, are permitted provided that the following conditions
   7  * are met:
   8  *
   9  * * Redistributions of source code must retain the above copyright
  10  * notice, this list of conditions and the following disclaimer.
  11  *
  12  * * Redistributions in binary form must reproduce the above copyright
  13  * notice, this list of conditions and the following disclaimer in the
  14  * documentation and/or other materials provided with the distribution.
  15  *
  16  * * Neither the name of the original author; nor the names of any contributors
  17  * may be used to endorse or promote products derived from this software
  18  * without specific prior written permission.
  19  *
  20  *
  21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24  * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
  25  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32  */
  33 
  34 /* INCLUDE ********************************************************************/
  35 #include "ftmod_sangoma_ss7_main.h"
  36 /******************************************************************************/
  37 
  38 /* DEFINES ********************************************************************/
  39 /******************************************************************************/
  40 
  41 /* GLOBALS ********************************************************************/
  42 /******************************************************************************/
  43 
  44 /* PROTOTYPES *****************************************************************/
  45 void sngss7_sta_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, uint8_t globalFlg, uint8_t evntType, SiStaEvnt *siStaEvnt);
  46 void sngss7_con_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiConEvnt *siConEvnt);
  47 void sngss7_con_cfm(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiConEvnt *siConEvnt);
  48 void sngss7_con_sta(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiCnStEvnt *siCnStEvnt, uint8_t evntType);
  49 void sngss7_rel_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiRelEvnt *siRelEvnt);
  50 void sngss7_rel_cfm(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiRelEvnt *siRelEvnt);
  51 void sngss7_dat_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiInfoEvnt *siInfoEvnt);
  52 void sngss7_fac_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, uint8_t evntType, SiFacEvnt *siFacEvnt);
  53 void sngss7_fac_cfm(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, uint8_t evntType, SiFacEvnt *siFacEvnt);
  54 void sngss7_umsg_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit);
  55 void sngss7_resm_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiResmEvnt *siResmEvnt);
  56 void sngss7_susp_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiSuspEvnt *siSuspEvnt);
  57 void sngss7_ssp_sta_cfm(uint32_t infId);
  58 /******************************************************************************/
  59 
  60 /* FUNCTIONS ******************************************************************/
  61 void sngss7_con_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiConEvnt *siConEvnt)
  62 {
  63         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
  64 
  65         sngss7_chan_data_t      *sngss7_info = NULL;
  66         ftdm_channel_t          *ftdmchan = NULL;
  67         sngss7_event_data_t     *sngss7_event = NULL;
  68 
  69         /* get the ftdmchan and ss7_chan_data from the circuit */
  70         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
  71                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
  72                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
  73                 return;
  74         }
  75 
  76         /* initalize the sngss7_event */
  77         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
  78         if (sngss7_event == NULL) {
  79                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
  80                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
  81                 return;
  82         }
  83         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
  84 
  85         /* fill in the sngss7_event struct */
  86         sngss7_event->spInstId  = spInstId;
  87         sngss7_event->suInstId  = suInstId;
  88         sngss7_event->circuit   = circuit;
  89         sngss7_event->event_id  = SNGSS7_CON_IND_EVENT;
  90         memcpy(&sngss7_event->event.siConEvnt, siConEvnt, sizeof(*siConEvnt));
  91 
  92         /* enqueue this event */
  93         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
  94 
  95         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
  96 }
  97 
  98 /******************************************************************************/
  99 void sngss7_con_cfm(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiConEvnt *siConEvnt)
 100 {
 101         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 102 
 103         sngss7_chan_data_t      *sngss7_info = NULL;
 104         ftdm_channel_t          *ftdmchan = NULL;
 105         sngss7_event_data_t     *sngss7_event = NULL;
 106 
 107         /* get the ftdmchan and ss7_chan_data from the circuit */
 108         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 109                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 110                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 111                 return;
 112         }
 113 
 114         /* initalize the sngss7_event */
 115         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 116         if (sngss7_event == NULL) {
 117                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 118                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 119                 return;
 120         }
 121         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 122 
 123         /* fill in the sngss7_event struct */
 124         sngss7_event->spInstId  = spInstId;
 125         sngss7_event->suInstId  = suInstId;
 126         sngss7_event->circuit   = circuit;
 127         sngss7_event->event_id  = SNGSS7_CON_CFM_EVENT;
 128         memcpy(&sngss7_event->event.siConEvnt, siConEvnt, sizeof(*siConEvnt));
 129 
 130         /* enqueue this event */
 131         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 132 
 133         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 134 }
 135 
 136 /******************************************************************************/
 137 void sngss7_con_sta(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiCnStEvnt *siCnStEvnt, uint8_t evntType)
 138 {
 139         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 140 
 141         sngss7_chan_data_t      *sngss7_info = NULL;
 142         ftdm_channel_t          *ftdmchan = NULL;
 143         sngss7_event_data_t     *sngss7_event = NULL;
 144 
 145         /* get the ftdmchan and ss7_chan_data from the circuit */
 146         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 147                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 148                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 149                 return;
 150         }
 151 
 152         /* initalize the sngss7_event */
 153         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 154         if (sngss7_event == NULL) {
 155                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 156                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 157                 return;
 158         }
 159         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 160 
 161         /* fill in the sngss7_event struct */
 162         sngss7_event->spInstId  = spInstId;
 163         sngss7_event->suInstId  = suInstId;
 164         sngss7_event->circuit   = circuit;
 165         sngss7_event->evntType  = evntType;
 166         sngss7_event->event_id  = SNGSS7_CON_STA_EVENT;
 167         memcpy(&sngss7_event->event.siCnStEvnt, siCnStEvnt, sizeof(*siCnStEvnt));
 168 
 169         /* enqueue this event */
 170         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 171 
 172         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 173 }
 174 
 175 /******************************************************************************/
 176 void sngss7_rel_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiRelEvnt *siRelEvnt)
 177 {
 178         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 179 
 180         sngss7_chan_data_t      *sngss7_info = NULL;
 181         ftdm_channel_t          *ftdmchan = NULL;
 182         sngss7_event_data_t     *sngss7_event = NULL;
 183 
 184         /* get the ftdmchan and ss7_chan_data from the circuit */
 185         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 186                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 187                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 188                 return;
 189         }
 190 
 191         /* initalize the sngss7_event */
 192         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 193         if (sngss7_event == NULL) {
 194                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 195                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 196                 return;
 197         }
 198         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 199 
 200         /* fill in the sngss7_event struct */
 201         sngss7_event->spInstId  = spInstId;
 202         sngss7_event->suInstId  = suInstId;
 203         sngss7_event->circuit   = circuit;
 204         sngss7_event->event_id  = SNGSS7_REL_IND_EVENT;
 205         memcpy(&sngss7_event->event.siRelEvnt, siRelEvnt, sizeof(*siRelEvnt));
 206 
 207         /* enqueue this event */
 208         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 209 
 210         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 211 }
 212 
 213 /******************************************************************************/
 214 void sngss7_rel_cfm(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiRelEvnt *siRelEvnt)
 215 {
 216         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 217 
 218         sngss7_chan_data_t      *sngss7_info = NULL;
 219         ftdm_channel_t          *ftdmchan = NULL;
 220         sngss7_event_data_t     *sngss7_event = NULL;
 221 
 222         /* get the ftdmchan and ss7_chan_data from the circuit */
 223         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 224                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 225                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 226                 return;
 227         }
 228 
 229         /* initalize the sngss7_event */
 230         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 231         if (sngss7_event == NULL) {
 232                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 233                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 234                 return;
 235         }
 236         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 237 
 238         /* fill in the sngss7_event struct */
 239         sngss7_event->spInstId  = spInstId;
 240         sngss7_event->suInstId  = suInstId;
 241         sngss7_event->circuit   = circuit;
 242         sngss7_event->event_id  = SNGSS7_REL_CFM_EVENT;
 243         memcpy(&sngss7_event->event.siRelEvnt, siRelEvnt, sizeof(*siRelEvnt));
 244 
 245         /* enqueue this event */
 246         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 247 
 248         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 249 }
 250 
 251 /******************************************************************************/
 252 void sngss7_dat_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiInfoEvnt *siInfoEvnt)
 253 {
 254         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 255 
 256         sngss7_chan_data_t      *sngss7_info = NULL;
 257         ftdm_channel_t          *ftdmchan = NULL;
 258         sngss7_event_data_t     *sngss7_event = NULL;
 259 
 260         /* get the ftdmchan and ss7_chan_data from the circuit */
 261         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 262                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 263                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 264                 return;
 265         }
 266 
 267         /* initalize the sngss7_event */
 268         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 269         if (sngss7_event == NULL) {
 270                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 271                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 272                 return;
 273         }
 274         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 275 
 276         /* fill in the sngss7_event struct */
 277         sngss7_event->spInstId  = spInstId;
 278         sngss7_event->suInstId  = suInstId;
 279         sngss7_event->circuit   = circuit;
 280         sngss7_event->event_id  = SNGSS7_DAT_IND_EVENT;
 281         memcpy(&sngss7_event->event.siInfoEvnt, siInfoEvnt, sizeof(*siInfoEvnt));
 282 
 283         /* enqueue this event */
 284         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 285 
 286         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 287 }
 288 
 289 /******************************************************************************/
 290 void sngss7_fac_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, uint8_t evntType, SiFacEvnt *siFacEvnt)
 291 {
 292         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 293 
 294         sngss7_chan_data_t      *sngss7_info = NULL;
 295         ftdm_channel_t          *ftdmchan = NULL;
 296         sngss7_event_data_t     *sngss7_event = NULL;
 297 
 298         /* get the ftdmchan and ss7_chan_data from the circuit */
 299         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 300                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 301                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 302                 return;
 303         }
 304 
 305         /* initalize the sngss7_event */
 306         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 307         if (sngss7_event == NULL) {
 308                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 309                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 310                 return;
 311         }
 312         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 313 
 314         /* fill in the sngss7_event struct */
 315         sngss7_event->spInstId  = spInstId;
 316         sngss7_event->suInstId  = suInstId;
 317         sngss7_event->circuit   = circuit;
 318         sngss7_event->evntType  = evntType;
 319         sngss7_event->event_id  = SNGSS7_FAC_IND_EVENT;
 320         memcpy(&sngss7_event->event.siFacEvnt, siFacEvnt, sizeof(*siFacEvnt));
 321 
 322         /* enqueue this event */
 323         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 324 
 325         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 326 }
 327 
 328 /******************************************************************************/
 329 void sngss7_fac_cfm(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, uint8_t evntType, SiFacEvnt *siFacEvnt)
 330 {
 331         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 332 
 333         sngss7_chan_data_t      *sngss7_info = NULL;
 334         ftdm_channel_t          *ftdmchan = NULL;
 335         sngss7_event_data_t     *sngss7_event = NULL;
 336 
 337         /* get the ftdmchan and ss7_chan_data from the circuit */
 338         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 339                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 340                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 341                 return;
 342         }
 343 
 344         /* initalize the sngss7_event */
 345         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 346         if (sngss7_event == NULL) {
 347                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 348                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 349                 return;
 350         }
 351         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 352 
 353         /* fill in the sngss7_event struct */
 354         sngss7_event->spInstId  = spInstId;
 355         sngss7_event->suInstId  = suInstId;
 356         sngss7_event->circuit   = circuit;
 357         sngss7_event->evntType  = evntType;
 358         sngss7_event->event_id  = SNGSS7_FAC_CFM_EVENT;
 359         memcpy(&sngss7_event->event.siFacEvnt, siFacEvnt, sizeof(*siFacEvnt));
 360 
 361         /* enqueue this event */
 362         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 363 
 364         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 365 }
 366 
 367 /******************************************************************************/
 368 void sngss7_umsg_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit)
 369 {
 370         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 371 
 372         sngss7_chan_data_t      *sngss7_info = NULL;
 373         ftdm_channel_t          *ftdmchan = NULL;
 374         sngss7_event_data_t     *sngss7_event = NULL;
 375 
 376         /* get the ftdmchan and ss7_chan_data from the circuit */
 377         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 378                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 379                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 380                 return;
 381         }
 382 
 383         /* initalize the sngss7_event */
 384         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 385         if (sngss7_event == NULL) {
 386                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 387                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 388                 return;
 389         }
 390         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 391 
 392         /* fill in the sngss7_event struct */
 393         sngss7_event->spInstId  = spInstId;
 394         sngss7_event->suInstId  = suInstId;
 395         sngss7_event->circuit   = circuit;
 396         sngss7_event->event_id  = SNGSS7_UMSG_IND_EVENT;
 397 
 398         /* enqueue this event */
 399         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 400 
 401         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 402 
 403 }
 404 /* GENERAL STATUS *************************************************************/
 405 void sngss7_sta_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, uint8_t globalFlg, uint8_t evntType, SiStaEvnt *siStaEvnt)
 406 {
 407         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 408 
 409         sngss7_chan_data_t      *sngss7_info = NULL;
 410         ftdm_channel_t          *ftdmchan = NULL;
 411         sngss7_event_data_t     *sngss7_event = NULL;
 412 
 413         /* get the ftdmchan and ss7_chan_data from the circuit */
 414         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 415                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 416                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 417                 return;
 418         }
 419 
 420         /* initalize the sngss7_event */
 421         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 422         if (sngss7_event == NULL) {
 423                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 424                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 425                 return;
 426         }
 427         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 428 
 429         /* fill in the sngss7_event struct */
 430         sngss7_event->spInstId  = spInstId;
 431         sngss7_event->suInstId  = suInstId;
 432         sngss7_event->circuit   = circuit;
 433         sngss7_event->globalFlg = globalFlg;
 434         sngss7_event->evntType  = evntType;
 435         sngss7_event->event_id  = SNGSS7_STA_IND_EVENT;
 436         if (siStaEvnt != NULL) {
 437                 memcpy(&sngss7_event->event.siStaEvnt, siStaEvnt, sizeof(*siStaEvnt));
 438         }
 439 
 440         /* enqueue this event */
 441         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 442 
 443         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 444 }
 445 
 446 /******************************************************************************/
 447 void sngss7_susp_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiSuspEvnt *siSuspEvnt)
 448 {
 449         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 450 
 451         sngss7_chan_data_t      *sngss7_info = NULL;
 452         ftdm_channel_t          *ftdmchan = NULL;
 453         sngss7_event_data_t     *sngss7_event = NULL;
 454 
 455         /* get the ftdmchan and ss7_chan_data from the circuit */
 456         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 457                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 458                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 459                 return;
 460         }
 461 
 462         /* initalize the sngss7_event */
 463         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 464         if (sngss7_event == NULL) {
 465                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 466                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 467                 return;
 468         }
 469         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 470 
 471         /* fill in the sngss7_event struct */
 472         sngss7_event->spInstId  = spInstId;
 473         sngss7_event->suInstId  = suInstId;
 474         sngss7_event->circuit   = circuit;
 475         sngss7_event->event_id  = SNGSS7_SUSP_IND_EVENT;
 476         if (siSuspEvnt != NULL) {
 477                 memcpy(&sngss7_event->event.siSuspEvnt, siSuspEvnt, sizeof(*siSuspEvnt));
 478         }
 479 
 480         /* enqueue this event */
 481         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 482 
 483         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 484 
 485 }
 486 
 487 /******************************************************************************/
 488 void sngss7_resm_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circuit, SiResmEvnt *siResmEvnt)
 489 {
 490         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 491 
 492         sngss7_chan_data_t      *sngss7_info = NULL;
 493         ftdm_channel_t          *ftdmchan = NULL;
 494         sngss7_event_data_t     *sngss7_event = NULL;
 495 
 496         /* get the ftdmchan and ss7_chan_data from the circuit */
 497         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 498                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 499                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 500                 return;
 501         }
 502 
 503         /* initalize the sngss7_event */
 504         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 505         if (sngss7_event == NULL) {
 506                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 507                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 508                 return;
 509         }
 510         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 511 
 512         /* fill in the sngss7_event struct */
 513         sngss7_event->spInstId  = spInstId;
 514         sngss7_event->suInstId  = suInstId;
 515         sngss7_event->circuit   = circuit;
 516         sngss7_event->event_id  = SNGSS7_RESM_IND_EVENT;
 517         if (siResmEvnt != NULL) {
 518                 memcpy(&sngss7_event->event.siResmEvnt, siResmEvnt, sizeof(*siResmEvnt));
 519         }
 520 
 521         /* enqueue this event */
 522         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 523 
 524         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 525 
 526 }
 527 
 528 /******************************************************************************/
 529 void sngss7_ssp_sta_cfm(uint32_t infId)
 530 {
 531         SS7_FUNC_TRACE_ENTER(__FUNCTION__);
 532 #if 0
 533         sngss7_chan_data_t      *sngss7_info = NULL;
 534         ftdm_channel_t          *ftdmchan = NULL;
 535         sngss7_event_data_t     *sngss7_event = NULL;
 536 
 537         /* get the ftdmchan and ss7_chan_data from the circuit */
 538         if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
 539                 SS7_ERROR("Failed to extract channel data for circuit = %d!\n", circuit);
 540                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 541                 return;
 542         }
 543 
 544         /* initalize the sngss7_event */
 545         sngss7_event = ftdm_malloc(sizeof(*sngss7_event));
 546         if (sngss7_event == NULL) {
 547                 SS7_ERROR("Failed to allocate memory for sngss7_event!\n");
 548                 SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 549                 return;
 550         }
 551         memset(sngss7_event, 0x0, sizeof(*sngss7_event));
 552 
 553         /* fill in the sngss7_event struct */
 554         sngss7_event->spInstId  = spInstId;
 555         sngss7_event->suInstId  = suInstId;
 556         sngss7_event->circuit   = circuit;
 557         sngss7_event->event_id  = SNGSS7_RESM_IND_EVENT;
 558         if (siSuspEvnt != NULL) {
 559                 memcpy(&sngss7_event->event.siResmEvnt, siResmEvnt, sizeof(*siResmEvnt));
 560         }
 561 
 562         /* enqueue this event */
 563         ftdm_queue_enqueue(((sngss7_span_data_t*)sngss7_info->ftdmchan->span->signal_data)->event_queue, sngss7_event);
 564 #endif
 565         SS7_FUNC_TRACE_EXIT(__FUNCTION__);
 566 
 567 }
 568 /******************************************************************************/
 569 /* For Emacs:
 570  * Local Variables:
 571  * mode:c
 572  * indent-tabs-mode:t
 573  * tab-width:4
 574  * c-basic-offset:4
 575  * End:
 576  * For VIM:
 577  * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
 578  */
 579 /******************************************************************************/
 580 

/* [<][>][^][v][top][bottom][index][help] */