This source file includes following definitions.
- ft_to_sngss7_activate_all
- ftmod_ss7_enable_isap
- ftmod_ss7_enable_nsap
- ftmod_ss7_enable_mtpLinkSet
- ftmod_ss7_inhibit_mtplink
- ftmod_ss7_uninhibit_mtplink
- ftmod_ss7_activate_mtplink
- ftmod_ss7_deactivate_mtplink
- ftmod_ss7_deactivate2_mtplink
- ftmod_ss7_activate_mtplinkSet
- ftmod_ss7_deactivate_mtplinkSet
- ftmod_ss7_deactivate2_mtplinkSet
- ftmod_ss7_lpo_mtplink
- ftmod_ss7_lpr_mtplink
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 #include "ftmod_sangoma_ss7_main.h"
36
37
38
39
40
41
42
43
44
45 int ft_to_sngss7_activate_all(void);
46
47 static int ftmod_ss7_enable_isap(int suId);
48 static int ftmod_ss7_enable_nsap(int suId);
49 static int ftmod_ss7_enable_mtpLinkSet(int lnkSetId);
50
51 int ftmod_ss7_inhibit_mtplink(uint32_t id);
52 int ftmod_ss7_uninhibit_mtplink(uint32_t id);
53
54 int ftmod_ss7_activate_mtplink(uint32_t id);
55 int ftmod_ss7_deactivate_mtplink(uint32_t id);
56 int ftmod_ss7_deactivate2_mtplink(uint32_t id);
57
58 int ftmod_ss7_activate_mtplinkSet(uint32_t id);
59 int ftmod_ss7_deactivate_mtplinkSet(uint32_t id);
60 int ftmod_ss7_deactivate2_mtplinkSet(uint32_t id);
61
62 int ftmod_ss7_lpo_mtplink(uint32_t id);
63 int ftmod_ss7_lpr_mtplink(uint32_t id);
64
65
66
67 int ft_to_sngss7_activate_all(void)
68 {
69 int x;
70
71 x = 1;
72 while (g_ftdm_sngss7_data.cfg.isap[x].id != 0) {
73
74 if (!(g_ftdm_sngss7_data.cfg.isap[x].flags & ACTIVE)) {
75
76 if (ftmod_ss7_enable_isap(x)) {
77 SS7_CRITICAL("ISAP %d Enable: NOT OK\n", x);
78 return 1;
79 } else {
80 SS7_INFO("ISAP %d Enable: OK\n", x);
81 }
82
83
84 g_ftdm_sngss7_data.cfg.isap[x].flags |= ACTIVE;
85 }
86
87 x++;
88 }
89
90 x = 1;
91 while (g_ftdm_sngss7_data.cfg.nsap[x].id != 0) {
92
93 if (!(g_ftdm_sngss7_data.cfg.nsap[x].flags & ACTIVE)) {
94
95 if (ftmod_ss7_enable_nsap(x)) {
96 SS7_CRITICAL("NSAP %d Enable: NOT OK\n", x);
97 return 1;
98 } else {
99 SS7_INFO("NSAP %d Enable: OK\n", x);
100 }
101
102
103 g_ftdm_sngss7_data.cfg.nsap[x].flags |= ACTIVE;
104 }
105
106 x++;
107 }
108
109 x = 1;
110 while (g_ftdm_sngss7_data.cfg.mtpLinkSet[x].id != 0) {
111
112 if (!(g_ftdm_sngss7_data.cfg.mtpLinkSet[x].flags & ACTIVE)) {
113
114 if (ftmod_ss7_enable_mtpLinkSet(x)) {
115 SS7_CRITICAL("LinkSet \"%s\" Enable: NOT OK\n", g_ftdm_sngss7_data.cfg.mtpLinkSet[x].name);
116 return 1;
117 } else {
118 SS7_INFO("LinkSet \"%s\" Enable: OK\n", g_ftdm_sngss7_data.cfg.mtpLinkSet[x].name);
119 }
120
121
122 g_ftdm_sngss7_data.cfg.mtpLinkSet[x].flags |= ACTIVE;
123 }
124
125 x++;
126 }
127
128 return 0;
129 }
130
131
132 static int ftmod_ss7_enable_isap(int suId)
133 {
134 CcMngmt cntrl;
135 Pst pst;
136
137
138 smPstInit(&pst);
139
140
141 pst.dstEnt = ENTCC;
142
143
144 memset(&cntrl, 0x0, sizeof(CcMngmt));
145
146
147 smHdrInit(&cntrl.hdr);
148
149 cntrl.hdr.msgType = TCNTRL;
150 cntrl.hdr.entId.ent = ENTCC;
151 cntrl.hdr.entId.inst = S_INST;
152 cntrl.hdr.elmId.elmnt = STISAP;
153
154 cntrl.hdr.elmId.elmntInst1 = suId;
155
156 cntrl.t.cntrl.action = ABND_ENA;
157 cntrl.t.cntrl.subAction = SAELMNT;
158
159 return (sng_cntrl_cc(&pst, &cntrl));
160 }
161
162
163 static int ftmod_ss7_enable_nsap(int suId)
164 {
165 SiMngmt cntrl;
166 Pst pst;
167
168
169 smPstInit(&pst);
170
171
172 pst.dstEnt = ENTSI;
173
174
175 memset(&cntrl, 0x0, sizeof(SiMngmt));
176
177
178 smHdrInit(&cntrl.hdr);
179
180 cntrl.hdr.msgType = TCNTRL;
181 cntrl.hdr.entId.ent = ENTSI;
182 cntrl.hdr.entId.inst = S_INST;
183 cntrl.hdr.elmId.elmnt = STNSAP;
184
185 cntrl.t.cntrl.s.siElmnt.elmntId.sapId = suId;
186 cntrl.t.cntrl.s.siElmnt.elmntParam.nsap.nsapType = SAP_MTP;
187
188
189 cntrl.t.cntrl.action = ABND_ENA;
190 cntrl.t.cntrl.subAction = SAELMNT;
191
192 return (sng_cntrl_isup(&pst, &cntrl));
193 }
194
195
196 static int ftmod_ss7_enable_mtpLinkSet(int lnkSetId)
197 {
198 SnMngmt cntrl;
199 Pst pst;
200
201
202 smPstInit(&pst);
203
204
205 pst.dstEnt = ENTSN;
206
207
208 memset(&cntrl, 0x0, sizeof(SnMngmt));
209
210
211 smHdrInit(&cntrl.hdr);
212
213 cntrl.hdr.msgType = TCNTRL;
214 cntrl.hdr.entId.ent = ENTSN;
215 cntrl.hdr.entId.inst = S_INST;
216 cntrl.hdr.elmId.elmnt = STLNKSET;
217 cntrl.hdr.elmId.elmntInst1 = lnkSetId;
218
219 cntrl.t.cntrl.action = ABND_ENA;
220 cntrl.t.cntrl.subAction = SAELMNT;
221
222 return (sng_cntrl_mtp3(&pst, &cntrl));
223 }
224
225
226 int ftmod_ss7_inhibit_mtplink(uint32_t id)
227 {
228 SnMngmt cntrl;
229 Pst pst;
230
231
232 smPstInit(&pst);
233
234
235 pst.dstEnt = ENTSN;
236
237
238 memset(&cntrl, 0x0, sizeof(SnMngmt));
239
240
241 smHdrInit(&cntrl.hdr);
242
243 cntrl.hdr.msgType = TCNTRL;
244 cntrl.hdr.entId.ent = ENTSN;
245 cntrl.hdr.entId.inst = S_INST;
246 cntrl.hdr.elmId.elmnt = STDLSAP;
247 cntrl.hdr.elmId.elmntInst1 = id;
248
249 cntrl.t.cntrl.action = AINH;
250 cntrl.t.cntrl.subAction = SAELMNT;
251
252 return (sng_cntrl_mtp3(&pst, &cntrl));
253 }
254
255
256 int ftmod_ss7_uninhibit_mtplink(uint32_t id)
257 {
258 SnMngmt cntrl;
259 Pst pst;
260
261
262 smPstInit(&pst);
263
264
265 pst.dstEnt = ENTSN;
266
267
268 memset(&cntrl, 0x0, sizeof(SnMngmt));
269
270
271 smHdrInit(&cntrl.hdr);
272
273 cntrl.hdr.msgType = TCNTRL;
274 cntrl.hdr.entId.ent = ENTSN;
275 cntrl.hdr.entId.inst = S_INST;
276 cntrl.hdr.elmId.elmnt = STDLSAP;
277 cntrl.hdr.elmId.elmntInst1 = id;
278
279 cntrl.t.cntrl.action = AUNINH;
280 cntrl.t.cntrl.subAction = SAELMNT;
281
282 return (sng_cntrl_mtp3(&pst, &cntrl));
283 }
284
285
286 int ftmod_ss7_activate_mtplink(uint32_t id)
287 {
288 SnMngmt cntrl;
289 Pst pst;
290
291
292 smPstInit(&pst);
293
294
295 pst.dstEnt = ENTSN;
296
297
298 memset(&cntrl, 0x0, sizeof(SnMngmt));
299
300
301 smHdrInit(&cntrl.hdr);
302
303 cntrl.hdr.msgType = TCNTRL;
304 cntrl.hdr.entId.ent = ENTSN;
305 cntrl.hdr.entId.inst = S_INST;
306 cntrl.hdr.elmId.elmnt = STDLSAP;
307 cntrl.hdr.elmId.elmntInst1 = g_ftdm_sngss7_data.cfg.mtpLink[id].id;
308
309 cntrl.t.cntrl.action = AENA;
310 cntrl.t.cntrl.subAction = SAELMNT;
311
312 return (sng_cntrl_mtp3(&pst, &cntrl));
313 }
314
315
316 int ftmod_ss7_deactivate_mtplink(uint32_t id)
317 {
318 SnMngmt cntrl;
319 Pst pst;
320
321
322 smPstInit(&pst);
323
324
325 pst.dstEnt = ENTSN;
326
327
328 memset(&cntrl, 0x0, sizeof(SnMngmt));
329
330
331 smHdrInit(&cntrl.hdr);
332
333 cntrl.hdr.msgType = TCNTRL;
334 cntrl.hdr.entId.ent = ENTSN;
335 cntrl.hdr.entId.inst = S_INST;
336 cntrl.hdr.elmId.elmnt = STDLSAP;
337 cntrl.hdr.elmId.elmntInst1 = g_ftdm_sngss7_data.cfg.mtpLink[id].id;
338
339 cntrl.t.cntrl.action = ADISIMM;
340 cntrl.t.cntrl.subAction = SAELMNT;
341
342 return (sng_cntrl_mtp3(&pst, &cntrl));
343 }
344
345
346 int ftmod_ss7_deactivate2_mtplink(uint32_t id)
347 {
348 SnMngmt cntrl;
349 Pst pst;
350
351
352 smPstInit(&pst);
353
354
355 pst.dstEnt = ENTSN;
356
357
358 memset(&cntrl, 0x0, sizeof(SnMngmt));
359
360
361 smHdrInit(&cntrl.hdr);
362
363 cntrl.hdr.msgType = TCNTRL;
364 cntrl.hdr.entId.ent = ENTSN;
365 cntrl.hdr.entId.inst = S_INST;
366 cntrl.hdr.elmId.elmnt = STDLSAP;
367 cntrl.hdr.elmId.elmntInst1 = g_ftdm_sngss7_data.cfg.mtpLink[id].id;
368
369 cntrl.t.cntrl.action = ADISIMM_L2;
370 cntrl.t.cntrl.subAction = SAELMNT;
371
372 return (sng_cntrl_mtp3(&pst, &cntrl));
373 }
374
375
376 int ftmod_ss7_activate_mtplinkSet(uint32_t id)
377 {
378 SnMngmt cntrl;
379 Pst pst;
380
381
382 smPstInit(&pst);
383
384
385 pst.dstEnt = ENTSN;
386
387
388 memset(&cntrl, 0x0, sizeof(SnMngmt));
389
390
391 smHdrInit(&cntrl.hdr);
392
393 cntrl.hdr.msgType = TCNTRL;
394 cntrl.hdr.entId.ent = ENTSN;
395 cntrl.hdr.entId.inst = S_INST;
396 cntrl.hdr.elmId.elmnt = STLNKSET;
397 cntrl.hdr.elmId.elmntInst1 = g_ftdm_sngss7_data.cfg.mtpLinkSet[id].id;
398
399 cntrl.t.cntrl.action = AACTLNKSET;
400 cntrl.t.cntrl.subAction = SAELMNT;
401
402 return (sng_cntrl_mtp3(&pst, &cntrl));
403 }
404
405
406 int ftmod_ss7_deactivate_mtplinkSet(uint32_t id)
407 {
408 SnMngmt cntrl;
409 Pst pst;
410
411
412 smPstInit(&pst);
413
414
415 pst.dstEnt = ENTSN;
416
417
418 memset(&cntrl, 0x0, sizeof(SnMngmt));
419
420
421 smHdrInit(&cntrl.hdr);
422
423 cntrl.hdr.msgType = TCNTRL;
424 cntrl.hdr.entId.ent = ENTSN;
425 cntrl.hdr.entId.inst = S_INST;
426 cntrl.hdr.elmId.elmnt = STLNKSET;
427 cntrl.hdr.elmId.elmntInst1 = g_ftdm_sngss7_data.cfg.mtpLinkSet[id].id;
428
429 cntrl.t.cntrl.action = ADEACTLNKSET;
430 cntrl.t.cntrl.subAction = SAELMNT;
431
432 return (sng_cntrl_mtp3(&pst, &cntrl));
433 }
434
435
436 int ftmod_ss7_deactivate2_mtplinkSet(uint32_t id)
437 {
438 SnMngmt cntrl;
439 Pst pst;
440
441
442 smPstInit(&pst);
443
444
445 pst.dstEnt = ENTSN;
446
447
448 memset(&cntrl, 0x0, sizeof(SnMngmt));
449
450
451 smHdrInit(&cntrl.hdr);
452
453 cntrl.hdr.msgType = TCNTRL;
454 cntrl.hdr.entId.ent = ENTSN;
455 cntrl.hdr.entId.inst = S_INST;
456 cntrl.hdr.elmId.elmnt = STLNKSET;
457 cntrl.hdr.elmId.elmntInst1 = g_ftdm_sngss7_data.cfg.mtpLinkSet[id].id;
458
459 cntrl.t.cntrl.action = ADEACTLNKSET_L2;
460 cntrl.t.cntrl.subAction = SAELMNT;
461
462 return (sng_cntrl_mtp3(&pst, &cntrl));
463 }
464
465
466 int ftmod_ss7_lpo_mtplink(uint32_t id)
467 {
468 SnMngmt cntrl;
469 Pst pst;
470
471
472 smPstInit(&pst);
473
474
475 pst.dstEnt = ENTSN;
476
477
478 memset(&cntrl, 0x0, sizeof(SnMngmt));
479
480
481 smHdrInit(&cntrl.hdr);
482
483 cntrl.hdr.msgType = TCNTRL;
484 cntrl.hdr.entId.ent = ENTSN;
485 cntrl.hdr.entId.inst = S_INST;
486 cntrl.hdr.elmId.elmnt = STDLSAP;
487 cntrl.hdr.elmId.elmntInst1 = g_ftdm_sngss7_data.cfg.mtpLink[id].id;
488
489 cntrl.t.cntrl.action = ACTION_LPO;
490 cntrl.t.cntrl.subAction = SAELMNT;
491
492 return (sng_cntrl_mtp3(&pst, &cntrl));
493 }
494
495
496 int ftmod_ss7_lpr_mtplink(uint32_t id)
497 {
498 SnMngmt cntrl;
499 Pst pst;
500
501
502 smPstInit(&pst);
503
504
505 pst.dstEnt = ENTSN;
506
507
508 memset(&cntrl, 0x0, sizeof(SnMngmt));
509
510
511 smHdrInit(&cntrl.hdr);
512
513 cntrl.hdr.msgType = TCNTRL;
514 cntrl.hdr.entId.ent = ENTSN;
515 cntrl.hdr.entId.inst = S_INST;
516 cntrl.hdr.elmId.elmnt = STDLSAP;
517 cntrl.hdr.elmId.elmntInst1 = g_ftdm_sngss7_data.cfg.mtpLink[id].id;
518
519 cntrl.t.cntrl.action = ACTION_LPR;
520 cntrl.t.cntrl.subAction = SAELMNT;
521
522 return (sng_cntrl_mtp3(&pst, &cntrl));
523 }
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539