ocs init
This commit is contained in:
1 parent
5f1710dc22
commit
dae6fc93f7
1057 files changed
+519829
No files matched your search
Binary file not shown.
@@ -0,0 +1,160 @@
|
||||
# !/bin/sh
|
||||
# Makefile for heart beating processor
|
||||
# Created by Huang QL, 2000/12/26
|
||||
#If you want to include which Module,Set the INC_XXX=$(INC_TRUE),
|
||||
#or set it to $(INC_FALSE),then run the command: make alt
|
||||
INC_TRUE=1
|
||||
INC_FALSE=0
|
||||
|
||||
CC = gcc
|
||||
CFLAGS=-D_REENTRANT -D_MAX_64COS_COOK_ -Wall -Wno-unused-function -g -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ -I/usr/local/lib/glib-2.0/include -L/usr/local/lib -lglib-2.0
|
||||
#-O2
|
||||
prefix = /usr
|
||||
includedir = $(prefix)/include
|
||||
libdir = $(prefix)/lib
|
||||
localinclude = ../include
|
||||
platLIBPREFIX =../../../wxc2plat
|
||||
INC_FLAGS = -I$(includedir)
|
||||
INCLUDES = -I../include
|
||||
|
||||
XAPPLIB_FLAGS = -L$(platLIBPREFIX)/xapp
|
||||
XAPPLD_LIBRARY = -lxapp
|
||||
TCAPLIB_FLAGS = -L$(platLIBPREFIX)/tcap
|
||||
TCAPLD_LIBRARY = -ltcap
|
||||
SCCPLIB_FLAGS = -L$(platLIBPREFIX)/sccp
|
||||
SCCPLD_LIBRARY = -lsccp
|
||||
MTP3LIB_FLAGS = -L$(platLIBPREFIX)/mtp3 -lcurses
|
||||
MTP3LD_LIBRARY = -lmtp3
|
||||
PUBLICLIB_FLAGS = -L$(platLIBPREFIX)/public
|
||||
PUBLICLD_LIBRARY = -lpublic
|
||||
DEBUGLIB_FLAGS = -L$(platLIBPREFIX)/debug
|
||||
DEBUGLD_LIBRARY = -ldebug
|
||||
SNMPLIB_FLAGS_I = -L$(platLIBPREFIX)/snmp
|
||||
SNMPLD_LIBRARY_I = -lsnmp
|
||||
SMPPLIB_FLAGS = -L$(platLIBPREFIX)/smppold
|
||||
SMPPLD_LIBRARY = -lsmpp
|
||||
IPTRANS_FLAGS = -L$(platLIBPREFIX)/iptrans
|
||||
IPTRANS_LIBRARY = -liptrans
|
||||
SCF_FLAGS = -L$(platLIBPREFIX)/scf
|
||||
SCF_LIBRARY = -lscf
|
||||
PPS_FLAGS = -L ../../OPR/lib
|
||||
PPS_LIBRARY = -lopr
|
||||
|
||||
|
||||
|
||||
STATIC=
|
||||
|
||||
COMPILE.c=$(CC) $(CFLAGS)
|
||||
LINK.c=$(CC) $(CFLAGS)
|
||||
|
||||
COMPILE_SUFFIX=$(STATIC) $(INC_FLAGS)
|
||||
|
||||
LINK_SUFFIX= $(INC_FLAGS) \
|
||||
$(PUBLICLIB_FLAGS) $(PUBLICLD_LIBRARY) \
|
||||
$(SNMPLIB_FLAGS_I) $(SNMPLD_LIBRARY_I) \
|
||||
$(XAPPLIB_FLAGS) $(XAPPLD_LIBRARY) \
|
||||
$(TCAPLIB_FLAGS) $(TCAPLD_LIBRARY) \
|
||||
$(SCCPLIB_FLAGS) $(SCCPLD_LIBRARY) \
|
||||
$(MTP3LIB_FLAGS) $(MTP3LD_LIBRARY) \
|
||||
$(DEBUGLIB_FLAGS) $(DEBUGLD_LIBRARY) \
|
||||
$(SMPPLIB_FLAGS) $(SMPPLD_LIBRARY) \
|
||||
$(IPTRANS_FLAGS) $(IPTRANS_LIBRARY) \
|
||||
$(SCF_FLAGS) $(SCF_LIBRARY)\
|
||||
$(PPS_FLAGS) $(PPS_LIBRARY)
|
||||
|
||||
PROGS=ppsm
|
||||
|
||||
#pps_OBJ = ppsmain.o capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o ppsopr.o callingCardMsg.o callingCardState.o
|
||||
|
||||
pps_OBJ = capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o callingCardMsg.o callingCardState.o tariffApplication.o callMeBack.o freeSMS.o feeTransfer.o masterSlaveCard.o radius.o gprs.o vas.o restapi.o ocs_user_table.o pps_redis.o
|
||||
all:$(PROGS)
|
||||
#$(pps_OBJ)
|
||||
# executive file
|
||||
ppsm:$(pps_OBJ)
|
||||
@echo Linking $@
|
||||
@echo $(LINK_SUFFIX)
|
||||
# @$(LINK.c) -o $(PROGS) $(pps_OBJ) $(LINK_SUFFIX) -L../lib/ -lppsfuns -ldl -lz -lpopt -lncurses -lm
|
||||
|
||||
# obj files
|
||||
#ppsmain.o:ppsmain.c
|
||||
# $(COMPILE.c) -c ppsmain.c $(INCLUDES)
|
||||
capmsg.o:capmsg.c
|
||||
$(COMPILE.c) -c capmsg.c $(INCLUDES)
|
||||
|
||||
crd.o:crd.c
|
||||
$(COMPILE.c) -c crd.c $(INCLUDES)
|
||||
|
||||
dailyreport.o:dailyreport.c
|
||||
$(COMPILE.c) -c dailyreport.c $(INCLUDES)
|
||||
|
||||
loadtl.o:loadtl.c
|
||||
$(COMPILE.c) -c loadtl.c $(INCLUDES)
|
||||
|
||||
message.o:message.c
|
||||
$(COMPILE.c) -c message.c $(INCLUDES)
|
||||
|
||||
mfunc.o:mfunc.c
|
||||
$(COMPILE.c) -c mfunc.c $(INCLUDES)
|
||||
|
||||
ppsmap.o:ppsmap.c
|
||||
$(COMPILE.c) -c ppsmap.c $(INCLUDES)
|
||||
|
||||
ppsMibTable.o:ppsMibTable.c
|
||||
$(COMPILE.c) -c ppsMibTable.c $(INCLUDES)
|
||||
|
||||
ppsmib.o:ppsmib.c
|
||||
$(COMPILE.c) -c ppsmib.c $(INCLUDES)
|
||||
|
||||
ppsfunc.o:ppsfunc.c
|
||||
$(COMPILE.c) -c ppsfunc.c $(INCLUDES)
|
||||
|
||||
ppsm.o:ppsm.c
|
||||
$(COMPILE.c) -c ppsm.c $(INCLUDES)
|
||||
|
||||
precard.o:precard.c
|
||||
$(COMPILE.c) -c precard.c $(INCLUDES)
|
||||
|
||||
rammng.o:rammng.c
|
||||
$(COMPILE.c) -c rammng.c $(INCLUDES)
|
||||
|
||||
smppapi.o:smppapi.c
|
||||
$(COMPILE.c) -c smppapi.c $(INCLUDES)
|
||||
|
||||
ppsussd.o:ppsussd.c
|
||||
$(COMPILE.c) -c ppsussd.c $(INCLUDES)
|
||||
|
||||
callingCardMsg.o:callingCardMsg.c
|
||||
$(COMPILE.c) -c callingCardMsg.c $(INCLUDES)
|
||||
|
||||
callingCardState.o:callingCardState.c
|
||||
$(COMPILE.c) -c callingCardState.c $(INCLUDES)
|
||||
|
||||
|
||||
tariffApplication.o:tariffApplication.c
|
||||
$(COMPILE.c) -c tariffApplication.c $(INCLUDES)
|
||||
|
||||
callMeBack.o:callMeBack.c
|
||||
$(COMPILE.c) -c callMeBack.c $(INCLUDES)
|
||||
|
||||
freeSMS.o:freeSMS.c
|
||||
$(COMPILE.c) -c freeSMS.c $(INCLUDES)
|
||||
|
||||
feeTransfer.o:feeTransfer.c
|
||||
$(COMPILE.c) -c feeTransfer.c $(INCLUDES)
|
||||
|
||||
masterSlaveCard.o:masterSlaveCard.c
|
||||
$(COMPILE.c) -c masterSlaveCard.c $(INCLUDES)
|
||||
radius.o:radius.c
|
||||
$(COMPILE.c) -c radius.c $(INCLUDES)
|
||||
gprs.o:gprs.c
|
||||
$(COMPILE.c) -c gprs.c $(INCLUDES)
|
||||
vas.o:vas.c
|
||||
$(COMPILE.c) -c vas.c $(INCLUDES)
|
||||
restapi.o:restapi.c
|
||||
$(COMPILE.c) -c restapi.c $(INCLUDES)
|
||||
ocs_user_table.o:ocs_user_table.c
|
||||
$(COMPILE.c) -c ocs_user_table.c $(INCLUDES)
|
||||
pps_redis.o:pps_redis.c
|
||||
$(COMPILE.c) -c pps_redis.c $(INCLUDES)
|
||||
clean:
|
||||
rm -f *.c~ *.o core ppsm *.c.bak
|
||||
@@ -0,0 +1,163 @@
|
||||
# !/bin/sh
|
||||
# Makefile for heart beating processor
|
||||
# Created by Huang QL, 2000/12/26
|
||||
#If you want to include which Module,Set the INC_XXX=$(INC_TRUE),
|
||||
#or set it to $(INC_FALSE),then run the command: make alt
|
||||
INC_TRUE=1
|
||||
INC_FALSE=0
|
||||
|
||||
CC = gcc
|
||||
CFLAGS=-D_REENTRANT -Wall -Wno-unused-function -g
|
||||
CFLAGS_IN=-D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
|
||||
|
||||
#-O2
|
||||
prefix = /usr
|
||||
includedir = $(prefix)/include
|
||||
libdir = $(prefix)/lib
|
||||
localinclude = ../include
|
||||
platLIBPREFIX =../../../wxc2plat
|
||||
INC_FLAGS = -I$(includedir)
|
||||
INCLUDES = -I../include
|
||||
|
||||
XAPPLIB_FLAGS = -L$(platLIBPREFIX)/xapp
|
||||
XAPPLD_LIBRARY = -lxapp
|
||||
TCAPLIB_FLAGS = -L$(platLIBPREFIX)/tcap
|
||||
TCAPLD_LIBRARY = -ltcap
|
||||
SCCPLIB_FLAGS = -L$(platLIBPREFIX)/sccp
|
||||
SCCPLD_LIBRARY = -lsccp
|
||||
MTP3LIB_FLAGS = -L$(platLIBPREFIX)/mtp3 -lcurses
|
||||
MTP3LD_LIBRARY = -lmtp3
|
||||
PUBLICLIB_FLAGS = -L$(platLIBPREFIX)/public
|
||||
PUBLICLD_LIBRARY = -lpublic
|
||||
DEBUGLIB_FLAGS = -L$(platLIBPREFIX)/debug
|
||||
DEBUGLD_LIBRARY = -ldebug
|
||||
SNMPLIB_FLAGS_I = -L$(platLIBPREFIX)/snmp
|
||||
SNMPLD_LIBRARY_I = -lsnmp
|
||||
SMPPLIB_FLAGS = -L$(platLIBPREFIX)/smppold
|
||||
SMPPLD_LIBRARY = -lsmpp
|
||||
IPTRANS_FLAGS = -L$(platLIBPREFIX)/iptrans
|
||||
IPTRANS_LIBRARY = -liptrans
|
||||
SCF_FLAGS = -L$(platLIBPREFIX)/scf
|
||||
SCF_LIBRARY = -lscf
|
||||
PPS_FLAGS = -L ../../OPR/lib
|
||||
PPS_LIBRARY = -lopr
|
||||
|
||||
|
||||
|
||||
STATIC=
|
||||
|
||||
COMPILE.c=$(CC) $(CFLAGS) $(CFLAGS_IN)
|
||||
LINK.c=$(CC) $(CFLAGS)
|
||||
|
||||
COMPILE_SUFFIX=$(STATIC) $(INC_FLAGS)
|
||||
|
||||
LINK_SUFFIX= $(INC_FLAGS) \
|
||||
$(PUBLICLIB_FLAGS) $(PUBLICLD_LIBRARY) \
|
||||
$(SNMPLIB_FLAGS_I) $(SNMPLD_LIBRARY_I) \
|
||||
$(XAPPLIB_FLAGS) $(XAPPLD_LIBRARY) \
|
||||
$(TCAPLIB_FLAGS) $(TCAPLD_LIBRARY) \
|
||||
$(SCCPLIB_FLAGS) $(SCCPLD_LIBRARY) \
|
||||
$(MTP3LIB_FLAGS) $(MTP3LD_LIBRARY) \
|
||||
$(DEBUGLIB_FLAGS) $(DEBUGLD_LIBRARY) \
|
||||
$(SMPPLIB_FLAGS) $(SMPPLD_LIBRARY) \
|
||||
$(IPTRANS_FLAGS) $(IPTRANS_LIBRARY) \
|
||||
$(SCF_FLAGS) $(SCF_LIBRARY)\
|
||||
$(PPS_FLAGS) $(PPS_LIBRARY)
|
||||
|
||||
PROGS=ppsm
|
||||
|
||||
#pps_OBJ = ppsmain.o capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o ppsopr.o callingCardMsg.o callingCardState.o
|
||||
|
||||
pps_OBJ = capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o callingCardMsg.o callingCardState.o tariffApplication.o callMeBack.o freeSMS.o feeTransfer.o masterSlaveCard.o radius.o gprs.o vas.o restapi.o ocs_user_table.o pps_redis.o
|
||||
all:$(PROGS)
|
||||
#$(pps_OBJ)
|
||||
# executive file
|
||||
ppsm:$(pps_OBJ)
|
||||
@echo Linking $@
|
||||
@echo $(LINK_SUFFIX)
|
||||
# @$(LINK.c) -o $(PROGS) $(pps_OBJ) $(LINK_SUFFIX) -L../lib/ -lppsfuns -ldl -lz -lpopt -lncurses -lm
|
||||
|
||||
# obj files
|
||||
#ppsmain.o:ppsmain.c
|
||||
# $(COMPILE.c) -c ppsmain.c $(INCLUDES)
|
||||
capmsg.o:capmsg.c
|
||||
$(COMPILE.c) -c capmsg.c $(INCLUDES)
|
||||
|
||||
crd.o:crd.c
|
||||
$(COMPILE.c) -c crd.c $(INCLUDES)
|
||||
|
||||
dailyreport.o:dailyreport.c
|
||||
$(COMPILE.c) -c dailyreport.c $(INCLUDES)
|
||||
|
||||
loadtl.o:loadtl.c
|
||||
$(COMPILE.c) -c loadtl.c $(INCLUDES)
|
||||
|
||||
message.o:message.c
|
||||
$(COMPILE.c) -c message.c $(INCLUDES)
|
||||
|
||||
mfunc.o:mfunc.c
|
||||
$(COMPILE.c) -c mfunc.c $(INCLUDES)
|
||||
|
||||
ppsmap.o:ppsmap.c
|
||||
$(COMPILE.c) -c ppsmap.c $(INCLUDES)
|
||||
|
||||
ppsMibTable.o:ppsMibTable.c
|
||||
$(COMPILE.c) -c ppsMibTable.c $(INCLUDES)
|
||||
|
||||
ppsmib.o:ppsmib.c
|
||||
$(COMPILE.c) -c ppsmib.c $(INCLUDES)
|
||||
|
||||
ppsfunc.o:ppsfunc.c
|
||||
$(COMPILE.c) -c ppsfunc.c $(INCLUDES)
|
||||
|
||||
ppsm.o:ppsm.c
|
||||
$(COMPILE.c) -c ppsm.c $(INCLUDES)
|
||||
|
||||
precard.o:precard.c
|
||||
$(COMPILE.c) -c precard.c $(INCLUDES)
|
||||
|
||||
rammng.o:rammng.c
|
||||
$(COMPILE.c) -c rammng.c $(INCLUDES)
|
||||
|
||||
smppapi.o:smppapi.c
|
||||
$(COMPILE.c) -c smppapi.c $(INCLUDES)
|
||||
|
||||
ppsussd.o:ppsussd.c
|
||||
$(COMPILE.c) -c ppsussd.c $(INCLUDES)
|
||||
|
||||
callingCardMsg.o:callingCardMsg.c
|
||||
$(COMPILE.c) -c callingCardMsg.c $(INCLUDES)
|
||||
|
||||
callingCardState.o:callingCardState.c
|
||||
$(COMPILE.c) -c callingCardState.c $(INCLUDES)
|
||||
|
||||
|
||||
tariffApplication.o:tariffApplication.c
|
||||
$(COMPILE.c) -c tariffApplication.c $(INCLUDES)
|
||||
|
||||
callMeBack.o:callMeBack.c
|
||||
$(COMPILE.c) -c callMeBack.c $(INCLUDES)
|
||||
|
||||
freeSMS.o:freeSMS.c
|
||||
$(COMPILE.c) -c freeSMS.c $(INCLUDES)
|
||||
|
||||
feeTransfer.o:feeTransfer.c
|
||||
$(COMPILE.c) -c feeTransfer.c $(INCLUDES)
|
||||
|
||||
masterSlaveCard.o:masterSlaveCard.c
|
||||
$(COMPILE.c) -c masterSlaveCard.c $(INCLUDES)
|
||||
radius.o:radius.c
|
||||
$(COMPILE.c) -c radius.c $(INCLUDES)
|
||||
gprs.o:gprs.c
|
||||
$(COMPILE.c) -c gprs.c $(INCLUDES)
|
||||
vas.o:vas.c
|
||||
$(COMPILE.c) -c vas.c $(INCLUDES)
|
||||
restapi.o:restapi.c
|
||||
$(COMPILE.c) -c restapi.c $(INCLUDES)
|
||||
ocs_user_table.o:ocs_user_table.c
|
||||
$(COMPILE.c) -c ocs_user_table.c $(INCLUDES)
|
||||
pps_redis.o:pps_redis.c
|
||||
$(COMPILE.c) -c pps_redis.c $(INCLUDES)
|
||||
clean:
|
||||
rm -f *.c~ *.o core ppsm *.c.bak
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
# !/bin/sh
|
||||
# Makefile for heart beating processor
|
||||
# Created by Huang QL, 2000/12/26
|
||||
#If you want to include which Module,Set the INC_XXX=$(INC_TRUE),
|
||||
#or set it to $(INC_FALSE),then run the command: make alt
|
||||
INC_TRUE=1
|
||||
INC_FALSE=0
|
||||
|
||||
CC = gcc
|
||||
CFLAGS=-D_REENTRANT -DOCS_USE_REDIS_DB -Wall -Wno-unused-function -g
|
||||
CFLAGS_IN=-D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
|
||||
|
||||
#-O2
|
||||
prefix = /usr
|
||||
includedir = $(prefix)/include
|
||||
libdir = $(prefix)/lib
|
||||
localinclude = ../include
|
||||
platLIBPREFIX =../../../wxc2plat
|
||||
INC_FLAGS = -I$(includedir)
|
||||
INCLUDES = -I../include
|
||||
|
||||
XAPPLIB_FLAGS = -L$(platLIBPREFIX)/xapp
|
||||
XAPPLD_LIBRARY = -lxapp
|
||||
TCAPLIB_FLAGS = -L$(platLIBPREFIX)/tcap
|
||||
TCAPLD_LIBRARY = -ltcap
|
||||
SCCPLIB_FLAGS = -L$(platLIBPREFIX)/sccp
|
||||
SCCPLD_LIBRARY = -lsccp
|
||||
MTP3LIB_FLAGS = -L$(platLIBPREFIX)/mtp3 -lcurses
|
||||
MTP3LD_LIBRARY = -lmtp3
|
||||
PUBLICLIB_FLAGS = -L$(platLIBPREFIX)/public
|
||||
PUBLICLD_LIBRARY = -lpublic
|
||||
DEBUGLIB_FLAGS = -L$(platLIBPREFIX)/debug
|
||||
DEBUGLD_LIBRARY = -ldebug
|
||||
SNMPLIB_FLAGS_I = -L$(platLIBPREFIX)/snmp
|
||||
SNMPLD_LIBRARY_I = -lsnmp
|
||||
SMPPLIB_FLAGS = -L$(platLIBPREFIX)/smppold
|
||||
SMPPLD_LIBRARY = -lsmpp
|
||||
IPTRANS_FLAGS = -L$(platLIBPREFIX)/iptrans
|
||||
IPTRANS_LIBRARY = -liptrans
|
||||
SCF_FLAGS = -L$(platLIBPREFIX)/scf
|
||||
SCF_LIBRARY = -lscf
|
||||
PPS_FLAGS = -L ../../OPR/lib
|
||||
PPS_LIBRARY = -lopr
|
||||
|
||||
|
||||
|
||||
STATIC=
|
||||
|
||||
COMPILE.c=$(CC) $(CFLAGS) $(CFLAGS_IN)
|
||||
LINK.c=$(CC) $(CFLAGS)
|
||||
|
||||
COMPILE_SUFFIX=$(STATIC) $(INC_FLAGS)
|
||||
|
||||
LINK_SUFFIX= $(INC_FLAGS) \
|
||||
$(PUBLICLIB_FLAGS) $(PUBLICLD_LIBRARY) \
|
||||
$(SNMPLIB_FLAGS_I) $(SNMPLD_LIBRARY_I) \
|
||||
$(XAPPLIB_FLAGS) $(XAPPLD_LIBRARY) \
|
||||
$(TCAPLIB_FLAGS) $(TCAPLD_LIBRARY) \
|
||||
$(SCCPLIB_FLAGS) $(SCCPLD_LIBRARY) \
|
||||
$(MTP3LIB_FLAGS) $(MTP3LD_LIBRARY) \
|
||||
$(DEBUGLIB_FLAGS) $(DEBUGLD_LIBRARY) \
|
||||
$(SMPPLIB_FLAGS) $(SMPPLD_LIBRARY) \
|
||||
$(IPTRANS_FLAGS) $(IPTRANS_LIBRARY) \
|
||||
$(SCF_FLAGS) $(SCF_LIBRARY)\
|
||||
$(PPS_FLAGS) $(PPS_LIBRARY)
|
||||
|
||||
PROGS=ppsm
|
||||
|
||||
#pps_OBJ = ppsmain.o capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o ppsopr.o callingCardMsg.o callingCardState.o
|
||||
|
||||
pps_OBJ = capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o callingCardMsg.o callingCardState.o tariffApplication.o callMeBack.o freeSMS.o feeTransfer.o masterSlaveCard.o radius.o gprs.o vas.o restapi.o ocs_user_table.o pps_redis.o
|
||||
all:$(PROGS)
|
||||
#$(pps_OBJ)
|
||||
# executive file
|
||||
ppsm:$(pps_OBJ)
|
||||
@echo Linking $@
|
||||
@echo $(LINK_SUFFIX)
|
||||
# @$(LINK.c) -o $(PROGS) $(pps_OBJ) $(LINK_SUFFIX) -L../lib/ -lppsfuns -ldl -lz -lpopt -lncurses -lm
|
||||
|
||||
# obj files
|
||||
#ppsmain.o:ppsmain.c
|
||||
# $(COMPILE.c) -c ppsmain.c $(INCLUDES)
|
||||
capmsg.o:capmsg.c
|
||||
$(COMPILE.c) -c capmsg.c $(INCLUDES)
|
||||
|
||||
crd.o:crd.c
|
||||
$(COMPILE.c) -c crd.c $(INCLUDES)
|
||||
|
||||
dailyreport.o:dailyreport.c
|
||||
$(COMPILE.c) -c dailyreport.c $(INCLUDES)
|
||||
|
||||
loadtl.o:loadtl.c
|
||||
$(COMPILE.c) -c loadtl.c $(INCLUDES)
|
||||
|
||||
message.o:message.c
|
||||
$(COMPILE.c) -c message.c $(INCLUDES)
|
||||
|
||||
mfunc.o:mfunc.c
|
||||
$(COMPILE.c) -c mfunc.c $(INCLUDES)
|
||||
|
||||
ppsmap.o:ppsmap.c
|
||||
$(COMPILE.c) -c ppsmap.c $(INCLUDES)
|
||||
|
||||
ppsMibTable.o:ppsMibTable.c
|
||||
$(COMPILE.c) -c ppsMibTable.c $(INCLUDES)
|
||||
|
||||
ppsmib.o:ppsmib.c
|
||||
$(COMPILE.c) -c ppsmib.c $(INCLUDES)
|
||||
|
||||
ppsfunc.o:ppsfunc.c
|
||||
$(COMPILE.c) -c ppsfunc.c $(INCLUDES)
|
||||
|
||||
ppsm.o:ppsm.c
|
||||
$(COMPILE.c) -c ppsm.c $(INCLUDES)
|
||||
|
||||
precard.o:precard.c
|
||||
$(COMPILE.c) -c precard.c $(INCLUDES)
|
||||
|
||||
rammng.o:rammng.c
|
||||
$(COMPILE.c) -c rammng.c $(INCLUDES)
|
||||
|
||||
smppapi.o:smppapi.c
|
||||
$(COMPILE.c) -c smppapi.c $(INCLUDES)
|
||||
|
||||
ppsussd.o:ppsussd.c
|
||||
$(COMPILE.c) -c ppsussd.c $(INCLUDES)
|
||||
|
||||
callingCardMsg.o:callingCardMsg.c
|
||||
$(COMPILE.c) -c callingCardMsg.c $(INCLUDES)
|
||||
|
||||
callingCardState.o:callingCardState.c
|
||||
$(COMPILE.c) -c callingCardState.c $(INCLUDES)
|
||||
|
||||
|
||||
tariffApplication.o:tariffApplication.c
|
||||
$(COMPILE.c) -c tariffApplication.c $(INCLUDES)
|
||||
|
||||
callMeBack.o:callMeBack.c
|
||||
$(COMPILE.c) -c callMeBack.c $(INCLUDES)
|
||||
|
||||
freeSMS.o:freeSMS.c
|
||||
$(COMPILE.c) -c freeSMS.c $(INCLUDES)
|
||||
|
||||
feeTransfer.o:feeTransfer.c
|
||||
$(COMPILE.c) -c feeTransfer.c $(INCLUDES)
|
||||
|
||||
masterSlaveCard.o:masterSlaveCard.c
|
||||
$(COMPILE.c) -c masterSlaveCard.c $(INCLUDES)
|
||||
radius.o:radius.c
|
||||
$(COMPILE.c) -c radius.c $(INCLUDES)
|
||||
gprs.o:gprs.c
|
||||
$(COMPILE.c) -c gprs.c $(INCLUDES)
|
||||
vas.o:vas.c
|
||||
$(COMPILE.c) -c vas.c $(INCLUDES)
|
||||
restapi.o:restapi.c
|
||||
$(COMPILE.c) -c restapi.c $(INCLUDES)
|
||||
ocs_user_table.o:ocs_user_table.c
|
||||
$(COMPILE.c) -c ocs_user_table.c $(INCLUDES)
|
||||
pps_redis.o:pps_redis.c
|
||||
$(COMPILE.c) -c pps_redis.c $(INCLUDES)
|
||||
clean:
|
||||
rm -f *.c~ *.o core ppsm *.c.bak
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
# !/bin/sh
|
||||
# Makefile for heart beating processor
|
||||
# Created by Huang QL, 2000/12/26
|
||||
#If you want to include which Module,Set the INC_XXX=$(INC_TRUE),
|
||||
#or set it to $(INC_FALSE),then run the command: make alt
|
||||
INC_TRUE=1
|
||||
INC_FALSE=0
|
||||
|
||||
CC = gcc
|
||||
CFLAGS=-D_REENTRANT -D_ZED_NO_CALLER_NUM_AND_EXPIRY_DATE_ -Wall -Wno-unused-function -g
|
||||
CFLAGS_IN=-D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
|
||||
|
||||
#-O2
|
||||
prefix = /usr
|
||||
includedir = $(prefix)/include
|
||||
libdir = $(prefix)/lib
|
||||
localinclude = ../include
|
||||
platLIBPREFIX =../../../wxc2plat
|
||||
INC_FLAGS = -I$(includedir)
|
||||
INCLUDES = -I../include
|
||||
|
||||
XAPPLIB_FLAGS = -L$(platLIBPREFIX)/xapp
|
||||
XAPPLD_LIBRARY = -lxapp
|
||||
TCAPLIB_FLAGS = -L$(platLIBPREFIX)/tcap
|
||||
TCAPLD_LIBRARY = -ltcap
|
||||
SCCPLIB_FLAGS = -L$(platLIBPREFIX)/sccp
|
||||
SCCPLD_LIBRARY = -lsccp
|
||||
MTP3LIB_FLAGS = -L$(platLIBPREFIX)/mtp3 -lcurses
|
||||
MTP3LD_LIBRARY = -lmtp3
|
||||
PUBLICLIB_FLAGS = -L$(platLIBPREFIX)/public
|
||||
PUBLICLD_LIBRARY = -lpublic
|
||||
DEBUGLIB_FLAGS = -L$(platLIBPREFIX)/debug
|
||||
DEBUGLD_LIBRARY = -ldebug
|
||||
SNMPLIB_FLAGS_I = -L$(platLIBPREFIX)/snmp
|
||||
SNMPLD_LIBRARY_I = -lsnmp
|
||||
SMPPLIB_FLAGS = -L$(platLIBPREFIX)/smppold
|
||||
SMPPLD_LIBRARY = -lsmpp
|
||||
IPTRANS_FLAGS = -L$(platLIBPREFIX)/iptrans
|
||||
IPTRANS_LIBRARY = -liptrans
|
||||
SCF_FLAGS = -L$(platLIBPREFIX)/scf
|
||||
SCF_LIBRARY = -lscf
|
||||
PPS_FLAGS = -L ../../OPR/lib
|
||||
PPS_LIBRARY = -lopr
|
||||
|
||||
|
||||
|
||||
STATIC=
|
||||
|
||||
COMPILE.c=$(CC) $(CFLAGS) $(CFLAGS_IN)
|
||||
LINK.c=$(CC) $(CFLAGS)
|
||||
|
||||
COMPILE_SUFFIX=$(STATIC) $(INC_FLAGS)
|
||||
|
||||
LINK_SUFFIX= $(INC_FLAGS) \
|
||||
$(PUBLICLIB_FLAGS) $(PUBLICLD_LIBRARY) \
|
||||
$(SNMPLIB_FLAGS_I) $(SNMPLD_LIBRARY_I) \
|
||||
$(XAPPLIB_FLAGS) $(XAPPLD_LIBRARY) \
|
||||
$(TCAPLIB_FLAGS) $(TCAPLD_LIBRARY) \
|
||||
$(SCCPLIB_FLAGS) $(SCCPLD_LIBRARY) \
|
||||
$(MTP3LIB_FLAGS) $(MTP3LD_LIBRARY) \
|
||||
$(DEBUGLIB_FLAGS) $(DEBUGLD_LIBRARY) \
|
||||
$(SMPPLIB_FLAGS) $(SMPPLD_LIBRARY) \
|
||||
$(IPTRANS_FLAGS) $(IPTRANS_LIBRARY) \
|
||||
$(SCF_FLAGS) $(SCF_LIBRARY)\
|
||||
$(PPS_FLAGS) $(PPS_LIBRARY)
|
||||
|
||||
PROGS=ppsm
|
||||
|
||||
#pps_OBJ = ppsmain.o capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o ppsopr.o callingCardMsg.o callingCardState.o
|
||||
|
||||
pps_OBJ = capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o callingCardMsg.o callingCardState.o tariffApplication.o callMeBack.o freeSMS.o feeTransfer.o masterSlaveCard.o radius.o gprs.o vas.o restapi.o ocs_user_table.o pps_redis.o
|
||||
all:$(PROGS)
|
||||
#$(pps_OBJ)
|
||||
# executive file
|
||||
ppsm:$(pps_OBJ)
|
||||
@echo Linking $@
|
||||
@echo $(LINK_SUFFIX)
|
||||
# @$(LINK.c) -o $(PROGS) $(pps_OBJ) $(LINK_SUFFIX) -L../lib/ -lppsfuns -ldl -lz -lpopt -lncurses -lm
|
||||
|
||||
# obj files
|
||||
#ppsmain.o:ppsmain.c
|
||||
# $(COMPILE.c) -c ppsmain.c $(INCLUDES)
|
||||
capmsg.o:capmsg.c
|
||||
$(COMPILE.c) -c capmsg.c $(INCLUDES)
|
||||
|
||||
crd.o:crd.c
|
||||
$(COMPILE.c) -c crd.c $(INCLUDES)
|
||||
|
||||
dailyreport.o:dailyreport.c
|
||||
$(COMPILE.c) -c dailyreport.c $(INCLUDES)
|
||||
|
||||
loadtl.o:loadtl.c
|
||||
$(COMPILE.c) -c loadtl.c $(INCLUDES)
|
||||
|
||||
message.o:message.c
|
||||
$(COMPILE.c) -c message.c $(INCLUDES)
|
||||
|
||||
mfunc.o:mfunc.c
|
||||
$(COMPILE.c) -c mfunc.c $(INCLUDES)
|
||||
|
||||
ppsmap.o:ppsmap.c
|
||||
$(COMPILE.c) -c ppsmap.c $(INCLUDES)
|
||||
|
||||
ppsMibTable.o:ppsMibTable.c
|
||||
$(COMPILE.c) -c ppsMibTable.c $(INCLUDES)
|
||||
|
||||
ppsmib.o:ppsmib.c
|
||||
$(COMPILE.c) -c ppsmib.c $(INCLUDES)
|
||||
|
||||
ppsfunc.o:ppsfunc.c
|
||||
$(COMPILE.c) -c ppsfunc.c $(INCLUDES)
|
||||
|
||||
ppsm.o:ppsm.c
|
||||
$(COMPILE.c) -c ppsm.c $(INCLUDES)
|
||||
|
||||
precard.o:precard.c
|
||||
$(COMPILE.c) -c precard.c $(INCLUDES)
|
||||
|
||||
rammng.o:rammng.c
|
||||
$(COMPILE.c) -c rammng.c $(INCLUDES)
|
||||
|
||||
smppapi.o:smppapi.c
|
||||
$(COMPILE.c) -c smppapi.c $(INCLUDES)
|
||||
|
||||
ppsussd.o:ppsussd.c
|
||||
$(COMPILE.c) -c ppsussd.c $(INCLUDES)
|
||||
|
||||
callingCardMsg.o:callingCardMsg.c
|
||||
$(COMPILE.c) -c callingCardMsg.c $(INCLUDES)
|
||||
|
||||
callingCardState.o:callingCardState.c
|
||||
$(COMPILE.c) -c callingCardState.c $(INCLUDES)
|
||||
|
||||
|
||||
tariffApplication.o:tariffApplication.c
|
||||
$(COMPILE.c) -c tariffApplication.c $(INCLUDES)
|
||||
|
||||
callMeBack.o:callMeBack.c
|
||||
$(COMPILE.c) -c callMeBack.c $(INCLUDES)
|
||||
|
||||
freeSMS.o:freeSMS.c
|
||||
$(COMPILE.c) -c freeSMS.c $(INCLUDES)
|
||||
|
||||
feeTransfer.o:feeTransfer.c
|
||||
$(COMPILE.c) -c feeTransfer.c $(INCLUDES)
|
||||
|
||||
masterSlaveCard.o:masterSlaveCard.c
|
||||
$(COMPILE.c) -c masterSlaveCard.c $(INCLUDES)
|
||||
radius.o:radius.c
|
||||
$(COMPILE.c) -c radius.c $(INCLUDES)
|
||||
gprs.o:gprs.c
|
||||
$(COMPILE.c) -c gprs.c $(INCLUDES)
|
||||
vas.o:vas.c
|
||||
$(COMPILE.c) -c vas.c $(INCLUDES)
|
||||
restapi.o:restapi.c
|
||||
$(COMPILE.c) -c restapi.c $(INCLUDES)
|
||||
ocs_user_table.o:ocs_user_table.c
|
||||
$(COMPILE.c) -c ocs_user_table.c $(INCLUDES)
|
||||
pps_redis.o:pps_redis.c
|
||||
$(COMPILE.c) -c pps_redis.c $(INCLUDES)
|
||||
clean:
|
||||
rm -f *.c~ *.o core ppsm *.c.bak
|
||||
|
||||
@@ -0,0 +1,508 @@
|
||||
|
||||
#include "../include/includes.h"
|
||||
#include "../include/ppsm.h"
|
||||
#include "../include/ramdata.h"
|
||||
#include "../include/ppsinf.h"
|
||||
#include "../include/message.h"
|
||||
#include "../include/iofunc.h"
|
||||
#include "../include/version.h"
|
||||
#include "../include/pps_public.h"
|
||||
#include "../include/cdrme.h"
|
||||
#include "../include/param.h"
|
||||
|
||||
#include "../include/plat_inc.h"
|
||||
|
||||
#include "../include/ppsMibTable.h"
|
||||
#include "../include/mfunc.h"
|
||||
|
||||
extern int xappCheckIfLocalMSISDN(char *msisdn);
|
||||
|
||||
extern PPSParamStruct ppsParam;
|
||||
extern struct timeval tvnow;
|
||||
extern _ram_data *ramshm_ptr;
|
||||
extern _state_machine *smshm_ptr;;
|
||||
|
||||
extern int SendUSSDRequest(u_short portid, char *ussd_info);
|
||||
extern int smppSendMsg(u_char *peerNumber,u_char *msg,u_char serviceNumPosition);
|
||||
extern int SendPSSREnd(u_short portid, char *ussd_info);
|
||||
|
||||
|
||||
static int SendCMBRequest(u_short portid,u8 ussdSmsFlag)
|
||||
{
|
||||
char tmp[MAX_SMS_LEN*4];
|
||||
_state_data *shmp;
|
||||
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
strcpy(tmp, (char *)getSmsSentenceNative(0,SMS_CMB_PROMPT));
|
||||
switch(ussdSmsFlag)
|
||||
{
|
||||
case USSD_TRANSFER:
|
||||
SendUSSDRequest(portid,tmp);
|
||||
break;
|
||||
case SMS_TRANSFER:
|
||||
default:
|
||||
smppSendMsg(shmp->caller_info.number, (u_char *)tmp,CallMeBackPosition);
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int SendCMBNotifyDestRequest(u_short portid,u8 ussdSmsFlag)
|
||||
{
|
||||
//u_char tmpMsisdn[32],tmpMsisdn1[32];
|
||||
_state_data *shmp;
|
||||
char dayTimeReadable[32]={0}, tmp[MAX_SMS_LEN*4];
|
||||
|
||||
if(portid>=MAX_FSM_PROCESS) return 0;
|
||||
|
||||
ppsgetdaytime_readFormat(dayTimeReadable);
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
cliManipulationFunction((char *)shmp->caller_info.number, (char *)shmp->process_info.ppsService.callMeBack.destNumber);
|
||||
strcpy(tmp, (char *)shmp->caller_info.number);
|
||||
|
||||
strcat(tmp, (char *)getSmsSentenceNative(0,SMS_CMB_NOTIFY));
|
||||
sprintf(tmp+strlen(tmp)," %s %s ", (char *)getSmsSentenceNative(0,SMS_ON), dayTimeReadable);
|
||||
strcat(tmp, (char *)getSmsSentenceNative(0,SMS_CMB_AD));
|
||||
smppSendMOSM((char *)shmp->process_info.ppsService.callMeBack.destNumber,
|
||||
(char *)shmp->caller_info.number,
|
||||
(u_char *)tmp,
|
||||
strlen(tmp),
|
||||
0
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int SendReinputCMBRequest(u_short portid,u8 ussdSmsFlag)
|
||||
{
|
||||
char tmp[MAX_SMS_LEN*4] = {0};
|
||||
_state_data *shmp;
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
strcpy(tmp, (char *)getSmsSentenceNative(0,SMS_FORMAT_ERROR));
|
||||
strcat(tmp, (char *)getSmsSentenceNative(0,SMS_CMB_PROMPT));
|
||||
switch(ussdSmsFlag)
|
||||
{
|
||||
case USSD_TRANSFER:
|
||||
SendUSSDRequest(portid,tmp);
|
||||
break;
|
||||
case SMS_TRANSFER:
|
||||
default:
|
||||
smppSendMsg(shmp->caller_info.number, (u_char *)tmp,CallMeBackPosition);
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int SendCMBDstNumberErrorRequest(u_short portid,u8 ussdSmsFlag)
|
||||
{
|
||||
char tmp[MAX_SMS_LEN*4] = {0};
|
||||
_state_data *shmp;
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
strcpy(tmp, (char *)getSmsSentenceNative(0,SMS_INVALID_NUMBER));
|
||||
strcat(tmp, (char *)getSmsSentenceNative(0,SMS_CMB_PROMPT));
|
||||
|
||||
switch(ussdSmsFlag)
|
||||
{
|
||||
case USSD_TRANSFER:
|
||||
SendUSSDRequest(portid,tmp);
|
||||
break;
|
||||
case SMS_TRANSFER:
|
||||
default:
|
||||
smppSendMsg(shmp->caller_info.number, (u_char *)tmp,CallMeBackPosition);
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int SendCMBLimited(u_short portid,u8 ussdSmsFlag)
|
||||
{
|
||||
char tmp[MAX_SMS_LEN*4] = {0};
|
||||
_state_data *shmp;
|
||||
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
strcpy(tmp, (char *)getSmsSentenceNative(0,SMS_CMB_REACH_MAX_LIMIT));
|
||||
switch(ussdSmsFlag)
|
||||
{
|
||||
case USSD_TRANSFER:
|
||||
SendPSSREnd(portid,tmp);
|
||||
break;
|
||||
case SMS_TRANSFER:
|
||||
default:
|
||||
smppSendMsg(shmp->caller_info.number, (u_char *)tmp,CallMeBackPosition);
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int getCMBInfo(u_short portid,u_char *ussd_data)
|
||||
{/* format:number*amount */
|
||||
_state_data *shmp;
|
||||
u8 i,len;
|
||||
|
||||
PutLogFunID("getTransferInfo");
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
len = strlen((char *)ussd_data);
|
||||
if(len <= 0)
|
||||
return -1;
|
||||
for(i = 0;i < len;i++)
|
||||
{/* only '0' - '9' are allowed */
|
||||
if(ussd_data[i] < '0' || ussd_data[i] > '9')
|
||||
return -1;
|
||||
}
|
||||
|
||||
CutUnknownPrefix((char *)ussd_data);
|
||||
if(strlen((char *)ussd_data)>MAX_ASCII_NUMBER_LEN)
|
||||
return -1;
|
||||
|
||||
if(!strcmp((char *)shmp->caller_info.number, (char *)ussd_data))
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
strcpy((char *)shmp->process_info.ppsService.callMeBack.destNumber, (char *)ussd_data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define changeCMBState(portid,val) do { \
|
||||
callMeBack = &shmp->process_info.ppsService.callMeBack;\
|
||||
callMeBack->state = val; \
|
||||
shmp->process_info.serviceInput = 0;\
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]\33[32m%s\33[0m transfer to state \33[36m%s\33[0m", portid, __FUNCTION__, #val); \
|
||||
} while(0)
|
||||
|
||||
static u8 getCMBState(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
return shmp->process_info.ppsService.callMeBack.state;
|
||||
}
|
||||
|
||||
void clearCMBInfo(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
|
||||
PutLogFunID("clearTransferInfo");
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
memset(&shmp->process_info.ppsService.callMeBack,0,sizeof(CMB));
|
||||
}
|
||||
|
||||
static BOOL checkIfLocalNumber(u_char *number)
|
||||
{
|
||||
if(xappCheckIfLocalMSISDN((char *)number) == 1)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL checkCMBDestNumber(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
_account_info account;
|
||||
|
||||
PutLogFunID("clearTransferInfo");
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
strcpy((char *)account.number, (char *)shmp->process_info.ppsService.callMeBack.destNumber);
|
||||
return checkIfLocalNumber(account.number);
|
||||
}
|
||||
|
||||
|
||||
int saveCMBSMSACK(u_short portid,u_char *sms)
|
||||
{
|
||||
_state_data *shmp;
|
||||
u8 len;
|
||||
|
||||
PutLogFunID("saveSMSACK");
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
len = strlen((char *)sms) % MAX_INPUT_SMS;
|
||||
|
||||
memcpy(shmp->process_info.ppsService.callMeBack.inputSMS,sms,len);
|
||||
shmp->process_info.ppsService.callMeBack.inputSMS[len] = 0;
|
||||
shmp->process_info.ppsService.callMeBack.smsTrigger = TRUE;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
static int getCMBSMSACK(u_short portid,u_char *sms)
|
||||
{
|
||||
_state_data *shmp;
|
||||
|
||||
PutLogFunID("getSMSACK");
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
if(shmp->process_info.ppsService.callMeBack.smsTrigger == FALSE)
|
||||
return 0;
|
||||
|
||||
shmp->process_info.ppsService.callMeBack.smsTrigger = FALSE;
|
||||
strcpy((char *)sms, (char *)shmp->process_info.ppsService.callMeBack.inputSMS);
|
||||
return strlen((char *)sms);
|
||||
}
|
||||
|
||||
extern BOOL isPrepaidUser(_account_info *ptr);
|
||||
static int isCMBAllowed(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
COSTable *cosTableItem;
|
||||
int cosID=0,cmbTimes;
|
||||
BOOL balanceExpired=FALSE,promotionExpired=FALSE;
|
||||
float balance = 0;
|
||||
|
||||
PutLogFunID("isCMBAllowed");
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
if(isPrepaidUser(&shmp->caller_info) == TRUE)
|
||||
cosID = GetLocalCosID(&shmp->caller_info);
|
||||
else
|
||||
{
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]postpaid user %s ,cmb fail",portid,shmp->caller_info.number);
|
||||
return 1;
|
||||
}
|
||||
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cosID];
|
||||
|
||||
if(cosTableItem->serviceControl[0].callMeBackMaxTimes > 0)
|
||||
{
|
||||
cmbTimes = GetCMBTimes(&shmp->caller_info);
|
||||
if(cmbTimes >= cosTableItem->serviceControl[0].callMeBackMaxTimes)
|
||||
{
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]user %s reach max call me back times",portid,shmp->caller_info.number);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
if(GetExpiration(&shmp->caller_info) <= tvnow.tv_sec)
|
||||
{
|
||||
balanceExpired = TRUE;
|
||||
}
|
||||
else
|
||||
balance += GetBalanceWithOutPromotion(shmp->caller_info.head,shmp->caller_info.tail);
|
||||
if(GetPromotionExpiration(&shmp->caller_info) <= tvnow.tv_sec)
|
||||
promotionExpired = TRUE;
|
||||
else
|
||||
balance += GetPromotion(&shmp->caller_info);
|
||||
|
||||
if(balanceExpired && promotionExpired)
|
||||
{
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]user %s account expired",portid,shmp->caller_info.number);
|
||||
return 3;
|
||||
}
|
||||
balance += GetOverdraft(&shmp->caller_info);
|
||||
|
||||
if(cosTableItem->serviceControl[0].callMeBackThreshold>0 &&
|
||||
balance > cosTableItem->serviceControl[0].callMeBackThreshold)
|
||||
return 4;
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum CMB_STATE{
|
||||
S_CMB_IDLE = 0,
|
||||
S_WART_INPUT_DESTNUMBER,
|
||||
S_CMB_CHECK_DSTNUMBER,
|
||||
S_CMB_PROCESSING,
|
||||
S_CMB_EXIT,
|
||||
};
|
||||
|
||||
int callMebackUSSDProc(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
u_char ussd_data[256]={0};
|
||||
int result = 0;
|
||||
CMB *callMeBack;
|
||||
|
||||
PutLogFunID("callMebackUSSDProc");
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
switch(getCMBState(portid))
|
||||
{
|
||||
case S_CMB_IDLE:
|
||||
result = isCMBAllowed(portid);
|
||||
if(result != 0)
|
||||
{
|
||||
switch(result)
|
||||
{
|
||||
case 2:
|
||||
SendCMBLimited(portid,USSD_TRANSFER);
|
||||
break;
|
||||
default:
|
||||
//SendServiceNotApplied(portid,USSD_TRANSFER,CallMeBackPosition);
|
||||
shmp->process_info.u_error = _PPS_ERR_SERVICE_NOT_APPLIED;
|
||||
break;
|
||||
}
|
||||
changeCMBState(portid,S_CMB_EXIT);
|
||||
break;
|
||||
}
|
||||
clearCMBInfo(portid);
|
||||
SendCMBRequest(portid,USSD_TRANSFER);
|
||||
changeCMBState(portid,S_WART_INPUT_DESTNUMBER);
|
||||
break;
|
||||
case S_WART_INPUT_DESTNUMBER:
|
||||
result = getUssdACK(portid,ussd_data);
|
||||
switch(result)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case -1:
|
||||
return SERVICE_EXIT_PPS;
|
||||
break;
|
||||
default:
|
||||
ussd_data[result] = 0;
|
||||
result = getCMBInfo(portid,ussd_data);
|
||||
switch(result)
|
||||
{
|
||||
case -1:
|
||||
if(shmp->process_info.serviceInput++ >= SERVICE_INPUT_NUM)
|
||||
return SERVICE_EXIT_PPS;
|
||||
SendReinputCMBRequest(portid,USSD_TRANSFER);
|
||||
break;
|
||||
case -2:
|
||||
if(shmp->process_info.serviceInput++ >= SERVICE_INPUT_NUM)
|
||||
return SERVICE_EXIT_PPS;
|
||||
SendCMBDstNumberErrorRequest(portid,USSD_TRANSFER);
|
||||
break;
|
||||
default:
|
||||
changeCMBState(portid,S_CMB_CHECK_DSTNUMBER);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case S_CMB_CHECK_DSTNUMBER:
|
||||
if(checkCMBDestNumber(portid) == FALSE)
|
||||
{
|
||||
if(shmp->process_info.serviceInput++ >= SERVICE_INPUT_NUM)
|
||||
{
|
||||
return SERVICE_EXIT_PPS;
|
||||
}
|
||||
SendCMBDstNumberErrorRequest(portid,USSD_TRANSFER);
|
||||
changeCMBState(portid,S_WART_INPUT_DESTNUMBER);
|
||||
}
|
||||
else
|
||||
changeCMBState(portid,S_CMB_PROCESSING);
|
||||
break;
|
||||
case S_CMB_PROCESSING:
|
||||
UpdateCMBTimes(&shmp->caller_info,1);
|
||||
SendCMBNotifyDestRequest(portid,SMS_TRANSFER);
|
||||
changeCMBState(portid,S_CMB_EXIT);
|
||||
break;
|
||||
case S_CMB_EXIT:
|
||||
clearCMBInfo(portid);
|
||||
return SERVICE_EXIT_PPS;
|
||||
break;
|
||||
}
|
||||
return SERVICE_KEEP_STATE;
|
||||
}
|
||||
|
||||
int callMebackSMSProc(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
u_char short_message[256];
|
||||
int result = 0;
|
||||
CMB *callMeBack;
|
||||
|
||||
PutLogFunID("callMebackSMSProc");
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
switch(getCMBState(portid))
|
||||
{
|
||||
case S_CMB_IDLE:
|
||||
result = isCMBAllowed(portid);
|
||||
if(result != 0)
|
||||
{
|
||||
switch(result)
|
||||
{
|
||||
case 2:
|
||||
SendCMBLimited(portid,SMS_TRANSFER);
|
||||
break;
|
||||
default:
|
||||
SendServiceNotApplied(portid,SMS_TRANSFER,CallMeBackPosition);
|
||||
break;
|
||||
}
|
||||
clearCMBInfo(portid);
|
||||
return SERVICE_RETURN_TO_PARENT;
|
||||
}
|
||||
changeCMBState(portid,S_WART_INPUT_DESTNUMBER);
|
||||
case S_WART_INPUT_DESTNUMBER:
|
||||
result = getCMBSMSACK(portid,short_message);
|
||||
switch(result)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case -1:
|
||||
return SERVICE_EXIT_PPS;
|
||||
break;
|
||||
default:
|
||||
short_message[result] = 0;
|
||||
result = getCMBInfo(portid,short_message);
|
||||
switch(result)
|
||||
{
|
||||
case -1:
|
||||
if(shmp->process_info.serviceInput++ >= SERVICE_INPUT_NUM)
|
||||
return SERVICE_EXIT_PPS;
|
||||
SendReinputCMBRequest(portid,SMS_TRANSFER);
|
||||
return SERVICE_EXIT_PPS;
|
||||
case -2:
|
||||
if(shmp->process_info.serviceInput++ >= SERVICE_INPUT_NUM)
|
||||
return SERVICE_EXIT_PPS;
|
||||
SendCMBDstNumberErrorRequest(portid,SMS_TRANSFER);
|
||||
return SERVICE_EXIT_PPS;
|
||||
default:
|
||||
changeCMBState(portid,S_CMB_CHECK_DSTNUMBER);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case S_CMB_CHECK_DSTNUMBER:
|
||||
if(checkCMBDestNumber(portid) == FALSE)
|
||||
{
|
||||
SendCMBDstNumberErrorRequest(portid,SMS_TRANSFER);
|
||||
return SERVICE_EXIT_PPS;
|
||||
}
|
||||
else
|
||||
changeCMBState(portid,S_CMB_PROCESSING);
|
||||
case S_CMB_PROCESSING:
|
||||
UpdateCMBTimes(&shmp->caller_info,1);
|
||||
SendCMBNotifyDestRequest(portid,SMS_TRANSFER);
|
||||
changeCMBState(portid,S_CMB_EXIT);
|
||||
case S_CMB_EXIT:
|
||||
clearCMBInfo(portid);
|
||||
return SERVICE_RETURN_TO_PARENT;
|
||||
break;
|
||||
}
|
||||
return SERVICE_KEEP_STATE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,849 @@
|
||||
|
||||
#include "../include/includes.h"
|
||||
#include "../include/message.h"
|
||||
#include "../include/ppsm.h"
|
||||
#include "../include/cdrme.h"
|
||||
#include "../include/ramdata.h"
|
||||
#include "../include/mfunc.h"
|
||||
#include "../include/config.h"
|
||||
#include "../include/param.h"
|
||||
#include "../include/precard.h"
|
||||
#include "../include/callingCard.h"
|
||||
|
||||
#include "../include/plat_inc.h"
|
||||
#include "../../../../plat/scf/src/include/scfpub.h"
|
||||
#include "../../../../plat/scf/src/include/scfmsg.h"
|
||||
|
||||
extern u_short debug_messages;
|
||||
extern int logMsgFlag;
|
||||
extern int ppsDebugCapMsg();
|
||||
extern _ram_data *ramshm_ptr;
|
||||
extern _state_machine *smshm_ptr;
|
||||
extern int SendAccountInfoBySMPP();
|
||||
|
||||
extern PPSParamStruct ppsParam;
|
||||
|
||||
|
||||
extern int CheckPINValidity(_account_info *ptr, char *pin);
|
||||
extern void SendAccountBalanceBySrf(u_short portid);
|
||||
extern int WaitingForRechargeCardPasswordResponse(u_short portid);
|
||||
extern int RechargeRequestProc(u_short portid);
|
||||
|
||||
int CallingCardSendReleaseCall(u_short portid);
|
||||
|
||||
/* need change _crd_param struct*/
|
||||
int IsCallingCardNumber(u_char *dstNumber)
|
||||
{
|
||||
int retval=0;
|
||||
int len;
|
||||
u_char *callingNumber;
|
||||
|
||||
callingNumber = ppsParam.ppsTables.serviceNumber[VirtualCallingCardNumberPosition].number;
|
||||
|
||||
if(callingNumber[0] == 0) return 0;
|
||||
len = strlen((char *)callingNumber);
|
||||
if(!strncasecmp((char *)dstNumber, (char *)callingNumber, len))
|
||||
retval = 1;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int WaitForMainMenu(_state_data *shmp,u_short portid)
|
||||
{
|
||||
int key = -1,dlgid,msglen,len;
|
||||
CAP_Message capmsg;
|
||||
CapArg capArg;
|
||||
CapPromptAndCollectUserInformation *pPCUI;
|
||||
|
||||
PutLogFunID("WaitForMainMenu");
|
||||
|
||||
if(shmp->process_info.funnel++>PROMPT_AND_COLLECT_TIMER)
|
||||
{
|
||||
shmp->process_info.tcos = CALLER_EXPIRIED;
|
||||
CallingCardSendReleaseCall(portid);
|
||||
return pin_mng_exit;
|
||||
}
|
||||
|
||||
dlgid = shmp->context_info.dialogue_id;
|
||||
if(!ReadScfMsg(&capmsg,dlgid))
|
||||
{
|
||||
return key;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
if(debug_messages<=MAX_DEBUG_MESSAGES)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02)
|
||||
|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
debug_messages ++;
|
||||
ppsDebugCapMsg(&capmsg,0);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(capmsg.msgOperaCode)
|
||||
{
|
||||
case CAP_OC_PromptAndCollectUserInformation:
|
||||
AddPPSStatistics(MIBPPS_PCUI_RES,shmp->process_info.dir);
|
||||
shmp->process_info.funnel = 0;
|
||||
msglen = capmsg.msgContent[3]*256 + capmsg.msgContent[4];
|
||||
capArg.version = shmp->context_info.acn_ver;
|
||||
if(decode_capmsg((char *)&capmsg.msgContent[5],
|
||||
msglen,
|
||||
capmsg.msgOperaCode,
|
||||
CAP_CONFIRM,
|
||||
&capArg)<0)
|
||||
{
|
||||
return key;
|
||||
}
|
||||
pPCUI=&capArg.msg_list.promptAndCollectUserInformationArg;
|
||||
len = pPCUI->digitsResponse[0];
|
||||
if(len<2 || len>12)
|
||||
return -1;
|
||||
|
||||
key = pPCUI->digitsResponse[2];
|
||||
/*
|
||||
key = pPCUI->digitsResponse[2]&0x0F;
|
||||
|
||||
if((key < ExitCallingCard) ||(key > TransferAccount))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
break;
|
||||
case CAP_O_UABORT:
|
||||
case CAP_O_PABORT:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
int WaitingForPin(_state_data *shmp,u8 type)
|
||||
{
|
||||
/*
|
||||
type 0:caller
|
||||
1:called
|
||||
*/
|
||||
int retval=pin_mng_keep_state,dlgid,msglen,len;
|
||||
CAP_Message capmsg;
|
||||
CapArg capArg;
|
||||
CapPromptAndCollectUserInformation *pPCUI;
|
||||
_account_info *call_type;
|
||||
|
||||
PutLogFunID("WaitingForInputCallingCardAccountResponse");
|
||||
dlgid = shmp->context_info.dialogue_id;
|
||||
if(!ReadScfMsg(&capmsg,dlgid))
|
||||
return retval;
|
||||
#if DEBUG
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
ppsDebugCapMsg(&capmsg,0);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(capmsg.msgOperaCode)
|
||||
{
|
||||
case CAP_OC_PromptAndCollectUserInformation:
|
||||
AddPPSStatistics(MIBPPS_PCUI_RES,shmp->process_info.dir);
|
||||
shmp->process_info.funnel = 0;
|
||||
msglen = capmsg.msgContent[3]*256 + capmsg.msgContent[4];
|
||||
capArg.version = shmp->context_info.acn_ver;
|
||||
if(decode_capmsg((char *)&capmsg.msgContent[5],
|
||||
msglen,
|
||||
capmsg.msgOperaCode,
|
||||
CAP_CONFIRM,
|
||||
&capArg)<0)
|
||||
{
|
||||
return (retval = pin_mng_exit); //timeout ,exit
|
||||
}
|
||||
pPCUI = &capArg.msg_list.promptAndCollectUserInformationArg;
|
||||
len = pPCUI->digitsResponse[0];
|
||||
if(len<2 || len>12)
|
||||
return (retval = pin_mng_exit); //timeout ,exit
|
||||
len --;
|
||||
if(pPCUI->digitsResponse[1] & 0x20)
|
||||
{
|
||||
pPCUI->digitsResponse[len+1] |= 0xF0;
|
||||
len =len * 2-1;
|
||||
}
|
||||
else
|
||||
len *=2;
|
||||
if( len != MAX_PIN_LEN) //max language types = 5
|
||||
{
|
||||
if(shmp->process_info.serviceInput++>=SERVICE_INPUT_NUM)
|
||||
{
|
||||
return (retval = pin_mng_exit);
|
||||
}
|
||||
return retval = 2;
|
||||
}
|
||||
ppsBcdToAsciiR(shmp->process_info.tmpDigits,
|
||||
&pPCUI->digitsResponse[2],
|
||||
len);
|
||||
shmp->process_info.tmpDigits[MAX_PIN_LEN] = 0;
|
||||
if(type == 0)
|
||||
call_type = &shmp->caller_info;
|
||||
else
|
||||
call_type = &shmp->called_info;
|
||||
|
||||
if(!CheckPINValidity(call_type,shmp->process_info.tmpDigits))
|
||||
{
|
||||
if(shmp->process_info.serviceInput++>=SERVICE_INPUT_NUM)
|
||||
{
|
||||
return (retval = pin_mng_exit);
|
||||
}
|
||||
return retval = 2;
|
||||
}
|
||||
retval = 1;
|
||||
break;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int WaitingForInputCallingCardAccountResponse(_state_data *shmp)
|
||||
{
|
||||
int retval=pin_mng_keep_state,dlgid,msglen,len;
|
||||
CAP_Message capmsg;
|
||||
CapArg capArg;
|
||||
CapPromptAndCollectUserInformation *pPCUI;
|
||||
|
||||
PutLogFunID("WaitingForInputCallingCardAccountResponse");
|
||||
|
||||
dlgid = shmp->context_info.dialogue_id;
|
||||
|
||||
if(!ReadScfMsg(&capmsg,dlgid))
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
if(debug_messages<=MAX_DEBUG_MESSAGES)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02)
|
||||
|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
debug_messages ++;
|
||||
ppsDebugCapMsg(&capmsg,0);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(capmsg.msgOperaCode)
|
||||
{
|
||||
case CAP_OC_PromptAndCollectUserInformation:
|
||||
AddPPSStatistics(MIBPPS_PCUI_RES,shmp->process_info.dir);
|
||||
shmp->process_info.funnel = 0;
|
||||
msglen = capmsg.msgContent[3]*256 + capmsg.msgContent[4];
|
||||
capArg.version = shmp->context_info.acn_ver;
|
||||
if(decode_capmsg((char *)&capmsg.msgContent[5],
|
||||
msglen,
|
||||
capmsg.msgOperaCode,
|
||||
CAP_CONFIRM,
|
||||
&capArg)<0)
|
||||
{
|
||||
return (retval = 3);
|
||||
}
|
||||
pPCUI=&capArg.msg_list.promptAndCollectUserInformationArg;
|
||||
len = pPCUI->digitsResponse[0];
|
||||
if(len>11) len = 11;
|
||||
if(len<=2) //
|
||||
{
|
||||
if(shmp->process_info.serviceInput++>=SERVICE_INPUT_NUM)
|
||||
{
|
||||
return (retval = 3);
|
||||
}
|
||||
return (retval = 2);
|
||||
}
|
||||
|
||||
if(pPCUI->digitsResponse[1] & 0x20)
|
||||
{
|
||||
pPCUI->digitsResponse[len] |=0xF0;
|
||||
}
|
||||
memset(shmp->cdr_info.msisdn,0xFF,10);
|
||||
memcpy(shmp->cdr_info.msisdn,
|
||||
&pPCUI->digitsResponse[2],
|
||||
len-1);
|
||||
ppsBcdToAsciiR((char *)shmp->caller_info.number,&pPCUI->digitsResponse[2],2*(len-1));
|
||||
StringCut((char *)shmp->caller_info.number,'F');
|
||||
if(GetAccountPos(&shmp->caller_info) == FALSE)
|
||||
{
|
||||
if(shmp->process_info.serviceInput++>=SERVICE_INPUT_NUM)
|
||||
{
|
||||
return (retval = 3);
|
||||
}
|
||||
return (retval = 2);
|
||||
}
|
||||
shmp->caller_info.status = GetAccountStatus(&shmp->caller_info);
|
||||
GetAccountCosID(&shmp->caller_info);
|
||||
retval = 1;
|
||||
break;
|
||||
case CAP_O_UABORT:
|
||||
case CAP_O_PABORT:
|
||||
default:
|
||||
retval = 3;
|
||||
break;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int WaitingForInputCallingCardAccountResponse_ccc(_state_data *shmp)
|
||||
{
|
||||
int retval=pin_mng_keep_state,dlgid,msglen,len;
|
||||
CAP_Message capmsg;
|
||||
CapArg capArg;
|
||||
CapPromptAndCollectUserInformation *pPCUI;
|
||||
char card_hrn[32];
|
||||
|
||||
PutLogFunID("WaitingForInputCallingCardAccountResponse_ccc");
|
||||
|
||||
dlgid = shmp->context_info.dialogue_id;
|
||||
|
||||
if(!ReadScfMsg(&capmsg,dlgid))
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
if(debug_messages<=MAX_DEBUG_MESSAGES)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02)
|
||||
|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
debug_messages ++;
|
||||
ppsDebugCapMsg(&capmsg,0);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(capmsg.msgOperaCode)
|
||||
{
|
||||
case CAP_OC_PromptAndCollectUserInformation:
|
||||
AddPPSStatistics(MIBPPS_PCUI_RES,shmp->process_info.dir);
|
||||
shmp->process_info.funnel = 0;
|
||||
msglen = capmsg.msgContent[3]*256 + capmsg.msgContent[4];
|
||||
capArg.version = shmp->context_info.acn_ver;
|
||||
if(decode_capmsg((char *)&capmsg.msgContent[5],
|
||||
msglen,
|
||||
capmsg.msgOperaCode,
|
||||
CAP_CONFIRM,
|
||||
&capArg)<0)
|
||||
{
|
||||
return (retval = 3);
|
||||
}
|
||||
pPCUI=&capArg.msg_list.promptAndCollectUserInformationArg;
|
||||
len = pPCUI->digitsResponse[0];
|
||||
if(len>11) len = 11;
|
||||
if(len<=2) //
|
||||
{
|
||||
if(shmp->process_info.serviceInput++>=SERVICE_INPUT_NUM)
|
||||
{
|
||||
return (retval = 3);
|
||||
}
|
||||
return (retval = 2);
|
||||
}
|
||||
|
||||
if(pPCUI->digitsResponse[1] & 0x20)
|
||||
{
|
||||
pPCUI->digitsResponse[len] |=0xF0;
|
||||
}
|
||||
|
||||
|
||||
len --;
|
||||
|
||||
if(pPCUI->digitsResponse[1] & 0x80)
|
||||
pPCUI->digitsResponse[len] |= 0xF0;
|
||||
|
||||
memset(shmp->cdr_info.caller, 0xFF, 10);
|
||||
memcpy(shmp->cdr_info.caller, &pPCUI->digitsResponse[2], len);
|
||||
ppsBcdToAsciiR(card_hrn, &pPCUI->digitsResponse[2], len*2);
|
||||
|
||||
strcpy((char *)shmp->caller_info.number, card_hrn);
|
||||
|
||||
if(1)
|
||||
{
|
||||
int result;
|
||||
if(RechargeCardRequest(shmp->process_info.portid, card_hrn, &result) != 1)
|
||||
retval = 2;
|
||||
else
|
||||
{
|
||||
UpdateRechargeCard(shmp->process_info.portid, CARD_AS_CC_USED);
|
||||
retval = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CAP_O_UABORT:
|
||||
case CAP_O_PABORT:
|
||||
default:
|
||||
retval = 3;
|
||||
break;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int WaitingForInputCalledNumber(_state_data *shmp)
|
||||
{
|
||||
int retval=pin_mng_keep_state,dlgid,msglen,len;
|
||||
CAP_Message capmsg;
|
||||
CapArg capArg;
|
||||
CapPromptAndCollectUserInformation *pPCUI;
|
||||
_state_data *callOutShmp;
|
||||
|
||||
PutLogFunID("WaitingForInputCalledNumber");
|
||||
|
||||
dlgid = shmp->context_info.dialogue_id;
|
||||
|
||||
if(!ReadScfMsg(&capmsg,dlgid))
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
if(debug_messages<=MAX_DEBUG_MESSAGES)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02)
|
||||
|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
debug_messages ++;
|
||||
ppsDebugCapMsg(&capmsg,0);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(capmsg.msgOperaCode)
|
||||
{
|
||||
case CAP_OC_PromptAndCollectUserInformation:
|
||||
AddPPSStatistics(MIBPPS_PCUI_RES,shmp->process_info.dir);
|
||||
shmp->process_info.funnel = 0;
|
||||
msglen = capmsg.msgContent[3]*256 + capmsg.msgContent[4];
|
||||
capArg.version = shmp->context_info.acn_ver;
|
||||
if(decode_capmsg((char *)&capmsg.msgContent[5],
|
||||
msglen,
|
||||
capmsg.msgOperaCode,
|
||||
CAP_CONFIRM,
|
||||
&capArg)<0)
|
||||
{
|
||||
return (retval = 3);
|
||||
}
|
||||
pPCUI=&capArg.msg_list.promptAndCollectUserInformationArg;
|
||||
len = pPCUI->digitsResponse[0];
|
||||
if(len>11) len = 11;
|
||||
if(len<=2) //
|
||||
{
|
||||
if(shmp->process_info.serviceInput++>=SERVICE_INPUT_NUM)
|
||||
{
|
||||
return (retval = 3);
|
||||
}
|
||||
return (retval = 2);
|
||||
}
|
||||
|
||||
if(pPCUI->digitsResponse[1] & 0x20)
|
||||
{
|
||||
pPCUI->digitsResponse[len] |=0xF0;
|
||||
}
|
||||
|
||||
dlgid = shmp->process_info.correlationID;
|
||||
callOutShmp = (_state_data *)&smshm_ptr->state_data;
|
||||
callOutShmp += dlgid;
|
||||
callOutShmp->context_info.callType = CT_MO_CALL;
|
||||
memset(callOutShmp->cdr_info.msisdn,0xFF,10);
|
||||
memcpy(callOutShmp->cdr_info.msisdn,
|
||||
&pPCUI->digitsResponse[2],
|
||||
len-1);
|
||||
ppsBcdToAsciiR((char *)callOutShmp->charge_info.number,&pPCUI->digitsResponse[2],2*(len-1));
|
||||
StringCut((char *)callOutShmp->charge_info.number,'F');
|
||||
retval = 1;
|
||||
break;
|
||||
case CAP_O_UABORT:
|
||||
case CAP_O_PABORT:
|
||||
default:
|
||||
retval = 3;
|
||||
break;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
int WaitingForInputTransferOutAccount_LIMITED(_state_data *shmp)
|
||||
{
|
||||
int retval=pin_mng_keep_state,dlgid,msglen,len;
|
||||
CAP_Message capmsg;
|
||||
CapArg capArg;
|
||||
CapPromptAndCollectUserInformation *pPCUI;
|
||||
|
||||
PutLogFunID("WaitingForInputTransferOutAccount");
|
||||
|
||||
dlgid = shmp->context_info.dialogue_id;
|
||||
|
||||
if(!ReadScfMsg(&capmsg,dlgid))
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
if(debug_messages<=MAX_DEBUG_MESSAGES)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02)
|
||||
|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
debug_messages ++;
|
||||
ppsDebugCapMsg(&capmsg,0);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(capmsg.msgOperaCode)
|
||||
{
|
||||
case CAP_OC_PromptAndCollectUserInformation:
|
||||
AddPPSStatistics(MIBPPS_PCUI_RES,shmp->process_info.dir);
|
||||
shmp->process_info.funnel = 0;
|
||||
msglen = capmsg.msgContent[3]*256 + capmsg.msgContent[4];
|
||||
capArg.version = shmp->context_info.acn_ver;
|
||||
if(decode_capmsg((char *)&capmsg.msgContent[5],
|
||||
msglen,
|
||||
capmsg.msgOperaCode,
|
||||
CAP_CONFIRM,
|
||||
&capArg)<0)
|
||||
{
|
||||
return (retval = 3);
|
||||
}
|
||||
pPCUI=&capArg.msg_list.promptAndCollectUserInformationArg;
|
||||
len = pPCUI->digitsResponse[0];
|
||||
if(len>11) len = 11;
|
||||
if(len<=2) //
|
||||
{
|
||||
if(shmp->process_info.serviceInput++>=SERVICE_INPUT_NUM)
|
||||
{
|
||||
return (retval = 3);
|
||||
}
|
||||
return (retval = 2);
|
||||
}
|
||||
|
||||
if(pPCUI->digitsResponse[1] & 0x20)
|
||||
{
|
||||
pPCUI->digitsResponse[len] |=0xF0;
|
||||
}
|
||||
memset(shmp->cdr_info.msisdn,0xFF,10);
|
||||
memcpy(shmp->cdr_info.msisdn,
|
||||
&pPCUI->digitsResponse[2],
|
||||
len-1);
|
||||
ppsBcdToAsciiR((char *)shmp->called_info.number,&pPCUI->digitsResponse[2],2*(len-1));
|
||||
StringCut((char *)shmp->called_info.number,'F');
|
||||
if(GetAccountPos(&shmp->called_info) == FALSE)
|
||||
{
|
||||
if(shmp->process_info.serviceInput++>=SERVICE_INPUT_NUM)
|
||||
{
|
||||
return (retval = 3);
|
||||
}
|
||||
return (retval = 2);
|
||||
}
|
||||
shmp->called_info.status = GetAccountStatus(&shmp->called_info);
|
||||
GetAccountCosID(&shmp->called_info);
|
||||
retval = 1;
|
||||
break;
|
||||
case CAP_O_UABORT:
|
||||
case CAP_O_PABORT:
|
||||
default:
|
||||
retval = 3;
|
||||
break;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int CallingCardWaitingForSpecialResourceReport(_state_data *shmp)
|
||||
{
|
||||
int retval=pin_mng_keep_state,dlgid;
|
||||
CAP_Message capmsg;
|
||||
|
||||
PutLogFunID("WaitingForSpecialResourceReport");
|
||||
|
||||
dlgid = shmp->context_info.dialogue_id;
|
||||
if(!ReadScfMsg(&capmsg,dlgid))
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
#if DEBUG
|
||||
if(debug_messages<=MAX_DEBUG_MESSAGES)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
debug_messages ++;
|
||||
ppsDebugCapMsg(&capmsg,0);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch(capmsg.msgOperaCode)
|
||||
{
|
||||
case CAP_OC_SpecializedResourceReport:
|
||||
AddPPSStatistics(MIBPPS_SPE_RUS_RPT,shmp->process_info.dir);
|
||||
retval = 1;
|
||||
break;
|
||||
default:
|
||||
retval = 2;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int CallingCardInquiryManageProc(u_short portid)
|
||||
{
|
||||
int retval,dlgid;
|
||||
int caller_status,instance;
|
||||
CAP_Message capmsg;
|
||||
COSTable *cosTableItem;
|
||||
_state_data *shmp;
|
||||
|
||||
PutLogFunID("CallingCardInquiryManageProc");
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
retval = pin_mng_keep_state;
|
||||
|
||||
switch(shmp->process_info.sub_state)
|
||||
{
|
||||
case S_INQ_SEND_PROMPT:
|
||||
caller_status = GetAccountStatus(&shmp->caller_info);
|
||||
if(caller_status == T_NORMAL)
|
||||
{
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[shmp->caller_info.cos_id];
|
||||
if(cosTableItem->smsNotificationInquiry[0].smsNotificationWhenInquiry)
|
||||
{
|
||||
SendAccountInfoBySMPP(
|
||||
&shmp->caller_info,
|
||||
shmp->called_info.number);
|
||||
}
|
||||
|
||||
SendAccountInfoPromptToSrf(portid,FALSE,TRUE);
|
||||
shmp->process_info.funnel = 0;
|
||||
shmp->process_info.srfRelease = 0x01;
|
||||
shmp->process_info.sub_state = S_INQ_SRR;
|
||||
}
|
||||
else
|
||||
{
|
||||
if((caller_status == T_FRESH || caller_status == T_OPRTRIAL)
|
||||
&& shmp->caller_info.head<MSISDN_HEAD_NUM)
|
||||
{
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[shmp->caller_info.cos_id];
|
||||
if(cosTableItem->accountValidity[0].activiationByInquiryIs)
|
||||
{
|
||||
UpdateAccountStatus(shmp->caller_info.head,
|
||||
shmp->caller_info.tail,
|
||||
T_NORMAL);
|
||||
UpdateAccountFirstUsedDate(
|
||||
shmp->caller_info.head,
|
||||
shmp->caller_info.tail);
|
||||
UpdateExpirationFirstInquiry(
|
||||
&shmp->caller_info,
|
||||
cosTableItem->accountValidity[0].validiDaysActivatedByInquiringAccountWithZeroBalance
|
||||
);
|
||||
instance = shmp->caller_info.head * UNIT_STORE_ACCOUNT
|
||||
+ shmp->caller_info.tail;
|
||||
SendAccountRealSync(instance,0.0,0.0,OMC_OCODE_EDIT);
|
||||
if(cosTableItem->smsNotificationInquiry[0].smsNotificationWhenInquiry)
|
||||
{
|
||||
SendAccountInfoBySMPP(
|
||||
&shmp->caller_info,
|
||||
shmp->called_info.number);
|
||||
}
|
||||
|
||||
SendAccountInfoPromptToSrf(portid,FALSE,TRUE);
|
||||
shmp->process_info.funnel = 0;
|
||||
shmp->process_info.srfRelease = 0x01;
|
||||
shmp->process_info.sub_state = S_INQ_SRR;
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
shmp->process_info.voiceID = ERROR_ACCOUNT_STATUS;
|
||||
shmp->process_info.srfRelease = 0;
|
||||
SendSrfPlayAnnouncement(portid);
|
||||
shmp->process_info.sub_state = S_INQ_SRR0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case S_INQ_SRR0:
|
||||
dlgid = shmp->context_info.dialogue_id;
|
||||
if(!ReadScfMsg(&capmsg,dlgid))
|
||||
return retval;
|
||||
|
||||
#if DEBUG
|
||||
if(debug_messages<=MAX_DEBUG_MESSAGES)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
debug_messages ++;
|
||||
ppsDebugCapMsg(&capmsg,0);
|
||||
}
|
||||
#endif
|
||||
retval = pin_mng_exit_to_main_menu;
|
||||
break;
|
||||
case S_INQ_SRR:
|
||||
dlgid = shmp->context_info.dialogue_id;
|
||||
if(!ReadScfMsg(&capmsg,dlgid))
|
||||
return retval;
|
||||
|
||||
#if DEBUG
|
||||
if(debug_messages<=MAX_DEBUG_MESSAGES)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
debug_messages ++;
|
||||
ppsDebugCapMsg(&capmsg,0);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(capmsg.msgOperaCode !=CAP_OC_SpecializedResourceReport)
|
||||
{
|
||||
if(debug_messages<=MAX_DEBUG_MESSAGES)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
debug_messages ++;
|
||||
DebugMsg(debugmib.display.asciiOut,"< Error message received >");
|
||||
}
|
||||
return (retval=pin_mng_exit_to_main_menu);
|
||||
}
|
||||
AddPPSStatistics(MIBPPS_SPE_RUS_RPT,shmp->process_info.dir);
|
||||
retval = pin_mng_exit_to_main_menu;
|
||||
break;
|
||||
default:
|
||||
retval = pin_mng_exit_to_main_menu;
|
||||
break;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int CallingCardSendReleaseCall(u_short portid)
|
||||
{
|
||||
_state_data *shmp,*shnmp;
|
||||
|
||||
PutLogFunID("CallingCardSendReleaseCall");
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shnmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
shnmp += shmp->process_info.correlationID;
|
||||
shnmp->process_info.tcos = shmp->process_info.tcos;
|
||||
shnmp->process_info.disconnectForwardConnection = 1;
|
||||
return pin_mng_exit;
|
||||
}
|
||||
|
||||
|
||||
int CallingCardRechargeManageProc(u_short portid)
|
||||
{
|
||||
int retval,retval1,dlgid;
|
||||
int caller_status;
|
||||
CAP_Message capmsg;
|
||||
_state_data *shmp;
|
||||
|
||||
PutLogFunID("CallingCardRechargeManageProc");
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
retval = pin_mng_keep_state;
|
||||
|
||||
if(shmp->process_info.funnel++>PROMPT_AND_COLLECT_TIMER)
|
||||
{
|
||||
CallingCardSendReleaseCall(portid);
|
||||
return (retval = pin_mng_exit_to_main_menu);
|
||||
}
|
||||
|
||||
switch(shmp->process_info.sub_state)
|
||||
{
|
||||
case S_REC_CHECK_ACCOUNT_STATUS:
|
||||
caller_status = GetAccountStatus(&shmp->caller_info);
|
||||
if( caller_status != T_NORMAL &&
|
||||
caller_status != T_FRESH &&
|
||||
caller_status != T_SUSPEND &&
|
||||
caller_status != T_OPRTRIAL )
|
||||
{
|
||||
shmp->process_info.voiceID = ERROR_ACCOUNT_STATUS;
|
||||
shmp->process_info.srfRelease = 1;
|
||||
SendSrfPlayAnnouncement(portid);
|
||||
shmp->process_info.tcos = NORMAL_CLEARING;
|
||||
shmp->process_info.sub_state = S_REC_WAIT_SRR;
|
||||
return retval;
|
||||
}
|
||||
shmp->process_info.sub_state = S_REC_PLAY_BALANCE;
|
||||
break;
|
||||
break;
|
||||
case S_REC_PLAY_BALANCE:
|
||||
shmp->process_info.funnel = 0;
|
||||
SendAccountInfoPromptToSrf(portid,TRUE,FALSE);
|
||||
shmp->process_info.sub_state = S_REC_WAIT_SRR0;
|
||||
break;
|
||||
case S_REC_WAIT_SRR0:
|
||||
dlgid = shmp->context_info.dialogue_id;
|
||||
if(!ReadScfMsg(&capmsg,dlgid))
|
||||
return retval;
|
||||
|
||||
#if DEBUG
|
||||
if(debug_messages<=MAX_DEBUG_MESSAGES)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
debug_messages ++;
|
||||
ppsDebugCapMsg(&capmsg,0);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(capmsg.msgOperaCode !=CAP_OC_SpecializedResourceReport)
|
||||
{
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"< Error message received >");
|
||||
}
|
||||
}
|
||||
AddPPSStatistics(MIBPPS_SPE_RUS_RPT,shmp->process_info.dir);
|
||||
shmp->process_info.sub_state = S_REC_INPUT_PWD;
|
||||
break;
|
||||
case S_REC_INPUT_PWD:
|
||||
shmp->process_info.funnel = 0;
|
||||
shmp->process_info.serviceInput = 0;
|
||||
shmp->process_info.voiceID = INPUT_PRECARD_PWD;
|
||||
shmp->process_info.endOfReplyDigit[0] = 1;
|
||||
shmp->process_info.endOfReplyDigit[1] = 12;
|
||||
shmp->process_info.maxPCUInfoLen = 20;
|
||||
SendPromptAndCollectUserInfo(portid);
|
||||
shmp->process_info.sub_state = S_REC_CHECK_PWD;
|
||||
break;
|
||||
case S_REC_CHECK_PWD:
|
||||
retval1 = WaitingForRechargeCardPasswordResponse(portid);
|
||||
switch(retval1)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
RechargeRequestProc(portid);
|
||||
shmp->process_info.srfRelease = 0;
|
||||
shmp->process_info.maxPCUInfoLen = 1;
|
||||
SendRechargeInfoPromptToSrf(portid);
|
||||
shmp->process_info.funnel = 0;
|
||||
shmp->process_info.sub_state = S_REC_WAIT_SRR;
|
||||
break;
|
||||
case 2:
|
||||
shmp->process_info.srfRelease = 0;
|
||||
shmp->process_info.voiceID = RECHARGE_FAILED;
|
||||
shmp->process_info.maxPCUInfoLen = 20;
|
||||
shmp->process_info.endOfReplyDigit[0] = 1;
|
||||
shmp->process_info.endOfReplyDigit[1] = 12;
|
||||
SendPromptAndCollectUserInfo(portid);
|
||||
shmp->process_info.funnel = 0;
|
||||
shmp->process_info.sub_state = S_REC_CHECK_PWD;
|
||||
break;
|
||||
case 3:
|
||||
retval = pin_mng_exit_to_main_menu;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case S_REC_WAIT_SRR:
|
||||
dlgid = shmp->context_info.dialogue_id;
|
||||
if(!ReadScfMsg(&capmsg,dlgid))
|
||||
return retval;
|
||||
#if DEBUG
|
||||
if(debug_messages<=MAX_DEBUG_MESSAGES)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
debug_messages ++;
|
||||
ppsDebugCapMsg(&capmsg,0);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(capmsg.msgOperaCode !=CAP_OC_SpecializedResourceReport)
|
||||
{
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"< Error message received >");
|
||||
}
|
||||
}
|
||||
AddPPSStatistics(MIBPPS_SPE_RUS_RPT,shmp->process_info.dir);
|
||||
retval = pin_mng_exit_to_main_menu;
|
||||
break;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
void function_abc()
|
||||
{
|
||||
printf("abc\n");
|
||||
printf("add new printf\n");
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,660 @@
|
||||
#include "../include/includes.h"
|
||||
#include "../include/sms_msgtype.h"
|
||||
#include "../include/iptrans.h"
|
||||
|
||||
extern long timezone;
|
||||
extern iconv_t iconv_p,iconv_v;
|
||||
|
||||
void Terminate(int sign)
|
||||
{
|
||||
int retv;
|
||||
|
||||
usleep(10*1000);
|
||||
printf("Program unormally shutdown.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void SetTerminate()
|
||||
{
|
||||
struct termio ptermio;
|
||||
ioctl(0,TCGETA, &ptermio);
|
||||
ptermio.c_cc[VINTR]='\x03';
|
||||
ioctl(0,TCSETA, &ptermio);
|
||||
signal(SIGINT , Terminate);
|
||||
signal(SIGTERM, Terminate);
|
||||
}
|
||||
|
||||
void *ShmInit(int shm_id, key_t key, int size, int shmflg)
|
||||
{
|
||||
void *retp;
|
||||
|
||||
shm_id=shmget(key,size,shmflg);
|
||||
|
||||
if(shm_id==-1){
|
||||
fprintf(stderr,"shmget(key %x) %s\n",key,strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
retp=shmat(shm_id,(char *)0,0);
|
||||
if(retp==(void *)-1){
|
||||
fprintf(stderr,"shmmat %s\n",strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
return retp;
|
||||
}
|
||||
|
||||
int SemInit( key_t key, int sem_num, int sem_flg)
|
||||
{
|
||||
int initarray[sem_num];
|
||||
int sem_id, retval, i;
|
||||
|
||||
sem_id = semget(key, sem_num, sem_flg);
|
||||
if (sem_id == -1)
|
||||
{
|
||||
fprintf(stderr,"Error in semget()\n");
|
||||
exit(1);
|
||||
}
|
||||
for (i=0; i<sem_num; i++) {
|
||||
initarray[i] = 1;
|
||||
retval = semctl(sem_id, i, SETVAL, initarray[i]);
|
||||
if (retval == -1)
|
||||
{
|
||||
fprintf(stderr,"Errro in semctl()\n");
|
||||
}
|
||||
}
|
||||
return sem_id;
|
||||
}
|
||||
|
||||
int SemLock(int sem_id, int sem_num, unsigned nsops, int sem_flg)
|
||||
{
|
||||
int retval;
|
||||
struct sembuf lock = {0, -1, SEM_UNDO};
|
||||
|
||||
lock.sem_num = sem_num;
|
||||
lock.sem_flg |= sem_flg;
|
||||
retval = semop(sem_id, &lock, nsops);
|
||||
if (retval == -1) {
|
||||
fprintf(stderr,"Error in semop()\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int SemUnlock(int sem_id, int sem_num, unsigned nsops, int sem_flg)
|
||||
{
|
||||
int retval;
|
||||
struct sembuf unlock = {0, 1, SEM_UNDO};
|
||||
|
||||
unlock.sem_num = sem_num;
|
||||
unlock.sem_flg |= sem_flg;
|
||||
retval = semop(sem_id, &unlock, nsops);
|
||||
if (retval == -1) {
|
||||
fprintf(stderr,"Error in semop()\n");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int InitDaemon(void)
|
||||
{
|
||||
pid_t pid;
|
||||
if((pid=fork())<0)
|
||||
return -1;
|
||||
else if(pid !=0)
|
||||
exit(0);
|
||||
setsid();
|
||||
chdir("/");
|
||||
umask(0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int EncodeEnglish(char *str_In,BYTE *bcd_Out)
|
||||
{
|
||||
int i,len,n,cur,index=0;
|
||||
unsigned char mid1,mid2;
|
||||
char tmpStr[2];
|
||||
char strIn[180];
|
||||
|
||||
n=0;
|
||||
strcpy(strIn,str_In);
|
||||
|
||||
len=strlen(strIn);
|
||||
if(len>160) return 0;
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
if(strIn[i] == 0x40)
|
||||
strIn[i] =0x00;
|
||||
}
|
||||
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
if(i<len-1)
|
||||
{
|
||||
mid1=strIn[i];
|
||||
mid2=strIn[i+1];
|
||||
cur=(mid1>>n) |((mid2<<(7-n))&0xff);
|
||||
}
|
||||
else
|
||||
{
|
||||
mid1=strIn[i];
|
||||
cur=(mid1>>n)&0xff;
|
||||
}
|
||||
// sprintf(tmpStr,"%2.2X", cur);
|
||||
// strcat(strOut,tmpStr);
|
||||
bcd_Out[index++]=cur;
|
||||
n=(n+1)%7;
|
||||
if(n==0) i++;
|
||||
}
|
||||
// AsciiToBcd(bcd_Out,strOut,strlen(strOut));
|
||||
// bcd_Out[strlen(strOut)/2]='\0';
|
||||
bcd_Out[index]='\0';
|
||||
return 1;
|
||||
}
|
||||
|
||||
int DecodeEnglish(char *strIn,char *strOut,int len0)
|
||||
{
|
||||
int i,n,j;
|
||||
int len;
|
||||
unsigned char mid1,mid2,cur;
|
||||
char tmpStr[2];
|
||||
BYTE strHex[1024];
|
||||
|
||||
// len=strlen(strIn);
|
||||
// sprintf(strOut,"");
|
||||
//
|
||||
|
||||
n=0;j=0;
|
||||
len = len0 - len0/8;
|
||||
memcpy(strHex,strIn,len);
|
||||
|
||||
fprintf(stderr,"len0 :%d len: %d\n",len0,len);
|
||||
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
if(i>0)
|
||||
{
|
||||
mid1=strHex[i];
|
||||
mid2=strHex[i-1];
|
||||
cur=((mid1<<n)&0x7f) |(mid2>>(8-n));
|
||||
}
|
||||
else
|
||||
{
|
||||
mid1=strHex[i]&0x7f;
|
||||
cur=mid1;
|
||||
}
|
||||
strOut[j++] = cur;
|
||||
n =(n+1)%8;
|
||||
if(n==0) i--;
|
||||
}
|
||||
|
||||
for(i=0;i<j;i++)
|
||||
{
|
||||
if(strOut[i] == 0x00)
|
||||
{
|
||||
strOut[i] = 0x40;
|
||||
}
|
||||
}
|
||||
|
||||
strOut[len0] = 0;
|
||||
}
|
||||
|
||||
int EncodeChinese(unsigned char *strIn, char *strOut)
|
||||
{
|
||||
int i;
|
||||
int code;
|
||||
int len = 0;
|
||||
unsigned char smsud[180];
|
||||
|
||||
for(i=0;i<160;)
|
||||
{
|
||||
|
||||
if(strIn[i] < 0x80)
|
||||
{
|
||||
if(strIn[i] == 0x00 )
|
||||
break;
|
||||
smsud[len++] = 0x00;
|
||||
smsud[len++] = strIn[i++];
|
||||
}
|
||||
else
|
||||
{
|
||||
smsud[len++] = strIn[i++];
|
||||
smsud[len++] = strIn[i++];
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0;i<len/2;i++)
|
||||
{
|
||||
code = smsud[i*2]*256 + smsud[i*2+1];
|
||||
code = CP936_Array[smsud[i*2]*256+smsud[i*2+1]];
|
||||
strOut[i*2] = code >>8;
|
||||
strOut[i*2+1] = code;
|
||||
}
|
||||
|
||||
strOut[len]=0;
|
||||
return len;
|
||||
}
|
||||
|
||||
int DecodeChinese( unsigned char *strIn, char *strOut,int len)
|
||||
{
|
||||
int i,code,count=0;
|
||||
// size_t size_in=8,size_out=0;
|
||||
// len = iconv(iconv_p,&strIn,&size_in,&strOut,&size_out);
|
||||
for(i=0;i<len/2;i++)
|
||||
{
|
||||
code = Unicode_Array[strIn[i*2]*256+strIn[i*2+1]];
|
||||
if(code<256)
|
||||
{
|
||||
strOut[count++] = code;
|
||||
}
|
||||
else
|
||||
{
|
||||
strOut[count++] = code>>8;
|
||||
strOut[count++] = code;
|
||||
}
|
||||
}
|
||||
strOut[count]=0;
|
||||
return len/2;
|
||||
}
|
||||
|
||||
int StrToChar(char *strIn,char *strOut)
|
||||
{
|
||||
int i,len;
|
||||
len=strlen(strIn);
|
||||
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
if(strIn[i]>=87) strIn[i] =strIn[i]-87;
|
||||
else if(strIn[i]>=65) strIn[i] =strIn[i]-55;
|
||||
else if(strIn[i]>=48) strIn[i] -=48;
|
||||
}
|
||||
for(i=0;i<len/2;i++)
|
||||
strOut[i] =strIn[i*2]*16+strIn[i*2+1];
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ReadCP936()
|
||||
{
|
||||
FILE *fpRead;
|
||||
char strRead[81];
|
||||
int i,j,len;
|
||||
int startc,endc,startu,endu;
|
||||
char ucode[6],ccode[6];
|
||||
unsigned short indexc,indexu,xcount;
|
||||
|
||||
fpRead=fopen(CP936_NAME,"r");
|
||||
if(fpRead==NULL)
|
||||
{
|
||||
fprintf(stderr,"Can't open file CP936.TXT, PLEASE check the path\n");
|
||||
exit(1);
|
||||
return 0;
|
||||
}
|
||||
while(!feof(fpRead))
|
||||
{
|
||||
fgets(strRead,80,fpRead);
|
||||
len=strlen(strRead);
|
||||
|
||||
for(j=0;j<len;j++)
|
||||
{
|
||||
if(strRead[j]=='#') break;
|
||||
}
|
||||
len=j;
|
||||
if(len<4) continue;
|
||||
startc=endc=0;
|
||||
startu=endu=0;
|
||||
xcount=0;
|
||||
for(j=0;j<len;j++)
|
||||
{
|
||||
if(strRead[j]=='x' || strRead[j]=='X')
|
||||
{
|
||||
if(startc==0) startc=j+1;
|
||||
else if(startu==0) startu=j+1;
|
||||
xcount++;
|
||||
}
|
||||
if(strRead[j]==0x09 && j>0)
|
||||
{
|
||||
if(endc==0) endc=j;
|
||||
else if(endu==0) endu=j;
|
||||
}
|
||||
}
|
||||
if(xcount>1){
|
||||
memcpy(ccode,&strRead[startc],endc-startc);
|
||||
memcpy(ucode,&strRead[startu],endu-startu);
|
||||
ccode[endc-startc]=0;
|
||||
ucode[endu-startu]=0;
|
||||
indexc=StrToInt(ccode);
|
||||
indexu=StrToInt(ucode);
|
||||
CP936_Array[indexc]=indexu;
|
||||
Unicode_Array[indexu]=indexc;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int StrToInt(char *strHex)
|
||||
{
|
||||
int i,len;
|
||||
unsigned short intOut;
|
||||
len=strlen(strHex);
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
if(strHex[i]>='a') strHex[i] =strHex[i]-'a'+10;
|
||||
else if(strHex[i]>='A') strHex[i] =strHex[i]-'A'+10;
|
||||
else if(strHex[i]>='0') strHex[i] =strHex[i]-'0';
|
||||
}
|
||||
|
||||
if(len==2) intOut=(unsigned short)(strHex[0]*16+strHex[1]);
|
||||
else if(len==4) intOut=(unsigned short)(strHex[0]*16+strHex[1])*256+(strHex[2]*16+strHex[3]);
|
||||
|
||||
return intOut;
|
||||
}
|
||||
|
||||
const char * Inet_ntoa(const long addr)
|
||||
{
|
||||
struct sockaddr_in addr_in;
|
||||
addr_in.sin_addr.s_addr=addr;
|
||||
return ((char *)inet_ntoa(addr_in.sin_addr));
|
||||
}
|
||||
|
||||
int msisdn_conv(BYTE* dst_buf,const char *src_buf,int req_len)
|
||||
{
|
||||
BYTE tmp_buf[256];
|
||||
int i,len;
|
||||
len = strlen(src_buf);
|
||||
memcpy(tmp_buf,src_buf,len);
|
||||
if(len%2)
|
||||
{
|
||||
tmp_buf[len] = 0x0F;
|
||||
len +=1;
|
||||
}
|
||||
AsciiToBcd_v(dst_buf,tmp_buf,len); /* exchange position of the char */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Datetime2SCTS(BYTE* scts, char* time_in)
|
||||
{
|
||||
struct tm *tmnow=NULL;
|
||||
time_t timep;
|
||||
char tmpbuf[1024];
|
||||
|
||||
timep = time(NULL);
|
||||
tmnow = localtime(&timep);
|
||||
|
||||
tmpbuf[0] = time_in[2];
|
||||
tmpbuf[1] = time_in[3];
|
||||
tmpbuf[2] = time_in[5];
|
||||
tmpbuf[3] = time_in[6];
|
||||
tmpbuf[4] = time_in[8];
|
||||
tmpbuf[5] = time_in[9];
|
||||
tmpbuf[6] = time_in[11];
|
||||
tmpbuf[7] = time_in[12];
|
||||
tmpbuf[8] = time_in[14];
|
||||
tmpbuf[9] = time_in[15];
|
||||
tmpbuf[10] = time_in[17];
|
||||
tmpbuf[11] = time_in[18];
|
||||
if(timezone>0)
|
||||
tmpbuf[12] = 0;
|
||||
else
|
||||
tmpbuf[12] = 1;
|
||||
tmpbuf[13] = timezone/3600;
|
||||
AsciiToBcd(scts,tmpbuf,14);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int AsciiToBcd(BYTE *bcd_buf, const char *ascii_buf, int len)
|
||||
{
|
||||
int i;
|
||||
char ch;
|
||||
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
ch =ascii_buf[i];
|
||||
if(ch>='a') ch -='a' -10;
|
||||
else if(ch>='A') ch -='A'-10;
|
||||
else ch -='0';
|
||||
if(i &1) *(bcd_buf++) |=ch & 0x0f;
|
||||
else *(bcd_buf) =ch<<4;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AsciiToBcd_v(BYTE *bcd_buf, const char *ascii_buf, int len)
|
||||
{
|
||||
int i;
|
||||
char ch,tmp_buf[256];
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
ch =ascii_buf[i];
|
||||
if(ch>='a') ch -= 'a' -10;
|
||||
else if(ch>='A') ch -= 'A'-10;
|
||||
else ch -= '0';
|
||||
tmp_buf[i] = ch;
|
||||
}
|
||||
for(i=0;i<len/2;i++)
|
||||
{
|
||||
*(bcd_buf++) =(tmp_buf[i*2+1]<<4) | ( tmp_buf[i*2] &0x0f);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const long Inet_pton(const char *sp)
|
||||
{
|
||||
struct in_addr i_addr;
|
||||
inet_pton(AF_INET,sp,&i_addr);
|
||||
return i_addr.s_addr;
|
||||
}
|
||||
|
||||
/* Convert data from left-aligned compact BCD form to ASCII form. */
|
||||
void BcdToAscii (char *ascii_buf, const BYTE *bcd_buf, int len)
|
||||
{
|
||||
int i;
|
||||
char ch;
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
if (i & 1) ch = *(bcd_buf++) & 0x0f;
|
||||
else ch = *bcd_buf >> 4;
|
||||
ascii_buf[i] = ch + ((ch > 9)? 'A'-10 : '0');
|
||||
}
|
||||
ascii_buf[i] = '\0';
|
||||
}
|
||||
|
||||
void DecodeAddress(char *addr_in,char *addrout)
|
||||
{
|
||||
int i,len;
|
||||
char addrin[22];
|
||||
|
||||
len = strlen(addr_in);
|
||||
BcdToAscii(addrin,addr_in,len*2);
|
||||
len = strlen(addrin);
|
||||
for(i=0;i<len/2-1;i++)
|
||||
{
|
||||
addrout[i*2] = addrin[i*2+1];
|
||||
addrout[i*2+1] = addrin[i*2];
|
||||
}
|
||||
if(addrin[len-2] =='f' || addrin[len-2] == 'F')
|
||||
{
|
||||
addrout[len-2] = addrin[len-1];
|
||||
addrout[len-1] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
addrout[len-2] = addrin[len-1];
|
||||
addrout[len-1] = addrin[len-2];
|
||||
addrout[len] = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void DecodeMSISDN(unsigned char *msisdn, char *addrout)
|
||||
{
|
||||
int i;
|
||||
char addrin[22];
|
||||
|
||||
BcdToAscii(addrin,msisdn,16);
|
||||
|
||||
for(i=0;i<8;i++)
|
||||
{
|
||||
|
||||
if(addrin[i*2] !='E' && addrin[i*2] !='e')
|
||||
{
|
||||
addrout[i*2] = addrin[i*2+1];
|
||||
addrout[i*2+1] = addrin[i*2];
|
||||
}
|
||||
else if(addrin[i*2+1] == 'E' || addrin[i*2+1] =='e')
|
||||
{
|
||||
addrout[i*2] =0;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
addrout[i*2] = addrin[i*2+1];
|
||||
addrout[i*2+1] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int msisdn2addr(char *msisdn, PSMS_ADDRESS sms_addr)
|
||||
{
|
||||
int len,i;
|
||||
char addrin[22];
|
||||
|
||||
BcdToAscii(addrin,msisdn,16);
|
||||
len =0;
|
||||
sms_addr->sms_addr_type = 0x81;
|
||||
for(i=0;i<8;i++)
|
||||
{
|
||||
if(addrin[i*2] !='E' && addrin[i*2] !='e')
|
||||
{
|
||||
sms_addr->sms_addr[i] = msisdn[i];
|
||||
len = len+2;
|
||||
}
|
||||
else if(addrin[i*2+1] == 'E' || addrin[i*2+1] =='e')
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
sms_addr->sms_addr[i] = 0xf0 | (msisdn[i] &0x0f);
|
||||
len = len+1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sms_addr->sms_addr_len = len;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int addr2msisdn(SMS_ADDRESS sms_addr, unsigned char *msisdn)
|
||||
{
|
||||
int i, len;
|
||||
char addrin[22];
|
||||
|
||||
len = sms_addr.sms_addr_len;
|
||||
BcdToAscii(addrin,sms_addr.sms_addr,len%2 ==0 ? len:len+1);
|
||||
for(i=0;i<(len+1)/2;i++)
|
||||
{
|
||||
if(addrin[i*2] !='F' && addrin[i*2] !='f')
|
||||
{
|
||||
msisdn[i] = sms_addr.sms_addr[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
msisdn[i] = 0xE0 | (sms_addr.sms_addr[i] &0x0f);
|
||||
}
|
||||
}
|
||||
for(i=(len+1)/2;i<8;i++)
|
||||
msisdn[i]=0xEE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int GetSCTS(long ltime, char *ch_time)
|
||||
{
|
||||
struct tm *t ,tt;
|
||||
char c_time[7];
|
||||
char work[2]={""};
|
||||
char tmp[20]={""};
|
||||
int i;
|
||||
|
||||
t = &tt;
|
||||
t = localtime(<ime);
|
||||
|
||||
c_time[0] = t->tm_year-100;
|
||||
c_time[1] = t->tm_mday;
|
||||
c_time[2] = t->tm_mon+1;
|
||||
c_time[3] = t->tm_hour;
|
||||
c_time[4] = t->tm_min;
|
||||
c_time[5] = t->tm_sec;
|
||||
c_time[6] = timezone/3600;
|
||||
|
||||
for(i=0;i<7;i++)
|
||||
{
|
||||
sprintf(work,"%02d",c_time[i]);
|
||||
strcat(tmp,work);
|
||||
}
|
||||
|
||||
AsciiToBcd_v(ch_time,tmp,14);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str2msisdn(char *str_In, unsigned char *msisdn)
|
||||
{
|
||||
int i,len;
|
||||
char strIn[22];
|
||||
strcpy(strIn,str_In);
|
||||
len = strlen(strIn);
|
||||
for(i=len;i<16;i++)
|
||||
strIn[i] = 'E';
|
||||
AsciiToBcd_v(msisdn,strIn,16);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str2address(char *str_In, PSMS_ADDRESS addrout)
|
||||
{
|
||||
int i,len;
|
||||
char strIn[22];
|
||||
|
||||
strcpy(strIn,str_In);
|
||||
len = strlen(strIn);
|
||||
|
||||
addrout->sms_addr_len = len;
|
||||
addrout->sms_addr_type = 0x81;
|
||||
if(len%2 ==1)
|
||||
{
|
||||
strIn[len] ='F';
|
||||
len = len+1;
|
||||
}
|
||||
AsciiToBcd_v(addrout->sms_addr,strIn,len );
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sms2str(char *strIn, char *strOut,int len)
|
||||
{
|
||||
BcdToAscii( strOut,strIn,len*2);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str2sms(char *strIn, char *strOut)
|
||||
{
|
||||
int len;
|
||||
len = strlen(strIn);
|
||||
AsciiToBcd(strOut,strIn,len);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int GetDate(long ltime,char *ctime)
|
||||
{
|
||||
struct tm *t ,tt;
|
||||
|
||||
t = &tt;
|
||||
t = localtime(<ime);
|
||||
|
||||
ctime[0] = t->tm_year-100;
|
||||
ctime[1] = t->tm_mon+1;
|
||||
ctime[2] = t->tm_mday;
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 52
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf
|
||||
END
|
||||
ppsCrdConf.txt
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 67
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/ppsCrdConf.txt
|
||||
END
|
||||
map_operation.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 71
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/map_operation.conf
|
||||
END
|
||||
map_acn.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 65
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/map_acn.conf
|
||||
END
|
||||
help_page
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/help_page
|
||||
END
|
||||
ppsConf.txt
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 64
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/ppsConf.txt
|
||||
END
|
||||
xap_sysparam.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 70
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/xap_sysparam.conf
|
||||
END
|
||||
sccp.conf_omt
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 66
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/sccp.conf_omt
|
||||
END
|
||||
menu_page
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/menu_page
|
||||
END
|
||||
iptrans.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 65
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/iptrans.conf
|
||||
END
|
||||
wxc2_sys.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 66
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/wxc2_sys.conf
|
||||
END
|
||||
conv_prefix.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 69
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/conv_prefix.conf
|
||||
END
|
||||
mtp3.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/mtp3.conf
|
||||
END
|
||||
cap_operation.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 71
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/cap_operation.conf
|
||||
END
|
||||
cap_acn.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 65
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/cap_acn.conf
|
||||
END
|
||||
sccp.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/sccp.conf
|
||||
END
|
||||
@@ -0,0 +1,538 @@
|
||||
10
|
||||
|
||||
dir
|
||||
114
|
||||
http://172.25.201.20/svn/wxc2/trunk/R4S/mss/pps/src/main/conf
|
||||
http://172.25.201.20/svn/wxc2
|
||||
|
||||
|
||||
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
4a7aa47d-8bee-446f-9599-049dc37ff264
|
||||
|
||||
ppsCrdConf.txt
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.093750Z
|
||||
33217000814fb308373097dd6d015d55
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
10289
|
||||
|
||||
map_operation.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.109375Z
|
||||
bc4f58d51ae8fdff18b7ec71c18bfdd7
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2647
|
||||
|
||||
map_acn.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.109375Z
|
||||
c2eeff43e897f1191ff6dda1e51c31da
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1509
|
||||
|
||||
help_page
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.109375Z
|
||||
487a2b3a13e1b0077495bc54ad5d8df1
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
386
|
||||
|
||||
ppsConf.txt
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.140625Z
|
||||
8add96d879bffb4071178c299efd21f1
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
5040
|
||||
|
||||
xap_sysparam.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.187500Z
|
||||
07db917a0a4b0ccba0a5543d2c64f904
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
16
|
||||
|
||||
sccp.conf_omt
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.171875Z
|
||||
535e4352e3f516c242faa58bc866eb30
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
5361
|
||||
|
||||
menu_page
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.093750Z
|
||||
fed7c4dea77026a9421bd72171df6002
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
583
|
||||
|
||||
iptrans.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.125000Z
|
||||
b0b3666a5a447b7d63550fae7e1934f4
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
516
|
||||
|
||||
wxc2_sys.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.125000Z
|
||||
85ad7cc8ef48e2afa8eaeeeab97855ec
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
86
|
||||
|
||||
conv_prefix.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.140625Z
|
||||
789b365e94dc068bb5090f254a6bbd73
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
6976
|
||||
|
||||
mtp3.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.156250Z
|
||||
937821b810444c6fbd6a1365cb8330a0
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
95312
|
||||
|
||||
cap_operation.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.156250Z
|
||||
15cd724ea91b96d8c6ff14aee06b7bcf
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1200
|
||||
|
||||
cap_acn.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.171875Z
|
||||
6eb5596aab256989a2e072f0858b47c0
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
209
|
||||
|
||||
sccp.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.187500Z
|
||||
ae0e3a6cac430bf387542d641941deda
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1228
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,9 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 24
|
||||
application/octet-stream
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,9 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 24
|
||||
application/octet-stream
|
||||
END
|
||||
@@ -0,0 +1,9 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 24
|
||||
application/octet-stream
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,9 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 24
|
||||
application/octet-stream
|
||||
END
|
||||
@@ -0,0 +1,7 @@
|
||||
#application context name configure file for CAP
|
||||
total data length=3
|
||||
|
||||
#application context name data
|
||||
No.1:50 02 // gsmSSF to gsmSCF
|
||||
No.2:51 02 // assist handoff gsmSSF to gsmSCF
|
||||
No.3:52 02 // gsmSRF to gsmSCF
|
||||
@@ -0,0 +1,34 @@
|
||||
# operation code configure file for CAP
|
||||
total data length=30
|
||||
|
||||
#operation code
|
||||
No.1:00 02 5 // initial DP
|
||||
No.2:16 02 5 // assist request instructions
|
||||
No.3:17 02 20 // establish temporary connection
|
||||
No.4:18 04 5 // disconnect forward connection
|
||||
No.5:19 04 5 // connect to resource
|
||||
No.6:20 04 5 // connect
|
||||
No.7:22 04 5 // release call
|
||||
No.8:23 02 5 // request report BCSM event
|
||||
No.9:24 02 5 // event report BCSM
|
||||
No.10:31 04 5 // continue
|
||||
No.11:33 04 5 // reset timer
|
||||
No.12:34 04 5 // furnish charging information
|
||||
No.13:35 02 5 // apply charging
|
||||
No.14:36 04 5 // apply charging report
|
||||
No.15:44 04 5 // call information report
|
||||
No.16:45 04 5 // call information request
|
||||
No.17:46 04 5 // send charging information
|
||||
No.18:47 04 60 // play announcement
|
||||
No.19:48 01 60 // prompt and collect user information
|
||||
No.20:49 04 5 // specialized resource report
|
||||
No.21:53 02 5 // cancel
|
||||
No.22:55 01 5 // activity test
|
||||
No.23:60 02 5 // initial DPSMS
|
||||
No.24:61 02 5 // Furnishing charging info.SMS
|
||||
No.25:62 02 5 // connect DPSMS
|
||||
No.26:63 02 5 // request SMS event
|
||||
No.27:64 02 5 // event report SMS
|
||||
No.28:65 04 5 // continue SMS
|
||||
No.29:66 04 5 // release DPSMS
|
||||
No.30:67 02 5 // reset timer DPSMS
|
||||
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
|
||||
******************
|
||||
* HELP PAGE *
|
||||
******************
|
||||
|
||||
Welcome to DEBUG MONITOR.
|
||||
|
||||
Press 's' or 'S' to enter "SUB MODULE SELECTION PAGE".
|
||||
|
||||
In "SUB MODULE SELECTION PAGE",
|
||||
Press 'x' or 'X' to return "HELP PAGE",
|
||||
Press 'a-p' or 'A-P' to select sub module.
|
||||
|
||||
In each sub module,
|
||||
Press '0-9' and 'a-f' to select pages.
|
||||
$
|
||||
@@ -0,0 +1,30 @@
|
||||
#ipconfig
|
||||
#port=type,num,interface
|
||||
#type=UDP/TCP
|
||||
#num=0-6
|
||||
#interface=BUFFER/DIRECT
|
||||
|
||||
4950=UDP,6,DIRECT
|
||||
4951=UDP,0,BUFFER
|
||||
4952=UDP,0,BUFFER
|
||||
4953=UDP,3,BUFFER
|
||||
4954=UDP,3,BUFFER
|
||||
4955=UDP,3,BUFFER
|
||||
4956=UDP,0,BUFFER
|
||||
4957=UDP,4,BUFFER
|
||||
4958=UDP,0,BUFFER
|
||||
4959=UDP,0,BUFFER
|
||||
4960=UDP,0,BUFFER
|
||||
4961=UDP,0,BUFFER
|
||||
4962=UDP,0,BUFFER
|
||||
4963=UDP,0,BUFFER
|
||||
4964=UDP,0,BUFFER
|
||||
4965=TCP,2,BUFFER
|
||||
4966=UDP,0,BUFFER
|
||||
4967=UDP,0,BUFFER
|
||||
4968=UDP,0,BUFFER
|
||||
4969=UDP,0,BUFFER
|
||||
4970=UDP,0,BUFFER
|
||||
4971=UDP,2,BUFFER
|
||||
4972=UDP,0,BUFFER
|
||||
4973=UDP,0,BUFFER
|
||||
@@ -0,0 +1,40 @@
|
||||
#application context name configure file
|
||||
total data length=36
|
||||
|
||||
#application context name data
|
||||
No.1:01 03 // network location update
|
||||
No.2:02 03 // location cancel
|
||||
No.3:03 03 // roaming number enquiry
|
||||
No.4:05 03 // location info retrieval
|
||||
No.5:10 02 // reset context
|
||||
No.6:11 02 // handover control
|
||||
No.7:13 02 // equipment management
|
||||
No.8:14 02 // info retrieval
|
||||
No.9:15 02 // inter VLR info retrieval
|
||||
No.10:16 03 // subscriber data management
|
||||
No.11:17 03 // tracing
|
||||
No.12:18 02 // network functional SS
|
||||
No.13:19 02 // network unstructured SS
|
||||
No.14:20 03 // short message gateway
|
||||
No.15:21 03 // short message MO relay
|
||||
No.16:23 02 // short message alert
|
||||
No.17:24 03 // short message waiting data management
|
||||
No.18:25 03 // mobile terminating short message relay
|
||||
No.19:26 02 // imsi retrieval
|
||||
No.20:27 03 // MS purging
|
||||
No.21:28 03 // subscriber info enquiry
|
||||
No.22:29 03 // any time info enquiry
|
||||
No.23:06 03 // call control transfer
|
||||
No.24:36 03 // invocation notification
|
||||
No.25:12 03 // sIWFS allocation
|
||||
No.26:31 03 // group call control
|
||||
No.27:32 03 // GPRS location update
|
||||
No.28:33 03 // GPRS location info retrieval
|
||||
No.29:34 03 // failure report
|
||||
No.30:35 03 // GPRS notify
|
||||
No.31:07 03 // reporting
|
||||
No.32:08 03 // call completion
|
||||
No.33:200 02 // security triplets (MAP-H defined by Meng Xiaozhen)
|
||||
No.34:201 02 // subscriber interrogate (MAP-H defined by Meng Xiaozhen)
|
||||
No.35:202 02 // HLR subscriber management (MAP-H defined by Meng Xiaozhen)
|
||||
No.36:203 02 // HLR ping AUC (MAP-H defined by Meng Xiaozhen reserved)
|
||||
@@ -0,0 +1,66 @@
|
||||
# operation code configure file
|
||||
total data length=62
|
||||
|
||||
#operation code
|
||||
No.1:02 01 20 // update location
|
||||
No.2:03 01 10 // cancel location
|
||||
No.3:67 01 20 // purge mobile station
|
||||
No.4:55 01 05 // send identification
|
||||
No.5:68 01 20 // prepare handover
|
||||
No.6:29 03 108000 // send end signal
|
||||
No.7:33 04 05 // process access signalling
|
||||
No.8:34 04 05 // forward access signalling
|
||||
No.9:69 01 20 // prepare subsequent handover
|
||||
No.10:56 01 20 // send authentication info
|
||||
No.11:43 01 20 // check IMEI
|
||||
No.12:07 01 20 // insert subscriber data
|
||||
No.13:08 01 20 // delete subscriber data
|
||||
No.14:37 04 20 // reset
|
||||
No.15:38 04 20 // forward check ss indication
|
||||
No.16:57 01 20 // restore data
|
||||
No.17:50 01 20 // active trace mode
|
||||
No.18:51 01 20 // deactive trace mode
|
||||
No.19:58 01 20 // send imsi
|
||||
No.20:22 01 20 // send routing info
|
||||
No.21:04 01 20 // provide roaming number
|
||||
No.22:06 01 20 // resume call handling
|
||||
No.23:31 01 20 // provide SIWFS number
|
||||
No.24:32 01 20 // SIWFS signalling modify
|
||||
No.25:73 01 20 // set report state
|
||||
No.26:74 01 20 // status report
|
||||
No.27:75 01 60 // remote user free
|
||||
No.28:10 01 20 // register ss
|
||||
No.29:11 01 20 // erase ss
|
||||
No.30:12 01 20 // activate ss
|
||||
No.31:13 01 20 // deactivate ss
|
||||
No.32:14 01 20 // interrogate ss
|
||||
No.33:59 01 600 // process unstructure ss request
|
||||
No.34:60 01 60 // unstructure ss request
|
||||
No.35:61 01 60 // unstructure ss notify
|
||||
No.36:17 01 60 // register password
|
||||
No.37:18 03 20 // get password
|
||||
No.38:76 01 20 // register cc entry
|
||||
No.39:77 01 20 // erase cc entry
|
||||
No.40:45 01 20 // send routing info for sm
|
||||
No.41:46 01 60 // mo forward sm
|
||||
No.42:44 01 60 // mt forward sm
|
||||
No.43:47 01 05 // report sm delivery status
|
||||
No.44:63 04 05 // inform service centre
|
||||
No.45:64 01 05 // alert service center
|
||||
No.46:66 01 05 // ready for sm
|
||||
No.47:70 01 20 // provider subscriber info
|
||||
No.48:71 01 20 // any time interrogation
|
||||
No.49:72 01 20 // ss invocatin notification
|
||||
No.50:39 01 20 // prepare group call
|
||||
No.51:40 03 108000 // send group call end signal
|
||||
No.52:41 04 05 // process group call signalling
|
||||
No.53:42 04 05 // forward group call signalling
|
||||
No.54:23 01 20 // update GPRS location
|
||||
No.55:24 01 20 // send routing info for GPRS
|
||||
No.56:25 01 20 // failure report
|
||||
No.57:26 01 20 // note ms present for GPRS
|
||||
No.58:200 01 05 // security triplets (MAP-H defined by Meng Xiaozhen)
|
||||
No.59:201 01 05 // interrogate subscriber (MAP-H defined by Meng Xiaozhen)
|
||||
No.60:202 01 05 // hlr create subscriber (MAP-H defined by Meng Xiaozhen)
|
||||
No.61:203 01 05 // hlr delete subscriber (MAP-H defined by Meng Xiaozhen)
|
||||
No.62:204 01 05 // hlr ping auc (MAP-H defined by Meng Xiaozhen reserved)
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
*********************************
|
||||
* SUB MODULE SELECTION PAGE *
|
||||
*********************************
|
||||
|
||||
a -- IPTR i -- HLR
|
||||
b -- MTP3 j -- SMSC
|
||||
c -- SCCP k -- SCF
|
||||
d -- TCAP l -- SNMP
|
||||
e -- CAPP m -- DATA SYNC
|
||||
f -- CCF n -- DEBUG
|
||||
g -- VLR o -- reserved
|
||||
h -- SSF p -- reserved
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
#SCCP Config file (R8V0_09)
|
||||
|
||||
[Local Node]
|
||||
#ssn NetID msisdn ip0 ip1
|
||||
4 0 - 172.18.128.1 172.18.129.1
|
||||
6 0 86755900500 172.18.128.1 172.18.99.1
|
||||
8 0 2525950008 172.48.112.143 -
|
||||
9 0 86755900503 172.18.98.1 172.18.99.1
|
||||
10 0 86755900504 172.18.98.1 172.18.99.1
|
||||
11 0 86755900505 172.18.98.1 172.18.99.1
|
||||
19 0 8675557127005 172.18.136.1 172.18.137.1
|
||||
20 0 8675557127006 172.18.144.1 172.18.145.1
|
||||
146 0 2525950007 172.18.128.138 -
|
||||
147 0 2525950006 172.18.128.137 -
|
||||
254 0 - 172.18.98.1 172.18.99.1
|
||||
[GTT_Table]
|
||||
#No NP StartDigits EndDigits NI SPC SSN RI AI S E N Rep
|
||||
0 6 540015200020000 540015200029999 0 00003C 6 1 7
|
||||
1 1 4475588881000 4475588881999 0 00003C 6 1 7
|
||||
2 1 4475556000000 4475556000003 0 00003C 0 0 7
|
||||
3 1 86755900510 86755900510 3 030303 19 1 7
|
||||
4 6 460029000000000 460029000019999 0 000001 6 1 7
|
||||
5 1 86755900000 86755919999 0 000001 6 1 7
|
||||
|
||||
[RL_SSN]
|
||||
#NetID DPC SSN
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
#SCCP Config file (R8V0_04)
|
||||
|
||||
[Local Node]
|
||||
#ssn NetID msisdn ip0 ip1
|
||||
4 2 594694000006 172.18.128.1 172.18.129.1
|
||||
6 2 594694000002 172.18.98.1 172.18.99.1
|
||||
7 2 594694000005 172.18.98.1 172.18.99.1
|
||||
8 2 594694000001 172.18.98.1 172.18.99.1
|
||||
9 2 594694000007 172.18.98.1 172.18.99.1
|
||||
10 2 594694000008 172.18.98.1 172.18.99.1
|
||||
11 2 594694000000 172.18.98.1 172.18.99.1
|
||||
19 2 594694000009 172.18.98.1 172.18.99.1
|
||||
20 2 594694000010 172.18.98.1 172.18.99.1
|
||||
21 2 594694000011 172.18.128.1 172.18.129.1
|
||||
22 2 594694980012 172.18.100.1 172.18.101.1
|
||||
146 2 594694000004 172.18.98.1 172.18.99.1
|
||||
147 2 594694000003 172.18.98.1 172.18.99.1
|
||||
254 2 - 172.18.98.1 172.18.99.1
|
||||
[GTT_Table]
|
||||
#No NP StartDigits EndDigits NI SPC SSN RI AI S E N Rep
|
||||
0 6 340020000000000 340029999999999 2 001FD3 6 1 7
|
||||
2 1 594694001000 594694009998 2 001FD3 6 1 7
|
||||
3 1 594694460000 594694469998 2 001FD3 6 1 7
|
||||
4 1 594694471000 594694479998 2 001FD3 6 1 7
|
||||
5 1 594694980012 594694980012 2 000003 8 0 7
|
||||
6 1 594694980013 594694980013 2 000004 8 0 7
|
||||
7 1 338 338 2 000B03 0 0 6
|
||||
8 1 33609 33609 2 000B03 0 0 6
|
||||
9 1 33603 33608 2 000B03 0 0 6 1 1 1 3383
|
||||
10 1 33610 33629 2 000B03 0 0 6 1 1 1 3383
|
||||
11 1 5906900 5906902 2 000B03 0 0 6 1 1 1 3385
|
||||
12 1 262692 262692 2 000B03 0 0 6 1 1 1 3382
|
||||
13 1 352 352 2 000B03 0 0 6 1 1 1 3383
|
||||
14 1 33660 33660 2 000B03 0 0 6
|
||||
15 1 33662 33662 2 000B03 0 0 6
|
||||
16 6 208100000000000 208109999999999 2 000B03 6 0 6 1 5 7 33609
|
||||
26 1 594694000002 594694000002 2 001FD3 6 1 7
|
||||
28 1 5946941 5946941 2 000B03 0 0 6 1 1 1 3385
|
||||
29 1 594694480000 594694979999 2 000B03 0 0 6 1 1 1 3385
|
||||
30 7 5946940001000000 5946940001099999 2 001FD3 6 1 7 1 16 1 594694000002
|
||||
31 7 594694000100000 594694000199999 2 001FD3 6 1 7 1 15 1 594694000002
|
||||
34 1 5966960 5966961 2 000B03 0 0 6 1 1 1 3385
|
||||
37 1 59035 59035 2 000B03 0 0 6
|
||||
38 1 59669690 59669690 2 000B03 0 0 6
|
||||
41 1 59669620 59669649 2 000B03 0 0 6
|
||||
42 1 59069037 59069041 2 000B03 0 0 6
|
||||
43 1 59069030 59069035 2 000B03 0 0 6
|
||||
44 1 59069036 59069036 2 000B03 0 0 6 1 1 1 3385
|
||||
45 1 59069047 59069065 2 000B03 0 0 6
|
||||
46 1 59069067 59069068 2 000B03 0 0 6
|
||||
47 1 59069071 59069076 2 000B03 0 0 6
|
||||
48 1 59469420 59469426 2 000B03 0 0 6
|
||||
49 1 59469438 59469438 2 000B03 0 0 6
|
||||
50 1 59469440 59469445 2 000B03 0 0 6
|
||||
51 1 59669680 59669686 2 000B03 0 0 6
|
||||
52 1 59069066 59069066 2 000B03 0 0 6 1 1 1 3385
|
||||
54 1 59669699 59669699 2 000B03 0 0 6
|
||||
56 1 59069042 59069046 2 000B03 0 0 6 1 1 1 3385
|
||||
57 1 59069069 59069070 2 000B03 0 0 6 1 1 1 3385
|
||||
58 1 59069077 59069099 2 000B03 0 0 6 1 1 1 3385
|
||||
60 1 59669650 59669679 2 000B03 0 0 6
|
||||
61 1 59669691 59669698 2 000B03 0 0 6
|
||||
62 1 59469427 59469437 2 000B03 0 0 6 1 1 1 3385
|
||||
63 1 59469439 59469439 2 000B03 0 0 6 1 1 1 3385
|
||||
65 1 594694401000 594694409999 2 0000B3 0 0 6 1 1 1 3385
|
||||
70 6 746020000000000 746029999999999 2 000B03 0 0 6 1 5 7 59785
|
||||
71 1 597 597 2 000B03 0 0 6
|
||||
75 6 250020000000000 250029999999999 2 000B03 0 0 6 1 5 7 781296
|
||||
76 1 78 79 2 000B03 0 0 6
|
||||
78 6 2509900000000000 250999999999999 2 000B03 0 0 6 1 5 7 79037
|
||||
80 6 222100000000000 222109999999999 2 000B03 0 0 6 1 5 7 39349
|
||||
81 1 39 39 2 000B03 0 0 6
|
||||
85 6 738002000000000 738002999999999 2 000B03 0 0 6 1 6 7 592640
|
||||
86 1 592 592 2 000B03 0 0 6
|
||||
87 1 5926400001 5926400001 2 000B03 7 0 6
|
||||
90 6 338050000000000 338050999999999 2 000B03 0 0 6 1 6 7 187638
|
||||
91 1 18 18 2 000B03 0 0 6
|
||||
95 6 362510000000000 362519999999999 2 000B03 0 0 6 1 5 7 59952
|
||||
96 1 599 599 2 000B03 0 0 6
|
||||
98 6 4600000000000000 460009999999999 2 000B03 0 0 6 1 5 7 86139
|
||||
100 1 86 86 2 000B03 0 0 6
|
||||
102 6 724160000000000 7241699999999990 2 000B03 0 0 6 1 5 7 55016
|
||||
104 1 55 55 2 000B03 0 0 6
|
||||
|
||||
[RL_SSN]
|
||||
#NetID DPC SSN
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#system configure file
|
||||
|
||||
#IP info of wxc2
|
||||
pps-0=172.18.128.136;
|
||||
pps-1=172.18.128.137;
|
||||
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
#application context name configure file for CAP
|
||||
total data length=3
|
||||
|
||||
#application context name data
|
||||
No.1:50 02 // gsmSSF to gsmSCF
|
||||
No.2:51 02 // assist handoff gsmSSF to gsmSCF
|
||||
No.3:52 02 // gsmSRF to gsmSCF
|
||||
@@ -0,0 +1,34 @@
|
||||
# operation code configure file for CAP
|
||||
total data length=30
|
||||
|
||||
#operation code
|
||||
No.1:00 02 5 // initial DP
|
||||
No.2:16 02 5 // assist request instructions
|
||||
No.3:17 02 20 // establish temporary connection
|
||||
No.4:18 04 5 // disconnect forward connection
|
||||
No.5:19 04 5 // connect to resource
|
||||
No.6:20 04 5 // connect
|
||||
No.7:22 04 5 // release call
|
||||
No.8:23 02 5 // request report BCSM event
|
||||
No.9:24 02 5 // event report BCSM
|
||||
No.10:31 04 5 // continue
|
||||
No.11:33 04 5 // reset timer
|
||||
No.12:34 04 5 // furnish charging information
|
||||
No.13:35 02 5 // apply charging
|
||||
No.14:36 04 5 // apply charging report
|
||||
No.15:44 04 5 // call information report
|
||||
No.16:45 04 5 // call information request
|
||||
No.17:46 04 5 // send charging information
|
||||
No.18:47 04 60 // play announcement
|
||||
No.19:48 01 60 // prompt and collect user information
|
||||
No.20:49 04 5 // specialized resource report
|
||||
No.21:53 02 5 // cancel
|
||||
No.22:55 01 5 // activity test
|
||||
No.23:60 02 5 // initial DPSMS
|
||||
No.24:61 02 5 // Furnishing charging info.SMS
|
||||
No.25:62 02 5 // connect DPSMS
|
||||
No.26:63 02 5 // request SMS event
|
||||
No.27:64 02 5 // event report SMS
|
||||
No.28:65 04 5 // continue SMS
|
||||
No.29:66 04 5 // release DPSMS
|
||||
No.30:67 02 5 // reset timer DPSMS
|
||||
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
|
||||
******************
|
||||
* HELP PAGE *
|
||||
******************
|
||||
|
||||
Welcome to DEBUG MONITOR.
|
||||
|
||||
Press 's' or 'S' to enter "SUB MODULE SELECTION PAGE".
|
||||
|
||||
In "SUB MODULE SELECTION PAGE",
|
||||
Press 'x' or 'X' to return "HELP PAGE",
|
||||
Press 'a-p' or 'A-P' to select sub module.
|
||||
|
||||
In each sub module,
|
||||
Press '0-9' and 'a-f' to select pages.
|
||||
$
|
||||
@@ -0,0 +1,30 @@
|
||||
#ipconfig
|
||||
#port=type,num,interface
|
||||
#type=UDP/TCP
|
||||
#num=0-6
|
||||
#interface=BUFFER/DIRECT
|
||||
|
||||
4950=UDP,6,DIRECT
|
||||
4951=UDP,0,BUFFER
|
||||
4952=UDP,0,BUFFER
|
||||
4953=UDP,3,BUFFER
|
||||
4954=UDP,3,BUFFER
|
||||
4955=UDP,3,BUFFER
|
||||
4956=UDP,0,BUFFER
|
||||
4957=UDP,4,BUFFER
|
||||
4958=UDP,0,BUFFER
|
||||
4959=UDP,0,BUFFER
|
||||
4960=UDP,0,BUFFER
|
||||
4961=UDP,0,BUFFER
|
||||
4962=UDP,0,BUFFER
|
||||
4963=UDP,0,BUFFER
|
||||
4964=UDP,0,BUFFER
|
||||
4965=TCP,2,BUFFER
|
||||
4966=UDP,0,BUFFER
|
||||
4967=UDP,0,BUFFER
|
||||
4968=UDP,0,BUFFER
|
||||
4969=UDP,0,BUFFER
|
||||
4970=UDP,0,BUFFER
|
||||
4971=UDP,2,BUFFER
|
||||
4972=UDP,0,BUFFER
|
||||
4973=UDP,0,BUFFER
|
||||
@@ -0,0 +1,40 @@
|
||||
#application context name configure file
|
||||
total data length=36
|
||||
|
||||
#application context name data
|
||||
No.1:01 03 // network location update
|
||||
No.2:02 03 // location cancel
|
||||
No.3:03 03 // roaming number enquiry
|
||||
No.4:05 03 // location info retrieval
|
||||
No.5:10 02 // reset context
|
||||
No.6:11 02 // handover control
|
||||
No.7:13 02 // equipment management
|
||||
No.8:14 02 // info retrieval
|
||||
No.9:15 02 // inter VLR info retrieval
|
||||
No.10:16 03 // subscriber data management
|
||||
No.11:17 03 // tracing
|
||||
No.12:18 02 // network functional SS
|
||||
No.13:19 02 // network unstructured SS
|
||||
No.14:20 03 // short message gateway
|
||||
No.15:21 03 // short message MO relay
|
||||
No.16:23 02 // short message alert
|
||||
No.17:24 03 // short message waiting data management
|
||||
No.18:25 03 // mobile terminating short message relay
|
||||
No.19:26 02 // imsi retrieval
|
||||
No.20:27 03 // MS purging
|
||||
No.21:28 03 // subscriber info enquiry
|
||||
No.22:29 03 // any time info enquiry
|
||||
No.23:06 03 // call control transfer
|
||||
No.24:36 03 // invocation notification
|
||||
No.25:12 03 // sIWFS allocation
|
||||
No.26:31 03 // group call control
|
||||
No.27:32 03 // GPRS location update
|
||||
No.28:33 03 // GPRS location info retrieval
|
||||
No.29:34 03 // failure report
|
||||
No.30:35 03 // GPRS notify
|
||||
No.31:07 03 // reporting
|
||||
No.32:08 03 // call completion
|
||||
No.33:200 02 // security triplets (MAP-H defined by Meng Xiaozhen)
|
||||
No.34:201 02 // subscriber interrogate (MAP-H defined by Meng Xiaozhen)
|
||||
No.35:202 02 // HLR subscriber management (MAP-H defined by Meng Xiaozhen)
|
||||
No.36:203 02 // HLR ping AUC (MAP-H defined by Meng Xiaozhen reserved)
|
||||
@@ -0,0 +1,66 @@
|
||||
# operation code configure file
|
||||
total data length=62
|
||||
|
||||
#operation code
|
||||
No.1:02 01 20 // update location
|
||||
No.2:03 01 10 // cancel location
|
||||
No.3:67 01 20 // purge mobile station
|
||||
No.4:55 01 05 // send identification
|
||||
No.5:68 01 20 // prepare handover
|
||||
No.6:29 03 108000 // send end signal
|
||||
No.7:33 04 05 // process access signalling
|
||||
No.8:34 04 05 // forward access signalling
|
||||
No.9:69 01 20 // prepare subsequent handover
|
||||
No.10:56 01 20 // send authentication info
|
||||
No.11:43 01 20 // check IMEI
|
||||
No.12:07 01 20 // insert subscriber data
|
||||
No.13:08 01 20 // delete subscriber data
|
||||
No.14:37 04 20 // reset
|
||||
No.15:38 04 20 // forward check ss indication
|
||||
No.16:57 01 20 // restore data
|
||||
No.17:50 01 20 // active trace mode
|
||||
No.18:51 01 20 // deactive trace mode
|
||||
No.19:58 01 20 // send imsi
|
||||
No.20:22 01 20 // send routing info
|
||||
No.21:04 01 20 // provide roaming number
|
||||
No.22:06 01 20 // resume call handling
|
||||
No.23:31 01 20 // provide SIWFS number
|
||||
No.24:32 01 20 // SIWFS signalling modify
|
||||
No.25:73 01 20 // set report state
|
||||
No.26:74 01 20 // status report
|
||||
No.27:75 01 60 // remote user free
|
||||
No.28:10 01 20 // register ss
|
||||
No.29:11 01 20 // erase ss
|
||||
No.30:12 01 20 // activate ss
|
||||
No.31:13 01 20 // deactivate ss
|
||||
No.32:14 01 20 // interrogate ss
|
||||
No.33:59 01 600 // process unstructure ss request
|
||||
No.34:60 01 60 // unstructure ss request
|
||||
No.35:61 01 60 // unstructure ss notify
|
||||
No.36:17 01 60 // register password
|
||||
No.37:18 03 20 // get password
|
||||
No.38:76 01 20 // register cc entry
|
||||
No.39:77 01 20 // erase cc entry
|
||||
No.40:45 01 20 // send routing info for sm
|
||||
No.41:46 01 60 // mo forward sm
|
||||
No.42:44 01 60 // mt forward sm
|
||||
No.43:47 01 05 // report sm delivery status
|
||||
No.44:63 04 05 // inform service centre
|
||||
No.45:64 01 05 // alert service center
|
||||
No.46:66 01 05 // ready for sm
|
||||
No.47:70 01 20 // provider subscriber info
|
||||
No.48:71 01 20 // any time interrogation
|
||||
No.49:72 01 20 // ss invocatin notification
|
||||
No.50:39 01 20 // prepare group call
|
||||
No.51:40 03 108000 // send group call end signal
|
||||
No.52:41 04 05 // process group call signalling
|
||||
No.53:42 04 05 // forward group call signalling
|
||||
No.54:23 01 20 // update GPRS location
|
||||
No.55:24 01 20 // send routing info for GPRS
|
||||
No.56:25 01 20 // failure report
|
||||
No.57:26 01 20 // note ms present for GPRS
|
||||
No.58:200 01 05 // security triplets (MAP-H defined by Meng Xiaozhen)
|
||||
No.59:201 01 05 // interrogate subscriber (MAP-H defined by Meng Xiaozhen)
|
||||
No.60:202 01 05 // hlr create subscriber (MAP-H defined by Meng Xiaozhen)
|
||||
No.61:203 01 05 // hlr delete subscriber (MAP-H defined by Meng Xiaozhen)
|
||||
No.62:204 01 05 // hlr ping auc (MAP-H defined by Meng Xiaozhen reserved)
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
*********************************
|
||||
* SUB MODULE SELECTION PAGE *
|
||||
*********************************
|
||||
|
||||
a -- IPTR i -- HLR
|
||||
b -- MTP3 j -- SMSC
|
||||
c -- SCCP k -- SCF
|
||||
d -- TCAP l -- SNMP
|
||||
e -- CAPP m -- DATA SYNC
|
||||
f -- CCF n -- DEBUG
|
||||
g -- VLR o -- reserved
|
||||
h -- SSF p -- reserved
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
#SCCP Config file (R8V0_09)
|
||||
|
||||
[Local Node]
|
||||
#ssn NetID msisdn ip0 ip1
|
||||
4 0 - 172.18.128.1 172.18.129.1
|
||||
6 0 86755900500 172.18.128.1 172.18.99.1
|
||||
8 0 2525950008 172.48.112.143 -
|
||||
9 0 86755900503 172.18.98.1 172.18.99.1
|
||||
10 0 86755900504 172.18.98.1 172.18.99.1
|
||||
11 0 86755900505 172.18.98.1 172.18.99.1
|
||||
19 0 8675557127005 172.18.136.1 172.18.137.1
|
||||
20 0 8675557127006 172.18.144.1 172.18.145.1
|
||||
146 0 2525950007 172.18.128.138 -
|
||||
147 0 2525950006 172.18.128.137 -
|
||||
254 0 - 172.18.98.1 172.18.99.1
|
||||
[GTT_Table]
|
||||
#No NP StartDigits EndDigits NI SPC SSN RI AI S E N Rep
|
||||
0 6 540015200020000 540015200029999 0 00003C 6 1 7
|
||||
1 1 4475588881000 4475588881999 0 00003C 6 1 7
|
||||
2 1 4475556000000 4475556000003 0 00003C 0 0 7
|
||||
3 1 86755900510 86755900510 3 030303 19 1 7
|
||||
4 6 460029000000000 460029000019999 0 000001 6 1 7
|
||||
5 1 86755900000 86755919999 0 000001 6 1 7
|
||||
|
||||
[RL_SSN]
|
||||
#NetID DPC SSN
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
#SCCP Config file (R8V0_04)
|
||||
|
||||
[Local Node]
|
||||
#ssn NetID msisdn ip0 ip1
|
||||
4 2 594694000006 172.18.128.1 172.18.129.1
|
||||
6 2 594694000002 172.18.98.1 172.18.99.1
|
||||
7 2 594694000005 172.18.98.1 172.18.99.1
|
||||
8 2 594694000001 172.18.98.1 172.18.99.1
|
||||
9 2 594694000007 172.18.98.1 172.18.99.1
|
||||
10 2 594694000008 172.18.98.1 172.18.99.1
|
||||
11 2 594694000000 172.18.98.1 172.18.99.1
|
||||
19 2 594694000009 172.18.98.1 172.18.99.1
|
||||
20 2 594694000010 172.18.98.1 172.18.99.1
|
||||
21 2 594694000011 172.18.128.1 172.18.129.1
|
||||
22 2 594694980012 172.18.100.1 172.18.101.1
|
||||
146 2 594694000004 172.18.98.1 172.18.99.1
|
||||
147 2 594694000003 172.18.98.1 172.18.99.1
|
||||
254 2 - 172.18.98.1 172.18.99.1
|
||||
[GTT_Table]
|
||||
#No NP StartDigits EndDigits NI SPC SSN RI AI S E N Rep
|
||||
0 6 340020000000000 340029999999999 2 001FD3 6 1 7
|
||||
2 1 594694001000 594694009998 2 001FD3 6 1 7
|
||||
3 1 594694460000 594694469998 2 001FD3 6 1 7
|
||||
4 1 594694471000 594694479998 2 001FD3 6 1 7
|
||||
5 1 594694980012 594694980012 2 000003 8 0 7
|
||||
6 1 594694980013 594694980013 2 000004 8 0 7
|
||||
7 1 338 338 2 000B03 0 0 6
|
||||
8 1 33609 33609 2 000B03 0 0 6
|
||||
9 1 33603 33608 2 000B03 0 0 6 1 1 1 3383
|
||||
10 1 33610 33629 2 000B03 0 0 6 1 1 1 3383
|
||||
11 1 5906900 5906902 2 000B03 0 0 6 1 1 1 3385
|
||||
12 1 262692 262692 2 000B03 0 0 6 1 1 1 3382
|
||||
13 1 352 352 2 000B03 0 0 6 1 1 1 3383
|
||||
14 1 33660 33660 2 000B03 0 0 6
|
||||
15 1 33662 33662 2 000B03 0 0 6
|
||||
16 6 208100000000000 208109999999999 2 000B03 6 0 6 1 5 7 33609
|
||||
26 1 594694000002 594694000002 2 001FD3 6 1 7
|
||||
28 1 5946941 5946941 2 000B03 0 0 6 1 1 1 3385
|
||||
29 1 594694480000 594694979999 2 000B03 0 0 6 1 1 1 3385
|
||||
30 7 5946940001000000 5946940001099999 2 001FD3 6 1 7 1 16 1 594694000002
|
||||
31 7 594694000100000 594694000199999 2 001FD3 6 1 7 1 15 1 594694000002
|
||||
34 1 5966960 5966961 2 000B03 0 0 6 1 1 1 3385
|
||||
37 1 59035 59035 2 000B03 0 0 6
|
||||
38 1 59669690 59669690 2 000B03 0 0 6
|
||||
41 1 59669620 59669649 2 000B03 0 0 6
|
||||
42 1 59069037 59069041 2 000B03 0 0 6
|
||||
43 1 59069030 59069035 2 000B03 0 0 6
|
||||
44 1 59069036 59069036 2 000B03 0 0 6 1 1 1 3385
|
||||
45 1 59069047 59069065 2 000B03 0 0 6
|
||||
46 1 59069067 59069068 2 000B03 0 0 6
|
||||
47 1 59069071 59069076 2 000B03 0 0 6
|
||||
48 1 59469420 59469426 2 000B03 0 0 6
|
||||
49 1 59469438 59469438 2 000B03 0 0 6
|
||||
50 1 59469440 59469445 2 000B03 0 0 6
|
||||
51 1 59669680 59669686 2 000B03 0 0 6
|
||||
52 1 59069066 59069066 2 000B03 0 0 6 1 1 1 3385
|
||||
54 1 59669699 59669699 2 000B03 0 0 6
|
||||
56 1 59069042 59069046 2 000B03 0 0 6 1 1 1 3385
|
||||
57 1 59069069 59069070 2 000B03 0 0 6 1 1 1 3385
|
||||
58 1 59069077 59069099 2 000B03 0 0 6 1 1 1 3385
|
||||
60 1 59669650 59669679 2 000B03 0 0 6
|
||||
61 1 59669691 59669698 2 000B03 0 0 6
|
||||
62 1 59469427 59469437 2 000B03 0 0 6 1 1 1 3385
|
||||
63 1 59469439 59469439 2 000B03 0 0 6 1 1 1 3385
|
||||
65 1 594694401000 594694409999 2 0000B3 0 0 6 1 1 1 3385
|
||||
70 6 746020000000000 746029999999999 2 000B03 0 0 6 1 5 7 59785
|
||||
71 1 597 597 2 000B03 0 0 6
|
||||
75 6 250020000000000 250029999999999 2 000B03 0 0 6 1 5 7 781296
|
||||
76 1 78 79 2 000B03 0 0 6
|
||||
78 6 2509900000000000 250999999999999 2 000B03 0 0 6 1 5 7 79037
|
||||
80 6 222100000000000 222109999999999 2 000B03 0 0 6 1 5 7 39349
|
||||
81 1 39 39 2 000B03 0 0 6
|
||||
85 6 738002000000000 738002999999999 2 000B03 0 0 6 1 6 7 592640
|
||||
86 1 592 592 2 000B03 0 0 6
|
||||
87 1 5926400001 5926400001 2 000B03 7 0 6
|
||||
90 6 338050000000000 338050999999999 2 000B03 0 0 6 1 6 7 187638
|
||||
91 1 18 18 2 000B03 0 0 6
|
||||
95 6 362510000000000 362519999999999 2 000B03 0 0 6 1 5 7 59952
|
||||
96 1 599 599 2 000B03 0 0 6
|
||||
98 6 4600000000000000 460009999999999 2 000B03 0 0 6 1 5 7 86139
|
||||
100 1 86 86 2 000B03 0 0 6
|
||||
102 6 724160000000000 7241699999999990 2 000B03 0 0 6 1 5 7 55016
|
||||
104 1 55 55 2 000B03 0 0 6
|
||||
|
||||
[RL_SSN]
|
||||
#NetID DPC SSN
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#system configure file
|
||||
|
||||
#IP info of wxc2
|
||||
pps-0=172.18.128.136;
|
||||
pps-1=172.18.128.137;
|
||||
Binary file not shown.
@@ -0,0 +1,216 @@
|
||||
#include "../include/includes.h"
|
||||
#include "../include/crd.h"
|
||||
#include "../include/param.h"
|
||||
|
||||
|
||||
extern PPSParamStruct ppsParam;
|
||||
|
||||
int SetCRDParam(u_char oidLen, DWORD *oid,
|
||||
u_char *pdata, u_short dataLen)
|
||||
{
|
||||
int oid0;
|
||||
VmsRouteParam *pcrd;
|
||||
|
||||
pcrd = &ppsParam.routeParam;
|
||||
oid0 = oid[13];
|
||||
switch(oid0)
|
||||
{
|
||||
case 1:
|
||||
memset(pcrd->plmnServiceNumber,0,16);
|
||||
memcpy(pcrd->plmnServiceNumber,pdata,dataLen);
|
||||
break;
|
||||
case 2:
|
||||
memset(pcrd->pstnServiceNumber,0,16);
|
||||
memcpy(pcrd->pstnServiceNumber,pdata,dataLen);
|
||||
|
||||
break;
|
||||
case 3:
|
||||
memset(pcrd->leaveMessageNumber,0,16);
|
||||
memcpy(pcrd->leaveMessageNumber,pdata,dataLen);
|
||||
break;
|
||||
case 4:
|
||||
pcrd->routeMethodOption = pdata[0];
|
||||
break;
|
||||
case 5:
|
||||
pcrd->routeNumberOption = pdata[0];
|
||||
break;
|
||||
case 6:
|
||||
pcrd->isPostpaidAllowed = pdata[0];
|
||||
break;
|
||||
case 7:
|
||||
pcrd->ring_back_service_key = pdata[0];
|
||||
break;
|
||||
}
|
||||
return dataLen;
|
||||
}
|
||||
|
||||
int GetCRDParam(u_char oidLen, DWORD *oid,
|
||||
u_char *pdata, BYTE *vartype)
|
||||
{
|
||||
int oid3;
|
||||
int vallen = 1;
|
||||
VmsRouteParam *pcrd;
|
||||
|
||||
pcrd = &ppsParam.routeParam;
|
||||
oid3 = oid[13];
|
||||
*vartype = 0x04;
|
||||
switch(oid3)
|
||||
{
|
||||
case 1:
|
||||
vallen = strlen((char *)pcrd->plmnServiceNumber);
|
||||
memcpy(pdata,pcrd->plmnServiceNumber,vallen);
|
||||
break;
|
||||
case 2:
|
||||
vallen = strlen((char *)pcrd->pstnServiceNumber);
|
||||
memcpy(pdata,pcrd->pstnServiceNumber,vallen);
|
||||
break;
|
||||
case 3:
|
||||
vallen = strlen((char *)pcrd->leaveMessageNumber);
|
||||
memcpy(pdata,pcrd->leaveMessageNumber,vallen);
|
||||
break;
|
||||
case 4:
|
||||
*vartype = INTEGER;
|
||||
pdata[0] = pcrd->routeMethodOption;
|
||||
break;
|
||||
case 5:
|
||||
*vartype = INTEGER;
|
||||
pdata[0] = pcrd->routeNumberOption;
|
||||
break;
|
||||
case 6:
|
||||
*vartype = INTEGER;
|
||||
pdata[0] = pcrd->isPostpaidAllowed;
|
||||
break;
|
||||
case 7:
|
||||
*vartype = INTEGER;
|
||||
vallen = 1;
|
||||
pdata[0] = pcrd->ring_back_service_key;
|
||||
break;
|
||||
}
|
||||
|
||||
return vallen;
|
||||
}
|
||||
|
||||
int IsCRDServiceNumber(char *number)
|
||||
{
|
||||
int retval=0;
|
||||
int len;
|
||||
VmsRouteParam *pcrd;
|
||||
|
||||
pcrd = &ppsParam.routeParam;
|
||||
|
||||
if(pcrd->routeMethodOption == ByWholeNumber)
|
||||
{
|
||||
if(strcmp((char *)pcrd->plmnServiceNumber,number)==0)
|
||||
retval = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pcrd->plmnServiceNumber[0] == 0) return 0;
|
||||
len = strlen((char *)pcrd->plmnServiceNumber);
|
||||
if(!strncasecmp(number, (char *)pcrd->plmnServiceNumber,len))
|
||||
retval = 1;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int IsPSTNMaitenance(char *number)
|
||||
{
|
||||
int retval=0;
|
||||
int len;
|
||||
VmsRouteParam *pcrd;
|
||||
|
||||
pcrd = &ppsParam.routeParam;
|
||||
|
||||
if(pcrd->routeMethodOption == ByWholeNumber)
|
||||
{
|
||||
if(strcmp((char *)pcrd->pstnServiceNumber,number)==0)
|
||||
retval = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pcrd->pstnServiceNumber[0] == 0) return 0;
|
||||
len = strlen((char *)pcrd->pstnServiceNumber);
|
||||
if(!strncasecmp(number, (char *)pcrd->pstnServiceNumber,len))
|
||||
retval = 1;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int IsVMSDeposit(char *number)
|
||||
{
|
||||
int retval=0;
|
||||
int len;
|
||||
VmsRouteParam *pcrd;
|
||||
|
||||
pcrd = &ppsParam.routeParam;
|
||||
|
||||
if(pcrd->routeMethodOption == ByWholeNumber)
|
||||
{
|
||||
if(strcmp((char *)pcrd->leaveMessageNumber,number)==0)
|
||||
retval = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pcrd->leaveMessageNumber[0] == 0) return 0;
|
||||
len = strlen((char *)pcrd->leaveMessageNumber);
|
||||
if(!strncasecmp(number, (char *)pcrd->leaveMessageNumber,len))
|
||||
retval = 1;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int GetCRDDestination(char *src_number, char *dst_number,u_char type)
|
||||
{
|
||||
int retval=0;
|
||||
int loop=0;
|
||||
VmsUserSegment *crd_ptr;
|
||||
|
||||
for(loop=0;loop<MaxVmsUserSegmentItem;loop++)
|
||||
{
|
||||
crd_ptr = &ppsParam.ppsTables.vmsUserSegment[loop];
|
||||
if(crd_ptr->existFlag == FALSE)
|
||||
continue;
|
||||
if(strcmp(src_number, (char *)crd_ptr->startMsisdn)>=0)
|
||||
if(strcmp(src_number, (char *)crd_ptr->endMsisdn)<=0)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case 0: /* PLMN maintenance */
|
||||
strcpy(dst_number, (char *)crd_ptr->vmsPLMNserviceNumber);
|
||||
break;
|
||||
case 1: /* PSTN maintenance */
|
||||
strcpy(dst_number, (char *)crd_ptr->vmsPSTNserviceNumber);
|
||||
break;
|
||||
case 2: /* deposit message */
|
||||
strcpy(dst_number, (char *)crd_ptr->leaveMessageNumber);
|
||||
break;
|
||||
}
|
||||
retval = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int IsPostpaidAllowed()
|
||||
{
|
||||
VmsRouteParam *pcrd;
|
||||
|
||||
pcrd = &ppsParam.routeParam;
|
||||
|
||||
return pcrd->isPostpaidAllowed;
|
||||
}
|
||||
|
||||
int CheckCRDRingBackSericeKey(int serviceKey)
|
||||
{
|
||||
VmsRouteParam *pcrd;
|
||||
|
||||
pcrd = &ppsParam.routeParam;
|
||||
|
||||
if(pcrd->ring_back_service_key<2)
|
||||
return 0;
|
||||
if(pcrd->ring_back_service_key == serviceKey)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,507 @@
|
||||
#include "../include/includes.h"
|
||||
#include "../include/ppsm.h"
|
||||
#include "../include/ramdata.h"
|
||||
#include "../include/ppsinf.h"
|
||||
#include "../include/message.h"
|
||||
#include "../include/iofunc.h"
|
||||
#include "../include/version.h"
|
||||
#include "../include/pps_public.h"
|
||||
#include "../include/cdrme.h"
|
||||
#include "../include/param.h"
|
||||
|
||||
#include "../include/plat_inc.h"
|
||||
|
||||
#include "../include/ppsMibTable.h"
|
||||
#include "../include/mfunc.h"
|
||||
|
||||
extern int logMsgFlag;
|
||||
extern PPSParamStruct ppsParam;
|
||||
extern struct timeval tvnow;
|
||||
extern _ram_data *ramshm_ptr;
|
||||
extern _state_machine *smshm_ptr;;
|
||||
extern _tariff_private *blf_shmp;
|
||||
|
||||
extern _prepaid_info *getPrepaidInfo(_account_info *account);
|
||||
|
||||
#define FREE_SMS_ACTIVE 0x01
|
||||
#define FREE_SMS_DEACTIVE 0xFE
|
||||
static int isFreeServiceActived(_prepaid_info *prepaidInfo)
|
||||
{
|
||||
if(prepaidInfo->freeSMSActiveDays > 0)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
static void setFreeServiceActived(_prepaid_info *prepaidInfo)
|
||||
{
|
||||
COSTable *cosTableItem;
|
||||
u_char cosID,activeDays;
|
||||
|
||||
cosID = prepaidInfo->cos_id;
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cosID];
|
||||
activeDays = cosTableItem->serviceControl[0].freeSMSActiveDays;
|
||||
|
||||
if(prepaidInfo->mo_expiration_date < tvnow.tv_sec + activeDays * 24 *3600)
|
||||
prepaidInfo->mo_expiration_date = tvnow.tv_sec + activeDays * 24 *3600;
|
||||
if(prepaidInfo->mt_expiration_date < tvnow.tv_sec + activeDays * 24 *3600)
|
||||
prepaidInfo->mt_expiration_date = tvnow.tv_sec + activeDays * 24 *3600;
|
||||
|
||||
prepaidInfo->freeSMSActiveDays = (activeDays <= 0?15:activeDays);
|
||||
|
||||
}
|
||||
|
||||
static void setFreeServiceDeactived(_prepaid_info *prepaidInfo)
|
||||
{
|
||||
prepaidInfo->freeSMSActiveDays = 0;
|
||||
}
|
||||
|
||||
|
||||
static int sendFreeServiceAlreadyActived(_state_data *shmp,_prepaid_info *prepaidInfo)
|
||||
{
|
||||
char msg[MAX_SMS_LEN*4] = {0};
|
||||
|
||||
strcpy(msg, (char *)getSmsSentenceNative(0,SMS_FREE_SERVICE_ACTIVE_ALREADY));
|
||||
if(prepaidInfo->freeSMSActiveDays != 255)
|
||||
sprintf(msg+strlen(msg),".%s %d.",getSmsSentenceNative(0,SMS_FREE_SERVICE_VALID_DAYS_LEFT),prepaidInfo->freeSMSActiveDays);
|
||||
|
||||
return smppSendMOSM((char *)shmp->caller_info.number, (char *)ppsParam.ppsTables.serviceNumber[FreeServicePosition].number
|
||||
, (u_char *)msg,strlen(msg),0);
|
||||
}
|
||||
|
||||
static int sendFreeServiceAlreadyDeactived(_state_data *shmp)
|
||||
{
|
||||
char msg[MAX_SMS_LEN*4] = {0};
|
||||
|
||||
strcpy(msg, (char *)getSmsSentenceNative(0,SMS_FREE_SERVICE_DEACTIVE_ALREADY));
|
||||
return smppSendMOSM((char *)shmp->caller_info.number, (char *)ppsParam.ppsTables.serviceNumber[FreeServicePosition].number
|
||||
, (u_char *)msg, strlen(msg), 0);
|
||||
}
|
||||
|
||||
static int sendFreeServiceActived(_state_data *shmp,_prepaid_info *prepaidInfo)
|
||||
{
|
||||
char msg[MAX_SMS_LEN*4] = {0};
|
||||
char dayTimeReadable[32]={0};
|
||||
|
||||
|
||||
ppsgetdaytime_readFormat(dayTimeReadable);
|
||||
strcpy(msg, (char *)getSmsSentenceNative(0,SMS_FREE_SERVICE_ACTIVED_NOTIFY));
|
||||
sprintf(msg+strlen(msg)," %s %s.", (char *)getSmsSentenceNative(0,SMS_ON),dayTimeReadable);
|
||||
if(prepaidInfo->freeSMSActiveDays != 255)
|
||||
sprintf(msg+strlen(msg),"%s %d.", (char *)getSmsSentenceNative(0,SMS_FREE_SERVICE_VALID_DAYS_LEFT),prepaidInfo->freeSMSActiveDays);
|
||||
return smppSendMOSM((char *)shmp->caller_info.number, (char *)ppsParam.ppsTables.serviceNumber[FreeServicePosition].number
|
||||
, (u_char *)msg, strlen(msg), 0);
|
||||
}
|
||||
|
||||
static int sendFreeServiceDeactived(u_char *destNumber)
|
||||
{
|
||||
char msg[MAX_SMS_LEN*4] = {0};
|
||||
char dayTimeReadable[32]={0};
|
||||
|
||||
|
||||
ppsgetdaytime_readFormat(dayTimeReadable);
|
||||
strcpy(msg, (char *)getSmsSentenceNative(0,SMS_FREE_SERVICE_DEACTIVED_NOTIFY));
|
||||
sprintf(msg+strlen(msg)," %s %s.", (char *)getSmsSentenceNative(0,SMS_ON),dayTimeReadable);
|
||||
return smppSendMOSM((char *)destNumber, (char *)ppsParam.ppsTables.serviceNumber[FreeServicePosition].number
|
||||
,(u_char *)msg,strlen(msg),0);
|
||||
}
|
||||
|
||||
static int sendFreeServiceExpired(u_char *destNumber)
|
||||
{
|
||||
char msg[MAX_SMS_LEN*4] = {0};
|
||||
char dayTimeReadable[32]={0};
|
||||
|
||||
ppsgetdaytime_readFormat(dayTimeReadable);
|
||||
strcpy(msg, (char *)getSmsSentenceNative(0,SMS_FREE_SERVICE_DEACTIVED_EXPIRED));
|
||||
sprintf(msg+strlen(msg)," %s %s.", (char *)getSmsSentenceNative(0,SMS_ON),dayTimeReadable);
|
||||
return smppSendMOSM((char *)destNumber, (char *)ppsParam.ppsTables.serviceNumber[FreeServicePosition].number
|
||||
, (u_char *)msg, strlen(msg), 0);
|
||||
}
|
||||
|
||||
static int sendFreeServiceInsufficientFee(u_char *destNumber)
|
||||
{
|
||||
char msg[MAX_SMS_LEN*4] = {0};
|
||||
//char dayTimeReadable[32]={0};
|
||||
|
||||
sprintf(msg, " %s.", (char *)getSmsSentenceNative(0,SMS_INSUFFICIENT_FEE));
|
||||
return smppSendMOSM((char *)destNumber, (char *)ppsParam.ppsTables.serviceNumber[FreeServicePosition].number
|
||||
, (u_char *)msg, strlen(msg), 0);
|
||||
}
|
||||
|
||||
static int sendFreeServiceMoExpired(u_char *destNumber)
|
||||
{
|
||||
char msg[MAX_SMS_LEN*4] = {0};
|
||||
//char dayTimeReadable[32]={0};
|
||||
|
||||
sprintf(msg," %s.", (char *)getSmsSentenceNative(0,SMS_EXPIRED_ACCOUNT));
|
||||
return smppSendMOSM((char *)destNumber, (char *)ppsParam.ppsTables.serviceNumber[FreeServicePosition].number
|
||||
, (u_char *)msg, strlen(msg), 0);
|
||||
}
|
||||
|
||||
static int sendFreeServiceErroCode(_state_data *shmp)
|
||||
{
|
||||
char msg[MAX_SMS_LEN*4] = {0};
|
||||
|
||||
sprintf(msg, " %s.", (char *)getSmsSentenceNative(0,SMS_FREE_SMS_NOTIFICATION));
|
||||
|
||||
return smppSendMOSM((char *)shmp->caller_info.number, (char *)ppsParam.ppsTables.serviceNumber[FreeServicePosition].number
|
||||
, (u_char *)msg, strlen(msg), 0);
|
||||
//return ;
|
||||
}
|
||||
|
||||
static void enableUserRentFlag(_prepaid_info *prepaidInfo)
|
||||
{
|
||||
COSTable *cosTableItem;
|
||||
u8 rentType;
|
||||
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[prepaidInfo->cos_id];
|
||||
|
||||
rentType = cosTableItem->serviceControl[0].freeSMSRentType;
|
||||
if(rentType <= 0)
|
||||
return;
|
||||
rentType = (rentType - 1) & 0x07;
|
||||
prepaidInfo->rent_type |= (0x01 << rentType);
|
||||
}
|
||||
|
||||
static void disableUserRentFlag(_prepaid_info *prepaidInfo)
|
||||
{
|
||||
COSTable *cosTableItem;
|
||||
u8 rentType,mask = 0xFE;
|
||||
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[prepaidInfo->cos_id];
|
||||
rentType = cosTableItem->serviceControl[0].freeSMSRentType;
|
||||
if(rentType <= 0)
|
||||
return;
|
||||
rentType = (rentType - 1) & 0x07;
|
||||
mask = (mask >> (8-rentType)) | (mask << rentType);
|
||||
prepaidInfo->rent_type &= mask;
|
||||
}
|
||||
|
||||
static int isFreeServiceDaysDeductable(_prepaid_info *prepaidInfo)
|
||||
{
|
||||
if(prepaidInfo->freeSMSActiveDays == 0xFF)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void freeServiceDaysDeduct(u_short head,u_short tail)
|
||||
{
|
||||
u8 len;//cosID=0,
|
||||
//COSTable *cosTableItem;
|
||||
_prepaid_data *shmp=&ramshm_ptr->prepaid_data;
|
||||
_prepaid_info *userData;
|
||||
u_char destNumber[32]={0};
|
||||
|
||||
userData = &shmp->prepaid_info[head][tail];
|
||||
//cosID = userData->cos_id;
|
||||
if(isFreeServiceActived(userData)== TRUE && isFreeServiceDaysDeductable(userData) == TRUE)
|
||||
{
|
||||
//cosTableItem = &ppsParam.ppsTables.cosTable[cosID];
|
||||
userData->freeSMSActiveDays--;
|
||||
if(userData->freeSMSActiveDays <= 0)
|
||||
{
|
||||
disableUserRentFlag(userData);
|
||||
len = userData->msisdn[MAX_MSISDN_BLEN-1];
|
||||
BcdToAscii((char *)destNumber,userData->msisdn,(MAX_MSISDN_BLEN-1)*2);
|
||||
destNumber[len] = 0;
|
||||
sendFreeServiceExpired(destNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int GetCosIDByUserData(u_short head,u_short tail)
|
||||
{
|
||||
u8 cosID=0;
|
||||
COSTable *cosTableItem;
|
||||
_prepaid_data *shmp=&ramshm_ptr->prepaid_data;
|
||||
_prepaid_info *userData;
|
||||
|
||||
userData = &shmp->prepaid_info[head][tail];
|
||||
cosID = userData->cos_id;
|
||||
if(isFreeServiceActived(userData)== TRUE)
|
||||
{
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cosID];
|
||||
cosID = cosTableItem->serviceControl[0].relatedCosID;
|
||||
}
|
||||
return cosID%MaxCosTableItem;
|
||||
}
|
||||
|
||||
int GetCosIDByAccount(_account_info *ptr)
|
||||
{
|
||||
//_prepaid_data *shmp=&ramshm_ptr->prepaid_data;
|
||||
u8 cosID=0;
|
||||
|
||||
PutLogFunID("GetCosIDByAccount");
|
||||
|
||||
if (ptr->head < MSISDN_HEAD_NUM && ptr->tail < UNIT_STORE_ACCOUNT)
|
||||
{
|
||||
cosID = GetCosIDByUserData(ptr->head,ptr->tail);
|
||||
}
|
||||
return cosID%MaxCosTableItem;
|
||||
}
|
||||
|
||||
int GetLocalCosID(_account_info *ptr)
|
||||
{
|
||||
u8 cosID=0;
|
||||
//COSTable *cosTableItem;
|
||||
_prepaid_data *shmp=&ramshm_ptr->prepaid_data;
|
||||
_prepaid_info *userData;
|
||||
|
||||
userData = &shmp->prepaid_info[ptr->head][ptr->tail];
|
||||
cosID = userData->cos_id%MaxCosTableItem;
|
||||
return cosID;
|
||||
}
|
||||
|
||||
int GetMOTariffIDWithFreeServiceControl(u_short head,u_short tail)
|
||||
{
|
||||
//_prepaid_data *shmp=&ramshm_ptr->prepaid_data;
|
||||
u8 cosID=0;
|
||||
COSTable *cosTableItem;
|
||||
|
||||
PutLogFunID("GetMOTariffDWithFreeServiceControl");
|
||||
|
||||
cosID = GetCosIDByUserData(head,tail);
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cosID];
|
||||
|
||||
return cosTableItem->tariff[0].moTariffID%MAX_ZONE_NUM;
|
||||
}
|
||||
|
||||
|
||||
int GetMTTariffIDWithFreeServiceControl(_account_info *ptr)
|
||||
{
|
||||
//_prepaid_data *shmp=&ramshm_ptr->prepaid_data;
|
||||
u8 cosID=0;
|
||||
COSTable *cosTableItem;
|
||||
|
||||
PutLogFunID("GetMOTariffDWithFreeServiceControl");
|
||||
|
||||
cosID = GetCosIDByAccount(ptr);
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cosID];
|
||||
|
||||
return cosTableItem->tariff[0].mtTariffID%MAX_ZONE_NUM;
|
||||
}
|
||||
|
||||
void SendManualOperationCDR(_account_info *caller_info,_account_info *called_info,int charge)
|
||||
{
|
||||
_tocdr_report pcdr;
|
||||
char buf[BUFSIZE]={""};
|
||||
int balance,len;
|
||||
int head, tail;
|
||||
|
||||
PutLogFunID("SendManualOperationCDR");
|
||||
|
||||
head = caller_info->head;
|
||||
tail = caller_info->tail;
|
||||
|
||||
memset(&pcdr, 0, sizeof(_tocdr_report));
|
||||
if (charge >= 0)
|
||||
{
|
||||
pcdr.type[0] = CT_ASSISTED_UP;
|
||||
pcdr.type[1] = CT_ASSISTED_UP>>8;
|
||||
}
|
||||
else
|
||||
{
|
||||
pcdr.type[0] = CT_ASSISTED_DOWN;
|
||||
pcdr.type[1] = CT_ASSISTED_DOWN>>8;
|
||||
}
|
||||
|
||||
AsciiToBcd(pcdr.seizuretime, ppsgetdaytime(buf), 14);
|
||||
AsciiToBcd(pcdr.answertime, ppsgetdaytime(buf), 14);
|
||||
AsciiToBcd(pcdr.releasetime, ppsgetdaytime(buf), 14);
|
||||
pcdr.duration[0] = 0;
|
||||
charge = abs(charge);
|
||||
memcpy(pcdr.charge,&charge,4);
|
||||
balance = (int) GetAccountBalance(head, tail);
|
||||
memcpy(pcdr.balance,&balance,4);
|
||||
|
||||
GetAccountMsisdn(head,tail,&pcdr.msisdn[1]);
|
||||
ByteRev(pcdr.msisdn,9,0);
|
||||
|
||||
pcdr.msisdn[0]=0x91;
|
||||
memcpy(pcdr.caller,pcdr.msisdn,9);
|
||||
buf[0] = 0;
|
||||
|
||||
pcdr.called[0] = 0x91;
|
||||
len = strlen((char *)called_info->number)%20;
|
||||
ppsAsciiToBcdR(&pcdr.called[1], (char *)called_info->number,(len+1)/2*2);
|
||||
if(len %2)
|
||||
{
|
||||
pcdr.called[(len+1)/2] |= 0xF0;
|
||||
}
|
||||
if(len<21)
|
||||
{
|
||||
pcdr.called[(len+1)/2+1] = 0xFF;
|
||||
}
|
||||
|
||||
sprintf(buf,"FFFFFFFFFFFFFFFFFF");
|
||||
AsciiToBcd(pcdr.imsi,buf,16);
|
||||
|
||||
pcdr.tcos[0] = NORMAL_CLEARING%256;
|
||||
|
||||
CDRStatistics(&pcdr,charge, 0);
|
||||
StoreCDR(&pcdr);
|
||||
pps_real_update_user_file(head, tail);
|
||||
|
||||
#if DEBUG
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02))
|
||||
DebugMsg(debugmib.display.asciiOut, "SendManualOperationCDR");
|
||||
#endif
|
||||
}
|
||||
|
||||
static int activteCharge(_state_data *shmp)
|
||||
{
|
||||
int head,tail;
|
||||
int amount,tariff_id=0;
|
||||
_prepaid_info *ptr;
|
||||
|
||||
PutLogFunID("activteCharge");
|
||||
|
||||
head = shmp->caller_info.head;
|
||||
tail = shmp->caller_info.tail;
|
||||
|
||||
if(head>=MSISDN_HEAD_NUM)
|
||||
return 0;
|
||||
ptr = &ramshm_ptr->prepaid_data.prepaid_info[head][tail];
|
||||
if(isFreeServiceActived(ptr) == TRUE)
|
||||
return 0;
|
||||
if(GetExpiration(&shmp->caller_info) <= tvnow.tv_sec)
|
||||
return -1;
|
||||
tariff_id = GetAccountZoneID(head,tail);
|
||||
if(tariff_id>=MAX_ZONE_NUM || tariff_id<0)
|
||||
tariff_id = 0;
|
||||
amount = blf_shmp->comm_tariff[tariff_id].activeFreeSMSCharegeAmount;
|
||||
if((ptr->balance + ptr->overdraft) - amount < 0)
|
||||
return -2;
|
||||
enableUserRentFlag(ptr);
|
||||
|
||||
ptr->balance -= amount;
|
||||
SendManualOperationCDR(&shmp->caller_info,&shmp->called_info,-amount);
|
||||
return amount;
|
||||
}
|
||||
|
||||
static int deactivteCharge(_state_data *shmp)
|
||||
{
|
||||
int head,tail;
|
||||
int amount,tariff_id=0;
|
||||
_prepaid_info *ptr;
|
||||
|
||||
PutLogFunID("deactivteCharge");
|
||||
|
||||
head = shmp->caller_info.head;
|
||||
tail = shmp->caller_info.tail;
|
||||
|
||||
if(head>=MSISDN_HEAD_NUM)
|
||||
return 0;
|
||||
ptr = &ramshm_ptr->prepaid_data.prepaid_info[head][tail];
|
||||
if(isFreeServiceActived(ptr) == FALSE)
|
||||
return 0;
|
||||
if(GetExpiration(&shmp->caller_info) <= tvnow.tv_sec)
|
||||
return -1;
|
||||
tariff_id = GetAccountZoneID(head,tail);
|
||||
if(tariff_id>=MAX_ZONE_NUM || tariff_id<0)
|
||||
tariff_id = 0;
|
||||
amount = blf_shmp->comm_tariff[tariff_id].deactiveFreeSMSCharegeAmount;
|
||||
if((ptr->balance + ptr->overdraft) - amount < 0)
|
||||
return -2;
|
||||
disableUserRentFlag(ptr);
|
||||
|
||||
|
||||
ptr->balance -= amount;
|
||||
SendManualOperationCDR(&shmp->caller_info,&shmp->called_info,-amount);
|
||||
return amount;
|
||||
}
|
||||
|
||||
|
||||
int switchServiceProc(u_short portid,u_char *shortMsg)
|
||||
{
|
||||
_prepaid_info *prepaidInfo;
|
||||
u8 len;
|
||||
int charge;
|
||||
u_char *sms;
|
||||
_state_data *shmp;
|
||||
|
||||
PutLogFunID("switchServiceProc");
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
|
||||
if((prepaidInfo = getPrepaidInfo(&shmp->caller_info)) == NULL)
|
||||
return -1;
|
||||
sms = getSmsSentenceNative(0,SMS_FREE_SERVICE_ACTIVE);
|
||||
len = strlen((char *)sms);
|
||||
if(!strncasecmp((char *)shortMsg, (char *)sms, len))
|
||||
{
|
||||
if(isFreeServiceActived(prepaidInfo) == FALSE)
|
||||
{
|
||||
charge = activteCharge(shmp);
|
||||
if(charge < 0)
|
||||
{ switch(charge)
|
||||
{
|
||||
case -1:
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]switch service,activate fail ,insufficient fee",portid);
|
||||
sendFreeServiceMoExpired(shmp->caller_info.number);
|
||||
break;
|
||||
case -2:
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]switch service,activate fail ,MO expired",portid);
|
||||
sendFreeServiceInsufficientFee(shmp->caller_info.number);
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
setFreeServiceActived(prepaidInfo);
|
||||
sendFreeServiceActived(shmp,prepaidInfo);
|
||||
SendAccountRealSync_2(&shmp->caller_info,-charge,0.0,OMC_OCODE_EDIT);
|
||||
}
|
||||
else
|
||||
sendFreeServiceAlreadyActived(shmp,prepaidInfo);
|
||||
return 1;
|
||||
}
|
||||
|
||||
sms = getSmsSentenceNative(0,SMS_FREE_SERVICE_DEACTIVE);
|
||||
len = strlen((char *)sms);
|
||||
if(!strncasecmp((char *)shortMsg, (char *)sms, len))
|
||||
{
|
||||
if(isFreeServiceActived(prepaidInfo) == TRUE)
|
||||
{
|
||||
charge = deactivteCharge(shmp);
|
||||
if(charge < 0)
|
||||
{
|
||||
switch(charge)
|
||||
{
|
||||
case -1:
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]switch service,deactivate fail ,insufficient fee",portid);
|
||||
sendFreeServiceMoExpired(shmp->caller_info.number);
|
||||
break;
|
||||
case -2:
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]switch service,deactivate fail ,MO expired",portid);
|
||||
sendFreeServiceInsufficientFee(shmp->caller_info.number);
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
setFreeServiceDeactived(prepaidInfo);
|
||||
sendFreeServiceDeactived(shmp->caller_info.number);
|
||||
SendAccountRealSync_2(&shmp->caller_info,-charge,0.0,OMC_OCODE_EDIT);
|
||||
}
|
||||
else
|
||||
sendFreeServiceAlreadyDeactived(shmp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
sms = getSmsSentenceNative(0,SMS_FREE_SERVICE_ENQUIRY);
|
||||
len = strlen((char *)sms);
|
||||
if(!strncasecmp((char *)shortMsg, (char *)sms, len))
|
||||
{
|
||||
if(isFreeServiceActived(prepaidInfo))
|
||||
sendFreeServiceAlreadyActived(shmp,prepaidInfo);
|
||||
else
|
||||
sendFreeServiceAlreadyDeactived(shmp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
sendFreeServiceErroCode(shmp);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
ipcrm='To delete ipcrm shm'
|
||||
|
||||
#program name
|
||||
if [ `whoami` != "root" ] ; then
|
||||
echo "Permission denied!"
|
||||
exit
|
||||
fi
|
||||
|
||||
ipcsm=`ipcs -m`
|
||||
echo "$ipcsm"
|
||||
|
||||
ipcsm=`ipcs -m|grep '0x'|awk '{print $2}'`
|
||||
for FILE in $ipcsm; do
|
||||
ipcrm shm $FILE
|
||||
done
|
||||
|
||||
ipcsm=`ipcs -s`
|
||||
echo "$ipcsm"
|
||||
|
||||
ipcsm=`ipcs -s|grep '0x'|awk '{print $2}'`
|
||||
for FILE in $ipcsm; do
|
||||
ipcrm sem $FILE
|
||||
done
|
||||
|
||||
ipcsm=`ipcs -q`
|
||||
echo "$ipcsm"
|
||||
|
||||
ipcsm=`ipcs -q|grep '0x'|awk '{print $2}'`
|
||||
for FILE in $ipcsm; do
|
||||
ipcrm msg $FILE
|
||||
done
|
||||
@@ -0,0 +1,189 @@
|
||||
#include <glib.h>
|
||||
|
||||
#include "../include/includes.h"
|
||||
#include "../include/ramdata.h"
|
||||
#include "../include/ppsm.h"
|
||||
#include "../include/param.h"
|
||||
#include "../include/tariff.h"
|
||||
|
||||
|
||||
|
||||
typedef struct ue_record
|
||||
{
|
||||
char used_flag;
|
||||
int index;
|
||||
int tb_index;
|
||||
long long msisdn;
|
||||
}_ue_record;
|
||||
|
||||
typedef struct ocs_ue_index_table
|
||||
{
|
||||
int head_index;
|
||||
int used_record;
|
||||
int record_num;
|
||||
_ue_record record[MAX_SUBS_RECORD];
|
||||
}_ocs_ue_index_table;
|
||||
|
||||
|
||||
|
||||
static _ocs_ue_index_table ue_table;
|
||||
|
||||
static GHashTable *htb_ue = NULL;
|
||||
|
||||
/* ----------------------------------------------*/
|
||||
int ocs_init_hash_table()
|
||||
{
|
||||
|
||||
if(htb_ue != NULL)
|
||||
g_hash_table_destroy(htb_ue);
|
||||
|
||||
htb_ue = g_hash_table_new(g_direct_hash,g_direct_equal);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int hash_add_ue_entity(_ue_record *ue_ptr)
|
||||
{
|
||||
if(ue_ptr != NULL)
|
||||
g_hash_table_insert(htb_ue, GINT_TO_POINTER(ue_ptr->msisdn), ue_ptr);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ocs_hash_clean_ue_entity(_ue_record *ue_ptr)
|
||||
{
|
||||
if(ue_ptr != NULL)
|
||||
g_hash_table_remove(htb_ue, GINT_TO_POINTER(ue_ptr->msisdn));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned int ocs_get_ue_index(long long msisdn)
|
||||
{
|
||||
unsigned int index = INVALID_UE_INDEX;
|
||||
_ue_record *ptr=NULL;
|
||||
|
||||
ptr = (_ue_record *)g_hash_table_lookup(htb_ue, GINT_TO_POINTER(msisdn));
|
||||
if(ptr != NULL)
|
||||
index = ptr->index;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
unsigned int ocs_get_ue_tb_index(long long msisdn)
|
||||
{
|
||||
unsigned int index = INVALID_UE_INDEX;
|
||||
_ue_record *ptr=NULL;
|
||||
|
||||
ptr = (_ue_record *)g_hash_table_lookup(htb_ue, GINT_TO_POINTER(msisdn));
|
||||
if(ptr != NULL)
|
||||
index = ptr->tb_index;
|
||||
|
||||
return index;
|
||||
}
|
||||
|
||||
_ue_record *ocs_get_ue_record(long long msisdn)
|
||||
{
|
||||
unsigned int index = ocs_get_ue_index(msisdn);
|
||||
_ue_record *ue_ptr=NULL;
|
||||
|
||||
if(index != INVALID_UE_INDEX)
|
||||
{
|
||||
ue_ptr = &ue_table.record[index];
|
||||
}
|
||||
|
||||
return ue_ptr;
|
||||
}
|
||||
|
||||
int ocs_check_ue_record(long long msisdn)
|
||||
{
|
||||
unsigned int index = ocs_get_ue_index(msisdn);
|
||||
|
||||
if(index != INVALID_UE_INDEX)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
long long ocs_get_ue_by_index(int store_index)
|
||||
{
|
||||
long long msisdn=0;
|
||||
_ue_record *ue_ptr;
|
||||
|
||||
if(store_index != INVALID_UE_INDEX)
|
||||
{
|
||||
ue_ptr = &ue_table.record[store_index];
|
||||
msisdn = ue_ptr->msisdn;
|
||||
}
|
||||
|
||||
|
||||
return msisdn;
|
||||
}
|
||||
|
||||
_ue_record *ocs_assign_ue_index(long long msisdn, int store_index)
|
||||
{
|
||||
register int loop;
|
||||
int index;
|
||||
_ue_record *ue_ptr;
|
||||
|
||||
for(loop = 0; loop < MAX_SUBS_RECORD; loop++)
|
||||
{
|
||||
//index = ue_table.head_index++;
|
||||
index = loop;
|
||||
ue_table.head_index %= MAX_SUBS_RECORD;
|
||||
if(ue_table.record[index].used_flag == 0)
|
||||
{
|
||||
ue_table.record_num ++;
|
||||
|
||||
ue_ptr = &ue_table.record[index];
|
||||
ue_ptr->used_flag = 1;
|
||||
ue_ptr->index = store_index;
|
||||
ue_ptr->msisdn = msisdn;
|
||||
ue_ptr->tb_index = loop;
|
||||
return ue_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ocs_delete_ue_record(long long msisdn)
|
||||
{
|
||||
unsigned int tb_index = ocs_get_ue_tb_index(msisdn);
|
||||
|
||||
if(tb_index != INVALID_UE_INDEX)
|
||||
{
|
||||
ue_table.record_num --;
|
||||
ocs_hash_clean_ue_entity(&ue_table.record[tb_index]);
|
||||
memset(&ue_table.record[tb_index], 0x00, sizeof(_ue_record));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int ocs_add_ue_record(long long msisdn, int store_index)
|
||||
{
|
||||
unsigned int index = ocs_get_ue_index(msisdn);
|
||||
_ue_record *ue_ptr = NULL;
|
||||
|
||||
if(index != INVALID_UE_INDEX)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
ue_ptr = ocs_assign_ue_index(msisdn, store_index);
|
||||
if(ue_ptr == NULL)
|
||||
return 0;
|
||||
hash_add_ue_entity(ue_ptr);
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
/* ----------------------------------------------*/
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
**
|
||||
** function.c
|
||||
** Created at 2000-05-29
|
||||
** Functions for data conversion, tools.
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
|
||||
/*
|
||||
** Fill string 'c' into last area of 'str'.
|
||||
*/
|
||||
|
||||
/* duplicate with public module 2006-09-25*/
|
||||
/*
|
||||
void
|
||||
StringCat(char *str, char *c, int slen)
|
||||
{
|
||||
if (strlen(str) >= slen) return;
|
||||
while (strlen(str) < slen)
|
||||
strcat(str, c);
|
||||
str[slen] = 0;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
** Cut string while match character c.
|
||||
*/
|
||||
/*
|
||||
void
|
||||
StringCut(char *str, int c)
|
||||
{
|
||||
if (toupper(*str) == toupper(c)) *str=0;
|
||||
while (str && *str++)
|
||||
if (toupper(*str) == toupper(c)) {
|
||||
*str = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
void Bstr2Hstr(char *cptr)
|
||||
{
|
||||
char s[12] = "";
|
||||
unsigned int i, j = 0;
|
||||
|
||||
while (cptr && *cptr && strchr("01", *cptr)) {
|
||||
i = *cptr++ - '0';
|
||||
j <<= 1;
|
||||
j |= (i & 0x01);
|
||||
}
|
||||
sprintf(s, "%x", j);
|
||||
cptr = (char *) s;
|
||||
}
|
||||
|
||||
void bitstring(char *str, long byze, int biz, int strwid)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
j = strwid - (biz + (biz >> 2)- (biz % 4 ? 0 : 1));
|
||||
for (i = 0; i < j; i++)
|
||||
*str++ = ' ';
|
||||
while (--biz >= 0) {
|
||||
*str++ = ((byze >> biz) & 1) + '0';
|
||||
//
|
||||
// if (!(biz % 4) && biz)
|
||||
// *str++ = ' ';
|
||||
//
|
||||
}
|
||||
*str = '\0';
|
||||
}
|
||||
/*
|
||||
** Binary string convert to int.
|
||||
*/
|
||||
|
||||
unsigned int Bstr2Int(char *cptr)
|
||||
{
|
||||
unsigned int i, j = 0;
|
||||
|
||||
while (cptr && *cptr && strchr("01", *cptr)) {
|
||||
i = *cptr++ - '0';
|
||||
j <<= 1;
|
||||
j |= (i & 0x01);
|
||||
}
|
||||
return(j);
|
||||
}
|
||||
|
||||
/*
|
||||
** Hex string convert to int.
|
||||
*/
|
||||
|
||||
unsigned int Hstr2Int(char *cptr)
|
||||
{
|
||||
unsigned int i, j = 0;
|
||||
|
||||
while (cptr && *cptr && isxdigit(*cptr)) {
|
||||
i = *cptr++ - '0';
|
||||
if (9 < i)
|
||||
i -= 7;
|
||||
j <<= 4;
|
||||
j |= (i & 0x0f);
|
||||
}
|
||||
return(j);
|
||||
}
|
||||
|
||||
/* Convert data from ASCII form to left-aligned compact BCD form. */
|
||||
/*
|
||||
void AsciiToBcd (BYTE *bcd_buf, const char *ascii_buf, int len)
|
||||
{
|
||||
int i;
|
||||
char ch;
|
||||
|
||||
for (i=0; i<len; i++)
|
||||
{
|
||||
ch = ascii_buf[i];
|
||||
if (ch>='a') ch -= 'a' - 10;
|
||||
else if (ch>='A') ch -= 'A' - 10;
|
||||
else ch -= '0';
|
||||
if (i & 1) *(bcd_buf++) |= ch & 0x0f;
|
||||
else *bcd_buf = ch << 4;
|
||||
}
|
||||
}
|
||||
*/
|
||||
/* Convert data from left-aligned compact BCD form to ASCII form. */
|
||||
/*
|
||||
void BcdToAscii (char *ascii_buf, const BYTE *bcd_buf, int len)
|
||||
{
|
||||
int i;
|
||||
char ch;
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
if (i & 1) ch = *(bcd_buf++) & 0x0f;
|
||||
else ch = *bcd_buf >> 4;
|
||||
ascii_buf[i] = ch + ((ch > 9)? 'A'-10 : '0');
|
||||
}
|
||||
ascii_buf[i] = '\0';
|
||||
}
|
||||
*/
|
||||
/* Convert data from ASCII form to right-aligned compact BCD form. */
|
||||
/*
|
||||
void AsciiToRbcd (BYTE *bcd_buf, const char *ascii_buf, int len)
|
||||
{
|
||||
int i;
|
||||
char ch;
|
||||
|
||||
if (len > 0) memset(bcd_buf ,0,len/2);
|
||||
for (i=0; i<len; i++) {
|
||||
ch = ascii_buf[i];
|
||||
if (ch>='a') ch -= 'a' - 10;
|
||||
else if (ch>='A') ch -= 'A' - 10;
|
||||
else ch -= '0';
|
||||
if ((len - i) & 1) *(bcd_buf++) |= ch & 0x0f;
|
||||
else *bcd_buf = ch << 4;
|
||||
}
|
||||
}
|
||||
*/
|
||||
/* Convert data from right-aligned compact BCD form to ASCII form. */
|
||||
|
||||
void RbcdToAscii (char *ascii_buf, const BYTE *bcd_buf, int len)
|
||||
{
|
||||
int i;
|
||||
char ch;
|
||||
|
||||
for (i=0; i<len; i++) {
|
||||
if ((len - i) & 1) ch = *(bcd_buf++) & 0x0f;
|
||||
else ch = *bcd_buf >> 4;
|
||||
ascii_buf[i] = ch + ((ch > 9)? 'A'-10 : '0');
|
||||
}
|
||||
ascii_buf[i] = '\0';
|
||||
}
|
||||
|
||||
/* Convert number to compact BCD, the number must in the range from 0 to 99. */
|
||||
|
||||
BYTE IntToBcd (int n)
|
||||
{
|
||||
return ((n / 10) << 4) | (n % 10);
|
||||
}
|
||||
|
||||
/* Convert number from compact BCD. */
|
||||
|
||||
int BcdToInt (BYTE n)
|
||||
{
|
||||
return (n >> 4) * 10 + (n & 0x0f);
|
||||
}
|
||||
|
||||
/* Copy charaters, then append a null character to array pointed by dst. */
|
||||
|
||||
void CopyToString (char *dst, const char *src, int len)
|
||||
{
|
||||
if (len) memcpy(dst, src, len);
|
||||
dst[len] = '\0';
|
||||
}
|
||||
|
||||
/* duplicate with public module 2006-09-25*/
|
||||
/*
|
||||
void gettime(time_buf)
|
||||
char *time_buf;
|
||||
{
|
||||
struct tm *t,tt;
|
||||
long curr_time;
|
||||
|
||||
t=&tt;
|
||||
curr_time=time((long *)0);
|
||||
t=localtime(&curr_time);
|
||||
sprintf(time_buf,"%02d:%02d:%02d",t->tm_hour,t->tm_min,t->tm_sec);
|
||||
time_buf[8]=0;
|
||||
}
|
||||
*/
|
||||
|
||||
const char * getdaytime(char *daytime_buf)
|
||||
{
|
||||
struct tm *t,tt;
|
||||
long curr_time;
|
||||
|
||||
t=&tt;
|
||||
curr_time=time((long *)0);
|
||||
t=localtime(&curr_time);
|
||||
sprintf(daytime_buf,"%04d%02d%02d%02d%02d%02d",
|
||||
t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour,
|
||||
t->tm_min, t->tm_sec);
|
||||
daytime_buf[14] = 0;
|
||||
return daytime_buf;
|
||||
}
|
||||
|
||||
+12964
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,271 @@
|
||||
#include "../include/includes.h"
|
||||
#include "../include/ppsm.h"
|
||||
#include "../include/ramdata.h"
|
||||
#include "../include/ppsinf.h"
|
||||
#include "../include/message.h"
|
||||
#include "../include/iofunc.h"
|
||||
#include "../include/version.h"
|
||||
#include "../include/pps_public.h"
|
||||
#include "../include/cdrme.h"
|
||||
|
||||
#include "../include/plat_inc.h"
|
||||
#include "../../../../plat/scf/src/include/scfpub.h"
|
||||
/*------------------------------------------------*/
|
||||
static struct termio prev_termio;
|
||||
static int timer100=0;
|
||||
extern int subSystemID;
|
||||
|
||||
/*------------------------------------------------*/
|
||||
/*------------------------------------------------*/
|
||||
extern int smpp_timer();
|
||||
extern int smppEncodeSM();
|
||||
extern int smppDecodeSM();
|
||||
extern int pps_read_sysparam();
|
||||
/*------------------------------------------------*/
|
||||
|
||||
|
||||
static void
|
||||
platInit()
|
||||
{
|
||||
debug_init();
|
||||
mtp_shm_init();
|
||||
iptrMainInit();
|
||||
snmp_init(4957);
|
||||
sccp_init();
|
||||
|
||||
tcap_init(512);
|
||||
xap_init(512);
|
||||
scsm_init();
|
||||
}
|
||||
|
||||
void
|
||||
ppsModuleProc()
|
||||
{
|
||||
//struct timeval tmstart,tmend;
|
||||
|
||||
iptrans_timer();
|
||||
snmp_timer();
|
||||
heartbeat_timer();
|
||||
debug_rt();
|
||||
mtp3_proc();
|
||||
sccp_timer();
|
||||
smpp_timer();
|
||||
tcap_fsm();
|
||||
xap_fsm();
|
||||
|
||||
|
||||
scsm();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SysGuard(int sig)
|
||||
{
|
||||
struct timeval tm;
|
||||
char fname[]={"../log/logout.txt"};
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen(fname,"w");
|
||||
if(fp != NULL)
|
||||
{
|
||||
gettimeofday(&tm,NULL);
|
||||
fprintf(fp,"====================================\n");
|
||||
fprintf(fp,"pps restart for segementation fault!\n");
|
||||
fprintf(fp,"log time : %s\n",ctime(&tm.tv_sec));
|
||||
fclose(fp);
|
||||
}
|
||||
fprintf(stderr,"Exception met, exit!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static void
|
||||
Terminate(int sig)
|
||||
{
|
||||
int retval=0,loop=0;
|
||||
char tm_str[30];
|
||||
time_t tn;
|
||||
|
||||
|
||||
tn = time(NULL);
|
||||
ioctl(0, TCGETA, prev_termio);
|
||||
retval = shmdt((char *) 0);
|
||||
printf("Service down at %s\n", GetAsciiTime(tm_str));
|
||||
|
||||
pps_exit(1);
|
||||
loop = 0;
|
||||
|
||||
while(loop<15)
|
||||
{
|
||||
loop++;
|
||||
ppsModuleProc();
|
||||
pps_proc();
|
||||
usleep(10);
|
||||
}
|
||||
|
||||
exit(sig);
|
||||
}
|
||||
|
||||
void
|
||||
FaultSignalProc(int sig)
|
||||
{
|
||||
system("/usr/local/pps/bin/ppsd restart");
|
||||
}
|
||||
|
||||
void
|
||||
SetFSMTimer()
|
||||
{
|
||||
struct itimerval *ptv, tv;
|
||||
|
||||
ptv = (struct itimerval *) &tv;
|
||||
ptv->it_interval.tv_sec = SMMP_IT_INTERVAL_SEC;
|
||||
ptv->it_interval.tv_usec = SMMP_IT_INTERVAL_USEC/2;
|
||||
ptv->it_value. tv_sec = SMMP_IT_VALUE_SEC;
|
||||
ptv->it_value.tv_usec = SMMP_IT_VALUE_USEC/2;
|
||||
setitimer(ITIMER_REAL, ptv, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
PrepaidAction(int sig)
|
||||
{
|
||||
|
||||
timer100++;
|
||||
ppsModuleProc();
|
||||
}
|
||||
|
||||
|
||||
void SetTerminate()
|
||||
{
|
||||
struct termio ptermio;
|
||||
ioctl(0,TCGETA, &ptermio);
|
||||
ptermio.c_cc[VINTR]='\x03';
|
||||
ioctl(0,TCSETA, &ptermio);
|
||||
signal(SIGINT , Terminate);
|
||||
signal(SIGTERM, Terminate);
|
||||
}
|
||||
|
||||
void
|
||||
SigactionPrepaid()
|
||||
{
|
||||
struct sigaction action;
|
||||
|
||||
action.sa_handler = PrepaidAction;
|
||||
action.sa_flags = SA_RESTART;
|
||||
sigemptyset(&action.sa_mask);
|
||||
sigaction(SIGALRM, &action, NULL);
|
||||
/*
|
||||
actsegv.sa_handler = SysGuard;
|
||||
actsegv.sa_flags = SA_RESTART;
|
||||
sigemptyset(&actsegv.sa_mask);
|
||||
sigaction(SIGSEGV,&actsegv,NULL);
|
||||
*/
|
||||
}
|
||||
|
||||
void shortMessageTest()
|
||||
{
|
||||
char sm_in[32]="000001000000",sm_out[32]="",sm_res[32]="";
|
||||
smppEncodeSM(sm_in,sm_out,12);
|
||||
smppDecodeSM(sm_out,sm_res,11*8/7);
|
||||
printf("result: %s\n",sm_res);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int retval=0;
|
||||
int err_flag = FALSE;
|
||||
int main_state=0;
|
||||
struct timeval tmstart,tmend;
|
||||
u_long peerip,localip=0x018812ac;
|
||||
//u_char buf[128];
|
||||
|
||||
while ((retval = getopt(argc, argv, "dvcf:I:")) != -1)
|
||||
switch (retval) {
|
||||
case 'd':
|
||||
DaemonInit("ppsm", LOG_USER);
|
||||
break;
|
||||
case '?':
|
||||
err_flag = TRUE;
|
||||
break;
|
||||
}
|
||||
if (err_flag) {
|
||||
log_msg("Usage: %s [-d] [-c] [-f RAM file name] [-v]\n", "ppsm");
|
||||
log_msg(" -d with daemon mode");
|
||||
log_msg(" -c Cancel RAM data initialization");
|
||||
log_msg(" -f[RAM file name] Load RAM file");
|
||||
log_msg(" -v print version information");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("sizeof _tariff_private: %d\n",sizeof(_tariff_private));
|
||||
pps_read_sysparam(&subSystemID,&localip,&peerip);
|
||||
//printf("smpplength: %d\n",smppEncodeSM("49998,2006-07-01 @2004-09-14 11:08<-86755900093",buf));
|
||||
//
|
||||
while(TRUE) {
|
||||
switch( main_state ) {
|
||||
case 0:
|
||||
platInit();
|
||||
|
||||
SetTermSignal(&prev_termio, (void *)Terminate);
|
||||
if(subSystemID)
|
||||
{
|
||||
heartbeat_init(0x0901);
|
||||
}
|
||||
else
|
||||
{
|
||||
heartbeat_init(0x0900);
|
||||
}
|
||||
|
||||
SetFSMTimer();
|
||||
SigactionPrepaid();
|
||||
main_state = 1;
|
||||
gettimeofday(&tmstart,NULL);
|
||||
|
||||
printf("sizeof(all data): %d\n",
|
||||
sizeof(_ram_data));
|
||||
printf("sizeof(tariff_data): %d\n",
|
||||
sizeof(_tariff_data));
|
||||
printf("sizeof(card_data): %d\n",
|
||||
sizeof(_card_data));
|
||||
printf("sizeof(user_data): %d\n",
|
||||
sizeof(_prepaid_data));
|
||||
printf("sizeof(_tariff_private): %d\n",
|
||||
sizeof(_tariff_private));
|
||||
printf("sizeof(_ram_data): %d\n",
|
||||
sizeof(_state_machine));
|
||||
printf("sizeof(_prepaid_info): %d\n",
|
||||
sizeof(_prepaid_info));
|
||||
printf("sizeof(_state_machine): %d\n",
|
||||
sizeof(_state_machine));
|
||||
printf("sizeof(stat): %d\n",
|
||||
sizeof(_pps_cdr_buffer) + sizeof(_pps_csta_buffer));
|
||||
break;
|
||||
case 1:
|
||||
ppsModuleProc();
|
||||
if (pps_init(100000,subSystemID,localip,peerip,"11200001")) {
|
||||
main_state = 2;
|
||||
gettimeofday(&tmend,NULL);
|
||||
printf("Take %ld senconds\n",
|
||||
tmend.tv_sec-tmstart.tv_sec);
|
||||
// shortMessageTest();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(timer100%TIMER_ACTION_STATE==0)
|
||||
{
|
||||
gettimeofday(&tmstart,NULL);
|
||||
pps_proc();/* Normal state */
|
||||
gettimeofday(&tmend,NULL);
|
||||
//printf("Plat takes : %.1fms\n", (tmend.tv_sec-tmstart.tv_sec)*1000+(tmend.tv_usec-tmstart.tv_usec)/1000.0);
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
main_state = 0;
|
||||
break;
|
||||
}
|
||||
usleep(10);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,412 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "../include/ppsm.h"
|
||||
#include "../include/ramdata.h"
|
||||
#include "../include/param.h"
|
||||
|
||||
#include "../include/plat_inc.h"
|
||||
|
||||
/*----------------------------------------*/
|
||||
|
||||
extern _ram_data *ramshm_ptr;
|
||||
extern _state_machine *smshm_ptr;
|
||||
extern u_char logMsgFlag;
|
||||
extern struct timeval tvnow;
|
||||
/*----------------------------------------*/
|
||||
int pps_debug_map_msg();
|
||||
/*----------------------------------------*/
|
||||
extern int PutLogFunID();
|
||||
extern int stuff_sccp_address();
|
||||
extern int ppsBcdToAsciiR();
|
||||
extern int DebugMsg();
|
||||
extern int DebugMsgDelimiter();
|
||||
extern int ppsAsciiToBcdR();
|
||||
extern void StringCut(char *str, int c);
|
||||
extern int pps_get_ucbc_number(char *ucbc_number);
|
||||
extern PPSParamStruct ppsParam;
|
||||
extern u8 isdn_ston(u8 *normal_isdn, u8 *str_isdn);
|
||||
extern void isdn_ntoa(u8 * anti_isdn, u8 * normal_isdn);
|
||||
/*----------------------------------------*/
|
||||
|
||||
int pps_send_map_open(u_short portid)
|
||||
{
|
||||
u_char data_flow[256];
|
||||
char msisdn[32];
|
||||
int offset = 0;
|
||||
SCCP_ADDR srcAddr,dstAddr;
|
||||
|
||||
_state_data *shmp=(_state_data *)&smshm_ptr->state_data;
|
||||
|
||||
PutLogFunID("pps_send_map_open");
|
||||
|
||||
shmp += portid;
|
||||
shmp->context_info.map_did = map_get_dialogueid(147);
|
||||
|
||||
data_flow[offset++] = 0;
|
||||
data_flow[offset++] = 1;
|
||||
data_flow[offset++] = MAP_FLAG;
|
||||
data_flow[offset++] = portid>>8;
|
||||
data_flow[offset++] = portid;
|
||||
data_flow[offset++] = 0;
|
||||
data_flow[offset++] = shmp->context_info.map_did>>8;
|
||||
data_flow[offset++] = shmp->context_info.map_did;
|
||||
data_flow[offset++] = 0;
|
||||
data_flow[offset++] = MAP_OPEN;
|
||||
data_flow[offset++] = MAP_REQUEST;
|
||||
|
||||
if(shmp->process_info.routing_home_flag == 1)
|
||||
{
|
||||
char ucbc_number[32];
|
||||
data_flow[offset++] = AC_roamingNbEnquiry;
|
||||
|
||||
pps_get_ucbc_number(ucbc_number);
|
||||
stuff_sccp_address(&dstAddr,ucbc_number,7, 0);
|
||||
shmp->context_info.map_acn_ver = 2; //map_get_acnver(&dstAddr,AC_roamingNbEnquiry);
|
||||
data_flow[offset++] = 2; //AC_roamingNbEnquiry;
|
||||
}
|
||||
else
|
||||
{
|
||||
data_flow[offset++] = shmp->context_info.map_acn;
|
||||
|
||||
stuff_sccp_address(&dstAddr,shmp->called_info.number,6,14);
|
||||
shmp->context_info.map_acn_ver = map_get_acnver(&dstAddr,
|
||||
AC_anyTimeInfoEnquiry);
|
||||
data_flow[offset++] = shmp->context_info.map_acn_ver;
|
||||
}
|
||||
|
||||
memcpy(&data_flow[offset],&dstAddr,sizeof(SCCP_ADDR ));
|
||||
offset += sizeof(SCCP_ADDR);
|
||||
|
||||
ppsBcdToAsciiR(msisdn,&ppsParam.ppsNumber[1],20);
|
||||
StringCut(msisdn,'F');
|
||||
stuff_sccp_address(&srcAddr,msisdn,147,0);
|
||||
memcpy(&data_flow[offset],&srcAddr,sizeof(SCCP_ADDR ));
|
||||
offset += sizeof(SCCP_ADDR);
|
||||
|
||||
data_flow[offset++] = 0x10; /* delimiter */
|
||||
data_flow[offset++] = 0x00;
|
||||
data_flow[1] = offset - 2;
|
||||
|
||||
if((logMsgFlag == 0xff) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,
|
||||
"portid: %d ,did: %d, Send Map Open @ %ld.%ld",
|
||||
portid,shmp->context_info.map_did,
|
||||
tvnow.tv_sec,tvnow.tv_usec);
|
||||
pps_debug_map_msg(data_flow,1);
|
||||
}
|
||||
return map_send_comdata(data_flow);
|
||||
|
||||
}
|
||||
|
||||
int pps_send_map_openrsp(u_short portid, u_char result)
|
||||
{
|
||||
u_char msg_flow[256];
|
||||
int did,offset=0;
|
||||
_state_data *shmp = (_state_data *) smshm_ptr->state_data;
|
||||
|
||||
if(portid>=MAX_FSM_PROCESS)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
shmp += (portid);
|
||||
|
||||
did = shmp->context_info.map_did;
|
||||
msg_flow[offset++] = 0;
|
||||
msg_flow[offset++] = 0;
|
||||
msg_flow[offset++] = MAP_FLAG;
|
||||
msg_flow[offset++] = portid>>8;
|
||||
msg_flow[offset++] = portid;
|
||||
msg_flow[offset++] = 0;
|
||||
msg_flow[offset++] = did>>8;
|
||||
msg_flow[offset++] = did;
|
||||
msg_flow[offset++] = 0;
|
||||
msg_flow[offset++] = MAP_OPEN;
|
||||
msg_flow[offset++] = MAP_RESPONSE;
|
||||
msg_flow[offset++] = result;
|
||||
if(result == OpenResultAccept)
|
||||
{
|
||||
msg_flow[offset++] = 0x00;
|
||||
}
|
||||
else
|
||||
{
|
||||
msg_flow[offset++] = 0x01;
|
||||
msg_flow[offset++] = 0x03;
|
||||
msg_flow[offset++] = 0x01;
|
||||
msg_flow[offset++] = InvalidDesReference;
|
||||
}
|
||||
|
||||
msg_flow[offset++] = 0x00;
|
||||
msg_flow[1] = offset;
|
||||
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsgDelimiter();
|
||||
DebugMsg(debugmib.display.asciiOut,
|
||||
"[%04d] did=%d, send open response result: %d! (%ld.%ld)",
|
||||
portid,did,result,tvnow.tv_sec,tvnow.tv_usec);
|
||||
}
|
||||
|
||||
if(!map_send_comdata(msg_flow))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int pps_send_map_opr(struct MapOprData_struct *opr_ptr, int delimiter_flag)
|
||||
{
|
||||
u_char data_flow[256];
|
||||
u_short data_len,portid;
|
||||
|
||||
_state_data *shmp=(_state_data *)&smshm_ptr->state_data;
|
||||
|
||||
PutLogFunID("pps_send_map_opr");
|
||||
|
||||
map_opr_stof(opr_ptr,data_flow,0);
|
||||
data_len = data_flow[0]*256 + data_flow[1] + 2;
|
||||
if(delimiter_flag)
|
||||
data_flow[data_len-1] = 0x10;
|
||||
else
|
||||
data_flow[data_len-1] = 0x00;
|
||||
data_flow[data_len++] = 0x00;
|
||||
data_flow[data_len++] = 0x00;
|
||||
data_flow[0] = (data_len - 2) >>8;
|
||||
data_flow[1] = (data_len - 2) & 0xff;
|
||||
|
||||
portid = (data_flow[3]*256 + data_flow[4])%(MAX_FSM_PROCESS);
|
||||
shmp += portid;
|
||||
|
||||
if((logMsgFlag == 0xff) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,
|
||||
"portid: %d ,did: %d, Send Map Opr. @ %ld.%ld",
|
||||
portid,shmp->context_info.map_did,
|
||||
tvnow.tv_sec,tvnow.tv_usec);
|
||||
pps_debug_map_msg(data_flow,1);
|
||||
}
|
||||
|
||||
|
||||
return map_send_oprdata(data_flow);
|
||||
}
|
||||
|
||||
int pps_send_mnp_ati(u_short portid)
|
||||
{
|
||||
char msisdn[32];
|
||||
char data_flow[256];
|
||||
int len;
|
||||
struct MapOprData_struct opr_data;
|
||||
struct MapOprSrv_struct map_opr;
|
||||
struct MapATI_Arg *ati_arg;
|
||||
|
||||
_state_data *shmp=(_state_data *)&smshm_ptr->state_data;
|
||||
|
||||
PutLogFunID("pps_send_mnp_ati");
|
||||
|
||||
shmp += portid;
|
||||
|
||||
ati_arg = &map_opr.msg_list.ati_arg;
|
||||
ati_arg->param_flag = 0x07;
|
||||
ati_arg->sub_ident.choice_flag = 2;
|
||||
len = strlen((char *)shmp->called_info.number); /* can be caller */
|
||||
if(len>(ISDN_LEN-1)*2) len = (ISDN_LEN-1) * 2;
|
||||
ati_arg->sub_ident.choice.msisdn[0] = (len+1)/2+1;
|
||||
ati_arg->sub_ident.choice.msisdn[1] = 0x91;
|
||||
ppsAsciiToBcdR(&ati_arg->sub_ident.choice.msisdn[2],
|
||||
shmp->called_info.number,
|
||||
(len+1)/2*2);
|
||||
if(len %2)
|
||||
{
|
||||
ati_arg->sub_ident.choice.msisdn[(len+1)/2+1] |= 0xF0;
|
||||
}
|
||||
ati_arg->req_info.param_flag = 0x40;
|
||||
|
||||
ppsBcdToAsciiR(msisdn,&ppsParam.ppsNumber[1],20);
|
||||
StringCut(msisdn,'F');
|
||||
len = (strlen(msisdn)+1)/2;
|
||||
if(len>ISDN_LEN-1) len = ISDN_LEN-1;
|
||||
ati_arg->scf_add[0] = len+1;
|
||||
ati_arg->scf_add[1] = 0x91;
|
||||
memcpy(&ati_arg->scf_add[2],&ppsParam.ppsNumber[1],len);
|
||||
|
||||
shmp->context_info.map_iid =
|
||||
map_get_invokeid(shmp->context_info.map_did);
|
||||
|
||||
map_opr.port_id = portid;
|
||||
map_opr.dialogue_id = shmp->context_info.map_did;
|
||||
map_opr.invoke_id = shmp->context_info.map_iid;
|
||||
map_opr.message_type = AnyTimeInter;
|
||||
map_opr.message_flag = MAP_REQUEST;
|
||||
|
||||
build_mapparam(&map_opr, (u8 *)data_flow);
|
||||
|
||||
opr_data.port_id = portid;
|
||||
opr_data.dialogue_id = map_opr.dialogue_id;
|
||||
opr_data.invoke_id = map_opr.invoke_id;
|
||||
opr_data.message_type = map_opr.message_type;
|
||||
opr_data.message_flag = map_opr.message_flag;
|
||||
opr_data.param_flag = 0x1f;
|
||||
len = build_mapparam(&map_opr,opr_data.param);
|
||||
if(len<=0 || len>MAX_MAPPOPR_LEN)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
opr_data.param_len = len;
|
||||
opr_data.param_flag |= 0x20;
|
||||
|
||||
|
||||
if((logMsgFlag == 0xff) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,
|
||||
"portid: %d ,did: %d, Send Map ATI_Req. @ %ld.%ld",
|
||||
portid,shmp->context_info.map_did,
|
||||
tvnow.tv_sec,tvnow.tv_usec);
|
||||
|
||||
}
|
||||
return pps_send_map_opr(&opr_data, 1);
|
||||
}
|
||||
|
||||
|
||||
int pps_send_routing_home_prn(u_short portid)
|
||||
{
|
||||
char msisdn[32],buf[32];
|
||||
//char data_flow[256];
|
||||
int len;
|
||||
struct MapOprData_struct opr_data;
|
||||
struct MapOprSrv_struct map_opr;
|
||||
struct MapPRN_Arg *prn_arg;
|
||||
|
||||
_state_data *shmp=(_state_data *)&smshm_ptr->state_data;
|
||||
|
||||
PutLogFunID("pps_send_routing_home_prn");
|
||||
|
||||
shmp += portid;
|
||||
|
||||
prn_arg = &map_opr.msg_list.prn_arg;
|
||||
prn_arg->param_flag = 0x07;
|
||||
memcpy(prn_arg->imsi, shmp->caller_info.IMSI, 8);
|
||||
|
||||
//isdn_ston(msisdn, shmp->cdr_info.locationNumber);
|
||||
isdn_ston((u8 *)msisdn, shmp->caller_info.number);
|
||||
isdn_ntoa(prn_arg->msc_num, (u8 *)msisdn);
|
||||
|
||||
ppsBcdToAsciiR(buf, shmp->cdr_info.called, 14);
|
||||
StringCut(buf, 'F');
|
||||
StringCut(buf, 'E');
|
||||
isdn_ston((u8 *)msisdn, (u8 *)buf);
|
||||
isdn_ntoa(prn_arg->msisdn, (u8 *)msisdn);
|
||||
|
||||
|
||||
shmp->context_info.map_iid =
|
||||
map_get_invokeid(shmp->context_info.map_did);
|
||||
|
||||
map_opr.port_id = portid;
|
||||
map_opr.dialogue_id = shmp->context_info.map_did;
|
||||
map_opr.invoke_id = shmp->context_info.map_iid;
|
||||
map_opr.message_type = ProvRoamNum;
|
||||
map_opr.message_flag = MAP_REQUEST;
|
||||
map_opr.version = 2;
|
||||
|
||||
|
||||
opr_data.port_id = portid;
|
||||
opr_data.dialogue_id = map_opr.dialogue_id;
|
||||
opr_data.invoke_id = map_opr.invoke_id;
|
||||
opr_data.message_type = map_opr.message_type;
|
||||
opr_data.message_flag = map_opr.message_flag;
|
||||
opr_data.param_flag = 0x1f;
|
||||
|
||||
len = build_mapparam(&map_opr,opr_data.param);
|
||||
if(len<=0 || len>MAX_MAPPOPR_LEN)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
opr_data.param_len = len;
|
||||
opr_data.param_flag |= 0x20;
|
||||
|
||||
|
||||
if((logMsgFlag == 0xff) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,
|
||||
"portid: %d ,did: %d, Send Map PRN_Req. @ %ld.%ld",
|
||||
portid,shmp->context_info.map_did,
|
||||
tvnow.tv_sec,tvnow.tv_usec);
|
||||
|
||||
}
|
||||
return pps_send_map_opr(&opr_data, 1);
|
||||
}
|
||||
|
||||
|
||||
int pps_send_map_close(u_short portid)
|
||||
{
|
||||
u_char data_flow[256];
|
||||
|
||||
_state_data *shmp=(_state_data *)&smshm_ptr->state_data;
|
||||
|
||||
PutLogFunID("pps_send_mnp_ati");
|
||||
|
||||
shmp += portid;
|
||||
|
||||
data_flow[0] = 0;
|
||||
data_flow[1] = 12;
|
||||
data_flow[2] = MAP_FLAG;
|
||||
data_flow[3] = portid>>8;
|
||||
data_flow[4] = portid & 0xff;
|
||||
data_flow[5] = 0;
|
||||
data_flow[6] = shmp->context_info.map_did >> 8;
|
||||
data_flow[7] = shmp->context_info.map_did & 0xff;
|
||||
data_flow[8] = 0x00;
|
||||
data_flow[9] = MAP_CLOSE;
|
||||
data_flow[10] = MAP_REQUEST;
|
||||
data_flow[11] = NormalRelease;
|
||||
data_flow[12] = 0x00;
|
||||
data_flow[13] = 0x00;
|
||||
//data_flow[1] = len;
|
||||
|
||||
map_send_comdata(data_flow);
|
||||
|
||||
if((logMsgFlag == 0xff) || shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,
|
||||
"portid: %d ,did: %d, Send Map Close @ %ld.%ld",
|
||||
portid,shmp->context_info.map_did,
|
||||
tvnow.tv_sec,tvnow.tv_usec);
|
||||
pps_debug_map_msg(data_flow,1);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int pps_debug_map_msg(u_char *data_flow, int flag)
|
||||
{
|
||||
int len,loop;
|
||||
char buf[1024],buf1[6];
|
||||
|
||||
if(!flag)
|
||||
DebugMsg(debugmib.display.asciiOut,
|
||||
" \33[32m-- <P/DID=%04d/%04d> Rec. MSG <ocode: %d> @%ld.%ld\33[0m",
|
||||
data_flow[3]*256+data_flow[4],
|
||||
data_flow[6]*256+data_flow[7],
|
||||
data_flow[9],
|
||||
tvnow.tv_sec,tvnow.tv_usec);
|
||||
else
|
||||
DebugMsg(debugmib.display.asciiOut,
|
||||
" \33[32m-- <P/DID=%04d/%04d> Snd. MSG <ocode: %d> @%ld.%ld\33[0m",
|
||||
data_flow[3]*256+data_flow[4],
|
||||
data_flow[6]*256+data_flow[7],
|
||||
data_flow[9],
|
||||
tvnow.tv_sec,tvnow.tv_usec);
|
||||
len = data_flow[0] * 256 + data_flow[1];
|
||||
DebugMsg(debugmib.display.asciiOut,"------------ Message Flow ----------------");
|
||||
memset(buf,0,1024);
|
||||
for(loop=0;loop<len+2;loop++)
|
||||
{
|
||||
sprintf(buf1,"%02X ",data_flow[loop]);
|
||||
strcat(buf,buf1);
|
||||
if((loop+1)%16==0){
|
||||
sprintf(buf1,"\r\n");
|
||||
strcat(buf,buf1);
|
||||
}
|
||||
}
|
||||
DebugMsg(debugmib.display.asciiOut,"%s\r\n",buf);
|
||||
return 1;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,735 @@
|
||||
|
||||
#include "../include/gprs.h"
|
||||
|
||||
static int pps_radius_sap_id;
|
||||
|
||||
extern int subSystemID;
|
||||
extern _state_machine *smshm_ptr;
|
||||
extern PPSParamStruct ppsParam;
|
||||
extern _ram_data *ramshm_ptr;
|
||||
extern struct timeval tvnow;
|
||||
|
||||
extern PPS_COS_RADIUS_ITEM *getCosRadiusItem(_account_info *ptr);
|
||||
extern int intiateGprsReportedInfo(_state_data *shmp);
|
||||
|
||||
/**************************** vas *******************************/
|
||||
extern BOOL isVas(WORD pid,RADIUS_ACCESS_REQUEST *access_request);
|
||||
extern int vas_process_access_request(WORD pid,RADIUS_ACCESS_REQUEST *access_request);
|
||||
|
||||
/**************************** vas *******************************/
|
||||
|
||||
|
||||
static ulong getNasVolumeMeterUnit(DWORD ip)
|
||||
{
|
||||
int i;
|
||||
PPS_RADIUS_NAS_INFO *nasItem;
|
||||
|
||||
return 1;
|
||||
for(i=0;i < RADIUS_MAX_NUM_OF_NAS;i++)
|
||||
{
|
||||
nasItem = &ppsParam.ppsTables.gsn[i];
|
||||
if(ip == nasItem->nasInfo.nas_ip)
|
||||
{
|
||||
if(nasItem->volumeMeterUnit > 0)
|
||||
return nasItem->volumeMeterUnit;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static ulong getNasDurationMeterUnit(DWORD ip)
|
||||
{
|
||||
int i;
|
||||
PPS_RADIUS_NAS_INFO *nasItem;
|
||||
|
||||
return 1;
|
||||
for(i=0;i < RADIUS_MAX_NUM_OF_NAS;i++)
|
||||
{
|
||||
nasItem = &ppsParam.ppsTables.gsn[i];
|
||||
if(ip == nasItem->nasInfo.nas_ip)
|
||||
{
|
||||
if(nasItem->durationMeterUnit > 0)
|
||||
return nasItem->durationMeterUnit;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int checkSupportedCapability(WORD pid,const RADIUS_VENDOR_SPECIFIC *vendorSpecific)
|
||||
{
|
||||
int i;
|
||||
RADIUS_VENDOR_ATTRIBUTE_3GPP2_PPAC *ppac;
|
||||
RADIUS_ATTRIBUTE_VENDOR_SPECIFIC *specific;
|
||||
|
||||
for(i=0;i<vendorSpecific->num;i++)
|
||||
{
|
||||
specific = (RADIUS_ATTRIBUTE_VENDOR_SPECIFIC *)&vendorSpecific->vendor_specific[i];
|
||||
if(specific->flag == 0)
|
||||
{
|
||||
pps_print_error(0,"Radius pid[%5ld],No vendor spefific content in %d",pid,i);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(specific->vendor_type == RADIUS_VENDOR_TYPE_3GPP2_PPAC)
|
||||
{
|
||||
ppac = &specific->attribute_3gpp2.ppac;
|
||||
if(ppac->aic.aic & 0x03)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
pps_print_error(0,"Radius pid[%5ld],Peer not support Volume Meter and Duration Meter",pid);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static RADIUS_VENDOR_ATTRIBUTE_3GPP_SGSN_ADDR *getSGSNAddr(WORD pid,const RADIUS_VENDOR_SPECIFIC *vendorSpecific)
|
||||
{
|
||||
int i;
|
||||
RADIUS_ATTRIBUTE_VENDOR_SPECIFIC *specific;
|
||||
|
||||
for(i=0;i<vendorSpecific->num;i++)
|
||||
{
|
||||
specific = (RADIUS_ATTRIBUTE_VENDOR_SPECIFIC *)&vendorSpecific->vendor_specific[i];
|
||||
if(specific->flag == 0)
|
||||
{
|
||||
pps_print_error(0,"Radius pid[%5ld],No vendor spefific content in %d",pid,i);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(specific->vendor_type == RADIUS_VENDOR_TYPE_3GPP_SGSN_ADDR)
|
||||
{
|
||||
return &specific->attribute_3gpp.sgsn_addr;
|
||||
}
|
||||
}
|
||||
pps_print_error(0,"Radius pid[%5ld],Peer no sgsn address",pid);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RADIUS_ATTRIBUTE_NAS_IP_ADDRESS *getNASIP(WORD pid,const RADIUS_ACCESS_REQUEST *accessRequest)
|
||||
{
|
||||
if(accessRequest->nas_ip_addr.flag != 0)
|
||||
{
|
||||
return (RADIUS_ATTRIBUTE_NAS_IP_ADDRESS *)&accessRequest->nas_ip_addr;
|
||||
}
|
||||
pps_print_error(0,"Radius pid[%5ld],Peer no nas ip",pid);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void updateReason(u8 reasonID,u_char *reason)
|
||||
{
|
||||
switch(reasonID)
|
||||
{
|
||||
case RADIUS_PPAQ_UR_PRE_INIT:
|
||||
strcpy((char *)reason,"PRE INIT");
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_INIT_REQUEST:
|
||||
strcpy((char *)reason,"INIT REQUEST");
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_THRESHOLD_REACHED:
|
||||
strcpy((char *)reason,"THRESHOLD REACHED");
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_QUOTA_REACHED:
|
||||
strcpy((char *)reason,"QUOTA REACHED");
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_TITSU_APPROACHING:
|
||||
strcpy((char *)reason,"TITSU APPROACHING");
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_REMOTE_DISC:
|
||||
strcpy((char *)reason,"REMOTE DISC");
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_CLIENT_SERVICE_TER:
|
||||
strcpy((char *)reason,"CLIENT SERVICE TER");
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_ACCESS_SERVICE_TER:
|
||||
strcpy((char *)reason,"ACCESS SERVICE TER");
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_SERVICE_NOT_EST:
|
||||
strcpy((char *)reason,"SERVICE NOT EST");
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_ONE_TIME_CHARGING:
|
||||
strcpy((char *)reason,"ONE TIME CHARGING");
|
||||
break;
|
||||
default:
|
||||
strcpy((char *)reason,"Unknown Reason");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int process_PPAQ(WORD pid, RADIUS_VENDOR_ATTRIBUTE_3GPP2_PPAQ *ppaq, RADIUS_ATTRIBUTE_ACCT_SESSION_ID *pAsi)
|
||||
{
|
||||
u_short pps_port,qid;
|
||||
_gprs_process *gprsProc;
|
||||
_RADIUS_REPORTED_INFO *radiusReportedInfo;
|
||||
_state_data *shmp;
|
||||
u_char reason[256]={0};
|
||||
|
||||
PutLogFunID("process_PPAQ");
|
||||
|
||||
if(ppaq->qid.flag != 0)
|
||||
{
|
||||
if(ppaq->qid.qid.length != 2*sizeof(u_short))
|
||||
{
|
||||
pps_print_error(0,"Incorrect QID,length error");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// get pps port
|
||||
pps_port = ppaq->qid.qid.value >> 16;
|
||||
if(subSystemID != 0)
|
||||
{
|
||||
if ((pps_port < QID_DUAL_PLAT_POIND) || (pps_port >= (MAX_FSM_PROCESS + QID_DUAL_PLAT_POIND)))
|
||||
{
|
||||
pps_print_error(0,"Incorrect pps port[%d]", pps_port);
|
||||
return -1;
|
||||
}
|
||||
pps_port = pps_port - QID_DUAL_PLAT_POIND;
|
||||
}
|
||||
if (pps_port >= MAX_FSM_PROCESS)
|
||||
{
|
||||
pps_print_error(0,"Incorrect pps port[%d]", pps_port);
|
||||
return -1;
|
||||
}
|
||||
//
|
||||
|
||||
// get qid, initial is 2
|
||||
qid = ppaq->qid.qid.value & 0xffff;
|
||||
if (qid < 2)
|
||||
{
|
||||
pps_print_error(0,"Incorrect qid[%d]", qid);
|
||||
return -1;
|
||||
}
|
||||
//
|
||||
}
|
||||
else
|
||||
{
|
||||
pps_print_error(0,"No QID");
|
||||
return -1;
|
||||
}
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += pps_port;
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
if(gprsProc->qid != qid)
|
||||
{
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]Incorrect QID:%d,not same as pps allocated:%d",pps_port,qid,gprsProc->qid);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* match acct-session-id
|
||||
if ((pAsi == NULL) || (pAsi->flag == 0))
|
||||
{
|
||||
pps_print_error(0, "No accounting session id");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((pAsi->acct_session_id.length < 2) || (pAsi->acct_session_id.length != gprsProc->acct_session_id.length) \
|
||||
|| (memcmp(pAsi->acct_session_id.value, gprsProc->acct_session_id.value, pAsi->acct_session_id.length-2) != 0))
|
||||
{
|
||||
pps_print_error(0, "accounting session id not match, discard");
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
|
||||
gprsProc->accessRequestTimer = 0;
|
||||
|
||||
if(ppaq->ur.flag != 0)
|
||||
{
|
||||
updateReason(ppaq->ur.ur.value,reason);
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d] ppaq updated reason:%s",pps_port,reason);
|
||||
switch(ppaq->ur.ur.value)
|
||||
{
|
||||
case RADIUS_PPAQ_UR_PRE_INIT:
|
||||
pps_print_error(shmp->process_info.logMsisdn,"Pre-initialization is unsupported");
|
||||
return -1;
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_INIT_REQUEST:
|
||||
pps_print_error(shmp->process_info.logMsisdn,"Initial Request is unsupported");
|
||||
return -1;
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_THRESHOLD_REACHED:
|
||||
gprsProc->radiusCommand = PPS_RADIUS_THRESHOLD_REACHED;
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_QUOTA_REACHED:
|
||||
gprsProc->radiusCommand = PPS_RADIUS_QUOTA_REACHED;
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_TITSU_APPROACHING:
|
||||
pps_print_error(shmp->process_info.logMsisdn,"TITSU Approaching is unsupported");
|
||||
return -1;
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_REMOTE_DISC:
|
||||
gprsProc->radiusCommand = PPS_RADIUS_REMOTE_DISC;
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_CLIENT_SERVICE_TER:
|
||||
gprsProc->radiusCommand = PPS_RADIUS_CLIENT_SERVICE_TER;
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_ACCESS_SERVICE_TER:
|
||||
gprsProc->radiusCommand = PPS_RADIUS_ACCESS_SERVICE_TER;
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_SERVICE_NOT_EST:
|
||||
gprsProc->radiusCommand = PPS_RADIUS_SERVICE_NOT_EST;
|
||||
break;
|
||||
case RADIUS_PPAQ_UR_ONE_TIME_CHARGING:
|
||||
pps_print_error(shmp->process_info.logMsisdn,"One-Time Charging is unsupported");
|
||||
return -1;
|
||||
break;
|
||||
default:
|
||||
pps_print_error(shmp->process_info.logMsisdn,"Unknow update reason:%d", ppaq->ur.ur.value);
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pps_print_error(shmp->process_info.logMsisdn,"No update reason");
|
||||
return -1;
|
||||
}
|
||||
|
||||
radiusReportedInfo = &gprsProc->radiusReportedInfo;
|
||||
if(ppaq->vq.flag != 0)
|
||||
{
|
||||
memcpy(&radiusReportedInfo->vq,&ppaq->vq,sizeof(RADIUS_VENDOR_3GPP2_PPAQ_SUB_ATTR_VQ));
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d] ppaq reported vq is:(integer:%lld,exponent:%d)",
|
||||
pps_port,radiusReportedInfo->vq.vq.integer,radiusReportedInfo->vq.vq.exponent);
|
||||
}
|
||||
if(ppaq->vt.flag != 0)
|
||||
{
|
||||
memcpy(&radiusReportedInfo->vt,&ppaq->vt,sizeof(RADIUS_VENDOR_3GPP2_PPAQ_SUB_ATTR_VT));
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d] ppaq reported vth is:(integer:%lld,exponent:%d)",
|
||||
pps_port,radiusReportedInfo->vt.vt.integer,radiusReportedInfo->vq.vq.exponent);
|
||||
}
|
||||
if(ppaq->dq.flag != 0)
|
||||
{
|
||||
memcpy(&radiusReportedInfo->dq,&ppaq->dq,sizeof(RADIUS_VENDOR_3GPP2_PPAQ_SUB_ATTR_DQ));
|
||||
}
|
||||
if(ppaq->dt.flag != 0)
|
||||
{
|
||||
memcpy(&radiusReportedInfo->dt,&ppaq->dt,sizeof(RADIUS_VENDOR_3GPP2_PPAQ_SUB_ATTR_DT));
|
||||
}
|
||||
return pps_port;
|
||||
}
|
||||
|
||||
static int getPPAQ(WORD pid,const RADIUS_VENDOR_SPECIFIC *vendorSpecific, RADIUS_ATTRIBUTE_ACCT_SESSION_ID *pAsi)
|
||||
{
|
||||
int i;
|
||||
RADIUS_VENDOR_ATTRIBUTE_3GPP2_PPAQ *ppaq;
|
||||
RADIUS_ATTRIBUTE_VENDOR_SPECIFIC *specific;
|
||||
|
||||
for(i=0;i<vendorSpecific->num;i++)
|
||||
{
|
||||
specific = (RADIUS_ATTRIBUTE_VENDOR_SPECIFIC *)&vendorSpecific->vendor_specific[i];
|
||||
if(specific->flag == 0)
|
||||
{
|
||||
pps_print_error(0,"Radius pid[%5ld],No vendor spefific content in %d",pid,i);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(specific->vendor_type == RADIUS_VENDOR_TYPE_3GPP2_PPAQ)
|
||||
{
|
||||
ppaq = &specific->attribute_3gpp2.ppaq;
|
||||
return process_PPAQ(pid, ppaq, pAsi);
|
||||
}
|
||||
}
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
||||
static int allocate_GPRS_PORT(WORD pid,RADIUS_TLV_TS *csi,RADIUS_TLV_TS *asi)
|
||||
{
|
||||
int gprs_port;
|
||||
_state_data *shmp;
|
||||
_gprs_process *gprsProc;
|
||||
u_char msisdn[MAX_ASCII_NUMBER_LEN];
|
||||
|
||||
gprs_port = AssignProcID(1);// gprs and gy has the same port range
|
||||
if(gprs_port < 0)
|
||||
{
|
||||
pps_print_error(0,"System busy ,no idle port");
|
||||
return -2;
|
||||
}
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += gprs_port;
|
||||
shmp->context_info.mtype = GPRS_O_OPEN;
|
||||
shmp->context_info.new_flag = YES;
|
||||
memset(msisdn,0,MAX_ASCII_NUMBER_LEN);
|
||||
if(csi->value[0] == '+')
|
||||
memcpy(msisdn,&csi->value[1],csi->length-1);
|
||||
else
|
||||
memcpy(msisdn,&csi->value[0],csi->length);
|
||||
strcpy((char *)shmp->caller_info.number, (char *)msisdn);
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
memcpy(&gprsProc->acct_session_id,asi,sizeof(RADIUS_TLV_TS));
|
||||
gprsProc->radiusCommand = PPS_RADIUS_NEW_SERVICE;
|
||||
gprsProc->radiusPid = pid;
|
||||
gprsProc->qid = INIT_QID;
|
||||
|
||||
memcpy(&gprsProc->calling_station_id,csi,sizeof(RADIUS_TLV_TS));
|
||||
if(logMsgFlag & 0x08)
|
||||
{
|
||||
if(strstr((char *)shmp->caller_info.number,logMsisdn))
|
||||
shmp->process_info.logMsisdn = 0x01;
|
||||
}
|
||||
return gprs_port;
|
||||
}
|
||||
|
||||
|
||||
static int process_access_request(WORD pid,RADIUS_ACCESS_REQUEST *access_request)
|
||||
{
|
||||
RADIUS_TLV_TS *csi,*asi;
|
||||
RADIUS_VENDOR_ATTRIBUTE_3GPP_SGSN_ADDR *sgsnAddr;
|
||||
RADIUS_ATTRIBUTE_NAS_IP_ADDRESS *nasAddr;
|
||||
int ppsPort=-1;
|
||||
|
||||
if(access_request->vendor_specific.num == 0)
|
||||
{
|
||||
pps_print_error(0,"No vendor spefific");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
sgsnAddr = getSGSNAddr(pid,&access_request->vendor_specific);
|
||||
if(sgsnAddr == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
nasAddr = getNASIP(pid,access_request);
|
||||
if(nasAddr == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ppsPort = getPPAQ(pid, &access_request->vendor_specific, &access_request->acct_session_id);
|
||||
if(ppsPort == -1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(ppsPort == -2)/* First Access Request */
|
||||
{
|
||||
if(checkSupportedCapability(pid,&access_request->vendor_specific) < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
csi = &access_request->calling_station_id.calling_station_id;
|
||||
asi = &access_request->acct_session_id.acct_session_id;
|
||||
if(access_request->calling_station_id.flag != 0)
|
||||
{
|
||||
if(csi->length > MAX_ASCII_NUMBER_LEN)
|
||||
{
|
||||
pps_print_error(0,"calling station id is too long:%d",csi->length);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pps_print_error(0,"No calling station id");
|
||||
return -1;
|
||||
}
|
||||
ppsPort = allocate_GPRS_PORT(pid,csi,asi);
|
||||
}
|
||||
|
||||
if(ppsPort >= 0)
|
||||
{
|
||||
_state_data *shmp;
|
||||
_gprs_process *gprsProc;
|
||||
_RADIUS_REPORTED_INFO *radiusReportedInfo;
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += ppsPort;
|
||||
|
||||
shmp->process_info.portid = ppsPort;
|
||||
radiusReportedInfo = &shmp->process_info.ppsService.gprs_process.radiusReportedInfo;
|
||||
memcpy(&radiusReportedInfo->nasIP,nasAddr,sizeof(RADIUS_ATTRIBUTE_NAS_IP_ADDRESS));
|
||||
memcpy(&radiusReportedInfo->sgsnIP,sgsnAddr,sizeof(RADIUS_VENDOR_ATTRIBUTE_3GPP_SGSN_ADDR));
|
||||
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
gprsProc->volumeMeterUnit = getNasVolumeMeterUnit(radiusReportedInfo->nasIP.nas_ip_addr.value);
|
||||
gprsProc->accessRequestTimer = 0;
|
||||
gprsProc->gsnIP = nasAddr->nas_ip_addr.value;
|
||||
gprsProc->sgsnIP = sgsnAddr->sgsn_addr;
|
||||
gprsProc->radiusPid = pid;
|
||||
|
||||
return ppsPort;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int process_accounting_request(WORD pid,RADIUS_ACCOUNTING_REQUEST *accounting_request)
|
||||
{
|
||||
int ppsPort=-1;
|
||||
_state_data *shmp;
|
||||
_gprs_process *gprsProc;
|
||||
|
||||
ppsPort = getPPAQ(pid,&accounting_request->vendor_specific, &accounting_request->acct_session_id);
|
||||
if(ppsPort < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += ppsPort;
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
memcpy(&gprsProc->acct_session_id,&accounting_request->acct_session_id.acct_session_id,
|
||||
sizeof(RADIUS_TLV_TS));
|
||||
gprsProc->radiusCommand = PPS_RADIUS_NO_CMD;/* upper layer does not has any interest of this message,just ignore it here */
|
||||
return ppsPort;
|
||||
}
|
||||
|
||||
int pps_process_radius_ind(WORD *usr_pid, WORD pid, RADIUS_MSG *msg_pdu)
|
||||
{
|
||||
int ppsPort;
|
||||
|
||||
switch(msg_pdu->msg_type)
|
||||
{
|
||||
case RADIUS_MSG_TYPE_ACCESS_REQUEST:
|
||||
if(isVas(pid,&msg_pdu->msg.access_request)== TRUE)
|
||||
{
|
||||
pps_print_event(0,"PPS receive radius msg:Access Request,for VAS prepaid");
|
||||
ppsPort = vas_process_access_request(pid,&msg_pdu->msg.access_request);
|
||||
}
|
||||
else
|
||||
{
|
||||
pps_print_event(0,"PPS receive radius msg:Access Request");
|
||||
ppsPort = process_access_request(pid,&msg_pdu->msg.access_request);
|
||||
}
|
||||
if(ppsPort < 0)
|
||||
*usr_pid = 0;
|
||||
else
|
||||
*usr_pid = ppsPort;
|
||||
return ppsPort;
|
||||
break;
|
||||
case RADIUS_MSG_TYPE_ACCOUNTING_REQUEST:
|
||||
pps_print_event(0,"PPS receive radius msg:Accounting Request but ignore it");
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
pps_print_error(0,"PPS not support radius msg type:%d ",msg_pdu->msg_type);
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int pps_process_radius_cnf(WORD usr_pid, WORD pid, RADIUS_MSG *msg_pdu)
|
||||
{
|
||||
int ppsPort;
|
||||
_state_data *shmp;
|
||||
_gprs_process *gprsProc;
|
||||
|
||||
|
||||
ppsPort = usr_pid;
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += ppsPort;
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
switch(msg_pdu->msg_type)
|
||||
{
|
||||
case RADIUS_MSG_TYPE_DISCONNECT_ACK:
|
||||
gprsProc->radiusCommand = PPS_RADIUS_DISCONNECT_ACK;
|
||||
pps_print_event(0,"PPS receive radius msg:disconnect ACK for pid %d",ppsPort);
|
||||
break;
|
||||
case RADIUS_MSG_TYPE_DISCONNECT_NAK:
|
||||
gprsProc->radiusCommand = PPS_RADIUS_DISCONNECT_NAK;
|
||||
pps_print_error(0,"PPS receive radius msg:disconnect NAK for pid %d",ppsPort);
|
||||
break;
|
||||
default:
|
||||
pps_print_error(0,"PPS not support radius conf");
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int pps_bind_radius()
|
||||
{
|
||||
RADIUS_SAP sap;
|
||||
|
||||
strcpy(sap.name,"PPS");
|
||||
sap.radius_ind = pps_process_radius_ind;
|
||||
sap.radius_cnf = pps_process_radius_cnf;
|
||||
pps_radius_sap_id = radius_bind(&sap);
|
||||
if(pps_radius_sap_id< 0)
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int pps_set_nas(BYTE id,RADIUS_NAS_INFORMATION *nasInfo)
|
||||
{
|
||||
return radius_set_nas_info(pps_radius_sap_id,id,nasInfo);
|
||||
}
|
||||
|
||||
int pps_del_nas(BYTE id)
|
||||
{
|
||||
return radius_delet_nas_info(pps_radius_sap_id,id);
|
||||
}
|
||||
|
||||
void init_radius_gsn()
|
||||
{
|
||||
int i;
|
||||
PPS_RADIUS_NAS_INFO *gsnItem;
|
||||
|
||||
pps_bind_radius();
|
||||
|
||||
for(i=0;i<MaxRadiusGsnItem;i++)
|
||||
{
|
||||
gsnItem = &ppsParam.ppsTables.gsn[i];
|
||||
if(gsnItem->existFlag == TRUE)
|
||||
{
|
||||
pps_set_nas(i,&gsnItem->nasInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
int sendRadiusAccessReject(u_short portid,u_char *reason)
|
||||
{
|
||||
_state_data *shmp;
|
||||
_gprs_process *gprsProc;
|
||||
RADIUS_MSG radiusMsg;
|
||||
RADIUS_ACCESS_REJECT *accessReject;
|
||||
int len;
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
|
||||
len = strlen((char *)reason)%RADIUS_TS_VALUE_LEN;
|
||||
radiusMsg.msg_type = RADIUS_MSG_TYPE_ACCESS_REJECT;
|
||||
|
||||
accessReject = &radiusMsg.msg.access_reject;
|
||||
memset(accessReject,0,sizeof(RADIUS_ACCESS_REJECT));
|
||||
if(len > 0)
|
||||
{
|
||||
accessReject->reply_message.num = 1;
|
||||
accessReject->reply_message.reply_message[0].flag = 1;
|
||||
accessReject->reply_message.reply_message[0].reply_message.length = len;
|
||||
memcpy(accessReject->reply_message.reply_message[0].reply_message.value,reason,len);
|
||||
}
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d] send radius access reject,reason:%s",portid,reason);
|
||||
return radius_send_access_reject(pps_radius_sap_id,gprsProc->radiusPid,portid,&radiusMsg);
|
||||
}
|
||||
|
||||
static int allocateQID(_state_data *shmp)
|
||||
{
|
||||
_gprs_process *gprsProc;
|
||||
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
gprsProc->qid++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sendRadiusAccessAccept(u_short portid,BOOL volumeFlag,BOOL durationFlag)
|
||||
{
|
||||
_state_data *shmp;
|
||||
_gprs_process *gprsProc;
|
||||
RADIUS_MSG radiusMsg;
|
||||
RADIUS_ACCESS_ACCEPT *accessAccept;
|
||||
RADIUS_ATTRIBUTE_VENDOR_SPECIFIC *vendorSpecific;
|
||||
RADIUS_VENDOR_ATTRIBUTE_3GPP2_PPAQ *ppaq;
|
||||
DWORD qid=0;
|
||||
ulong meterUnit;
|
||||
//PPS_COS_RADIUS_ITEM *radiusItem;
|
||||
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
|
||||
radiusMsg.msg_type = RADIUS_MSG_TYPE_ACCESS_ACCEPT;
|
||||
|
||||
accessAccept = &radiusMsg.msg.access_accept;
|
||||
memset(accessAccept,0,sizeof(RADIUS_ACCESS_ACCEPT));
|
||||
accessAccept->vendor_specific.num = 1;
|
||||
|
||||
vendorSpecific = &accessAccept->vendor_specific.vendor_specific[0];
|
||||
vendorSpecific->vendor_type = RADIUS_VENDOR_TYPE_3GPP2_PPAC;
|
||||
vendorSpecific->attribute_3gpp2.ppac.sfs.flag = 1;
|
||||
vendorSpecific->attribute_3gpp2.ppac.sfs.sfs= 0x01;
|
||||
|
||||
|
||||
if(volumeFlag != FALSE || durationFlag != FALSE)
|
||||
{
|
||||
allocateQID(shmp);
|
||||
accessAccept->vendor_specific.num++;
|
||||
vendorSpecific = &accessAccept->vendor_specific.vendor_specific[1];
|
||||
vendorSpecific->vendor_type = RADIUS_VENDOR_TYPE_3GPP2_PPAQ;
|
||||
ppaq = &vendorSpecific->attribute_3gpp2.ppaq;
|
||||
|
||||
ppaq->qid.flag = 1;
|
||||
if(subSystemID == 0)
|
||||
{
|
||||
qid = portid;
|
||||
qid <<=16;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
qid = portid + QID_DUAL_PLAT_POIND;
|
||||
qid <<=16;
|
||||
}
|
||||
ppaq->qid.qid.value = qid | (gprsProc->qid & 0xffff);
|
||||
|
||||
//radiusItem = getCosRadiusItem(&shmp->caller_info);
|
||||
|
||||
|
||||
if(volumeFlag == TRUE)
|
||||
{
|
||||
meterUnit = getNasVolumeMeterUnit(gprsProc->radiusReportedInfo.nasIP.nas_ip_addr.value);
|
||||
if(gprsProc->vqAllocated.integer> 0)
|
||||
{
|
||||
ppaq->vq.flag = 1;
|
||||
ppaq->vq.vq.integer = gprsProc->vqAllocated.integer/meterUnit;
|
||||
ppaq->vq.vq.exponent = gprsProc->vqAllocated.exponent;
|
||||
}
|
||||
if(gprsProc->vthAllocated.integer> 0)
|
||||
{
|
||||
ppaq->vt.flag = 1;
|
||||
ppaq->vt.vt.integer = (gprsProc->vthAllocated.integer)/meterUnit;
|
||||
ppaq->vt.vt.exponent = gprsProc->vthAllocated.exponent;
|
||||
}
|
||||
}
|
||||
|
||||
if(durationFlag == TRUE)
|
||||
{
|
||||
meterUnit = getNasDurationMeterUnit(gprsProc->radiusReportedInfo.nasIP.nas_ip_addr.value);
|
||||
ppaq->dq.flag = 1;
|
||||
ppaq->dq.dq.value = gprsProc->dqAllocated/meterUnit;
|
||||
|
||||
ppaq->dt.flag = 1;
|
||||
ppaq->dt.dt.value = gprsProc->dthAllocated/meterUnit;
|
||||
}
|
||||
}
|
||||
intiateGprsReportedInfo(shmp);
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d] send radius access accept",portid);
|
||||
return radius_send_access_accept(pps_radius_sap_id,gprsProc->radiusPid,portid,&radiusMsg);
|
||||
}
|
||||
|
||||
|
||||
int sendRadiusDisconnectReq(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
_gprs_process *gprsProc;
|
||||
RADIUS_MSG radiusMsg;
|
||||
RADIUS_DISCONNECT_REQUEST *disconnectReq;
|
||||
RADIUS_ADDR addr;
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
|
||||
radiusMsg.msg_type = RADIUS_MSG_TYPE_DISCONNECT_REQUEST;
|
||||
|
||||
disconnectReq = &radiusMsg.msg.disconnect_request;
|
||||
memset(disconnectReq,0,sizeof(RADIUS_DISCONNECT_REQUEST));
|
||||
|
||||
addr.addr.ipV4 = gprsProc->gsnIP;
|
||||
disconnectReq->calling_station_id.flag = 1;
|
||||
memcpy(&disconnectReq->calling_station_id.calling_station_id,&gprsProc->calling_station_id,sizeof(RADIUS_TLV_TS));
|
||||
disconnectReq->acct_session_id.flag = 1;
|
||||
memcpy(&disconnectReq->acct_session_id.acct_session_id,&gprsProc->acct_session_id,sizeof(RADIUS_TLV_TS));
|
||||
|
||||
return radius_send_disconnect_request(pps_radius_sap_id,portid,&radiusMsg,&addr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,624 @@
|
||||
|
||||
#include "../include/includes.h"
|
||||
#include "../include/ppsm.h"
|
||||
#include "../include/ramdata.h"
|
||||
#include "../include/ppsinf.h"
|
||||
#include "../include/message.h"
|
||||
#include "../include/iofunc.h"
|
||||
#include "../include/version.h"
|
||||
#include "../include/pps_public.h"
|
||||
#include "../include/cdrme.h"
|
||||
#include "../include/param.h"
|
||||
|
||||
#include "../include/plat_inc.h"
|
||||
|
||||
#include "../include/ppsMibTable.h"
|
||||
#include "../include/mfunc.h"
|
||||
|
||||
extern PPSParamStruct ppsParam;
|
||||
extern struct timeval tvnow;
|
||||
extern _ram_data *ramshm_ptr;
|
||||
|
||||
extern void DebugMsg(void *ptr, const char *fmt, ...);
|
||||
extern u_short debug_messages;
|
||||
extern int logMsgFlag;
|
||||
|
||||
enum PROMOTION_USED_SERVICE{
|
||||
PROMOTION_USED_CALL,
|
||||
PROMOTION_USED_SMS,
|
||||
PROMOTION_USED_GPRS,
|
||||
};
|
||||
|
||||
enum PROMOTION_USED_RANGE{
|
||||
MO_LOCAL,
|
||||
MO_NDD,
|
||||
MO_IDD,
|
||||
};
|
||||
|
||||
|
||||
enum _TIER_RATING_PLAN{
|
||||
BILL_TIER_PLAN_A = 0,
|
||||
BILL_TIER_PLAN_B,
|
||||
BILL_TIER_PLAN_C,
|
||||
};
|
||||
|
||||
|
||||
BOOL isPromotionCanBeUsedForRoDebit(_account_info *shmp)
|
||||
{
|
||||
if(shmp == NULL) return 0;
|
||||
COSTable *cosTableItem;
|
||||
int cos_id=0;
|
||||
|
||||
cos_id = GetAccountCosID(shmp)%MaxCosTableItem;
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cos_id];
|
||||
|
||||
return cosTableItem->tariff[0].promotionUsedForRoDebit;
|
||||
}
|
||||
|
||||
BOOL isPromotionCanBeUsedAtThisPoint(_state_data *shmp)
|
||||
{
|
||||
COSTable *cosTableItem;
|
||||
int cos_id=0;
|
||||
promotion_plan_control *pPromotionControl;
|
||||
u8 serviceType,call_type;
|
||||
|
||||
cos_id = GetAccountCosID(&shmp->caller_info)%MaxCosTableItem;
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cos_id];
|
||||
pPromotionControl = &cosTableItem->tariff[0].promotionUseControl;
|
||||
|
||||
serviceType = shmp->context_info.callType;
|
||||
switch(serviceType)
|
||||
{
|
||||
case CT_MO_CALL:
|
||||
call_type = shmp->process_info.tariff.call_type;
|
||||
switch(call_type)
|
||||
{
|
||||
case MO_LOCAL:
|
||||
return pPromotionControl->usedForCall.LOCAL;
|
||||
break;
|
||||
case MO_NDD:
|
||||
return pPromotionControl->usedForCall.NDD;
|
||||
break;
|
||||
case MO_IDD:
|
||||
return pPromotionControl->usedForCall.IDD;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CT_MO_SM:
|
||||
call_type = shmp->process_info.smsTariff.call_type;
|
||||
switch(call_type)
|
||||
{
|
||||
case MO_LOCAL:
|
||||
return pPromotionControl->usedForSMS.LOCAL;
|
||||
break;
|
||||
case MO_NDD:
|
||||
return pPromotionControl->usedForSMS.NDD;
|
||||
break;
|
||||
case MO_IDD:
|
||||
return pPromotionControl->usedForSMS.IDD;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case CT_GPRS:
|
||||
return pPromotionControl->usedForGPRS.allowed;
|
||||
break;
|
||||
case CT_RO_DEBIT:
|
||||
return cosTableItem->tariff[0].promotionUsedForRoDebit;
|
||||
break;
|
||||
default:
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL isPromotionCanBeTransfered(_account_info *accountInfo)
|
||||
{
|
||||
COSTable *cosTableItem;
|
||||
int cos_id=0;
|
||||
promotion_plan_control *pPromotionControl;
|
||||
|
||||
cos_id = GetAccountCosID(accountInfo)%MaxCosTableItem;
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cos_id];
|
||||
pPromotionControl = &cosTableItem->tariff[0].promotionUseControl;
|
||||
|
||||
return pPromotionControl->transfer.transfer;
|
||||
}
|
||||
|
||||
BOOL isPromotionFirstTransfered(_account_info *accountInfo)
|
||||
{
|
||||
COSTable *cosTableItem;
|
||||
int cos_id=0;
|
||||
promotion_plan_control *pPromotionControl;
|
||||
|
||||
cos_id = GetAccountCosID(accountInfo)%MaxCosTableItem;
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cos_id];
|
||||
pPromotionControl = &cosTableItem->tariff[0].promotionUseControl;
|
||||
|
||||
return pPromotionControl->transfer.transferPrioriy;
|
||||
}
|
||||
|
||||
|
||||
double GetBalanceWithPromotionControl(_state_data *stateProc,_account_info *ptr)
|
||||
{
|
||||
_prepaid_data *shmp=&ramshm_ptr->prepaid_data;
|
||||
double balance=0;
|
||||
|
||||
PutLogFunID("GetBalanceWithPromotionControl");
|
||||
|
||||
if (ptr->head < MSISDN_HEAD_NUM && ptr->tail < UNIT_STORE_ACCOUNT)
|
||||
{
|
||||
if(shmp->prepaid_info[ptr->head][ptr->tail].balance>=ppsParam.serviceControl.maxBalance)// balance overflow prevetion
|
||||
shmp->prepaid_info[ptr->head][ptr->tail].status = T_SUSPEND;
|
||||
if(shmp->prepaid_info[ptr->head][ptr->tail].msisdn[MAX_MSISDN_BLEN-1]<=2)// msisdn length field
|
||||
return 0;
|
||||
if(GetExpiration(ptr) > tvnow.tv_sec)// check validity date
|
||||
{
|
||||
balance = shmp->prepaid_info[ptr->head][ptr->tail].balance;
|
||||
}
|
||||
else
|
||||
pps_print_error(stateProc->process_info.logMsisdn,"[%05d]%s balance validity expired",stateProc->process_info.portid,ptr->number);
|
||||
if(isPromotionCanBeUsedAtThisPoint(stateProc))
|
||||
{
|
||||
if(GetPromotionExpiration(ptr)> tvnow.tv_sec)
|
||||
balance += shmp->prepaid_info[ptr->head][ptr->tail].promo_balance ;
|
||||
else
|
||||
; //pps_print_error(stateProc->process_info.logMsisdn,"[%05d]%s promotion validity expired",stateProc->process_info.portid,ptr->number);
|
||||
}
|
||||
return balance;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void supplementaryServiceChangeBasciFee(_state_data *shmp,_bill_tariff *ptar)
|
||||
{
|
||||
if(shmp->context_info.callType == CT_MF_CALL)
|
||||
{
|
||||
if(shmp->process_info.poolCall)
|
||||
{
|
||||
ChangeTariffToPoolCallTariff(shmp,ptar);
|
||||
#if DEBUG
|
||||
if((logMsgFlag & 0x02)|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"Pool call!");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
else if(shmp->process_info.cugCall)
|
||||
{
|
||||
if(shmp->process_info.favoriteCall)
|
||||
{
|
||||
ChangeTariffToCfCugFavTariff(shmp,ptar);
|
||||
#if DEBUG
|
||||
if((logMsgFlag & 0x02)|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"CF + CUG + Favorite call!");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeTariffToCfCugTariff(shmp,ptar);
|
||||
#if DEBUG
|
||||
if((logMsgFlag & 0x02)|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"CF + CUG call!");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
else if(shmp->process_info.favoriteCall)
|
||||
{
|
||||
ChangeTariffToCfFavTariff(shmp,ptar);
|
||||
#if DEBUG
|
||||
if((logMsgFlag & 0x02)|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"CF + Favorite call!");
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeTariffToCfTariff(shmp,ptar);
|
||||
#if DEBUG
|
||||
if((logMsgFlag & 0x02)|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"CF call!");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]CF service,replace basic fee with common fee",
|
||||
shmp->process_info.portid);
|
||||
}//MF CALL
|
||||
else if(shmp->context_info.callType == CT_MO_CALL)
|
||||
{
|
||||
if(shmp->process_info.poolCall)
|
||||
{
|
||||
ChangeTariffToPoolCallTariff(shmp,ptar);
|
||||
#if DEBUG
|
||||
if((logMsgFlag & 0x02)|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"Pool call!");
|
||||
}
|
||||
#endif
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]Pool call service,replace basic fee with common fee",
|
||||
shmp->process_info.portid);
|
||||
}
|
||||
else if(shmp->process_info.cugCall)
|
||||
{
|
||||
if(shmp->process_info.favoriteCall)
|
||||
{
|
||||
ChangeTariffToCugFavTariff(shmp,ptar);
|
||||
#if DEBUG
|
||||
if((logMsgFlag & 0x02)|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"CUG + Favorite call!");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeTariffToCugTariff(shmp,ptar);
|
||||
#if DEBUG
|
||||
if((logMsgFlag & 0x02)|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"CUG call!");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]CUG service,replace basic fee with common fee",
|
||||
shmp->process_info.portid);
|
||||
}
|
||||
else if(shmp->process_info.favoriteCall)
|
||||
{
|
||||
if(shmp->context_info.callType != CT_MT_CALL)
|
||||
{
|
||||
ChangeTariffToFavoriteCallTariff(shmp,ptar);//
|
||||
}
|
||||
#if DEBUG
|
||||
if((logMsgFlag & 0x02)|| shmp->process_info.logMsisdn)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"Favorite call!");
|
||||
}
|
||||
#endif
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]Favorite call service,replace basic fee with common fee",
|
||||
shmp->process_info.portid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(shmp->process_info.roamingFlag == 1)
|
||||
{
|
||||
if(shmp->context_info.callType == CT_MT_CALL)
|
||||
{
|
||||
ChangeTariffToMTRoamingTariff(shmp,ptar);
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]MT Roaming service,change basic fee with roaming fee,long fee",
|
||||
shmp->process_info.portid);
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeTariffToMORoamingTariff(shmp,ptar);
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]MO Roaming service,replace basic fee with common fee",
|
||||
shmp->process_info.portid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int getTierIndex(_state_data *shmp,_bill_tariff *ptar,u32 talkTime)
|
||||
{
|
||||
TIER_RATING *pTierRating;
|
||||
u8 tierNum,tierIndex;
|
||||
u32 tierAUnits,tierBUnits,tierCUnits;
|
||||
u32 duration,duration_units,tierCycle;
|
||||
int unit_time=60;
|
||||
|
||||
|
||||
pTierRating = &ptar->tierRating;
|
||||
tierNum = pTierRating->tierNumber;
|
||||
if ((unit_time = ptar->unit_time) <= 0)
|
||||
unit_time = 60;
|
||||
|
||||
if(talkTime >= ptar->free_time)
|
||||
duration = talkTime - ptar->free_time;
|
||||
else
|
||||
{
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]get tier index error,free time,no need to charge,use tier 0",
|
||||
shmp->process_info.portid);
|
||||
return BILL_TIER_PLAN_A;
|
||||
}
|
||||
|
||||
duration_units = duration / unit_time;
|
||||
switch(tierNum)
|
||||
{
|
||||
case BILL_TIERS_ONE:
|
||||
tierIndex = BILL_TIER_PLAN_A;
|
||||
break;
|
||||
case BILL_TIERS_TWO:
|
||||
tierAUnits = pTierRating->rating[BILL_TIER_PLAN_A].units;
|
||||
tierBUnits = pTierRating->rating[BILL_TIER_PLAN_B].units;
|
||||
if(tierAUnits == 0 || tierBUnits == 0)
|
||||
{
|
||||
tierIndex = BILL_TIER_PLAN_A;
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]get tier index,Tier level is 1,but the units of tier 0/1 is 0,only use tier 0",
|
||||
shmp->process_info.portid);
|
||||
}
|
||||
else
|
||||
{
|
||||
tierCycle = duration_units%(tierAUnits+tierBUnits);
|
||||
if(tierCycle >= tierAUnits)
|
||||
tierIndex = BILL_TIER_PLAN_B;
|
||||
else
|
||||
tierIndex = BILL_TIER_PLAN_A;
|
||||
}
|
||||
break;
|
||||
case BILL_TIERS_TRREE:
|
||||
tierAUnits = pTierRating->rating[BILL_TIER_PLAN_A].units;
|
||||
tierBUnits = pTierRating->rating[BILL_TIER_PLAN_B].units;
|
||||
tierCUnits = pTierRating->rating[BILL_TIER_PLAN_C].units;
|
||||
if(tierAUnits == 0 || tierBUnits == 0 ||tierCUnits == 0)
|
||||
{
|
||||
tierIndex = BILL_TIER_PLAN_A;
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]get tier index,Tier level is 2,but the units of tier 0/1/2 is 0,only use tier 0",
|
||||
shmp->process_info.portid);
|
||||
}
|
||||
else
|
||||
{
|
||||
tierCycle = duration_units%(tierAUnits+tierBUnits+tierCUnits);
|
||||
if(tierCycle >= (tierBUnits + tierAUnits))
|
||||
tierIndex = BILL_TIER_PLAN_C;
|
||||
else if(tierCycle >= tierAUnits)
|
||||
tierIndex = BILL_TIER_PLAN_B;
|
||||
else
|
||||
tierIndex = BILL_TIER_PLAN_A;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
tierIndex = BILL_TIER_PLAN_A;
|
||||
break;
|
||||
}
|
||||
return tierIndex;
|
||||
}
|
||||
|
||||
u_char getCurrentTier(_state_data *shmp,_bill_tariff *ptar)
|
||||
{
|
||||
u32 talkTime;
|
||||
|
||||
talkTime = shmp->process_info.duration/CYCLE_STATE_INTERVAL;
|
||||
return getTierIndex(shmp,ptar,talkTime);
|
||||
}
|
||||
|
||||
float getCurrentFee(_state_data *shmp)
|
||||
{
|
||||
u_char tier;
|
||||
TIER_RATING *pTierRating;
|
||||
_bill_tariff *ptar;
|
||||
|
||||
ptar = &shmp->process_info.tariff;
|
||||
tier = getCurrentTier(shmp,ptar);
|
||||
supplementaryServiceChangeBasciFee(shmp,ptar);
|
||||
pTierRating = &ptar->tierRating;
|
||||
return pTierRating->rating[tier].base_fee + pTierRating->rating[tier].long_distance_fee;
|
||||
}
|
||||
|
||||
float BillingFormula(_state_data *shmp,_bill_tariff *ptar,int startTime)
|
||||
{
|
||||
float num=0;
|
||||
u8 index;
|
||||
TIER_RATING *pTierRating;
|
||||
|
||||
PutLogFunID("BillingFormula");
|
||||
|
||||
pTierRating = &ptar->tierRating;
|
||||
|
||||
index = getTierIndex(shmp,ptar,startTime);
|
||||
supplementaryServiceChangeBasciFee(shmp,ptar);
|
||||
num = pTierRating->rating[index].base_fee + pTierRating->rating[index].long_distance_fee ;
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]current tier is %d,basic fee:%0.4f,long fee:%0.4f",
|
||||
shmp->process_info.portid,index,pTierRating->rating[index].base_fee,pTierRating->rating[index].long_distance_fee);
|
||||
return num;
|
||||
}
|
||||
|
||||
float TimeToCharge(_state_data *shmp,_bill_tariff *ptar, int duration,int begin_time, int init_bill)
|
||||
{
|
||||
int i=0,j=0;
|
||||
int discount=0;
|
||||
float charge=0;
|
||||
int itimes=0, unit_time=60, curr_time=0,startTime;
|
||||
int truncationFlag=0;
|
||||
|
||||
PutLogFunID("TimeToCharge");
|
||||
|
||||
if(duration<=0) return (charge = 0);
|
||||
if ((unit_time = ptar->unit_time) <= 0)
|
||||
unit_time = 60;
|
||||
itimes = (ceil)((double) duration / unit_time);
|
||||
startTime = shmp->process_info.duration/CYCLE_STATE_INTERVAL;
|
||||
|
||||
if(ppsParam.serviceControl.truncation_flag)
|
||||
{
|
||||
charge = BillingFormula(shmp,ptar,startTime);
|
||||
if(charge == floorf(charge))
|
||||
truncationFlag = 1;
|
||||
}
|
||||
charge = 0;
|
||||
for (i=1; i<=itimes; i++)
|
||||
{
|
||||
curr_time = begin_time + unit_time * (i - 1);
|
||||
if(OCS_with_external_CRM())//query tariff from CRM database
|
||||
discount = shmp->process_info.rest_if.tariff_discount;
|
||||
else
|
||||
discount = GetDiscount(curr_time,ptar->discountID);
|
||||
if (i <= ptar->mini_unit && (!init_bill))
|
||||
{
|
||||
for(j=0;j < ptar->mini_unit;j++)
|
||||
{
|
||||
charge += BillingFormula(shmp,ptar,startTime);
|
||||
startTime += unit_time;
|
||||
}
|
||||
i = ptar->mini_unit;
|
||||
}
|
||||
else
|
||||
{
|
||||
charge += BillingFormula(shmp,ptar,startTime);
|
||||
startTime += unit_time;
|
||||
}
|
||||
}
|
||||
|
||||
if(!init_bill)
|
||||
{
|
||||
charge = (charge + ptar->adjustment)*discount/100;
|
||||
}
|
||||
else
|
||||
{
|
||||
charge = (charge * discount)/100;
|
||||
}
|
||||
if(truncationFlag )
|
||||
return (floorf(charge));
|
||||
else
|
||||
return (charge);
|
||||
}
|
||||
|
||||
float caculateMiniCharge(_state_data *shmp,_bill_tariff *ptar)
|
||||
{
|
||||
float charge=0;
|
||||
int unit_time=60, curr_time=0,startTime,j;
|
||||
float discount;
|
||||
|
||||
charge = 0;
|
||||
curr_time = tvnow.tv_sec;
|
||||
if ((unit_time = ptar->unit_time) <= 0)
|
||||
unit_time = 60;
|
||||
startTime = shmp->process_info.duration/CYCLE_STATE_INTERVAL;
|
||||
discount = GetDiscount(curr_time,ptar->discountID)/100;
|
||||
for(j=0;j < ptar->mini_unit;j++)
|
||||
{
|
||||
charge += BillingFormula(shmp,ptar,startTime);
|
||||
startTime += unit_time;
|
||||
}
|
||||
return charge*discount;
|
||||
}
|
||||
|
||||
static int caculateLeftTime(_state_data *shmp,float balance,_bill_tariff *ptar)
|
||||
{
|
||||
float charge=0;
|
||||
int unit_time=60, curr_time=0,startTime;
|
||||
float discount;
|
||||
|
||||
charge = 0;
|
||||
curr_time = tvnow.tv_sec;
|
||||
if ((unit_time = ptar->unit_time) <= 0)
|
||||
unit_time = 60;
|
||||
startTime = shmp->process_info.duration/CYCLE_STATE_INTERVAL;
|
||||
discount = GetDiscount(curr_time,ptar->discountID)/100;
|
||||
if(discount <= 0)
|
||||
return MAX_CALL_DURATION;
|
||||
charge += BillingFormula(shmp,ptar,startTime);
|
||||
while((charge*discount) <= balance)
|
||||
{
|
||||
startTime += unit_time;
|
||||
curr_time += unit_time;
|
||||
charge += BillingFormula(shmp,ptar,startTime);
|
||||
}
|
||||
return curr_time - tvnow.tv_sec;
|
||||
}
|
||||
|
||||
int preLeftTime(_state_data *shmp,float balance,_bill_tariff *ptar)
|
||||
{
|
||||
TIER_RATING *pTierRating;
|
||||
TIER_INFO *pTierInfo;
|
||||
u8 tierNum;
|
||||
u32 tierAUnits,tierBUnits,tierCUnits,S_UNITS_CYCLE;
|
||||
float tierA_V_perUnit,tierB_V_perUnit,tierC_V_perUnit,units;
|
||||
long double S_V_CYLCE;
|
||||
int unit_time=60,cycleTimes;
|
||||
float maxDuration;
|
||||
float discount;
|
||||
|
||||
pTierRating = &ptar->tierRating;
|
||||
tierNum = pTierRating->tierNumber;
|
||||
if ((unit_time = ptar->unit_time) <= 0)
|
||||
unit_time = 60;
|
||||
|
||||
discount = GetDiscount(tvnow.tv_sec,ptar->discountID)*1.0/100;
|
||||
if(discount <= 0.0001)
|
||||
return MAX_CALL_DURATION;
|
||||
|
||||
switch(tierNum)
|
||||
{
|
||||
case BILL_TIERS_TWO:
|
||||
pTierInfo = &pTierRating->rating[BILL_TIER_PLAN_A];
|
||||
tierA_V_perUnit = pTierInfo->base_fee + pTierInfo->long_distance_fee;
|
||||
tierAUnits = pTierInfo->units;
|
||||
pTierInfo = &pTierRating->rating[BILL_TIER_PLAN_B];
|
||||
tierB_V_perUnit = pTierInfo->base_fee + pTierInfo->long_distance_fee;
|
||||
tierBUnits = pTierInfo->units;
|
||||
|
||||
S_V_CYLCE = tierA_V_perUnit*tierAUnits + tierB_V_perUnit*tierBUnits;
|
||||
if( S_V_CYLCE <= 0)
|
||||
return MAX_CALL_DURATION;
|
||||
if(tierAUnits == 0 || tierBUnits == 0)
|
||||
{
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]Pre time,Tier level is 1,but the units of tier 0/1 is 0,only use tier 0",
|
||||
shmp->process_info.portid);
|
||||
break;
|
||||
}
|
||||
S_UNITS_CYCLE = tierAUnits + tierBUnits;
|
||||
cycleTimes = balance/(discount*S_V_CYLCE);
|
||||
|
||||
maxDuration = cycleTimes*S_UNITS_CYCLE*unit_time;
|
||||
if(maxDuration < MAX_CALL_DURATION)
|
||||
{
|
||||
maxDuration = caculateLeftTime(shmp,balance,ptar);
|
||||
}
|
||||
return maxDuration;
|
||||
break;
|
||||
case BILL_TIERS_TRREE:
|
||||
pTierInfo = &pTierRating->rating[BILL_TIER_PLAN_A];
|
||||
tierA_V_perUnit = pTierInfo->base_fee + pTierInfo->long_distance_fee;
|
||||
tierAUnits = pTierInfo->units;
|
||||
pTierInfo = &pTierRating->rating[BILL_TIER_PLAN_B];
|
||||
tierB_V_perUnit = pTierInfo->base_fee + pTierInfo->long_distance_fee;
|
||||
tierBUnits = pTierInfo->units;
|
||||
pTierInfo = &pTierRating->rating[BILL_TIER_PLAN_C];
|
||||
tierC_V_perUnit = pTierInfo->base_fee + pTierInfo->long_distance_fee;
|
||||
tierCUnits = pTierInfo->units;
|
||||
|
||||
S_V_CYLCE = tierA_V_perUnit*tierAUnits + tierB_V_perUnit*tierBUnits + tierC_V_perUnit*tierCUnits;
|
||||
if( S_V_CYLCE <= 0)
|
||||
return MAX_CALL_DURATION;
|
||||
if(tierAUnits == 0 || tierBUnits == 0 || tierCUnits == 0 )
|
||||
{
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]Pre time,Tier level is 2,but the units of tier 0/1/2 is 0,only use tier 0",
|
||||
shmp->process_info.portid);
|
||||
break;
|
||||
}
|
||||
S_UNITS_CYCLE = tierAUnits + tierBUnits + tierCUnits;
|
||||
cycleTimes = balance/(discount*S_V_CYLCE);
|
||||
|
||||
maxDuration = cycleTimes*S_UNITS_CYCLE*unit_time;
|
||||
if(maxDuration < MAX_CALL_DURATION)
|
||||
{
|
||||
maxDuration = caculateLeftTime(shmp,balance,ptar);
|
||||
}
|
||||
return maxDuration;
|
||||
break;
|
||||
}
|
||||
|
||||
pTierInfo = &pTierRating->rating[BILL_TIER_PLAN_A];
|
||||
tierA_V_perUnit = pTierInfo->base_fee + pTierInfo->long_distance_fee;
|
||||
|
||||
if( tierA_V_perUnit <= 0)
|
||||
return MAX_CALL_DURATION;
|
||||
|
||||
units = (floorf)(balance/(discount*tierA_V_perUnit));
|
||||
maxDuration = units*unit_time;
|
||||
|
||||
return maxDuration;
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user