-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintu.c
More file actions
2783 lines (2303 loc) · 100 KB
/
Copy pathintu.c
File metadata and controls
2783 lines (2303 loc) · 100 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
camel gateway engine application
version 1.1
02022017
working!
MODIFIED (MM/DD/YY)
Elvina 21/03/2017 - В get запросы при режиме SIP передаются вх и исх номер
Elvina 29/03/2017 - Добывлен сценарий на коды возврата при обращение к БД
*/
#include "intu_def.h"
#include "sys/ipc.h"
#include "time.h"
#include "helper.h"
#include "globals.h"
#include "camelgw_handle_idp.h"
#include "camelgw_handle_erb.h"
#include "camelgw_conf.h"
//#include "camelgw_handle_acr.c"
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
#define ANSI_COLOR_BLUE "\x1b[34m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_CYAN "\x1b[36m"
#define ANSI_COLOR_RESET "\x1b[0m"
//#define NATIONAL_NUMBER 3
//#define INTERNATIONAL_NUMBER 4
//#define REGIME 1
#define IP 2
#define IDP_RES 3
#define DEBUG //working in DEBUG mode, with a lot of printfs and other tricks
struct alarm {
int severity;
char *descriptor;
};
//struct alarm alrm;
/* modes for main processing logic by INTU module */
//#define MODE_CONTINUE_ONLY 1
//#define MODE_PREPAID 2
//#define MODE_SIP_TERMINATION 3
/*
* INTU
* ====
*
* INTU operates as a state machine, with each state representing a point durinmg
* an INAP dialogue. A separate Dialogue Control Block (DLG_CB) exists for each
* dialogue identifier in the supported range.
*
* The following Message Sequence Chart shows the messages that occur and the
* expected flow through the state machine for a single dialogue. The messages
* between INTU and the local INAP task.
*
* INTU INAP
* ===== =====
* (Note 1) | |
* IDLE |
* | DLG-IND (OPEN) |
* (Note 2) | <---------------------------- |
* | |
* OPEN |
* | SRV-IND (INVOKE:InitialDP) |
* (Note 3) | <---------------------------- |
* | |
* PENDING |
* DELIMIT |
* | DLG-IND (DELIMIT) |
* | <---------------------------- |
* (Note 4) | |
* | DLG-REQ (OPEN-RSP) |
* | ----------------------------> |
* | |
* | SRV-REQ (INVOKE:Connect) |
* | ----------------------------> |
* | |
* | DLG-REQ (DELIMIT) |
* | ----------------------------> |
* | |
* | DLG-REQ (CLOSE) |
* | ----------------------------> |
* | (pre-arranged end) |
* | |
* CLOSING |
* | DLG-IND (CLOSE) |
* (Note 5) | <---------------------------- |
* | |
* IDLE |
* | |
*
* Note 1: Dialogue is idle
*
* Note 2: Dialogue OPEN indication causes the dialogue to be opened
*
* Note 3: The service key is checked if it matches the information needed
* to process the service is stored and prepared in the dialogue control
* block (DLG_CB) waiting for the delimit.
*
* Note 4: The delimit triggers the processing of the prepared service logic,
* In this case a simple number translation from one known number to
* another. If the called party address isn't recognised a ReleaseCall
* would be sent. INTU replies with an OPEN-RSP, INVOKE-Connect,
* DELIMIT, CLOSE(pre-arranged end).
*
* Note 5: The dialogue is waiting for INAP to tell it to close the dialogue.
* When the CLOSE comes the dialogue control block is reset.
*/
/*
*
* unsigned char u8 Exactly one byte (8 bits);
* unsigned int short u16; 16bit
* unsigned int long u32; Exactly 4 bytes (32 bits)
*
*/
//typedef struct msgbuf {
//long msg_type;
//long int msg_time; // время в сыром линукс формате
//int msg_dlg_id; //current dialog id
//int msg_serv_mode;//indicator of service mode
//u16 msg_operation;
//u16 msg_databuf_offset;
//u8 msg_databuf[0];
//} LOG_MSG;
//void sig_handler (int signum, siginfo_t *siginfo, void *ucontext);// {
static void* thread_func(void *ptr);// {
static void* thread_func2(void *p);// {
int INTU_handle_cpt_list(u32 ic_dlg_id, DLG_CB *dlg_ptr, HDR *h, IN_CPT *buffer_cpt_ptr);
int INTU_process_invokes(u32 ic_dlg_id, DLG_CB *dlg_ptr, HDR *h);
/*
* global enum for consttrcting SERVICE flag parameter -от этого параметра
* зависит вся логика шлюза, в зависимости от настроек lua,
* вход или исходящий вызов, домашний или гостевой VLR
*/
//enum OPTIONS_FLAGS {
// DP2 = 0x01, //DP2 is an int type - MO call
// DP12 = 0x00, //MT call
// BYPASS = 0x00, //bypass mode, all services switched off, just continue to MSC
// SIP_ON = 0x04, //SIP service ON
// SIP_OFF = 0x08, //SIP service OFF
// HOME_VLR = 0x00, // user located in Home VLR
// GUEST_VLR =0x40,// user located in GUEST VLR
//};
//global array for max size of LOG_MSG structure
//4112 = 4096(max number of databuf elements + length of another elements of mLOG_MSG
unsigned char memory_buffer[256];
u8 example_freephone_num[] = {8,9,0,2,7,1,1,1,2,8,7};
u8 example_dest_routing_num[] = {8,9,1,7,8,8,5,0,3,0,7};
/*
* Cause normal_unspecified
*/
//u8 example_release_cause[]= {0,0x80+INTU_cause_value_normal_unspecified};
/*
* Example service key. This is the only service key recognised by this example
* program. If the InitialDP does not use this service key INTU will respond
* with U_ERROR.
*/
static u8 example_srv_key[] = {0x1};
static u8 example_srv_key_2[] = {0x2};
int socket_d, socket_d_vpn, socket_d_m2m;
/*
* Module variables, updated by command line options in intu_main
*/
u8 intu_mod_id; // The task id of this module
u8 inap_mod_id; // The task id of the INAP binary module
u16 num_dialogues; // The number of dialogues to support
u32 base_dialogue_id; // The base number of the supported dialogue IDs
u16 intu_options; // Defines which tracing options are configured
/*
* Module variables
*/
u32 last_dlg_id; /* Last Dialog ID of configured range */
/*
* Array of dialogue control blocks for dialogue ids
* from (base_dialogue_id) to (base_dialogue_id + NUM_DIALOGUES - 1).
*/
DLG_CB dlg_data[MAX_NUM_DIALOGUES];
//u8 example_release_cause[2]= {0,0x80+INTU_cause_value_normal_unspecified};
//u8 example_release_cause2[2] = {0x80, 0x80 + INTU_cause_call_bearer_capability_not_authorized};
/*
* Variables to log dialogue statistics
*/
static u16 active_dialogues = 0;
static u32 completed_dialogues = 0;
static u32 successful_dialogues = 0;
static u32 timeout_dialogues;
struct My_Data {
u16 Dead_Dialogue;
pthread_spinlock_t spin;
};
char *socket_path = "/var/run/camelgw/socket";
const char *socket_path_vpn = "/var/run/camelgw/vpn_driver";
char *socket_path_m2m = "/var/run/camelgw/m2m_driver";
pthread_spinlock_t spin;
u16 Global;
volatile sig_atomic_t services_conf_reread_flag;
void
sighup(int signo)
{
services_conf_reread_flag = 1; /*need to reread services configuration file */
}
/*
*******************************************************************************
* *
* intu_ent: Main program loop *
*
* intu_ent() called from the main function in intumain.c *
*******************************************************************************
*/
int intu_ent()
{
HDR *h; /* Received message */
DLG_CB *dlg; /* The control block for the dlg id of the rec msg*/
u16 i; /* loop counter */
u16 min_rev; /* INAP API major revision number */
u16 maj_rev; /* INAP API major revision number */
char *ident_text; /* INAP API name in text */
// int socket_d;
MSG *msg_buff_ptr;
u8 *pptr;
int ret;
int status;
int fd; //descriptor for connecting with Erlang node
pthread_t thread;
// timer_t timer;
struct sigaction sa;
struct sockaddr_un addr;
//struct sigevent se = {0};
// struct itimerspec ts = {0};
sigset_t new_set, pending_set, old_set;
// struct alarm alrm;
//example_release_cause[2]= {0,0x80+INTU_cause_value_normal_unspecified};
/*
* Calculate last valid dialog ID
*/
last_dlg_id = base_dialogue_id + num_dialogues - 1;
if (num_dialogues > MAX_NUM_DIALOGUES)
{
fprintf(stderr, "intu() : Not enough dialogue resources available\n");
fprintf(stderr, "0x%04x available, 0x%04x requested\n", MAX_NUM_DIALOGUES, num_dialogues);
return 0;
}
/*
* If not using Extended Dialog IDs, check that all dialog DIDs required only 16 bits
*/
if ((intu_options & INTU_OPT_EXT_DLG) == 0)
{
if ((last_dlg_id > MAX_NON_EXT_DID) && (num_dialogues > 0))
{
fprintf(stderr, "intu() : Dialogue range requires use of Extended Dialog IDs option (0x%04x)\n", INTU_OPT_EXT_DLG);
fprintf(stderr, " last dialog in configured range is 0x%08lx\n", last_dlg_id);
return 0;
}
}
/*
* Print banner so we know what's running:
*/
printf("CAMEL Gateway application (C) based on Dialogic intu.c Version = 1.2 \n");
printf("=======================================================================================\n\n");
if (IN_version(&maj_rev, &min_rev, &ident_text) == IN_SUCCESS);
printf("%s Version %i.%i\n",ident_text, maj_rev, min_rev);
printf("INTU module ID - 0x%02x \nINAP module ID - 0x%02x\n", intu_mod_id, inap_mod_id);
printf("Number of dialogues - 0x%04x (%i)\nBase dialogue ID - 0x%04x\n", num_dialogues, num_dialogues, base_dialogue_id);
printf("Options set - 0x%04x \n\n", intu_options);
/*
* Initialise the per-dialogue resources:
*/
for (i=0; i<MAX_NUM_DIALOGUES; i++)
{
dlg = &dlg_data[i];
dlg->state = INTU_STATE_IDLE;
dlg->reply_prepared = INTU_REPLY_NONE;
dlg->cpt_list_head = NULL; // для каждого диалога список компонент изначально состоит как бы из одного узла, указатель на голову = null
dlg->cursor = 0;
//may be need this initialising by zero memset(&(dlg->call_details), 0, sizeof(struct calldetails));
}
/* timer environment settings */
/*timer used when no any message received for open dialog during TIMEOUT value */
// se.sigev_notify = SIGEV_SIGNAL;
// se.sigev_signo = SIGRTMIN;
// se.sigev_value.sival_int = 15;//&timer;
//
/* timer create */
/* ret = timer_create(CLOCK_REALTIME, &se, &timer);
if (ret)
perror("timer create"); */
//timer_settime(timer, 0, &ts, NULL);
//struct sigaction sa;
//sigset_t set, pending_set, old_set;
// timer_t timer;
// int ret,i;
//sa.sa_handler = sig_handler;
// sigemptyset (&new_action.sa_mask);
// sa.sa_flags = SA_SIGINFO;
// sigaction (SIGRTMIN, &sa, NULL);
// sigaction (SIGTERM, &new_action, NULL);
//socket_d for ora_cli moved to prepaid lib
/* /\*prepare UNIX DOMAIN SOCKET DESCRIPTOR *\/ */
/* /\*used to connect to oracle_cli process*\/ */
/* if ( (socket_d = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) { */
/* perror("socket error"); */
/* exit(-1); */
/* } */
/* memset(&addr, 0, sizeof(addr)); */
/* addr.sun_family = AF_UNIX; */
/* if (*socket_path == '\0') { */
/* *addr.sun_path = '\0'; */
/* strncpy(addr.sun_path+1, socket_path+1, sizeof(addr.sun_path)-2); */
/* } else { */
/* strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path)-1); */
/* } */
/* if (connect(socket_d, (struct sockaddr*)&addr, sizeof(addr)) == -1) { */
/* perror("unix domain socket connect error"); */
/* // exit(-1); */
/* //TODO - set global flag */
/* } */
/***** connect to vpn_driver ********/
if ( (socket_d_vpn = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
perror("socket for vpn driver error");
exit(-1);
}
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
if (*socket_path_vpn == '\0') {
*addr.sun_path = '\0';
strncpy(addr.sun_path+1, socket_path_vpn+1, sizeof(addr.sun_path)-2);
} else {
strncpy(addr.sun_path, socket_path_vpn, sizeof(addr.sun_path)-1);
}
if (connect(socket_d_vpn, (struct sockaddr*)&addr, sizeof(addr)) == -1) {
perror("unix domain socket connect with vpn driver error");
// exit(-1);
}
/***** connect to m2m_driver ********/
//work in progress
if ( (socket_d_m2m = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
perror("socket for m2m driver error");
exit(-1);
}
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
if (*socket_path_m2m == '\0')
{
*addr.sun_path = '\0';
strncpy(addr.sun_path+1, socket_path_m2m+1, sizeof(addr.sun_path)-2);
}
else
{
strncpy(addr.sun_path, socket_path_m2m, sizeof(addr.sun_path)-1);
}
if (connect(socket_d_m2m, (struct sockaddr*)&addr, sizeof(addr)) == -1) {
perror("unix domain socket connect with m2m driver error");
// exit(-1);
}
/*******************************************************************************************
* MAIN PROGRAMM ENDLESS LOOP
****************************************************************************************************/
/* all things about signals sould be moved inti intumain.c !!!!!!!
sigemptyset(&new_set);
//sigaddset(&set, SIGUSR1);
//sigaddset(&set, SIGUSR2);
sigaddset(&new_set, SIGRTMIN);
// sigprocmask(SIG_SETMASK, &new_set, &old_set);
// finished = 0;
//sigprocmask(SIG_SETMASK, &new_set, &old_set);
pthread_sigmask(SIG_BLOCK, &new_set, &old_set); //block SIGRTMIN signal for main thread
// u8 *pptr;
unsigned char value = 0x35;
//uc_ptr = (unsigned char*) calloc(80, 1);
/**************************** configure SCCP module parameters *******************************************************/
msg_buff_ptr = getm(SCP_MSG_CONFIG, 0, 0, SCPML_CONFIG_MAX );
msg_buff_ptr->hdr.src = 0x3d;
msg_buff_ptr->hdr.dst = SCP_TASK_ID;
msg_buff_ptr->hdr.id = 0;
msg_buff_ptr->hdr.rsp_req = 0x2000; //need confirmation send to user module
pptr = get_param(msg_buff_ptr);
memset(pptr, 0, msg_buff_ptr->len);
rpackbytes(pptr, SCPMO_CONFIG_cnf_ver , 1, SCPMS_CONFIG_cnf_ver );
rpackbytes(pptr, SCPMO_CONFIG_sio, 0xc3 , SCPMS_CONFIG_sio ); //sio = c3
rpackbytes(pptr, SCPMO_CONFIG_options, 0x8006, SCPMS_CONFIG_options); //TODO! - should check this value
rpackbytes(pptr, SCPMO_CONFIG_module_id, 0x33, SCPMS_CONFIG_module_id); //SCCP module ID
rpackbytes(pptr, SCPMO_CONFIG_mtp_id, 0x22, SCPMS_CONFIG_mtp_id);
rpackbytes(pptr, SCPMO_CONFIG_mngt_id, 0xef, SCPMS_CONFIG_mngt_id);
rpackbytes(pptr, SCPMO_CONFIG_maint_id, 0xef, SCPMS_CONFIG_maint_id);
rpackbytes(pptr, SCPMO_CONFIG_point_code, 14100, SCPMS_CONFIG_point_code); //SCP Point Code
rpackbytes(pptr, SCPMO_CONFIG_max_sif, 272, SCPMS_CONFIG_max_sif);
rpackbytes(pptr, SCPMO_CONFIG_sccp_instance, 0 , SCPMS_CONFIG_sccp_instance);
rpackbytes(pptr, SCPMO_CONFIG_smb_id, 0xef, SCPMS_CONFIG_smb_id);
rpackbytes(pptr, SCPMO_CONFIG_smb_flags, 0x1c, SCPMS_CONFIG_smb_flags);
rpackbytes(pptr, SCPMO_CONFIG_num_uc, 0, SCPMS_CONFIG_num_uc);
rpackbytes(pptr, SCPMO_CONFIG_uc_onset ,0 , SCPMS_CONFIG_uc_onset);
rpackbytes(pptr, SCPMO_CONFIG_uc_abmt ,0 , SCPMS_CONFIG_uc_abmt);
rpackbytes(pptr, SCPMO_CONFIG_num_ic ,0 , SCPMS_CONFIG_num_ic);
rpackbytes(pptr, SCPMO_CONFIG_ic_onset ,0 ,SCPMS_CONFIG_ic_onset);
rpackbytes(pptr, SCPMO_CONFIG_ic_abmt, 0 , SCPMS_CONFIG_ic_abmt);
rpackbytes(pptr, SCPMO_CONFIG_num_data,0 , SCPMS_CONFIG_num_data);
rpackbytes(pptr, SCPMO_CONFIG_data_onset,0 , SCPMS_CONFIG_data_onset);
rpackbytes(pptr, SCPMO_CONFIG_data_abmt,0 , SCPMS_CONFIG_data_abmt);
rpackbytes(pptr, SCPMO_CONFIG_num_edata,0 , SCPMS_CONFIG_num_edata);
rpackbytes(pptr, SCPMO_CONFIG_edata_onset,0 , SCPMS_CONFIG_edata_onset);
rpackbytes(pptr, SCPMO_CONFIG_edata_abmt,0 , SCPMS_CONFIG_edata_abmt);
rpackbytes(pptr, SCPMO_CONFIG_ext_options, SCPXF_DEL_CGPC, SCPMS_CONFIG_ext_options); //remove PointCode from SCCP Calling GT from INTU messages
rpackbytes(pptr, SCPMO_CONFIG_base_id , 0, SCPMS_CONFIG_base_id);
rpackbytes(pptr, SCPMO_CONFIG_top_id , 0, SCPMS_CONFIG_top_id);
rpackbytes(pptr, SCPMO_CONFIG_min_id , 0, SCPMS_CONFIG_min_id);
rpackbytes(pptr, SCPMO_CONFIG_max_id , 0, SCPMS_CONFIG_max_id);
rpackbytes(pptr, SCPMO_CONFIG_isup_id , 0 , SCPMS_CONFIG_isup_id);
rpackbytes(pptr, SCPMO_CONFIG_nc , 0 , SCPMS_CONFIG_nc);
rpackbytes(pptr, SCPMO_CONFIG_hop_counter, 0, SCPMS_CONFIG_hop_counter );
rpackbytes(pptr, SCPMO_CONFIG_error_offset, 0, SCPMS_CONFIG_error_offset);
rpackbytes(pptr, SCPMO_CONFIG_trace_id, 0xef, SCPMS_CONFIG_trace_id);
rpackbytes(pptr, SCPMO_CONFIG_gtt_separator, 0, SCPMS_CONFIG_gtt_separator);
rpackbytes(pptr, SCPMO_CONFIG_ext2_options, 0x1, SCPMS_CONFIG_ext2_options);
if (GCT_send(msg_buff_ptr->hdr.dst, &msg_buff_ptr->hdr) != 0)
{
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
printf("message send error!");
relm(&msg_buff_ptr->hdr);
}
/*******************************end of SCCP module parameters configuration ******************************************/
/**************************** configure TCAP module parameters *******************************************************/
msg_buff_ptr = getm(TCP_MSG_CONFIG, 0, 0, TCPML_CONFIG_V1);
msg_buff_ptr->hdr.src = 0x3d;
msg_buff_ptr->hdr.dst = 0x14;
msg_buff_ptr->hdr.rsp_req = 0x2000;
pptr = get_param(msg_buff_ptr);
memset(pptr, 0, msg_buff_ptr->len);
rpackbytes(pptr, TCPMO_CONFIG_V1_cnf_ver, 1, TCPMS_CONFIG_V1_cnf_ver);
rpackbytes(pptr, TCPMO_CONFIG_V1_module_id, 0, TCPMS_CONFIG_V1_module_id );
rpackbytes(pptr, TCPMO_CONFIG_V1_user_id, 0x35, TCPMS_CONFIG_V1_user_id);
rpackbytes(pptr, TCPMO_CONFIG_V1_nsap_id, 0x33, TCPMS_CONFIG_V1_nsap_id);
//old commerc rpackbytes(pptr, TCPMO_CONFIG_V1_mngt_id, 0xef, TCPMS_CONFIG_V1_mngt_id); //try to use new mngt id module
//rpackbytes(pptr, TCPMO_CONFIG_V1_mngt_id, 0xed, TCPMS_CONFIG_V1_mngt_id);
rpackbytes(pptr, TCPMO_CONFIG_V1_mngt_id, 0x3d, TCPMS_CONFIG_V1_mngt_id); //try to use new mngt id module
//rpackbytes(pptr, TCPMO_CONFIG_V1_maint_id , 0xef, TCPMS_CONFIG_V1_maint_id);
rpackbytes(pptr, TCPMO_CONFIG_V1_maint_id , 0x3d, TCPMS_CONFIG_V1_maint_id);
//old commerc rpackbytes(pptr, TCPMO_CONFIG_V1_trace_id , 0xed, TCPMS_CONFIG_V1_trace_id); //module to catch trace messages
rpackbytes(pptr, TCPMO_CONFIG_V1_trace_id , 0x3d, TCPMS_CONFIG_V1_trace_id); //module to catch trace messages
rpackbytes(pptr, TCPMO_CONFIG_V1_tcap_instance, 0x0, TCPMS_CONFIG_V1_tcap_instance );
rpackbytes(pptr, TCPMO_CONFIG_V1_tid_ninst , 0x0, TCPMS_CONFIG_V1_tid_ninst);
rpackbytes(pptr, TCPMO_CONFIG_V1_tid_ndref, 0x10, TCPMS_CONFIG_V1_tid_ndref);
rpackbytes(pptr, TCPMO_CONFIG_V1_tid_nseq , 0x0c, TCPMS_CONFIG_V1_tid_nseq);
rpackbytes(pptr, TCPMO_CONFIG_V1_addr_format , 0x0, TCPMS_CONFIG_V1_addr_format );
rpackbytes(pptr, TCPMO_CONFIG_V1_reserved_1 , 0, TCPMS_CONFIG_V1_reserved_1);
// rpackbytes(pptr, TCPMO_CONFIG_V1_flags, TCPF_DLG_TIM_ABORT, TCPMS_CONFIG_V1_flags);
//old commerc rpackbytes(pptr, TCPMO_CONFIG_V1_flags, 0, TCPMS_CONFIG_V1_flags);
rpackbytes(pptr, TCPMO_CONFIG_V1_flags, TCPF_TR_DISC, TCPMS_CONFIG_V1_flags); //trace discarded primitives to mngmn module
rpackbytes(pptr, TCPMO_CONFIG_V1_ext_flags, 0x0, TCPMS_CONFIG_V1_ext_flags);
rpackbytes(pptr, TCPMO_CONFIG_V1_max_data , 0xff, TCPMS_CONFIG_V1_max_data);
rpackbytes(pptr, TCPMO_CONFIG_V1_dlg_hunt, 0x0, TCPMS_CONFIG_V1_dlg_hunt);
rpackbytes(pptr, TCPMO_CONFIG_V1_def_dlg_idle_tmo , 0x012c, TCPMS_CONFIG_V1_def_dlg_idle_tmo); //TCAP dialog timeout timer = 5 minutes
rpackbytes(pptr, TCPMO_CONFIG_V1_reserved_2, 0x0000, TCPMS_CONFIG_V1_reserved_2);
//rpackbytes(pptr, TCPMO_CONFIG_V1_num_components , 0x100, TCPMS_CONFIG_V1_num_components );
rpackbytes(pptr, TCPMO_CONFIG_V1_num_components , 0x0014, TCPMS_CONFIG_V1_num_components );
//rpackbytes(pptr, TCPMO_CONFIG_V1_num_invokes , 0x0100, TCPMS_CONFIG_V1_num_invokes);
rpackbytes(pptr, TCPMO_CONFIG_V1_num_invokes , 0x0014, TCPMS_CONFIG_V1_num_invokes);
// rpackbytes(pptr, TCPMO_CONFIG_V1_nog_dialogues, 0x800, TCPMS_CONFIG_V1_nog_dialogues);
rpackbytes(pptr, TCPMO_CONFIG_V1_nog_dialogues , 0x0014, TCPMS_CONFIG_V1_nog_dialogues );
//rpackbytes(pptr, TCPMO_CONFIG_V1_nic_dialogues, 0x800, TCPMS_CONFIG_V1_nic_dialogues);
rpackbytes(pptr, TCPMO_CONFIG_V1_nic_dialogues, 0x000a, TCPMS_CONFIG_V1_nic_dialogues);
rpackbytes(pptr, TCPMO_CONFIG_V1_base_ogdlg_id , 0x0000, TCPMS_CONFIG_V1_base_ogdlg_id );
rpackbytes(pptr, TCPMO_CONFIG_V1_base_icdlg_id , 0x8000, TCPMS_CONFIG_V1_base_icdlg_id );
if (GCT_send(msg_buff_ptr->hdr.dst, &msg_buff_ptr->hdr) != 0)
{
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
printf("message send error!");
relm(&msg_buff_ptr->hdr);
}
/*********************TCAP trace mask config******************************************************************************/
msg_buff_ptr = getm(TCP_MSG_TRACE_MASK, 0, 0, TCPML_TRACE_MASK);
msg_buff_ptr->hdr.src = 0x3d;
msg_buff_ptr->hdr.dst = TCP_TASK_ID;
msg_buff_ptr->hdr.id = 0;
//msg_buff_ptr->hdr.rsp_req = 0x2000; //rsp_req for confirmation receiving
pptr = get_param(msg_buff_ptr);
memset(pptr, 0, msg_buff_ptr->len);
//TCPMO_CONFIG_V1_cnf_ver
rpackbytes(pptr, TCPMO_TRACE_MASK_op_evt_mask, 0, TCPMS_TRACE_MASK_op_evt_mask);
rpackbytes(pptr, TCPMO_TRACE_MASK_ip_evt_mask, TCPIEM_UDT_IND, TCPMS_TRACE_MASK_ip_evt_mask);
rpackbytes(pptr, TCPMO_TRACE_MASK_mng_evt_mask, 0, TCPMO_TRACE_MASK_mng_evt_mask);
if (GCT_send(msg_buff_ptr->hdr.dst, &msg_buff_ptr->hdr) != 0)
{
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
printf("message send error!");
relm(&msg_buff_ptr->hdr);
}
/***************************************************************************************************/
msg_buff_ptr = getm(TCP_MSG_S_TCU_ID, 0, 0, 3);
msg_buff_ptr->hdr.src = 0x3d;
msg_buff_ptr->hdr.dst = TCP_TASK_ID;
msg_buff_ptr->hdr.id = 0x92;
msg_buff_ptr->hdr.rsp_req = 0x2000; //rsp_req for confirmation receiving
pptr = get_param(msg_buff_ptr);
memset(pptr, 0, msg_buff_ptr->len);
//TCPMO_CONFIG_V1_cnf_ver
rpackbytes(pptr, 0, 0x35, 1);
rpackbytes(pptr, 1, 0, 1 );
if (GCT_send(msg_buff_ptr->hdr.dst, &msg_buff_ptr->hdr) != 0)
{
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
printf("message send error!");
relm(&msg_buff_ptr->hdr);
}
/**************************** configure INAP module parameters *******************************************************/
msg_buff_ptr = getm(INAP_MSG_CONFIG, 0, 0, INAPML_CONFIG_V1);
msg_buff_ptr->hdr.src = 0x3d;
msg_buff_ptr->hdr.dst = 0x35;
msg_buff_ptr->hdr.rsp_req = 0x2000;
//msg_tcap->hdr.id = 3;
pptr = get_param(msg_buff_ptr);
memset(pptr, 0, msg_buff_ptr->len);
rpackbytes(pptr, INAPMO_CONFIG_V1_user_id, 0x3d, INAPMS_CONFIG_V1_user_id );
rpackbytes(pptr, INAPMO_CONFIG_V1_TCAP_id, 0x14 , INAPMS_CONFIG_V1_TCAP_id );
rpackbytes(pptr, INAPMO_CONFIG_V1_mngt_id, 0xef, INAPMS_CONFIG_V1_mngt_id );
rpackbytes(pptr, INAPMO_CONFIG_V1_maint_id, 0xef, INAPMS_CONFIG_V1_maint_id );
rpackbytes(pptr, INAPMO_CONFIG_V1_trace_id, 0xef , INAPMS_CONFIG_V1_trace_id );
rpackbytes(pptr, INAPMO_CONFIG_V1_version, 1, INAPMS_CONFIG_V1_version );
rpackbytes(pptr, INAPMO_CONFIG_V1_base_usr_ogdlg_id, 0x0000, INAPMS_CONFIG_V1_base_usr_ogdlg_id );
rpackbytes(pptr, INAPMO_CONFIG_V1_base_usr_icdlg_id, 0x8000, INAPMS_CONFIG_V1_base_usr_icdlg_id );
rpackbytes(pptr, INAPMO_CONFIG_V1_base_tc_ogdlg_id, 0x0000, INAPMS_CONFIG_V1_base_tc_ogdlg_id );
rpackbytes(pptr, INAPMO_CONFIG_V1_base_tc_icdlg_id, 0x8000, INAPMS_CONFIG_V1_base_tc_icdlg_id );
// rpackbytes(pptr, INAPMO_CONFIG_V1_nog_dialogues, 0x0800, INAPMS_CONFIG_V1_nog_dialogues );
//rpackbytes(pptr, INAPMO_CONFIG_V1_nic_dialogues, 0x0800, INAPMS_CONFIG_V1_nic_dialogues ); //reserved octets set to 0 all
//rpackbytes(pptr, INAPMO_CONFIG_V1_num_invokes, 0x0100, INAPMS_CONFIG_V1_num_invokes ); //reserved octets set to 0 all
rpackbytes(pptr, INAPMO_CONFIG_V1_nog_dialogues, 0x000a, INAPMS_CONFIG_V1_nog_dialogues );
rpackbytes(pptr, INAPMO_CONFIG_V1_nic_dialogues, 0x000a, INAPMS_CONFIG_V1_nic_dialogues ); //reserved octets set to 0 all
rpackbytes(pptr, INAPMO_CONFIG_V1_num_invokes, 0x0100, INAPMS_CONFIG_V1_num_invokes ); //reserved octets set to 0 all
rpackbytes(pptr, INAPMO_CONFIG_V1_options, INAPF_TRNS_AC, INAPMS_CONFIG_V1_options ); //transparent AC
rpackbytes(pptr, INAPMO_CONFIG_V1_error_offset, 0, INAPMS_CONFIG_V1_error_offset ); //reserved octets set to 0 all
if (GCT_send(msg_buff_ptr->hdr.dst, &msg_buff_ptr->hdr) != 0)
{
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
printf("message send error!");
relm(&msg_buff_ptr->hdr);
}
/*********************************************************************************************/
/**************************** configure SCCP GT translation ******************************************************/
//remote sccp gt
//msg_tcap = getm(SCP_MSG_GTT_ADD, 0, 0, 30+1 );
// unsigned char SCP_SCCP_GT_address_MSC[] = {0x08, 0x0b, 0x12, 0x92, 0x00, 0x11, 0x04, 0x97, 0x05, 0x66, 0x15, 0x20, 0x01};
// unsigned char SCP_SCCP_destination_MSC[] = {0x09, 0x0c, 0x11, 0x3c, 0x37, 0x00, 0x11, 0x04, 0x97, 0x05, 0x66, 0x15, 0x20, 0x01};
//msg_tcap->hdr.src = 0x3d;
// msg_tcap->hdr.dst = SCP_TASK_ID;
//msg_tcap->hdr.id = 0;
//msg_tcap->hdr.rsp_req = 0x2000;
// pptr = get_param(msg_tcap);
// memset(pptr, 0, msg_tcap->len);
//memcpy(pptr, SCP_SCCP_GT_address_MSC, 13);
//memcpy(pptr+13, SCP_SCCP_destination_MSC, 14);
//memcpy(pptr+13+14, SCP_GT_MASK, 3);
// if (GCT_send(msg_tcap->hdr.dst, &msg_tcap->hdr) != 0)
// {
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
// printf("message send error!");
// relm(&msg_tcap->hdr);
// }
/*******************************end of SCCP GT translations configuration ******************************************/
/**************************** configure SCCP subsystem resource RSP parameters *********************************************/
msg_buff_ptr = getm(SCP_MSG_CNF_SSR, 0, 0, SCPML_CNF_SSR);
msg_buff_ptr->hdr.src = 0x3d;
msg_buff_ptr->hdr.dst = 0x33;
msg_buff_ptr->hdr.rsp_req = 0x2000;
msg_buff_ptr->hdr.id = 1;
pptr = get_param(msg_buff_ptr);
memset(pptr, 0, msg_buff_ptr->len);
rpackbytes(pptr, SCPMO_CNF_SSR_cnf_ver , 0, SCPMS_CNF_SSR_cnf_ver );
rpackbytes(pptr, SCPMO_CNF_SSR_ssr_type , SCP_SSRT_RSP , SCPMS_CNF_SSR_ssr_type ); //remote point code
rpackbytes(pptr, SCPMO_CNF_SSR_module_id , 0, SCPMS_CNF_SSR_module_id );
rpackbytes(pptr, SCPMO_CNF_SSR_mult_ind , 0, SCPMS_CNF_SSR_mult_ind );
rpackbytes(pptr, SCPMO_CNF_SSR_spc , 14140, SCPMS_CNF_SSR_spc );
rpackbytes(pptr, SCPMO_CNF_SSR_ssn , 0, SCPMS_CNF_SSR_ssn );
rpackbytes(pptr, SCPMO_CNF_SSR_mgmt_id , 0xef, SCPMS_CNF_SSR_mgmt_id );
rpackbytes(pptr, SCPMO_CNF_SSR_ssr_flags , 0, SCPMS_CNF_SSR_ssr_flags );
rpackbytes(pptr, SCPMO_CNF_SSR_pc_mask , 0, SCPMS_CNF_SSR_pc_mask );
rpackbytes(pptr, SCPMO_CNF_SSR_sio , 0, SCPMS_CNF_SSR_sio );
rpackbytes(pptr, SCPMO_CNF_SSR_riid , 0, SCPMS_CNF_SSR_riid );
rpackbytes(pptr, SCPMO_CNF_SSR_label_fmt , 0, 21 ); //reserved octets set to 0 all
if (GCT_send(msg_buff_ptr->hdr.dst, &msg_buff_ptr->hdr) != 0)
{
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
printf("message send error!");
relm(&msg_buff_ptr->hdr);
}
/**************************** configure SCCP subsystem resource LSS parameters *********************************************/
msg_buff_ptr = getm(SCP_MSG_CNF_SSR, 0, 0, SCPML_CNF_SSR);
msg_buff_ptr->hdr.src = 0x3d;
msg_buff_ptr->hdr.dst = 0x33;
msg_buff_ptr->hdr.rsp_req = 0x2000;
msg_buff_ptr->hdr.id = 2;
pptr = get_param(msg_buff_ptr);
memset(pptr, 0, msg_buff_ptr->len);
rpackbytes(pptr, SCPMO_CNF_SSR_cnf_ver, 0, SCPMS_CNF_SSR_cnf_ver );
rpackbytes(pptr, SCPMO_CNF_SSR_ssr_type, SCP_SSRT_LSS , SCPMS_CNF_SSR_ssr_type );
rpackbytes(pptr, SCPMO_CNF_SSR_module_id, 0x14, SCPMS_CNF_SSR_module_id );
rpackbytes(pptr, SCPMO_CNF_SSR_mult_ind, 0, SCPMS_CNF_SSR_mult_ind );
rpackbytes(pptr, SCPMO_CNF_SSR_spc, 0, SCPMS_CNF_SSR_spc );
rpackbytes(pptr, SCPMO_CNF_SSR_ssn, 0x92, SCPMS_CNF_SSR_ssn );
rpackbytes(pptr, SCPMO_CNF_SSR_mgmt_id, 0, SCPMS_CNF_SSR_mgmt_id );
// rpackbytes(pptr, SCPMO_CNF_SSR_ssr_flags, SSRF_HBT, SCPMS_CNF_SSR_ssr_flags ); //LSS heartbeat flag
rpackbytes(pptr, SCPMO_CNF_SSR_ssr_flags, 0, SCPMS_CNF_SSR_ssr_flags ); //without heartbeat flag
rpackbytes(pptr, SCPMO_CNF_SSR_pc_mask, 0, SCPMS_CNF_SSR_pc_mask );
rpackbytes(pptr, SCPMO_CNF_SSR_sio, 0, SCPMS_CNF_SSR_sio );
rpackbytes(pptr, SCPMO_CNF_SSR_riid, 0, SCPMS_CNF_SSR_riid );
rpackbytes(pptr, SCPMO_CNF_SSR_label_fmt, 0, 21 ); //reserved octets set to 0 all
if (GCT_send(msg_buff_ptr->hdr.dst, &msg_buff_ptr->hdr) != 0)
{
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
printf("message send error!");
relm(&msg_buff_ptr->hdr);
}
/**************************** configure SCCP subsystem resource RSS parameters *********************************************/
msg_buff_ptr = getm(SCP_MSG_CNF_SSR, 0, 0, SCPML_CNF_SSR);
msg_buff_ptr->hdr.src = 0x3d;
msg_buff_ptr->hdr.dst = 0x33;
msg_buff_ptr->hdr.rsp_req = 0x2000;
msg_buff_ptr->hdr.id = 3;
pptr = get_param(msg_buff_ptr);
memset(pptr, 0, msg_buff_ptr->len);
rpackbytes(pptr, SCPMO_CNF_SSR_cnf_ver , 0, SCPMS_CNF_SSR_cnf_ver );
rpackbytes(pptr, SCPMO_CNF_SSR_ssr_type, SCP_SSRT_RSS , SCPMS_CNF_SSR_ssr_type );
rpackbytes(pptr, SCPMO_CNF_SSR_module_id, 0, SCPMS_CNF_SSR_module_id );
rpackbytes(pptr, SCPMO_CNF_SSR_mult_ind, 0, SCPMS_CNF_SSR_mult_ind );
rpackbytes(pptr, SCPMO_CNF_SSR_spc, 14140, SCPMS_CNF_SSR_spc ); /*SSF GT*/
rpackbytes(pptr, SCPMO_CNF_SSR_ssn, 0x92, SCPMS_CNF_SSR_ssn );
rpackbytes(pptr, SCPMO_CNF_SSR_mgmt_id, 0xef, SCPMS_CNF_SSR_mgmt_id );
rpackbytes(pptr, SCPMO_CNF_SSR_ssr_flags, 0, SCPMS_CNF_SSR_ssr_flags );
rpackbytes(pptr, SCPMO_CNF_SSR_pc_mask, 0, SCPMS_CNF_SSR_pc_mask );
rpackbytes(pptr, SCPMO_CNF_SSR_sio, 0, SCPMS_CNF_SSR_sio );
rpackbytes(pptr, SCPMO_CNF_SSR_riid, 0, SCPMS_CNF_SSR_riid );
rpackbytes(pptr, SCPMO_CNF_SSR_label_fmt, 0, 21 ); //reserved octets set to 0 all
if (GCT_send(msg_buff_ptr->hdr.dst, &msg_buff_ptr->hdr) != 0)
{
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
printf("message send error!");
relm(&msg_buff_ptr->hdr);
}
/**************************** configure SCCP subsystem concerned resource parameters *********************************************/
msg_buff_ptr = getm(SCP_MSG_ADD_CONC, 0, 0, SCPML_ADD_CONC);
msg_buff_ptr->hdr.src = 0x3d;
msg_buff_ptr->hdr.dst = SCP_TASK_ID;
msg_buff_ptr->hdr.rsp_req = 0x2000;
msg_buff_ptr->hdr.id = 0;
pptr = get_param(msg_buff_ptr);
memset(pptr, 0, msg_buff_ptr->len);
rpackbytes(pptr, SCPMO_ADD_CONC_cnf_ver, 0 ,SCPMS_ADD_CONC_cnf_ver);
rpackbytes(pptr, SCPMO_ADD_CONC_ssr_type, SCP_SSRT_LSS ,SCPMS_ADD_CONC_ssr_type);
rpackbytes(pptr, SCPMO_ADD_CONC_ssr_spc, 14100 ,SCPMS_ADD_CONC_ssr_spc); /*SCP*/
rpackbytes(pptr, SCPMO_ADD_CONC_ssr_ssn, 0x92 ,SCPMS_ADD_CONC_ssr_ssn);
rpackbytes(pptr, SCPMO_ADD_CONC_conc_type, SCP_SSRT_RSP ,SCPMS_ADD_CONC_conc_type);
rpackbytes(pptr, SCPMO_ADD_CONC_conc_spc, 14140 ,SCPMS_ADD_CONC_conc_spc); /*SSF*/
rpackbytes(pptr, SCPMO_ADD_CONC_conc_ssn, 0 ,SCPMS_ADD_CONC_conc_ssn);
rpackbytes(pptr, SCPMO_ADD_CONC_reserved, 0 ,SCPMS_ADD_CONC_reserved);
if (GCT_send(msg_buff_ptr->hdr.dst, &msg_buff_ptr->hdr) != 0)
{
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
printf("message send error!");
relm(&msg_buff_ptr->hdr);
}
/**************SSN allowed**************************/
// msg_tcap = getm(SCP_MSG_SCMG_REQ, 0, 0, 8);
//
// msg_tcap->hdr.src = 0x3d;
// msg_tcap->hdr.dst = SCP_TASK_ID;
// msg_tcap->hdr.id = 0x92;
// msg_tcap->hdr.rsp_req = 0x2000;
// pptr = get_param(msg_tcap);
// memset(pptr, 0, msg_tcap->len);
//TCPMO_CONFIG_V1_cnf_ver
// rpackbytes(pptr, 0, 1, 1);
// rpackbytes(pptr, 1, 1, 1 );
// if (GCT_send(msg_tcap->hdr.dst, &msg_tcap->hdr) != 0)
// {
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
// printf("message send error!");
// relm(&msg_tcap->hdr);
// }
/**************SSN allowed**************************/
// msg_tcap = getm(SCP_MSG_SCMG_REQ, 0, 0, 8);
// msg_tcap->hdr.src = 0x3d;
// msg_tcap->hdr.dst = SCP_TASK_ID;
// msg_tcap->hdr.id = 0x01;
// msg_tcap->hdr.rsp_req = 0x2000;
// pptr = get_param(msg_tcap);
// memset(pptr, 0, msg_tcap->len);
//TCPMO_CONFIG_V1_cnf_ver
// rpackbytes(pptr, 0, 1, 1);
// rpackbytes(pptr, 1, 1, 1 );
// if (GCT_send(msg_tcap->hdr.dst, &msg_tcap->hdr) != 0)
// {
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
// printf("message send error!");
// relm(&msg_tcap->hdr);
// }
/************************************/
/**************SSN allowed**************************/
// msg_tcap = getm(SCP_MSG_SCMG_REQ, 0, 0, 8);
//
// msg_tcap->hdr.src = 0x3d;
//msg_tcap->hdr.dst = SCP_TASK_ID;
//msg_tcap->hdr.id = 0x92;
//pptr = get_param(msg_tcap);
//memset(pptr, 0, msg_tcap->len);
//TCPMO_CONFIG_V1_cnf_ver
//rpackbytes(pptr, 0, 1, 1);
//rpackbytes(pptr, 1, 1, 1 );
//if (GCT_send(msg_tcap->hdr.dst, &msg_tcap->hdr) != 0)
// {
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.
*/
// printf("message send error!");
// relm(&msg_tcap->hdr);
// }
/*******************************************/
/**********************INAP TRACE ********/
/*msg_tcap = getm(INAP_MSG_TRACE_MASK , 0, 0, INAPML_TRACE_MASK );
msg_tcap->hdr.src = 0x3d;
msg_tcap->hdr.dst = INAP_TASK_ID;
//msg_tcap->hdr.id = 0x21;
pptr = get_param(msg_tcap);
memset(pptr, 0, msg_tcap->len);
rpackbytes(pptr, INAPMO_TRACE_MASK_op_evt_mask , 15, INAPMS_TRACE_MASK_op_evt_mask );
rpackbytes(pptr, INAPMO_TRACE_MASK_ip_evt_mask , 15 , INAPMS_TRACE_MASK_ip_evt_mask );
rpackbytes(pptr, INAPMO_TRACE_MASK_non_prim_mask , 127 , INAPMS_TRACE_MASK_non_prim_mask );
if (GCT_send(msg_tcap->hdr.dst, &msg_tcap->hdr) != 0)
{
printf("message send error!");
relm(&msg_tcap->hdr);
}*/
/**********************************************************************************************/
/**************************** configure SCCP GT translation ******************************************************/
//local SCCP gt translation -- this SCCP GT translation need to transfer IDP to INTU application
//when remove this translation -- IDP component doesn't transferred to INTU binary
msg_buff_ptr = getm(SCP_MSG_GTT_ADD, 0, 0, 30+1 );
//commerc
// unsigned char SCP_SCCP_GT_address[] = {0x08, 0x0b, 0x12, 0x92, 0x00, 0x11, 0x04, 0x97, 0x05, 0x66, 0x15, 0x20, 0x05};
//testIN GT 79506651002
//target address
unsigned char SCP_SCCP_GT_address[] = {0x08, 0x0b, 0x12, 0x92, 0x00, 0x11, 0x04, 0x97, 0x05, 0x66, 0x15, 0x00, 0x02};
//commerc SPc where GT should be routed 27 37 = 14119
// unsigned char SCP_SCCP_destination_scp[] = {0x09, 0x0c, 0x11, 0x27, 0x37, 0x00, 0x11, 0x04, 0x97, 0x05, 0x66, 0x15, 0x20, 0x05};
//test IN SPc where GT should be routed 14 37 = 14100 and also shoul use SCP GT
unsigned char SCP_SCCP_destination_scp[] = {0x09, 0x0c, 0x11, 0x14, 0x37, 0x00, 0x11, 0x04, 0x97, 0x05, 0x66, 0x15, 0x00, 0x02};
unsigned char SCP_GT_MASK[] = {0x1c, 0x01, 0x00};
msg_buff_ptr->hdr.src = 0x3d;
msg_buff_ptr->hdr.dst = SCP_TASK_ID;
msg_buff_ptr->hdr.id = 0;
msg_buff_ptr->hdr.rsp_req = 0x2000;
pptr = get_param(msg_buff_ptr);
memset(pptr, 0, msg_buff_ptr->len);
memcpy(pptr, SCP_SCCP_GT_address, 13);
memcpy(pptr+13, SCP_SCCP_destination_scp, 14);
memcpy(pptr+13+14, SCP_GT_MASK, 3);
if (GCT_send(msg_buff_ptr->hdr.dst, &msg_buff_ptr->hdr) != 0)
{
/*
* GCT_send() has failed.
* Sending process retains ownerships of the MSG.
* Release the MSG.