init ems server code
This commit is contained in:
99
plat/isup/Makefile
Normal file
99
plat/isup/Makefile
Normal file
@@ -0,0 +1,99 @@
|
||||
|
||||
##----------------------------------------------------------##
|
||||
## ##
|
||||
## Universal Makefile for module template : V1.6.3 ##
|
||||
## ##
|
||||
## Created : Wei Liu 07/04/11 ##
|
||||
## Revision: [Last]Wei Liu 07/07/07 ##
|
||||
## ##
|
||||
##----------------------------------------------------------##
|
||||
|
||||
##---------------------------------------------------------------------##
|
||||
##--------------------------------------
|
||||
##
|
||||
## Project correlation(Customer define)
|
||||
##
|
||||
##--------------------------------------
|
||||
|
||||
## MODULE= [Module Name]
|
||||
## TYPE = app/plat => Module Type
|
||||
|
||||
## DBUG_FLAGS_ADD = [Module Define Gcc Flags for Debug ]
|
||||
## DBUG_FLAGS_ADD = [Module Define Gcc Flags for Release]
|
||||
|
||||
## BUILD = lib/exef => Output file format
|
||||
## CFG = debug/release => Build Configuration
|
||||
|
||||
## SRC_PATH = [Source file path]
|
||||
## INC_PATH = [Include file path]
|
||||
## APP_PATH = [App Module path]
|
||||
## PLT_PATH = [Plat Module path]
|
||||
|
||||
## PLT_LIB = [Needed plat lib for Link] => just for test or wxc2main
|
||||
## APP_LIB = [Needed app lib for Link] => just for test or wxc2main
|
||||
## LIB_ADD = [Needed Extend lib for Link] => just for test or wxc2main
|
||||
|
||||
## PLT_LIB e.g. = haepub fsm mng proto kernel aif mgc mgcp sip rtp \
|
||||
## 8ecp bicc smpp xapp tcap mtp3 m2ua \
|
||||
## snmp iptrans debug sccp public
|
||||
##
|
||||
## APP_LIB e.g. = msc vlr ssf hlr ae pps mnp smsc vms aas
|
||||
## LIB_ADD e.g. = -liba3a8 -lm
|
||||
|
||||
## OBJ_ADD = [Extend third party object files needed]
|
||||
## TEST_OBJ_PATH = [module object files Path for test ] => just for test
|
||||
##---------------------------------------------------------------------##
|
||||
|
||||
MODULE = isup
|
||||
TYPE = plat
|
||||
|
||||
DBUG_FLAGS_ADD =
|
||||
RELS_FLAGS_ADD =
|
||||
|
||||
##Default commonly as below
|
||||
|
||||
BUILD = lib
|
||||
CFG = debug
|
||||
|
||||
|
||||
PLT_LIB =
|
||||
|
||||
APP_LIB =
|
||||
LIB_ADD =
|
||||
|
||||
SRC_PATH = ./src
|
||||
INC_PATH = ./src/include
|
||||
PLT_PATH = ../../plat
|
||||
APP_PATH = ../../mss
|
||||
|
||||
OBJ_ADD =
|
||||
TEST_OBJ_PATH =
|
||||
|
||||
PREPROC_CMD =
|
||||
POSTPROC_CMD =
|
||||
|
||||
##---------------------------------------------------------------------##
|
||||
##--------------------------------------
|
||||
##
|
||||
## Make configuration(Customer define)
|
||||
##
|
||||
##--------------------------------------
|
||||
|
||||
## CCFLAG_SWITCH = on/off => gcc flag show on/off
|
||||
## COVER_NEED = yes/no => PTF cover report needed
|
||||
## COVER_REPORT_PATH = [path ] => PTF cover report path
|
||||
|
||||
CCFLAG_SWITCH = off
|
||||
COVER_NEED = no
|
||||
COVER_REPORT_PATH = ./output
|
||||
MAKE_INCLUDE = $(HOME)/ems.git/include
|
||||
|
||||
##---------------------------------------------------------------------##
|
||||
|
||||
|
||||
##--------------------------------------
|
||||
##
|
||||
## include makefile.rules (Do not change)
|
||||
##
|
||||
##--------------------------------------
|
||||
include $(MAKE_INCLUDE)/Makefile.rules
|
||||
BIN
plat/isup/doc/ISUP_R9V0_01P07.doc
Normal file
BIN
plat/isup/doc/ISUP_R9V0_01P07.doc
Normal file
Binary file not shown.
BIN
plat/isup/doc/ISUP_R9V0_01P08.doc
Normal file
BIN
plat/isup/doc/ISUP_R9V0_01P08.doc
Normal file
Binary file not shown.
BIN
plat/isup/doc/ISUP_R9V0_01P8.doc
Normal file
BIN
plat/isup/doc/ISUP_R9V0_01P8.doc
Normal file
Binary file not shown.
BIN
plat/isup/doc/ISUP_R9V0_02P01.doc
Normal file
BIN
plat/isup/doc/ISUP_R9V0_02P01.doc
Normal file
Binary file not shown.
BIN
plat/isup/doc/ISUP_R9V0_02P02.doc
Normal file
BIN
plat/isup/doc/ISUP_R9V0_02P02.doc
Normal file
Binary file not shown.
BIN
plat/isup/doc/ISUP_R9V0_02P03-6.doc
Normal file
BIN
plat/isup/doc/ISUP_R9V0_02P03-6.doc
Normal file
Binary file not shown.
BIN
plat/isup/doc/ISUP_R9V0_02P07.doc
Normal file
BIN
plat/isup/doc/ISUP_R9V0_02P07.doc
Normal file
Binary file not shown.
BIN
plat/isup/doc/ISUP_R9V0_02P1.doc
Normal file
BIN
plat/isup/doc/ISUP_R9V0_02P1.doc
Normal file
Binary file not shown.
19
plat/isup/src/include/inc.h
Normal file
19
plat/isup/src/include/inc.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/*=========================================*/
|
||||
/* */
|
||||
/* */
|
||||
/* Author: Zane Yi */
|
||||
/* Date: 2007.02.01 */
|
||||
/* */
|
||||
/*=========================================*/
|
||||
|
||||
#ifndef _ISUPINC_H_
|
||||
#define _ISUPINC_H_
|
||||
|
||||
#include "../../../mtp3/src/include/mtp3.h"
|
||||
#include "../../../../plat/public/src/include/license_id.h"
|
||||
|
||||
extern int wxc2_get_license(int functionID);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
274
plat/isup/src/include/isup_const.h
Normal file
274
plat/isup/src/include/isup_const.h
Normal file
@@ -0,0 +1,274 @@
|
||||
/*=========================================*/
|
||||
/* */
|
||||
/* */
|
||||
/* Author: Zane Yi */
|
||||
/* Date: 2007.02.01 */
|
||||
/* */
|
||||
/*=========================================*/
|
||||
#ifndef _ISUPCONST_H_
|
||||
#define _ISUPCONST_H_
|
||||
|
||||
//Protocol discriminator
|
||||
#define ISUP_SI 0x05
|
||||
|
||||
|
||||
//block
|
||||
/************************************/
|
||||
#define M_LOCAL_BLOCK 0x01
|
||||
#define M_REMOTE_BLOCK 0x02
|
||||
|
||||
/************************************/
|
||||
|
||||
//SUS
|
||||
/************************************/
|
||||
#define ISUP_ORIG_SUSPEND 0x01
|
||||
#define ISUP_TERM_SUSPEND 0x02
|
||||
|
||||
/************************************/
|
||||
|
||||
//call state
|
||||
#define IDLE_FLAG 0x00
|
||||
#define CALLIN_FLAG 0x01
|
||||
#define CALLOUT_FLAG 0x02
|
||||
#define START_RESET 0xFF
|
||||
|
||||
|
||||
//timer flag
|
||||
/************************************/
|
||||
#define BLS_FLAG 0x04
|
||||
#define BLR_FLAG 0x08
|
||||
#define MGBS_FLAG 0x10
|
||||
#define MGBR_FLAG 0x20
|
||||
#define CRS_FLAG 0x40
|
||||
#define CRR_FLAG 0x80
|
||||
#define CGRS_FLAG 0x100
|
||||
#define CGRR_FLAG 0x200
|
||||
/************************************/
|
||||
|
||||
//state
|
||||
/************************************/
|
||||
#define CPCI_IDLE 0
|
||||
#define CPCI_WAIT_CONTINUITY 1
|
||||
#define CPCI_WAIT_ACM 2
|
||||
#define CPCI_WAIT_ANM 3
|
||||
#define CPCI_ANSWERED 4
|
||||
#define CPCI_SUSPENDED 5
|
||||
#define CPCI_WAIT_RLC 6
|
||||
#define CPCI_WAIT_REL_COMP 7
|
||||
#define CPCI_WAIT_RESET 8
|
||||
#define CPCI_WAIT_GROUP_RESET 9
|
||||
/************************************/
|
||||
#define CPCO_IDLE 0
|
||||
#define CPCO_WAIT_CONTINUITY 1
|
||||
#define CPCO_WAIT_ACM 2
|
||||
#define CPCO_WAIT_ANM 3
|
||||
#define CPCO_ANSWERED 4
|
||||
#define CPCO_SUSPENDED 5
|
||||
#define CPCO_WAIT_RLC 6
|
||||
#define CPCO_WAIT_REL_COMP 7
|
||||
#define CPCO_WAIT_RESET 8
|
||||
#define CPCO_WAIT_GROUP_RESET 9
|
||||
/************************************/
|
||||
#define BLS_IDLE 0
|
||||
#define BLS_WAIT_BLA 1
|
||||
#define BLS_LOCAL_LOCKED 2
|
||||
#define BLS_WAIT_UBA 3
|
||||
/************************************/
|
||||
#define BLR_IDLE 0
|
||||
#define BLR_WAIT_BLOCKING_RESP 1
|
||||
#define BLR_REMOTE_LOCKED 2
|
||||
#define BLR_WAIT_UNBLOCKING_RESP 3
|
||||
/************************************/
|
||||
#define MGBS_IDLE 0
|
||||
#define MGBS_WAIT_CGBA 1
|
||||
#define MGBS_WAIT_CGUA 2
|
||||
/************************************/
|
||||
#define MGBR_IDLE 0
|
||||
#define MGBR_WAIT_BLOCKING_RESP 1
|
||||
#define MGBR_WAIT_UNBLOCKING_RESP 2
|
||||
/************************************/
|
||||
#define CRS_IDLE 0
|
||||
#define CRS_WAIT_REL 1
|
||||
/************************************/
|
||||
#define CRR_IDLE 0
|
||||
#define CRR_WAIT_RESPONSE 1
|
||||
/************************************/
|
||||
#define CGRS_IDLE 0
|
||||
#define CGRS_WAIT_GRA 1
|
||||
/************************************/
|
||||
#define CGRR_IDLE 0
|
||||
#define CGRR_WAIT_GROUP_RESET_COMP 1
|
||||
/************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
//********************************************/
|
||||
//****** ISUP Internal Command
|
||||
//********************************************/
|
||||
#define CMD_UNBLO 0x01
|
||||
#define CMD_BLO 0x02
|
||||
#define CMD_RESET 0x03
|
||||
#define CMD_RESET_COMP 0x04
|
||||
|
||||
|
||||
#define SI_CPCI 0x10
|
||||
#define SI_CPCO 0x20
|
||||
#define SI_BLS 0x30
|
||||
#define SI_BLR 0x40
|
||||
#define SI_MGBR 0x50
|
||||
#define SI_MGBS 0x60
|
||||
#define SI_CRS 0x70
|
||||
#define SI_CRR 0x80
|
||||
#define SI_CGRS 0x90
|
||||
#define SI_CGRR 0xA0
|
||||
|
||||
|
||||
/********************************************/
|
||||
/****** ISUP Event/Primitive Definition *****/
|
||||
/********************************************/
|
||||
//Primitive
|
||||
#define ISUP_SETUP_REQ 0x11
|
||||
#define ISUP_SETUP_IND 0x21
|
||||
#define ISUP_SETUP_RSP 0x31
|
||||
#define ISUP_SETUP_CNF 0x41
|
||||
|
||||
#define ISUP_RELEASE_REQ 0x12
|
||||
#define ISUP_RELEASE_IND 0x22
|
||||
#define ISUP_RELEASE_RSP 0x32
|
||||
#define ISUP_RELEASE_CNF 0x42
|
||||
|
||||
#define ISUP_ALERT_REQ 0x13
|
||||
#define ISUP_ALERT_IND 0x23
|
||||
#define ISUP_INFO_REQ 0x33
|
||||
#define ISUP_INFO_IND 0x43
|
||||
#define ISUP_PROG_REQ 0x53
|
||||
#define ISUP_PROG_IND 0x63
|
||||
#define ISUP_SUSPEND_REQ 0x73
|
||||
#define ISUP_SUSPEND_IND 0x83
|
||||
#define ISUP_RESUME_REQ 0x93
|
||||
#define ISUP_RESUME_IND 0xa3
|
||||
|
||||
#define ISUP_BLOCK_REQ 0x14
|
||||
#define ISUP_BLOCK_IND 0x24
|
||||
#define ISUP_BLOCK_RSP 0x34
|
||||
#define ISUP_BLOCK_CNF 0x44
|
||||
#define ISUP_UNBLOCK_REQ 0x54
|
||||
#define ISUP_UNBLOCK_IND 0x64
|
||||
#define ISUP_UNBLOCK_RSP 0x74
|
||||
#define ISUP_UNBLOCK_CNF 0x84
|
||||
#define ISUP_RESET_REQ 0x94
|
||||
#define ISUP_RESET_IND 0xa4
|
||||
#define ISUP_RESET_RSP 0xb4
|
||||
#define ISUP_RESET_CNF 0xc4
|
||||
|
||||
#define ISUP_DATA_IND 0x0f
|
||||
|
||||
#define ISUP_REATTEMPT_IND 0x1f
|
||||
#define ISUP_FAILURE_IND 0x2f
|
||||
#define ISUP_MAINTENANCE_IND 0x3f
|
||||
#define ISUP_STARTRESET_IND 0x4f
|
||||
|
||||
#define ISUP_STOP_REQ 0xef
|
||||
#define ISUP_STOP_CNF 0xff
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Event
|
||||
#define EN_NONE 0x00
|
||||
#define EN_ANM 0x01
|
||||
#define EN_CON 0x02
|
||||
#define EN_GROUP 0x03
|
||||
|
||||
#define EN_CLEAR_BLR 0x04
|
||||
|
||||
#define EN_T5_TIMEOUT 0x10
|
||||
#define EN_T13_TIMEOUT 0x11
|
||||
#define EN_T15_TIMEOUT 0x12
|
||||
#define EN_T19_TIMEOUT 0x13
|
||||
#define EN_T21_TIMEOUT 0x14
|
||||
|
||||
/********************************************/
|
||||
/****** ISUP Timer Definition (s) *****/
|
||||
/********************************************/
|
||||
/*
|
||||
T1 15-60 seconds When release message is sent At the receipt of release complete message Retransmit release message and start timer T1
|
||||
T2 3 minutes When controlling exchange receives suspend (user) message At the receipt of resume (user) message at controlling exchange Initiate release procedure
|
||||
T3 2 minutes At receipt of overload message On expiry Initiate release procedure
|
||||
T4 5-15 minutes At receipt of MTP-STATUS primitive with the cause "remote user unavailable" On expiry, or at receipt of user part available message (or any other) Send user part test message. Start T4
|
||||
T5 5-15 minutes When initial release message is sent At receipt of release complete message Send reset circuit message, alert maintenance personnel and remove the circuit from service, stop T1, start T17. Procedure continues until maintenance intervention occurs
|
||||
T6 Covered in Q.118 When controlling exchange receives suspend (network) At the receipt of resume (network) message or release message Initiate release procedure
|
||||
T7 20-30 seconds When the latest address message is sent When the condition for normal release of address and routing information is met (receipt of ACM, CON messages) Release all equipment and connection(Send release message)
|
||||
T8 10-15 seconds When an exchange receives initial address message requiring continuity check on this circuit or indicates that continuity check has been performed on a previous circuit At receipt of continuity message Release all equipment and connection into the network(Send release message)
|
||||
T9 Interval specifiedin Q.118 When national controlling or outgoing international exchange receives ACM At the receipt of answer Release connection send back release message
|
||||
T10 4-6 seconds When last digit is received in interworking situations At the receipt of fresh information Send address complete message
|
||||
T11 15-20 seconds When latest address message is received in interworking situations When ACM is sent Send address complete message
|
||||
T12 15-60 seconds When blocking message is sent At receipt of blocking acknowledgement Retransmit blocking message and start T12
|
||||
T13 5-15 minutes When initial blocking message is sent At receipt of blocking acknowledgement Transmit blocking message and alert maintenance personnel, start T13, stop T12. Procedure continues until maintenance intervention occurs
|
||||
T14 15-60 seconds When unblocking message is sent At receipt of unblocking acknowledgement Retransmit unblocking message and start T14
|
||||
T15 5-15 minutes When initial unblocking message is sent At receipt of unblocking acknowledgement Retransmit unblocking message alert maintenance personnel, start T15 and stop T14. Procedure continues until maintenance intervention occurs
|
||||
T16 15-60 seconds When reset circuit message is sent not due to expiry of T5 At the receipt of the acknowledgement (RLC message) Retransmit reset circuit message and start T16
|
||||
T17 5-15 minutes When initial reset circuit messageis sent At the receipt of the acknowledgement Alert maintenance personnel, retransmit reset circuit message, start T17, stop T16. Procedure continues until maintenance intervention occurs
|
||||
T18 15-60 seconds When group blocking message is sent At receipt of group blocking acknowledgement Retransmit group blocking message and start T18
|
||||
T19 5-15 minutes When initial group blocking message is sent At receipt of group blocking acknowledgement Retransmit group blocking message, alert maintenance personnel, start T19, stop T18. Procedure continues until maintenance intervention occurs
|
||||
T20 15-60 seconds When group unblocking message is sent At receipt of group unblocking acknowledgement Retransmit group unblocking message and start T20
|
||||
T21 5-15 minutes When initial group unblocking message is sent At receipt of group unblocking acknowledgement Retransmit group unblocking message, alert maintenance personnel, start T21, stop T20. Procedure continues until maintenance intervention occurs
|
||||
T22 15-60 seconds When circuit group reset message is sent At the receipt of the acknowledgement Retransmit circuit group reset message and start T22
|
||||
T23 5-15 minutes When initial circuit group reset message is sent At the receipt of the acknowledgement Alert maintenance personnel and start T23, retransmit circuit group reset message, stop T22. Procedure continues until maintenance intervention occurs
|
||||
T24 < 2 seconds When check tone is sent At the receipt of backward check tone Send continuity message with failure indication and:a) start T25 if continuity check was asked in IAM and make automatic repeat attempt; orb) start T26 if continuity check was asked in CCR
|
||||
T25 1-10 seconds When initial continuity check failure is detected - Send CCR message and repeat continuity check
|
||||
T26 1-3 minutes When second or subsequent continuity check failure is detected - Send CCR message and repeat continuity check
|
||||
T27 4 minutes When continuity check failure indication is received At receipt of continuity check request message Send reset circuit message. Start T16 and T17
|
||||
T28 10 seconds When send CQM At receipt of CQR Alert maintenance
|
||||
T29 300-600 ms Congestion indication received when T29 not running - New congestion indication will be taken into account
|
||||
T30 5-10 seconds Congestion indication received when T29 not running - Restore traffic by one step if not yet at full load and start T30
|
||||
T31 > 6 minutes Release of ISDN User Part signalling connection based on CO SCCP On expiry Call reference reusable
|
||||
T32 3-5 seconds When response to request of end-to-end connection establishment is sent At receipt of first end?to-end message from the remote end End-to-end message allowed to be sent
|
||||
T33 12-15 seconds When send INR On receipt of INF Release call, alert maintenance personnel
|
||||
T34 2-4 seconds When indication of a segmented message is received on an IAM, ACM, CPG, ANM or CON message At receipt of a segmentation message Proceed with call
|
||||
T35 15-20 seconds At receipt of the latest digit (< > ST) and before the minimum or fixed number of digits have been received At receipt of ST or when the minimum or fixed number of digits have been received Send release message (cause 28)
|
||||
T36 10-15 seconds When transit or incoming international exchange receives continuity check request message At receipt of continuity or release message Release all equipment, send reset circuit message. Start T16 and T17
|
||||
T37 2-4 seconds When request for an echo control device is sent to another exchange On expiry or when an indication of a half echo control device being included/not included is known Half echo control device is included or enabled
|
||||
T38 Interval specified in Q.118 When the incoming international exchange sends to the preceding exchange a suspend (network) message At receipt of resume (network) or release message Send release message (cause 102)
|
||||
T39 Interval specified in Q.730 When an MCID request is sent At receipt of an MCID response Call continues
|
||||
*/
|
||||
#define ISUP_T1 15
|
||||
#define ISUP_T5 300
|
||||
#define ISUP_T7 30
|
||||
#define ISUP_T8 10
|
||||
#define ISUP_T9 120
|
||||
#define ISUP_T12 15
|
||||
#define ISUP_T13 300
|
||||
#define ISUP_T14 15
|
||||
#define ISUP_T15 300
|
||||
#define ISUP_T16 15
|
||||
#define ISUP_T17 300
|
||||
#define ISUP_T18 15
|
||||
#define ISUP_T19 300
|
||||
#define ISUP_T20 15
|
||||
#define ISUP_T21 300
|
||||
#define ISUP_T22 15
|
||||
#define ISUP_T23 300
|
||||
#define ISUP_T24 1
|
||||
#define ISUP_T25 1
|
||||
#define ISUP_T26 60
|
||||
#define ISUP_T27 240
|
||||
#define ISUP_T34 2
|
||||
#define ISUP_T36 10
|
||||
#define ISUP_T37 2
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
45
plat/isup/src/include/isup_debug.h
Normal file
45
plat/isup/src/include/isup_debug.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/*=========================================*/
|
||||
/* */
|
||||
/* */
|
||||
/* Author: Zane Yi */
|
||||
/* Date: 2007.02.01 */
|
||||
/* */
|
||||
/*=========================================*/
|
||||
|
||||
#ifndef _ISUPDEBUG_H_
|
||||
#define _ISUPDEBUG_H_
|
||||
|
||||
#include "inc.h"
|
||||
#include "../../../debug/src/include/debug.h"
|
||||
|
||||
/*Color Set */
|
||||
#define COL_WHITE 37
|
||||
#define COL_RED 31
|
||||
#define COL_YELLOW 33
|
||||
#define COL_GREEN 32
|
||||
#define COL_BLUE 34
|
||||
#define COL_BROWN 35
|
||||
#define COL_MEGEN 36
|
||||
#define COL_GRAY 38
|
||||
#define COL_HI_WHI 58
|
||||
#define COL_HI_RED 39
|
||||
#define COL_HI_YEL 52
|
||||
#define COL_HI_GRE 51
|
||||
#define COL_HI_BLU 53
|
||||
#define COL_HI_BRO 54
|
||||
#define COL_HI_MEG 55
|
||||
#define COL_BLACK 30
|
||||
|
||||
#define COL_ESC '\033'
|
||||
|
||||
int isup_debug_init(void);
|
||||
void isup_debug_timer(void);
|
||||
void isup_log_err(u32 pid,const char *fmt, ...);
|
||||
void isup_trace_func(u32 pid,const char *fmt, ...);
|
||||
void monitor_isup_msg(u32 pid,BYTE *head, up_message *msg,BYTE col);
|
||||
void isup_msg_csta(u8 msgtype,u8 flag);
|
||||
void monitor_port_state(u32 cic_val,u32 port);
|
||||
void test_isup_msg(u8 type, u8 flag);
|
||||
|
||||
|
||||
#endif
|
||||
62
plat/isup/src/include/isup_def.h
Normal file
62
plat/isup/src/include/isup_def.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*=========================================*/
|
||||
/* */
|
||||
/* */
|
||||
/* Author: Zane Yi */
|
||||
/* Date: 2007.02.01 */
|
||||
/* */
|
||||
/*=========================================*/
|
||||
#ifndef _ISUPDEF_H_
|
||||
#define _ISUPDEF_H_
|
||||
|
||||
extern ISUP_Resource_Pond isup_db;
|
||||
extern ISUP_Timer_Struct isup_timer_var;
|
||||
extern up_message isup_rv_msg,isup_sd_msg;
|
||||
extern SiAllPdus isup_rv_pdus,isup_sd_pdus;
|
||||
|
||||
/*-----isup_msg.c-------*/
|
||||
extern int isup_mdsc_proc();
|
||||
extern int isup_send_msg(u32 pid, u8 msg_type);
|
||||
|
||||
|
||||
/*-----isup_fsm.c-------*/
|
||||
extern int isup_event_handle(u32 pid, u8 primitive, u8 eventType);
|
||||
|
||||
|
||||
extern void isup_cpc_proc(u32 pid);
|
||||
extern void isup_cpc_timer(u32 pid);
|
||||
|
||||
extern void isup_cpci_proc(u32 pid);
|
||||
extern void isup_cpci_timer(u32 pid);
|
||||
|
||||
extern void isup_cpco_proc(u32 pid);
|
||||
extern void isup_cpco_timer(u32 pid);
|
||||
|
||||
extern void isup_csc_timer(u32 pid);
|
||||
|
||||
extern void isup_bls_proc(u32 pid);
|
||||
extern void isup_bls_timer(u32 pid);
|
||||
|
||||
extern void isup_blr_proc(u32 pid);
|
||||
|
||||
|
||||
extern void isup_mgbr_proc(u32 pid);
|
||||
|
||||
|
||||
extern void isup_mgbs_proc(u32 pid);
|
||||
extern void isup_mgbs_timer(u32 pid);
|
||||
|
||||
extern void isup_crr_proc(u32 pid);
|
||||
|
||||
|
||||
extern void isup_crs_proc(u32 pid);
|
||||
extern void isup_crs_timer(u32 pid);
|
||||
|
||||
extern void isup_cgrr_proc(u32 pid);
|
||||
|
||||
|
||||
extern void isup_cgrs_proc(u32 pid);
|
||||
extern void isup_cgrs_timer(u32 pid);
|
||||
|
||||
extern u8 isup_check_crs_waiting(u32 pid);
|
||||
|
||||
#endif
|
||||
111
plat/isup/src/include/isup_if.h
Normal file
111
plat/isup/src/include/isup_if.h
Normal file
@@ -0,0 +1,111 @@
|
||||
//=========================================
|
||||
//
|
||||
//
|
||||
// Author: Zane Yi
|
||||
// Date: 2007.02.01
|
||||
//
|
||||
//=========================================
|
||||
#ifndef _ISUPIF_H_
|
||||
#define _ISUPIF_H_
|
||||
|
||||
#include "../../../pal/pal.h"
|
||||
#include "isup_const.h"
|
||||
#include "isup_public.h"
|
||||
#include "isup_msg.h"
|
||||
|
||||
//*****************************************************
|
||||
// ISUP Module parameter structure
|
||||
//*****************************************************
|
||||
|
||||
typedef int f_isup_setup_ind(Pst *pst, const SiPduIAM *ptr, u8 *raw_data, u8 len);
|
||||
typedef int f_isup_setup_anm_cnf(Pst *pst, const SiPduANM *ptr_anm, u8 *raw_data, u8 len);
|
||||
typedef int f_isup_setup_con_cnf(Pst *pst, const SiPduCON *ptr_con, u8 *raw_data, u8 len);
|
||||
typedef int f_isup_release_ind(Pst *pst, const SiPduREL *ptr, u8 *raw_data, u8 len );
|
||||
typedef int f_isup_release_cnf(Pst *pst, const SiPduRLC *ptr, u8 *raw_data, u8 len );
|
||||
typedef int f_isup_alert_ind(Pst *pst, const SiPduACM *ptr, u8 *raw_data, u8 len );
|
||||
typedef int f_isup_info_ind(Pst *pst, const SiPduSAM *ptr, u8 *raw_data, u8 len );
|
||||
typedef int f_isup_prog_ind(Pst *pst, const SiPduCPG *ptr, u8 *raw_data, u8 len );
|
||||
typedef int f_isup_suspend_ind(Pst *pst, const SiPduSUS *ptr, u8 *raw_data, u8 len );
|
||||
typedef int f_isup_resume_ind(Pst *pst, const SiPduRES *ptr, u8 *raw_data, u8 len );
|
||||
typedef int f_isup_block_ind(Pst *pst, const SiPduCGB *ptr);
|
||||
typedef int f_isup_block_cnf(Pst *pst, const SiPduCGBA *ptr);
|
||||
typedef int f_isup_unblock_ind(Pst *pst, const SiPduCGU *ptr);
|
||||
typedef int f_isup_unblock_cnf(Pst *pst, const SiPduCGUA *ptr);
|
||||
typedef int f_isup_reset_ind(Pst *pst, const SiPduGRS *ptr);
|
||||
typedef int f_isup_reset_cnf(Pst *pst, const SiPduGRA *ptr);
|
||||
typedef int f_isup_local(Pst *pst);
|
||||
typedef int f_isup_maintance_ind(Pst *pst,u8 eventType);
|
||||
typedef int f_isup_data_ind(Pst *pst, u8 msgType, const SiAllPdus *ptr, u8 *raw_data, u8 len);
|
||||
|
||||
typedef struct _eventhandle_struct
|
||||
{
|
||||
f_isup_setup_ind *h_isup_setup_ind;
|
||||
f_isup_setup_anm_cnf *h_isup_setup_anm_cnf;
|
||||
f_isup_setup_con_cnf *h_isup_setup_con_cnf;
|
||||
f_isup_release_ind *h_isup_release_ind;
|
||||
f_isup_release_cnf *h_isup_release_cnf;
|
||||
f_isup_alert_ind *h_isup_alert_ind;
|
||||
f_isup_info_ind *h_isup_info_ind;
|
||||
f_isup_prog_ind *h_isup_prog_ind;
|
||||
f_isup_suspend_ind *h_isup_suspend_ind;
|
||||
f_isup_resume_ind *h_isup_resume_ind;
|
||||
f_isup_block_ind *h_isup_block_ind;
|
||||
f_isup_block_cnf *h_isup_block_cnf;
|
||||
f_isup_unblock_ind *h_isup_unblock_ind;
|
||||
f_isup_unblock_cnf *h_isup_unblock_cnf;
|
||||
f_isup_reset_ind *h_isup_reset_ind;
|
||||
f_isup_reset_cnf *h_isup_reset_cnf;
|
||||
f_isup_local *h_isup_reattempt_ind;
|
||||
f_isup_local *h_isup_failure_ind;
|
||||
f_isup_maintance_ind *h_isup_maintenance_ind;
|
||||
f_isup_local *h_isup_startreset_ind;
|
||||
f_isup_data_ind *h_isup_data_ind;
|
||||
} EventHandle_struct;
|
||||
|
||||
typedef struct _sap_attrib_struct
|
||||
{
|
||||
EventHandle_struct event_handle;
|
||||
}Sap_Attrib_struct;
|
||||
//*****************************************************
|
||||
// ISUP Module interface
|
||||
//*****************************************************
|
||||
|
||||
#define ISUP_CM_OK 1 /* Command request success */
|
||||
#define ISUP_CM_FAILED 0 /* Command request failed */
|
||||
|
||||
//Command
|
||||
extern int isup_setup_req(Pst *pst, SiPduIAM *ptr, u8 *raw_data, u8 len);
|
||||
extern int isup_setup_anm_rsp(Pst *pst, SiPduANM *ptr_anm, u8 *raw_data, u8 len);
|
||||
extern int isup_setup_con_rsp(Pst *pst, SiPduCON *ptr_con, u8 *raw_data, u8 len);
|
||||
extern int isup_release_req(Pst *pst, SiPduREL *ptr, u8 *raw_data, u8 len);
|
||||
extern int isup_release_rsp(Pst *pst, SiPduRLC *ptr, u8 *raw_data, u8 len);
|
||||
extern int isup_alert_req(Pst *pst, SiPduACM *ptr, u8 *raw_data, u8 len);
|
||||
extern int isup_info_req(Pst *pst, SiPduSAM *ptr, u8 *raw_data, u8 len);
|
||||
extern int isup_prog_req(Pst *pst, SiPduCPG *ptr, u8 *raw_data, u8 len);
|
||||
extern int isup_suspend_req(Pst *pst, SiPduSUS *ptr, u8 *raw_data, u8 len);
|
||||
extern int isup_resume_req(Pst *pst, SiPduRES *ptr, u8 *raw_data, u8 len);
|
||||
extern int isup_block_req(Pst *pst, SiPduCGB *ptr );
|
||||
extern int isup_block_rsp(Pst *pst, SiPduCGBA *ptr);
|
||||
extern int isup_unblock_req(Pst *pst, SiPduCGU *ptr );
|
||||
extern int isup_unblock_rsp(Pst *pst, SiPduCGUA *ptr);
|
||||
extern int isup_reset_req(Pst *pst, SiPduGRS *ptr );
|
||||
extern int isup_reset_rsp(Pst *pst, SiPduGRA *ptr);
|
||||
extern int isup_bls_stop_req(Pst *pst);
|
||||
extern int isup_mgbs_stop_req(Pst *pst);
|
||||
extern int isup_crs_stop_req(Pst *pst);
|
||||
extern int isup_cgrs_stop_req(Pst *pst);
|
||||
extern int isup_data_req(Pst *pst, u8 msgType, SiAllPdus *ptr, u8 *raw_data, u8 len);
|
||||
|
||||
//run_mode
|
||||
#define ISUP_SINGLE_MODE 0 /* Single Plat */
|
||||
#define ISUP_DUAL_MODE 1 /* DUAL Plat */
|
||||
|
||||
extern int isup_set_run_mode (u8 run_mode, u32 alter_ip);
|
||||
extern int isup_inquire_cic (u16 cg_id, u32 cic);//return -1/0/1 L3 down/L4 failed/L4 normal
|
||||
|
||||
|
||||
//system interface
|
||||
extern void isup_init(u8 systemID, u32 interval_ms);
|
||||
extern void isup_timer();
|
||||
#endif
|
||||
|
||||
1699
plat/isup/src/include/isup_msg.h
Normal file
1699
plat/isup/src/include/isup_msg.h
Normal file
File diff suppressed because it is too large
Load Diff
49
plat/isup/src/include/isup_public.h
Normal file
49
plat/isup/src/include/isup_public.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*=========================================*/
|
||||
/* */
|
||||
/* */
|
||||
/* Author: Zane Yi */
|
||||
/* Date: 2007.02.01 */
|
||||
/* */
|
||||
/*=========================================*/
|
||||
|
||||
#ifndef _ISUP_PUBLIC_H_
|
||||
#define _ISUP_PUBLIC_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef _T_U8
|
||||
#define _T_U8
|
||||
typedef unsigned char u8;
|
||||
#endif
|
||||
|
||||
#ifndef _T_U16
|
||||
#define _T_U16
|
||||
typedef unsigned short u16;
|
||||
#endif
|
||||
|
||||
#ifndef _T_U32
|
||||
#define _T_U32
|
||||
typedef unsigned int u32;
|
||||
#endif
|
||||
|
||||
#ifndef _T_BYTE
|
||||
#define _T_BYTE
|
||||
typedef unsigned char BYTE;
|
||||
#endif
|
||||
|
||||
#ifndef _T_WORD
|
||||
#define _T_WORD
|
||||
typedef unsigned short WORD;
|
||||
#endif
|
||||
|
||||
#ifndef _T_DWORD
|
||||
#define _T_DWORD
|
||||
typedef unsigned int DWORD;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
138
plat/isup/src/include/isup_struct.h
Normal file
138
plat/isup/src/include/isup_struct.h
Normal file
@@ -0,0 +1,138 @@
|
||||
/*========================================*/
|
||||
/* */
|
||||
/* */
|
||||
/* Author: Zane Yi */
|
||||
/* Date: 2007.02.01 */
|
||||
/* */
|
||||
/*========================================*/
|
||||
#ifndef _ISUPSTRUCT_H_
|
||||
#define _ISUPSTRUCT_H_
|
||||
|
||||
#include "isup_if.h"
|
||||
|
||||
|
||||
//*****************************************************
|
||||
// ISUP Resource Structures
|
||||
//*****************************************************
|
||||
#define ISUP_MAX_SAP 16
|
||||
#define ISUP_MAX_CG 256
|
||||
#define ISUP_MAX_CIRCUIT 256
|
||||
#define ISUP_MAX_PORT 8192 //=ISUP_MAX_CIRCUIT*ISUP_CIRCUIT_CIC
|
||||
|
||||
//#define ISUP_CG_CIRCUIT 32
|
||||
#define ISUP_CIRCUIT_CIC 32
|
||||
|
||||
//#define NAME_LEN 16
|
||||
|
||||
typedef struct _isup_cic_state
|
||||
{
|
||||
u8 call_state;
|
||||
u8 sus_state;
|
||||
u8 blo_state; //bit0:local m-block flag bit1:remote block m-flag
|
||||
} ISUP_CIC_state;
|
||||
|
||||
|
||||
typedef struct _isup_fsm_state
|
||||
{
|
||||
u8 cpc_state;
|
||||
u8 blr_state;
|
||||
u8 bls_state;
|
||||
u8 mgbs_state;
|
||||
u8 mgbr_state;
|
||||
u8 crs_state;
|
||||
u8 crr_state;
|
||||
u8 cgrs_state;
|
||||
u8 cgrr_state;
|
||||
} ISUP_Fsm_state;
|
||||
|
||||
|
||||
typedef struct _isup_port_struct
|
||||
{
|
||||
u8 enable;
|
||||
|
||||
u8 reset_flag;
|
||||
|
||||
u8 gourp_range;
|
||||
u8 status_field[ISUP_STATUS_LEN];
|
||||
|
||||
u8 re_cause;
|
||||
u8 re_location;
|
||||
u8 re_range;
|
||||
u8 re_typeInd;
|
||||
SiRangStat re_rangStat;
|
||||
|
||||
u16 timer_flag;
|
||||
|
||||
u32 w_time;
|
||||
u32 su_proc_id; //for normal call
|
||||
u32 sm_proc_id; //for maintenance
|
||||
|
||||
u8 sprc_cmd;
|
||||
u8 primitive_cmd;
|
||||
u8 internal_cmd;
|
||||
|
||||
ISUP_Fsm_state fsm_state;
|
||||
ISUP_CIC_state cic_state;
|
||||
|
||||
int trace_flag;
|
||||
} ISUP_Port_struct;
|
||||
|
||||
|
||||
typedef struct _isup_attrib_struct
|
||||
{
|
||||
u8 systemID;
|
||||
u8 isup_run_mode;
|
||||
u32 isup_remote_ip;
|
||||
} ISUP_Attrib_struct;
|
||||
|
||||
typedef struct _isup_resource_pond
|
||||
{
|
||||
ISUP_Port_struct port_pond[ISUP_MAX_PORT];
|
||||
ISUP_Attrib_struct attrib;
|
||||
}ISUP_Resource_Pond;
|
||||
|
||||
|
||||
typedef struct _isup_timer_struct {
|
||||
int t1;
|
||||
int t2;
|
||||
int t3;
|
||||
int t4;
|
||||
int t5;
|
||||
int t6;
|
||||
int t7;
|
||||
int t8;
|
||||
int t9;
|
||||
int t12;
|
||||
int t13;
|
||||
int t14;
|
||||
int t15;
|
||||
int t16;
|
||||
int t17;
|
||||
int t18;
|
||||
int t19;
|
||||
int t20;
|
||||
int t21;
|
||||
int t22;
|
||||
int t23;
|
||||
int t24;
|
||||
int t25;
|
||||
int t26;
|
||||
int t27;
|
||||
int t34;
|
||||
int t36;
|
||||
int t37;
|
||||
int t38;
|
||||
} ISUP_Timer_Struct;
|
||||
|
||||
|
||||
typedef struct _isup_msg_csta {
|
||||
u32 rv_iam;
|
||||
u32 sd_iam;
|
||||
u32 rv_acm;
|
||||
u32 sd_acm;
|
||||
u32 rv_rel;
|
||||
u32 sd_rel;
|
||||
u32 rv_rlc;
|
||||
u32 sd_rlc;
|
||||
} ISUP_Msg_Csta;
|
||||
#endif
|
||||
BIN
plat/isup/src/include/vssver2.scc
Normal file
BIN
plat/isup/src/include/vssver2.scc
Normal file
Binary file not shown.
1586
plat/isup/src/isup_debug.c
Normal file
1586
plat/isup/src/isup_debug.c
Normal file
File diff suppressed because it is too large
Load Diff
2602
plat/isup/src/isup_fsm.c
Normal file
2602
plat/isup/src/isup_fsm.c
Normal file
File diff suppressed because it is too large
Load Diff
700
plat/isup/src/isup_if.c
Normal file
700
plat/isup/src/isup_if.c
Normal file
@@ -0,0 +1,700 @@
|
||||
/*=========================================*/
|
||||
/* */
|
||||
/* */
|
||||
/* Author: Zane Yi */
|
||||
/* Date: 2007.02.01 */
|
||||
/* */
|
||||
/*=========================================*/
|
||||
#include "./include/inc.h"
|
||||
#include "./include/isup_if.h"
|
||||
#include "./include/isup_struct.h"
|
||||
#include "./include/isup_debug.h"
|
||||
#include "./include/isup_def.h"
|
||||
#include "./include/isup_const.h"
|
||||
|
||||
up_message isup_rv_msg,isup_sd_msg,isup_raw_msg;
|
||||
SiAllPdus isup_rv_pdus,isup_sd_pdus;
|
||||
ISUP_Timer_Struct isup_timer_var;
|
||||
ISUP_Resource_Pond isup_db;
|
||||
|
||||
extern int check_outbound_route(BYTE ni, long dpc, BYTE sls);//mtp3 interface
|
||||
|
||||
static void timer_init(u32 interval_ms)
|
||||
{
|
||||
memset(&isup_timer_var,0,sizeof(isup_timer_var));
|
||||
isup_timer_var.t1 = ISUP_T1*1000/interval_ms;
|
||||
isup_timer_var.t5 = ISUP_T5*1000/interval_ms;
|
||||
isup_timer_var.t7 = ISUP_T7*1000/interval_ms;
|
||||
isup_timer_var.t8 = ISUP_T8*1000/interval_ms;
|
||||
isup_timer_var.t9 = ISUP_T9*1000/interval_ms;
|
||||
isup_timer_var.t12 = ISUP_T12*1000/interval_ms;
|
||||
isup_timer_var.t13 = ISUP_T13*1000/interval_ms;
|
||||
isup_timer_var.t14 = ISUP_T14*1000/interval_ms;
|
||||
isup_timer_var.t15 = ISUP_T15*1000/interval_ms;
|
||||
isup_timer_var.t16 = ISUP_T16*1000/interval_ms;
|
||||
isup_timer_var.t17 = ISUP_T17*1000/interval_ms;
|
||||
isup_timer_var.t18 = ISUP_T18*1000/interval_ms;
|
||||
isup_timer_var.t19 = ISUP_T19*1000/interval_ms;
|
||||
isup_timer_var.t20 = ISUP_T20*1000/interval_ms;
|
||||
isup_timer_var.t21 = ISUP_T21*1000/interval_ms;
|
||||
isup_timer_var.t22 = ISUP_T22*1000/interval_ms;
|
||||
isup_timer_var.t23 = ISUP_T23*1000/interval_ms;
|
||||
isup_timer_var.t24 = ISUP_T24*1000/interval_ms;
|
||||
isup_timer_var.t25 = ISUP_T25*1000/interval_ms;
|
||||
isup_timer_var.t26 = ISUP_T26*1000/interval_ms;
|
||||
isup_timer_var.t27 = ISUP_T27*1000/interval_ms;
|
||||
isup_timer_var.t34 = ISUP_T34*1000/interval_ms;
|
||||
isup_timer_var.t37 = ISUP_T37*1000/interval_ms;
|
||||
}
|
||||
|
||||
|
||||
static int find_port_by_sap(Pst *pst)
|
||||
{
|
||||
const pal_circuit_struct* circuit_str;
|
||||
|
||||
circuit_str = pal_locate_circuit(pst->cg_id, pst->cic);
|
||||
if(circuit_str == NULL)
|
||||
{
|
||||
isup_log_err(0,"illegal cic value! cg_id=%d,cic=%d\r\n",pst->cg_id,pst->cic);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(isup_db.attrib.isup_run_mode == ISUP_DUAL_MODE &&
|
||||
circuit_str->attrib.plat_id != isup_db.attrib.systemID)
|
||||
{
|
||||
isup_log_err(0,"error!plat_id=%d,systemID=%d,run_mode=%d,cg_id=%d,cic=%d\r\n",
|
||||
circuit_str->attrib.plat_id,
|
||||
isup_db.attrib.systemID,
|
||||
isup_db.attrib.isup_run_mode,
|
||||
pst->cg_id,
|
||||
pst->cic);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pst->sp_proc_id = ISUP_CIRCUIT_CIC*circuit_str->id +
|
||||
(pst->cic - circuit_str->attrib.head_cic);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
//static void isup_check_L3status(void)
|
||||
//{
|
||||
// int i;
|
||||
// for (i = 0; i < ISUP_MAX_CG; i++)
|
||||
// {
|
||||
// if (isup_db.cg_pond[i].enable)
|
||||
// {
|
||||
// if (check_outbound_route((isup_db.cg_pond[i].attrib.network_id & 3), isup_db.cg_pond[i].attrib.dpc, 0) >= 0)
|
||||
// {
|
||||
// //L3 OK
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //L3 Failed
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
void isup_init(u8 systemID, u32 interval_ms)
|
||||
{
|
||||
u32 stack_size;
|
||||
if (interval_ms==0)
|
||||
interval_ms = 10;
|
||||
printf("Start ISUP module init...\n");
|
||||
memset(&isup_db, 0, sizeof(ISUP_Resource_Pond));
|
||||
memset(&isup_timer_var, 1, sizeof(ISUP_Timer_Struct));
|
||||
memset(&isup_rv_msg, 0, sizeof(up_message));
|
||||
memset(&isup_sd_msg, 0, sizeof(up_message));
|
||||
memset(&isup_rv_pdus, 0, sizeof(SiAllPdus));
|
||||
memset(&isup_sd_pdus, 0, sizeof(SiAllPdus));
|
||||
timer_init(interval_ms);
|
||||
isup_db.attrib.systemID = systemID;
|
||||
isup_db.attrib.isup_remote_ip = 0;
|
||||
isup_db.attrib.isup_run_mode = 0;
|
||||
stack_size = sizeof(ISUP_Resource_Pond) + sizeof(ISUP_Timer_Struct);
|
||||
isup_debug_init();
|
||||
printf("ISUP module init completed, stack size: %ld bytes\n", stack_size);
|
||||
}
|
||||
|
||||
void isup_timer()
|
||||
{
|
||||
u16 i,j;
|
||||
u32 offset, pid;
|
||||
static DWORD cntT50ms = 0;
|
||||
const pal_circuit_struct* circuit_str;
|
||||
const pal_cg_struct* cg_str;
|
||||
|
||||
if (++cntT50ms >= 5)
|
||||
{ // 50 mini seconds period
|
||||
cntT50ms = 0;
|
||||
isup_debug_timer();
|
||||
// isup_check_L3status();
|
||||
}
|
||||
|
||||
for (i = 0; i <64; i++)
|
||||
{
|
||||
if (isup_mdsc_proc()==0)
|
||||
break; //no message in lower layer
|
||||
}
|
||||
|
||||
for (i = 0; i <ISUP_MAX_CIRCUIT; i++) //for timer
|
||||
{
|
||||
circuit_str = pal_circuit_ptr(i);
|
||||
if(circuit_str == NULL)
|
||||
continue;
|
||||
if(circuit_str->enable==0)
|
||||
continue;
|
||||
|
||||
cg_str = pal_cg_ptr(circuit_str->cg_id);
|
||||
if(cg_str == NULL)
|
||||
continue;
|
||||
if(cg_str->attrib.protocol!=1)//isup
|
||||
continue;
|
||||
|
||||
if(isup_db.attrib.isup_run_mode == ISUP_DUAL_MODE &&
|
||||
circuit_str->attrib.plat_id != isup_db.attrib.systemID)
|
||||
continue;
|
||||
|
||||
offset = ISUP_CIRCUIT_CIC*i;
|
||||
for (j = 0; j <ISUP_CIRCUIT_CIC; j++)
|
||||
{
|
||||
pid = offset + j;
|
||||
isup_csc_timer(pid);
|
||||
isup_cpc_timer(pid);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int isup_setup_req(Pst *pst, SiPduIAM *ptr, u8 *raw_data, u8 len)
|
||||
{
|
||||
if(find_port_by_sap(pst)==-1)
|
||||
{
|
||||
isup_trace_func(0,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
isup_db.port_pond[pst->sp_proc_id].su_proc_id = pst->su_proc_id;
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_SETUP_REQ;
|
||||
isup_db.port_pond[pst->sp_proc_id].trace_flag = pst->trace_flag;
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
|
||||
if(isup_db.port_pond[pst->sp_proc_id].cic_state.call_state == IDLE_FLAG)
|
||||
{
|
||||
isup_db.port_pond[pst->sp_proc_id].cic_state.call_state = CALLOUT_FLAG;
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduIAM));
|
||||
|
||||
memset(&isup_raw_msg,0,sizeof(up_message));
|
||||
isup_raw_msg.len = len;
|
||||
memcpy(isup_raw_msg.msgList,raw_data,isup_raw_msg.len);
|
||||
|
||||
isup_cpc_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
isup_log_err(pst->sp_proc_id,"Error,call_state=%d\r\n",isup_db.port_pond[pst->sp_proc_id].cic_state.call_state);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
int isup_setup_anm_rsp(Pst *pst, SiPduANM *ptr_anm, u8 *raw_data, u8 len)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
{
|
||||
isup_log_err(0,"[Error] sp_proc_id == %d. ",pst->sp_proc_id);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_SETUP_RSP;
|
||||
memcpy(&isup_sd_pdus,ptr_anm,sizeof(SiPduANM));
|
||||
|
||||
memset(&isup_raw_msg,0,sizeof(up_message));
|
||||
isup_raw_msg.len = len;
|
||||
memcpy(isup_raw_msg.msgList,raw_data,isup_raw_msg.len);
|
||||
isup_cpc_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_setup_con_rsp(Pst *pst, SiPduCON *ptr_con, u8 *raw_data, u8 len)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
{
|
||||
isup_log_err(0,"[Error] sp_proc_id == %d. ",pst->sp_proc_id);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_SETUP_RSP;
|
||||
memcpy(&isup_sd_pdus,ptr_con,sizeof(SiPduCON));
|
||||
|
||||
memset(&isup_raw_msg,0,sizeof(up_message));
|
||||
isup_raw_msg.len = len;
|
||||
memcpy(isup_raw_msg.msgList,raw_data,isup_raw_msg.len);
|
||||
isup_cpc_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
|
||||
int isup_release_req(Pst *pst, SiPduREL *ptr, u8 *raw_data, u8 len )
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
{
|
||||
isup_log_err(0,"[Error] sp_proc_id == %d. ",pst->sp_proc_id);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_RELEASE_REQ;
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduREL));
|
||||
|
||||
memset(&isup_raw_msg,0,sizeof(up_message));
|
||||
isup_raw_msg.len = len;
|
||||
memcpy(isup_raw_msg.msgList,raw_data,isup_raw_msg.len);
|
||||
isup_cpc_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_release_rsp(Pst *pst, SiPduRLC *ptr, u8 *raw_data, u8 len)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
{
|
||||
isup_log_err(0,"[Error] sp_proc_id == %d. ",pst->sp_proc_id);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_RELEASE_RSP;
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduRLC));
|
||||
|
||||
memset(&isup_raw_msg,0,sizeof(up_message));
|
||||
isup_raw_msg.len = len;
|
||||
memcpy(isup_raw_msg.msgList,raw_data,isup_raw_msg.len);
|
||||
isup_cpc_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_alert_req(Pst *pst, SiPduACM *ptr, u8 *raw_data, u8 len)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
return ISUP_CM_FAILED;
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_ALERT_REQ;
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduACM));
|
||||
|
||||
memset(&isup_raw_msg,0,sizeof(up_message));
|
||||
isup_raw_msg.len = len;
|
||||
memcpy(isup_raw_msg.msgList,raw_data,isup_raw_msg.len);
|
||||
|
||||
isup_cpc_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_info_req(Pst *pst, SiPduSAM *ptr, u8 *raw_data, u8 len)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
return ISUP_CM_FAILED;
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_INFO_REQ;
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduSAM));
|
||||
|
||||
memset(&isup_raw_msg,0,sizeof(up_message));
|
||||
isup_raw_msg.len = len;
|
||||
memcpy(isup_raw_msg.msgList,raw_data,isup_raw_msg.len);
|
||||
isup_cpc_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_prog_req(Pst *pst, SiPduCPG *ptr, u8 *raw_data, u8 len)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
return ISUP_CM_FAILED;
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_PROG_REQ;
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduCPG));
|
||||
|
||||
memset(&isup_raw_msg,0,sizeof(up_message));
|
||||
isup_raw_msg.len = len;
|
||||
memcpy(isup_raw_msg.msgList,raw_data,isup_raw_msg.len);
|
||||
isup_cpc_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_suspend_req(Pst *pst, SiPduSUS *ptr, u8 *raw_data, u8 len)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
return ISUP_CM_FAILED;
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_SUSPEND_REQ;
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduSUS));
|
||||
|
||||
memset(&isup_raw_msg,0,sizeof(up_message));
|
||||
isup_raw_msg.len = len;
|
||||
memcpy(isup_raw_msg.msgList,raw_data,isup_raw_msg.len);
|
||||
isup_cpc_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_resume_req(Pst *pst, SiPduRES *ptr, u8 *raw_data, u8 len)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
return ISUP_CM_FAILED;
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_RESUME_REQ;
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduRES));
|
||||
|
||||
memset(&isup_raw_msg,0,sizeof(up_message));
|
||||
isup_raw_msg.len = len;
|
||||
memcpy(isup_raw_msg.msgList,raw_data,isup_raw_msg.len);
|
||||
isup_cpc_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
/*Maintenance*/
|
||||
int isup_block_req(Pst *pst, SiPduCGB *ptr )
|
||||
{
|
||||
if(find_port_by_sap(pst)==-1)
|
||||
{
|
||||
isup_trace_func(0,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
isup_db.port_pond[pst->sp_proc_id].sm_proc_id = pst->su_proc_id;
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_BLOCK_REQ;
|
||||
if(ptr != NULL)
|
||||
{
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduCGB));
|
||||
isup_mgbs_proc(pst->sp_proc_id);
|
||||
}
|
||||
else
|
||||
isup_bls_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_block_rsp(Pst *pst, SiPduCGBA *ptr)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
{
|
||||
isup_log_err(0,"[Error] sp_proc_id == %d. ",pst->sp_proc_id);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_BLOCK_RSP;
|
||||
if(ptr != NULL)
|
||||
{
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduCGBA));
|
||||
isup_mgbr_proc(pst->sp_proc_id);
|
||||
}
|
||||
else
|
||||
isup_blr_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_unblock_req(Pst *pst, SiPduCGU *ptr )
|
||||
{
|
||||
if(find_port_by_sap(pst)==-1)
|
||||
{
|
||||
isup_trace_func(0,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
isup_db.port_pond[pst->sp_proc_id].sm_proc_id = pst->su_proc_id;
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_UNBLOCK_REQ;
|
||||
if(ptr != NULL)
|
||||
{
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduCGU));
|
||||
isup_mgbs_proc(pst->sp_proc_id);
|
||||
}
|
||||
else
|
||||
isup_bls_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_unblock_rsp(Pst *pst, SiPduCGUA *ptr)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
{
|
||||
isup_log_err(0,"[Error] sp_proc_id == %d. ",pst->sp_proc_id);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_UNBLOCK_RSP;
|
||||
if(ptr != NULL)
|
||||
{
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduCGUA));
|
||||
isup_mgbr_proc(pst->sp_proc_id);
|
||||
}
|
||||
else
|
||||
isup_blr_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_reset_req(Pst *pst, SiPduGRS *ptr )
|
||||
{
|
||||
|
||||
if(find_port_by_sap(pst)==-1)
|
||||
{
|
||||
isup_trace_func(0,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
isup_db.port_pond[pst->sp_proc_id].sm_proc_id = pst->su_proc_id;
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_RESET_REQ;
|
||||
if(ptr != NULL)
|
||||
{
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduGRS));
|
||||
isup_cgrs_proc(pst->sp_proc_id);
|
||||
}
|
||||
else
|
||||
isup_crs_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_reset_rsp(Pst *pst, SiPduGRA *ptr)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
{
|
||||
isup_log_err(0,"[Error] sp_proc_id == %d. ",pst->sp_proc_id);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_RESET_RSP;
|
||||
if(ptr != NULL)
|
||||
{
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiPduGRA));
|
||||
}
|
||||
isup_cpc_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
|
||||
int isup_bls_stop_req(Pst *pst)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id == 0 || pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
{
|
||||
isup_log_err(0,"[Error] sp_proc_id == %d. ",pst->sp_proc_id);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_STOP_REQ;
|
||||
isup_bls_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
|
||||
int isup_mgbs_stop_req(Pst *pst)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
{
|
||||
isup_log_err(0,"[Error] sp_proc_id == %d. ",pst->sp_proc_id);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_STOP_REQ;
|
||||
isup_mgbs_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_crs_stop_req(Pst *pst)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
{
|
||||
isup_log_err(0,"[Error] sp_proc_id == %d. ",pst->sp_proc_id);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_STOP_REQ;
|
||||
isup_crs_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_cgrs_stop_req(Pst *pst)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
if(pst->sp_proc_id >= ISUP_MAX_PORT)
|
||||
{
|
||||
isup_log_err(0,"[Error] sp_proc_id == %d. ",pst->sp_proc_id);
|
||||
return ISUP_CM_FAILED;
|
||||
}
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = ISUP_STOP_REQ;
|
||||
isup_cgrs_proc(pst->sp_proc_id);
|
||||
if(isup_db.port_pond[pst->sp_proc_id].primitive_cmd != 0)
|
||||
{
|
||||
isup_trace_func(pst->sp_proc_id,"[waring]primitive cmd discard.(cmd=%d)",isup_db.port_pond[pst->sp_proc_id].primitive_cmd);
|
||||
isup_db.port_pond[pst->sp_proc_id].primitive_cmd = 0;
|
||||
}
|
||||
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
|
||||
int isup_data_req(Pst *pst, u8 msgType, SiAllPdus *ptr, u8 *raw_data, u8 len)
|
||||
{
|
||||
// if(find_port_by_sap(pst)==-1)
|
||||
// {
|
||||
// isup_trace_func(0,"APP => function trace: %s(msgType=%d)\r\n", __FUNCTION__,msgType);
|
||||
// return ISUP_CM_FAILED;
|
||||
// }
|
||||
isup_trace_func(pst->sp_proc_id,"APP => function trace: %s(msgType=%d)\r\n", __FUNCTION__,msgType);
|
||||
memcpy(&isup_sd_pdus,ptr,sizeof(SiAllPdus));
|
||||
|
||||
memset(&isup_raw_msg,0,sizeof(up_message));
|
||||
isup_raw_msg.len = len;
|
||||
memcpy(isup_raw_msg.msgList,raw_data,isup_raw_msg.len);
|
||||
if(isup_send_msg(pst->sp_proc_id,msgType)==-1)
|
||||
return ISUP_CM_FAILED;
|
||||
else
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int isup_set_run_mode (u8 run_mode, u32 alter_ip)
|
||||
{
|
||||
isup_trace_func(0,"APP => function trace: %s\r\n", __FUNCTION__);
|
||||
isup_db.attrib.isup_run_mode = run_mode % 2;
|
||||
isup_db.attrib.isup_remote_ip = alter_ip;
|
||||
return ISUP_CM_OK;
|
||||
}
|
||||
|
||||
int isup_inquire_cic (u16 cg_id, u32 cic)
|
||||
{
|
||||
Pst pst;
|
||||
const pal_cg_struct* cg_str;
|
||||
|
||||
pst.cg_id = cg_id;
|
||||
pst.cic = cic;
|
||||
|
||||
cg_str = pal_cg_ptr(cg_id);
|
||||
if(cg_str == NULL)
|
||||
return -3;
|
||||
|
||||
if (check_outbound_route((cg_str->attrib.network_id & 3), cg_str->attrib.dpc, 0) < 0)
|
||||
return -1;
|
||||
|
||||
if(find_port_by_sap(&pst)==-1)
|
||||
return -2;
|
||||
|
||||
if(isup_db.port_pond[pst.sp_proc_id].cic_state.call_state == IDLE_FLAG &&
|
||||
!(isup_db.port_pond[pst.sp_proc_id].cic_state.blo_state & M_REMOTE_BLOCK))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
7879
plat/isup/src/isup_msg.c
Normal file
7879
plat/isup/src/isup_msg.c
Normal file
File diff suppressed because it is too large
Load Diff
402
plat/isup/src/isup_transit.c
Normal file
402
plat/isup/src/isup_transit.c
Normal file
@@ -0,0 +1,402 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2008 LGC Wireless, Inc
|
||||
* Written by: Xinyu Yan <xyyan@lgcwireless.com>
|
||||
*
|
||||
*-
|
||||
*/
|
||||
#include "./include/isup_debug.h"
|
||||
#include "./include/isup_public.h"
|
||||
#include "./include/isup_if.h"
|
||||
#include "./include/isup_struct.h"
|
||||
#include "./include/isup_def.h"
|
||||
#include "./include/isup_const.h"
|
||||
|
||||
#define MAX_ISUP_VAR 10
|
||||
#define MAX_ISUP_OPT 50
|
||||
|
||||
struct param_unit {
|
||||
u8 len;
|
||||
u8 *ptr;
|
||||
};
|
||||
|
||||
struct isup_gen_fmt {
|
||||
u8 var_num;
|
||||
u8 opt_num;
|
||||
struct param_unit fix;
|
||||
struct param_unit var[MAX_ISUP_VAR];
|
||||
struct param_unit opt[MAX_ISUP_OPT];
|
||||
};
|
||||
|
||||
#define MAX_ISUP_MSGTYPE 100 //not sure, just an assumption
|
||||
#define LEN_OF_LV(ptr) (*ptr + 1)
|
||||
#define LEN_OF_TLV(ptr) (*(ptr+1) + 2)
|
||||
|
||||
struct isup_fmt_desc {
|
||||
u8 exist;
|
||||
u8 fixed_len; /* fixed len start from message type(include) */
|
||||
u8 var_num;
|
||||
};
|
||||
|
||||
const static struct isup_fmt_desc fmt_desc_itu[MAX_ISUP_MSGTYPE] = {
|
||||
{0},
|
||||
{1, 6, 1}, //Initial address(1)
|
||||
{1, 1, 1}, //Subsequent address(2)
|
||||
{1,3,0},//Information request (national use)(3)
|
||||
{1,3,0},//Information (national use)(4)
|
||||
{1,2,0},//Continuity(5)
|
||||
{1,3,0},//Address complete(6)
|
||||
{1,3,0},//Connect(7)
|
||||
{1,1,0},//Forward transfer(8)
|
||||
{1,1,0},//Answer(9)
|
||||
{0},//10
|
||||
{0},//11
|
||||
{1,1,1},//Release(12)
|
||||
{1,2,0},//Suspend(13)
|
||||
{1,2,0},//Resume(14)
|
||||
{0},//15
|
||||
{1,1,0},//Release complete(16)
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},//Unblocking(20)
|
||||
{0},
|
||||
{0},//Unblocking acknowledgement(22)
|
||||
{0},
|
||||
{0},
|
||||
{0},//25
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},//30
|
||||
{1,2,0},//Facility request(31)
|
||||
{1,2,0},//Facility accepted(32)
|
||||
{1,2,1},//Facility reject(33)
|
||||
{0},
|
||||
{0},//35
|
||||
{0},//Loop Back Acknowledgement(36)
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},//Pass-Along(40)
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{1,2,0},//Call progress(44)
|
||||
{1,1,1},//User-to-user information(45)
|
||||
{0},//Unequipped CIC (national use)(46)
|
||||
{1,1,1},//Confusion(47)
|
||||
{0},//Overload(48)
|
||||
{0},//Charge information (national use)(49)
|
||||
{1,1,0},//Network resource management(50)
|
||||
{1,1,0},//Facility (51)
|
||||
{1,1,0},//User Part Test(52)
|
||||
{1,1,0},//User Part Available(53)
|
||||
{1,1,0},//Identification request(54)
|
||||
{1,1,0},//Identification response(55)
|
||||
{1,1,0},//Segmentation(56)
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},//60
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{1,1,0},//Loop Prevention(64)
|
||||
{1,1,0},//Application transport message(65)
|
||||
{1,1,0},//Pre-release information message (66)
|
||||
};
|
||||
|
||||
const static struct isup_fmt_desc fmt_desc_ansi[MAX_ISUP_MSGTYPE] = {
|
||||
{0},
|
||||
{1, 5, 2}, //Initial address(1)
|
||||
{1, 1, 1}, //Subsequent address(2)
|
||||
{1,3,0},//Information request (national use)(3)
|
||||
{1,3,0},//Information (national use)(4)
|
||||
{1,2,0},//Continuity(5)
|
||||
{1,3,0},//Address complete(6)
|
||||
{1,3,0},//Connect(7)
|
||||
{1,1,0},//Forward transfer(8)
|
||||
{1,1,0},//Answer(9)
|
||||
{0},//10
|
||||
{0},//11
|
||||
{1,1,1},//Release(12)
|
||||
{1,2,0},//Suspend(13)
|
||||
{1,2,0},//Resume(14)
|
||||
{0},//15
|
||||
{1,1,0},//Release complete(16)
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},//Unblocking(20)
|
||||
{0},
|
||||
{0},//Unblocking acknowledgement(22)
|
||||
{0},
|
||||
{0},
|
||||
{0},//25
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},//30
|
||||
{1,2,0},//Facility request(31)
|
||||
{1,2,0},//Facility accepted(32)
|
||||
{1,2,1},//Facility reject(33)
|
||||
{0},
|
||||
{0},//35
|
||||
{0},//Loop Back Acknowledgement(36)
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},//Pass-Along(40)
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{1,2,0},//Call progress(44)
|
||||
{1,1,1},//User-to-user information(45)
|
||||
{0},//Unequipped CIC (national use)(46)
|
||||
{1,1,1},//Confusion(47)
|
||||
{0},//Overload(48)
|
||||
{0},//Charge information (national use)(49)
|
||||
{1,1,0},//Network resource management(50)
|
||||
{1,1,0},//Facility (51)
|
||||
{1,1,0},//User Part Test(52)
|
||||
{1,1,0},//User Part Available(53)
|
||||
{1,1,0},//Identification request(54)
|
||||
{1,1,0},//Identification response(55)
|
||||
{1,1,0},//Segmentation(56)
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{0},//60
|
||||
{0},
|
||||
{0},
|
||||
{0},
|
||||
{1,1,0},//Loop Prevention(64)
|
||||
{1,1,0},//Application transport message(65)
|
||||
{1,1,0},//Pre-release information message (66)
|
||||
};
|
||||
|
||||
int raw_to_fmt(struct isup_gen_fmt *fmt, u8 *raw_head, u16 raw_len, u8 variant)
|
||||
{
|
||||
int i;
|
||||
const struct isup_fmt_desc *desc;
|
||||
struct param_unit *opt;
|
||||
u8 msg_type;
|
||||
u8 *raw = raw_head;
|
||||
|
||||
msg_type = *raw;
|
||||
if(msg_type >= MAX_ISUP_MSGTYPE)
|
||||
return 0;
|
||||
if(variant == VARIANT_ANSI)
|
||||
desc = &fmt_desc_ansi[msg_type];
|
||||
else
|
||||
desc = &fmt_desc_itu[msg_type];
|
||||
if(desc->exist == 0)
|
||||
return 0;
|
||||
|
||||
memset(fmt, 0, sizeof(struct isup_gen_fmt));
|
||||
|
||||
// M Fixed //
|
||||
fmt->fix.len = desc->fixed_len;
|
||||
fmt->fix.ptr = raw;
|
||||
raw += fmt->fix.len;
|
||||
|
||||
// M Variable //
|
||||
fmt->var_num = desc->var_num;
|
||||
raw += *raw;
|
||||
if(fmt->var_num != 0)
|
||||
{
|
||||
for(i = 0; i < fmt->var_num; i++)
|
||||
{
|
||||
if(raw + LEN_OF_LV(raw) - raw_head > raw_len)
|
||||
return -1;
|
||||
fmt->var[i].len = LEN_OF_LV(raw);
|
||||
fmt->var[i].ptr = raw;
|
||||
raw += fmt->var[i].len;
|
||||
}
|
||||
}
|
||||
|
||||
// Option //
|
||||
while(*raw != 0)
|
||||
{
|
||||
if(raw + LEN_OF_TLV(raw) - raw_head > raw_len)
|
||||
return -1;
|
||||
opt = &fmt->opt[fmt->opt_num++];
|
||||
opt->len = LEN_OF_TLV(raw);
|
||||
opt->ptr = raw;
|
||||
raw += opt->len;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int param_need_merge(u8 param_name)
|
||||
{
|
||||
switch(param_name)
|
||||
{
|
||||
case ME_REDIRGNUM:
|
||||
case ME_REDIRINFO:
|
||||
case ME_ORIGCALDNUM:
|
||||
case ME_LOCNMB:
|
||||
case ME_LASDIVLINID:
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int param_already_exist(u8 *index, struct isup_gen_fmt *org, u8 param_name)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < org->opt_num; i++)
|
||||
{
|
||||
if(*(org->opt[i].ptr) == param_name)
|
||||
{
|
||||
*index = i;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static u8 bw_call_ind[4];
|
||||
void merge_cpg_acm(struct isup_gen_fmt *dst, struct isup_gen_fmt *cpg, struct isup_gen_fmt *acm)
|
||||
{
|
||||
int i;
|
||||
u8 param_name;
|
||||
u8 index;
|
||||
|
||||
memcpy(dst, cpg, sizeof(struct isup_gen_fmt));
|
||||
|
||||
/* backward call ind, from fix part to opt */
|
||||
bw_call_ind[0] = ME_BACKCALLIND;
|
||||
bw_call_ind[1] = 2;
|
||||
memcpy(bw_call_ind+2, acm->fix.ptr+1, 2);
|
||||
dst->opt[dst->opt_num].len = 4;
|
||||
dst->opt[dst->opt_num].ptr = bw_call_ind;
|
||||
dst->opt_num++;
|
||||
|
||||
for(i = 0; i < acm->opt_num; i++)
|
||||
{
|
||||
param_name = *(acm->opt[i].ptr);
|
||||
/* discard echo control infomation */
|
||||
if(param_name == ME_ECHOCNTRL)
|
||||
continue;
|
||||
if(param_already_exist(&index, dst, param_name) == 1)
|
||||
memcpy(&dst->opt[index], &acm->opt[i], sizeof(struct param_unit));
|
||||
else
|
||||
memcpy(&dst->opt[dst->opt_num++], &acm->opt[i], sizeof(struct param_unit));
|
||||
}
|
||||
}
|
||||
|
||||
void merge_fmt(struct isup_gen_fmt *dst, struct isup_gen_fmt *org, struct isup_gen_fmt *add)
|
||||
{
|
||||
int i;
|
||||
u8 param_name;
|
||||
u8 index;
|
||||
|
||||
memcpy(dst, org, sizeof(struct isup_gen_fmt));
|
||||
|
||||
if(*(add->fix.ptr) == M_CPG)
|
||||
memcpy(&dst->fix, &add->fix, sizeof(struct param_unit));
|
||||
|
||||
if(*(add->fix.ptr) == M_IAM)
|
||||
{
|
||||
for(i = 0; i < add->var_num; i++)
|
||||
{
|
||||
memcpy(&dst->var[i], &add->var[i], sizeof(struct param_unit));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i = 0; i < org->var_num; i++)
|
||||
{
|
||||
memcpy(&dst->var[i], &org->var[i], sizeof(struct param_unit));
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 0; i < add->opt_num; i++)
|
||||
{
|
||||
param_name = *(add->opt[i].ptr);
|
||||
if(param_need_merge(param_name) == 0)
|
||||
continue;
|
||||
if(param_already_exist(&index, dst, param_name) == 1)
|
||||
memcpy(&dst->opt[index], &add->opt[i], sizeof(struct param_unit));
|
||||
else
|
||||
memcpy(&dst->opt[dst->opt_num++], &add->opt[i], sizeof(struct param_unit));
|
||||
}
|
||||
}
|
||||
|
||||
int fmt_to_raw(u8 *raw_head, struct isup_gen_fmt *fmt)
|
||||
{
|
||||
u8 *raw = raw_head;
|
||||
int i;
|
||||
u8 pre_pointer;
|
||||
u8 pre_varlen;
|
||||
|
||||
// M Fixed //
|
||||
memcpy(raw, fmt->fix.ptr, fmt->fix.len);
|
||||
raw += fmt->fix.len;
|
||||
|
||||
/* Set initial condition, note that if VAR not exist, it applys to OPT directly */
|
||||
pre_varlen = fmt->var_num + 1;
|
||||
pre_pointer = 1;
|
||||
|
||||
// M Variable //
|
||||
if(fmt->var_num != 0)
|
||||
{
|
||||
for(i = 0; i < fmt->var_num; i++)
|
||||
{
|
||||
*raw = pre_pointer + pre_varlen - 1;
|
||||
memcpy(raw+*raw, fmt->var[i].ptr, fmt->var[i].len);
|
||||
pre_varlen = fmt->var[i].len;
|
||||
pre_pointer = *(raw++);
|
||||
}
|
||||
|
||||
// /* "pointer of optional part" is set to 0 first */
|
||||
// *raw = 0;
|
||||
}
|
||||
|
||||
// Option //
|
||||
if(fmt->opt_num != 0)
|
||||
{
|
||||
/* Set "pointer of optional part" */
|
||||
*raw = pre_pointer + pre_varlen - 1;
|
||||
|
||||
raw += *raw;
|
||||
for(i = 0; i < fmt->opt_num; i++)
|
||||
{
|
||||
memcpy(raw, fmt->opt[i].ptr, fmt->opt[i].len);
|
||||
raw += fmt->opt[i].len;
|
||||
}
|
||||
|
||||
// /* Set "end of optional parameter" */
|
||||
// *raw = 0;
|
||||
}
|
||||
|
||||
/* Last octet set to 0. It may be "pointer of optional part" or "end of optional parameter" */
|
||||
*(raw++) = 0;
|
||||
if(fmt->opt_num == 0)
|
||||
return raw-raw_head+pre_pointer + pre_varlen - 1 -1;
|
||||
else
|
||||
return raw-raw_head;
|
||||
}
|
||||
|
||||
int isup_transit_msg(u8 *raw_dst, u8 *raw_add, u8 len_add, u8 *raw_org, u8 len_org, u8 variant)
|
||||
{
|
||||
struct isup_gen_fmt fmt_org;
|
||||
struct isup_gen_fmt fmt_add;
|
||||
struct isup_gen_fmt fmt_dst;
|
||||
|
||||
if(raw_to_fmt(&fmt_org, raw_org, len_org, variant)==0)
|
||||
return 0;
|
||||
if(raw_to_fmt(&fmt_add, raw_add, len_add, variant)==0)
|
||||
return 0;
|
||||
if((*(fmt_org.fix.ptr) == M_ACM) && (*(fmt_add.fix.ptr) == M_CPG))
|
||||
merge_cpg_acm(&fmt_dst, &fmt_add, &fmt_org);
|
||||
else
|
||||
merge_fmt(&fmt_dst, &fmt_org, &fmt_add);
|
||||
return fmt_to_raw(raw_dst, &fmt_dst);
|
||||
}
|
||||
|
||||
BIN
plat/isup/src/vssver2.scc
Normal file
BIN
plat/isup/src/vssver2.scc
Normal file
Binary file not shown.
187
plat/isup/ut/isup_main.c
Normal file
187
plat/isup/ut/isup_main.c
Normal file
@@ -0,0 +1,187 @@
|
||||
// ***************************************************************
|
||||
// isup_main version: 1.0 <20><> date: 04/06/2007
|
||||
// -------------------------------------------------------------
|
||||
// DESCRIPTION: For isup module test
|
||||
//
|
||||
// AUTHOR: Zane
|
||||
//
|
||||
// HISTORY:
|
||||
// -------------------------------------------------------------
|
||||
// Copyright (C) 2007 - All Rights Reserved
|
||||
// ***************************************************************
|
||||
//
|
||||
// ***************************************************************
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "./include/isup_if.h"
|
||||
#include "../../plat/snmp/src/include/snmp.h"
|
||||
#include "../../plat/public/src/include/license_id.h"
|
||||
|
||||
#define SYS_IT_INTERVAL_SEC 0
|
||||
#define SYS_IT_INTERVAL_USEC (20*1000)
|
||||
|
||||
static char serialNumber[18]="";
|
||||
static int systemID=0,systemInited=0;
|
||||
static int sys_timer10ms=0;
|
||||
|
||||
extern void m2ua_init(void);
|
||||
extern void m2ua_timer(void);
|
||||
extern void debug_init_wxc2_ver();
|
||||
|
||||
static void isup_param_init(void)
|
||||
{
|
||||
Sap_Attrib_struct sap;
|
||||
Cg_Attrib_struct cg;
|
||||
Circuit_Attrib_struct trunk;
|
||||
int sap_id,cg_id,trunk_id;
|
||||
|
||||
memset(&sap,0,sizeof(Sap_Attrib_struct));
|
||||
memset(&cg,0,sizeof(Cg_Attrib_struct));
|
||||
memset(&trunk,0,sizeof(Circuit_Attrib_struct));
|
||||
|
||||
if((sap_id = isup_bind_sap(&sap)) == -1)
|
||||
{
|
||||
printf("add sap error!\r\n");
|
||||
return;
|
||||
}
|
||||
|
||||
cg.opc = 1;
|
||||
cg.dpc = 2;
|
||||
cg.network_id = 0;
|
||||
cg.priority = 1; // 0:Reattempt ind / 1:Discard
|
||||
cg.tg_id = 0;
|
||||
cg.variant_type = VARIANT_ITU;
|
||||
|
||||
if((cg_id = isup_add_cg(sap_id, &cg)) == -1)
|
||||
{
|
||||
printf("Failed to create isup trunk group socket\r\n");
|
||||
return;
|
||||
}
|
||||
|
||||
trunk.cic_range = 32;
|
||||
trunk.head_cic = 0;
|
||||
trunk.plat_id = CTRL_PLAT_0;
|
||||
if((trunk_id = isup_add_circuit(cg_id, &trunk)) == -1)
|
||||
{
|
||||
printf("Failed to create isup trunk socket\r\n");
|
||||
return;
|
||||
}
|
||||
|
||||
isup_set_run_mode(ISUP_SINGLE_MODE,0);
|
||||
printf("isup init ok.\r\n");
|
||||
}
|
||||
|
||||
|
||||
int wxc2_get_license(int functionID)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void sysTimer_IRQ()
|
||||
{
|
||||
sys_timer10ms = 1;
|
||||
}
|
||||
|
||||
|
||||
static void SigactionSystem()
|
||||
{
|
||||
struct sigaction action;//,actsegv;
|
||||
|
||||
action.sa_handler = sysTimer_IRQ;
|
||||
sigemptyset(&action.sa_mask);
|
||||
action.sa_flags = SA_RESTART;
|
||||
if(sigaction(SIGALRM, &action, NULL)<0)
|
||||
{
|
||||
printf("sigactin sigalarm failed\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void moduleInit()
|
||||
{
|
||||
printf("\n\n<EFBFBD><EFBFBD>R9 Platform Init<69><74>\n\n");
|
||||
|
||||
debug_init();
|
||||
iptrMainInit();
|
||||
|
||||
m2ua_init();
|
||||
|
||||
snmp_init(4957);
|
||||
|
||||
mtp_shm_init();
|
||||
|
||||
mtp3_init_serial(serialNumber);
|
||||
|
||||
// sccp_init(systemID, 0, 0);
|
||||
|
||||
isup_init(systemID,10);
|
||||
|
||||
printf("\n\n<EFBFBD><EFBFBD>R9 Platform Init completed<65><64>\n\n");
|
||||
|
||||
}
|
||||
|
||||
static void SetFSMTimer()
|
||||
{
|
||||
struct itimerval *ptv, tv;
|
||||
|
||||
ptv = (struct itimerval *) &tv;
|
||||
ptv->it_interval.tv_sec = SYS_IT_INTERVAL_SEC;
|
||||
ptv->it_interval.tv_usec = SYS_IT_INTERVAL_USEC;
|
||||
ptv->it_value. tv_sec = SYS_IT_INTERVAL_SEC;
|
||||
ptv->it_value.tv_usec = SYS_IT_INTERVAL_USEC;
|
||||
setitimer(ITIMER_REAL, ptv, NULL);
|
||||
}
|
||||
|
||||
static void moduleProc()
|
||||
{
|
||||
static int wait_sccp_normal_count = 0;
|
||||
|
||||
iptrans_timer();
|
||||
|
||||
|
||||
snmp_timer();
|
||||
|
||||
if(systemInited)
|
||||
{
|
||||
wait_sccp_normal_count=6001;
|
||||
|
||||
heartbeat_timer();
|
||||
m2ua_timer();
|
||||
mtp3_proc();
|
||||
|
||||
// sccp_timer();
|
||||
|
||||
isup_timer();
|
||||
}
|
||||
|
||||
|
||||
debug_rt();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
moduleInit();
|
||||
|
||||
debug_init_wxc2_ver("ISUP TEST CASE v1.0 - Init...");
|
||||
|
||||
SigactionSystem();
|
||||
SetFSMTimer();
|
||||
|
||||
isup_param_init();
|
||||
|
||||
sys_timer10ms = 1;
|
||||
|
||||
while(1)
|
||||
{
|
||||
if(sys_timer10ms)
|
||||
{
|
||||
sys_timer10ms = 0;
|
||||
moduleProc();
|
||||
systemInited = 1;
|
||||
}
|
||||
if (sys_timer10ms == 0)
|
||||
usleep(1);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
87
plat/isup/ut/isup_msg_rv.txt
Normal file
87
plat/isup/ut/isup_msg_rv.txt
Normal file
@@ -0,0 +1,87 @@
|
||||
Test 1
|
||||
|
||||
0 PUB.SET SYNC=0
|
||||
|
||||
0 PUB.SET RECYCLE=0
|
||||
|
||||
1 M2UA.SET UPPERLAYER=MTP3
|
||||
|
||||
0 M2UA.SET LOCAL_PORT=2904
|
||||
|
||||
0 M2UA.SET REMOTE_PORT=2904
|
||||
|
||||
0 M2UA.SET REMOTE_IP=172.54.242.252
|
||||
|
||||
0 M2UA.SET STREAM_ID=1
|
||||
|
||||
10 M2UA.SET CLIENT // <20><><EFBFBD><EFBFBD>
|
||||
|
||||
20 M2UA.SET SG_LINK //<2F>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>20<32><30><EFBFBD>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
20 M2UA.SET LINK_ID=0 // <20>ڷ<EFBFBD><DAB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>ź<C5BA><F3A3ACB7><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>·
|
||||
|
||||
20 M2UA.SET LK_LINK // <20>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>20<32><30><EFBFBD>鿴<EFBFBD><E9BFB4>·<EFBFBD><C2B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
10000000 M2UA.RECV
|
||||
|
||||
|
||||
|
||||
62
plat/isup/ut/isup_msg_send.txt
Normal file
62
plat/isup/ut/isup_msg_send.txt
Normal file
@@ -0,0 +1,62 @@
|
||||
Test 1
|
||||
0 PUB.SET SYNC=0
|
||||
0 PUB.SET RECYCLE=0
|
||||
1 M2UA.SET UPPERLAYER=MTP3
|
||||
0 M2UA.SET LOCAL_PORT=2904
|
||||
0 M2UA.SET REMOTE_PORT=2904
|
||||
0 M2UA.SET REMOTE_IP=172.54.242.252
|
||||
0 M2UA.SET STREAM_ID=1
|
||||
10 M2UA.SET CLIENT
|
||||
20 M2UA.SET SG_LINK
|
||||
20 M2UA.SET LINK_ID=0
|
||||
20 M2UA.SET LK_LINK
|
||||
20 M2UA.SEND 00 5B 05 01 80 00 A0 0A 00 06 55 7F 01 29 01 0F 01 05 01 01 01 01 00 12 03 A1 81 01 2A 01 2B 20 01 01 03 02 01 00 2C 01 01 35 01 01 37 01 55 2E 01 01 0C 04 81 90 21 03 39 02 01 01 36 01 09 2F 02 01 01 32 02 01 01 33 02 01 01 40 01 01 72 03 01 01 01 74 02 03 01 FA 03 FF FF 01 00
|
||||
10 M2UA.SEND 00 6C 05 01 80 00 A0 0A 00 09 01 11 02 55 7F 29 01 0F 01 05 01 01 01 01 00 2A 01 2B 20 01 01 21 06 81 15 21 43 65 07 03 02 01 00 2E 01 01 2C 01 01 39 03 01 01 01 2D 02 00 01 C0 07 01 81 95 21 43 65 07 35 01 01 2F 02 01 01 32 02 01 01 0B 05 81 90 21 43 05 33 02 01 01 37 01 76 40 01 01 4D 03 01 01 01 73 02 01 01 FA 03 FF FF 01 00
|
||||
10 M2UA.SEND 00 09 05 01 80 00 A0 0A 00 13 00
|
||||
10 M2UA.SEND 00 09 05 01 80 00 A0 0A 00 15 00
|
||||
10 M2UA.SEND 00 83 05 01 80 00 A0 0A 00 2C 81 01 24 01 81 12 03 A1 81 01 01 05 01 01 01 01 00 11 02 55 7F 29 01 0F 03 03 01 01 01 2A 01 2B 2C 01 01 2F 03 01 01 01 32 03 01 01 01 35 01 01 2E 01 01 0C 05 81 90 21 43 05 39 03 01 01 01 36 01 0A 33 03 01 01 01 40 01 01 45 04 81 95 11 01 37 01 55 21 06 81 15 21 43 65 07 4D 03 01 01 01 C0 05 01 81 95 21 03 2D 02 00 01 72 03 01 01 01 74 03 03 01 01 FA 03 FF FF 01 00
|
||||
10 M2UA.SEND 00 10 05 01 80 00 A0 0A 00 18 01 01 05 1F FF FF FF FF
|
||||
10 M2UA.SEND 00 10 05 01 80 00 A0 0A 00 1A 01 01 05 1F FF FF FF FF
|
||||
10 M2UA.SEND 00 0B 05 01 80 00 A0 0A 00 2A 01 01 01
|
||||
10 M2UA.SEND 00 10 05 01 80 00 A0 0A 00 2B 02 03 01 01 03 01 01 01
|
||||
10 M2UA.SEND 00 0B 05 01 80 00 A0 0A 00 17 01 01 01
|
||||
10 M2UA.SEND 00 0F 05 01 80 00 A0 0A 00 29 01 05 1F FF FF FF FF
|
||||
10 M2UA.SEND 00 10 05 01 80 00 A0 0A 00 19 01 01 05 1F FF FF FF FF
|
||||
10 M2UA.SEND 00 10 05 01 80 00 A0 0A 00 1B 01 01 05 1F FF FF FF FF
|
||||
10 M2UA.SEND 00 09 05 01 80 00 A0 0A 00 31 00
|
||||
10 M2UA.SEND 00 10 05 01 80 00 A0 0A 00 2F 02 00 05 A1 81 01 01 01
|
||||
10 M2UA.SEND 00 6F 05 01 80 00 A0 0A 00 07 55 7F 01 29 01 0F 21 06 81 15 21 43 65 07 01 05 01 01 01 01 00 2A 01 2B 20 01 01 03 03 01 01 01 2F 03 01 01 01 2C 01 01 32 03 01 01 01 35 01 01 37 01 55 2E 01 01 2D 02 00 01 39 03 01 01 01 0B 05 81 90 21 43 05 33 03 01 01 01 C0 07 01 81 95 21 43 65 07 40 01 01 4D 03 01 01 01 72 03 01 01 01 FA 03 FF FF 01 00
|
||||
10 M2UA.SEND 00 09 05 01 80 00 A0 0A 00 05 01
|
||||
10 M2UA.SEND 00 2A 05 01 80 00 A0 0A 00 33 01 38 01 3F 39 03 01 01 01 32 03 01 01 01 33 03 01 01 01 45 04 81 95 11 01 03 03 01 01 01 2C 01 01 00
|
||||
10 M2UA.SEND 00 23 05 01 80 00 A0 0A 00 20 01 01 2A 01 2B 01 05 01 01 01 01 00 0D 07 01 01 01 01 00 01 01 39 03 01 01 01 00
|
||||
10 M2UA.SEND 00 14 05 01 80 00 A0 0A 00 21 01 02 06 04 A1 81 01 01 2A 01 2B 00
|
||||
10 M2UA.SEND 00 23 05 01 80 00 A0 0A 00 1F 01 01 2A 01 2B 01 05 01 01 01 01 00 0D 07 01 01 01 01 00 01 01 39 03 01 01 01 00
|
||||
10 M2UA.SEND 00 11 05 01 80 00 A0 0A 00 08 01 01 05 01 01 01 01 00 00
|
||||
10 M2UA.SEND 00 15 05 01 80 00 A0 0A 00 36 01 3B 01 03 38 01 3F 39 03 01 01 01 00
|
||||
10 M2UA.SEND 00 2C 05 01 80 00 A0 0A 00 37 01 3C 01 03 38 01 3F 39 03 01 01 01 0A 04 81 95 11 01 03 03 01 01 01 C0 05 01 81 95 21 03 71 03 01 01 01 00
|
||||
10 M2UA.SEND 00 43 05 01 80 00 A0 0A 00 04 E5 00 01 09 01 01 0A 04 81 95 11 01 01 05 01 01 01 01 00 0D 07 01 01 01 01 00 01 01 39 03 01 01 01 2F 03 01 01 01 F5 02 0F 00 FA 03 FF FF 01 F9 03 FF FF 81 F8 01 0F F7 01 1F 00
|
||||
10 M2UA.SEND 00 21 05 01 80 00 A0 0A 00 03 9B 00 01 01 05 00 00 01 01 00 39 03 01 01 01 2F 03 01 01 01 F6 02 0F 00 00
|
||||
10 M2UA.SEND 00 09 05 01 80 00 A0 0A 00 24 00
|
||||
10 M2UA.SEND 00 18 05 01 80 00 A0 0A 00 32 01 38 01 3F 39 03 01 01 01 35 01 02 37 01 55 00
|
||||
10 M2UA.SEND 00 09 05 01 80 00 A0 0A 00 30 00
|
||||
10 M2UA.SEND 00 0B 05 01 80 00 A0 0A 00 28 01 01 01
|
||||
10 M2UA.SEND 00 48 05 01 80 00 A0 0A 00 0C 02 06 04 A1 81 01 01 13 02 11 11 0C 04 81 90 21 03 03 03 01 01 01 1E 02 01 00 20 03 01 01 01 27 01 01 2F 03 01 01 01 2E 01 01 39 03 01 01 01 40 01 01 2A 01 2B 73 03 01 01 01 32 03 01 01 01 00
|
||||
10 M2UA.SEND 00 10 05 01 80 00 A0 0A 00 10 01 12 04 A1 81 01 01 00
|
||||
10 M2UA.SEND 00 09 05 01 80 00 A0 0A 00 12 00
|
||||
10 M2UA.SEND 00 12 05 01 80 00 A0 0A 00 0E 01 01 01 05 01 01 01 01 00 00
|
||||
10 M2UA.SEND 00 27 05 01 80 00 A0 0A 00 38 01 03 03 01 01 01 20 03 01 01 01 38 01 3F C1 04 21 01 02 03 2C 01 01 C0 05 01 81 95 21 03 00
|
||||
10 M2UA.SEND 00 0E 05 01 80 00 A0 0A 00 02 02 00 03 80 11 01
|
||||
10 M2UA.SEND 00 12 05 01 80 00 A0 0A 00 0D 01 01 01 05 01 01 01 01 00 00
|
||||
10 M2UA.SEND 00 09 05 01 80 00 A0 0A 00 14 00
|
||||
10 M2UA.SEND 00 09 05 01 80 00 A0 0A 00 16 00
|
||||
10 M2UA.SEND 00 09 05 01 80 00 A0 0A 00 2E 00
|
||||
10 M2UA.SEND 00 0F 05 01 80 00 A0 0A 00 35 01 39 03 01 01 01 00
|
||||
10 M2UA.SEND 00 0F 05 01 80 00 A0 0A 00 34 01 39 03 01 01 01 00
|
||||
10 M2UA.SEND 00 14 05 01 80 00 A0 0A 00 2D 02 05 03 01 01 01 03 03 01 01 01 00
|
||||
10 M2UA.SEND 00 C9 05 01 80 00 A0 0A 00 01 15 7B 03 01 01 02 05 03 81 90 01 23 02 91 01 0B 03 81 14 01 13 02 11 11 1A 04 11 11 00 01 0D 07 01 01 01 01 00 01 01 28 03 81 14 01 20 02 01 01 03 03 01 01 01 1D 02 01 01 2A 01 2B 2B 02 02 00 34 02 01 01 32 02 01 01 39 02 01 01 2C 01 01 33 02 01 01 3A 06 21 11 11 00 00 01 3E 01 01 4C 0A 82 21 03 82 21 03 93 01 21 03 4B 01 01 5B 03 01 01 01 25 05 01 02 01 01 02 65 02 01 01 6E 03 01 01 01 6F 03 81 14 01 70 03 01 01 01 72 03 01 01 01 66 02 01 01 75 03 03 01 01 37 01 55 3D 01 01 79 01 01 FE 02 0F 00 FD 03 81 95 01 FC 03 81 95 01 FB 09 11 11 11 11 01 01 01 01 01 F4 02 01 81 00
|
||||
10 M2UA.SEND 00 21 05 01 80 00 A0 0A 00 42 01 38 01 3F 39 03 01 01 01 29 01 0F 08 01 0D 78 07 81 81 41 81 01 01 01 00
|
||||
10 M2UA.SEND 00 21 05 01 80 00 A0 0A 00 42 01 38 01 3F 39 03 01 01 01 29 01 0F 08 01 0D 78 07 81 81 41 81 01 01 01 00
|
||||
|
||||
|
||||
|
||||
10000000 M2UA.recv
|
||||
Reference in New Issue
Block a user