ocs init
This commit is contained in:
31
mss/pps/Makefile
Normal file
31
mss/pps/Makefile
Normal file
@@ -0,0 +1,31 @@
|
||||
all:
|
||||
@cd ./src/lib; make; cd ..; cd ..
|
||||
@cd ./src/main; make; cd ..; cd ..
|
||||
@cd ./src/object; make; cp libpps.a ../../lib; cd ..; cd ..
|
||||
|
||||
cook_island:
|
||||
@cd ./src/lib; make; cd ..; cd ..
|
||||
@cd ./src/main; make -f Cook_Makefile; cd ..; cd ..
|
||||
@cd ./src/object; make; cp libpps.a ../../lib; cd ..; cd ..
|
||||
|
||||
zed_mobile:
|
||||
@cd ./src/lib; make; cd ..; cd ..
|
||||
@cd ./src/main; make -f Zed_Makefile; cd ..; cd ..
|
||||
@cd ./src/object; make; cp libpps.a ../../lib; cd ..; cd ..
|
||||
|
||||
rdb_tariff:
|
||||
@cd ./src/lib; make; cd ..; cd ..
|
||||
@cd ./src/main; make -f Rdb_Makefile; cd ..; cd ..
|
||||
@cd ./src/object; make; cp libpps.a ../../lib; cd ..; cd ..
|
||||
|
||||
clean:
|
||||
@cd ./src/lib; make clean; cd ..; cd ..
|
||||
@cd ./src/main; make clean; cd ..; cd ..
|
||||
@cd ./src/object; make clean; cd ..; cd ..
|
||||
@cd ./lib; rm -f libpps.a; cd ..
|
||||
|
||||
touch:
|
||||
@cd ./src/lib; touch *.c; cd ..; cd ..
|
||||
@cd ./src/main; touch *.c; cd ..; cd ..
|
||||
|
||||
rebuild: clean all
|
||||
16
mss/pps/build_redis.txt
Normal file
16
mss/pps/build_redis.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
1)ppsm.h: #define OCS_USE_REDIS_DB 1
|
||||
2)pps/src/main/Makefile
|
||||
pps_OBJ = ... pps_redis.o
|
||||
pps_redis.o:pps_redis.c
|
||||
$(COMPILE.c) -c pps_redis.c $(INCLUDES)
|
||||
3)pps/src/object/makefile
|
||||
ar r ... pps_redis.o
|
||||
4)mss/main/Makefile
|
||||
-lhiredis
|
||||
|
||||
5)gnutls版本不兼容,因为diameter没有用到tls,所以注释掉这几行tls代码;
|
||||
../../plat/diameter/lib//libdiameter.a(config.o): In function `fd_conf_parse':
|
||||
/root/build/OCS_CRM/plat/diameter/libfdcore/config.c:473: undefined reference to `gnutls_certificate_get_x509_cas'
|
||||
/root/build/OCS_CRM/plat/diameter/libfdcore/config.c:474: undefined reference to `gnutls_certificate_get_x509_crls'
|
||||
../../plat/diameter/lib//libdiameter.a(sctp3436.o): In function `set_sess_transport':
|
||||
/root/build/OCS_CRM/plat/diameter/libfdcore/sctp3436.c:284: undefined reference to `gnutls_transport_set_lowat'
|
||||
18
mss/pps/src/include/Makefile.am
Normal file
18
mss/pps/src/include/Makefile.am
Normal file
@@ -0,0 +1,18 @@
|
||||
##
|
||||
## PACS-WLL 2000 project, Prepaid System.
|
||||
##
|
||||
## module Copyright (C) 2000-2001 interWAVE Inc.
|
||||
## Written completely by Zhang Shuzhong at iCRD February, 2001
|
||||
##
|
||||
## file name: Makefile.am
|
||||
## CVS $Id: Makefile.am,v 1.1 2001/06/28 07:21:15 zhangsz Exp $
|
||||
##
|
||||
## Process this file with automake to create Makefile.in
|
||||
##
|
||||
|
||||
noinst_HEADERS = cdrme.h beat.h ppsm.h ppsinf.h \
|
||||
includes.h public.h function.h \
|
||||
iptrans.h sqlfunc.h debug.h \
|
||||
errlog.h config.h logfunc.h crypt.h version.h mfunc.h \
|
||||
ramdata.h message.h tariff.h ppsoid.h ppcron.h \
|
||||
iofunc.h ppscsta.h
|
||||
236
mss/pps/src/include/Makefile.in
Normal file
236
mss/pps/src/include/Makefile.in
Normal file
@@ -0,0 +1,236 @@
|
||||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
CC = @CC@
|
||||
CHMOD = @CHMOD@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MV = @MV@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@
|
||||
SED = @SED@
|
||||
VERSION = @VERSION@
|
||||
|
||||
noinst_HEADERS = cdrme.h beat.h ppsm.h ppsinf.h includes.h public.h function.h iptrans.h sqlfunc.h debug.h errlog.h config.h logfunc.h crypt.h version.h mfunc.h ramdata.h message.h tariff.h ppsoid.h ppcron.h iofunc.h ppscsta.h
|
||||
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
|
||||
DIST_COMMON = ./stamp-h.in Makefile.am Makefile.in acconfig.h \
|
||||
config.h.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps include/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
config.h: stamp-h
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h; \
|
||||
$(MAKE) stamp-h; \
|
||||
else :; fi
|
||||
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES= CONFIG_HEADERS=include/config.h \
|
||||
$(SHELL) ./config.status
|
||||
@echo timestamp > stamp-h 2> /dev/null
|
||||
$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
|
||||
@if test ! -f $@; then \
|
||||
rm -f $(srcdir)/stamp-h.in; \
|
||||
$(MAKE) $(srcdir)/stamp-h.in; \
|
||||
else :; fi
|
||||
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
|
||||
|
||||
mostlyclean-hdr:
|
||||
|
||||
clean-hdr:
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
|
||||
maintainer-clean-hdr:
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = include
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am:
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(HEADERS) config.h
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
|
||||
tags mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \
|
||||
distdir info-am info dvi-am dvi check check-am installcheck-am \
|
||||
installcheck all-recursive-am install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
98
mss/pps/src/include/acconfig.h
Normal file
98
mss/pps/src/include/acconfig.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Define if you have __FILE__ macro */
|
||||
#undef HAVE_FILE_MACRO
|
||||
|
||||
/* Define if you have __FUNCTION__ macro */
|
||||
#undef HAVE_FUNCTION_MACRO
|
||||
|
||||
/* Define if you have __LINE__ macro */
|
||||
#undef HAVE_LINE_MACRO
|
||||
|
||||
/* Define if you have __DATE__ macro */
|
||||
#undef HAVE_DATE_MACRO
|
||||
|
||||
/* Define if you have __TIME__ macro */
|
||||
#undef HAVE_TIME_MACRO
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
#undef HAVE_SOCKET
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <syslog.h> header file. */
|
||||
#undef HAVE_SYSLOG_H
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
81
mss/pps/src/include/callingCard.h
Normal file
81
mss/pps/src/include/callingCard.h
Normal file
@@ -0,0 +1,81 @@
|
||||
#ifndef _CALLINGCARD_H
|
||||
|
||||
#define _CALLINGCARD_H
|
||||
|
||||
#include "voiceID.h"
|
||||
|
||||
enum _CALLING_CARD_OPERATION
|
||||
{
|
||||
ExitCallingCard = 0,
|
||||
MakeCall = 1,
|
||||
InquiryBlance,
|
||||
RechargeAccout,
|
||||
ChangePassword,
|
||||
TransferAccount
|
||||
};
|
||||
|
||||
|
||||
#ifndef pin_mng_keep_state_value
|
||||
#define pin_mng_keep_state_value
|
||||
typedef enum pin_mng_retval
|
||||
{
|
||||
pin_mng_keep_state = 0,
|
||||
pin_mng_exit,
|
||||
pin_mng_exit_to_main_menu,
|
||||
}_pin_mng_retval;
|
||||
#endif
|
||||
|
||||
enum callingCardMainState
|
||||
{
|
||||
entryCallingCard = 0,
|
||||
sendMainMenu,
|
||||
chooseFunction,
|
||||
runFunction,
|
||||
exitCallingCardSys
|
||||
};
|
||||
|
||||
enum entryCallingCardState
|
||||
{
|
||||
callingCardIdle = 0,
|
||||
returnMainMenu,
|
||||
inputCallingCardAccount = 2,
|
||||
waitForCallingCardAccount,
|
||||
inputCallingCardAccountPassword,
|
||||
checkCallingCardAccountPassword,
|
||||
entrySuccess
|
||||
};
|
||||
|
||||
enum makeCallState
|
||||
{
|
||||
requireInputCalledNumber = 2,
|
||||
waitForCalledNumber,
|
||||
requireRouteCalled,
|
||||
waitSpecialResourceReport,
|
||||
waitForRouteResult,
|
||||
};
|
||||
|
||||
enum rechargeAccountState
|
||||
{
|
||||
rechargeAccount = 2
|
||||
};
|
||||
|
||||
enum inquiryAccountSate
|
||||
{
|
||||
inquiryAccount = 2
|
||||
};
|
||||
|
||||
enum transferAccountState
|
||||
{
|
||||
inputTransferOutAccount = 2,
|
||||
waitForInputTransferOutAccount,
|
||||
inputTransferOutAccountPassword,
|
||||
waitForInputTransferOutAccountPassword,
|
||||
checkTransferOutAccountPassword,
|
||||
transferToCurrentAccount,
|
||||
transferSuccess,
|
||||
transferFail
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
144
mss/pps/src/include/cdrme.h
Normal file
144
mss/pps/src/include/cdrme.h
Normal file
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
**
|
||||
**
|
||||
** file name: cdrme.h
|
||||
**
|
||||
** Defination for CDR(call detail record) management entity (cdrme.c).
|
||||
*/
|
||||
|
||||
#ifndef CDRME__H
|
||||
#define CDRME__H
|
||||
|
||||
#include "report.h"
|
||||
|
||||
#define MO_CDR_TYPE 0x00
|
||||
#define MT_CDR_TYPE 0x01
|
||||
#define SC_CDR_TYPE 0x02// selfcare cdr
|
||||
#define MAX_CDR_LEN 8192
|
||||
#define MAX_CSTA_LEN 96
|
||||
|
||||
typedef struct _tocdr_record {
|
||||
char mtype[2];
|
||||
char type[4];
|
||||
char imsi[16];
|
||||
char msisdn[18];
|
||||
char msrn[18];
|
||||
char caller[18];
|
||||
char called[24];
|
||||
char re[16];
|
||||
char intkgp[6];
|
||||
char outkgp[6];
|
||||
char lac[10];
|
||||
char bs[4];
|
||||
char ss[4];
|
||||
char mobclassmark[16];
|
||||
char seizuretime[18];
|
||||
char answertime[18];
|
||||
char releasetime[18];
|
||||
char duration[8];
|
||||
char tcos[4];
|
||||
char ssa[4];
|
||||
char ssparam[16];
|
||||
char ssr[4];
|
||||
char cr[4];
|
||||
char rcu[2];
|
||||
char charge[8];
|
||||
char balance[8];
|
||||
} _tocdr_record;
|
||||
|
||||
typedef struct _tocdr_report {
|
||||
u_long squence;
|
||||
BYTE mtype;
|
||||
BYTE type[2];
|
||||
BYTE imsi[8];
|
||||
BYTE msisdn[9];
|
||||
BYTE msrn[9];
|
||||
BYTE caller[9];
|
||||
BYTE called[12];
|
||||
BYTE re[8];
|
||||
BYTE intkgp[3];
|
||||
BYTE outkgp[3];
|
||||
BYTE lac[5];
|
||||
BYTE bs[2];
|
||||
BYTE ss[2];
|
||||
BYTE mobclassmark[8];
|
||||
BYTE seizuretime[9];
|
||||
BYTE answertime[9];
|
||||
BYTE releasetime[9];
|
||||
BYTE duration[4];
|
||||
BYTE tcos[2];
|
||||
BYTE ssa[2];
|
||||
BYTE ssparam[8];
|
||||
BYTE ssr[2];
|
||||
BYTE cr[2];
|
||||
BYTE rcu;
|
||||
BYTE charge[4];
|
||||
BYTE balance[4];
|
||||
BYTE cos_id;
|
||||
BYTE gprsSgsnIP[64];
|
||||
BYTE gprsGgsnIP[64];
|
||||
BYTE gprsDestIP[64];
|
||||
BYTE gprsVolume[4];
|
||||
BYTE peerAddress[128];
|
||||
BYTE plan_id[4];
|
||||
} _tocdr_report;
|
||||
|
||||
/*
|
||||
typedef struct _pps_cdr_buffer{
|
||||
u_short pReadSub;
|
||||
u_short pWriteSub;
|
||||
_tocdr_report cdr_record[MAX_CDR_LEN];
|
||||
u_char flag[MAX_CDR_LEN];
|
||||
}_pps_cdr_buffer;
|
||||
*/
|
||||
typedef struct _pps_cdr_buffer{
|
||||
u_short pReadSub;
|
||||
u_short pWriteSub;
|
||||
u_char flag[MAX_CDR_LEN];
|
||||
u_char cdrMsg[MAX_CDR_LEN][256]; /* byte0=len; byte1-255=msg */
|
||||
}_pps_cdr_buffer;
|
||||
|
||||
|
||||
#define PPS_CSTA_TYPES MAX_SERVICE_TYPE //MAX_CALL_TYPE
|
||||
#define PPS_CSTA_TYPE_BASE 100
|
||||
typedef struct _pps_csta_items
|
||||
{
|
||||
long number;
|
||||
long charge;
|
||||
long duration;
|
||||
long gprsVolume;
|
||||
}_pps_csta_items;
|
||||
|
||||
typedef struct _pps_vas_csta_items
|
||||
{
|
||||
u_long smsNumber;
|
||||
long smsCharge;
|
||||
u_long mmsSendNumber;
|
||||
long mmsSendCharge;
|
||||
u_long mmsRetrieveNumber;
|
||||
long mmsRetrieveCharge;
|
||||
u_long mmsEmailNumber;
|
||||
long mmsEmailCharge;
|
||||
}_pps_vas_csta_items;
|
||||
|
||||
typedef struct _pps_csta_record
|
||||
{
|
||||
u_long timestamp;
|
||||
_pps_csta_items csta_type[PPS_CSTA_TYPES];
|
||||
_pps_csta_items gprsCsta;
|
||||
_pps_vas_csta_items vasCsta;
|
||||
}_pps_csta_record;
|
||||
|
||||
typedef struct _pps_csta_buffer
|
||||
{
|
||||
_pps_csta_record csta_record[MAX_CSTA_LEN];
|
||||
}_pps_csta_buffer;
|
||||
|
||||
// fix multiple definition====================================
|
||||
extern _pps_cdr_buffer pps_cdr_buffer;
|
||||
extern _pps_csta_buffer pps_csta_buffer;
|
||||
//
|
||||
|
||||
int encodePPS_MO_CDR(_tocdr_report *pcdr,u_char *pdata);
|
||||
int encodePPS_MT_CDR(_tocdr_report *pcdr,u_char *pdata);
|
||||
#endif /* CDRME__H */
|
||||
126
mss/pps/src/include/config.h
Normal file
126
mss/pps/src/include/config.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/* include/config.h. Generated automatically by configure. */
|
||||
/* include/config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef pid_t */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
/* #undef TM_IN_SYS_TIME */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef pid_t */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
/* #undef TM_IN_SYS_TIME */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
/* #undef pid_t */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
/* #undef TM_IN_SYS_TIME */
|
||||
|
||||
/* Define if you have __FILE__ macro */
|
||||
#define HAVE_FILE_MACRO 1
|
||||
|
||||
/* Define if you have __FUNCTION__ macro */
|
||||
#define HAVE_FUNCTION_MACRO 1
|
||||
|
||||
/* Define if you have __LINE__ macro */
|
||||
#define HAVE_LINE_MACRO 1
|
||||
|
||||
/* Define if you have __DATE__ macro */
|
||||
#define HAVE_DATE_MACRO 1
|
||||
|
||||
/* Define if you have __TIME__ macro */
|
||||
#define HAVE_TIME_MACRO 1
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define if you have the <syslog.h> header file. */
|
||||
#define HAVE_SYSLOG_H 1
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
#define HAVE_TERMIO_H 1
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "prepaid"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "1.0.04"
|
||||
|
||||
34
mss/pps/src/include/crd.h
Normal file
34
mss/pps/src/include/crd.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef _CRD_H
|
||||
#define _CRD_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
typedef enum _routeMethod
|
||||
{
|
||||
ByPrefix = 0,
|
||||
ByWholeNumber
|
||||
}routeMethod;
|
||||
|
||||
typedef enum _NumberMethod
|
||||
{
|
||||
ByCaller = 0,
|
||||
ByCalled
|
||||
}NumberMethod;
|
||||
|
||||
/* call re-direct */
|
||||
|
||||
#define MAX_DIGITS_LEN 16
|
||||
|
||||
|
||||
int IsCRDServiceNumber(char *number);
|
||||
/* retval=0/1, no/yes */
|
||||
|
||||
int IsPostpaidAllowed();
|
||||
/* retval=0/1, no/yes */
|
||||
|
||||
int GetCRDDestination(char *src_number, char *dst_number,u_char type);
|
||||
int CheckCRDRingBackServiceKey(int serviceKey);
|
||||
/* retval=0/1, not find/find match destination */
|
||||
|
||||
#endif
|
||||
110
mss/pps/src/include/debug.h
Normal file
110
mss/pps/src/include/debug.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
**
|
||||
** file name: debug.h
|
||||
**
|
||||
** The debug information defination.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef DEBUG__H
|
||||
#define DEBUG__H
|
||||
#include "config.h"
|
||||
|
||||
void
|
||||
DebugMsg(void *ptr, const char *fmt, ...);
|
||||
void
|
||||
DebugRet(void *ptr, const char *fmt, ...);
|
||||
void
|
||||
DebugMsgDelimiter();
|
||||
BOOL
|
||||
WriteDebugMsg(void *dest, const void *src);
|
||||
#define DebugFlag(shmp) \
|
||||
DebugMsg(shmp, "%s: %s: %d", FILE_MACRO, FUNCTION_MACRO, LINE_MACRO)
|
||||
|
||||
#define WriteContentToDebugBuffer(shmp, buf, bcd_buf, nbytes) \
|
||||
BcdToAscii(buf, bcd_buf, 2 * nbytes); \
|
||||
DebugMsg(shmp, "packets contains (%s):\n%s", FUNCTION_MACRO, buf);
|
||||
|
||||
#define WriteSendMessageToDebugBuffer(shmp, pbuf) \
|
||||
DebugMsg(shmp, "=================================================="); \
|
||||
DebugMsg(shmp,"Send packet to %s %d Length=%d", \
|
||||
Inet_ntoa(pbuf->msgDstIP), pbuf->msgDstPort, \
|
||||
pbuf->msgLength); \
|
||||
gettimeofday(&tv, NULL); \
|
||||
DebugMsg(shmp,"Current time: %s (%ld.%06ld)", \
|
||||
CharTime(buf, &tv.tv_sec), tv.tv_sec, tv.tv_usec); \
|
||||
DebugMsg(shmp, "packets contains (%s):", FUNCTION_MACRO); \
|
||||
BcdToAscii(buf, pbuf->msgContent, 2*pbuf->msgLength); \
|
||||
FormatOutput(buf, 2*pbuf->msgLength, 2, ' '); \
|
||||
DebugMsg(shmp, "%s", buf); \
|
||||
DebugMsg(shmp,"=========04==========08==========12==========16==========20==========24========="); \
|
||||
|
||||
#define WriteRecvMessageToDebugBuffer(shmp, pbuf) \
|
||||
DebugMsg(shmp,"=================================================="); \
|
||||
DebugMsg(shmp,"Got packet from %s %d Length=%d", \
|
||||
Inet_ntoa(pbuf->msgSrcIP), pbuf->msgSrcPort, \
|
||||
pbuf->msgLength); \
|
||||
gettimeofday(&tv, NULL); \
|
||||
DebugMsg(shmp,"Current time: %s (%ld.%06ld)", \
|
||||
CharTime(buf, &tv.tv_sec), tv.tv_sec, tv.tv_usec); \
|
||||
DebugMsg(shmp, "packets contains (%s):", FUNCTION_MACRO); \
|
||||
BcdToAscii(buf, pbuf->msgContent, 2*pbuf->msgLength); \
|
||||
FormatOutput(buf, 2*pbuf->msgLength, 2, ' '); \
|
||||
DebugMsg(shmp, "%s", buf); \
|
||||
DebugMsg(shmp,"=========04==========08==========12==========16==========20==========24========="); \
|
||||
|
||||
#define UNDER_DEVELOP 0
|
||||
#define DEBUG 1
|
||||
|
||||
#define D_NO_DEBUG 0
|
||||
#define D_CONSOLE_ONLY 1
|
||||
#define D_LOG_ONLY 2
|
||||
#define D_CONSOLE_LOG 3
|
||||
#define D_SYSLOG_MODE 4
|
||||
|
||||
#define SCAN_IT_INTERVAL_SEC 0
|
||||
#define SCAN_IT_INTERVAL_USEC (20*1000)
|
||||
#define SCAN_IT_VALUE_SEC 0
|
||||
#define SCAN_IT_VALUE_USEC (20*1000)
|
||||
|
||||
/* If we have these macros, we can add additional info to the header. */
|
||||
#ifdef HAVE_FILE_MACRO
|
||||
#define FILE_MACRO (__FILE__)
|
||||
#else
|
||||
#define FILE_MACRO ("")
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FUNCTION_MACRO
|
||||
#define FUNCTION_MACRO (__FUNCTION__)
|
||||
#else
|
||||
#define FUNCTION_MACRO ("")
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DATE_MACRO
|
||||
#define DATE_MACRO (__DATE__)
|
||||
#else
|
||||
#define DATE_MACRO ("")
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TIME_MACRO
|
||||
#define TIME_MACRO (__TIME__)
|
||||
#else
|
||||
#define TIME_MACRO ("")
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINE_MACRO
|
||||
#define LINE_MACRO (__LINE__)
|
||||
#else
|
||||
#define LINE_MACRO ("")
|
||||
#endif
|
||||
|
||||
// Buffer stored by debug information
|
||||
#define DEBUG_BUFFER_LINE (25*16)
|
||||
#define DEBUG_LINE_LEN (80)
|
||||
typedef struct {
|
||||
u_short subRead;
|
||||
u_short subWrite;
|
||||
u_char infoDebug[DEBUG_BUFFER_LINE][DEBUG_LINE_LEN];
|
||||
} _debug_info;
|
||||
|
||||
#endif /* DEBUG__H */
|
||||
40
mss/pps/src/include/errlog.h
Normal file
40
mss/pps/src/include/errlog.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
** Error and log proccess functions header file,
|
||||
** to be included *after* all standard system headers
|
||||
**
|
||||
** CVS: $Id: errlog.h,v 1.1 2001/06/28 07:21:15 zhangsz Exp $
|
||||
*/
|
||||
|
||||
#ifndef ERRLOG__H
|
||||
#define ERRLOG__H
|
||||
|
||||
#include <sys/types.h> /* required for some of our prototypes */
|
||||
#include <stdio.h> /* for convenience */
|
||||
#include <stdlib.h> /* for convenience */
|
||||
#include <string.h> /* for convenience */
|
||||
#include <unistd.h> /* for convenience */
|
||||
|
||||
|
||||
/* default file access permissions for new files */
|
||||
#define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
|
||||
|
||||
/* default permissions for new directories */
|
||||
#define DIR_MODE (FILE_MODE | S_IXUSR | S_IXGRP | S_IXOTH)
|
||||
|
||||
#define log_flag() \
|
||||
log_debug("%s: %s: %d", FILE_MACRO, FUNCTION_MACRO, LINE_MACRO)
|
||||
|
||||
void err_dump(const char *, ...); /* {App misc_source} */
|
||||
void err_msg(const char *, ...);
|
||||
void err_quit(const char *, ...);
|
||||
void err_ret(const char *, ...);
|
||||
void err_sys(const char *, ...);
|
||||
|
||||
void log_debug(const char *, ...); /* {App misc_source} */
|
||||
void log_msg(const char *, ...); /* {App misc_source} */
|
||||
void log_open(const char *, int, int);
|
||||
void log_quit(const char *, ...);
|
||||
void log_sys(const char *, ...);
|
||||
void log_ret(const char *, ...);
|
||||
|
||||
#endif /* ERRLOG__H */
|
||||
235
mss/pps/src/include/function.h
Normal file
235
mss/pps/src/include/function.h
Normal file
@@ -0,0 +1,235 @@
|
||||
/*
|
||||
**
|
||||
** function.h
|
||||
**
|
||||
** Description: Header file of function definations.
|
||||
*/
|
||||
|
||||
#ifndef _PPS_FUNCTION__H
|
||||
#define _PPS_FUNCTION__H
|
||||
|
||||
#define GetAsciiTime GetASCTime
|
||||
|
||||
char *
|
||||
NstrCrypt(char *sp);
|
||||
|
||||
#define LogContent(fp, buf, bcd_buf, nbytes) \
|
||||
BcdToAscii(buf, bcd_buf, 2 * nbytes); \
|
||||
FormatOutput(buf, 2*nbytes, 2, ' '); \
|
||||
LogMsg(fp, "packets contains (%s):\n%s", FUNCTION_MACRO, buf);
|
||||
|
||||
#define DisplayContent(buf, bcd_buf, nbytes) \
|
||||
BcdToAscii(buf, bcd_buf, 2 * nbytes); \
|
||||
FormatOutput(buf, 2*nbytes, 2, ' '); \
|
||||
log_debug("packets contains (%s):\n%s", FUNCTION_MACRO, buf);
|
||||
|
||||
#define BzeroContent(content, length) \
|
||||
bzero(content+length, MAX_CONTENT_LEN-length);
|
||||
|
||||
int InitDaemon(void); /* Initialize a daemon process */
|
||||
|
||||
void
|
||||
SetTermSignal(struct termio *ptermio, void (*handler)(int));
|
||||
|
||||
void
|
||||
SetFaultSignal(void (*handler)(int));
|
||||
|
||||
void
|
||||
SetRefreshSignal(struct termio *ptermio, void (*handler)(int));
|
||||
|
||||
/* Initialize a daemon process */
|
||||
void DaemonInit(const char *pname, int);
|
||||
|
||||
/* passive a socket handler, from comfunc.c */
|
||||
int passivesock( const char * transport, u_short portbase, int qlen);
|
||||
|
||||
/* passive a UDP socket handler, from comfunc.c */
|
||||
int passiveUDP(u_short portbase);
|
||||
|
||||
/* Fill string 'c' into last area of 'str'. */
|
||||
void StringCat(char *str, char *c, int slen);
|
||||
|
||||
int ByteLength(BYTE *bcd, int c);
|
||||
|
||||
/* Cut string while match character c. */
|
||||
void StringCut(char *str, int c);
|
||||
|
||||
void Bstr2Hstr(char *cptr);
|
||||
|
||||
void bitstring(char *str, long byze, int biz, int strwid);
|
||||
|
||||
/* Binary string convert to int. */
|
||||
unsigned int Bstr2Int(char *cptr);
|
||||
|
||||
/* Hex string convert to int. */
|
||||
unsigned int Hstr2Int(char *cptr);
|
||||
|
||||
/* Get current hour */
|
||||
int gethour(char *hour_buf);
|
||||
int getweek(char *week_buf);
|
||||
void getdate(char *date_buf);
|
||||
int getmon(char *mon_buf);
|
||||
int getday(char *day_buf);
|
||||
int getyear(char *year_buf);
|
||||
int getmin(char *min_buf);
|
||||
int getsec(char *sec_buf);
|
||||
|
||||
/* Get current hour */
|
||||
int getmin(char * min_buf);
|
||||
|
||||
/* Convert data from ASCII form to left-aligned compact BCD form. */
|
||||
void AsciiToBcd (BYTE *bcd_buf, const char *ascii_buf, int len);
|
||||
|
||||
/* Convert data from left-aligned compact BCD form to ASCII form. */
|
||||
void BcdToAscii (char *ascii_buf, const BYTE *bcd_buf, int len);
|
||||
|
||||
/* Convert data from ASCII form to right-aligned compact BCD form. */
|
||||
void AsciiToRbcd (BYTE *bcd_buf, const char *ascii_buf, int len);
|
||||
|
||||
const char *
|
||||
ppsgetdaytime(char *daytime_buf);
|
||||
|
||||
//char *GetASCTime(char *timep);
|
||||
char *CharTime(char *ptr, const time_t *timep);
|
||||
|
||||
void *
|
||||
ShmInit(int shm_id, char *prog_name, key_t key, int size, int shmflg);
|
||||
|
||||
int
|
||||
SemInit(char *prog_name, key_t key, int sem_num, int sem_flg);
|
||||
|
||||
BOOL
|
||||
SemLock(char *prog_name, int sem_id, int sem_num,
|
||||
unsigned nsops, int sem_flg);
|
||||
|
||||
BOOL
|
||||
SemUnlock(char *prog_name, int sem_id, int sem_num,
|
||||
unsigned nsops, int sem_flg);
|
||||
|
||||
BOOL
|
||||
ReadQueueMsg(void *dest, const void *src, int max_num);
|
||||
|
||||
BOOL
|
||||
WriteQueueMsg(void *dest, const void *src, int max_num);
|
||||
|
||||
BOOL
|
||||
ReadMsg(void *dest, void *src, int max_num);
|
||||
|
||||
BOOL
|
||||
WriteMsg(void *src, void *dest, int max_num);
|
||||
|
||||
BOOL
|
||||
WriteErrorLog(void *pbuf, void *perr, int max_num);
|
||||
|
||||
const char *
|
||||
Inet_ntoa(const long addr);
|
||||
|
||||
const long
|
||||
ppsInet_pton(const char *sp);
|
||||
|
||||
//const long
|
||||
//GetLocalIP(void);
|
||||
|
||||
char *
|
||||
FormatOutput(char *sp, size_t, int, int);
|
||||
|
||||
void
|
||||
ByteReverse(BYTE *p1, BYTE *p2, size_t size);
|
||||
|
||||
void
|
||||
SafeFree(void *pmem);
|
||||
|
||||
/* n is BYTE length */
|
||||
void
|
||||
GetAsciiField(char *dest, BYTE *src, size_t n);
|
||||
|
||||
#define SetAsciiField SetBcdField
|
||||
void
|
||||
SetBcdField(BYTE *dest, char *src, size_t n);
|
||||
|
||||
void
|
||||
SetIntField(BYTE *dest, int src, size_t n);
|
||||
|
||||
int
|
||||
GetIntField(int *i, BYTE *src, size_t n, int flag);
|
||||
|
||||
void
|
||||
StringRev(char *sp);
|
||||
|
||||
u_char *
|
||||
ByteRev(u_char *ptr, size_t size,int flag);
|
||||
|
||||
time_t
|
||||
MakeTime(struct tm *timep, char *ptr);
|
||||
|
||||
const char *
|
||||
AsciiTime(char *ptr, time_t);
|
||||
|
||||
void
|
||||
SetIntToNBO(u_char *dest, const long src);
|
||||
|
||||
void
|
||||
SetShortToNBO(u_char *dest, const short src);
|
||||
|
||||
const long
|
||||
GetIntFromNBO(u_char *src);
|
||||
|
||||
const short
|
||||
GetShortFromNBO(u_char *src);
|
||||
|
||||
const long
|
||||
ByteToInt(u_char *src, int n);
|
||||
|
||||
u_short
|
||||
GetHour(time_t);
|
||||
|
||||
u_short
|
||||
GetMinute(time_t);
|
||||
|
||||
u_short
|
||||
GetTmHour();
|
||||
|
||||
u_short
|
||||
GetTmMinute();
|
||||
|
||||
u_short
|
||||
GetTmSecond();
|
||||
|
||||
u_short
|
||||
GetTmDay();
|
||||
|
||||
u_short
|
||||
GetTmMonth();
|
||||
|
||||
u_short
|
||||
GetTmYear();
|
||||
|
||||
char *
|
||||
GetTmDate(char *ptr);
|
||||
|
||||
int
|
||||
AsciiToMsisdn(char *cptr,u_char *bptr,int len);
|
||||
|
||||
void
|
||||
string2ltime(time_t *nowtime, char *timestr);
|
||||
|
||||
void
|
||||
ppsAsciiToBcdR(u_char *bcd_buf, const char *asc_buf, int len);
|
||||
|
||||
void
|
||||
ppsBcdToAsciiR(char *asc_buf, const u_char *bcd_buf, int len);
|
||||
|
||||
void
|
||||
CharToTimeStamp(u_char *btime,char *atime);
|
||||
|
||||
void gettime(char *time_buf);
|
||||
const int getnowtime(int *timebuf);
|
||||
void GetVersionID(char *cbuf, u_char *bbuf);
|
||||
unsigned int HstrToInt(char *cptr);
|
||||
|
||||
int CutUnknownPrefix(char *number);
|
||||
extern int msisdnUnkToInt(char *strIn, char *strOut);
|
||||
//extern int EncryptPIN();
|
||||
extern int PutLogFunID();
|
||||
|
||||
#endif
|
||||
79
mss/pps/src/include/gprs.h
Normal file
79
mss/pps/src/include/gprs.h
Normal file
@@ -0,0 +1,79 @@
|
||||
#ifndef _GPRS__H
|
||||
#define _GPRS__H
|
||||
|
||||
#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/ppsMibTable.h"
|
||||
#include "../include/mfunc.h"
|
||||
|
||||
#include "../../../../plat/radius/src/include/radius_if.h"
|
||||
|
||||
extern char logMsisdn[18];
|
||||
extern int logMsgFlag;
|
||||
|
||||
|
||||
#define INIT_QID 1
|
||||
#define QID_DUAL_PLAT_POIND 30000
|
||||
#define MAX_PPAQ_EACH_ACCESS_REQUEST 1
|
||||
|
||||
#define GPRS_O_OPEN 0x88
|
||||
#define VAS_O_OPEN 0x89
|
||||
|
||||
#define BYTES_PER_KB 1024
|
||||
|
||||
|
||||
enum{
|
||||
PPS_RADIUS_NO_CMD,
|
||||
PPS_RADIUS_NEW_SERVICE,
|
||||
PPS_RADIUS_THRESHOLD_REACHED,
|
||||
PPS_RADIUS_QUOTA_REACHED,
|
||||
PPS_RADIUS_REMOTE_DISC,
|
||||
PPS_RADIUS_CLIENT_SERVICE_TER,
|
||||
PPS_RADIUS_ACCESS_SERVICE_TER,
|
||||
PPS_RADIUS_SERVICE_NOT_EST,
|
||||
PPS_RADIUS_DISCONNECT_ACK,
|
||||
PPS_RADIUS_DISCONNECT_NAK,
|
||||
};
|
||||
|
||||
enum{
|
||||
PPS_POSTPAID_USER,
|
||||
PPS_PREPAID_USER,
|
||||
};
|
||||
|
||||
enum pps_gprs_process_state{
|
||||
pps_gprs_idle,
|
||||
pps_gprs_postpaid,
|
||||
pps_gprs_prepaid,
|
||||
|
||||
pps_gprs_wait_request,
|
||||
pps_gprs_wait_quota_reached,
|
||||
pps_gprs_inactive_timeout,
|
||||
pps_gprs_access_timeout,
|
||||
pps_gprs_wait_terminate,
|
||||
pps_gprs_service_terminate,
|
||||
|
||||
};
|
||||
|
||||
enum _VAS_STATE{
|
||||
VAS_STATE_IDLE,
|
||||
VAS_STATE_AUTH,
|
||||
VAS_STATE_CHARGE,
|
||||
VAS_STATE_ACCEPT,
|
||||
VAS_STATE_REJECT,
|
||||
VAS_STATE_TERMINATE,
|
||||
};//VAS_STATE;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
43
mss/pps/src/include/includes.h
Normal file
43
mss/pps/src/include/includes.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
** includes.h
|
||||
*/
|
||||
|
||||
#ifndef _PPS_INCLUDES__H
|
||||
#define _PPS_INCLUDES__H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <memory.h>
|
||||
#include <malloc.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <net/if.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/io.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#include <sys/sem.h>
|
||||
#include <sys/msg.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
#include <syslog.h>
|
||||
#include <termio.h>
|
||||
#include "public.h"
|
||||
#include "function.h"
|
||||
#include "errlog.h"
|
||||
#include "logfunc.h"
|
||||
#include "debug.h"
|
||||
|
||||
#endif /* INCLUDES__H */
|
||||
|
||||
23
mss/pps/src/include/iofunc.h
Normal file
23
mss/pps/src/include/iofunc.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
**
|
||||
** file name: iofunc.h
|
||||
**
|
||||
** Parameter of IVR/VPS
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef IOFUNC__H
|
||||
#define IOFUNC__H
|
||||
|
||||
void InitParport(char *prog_name, u_short parport_range);
|
||||
|
||||
void SetParport(u_short parport_range, u_char flag);
|
||||
|
||||
void SetParportOn(char ledbit,u_short parport_range);
|
||||
|
||||
void SetParportOff(char ledbit,u_short parport_range);
|
||||
|
||||
void SetNonblock(int);
|
||||
|
||||
void SetParalPort(unsigned char flag, unsigned char data);
|
||||
#endif /* IOFUNC__H */
|
||||
37
mss/pps/src/include/logfunc.h
Normal file
37
mss/pps/src/include/logfunc.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
**
|
||||
** file name: logfunc.h
|
||||
**
|
||||
** Header file include by logfunc.c
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef LOGFUNC__H
|
||||
#define LOGFUNC__H
|
||||
|
||||
#define LogFlag(fp) \
|
||||
LogMsg(fp, "%s: %s: %d", FILE_MACRO, FUNCTION_MACRO, LINE_MACRO)
|
||||
|
||||
void *
|
||||
OpenLog (const char *prog_name, const char *ident,
|
||||
int option, int priority);
|
||||
|
||||
void
|
||||
LogRet(void *fp, const char *fmt, ...);
|
||||
|
||||
void
|
||||
LogSys(void *fp, const char *fmt, ...);
|
||||
|
||||
void
|
||||
LogMsg(void *fp, const char *fmt, ...);
|
||||
|
||||
void
|
||||
LogQuit(void *fp, const char *fmt, ...);
|
||||
|
||||
void
|
||||
GetErrnoMsg(char *sp, const char *fmt, ...);
|
||||
|
||||
void
|
||||
CloseLog(void *fp);
|
||||
|
||||
#endif
|
||||
192
mss/pps/src/include/message.h
Normal file
192
mss/pps/src/include/message.h
Normal file
@@ -0,0 +1,192 @@
|
||||
/*
|
||||
** file name: message.h
|
||||
**
|
||||
** Message type defination.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef MESSAGE__H
|
||||
#define MESSAGE__H
|
||||
#include "ramdata.h"
|
||||
|
||||
void SendContinue(u_short);
|
||||
void SendReleaseCall(u_short);
|
||||
void SendActivityTest(u_short);
|
||||
void SendCDR(int);
|
||||
void SendPlayAnnouncement(int proc_id, int balance,
|
||||
int expiration, int code_id, int oper_result );
|
||||
void SendAccountRealSync(DWORD instance,double balance,double promotion,int ocode);
|
||||
|
||||
void SendPeriodicChargeCDR(int, int, int,int);
|
||||
void SendRechargeCDR(int, int, int);
|
||||
void SendOperatorRechargeCDR(int, int, int);
|
||||
void SendPPSGeneralCDR(int, int, int,char);
|
||||
void SendRequestBCSMEvent(u_short portid);
|
||||
void SendApplyCharging(u_short portid);
|
||||
int GetRamData(u_char oidLen,DWORD *oid,u_char *pdata, u_short dataLen);
|
||||
int SetCDRParam(u_char oidLen,DWORD *oid,u_char *pdata, u_short dataLen);
|
||||
int GetCDRParam(DWORD oid,u_char *pdata);
|
||||
int SetDatabase(u_char oidLen,DWORD *oid,u_char *pdata, u_short dataLen);
|
||||
int GetDatabase(u_char oidLen,DWORD *oid,u_char *pdata, BYTE *vartype);
|
||||
|
||||
int ImportUserData(char *record);
|
||||
int ImportCommTariffData(FILE *fp);
|
||||
int ImportRentTariffData(FILE *fp);
|
||||
int ImportCallType(FILE *fp);
|
||||
int ImportHolidayTariffData(FILE *fp);
|
||||
int ImportDiscountTariffData(FILE *fp);
|
||||
int ImportBasicTariffData(FILE *fp);
|
||||
int ImportMTTariff(FILE *fp);
|
||||
int ImportCalltypeToDiscount(FILE *fp);
|
||||
|
||||
int ppsSendHeartBeating();
|
||||
|
||||
void SendContinueSMS(u_short portid);
|
||||
void SendRequestSMSEvents(u_short portid);
|
||||
void SendReleaseCall(u_short portid);
|
||||
void SendReleaseSMS(u_short portid);
|
||||
|
||||
int AssignProcID(int gy_flag);
|
||||
|
||||
int DeleteSubscriberDataHead(int head);
|
||||
int SetUserDataByOMC(u_char oidlen, DWORD *oid,
|
||||
u_char *pdata, u_short datalen);
|
||||
|
||||
void SendConnectToResource(u_short portid);
|
||||
void SendSrfPlayAnnouncement(u_short portid);
|
||||
void SendDisconnectForwardConnection(u_short portid);
|
||||
void SendPromptAndCollectUserInfo(u_short portid);
|
||||
int SendAccountInfoPromptToSrf(u_short portid,u_char isOnlyBalance,u_char isLastCallAttatched);
|
||||
int SendRechargeInfoPromptToSrf(u_short portid);
|
||||
void SendAccountInfoForLowCredit(char *caller,
|
||||
long balance,long expired_date,
|
||||
long promo,long promo_expired_date);
|
||||
void SendDisconnectForwardConnection(u_short portid);
|
||||
void SendFmnPromptAndCollectUserInfo(u_short portid);
|
||||
void SendPromptCollectedRechargedUserInfo(u_short portid);
|
||||
|
||||
/* defination of message type */
|
||||
|
||||
|
||||
#define MAX_MSISDN_LEN 11
|
||||
#define MIN_MSISDN_LEN 3
|
||||
|
||||
|
||||
#define _CID_ _cap_initial_dp
|
||||
typedef struct {
|
||||
BYTE callType; /* 0/1/2:=MO/MT/MF */
|
||||
BYTE servieKey;
|
||||
BYTE eventTypeBCSM;
|
||||
BYTE callingPartyNumber[11];
|
||||
BYTE IMSI[9];
|
||||
BYTE locationInfo[11];
|
||||
BYTE callReference[9];
|
||||
BYTE calledPartyBCDNumber[20];
|
||||
BYTE calledPartyNumber[13];
|
||||
}_cap_initial_dp;
|
||||
|
||||
#define _CC_ _cap_continue
|
||||
typedef struct {
|
||||
BYTE msgLength;
|
||||
BYTE msgReserved;
|
||||
BYTE msgSrvType;
|
||||
BYTE msgDstID[3];
|
||||
BYTE msgSrcID[3];
|
||||
BYTE msgOperaCode;
|
||||
BYTE EndFlag;
|
||||
}_cap_continue;
|
||||
|
||||
#define _CRC_ _cap_release_call
|
||||
typedef struct {
|
||||
BYTE Cause[3];
|
||||
}_cap_release_call;
|
||||
|
||||
#define _CER_ _cap_event_report
|
||||
typedef struct {
|
||||
BYTE type;
|
||||
BYTE invoke_id;
|
||||
BYTE event_type;
|
||||
BYTE dp_type;
|
||||
} _cap_event_report;
|
||||
|
||||
#define _CAT_ _cap_activity_test
|
||||
typedef struct {
|
||||
BYTE msgLength;
|
||||
BYTE msgReserved;
|
||||
BYTE msgSrvType;
|
||||
BYTE msgDstID[3];
|
||||
BYTE msgSrcID[3];
|
||||
BYTE msgOperaCode;
|
||||
BYTE EndFlag;
|
||||
}_cap_activity_test;
|
||||
|
||||
#define MAX_CALL_NUM_BLEN 10
|
||||
#define MAX_CALL_NUM_ALEN 20
|
||||
|
||||
#define _IER_ _ivr_establish_req
|
||||
typedef struct {
|
||||
u_char DDO0;
|
||||
u_char DDO1;
|
||||
u_char port;
|
||||
u_char type;
|
||||
u_char invoke_id;
|
||||
u_char caller[MAX_CALL_NUM_BLEN];
|
||||
u_char called[MAX_CALL_NUM_BLEN+2];
|
||||
} _ivr_establish_req;
|
||||
|
||||
#define _AIS_ _account_info_sm
|
||||
|
||||
typedef struct {
|
||||
u_char msgLength;
|
||||
u_char msgReserved;
|
||||
u_char msgServiceType;
|
||||
u_char msgDstID[3];
|
||||
u_char msgSrcID[3];
|
||||
u_char msgOperaCode;
|
||||
u_char msisdn[8];
|
||||
u_char balance[4];
|
||||
u_char expired_date[4];
|
||||
u_char endFlag;
|
||||
} _account_info_sm;
|
||||
|
||||
/*
|
||||
typedef struct {
|
||||
u_char systemID;
|
||||
u_char subSystemID;
|
||||
u_char timeStamp[4];
|
||||
u_char ledStatus[8];
|
||||
u_char alarm[2];
|
||||
u_char reserved0;
|
||||
u_char extLength;
|
||||
u_char version[3];
|
||||
u_char status;
|
||||
u_char sumOfParameter;
|
||||
u_char systemCapability[4];
|
||||
u_char licensedUser[4];
|
||||
u_char realUserNumber[4];
|
||||
char serialNumber[8];
|
||||
}_pps_heartbeat;
|
||||
|
||||
*/
|
||||
typedef struct {
|
||||
u_char systemID;
|
||||
u_char subSystemID;
|
||||
u_char timeStamp[4];
|
||||
u_char ledStatus[8];
|
||||
u_char reserved0;
|
||||
u_char alarm[2];
|
||||
u_char extLength_h;
|
||||
u_char extLength_l;
|
||||
u_char component_id_h;
|
||||
u_char component_id_l;
|
||||
u_char component_len_h;
|
||||
u_char component_len_l;
|
||||
u_char version[3];
|
||||
u_char status;
|
||||
u_char sumOfParameter[4];
|
||||
u_char licensedUser[4];
|
||||
u_char realUserNumber[4];
|
||||
u_char serialNumber[4];
|
||||
u_char systemCapability[4];
|
||||
}_pps_heartbeat;
|
||||
#endif /* MESSAGE__H */
|
||||
296
mss/pps/src/include/mfunc.h
Normal file
296
mss/pps/src/include/mfunc.h
Normal file
@@ -0,0 +1,296 @@
|
||||
/*
|
||||
**
|
||||
** file name: smfunc.h
|
||||
**
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef SMFUNC__H
|
||||
#define SMFUNC__H
|
||||
|
||||
#include "cdrme.h"
|
||||
#include "ramdata.h"
|
||||
|
||||
/* deal with balance to a nature voice prompt */
|
||||
void ProcAmountVoice(char *sp);
|
||||
int MergeVoiceStream(BYTE *dest, int balance, int expire, int code_id, int oper_result);
|
||||
u_char GetAccountZoneID(int head, int tail);
|
||||
int IsSpanCall(void *shmp);
|
||||
int GetServiceCode(void *shmp, char *sptr);
|
||||
int GetServiceAction(void *shmp, int code_id);
|
||||
int GetAccountPos(void *ptr);
|
||||
float GetBalance(_account_info *ptr);
|
||||
long GetExpiration(_account_info *ptr);
|
||||
int GetOverdraft(_account_info *ptr);
|
||||
int GetCMBTimes(_account_info *ptr);
|
||||
int UpdateCMBTimes(_account_info *ptr,int times);
|
||||
int resetCMBTimes(_account_info *ptr);
|
||||
|
||||
void UpdateBalance(_state_data *stateProc,_account_info *ptr, float charge,CHARGED_FEE *chargeFee);
|
||||
void UpdateExpiration(void *ptr);
|
||||
void UpdateExpirationFirstCharge(void *ptr);
|
||||
void UpdateExpirationFirstInquiry(void *ptr, long valid_time);
|
||||
int IsNormalAccount(void *ptr);
|
||||
int GetAccountStatus(void *ptr);
|
||||
int GetDiscount(int timestamp,u_char discount_id);
|
||||
float BillingFormula(_state_data *shmp,_bill_tariff *ptar,int startTime);
|
||||
float TimeToCharge(_state_data *shmp,_bill_tariff *ptar, int duration,int begin_time, int init_bill);
|
||||
int preLeftTime(_state_data *shmp,float balance,_bill_tariff *ptar);
|
||||
int GetValidTime(int begin_time, void *ptar, float balance, int init_bill, int overdraft);
|
||||
float caculateMiniCharge(_state_data *shmp,_bill_tariff *ptar);
|
||||
void EncryptCardHRN(char *card_hrn,u_char *card_pwd);
|
||||
int BillingProc(void *shmp, int);
|
||||
void SetCallType(void *shmp, int);
|
||||
float ChargeGprsAccountBalance(_state_data *shmp,int real_duration);
|
||||
int IsNormalRechargeCard(void *ptr);
|
||||
u_short GetRechargeCardFaceValue(void *ptr);
|
||||
u_short GetRechargeCardValidTime(void *ptr);
|
||||
|
||||
u_char GetTariffLacInfo(u_char *cgi);
|
||||
void SetLocationInfo(u_char *cgi,u_short portid);
|
||||
u_long GetTimeFunnel(u_short, u_short, u_short);
|
||||
int IsEnablePeriodicCharge(int head, int tail);
|
||||
int IsEnablePeriodicAction(int head, int tail);
|
||||
|
||||
float GetAccountBalance(int head, int tail);
|
||||
int GetUserType(int head, int tail);
|
||||
int GetPeriodicTariffFee(int tariff_id,int id);
|
||||
short GetPeriodicTariffDate(int tariff_id,int id);
|
||||
short GetPeriodicTariffType(int tariff_id,int id);
|
||||
short GetPeriodicTariffPeriod(int tariff_id,int id);
|
||||
void UpdateAccountBalance(int head, int tail, float charge);
|
||||
u_long GetAccountFirstUsedDate(int head, int tail);
|
||||
int GetAccountMsisdn(int head, int tail,u_char *msisdn);
|
||||
short IsPeriodicChargeDate(int id, int first_used_date);
|
||||
int UpdateTariffTable(int zone_id);
|
||||
void UpdateOtherTable(void);
|
||||
void UpdateAccountFirstUsedDate(int, int);
|
||||
void UpdateAccountStatus(int, int, int);
|
||||
void UpdateAccountRechargeFail(int, int);
|
||||
int GetParamRechargeAttemptLimit();
|
||||
u_short GetAccountRechargeFail(int, int);
|
||||
void ResetAccountRechargeFail(int, int);
|
||||
int IsEnableToCall(int proc_id);
|
||||
u_short TStringToID(char *time_buf);
|
||||
u_short TStampToID(time_t);
|
||||
int CDRStatistics(_tocdr_report *pbuf, float charge, ulong gprsVolume);
|
||||
int GprsCDRStatistics(_tocdr_report* pbuf,float f_charge,ulong gprsVolume);
|
||||
int MsisdnToLong(u_long *ulmsisdn, char *cmsisdn);
|
||||
void cstaInstanceCheck();
|
||||
int CheckWetherLocalNumber(char *number);
|
||||
int GetPeriodicChargeDate(int tariff_id,int id);
|
||||
int GetUserInstance(long long head, int *instance);
|
||||
int GetUserPos(int *head,long long head1);
|
||||
int ConferenceCallBillingProc(void *ptr, int duration);
|
||||
void SetRoamingFlag(void *shmp);
|
||||
int GetAccountCUG(_account_info *ptr);
|
||||
int CheckWetherFamilyNumber(_account_info *caller, _account_info *called);
|
||||
int GetAccountFamilyNumberCounter(_account_info *ptr);
|
||||
int StoreAccountFamilyNumber(_account_info *ptr,char *msisdn,int index);
|
||||
int BillingFamilyNumberChange(_state_data *shmp);
|
||||
int IncreaseFamilyNumberChangeCounter(int head, int tail);
|
||||
int GetServiceType(_state_data *shmp);
|
||||
int GetServiceType_0(_state_data *shmp);
|
||||
int GetAccountCosID(_account_info *ptr);
|
||||
int SaveDailyReport();
|
||||
int GetRechargeCardByIndex(int index,char *card_no);
|
||||
void SendManualRechargeCDR(_recharge_card_info *shmp);
|
||||
int GetAccountLastCallInfo(_account_info *ptr, _last_call_info *pInfo);
|
||||
int GetSubsCapTariffID(_state_data *shmp, int call_type);
|
||||
void UpdateSubsCapInfo(_account_info *ptr, int cap_type,float charge, int amount, _state_data *shmp);
|
||||
void GetSubsCapInfo(_account_info *ptr,int cap_type, float *balance, int *counter, int type);
|
||||
BOOL isPromotionCanBeUsedAtThisPoint(_state_data *shmp);
|
||||
BOOL isPromotionCanBeUsedForRoDebit(_account_info *shmp);
|
||||
double GetBalanceWithPromotionControl(_state_data *stateProc,_account_info *ptr);
|
||||
int GetAccountBundlePlanInfo(_account_info *ptr, long ret_value[]);
|
||||
int UpdateAccountBundlePlanInfo(_account_info *shmp, long set_value[]);
|
||||
int subscribe_bundle_plan_send_used_up_info(char *caller_number, SMS_SENTENCE id);
|
||||
|
||||
int GetAccountVoiceID(int head,int tail);
|
||||
|
||||
int cliManipulationFunction(char *caller, char *called);
|
||||
|
||||
void playPromptAndCollectVoice(u_short portid,u_short voiceID,u8 inputLen);
|
||||
void playPromptVoice(u_short portid,u_short voiceID);
|
||||
int CallingCardWaitingForSpecialResourceReport(_state_data *shmp);
|
||||
int CallingCardSendReleaseCall(u_short portid);
|
||||
int isTransferAllowed(u_short portid);
|
||||
int isRechargeAllowed(u_short portid);
|
||||
int transferIddBillingPrefix(char *number);
|
||||
int poolTransferAccount(_account_info *callerInfo,_account_info *destInfo,float transferedFee);
|
||||
extern void resetPoolSlaveDaily(u_short head,u_short tail);
|
||||
|
||||
extern void increPoolChildCharged(_account_info *ptr,double charged);
|
||||
extern void increPoolChildSMS(_account_info *ptr);
|
||||
extern void increPoolChildCalls(_account_info *ptr);
|
||||
extern BOOL isPromotionCanBeUsedAtThisPoint(_state_data *shmp);
|
||||
extern float BillingFormula(_state_data *shmp,_bill_tariff *ptar,int startTime);
|
||||
extern float TimeToCharge(_state_data *shmp,_bill_tariff *ptar, int duration,int begin_time, int init_bill);
|
||||
extern double GetBalanceWithPromotionControl(_state_data *stateProc,_account_info *ptr);
|
||||
extern float caculateMiniCharge(_state_data *shmp,_bill_tariff *ptar);
|
||||
extern int preLeftTime(_state_data *shmp,float balance,_bill_tariff *ptar);
|
||||
extern void PPSSendUserSMSNotification(int head, int tail,char *msgSend);
|
||||
extern u_char getCurrentTier(_state_data *shmp,_bill_tariff *ptar);
|
||||
extern void ChangeTariffToPoolCallTariff(_state_data *shmp,_bill_tariff *ptar);
|
||||
extern float getCurrentFee(_state_data *shmp);
|
||||
extern int isPoolChildReachSMSLimit(_state_data *shmp);
|
||||
extern int isPoolChildReachFeeLimit(_account_info *ptr);
|
||||
extern int decMasterChildren(_prepaid_info *prepaidInfo);
|
||||
extern int IncreasePoolAccountChangeCounter(int head, int tail);
|
||||
extern int increMasterChangeCounter(_prepaid_info *prepaidInfo);
|
||||
extern int getHowManyChildren(_prepaid_info *prepaidInfo);
|
||||
extern int BillingChildNumberChange(_state_data *shmp);
|
||||
extern int increMasterChildren(_prepaid_info *prepaidInfo);
|
||||
|
||||
extern int getPoolAccountRole(u_short portid);
|
||||
extern int CheckWetherPoolNumber(_account_info *caller, _account_info *called);
|
||||
extern int isPoolChildReachCallLimit(_state_data *shmp);
|
||||
extern void clearTransferInfo(u_short portid);
|
||||
extern void clearMasterSlaveInfo(u_short portid);
|
||||
extern int isRechargeAllowed(u_short portid);
|
||||
extern int chargeOrTransfer(u_short portid);
|
||||
extern int getInputtedChoice(_state_data *shmp);
|
||||
extern int transferAccountIVRProc(u_short portid);
|
||||
extern int masterSlaveIVRProc(u_short portid);
|
||||
extern void clearCMBInfo(u_short portid);
|
||||
extern int callMebackUSSDProc(u_short portid);
|
||||
extern int transferAccountIVRProc(u_short portid);
|
||||
extern int smppSendMOSM(char *caller, char *called, u_char *msg,int msgLen,u_char dataCoding);
|
||||
extern void SendAccountRealSync_2(_account_info *accountInfo,double balance,double promotion ,int ocode);
|
||||
extern void SendAccountRealSync(DWORD instance,double balance,double promotion, int ocode);
|
||||
extern void PPSSendUserSMSNotification(int head, int tail,char *msgSend);
|
||||
extern int WaitingForInput(_state_data *shmp,u8 *inputMsg);
|
||||
extern float GetPromotion(_account_info *ptr);
|
||||
extern int GetBalanceWithOutPromotion(int head, int tail);
|
||||
extern u_char *getSmsSentenceNative(SMS_SENTENCE id,u8 languageType);
|
||||
extern int fillMoneyToContent(float balance,char *sms);
|
||||
extern float GetAccountBalance(int head, int tail);
|
||||
extern int GetLocalCosID(_account_info *ptr);
|
||||
extern void pps_print_error(u_char logMsisdnFlag,const char *fmt, ...);
|
||||
extern void pps_print_event(u_char logMsisdnFlag,const char *fmt, ...);
|
||||
extern void saveCommand();
|
||||
extern int GetMOTariffIDWithFreeServiceControl(u_short head,u_short tail);
|
||||
extern void SendTransferCDR(_account_info *caller_info,_account_info *called_info,float charge);
|
||||
extern void SendDirectDebitAndRefundCDR(_account_info *caller_info, float charge);
|
||||
extern void SendSmsDirectDebitAndRefundCDR(_state_data *shmp, int sent_num, int bIsRefund);
|
||||
extern int SendServiceNotApplied(u_short portid,u8 ussdSmsFlag,u8 serviceNumberPosition);
|
||||
extern u_long PPS_SET_INTEGER(u_char *pdata, u_char dataLen);
|
||||
extern float pps_billing_ro_voice(_state_data *shmp, u32 *need_assigned_duration, u32 *new_assigned_bundle);
|
||||
extern float pps_billing_ro_voice_with_crm(_state_data *shmp, u32 *need_assigned_duration, u32 *new_assigned_bundle);
|
||||
extern float pps_refund_ro_voice_with_crm(_state_data *shmp, u32 refund_duration, u32 *refund_bundle);
|
||||
extern float pps_refund_ro_voice(_state_data *shmp, u32 refund_duration, u32 *refund_bundle);
|
||||
extern int pps_get_ro_voice_quota(_state_data *shmp);
|
||||
extern int pps_get_account_bundle_mo_voice(_state_data * shmp);
|
||||
extern int pps_get_account_bundle_mt_voice(_state_data * shmp);
|
||||
extern int pps_get_account_bundle_mo_sms(_state_data * shmp);
|
||||
extern void UpdateExpirationForRechargeCard(_account_info *ptr, u_short valid_time, u_short faceValue);
|
||||
extern int GetCardSystemParamByNearestValue(u_char cos_id, u_short faceValue);
|
||||
extern void SendSelfcareRechargeCDR(_account_info *user_info, char *pwd, int type, int charge);
|
||||
extern void SendSelfcareBundleSubCDR(_account_info *user_info, int charge, u32 data_volume, u32 voice_sec);
|
||||
extern void SendSelfcareTransferCDR(_account_info *caller_info,_account_info *called_info, float charge);
|
||||
extern int get_transfer_status_normal_flag();
|
||||
extern int get_not_change_transfer_expiry_date();
|
||||
extern void UpdateAccountOverdraft(int head, int tail, long overdraft);
|
||||
extern void ppsgetdaytime_readFormat(char *daytime_buf);
|
||||
extern int GetAccountPromptInfo();
|
||||
extern int StoreCDR(_tocdr_report *pcdr);
|
||||
extern int pps_send_map_close();
|
||||
extern int pps_debug_map_msg();
|
||||
extern int smppDecodeSM(char *strIn, char *strOut,int length);
|
||||
extern int SendUSSDNotify(u_short portid, char *ussd_info);
|
||||
extern int PutLogFunID(char *func_name);
|
||||
extern const char * AsciiTime(char *ptr, time_t time);
|
||||
extern int fillMoneyAndDate(long balance, char *expire_date, int calltype0, u_char flag, u_char *smMsgBuf);
|
||||
extern int pps_get_adaptor_flag();
|
||||
extern int smppSendActivicationInfo(_account_info *caller_info, char *called);
|
||||
extern int MsisdnToAscii(char *ascii_in, BYTE *cmsisdn);
|
||||
extern char* ppsParseSentence(char *sentence,int varNum, char *varStr[]);
|
||||
extern char *sendPPSNotificationMessage(int head, int tail, int sms_id);
|
||||
extern void SendPPSGeneralCDR(int head, int tail, int charge, char cdr_type);
|
||||
extern const char * AsciiTimeYMD(char *ptr, time_t time);
|
||||
extern int isAccountExpired(_account_info *ptr);
|
||||
extern int GetCosIDByAccount(_account_info *ptr);
|
||||
extern void notifyUserTransferResult_1(_account_info *srcUsr, _account_info *dstUsr, int amount, u8 callerOrCalled);
|
||||
extern int GetCardSystemParam(u_char cos_id,u_short faceValue);
|
||||
extern int IsPromotionTime(COSTable *cosTableItem, struct timeval tvn);
|
||||
extern int GetPromotionAmount(COSTable *cosTableItem, int charge);
|
||||
extern void UpdateAccountPromotionBalance(int head, int tail, float charge);
|
||||
extern void UpdateAccountPromotionExpiryDay(int head, int tail, int days);
|
||||
extern int GetPromotionDay(COSTable *cosTableItem, int charge);
|
||||
extern int subscribe_bundle_plan(_state_data *shmp, char *sms, int method, char *ret_prompt);
|
||||
extern int getUssdACK(u_short portid,u_char *ussd_data);
|
||||
extern int ocs_bundle_plan_query(_state_data *shmp, char *sms, int method, char *ret_prompt);
|
||||
extern int subscribe_bundle_plan_query_info(_state_data *shmp, int operation, int method, char *ret_prompt);
|
||||
extern int GetUssdServiceType(_state_data *shmp);
|
||||
extern int get_cos_bundle_control(int cos_id);
|
||||
extern int GetUssdServiceKey(u_char serviceKey);
|
||||
extern int UseExternalVC();
|
||||
extern int send_scf_update_card_data(u_short portid);
|
||||
extern int RechargeFailedUpdateAccountData(u_short portid);
|
||||
extern int AssignProcID(int gy_flag);
|
||||
extern int CheckClearFriendFamilyNumber(int head, int tail, int rent_charge,int rent_id);
|
||||
extern int pps_update_account_bundle_mt_voice(_state_data *shmp, int seconds);
|
||||
extern int pps_update_account_bundle_mo_voice(_state_data *shmp, int seconds);
|
||||
extern int IncreaseFriendFamilyFreeCallDuration(int head, int tail, int duration);
|
||||
extern int sendPPSTestShortMessage(char *message);
|
||||
extern int pps_update_account_bundle_mo_sms(_state_data *shmp, int count);
|
||||
extern int IncreaseFriendFamilyFreeSMSCounter(int head, int tail);
|
||||
extern int IsEnableToAddEditFavoriteNumber(_state_data *shmp, int flag);
|
||||
extern int IsFavoriteNumberTypeOk(_state_data *shmp);
|
||||
extern int AddInterPrefix(char *number);
|
||||
extern int GetMOTariffData(_state_data *shmp,_bill_tariff *ptar, char *call_no, int zone_id);
|
||||
extern int GetMTTariffData(_state_data *shmp, u_char tariffID, _bill_tariff *ptar, _account_info *pinfo, _account_info *pcaller);
|
||||
extern int pps_real_update_file_init();
|
||||
extern int pps_real_update_file_close();
|
||||
extern int pps_get_ucbc_number(char *ucbc_number);
|
||||
extern long GetPromotionExpiration(_account_info *ptr);
|
||||
extern ulong getSystemCurrencyResolution();
|
||||
extern int pps_real_update_user_file(int head, int tail);
|
||||
extern int CountUsedCardForDailyReport(int charge);
|
||||
extern int GetAccountMsisdnStr(int head, int tail,u_char *msisdn);
|
||||
extern void ppsListAllSubsMSISDN();
|
||||
extern int gx_print_all_port_status();
|
||||
extern int gx_print_stat();
|
||||
extern int gx_stat_clean_all();
|
||||
extern int smppSendMsg(u_char *peerNumber,u_char *msg,u_char serviceNumPosition);
|
||||
extern int UpdateAccountBundlePlanInfoWarningFlag(_state_data *shmp, int flag);
|
||||
extern void ChangeTariffToCfCugFavTariff(_state_data *shmp, _bill_tariff *ptar);
|
||||
extern void ChangeTariffToCfCugTariff(_state_data *shmp, _bill_tariff *ptar);
|
||||
extern void ChangeTariffToCfFavTariff(_state_data *shmp, _bill_tariff *ptar);
|
||||
extern void ChangeTariffToCfTariff(_state_data *shmp, _bill_tariff *ptar);
|
||||
extern void ChangeTariffToCugFavTariff(_state_data *shmp, _bill_tariff *ptar);
|
||||
extern void ChangeTariffToCugTariff(_state_data *shmp, _bill_tariff *ptar);
|
||||
extern void ChangeTariffToFavoriteCallTariff(_state_data *shmp, _bill_tariff *ptar);
|
||||
extern void ChangeTariffToMTRoamingTariff(_state_data *shmp, _bill_tariff *ptar);
|
||||
extern void ChangeTariffToMORoamingTariff(_state_data *shmp, _bill_tariff *ptar);
|
||||
extern int IsPromotionExpired(_account_info *ptr);
|
||||
extern int pps_rest_query_process(u_short portid);
|
||||
extern int SendRestAccountInfoPromptToSrf(u_short portid);
|
||||
extern int pps_rest_topup_process(u_short portid);
|
||||
extern int SendRestRechargeInfoPromptToSrf(u_short portid);
|
||||
extern int pps_rest_query_process(u_short portid);
|
||||
extern int pps_rest_topup_process(u_short portid);
|
||||
extern int pps_smpp_state(u_short portid);
|
||||
extern int pps_rest_transfer_process(u_short portid);
|
||||
extern int SendTransferSuccessRequest(u_short portid,u8 ussdSmsFlag);
|
||||
extern int SendPSSREnd(u_short portid,char *ussd_info);
|
||||
extern int ocs_get_calling_card_cos_id();
|
||||
extern float ocs_get_calling_card_left_balance(int head, int tail);
|
||||
extern int ocs_get_calling_card_method();
|
||||
extern int WaitingForEventsReport_ccc(u_short portid);
|
||||
extern int WaitingforAnsweredProc_ccc(u_short portid);
|
||||
extern int CheckCallValidity_ccc(u_short portid);
|
||||
extern int WaitingForInputCallingCardAccountResponse_ccc(_state_data *shmp);
|
||||
extern int BillingProc_ccc(_state_data *shmp, int sub_flag0);
|
||||
extern int IsEnableToCall_ccc(int proc_id);
|
||||
extern int pps_get_answer_timer_out();
|
||||
extern void ChargeAccountByRealCallDuration(u_short portid);
|
||||
extern char *pps_get_service_number(unsigned int num_pos);
|
||||
extern int OCS_with_external_CRM();
|
||||
extern void pps_send_rent_charge_to_crm(int head, int tail);
|
||||
extern void ocs_get_crm_prefix_definition();
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
331
mss/pps/src/include/param.h
Normal file
331
mss/pps/src/include/param.h
Normal file
@@ -0,0 +1,331 @@
|
||||
#ifndef ppsParam_H
|
||||
#define ppsParam_H
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "crd.h"
|
||||
#include "ppsMibTable.h"
|
||||
#include "voiceID.h"
|
||||
|
||||
#define MSISDN_LENGTH 11
|
||||
|
||||
|
||||
|
||||
|
||||
typedef enum _SERVICE_KEY
|
||||
{
|
||||
HELP=0,
|
||||
INQUIRY_SERVICE,
|
||||
SCRATCH_CARD_RECHARGE,
|
||||
CREDIT_CARD_RECHARGE,
|
||||
FAVORITE_NUMBER_SERVICE,
|
||||
LANGUAGE_MANAGEMENT,
|
||||
PIN_MANAGEMENT,
|
||||
SERVICE_9,
|
||||
SERVICE_10,
|
||||
SERVICE_11,
|
||||
}SERVICE_KEY;
|
||||
|
||||
|
||||
typedef struct _file_operation
|
||||
{
|
||||
u_char uploadUserData;
|
||||
u_char uploadPrepaidCard;
|
||||
u_char uploadTariffPlan;
|
||||
u_long nextTariffStartTime;
|
||||
}PPSFileOperation;
|
||||
|
||||
enum _statistics_enum{
|
||||
MIBPPS_CAPOPEN = 0,
|
||||
MIBPPS_INITIALDP ,
|
||||
MIBPPS_REQUESTBCSM,
|
||||
MIBPPS_APPLYCHARGING,
|
||||
MIBPPS_CONTINUE,
|
||||
MIBPPS_ACTIVITYS,
|
||||
MIBPPS_ACTIVITYR,
|
||||
MIBPPS_REPORTBCSM,
|
||||
MIBPPS_CHARGINGREPORT,
|
||||
MIBPPS_ANSWERED,
|
||||
MIBPPS_DISCONNECT,
|
||||
MIBPPS_RELEASECALL,
|
||||
MIBPPS_INQUIRE,
|
||||
MIBPPS_RECHARGE,
|
||||
MIBPPS_READCARD,
|
||||
MIBPPS_READCARDRSP,
|
||||
MIBPPS_WRITECARD,
|
||||
MIBPPS_WRITECARDRSP,
|
||||
MIBPPS_PLAYANNOUNCE,
|
||||
MIBPPS_ACCOUNTINFO,
|
||||
MIBPPS_ACCINFOACK,
|
||||
MIBPPS_CDRNUMBER,
|
||||
MIBPPS_CSTANUMBER,
|
||||
MIBPPS_CDROVERFLOW,
|
||||
MIBPPS_BLACKLIST,
|
||||
MIBPPS_SUSPEND,
|
||||
MIBPPS_INITIALDP_SMS,
|
||||
MIBPPS_REQUEST_SMS,
|
||||
MIBPPS_CONTINUE_SMS,
|
||||
MIBPPS_REPORT_SMS,
|
||||
MIBPPS_RELEASE_SMS,
|
||||
MIBPPS_CONFERENCE,
|
||||
MIBPPS_THIRD_PARTY,
|
||||
MIBPPS_CONNECT_TO_RESOURCE,
|
||||
MIBPPS_PLAY_ANNOUNCEMENT,
|
||||
MIBPPS_EST_TMP_CNT,
|
||||
MIBPPS_AST_INS,
|
||||
MIBPPS_PCUI,
|
||||
MIBPPS_PCUI_RES,
|
||||
MIBPPS_SPE_RUS_RPT,
|
||||
MIBPPS_DISCNT_FWD_CNT,
|
||||
MIBPPS_SM_INQUIRY,
|
||||
MIBPPS_SM_RECHARGE,
|
||||
};
|
||||
|
||||
typedef struct _msg_statistics_
|
||||
{
|
||||
u_long CapOpen;
|
||||
u_long Initialdp[2];
|
||||
u_long RequestBCSM[2];
|
||||
u_long ApplyCharging[2];
|
||||
u_long Continue[2];
|
||||
u_long ActivityS;
|
||||
u_long ActivityR;
|
||||
u_long ReportBCSM[2];
|
||||
u_long ChargingReport[2];
|
||||
u_long Answered[2];
|
||||
u_long Disconnect[2];
|
||||
u_long Releasecall[2];
|
||||
u_long Inquire;
|
||||
u_long Recharge;
|
||||
u_long ReadCard;
|
||||
u_long ReadCardRsp;
|
||||
u_long WriteCard;
|
||||
u_long WriteCardRsp;
|
||||
u_long Playannounce;
|
||||
u_long Accountinfo;
|
||||
u_long Accinfoack;
|
||||
u_long InitialDP_SMS;
|
||||
u_long Request_SMS;
|
||||
u_long Continue_SMS;
|
||||
u_long Report_SMS;
|
||||
u_long Release_SMS;
|
||||
u_long Conference;
|
||||
u_long ThirdParty;
|
||||
u_long ConnectToResource;
|
||||
u_long PlayAnnouncement;
|
||||
u_long EstablishTemporaryConnection;
|
||||
u_long AssistInstructions;
|
||||
u_long PCUI;
|
||||
u_long PCUI_rsp;
|
||||
u_long SpecialResourceReport;
|
||||
u_long DisconnectForwardConnection;
|
||||
u_long smInquiry;
|
||||
u_long smRecharge;
|
||||
u_long send_sync[4];
|
||||
u_long recv_sync[4];
|
||||
u_long update_card_request;
|
||||
u_long update_card_error_msg;
|
||||
u_long update_card_ok;
|
||||
u_long update_card_no_card;
|
||||
u_long update_card_used;
|
||||
u_long update_card_expired;
|
||||
u_long update_card_sys_failure;
|
||||
char ussd_operation_date[7][16];
|
||||
u_long ussd_operation[7][3*4]; /* 7*3 */
|
||||
}_msg_statistics;
|
||||
|
||||
typedef struct _measurement
|
||||
{
|
||||
u_long cdrnumber;
|
||||
u_long balance;
|
||||
u_long duration;
|
||||
u_long cstanumber;
|
||||
u_long cdroverflow;
|
||||
u_long blacklist;
|
||||
u_long suspend;
|
||||
u_long usernumber;
|
||||
// u_long headnumber;
|
||||
u_char user_number[8];
|
||||
u_long peer_usernumber;
|
||||
// u_char head_prefix[1000][4];
|
||||
u_int free_index;
|
||||
u_long cardnumber;
|
||||
u_long cardheadnumber;
|
||||
u_char card_number[8];
|
||||
u_char card_prefix[2000][4];
|
||||
u_long sysCapability;
|
||||
u_char sys_capability[4];
|
||||
u_char licensed_user[4];
|
||||
u_char index_alarm;
|
||||
u_int search_table_result[4];
|
||||
u_char mt_release_flag;
|
||||
}_measurement;
|
||||
|
||||
typedef struct _display
|
||||
{
|
||||
char sysState;
|
||||
char peer_state;
|
||||
char peer_state_counter;
|
||||
char dataSrc;
|
||||
char initProgress;
|
||||
char control_state;
|
||||
u_long masterIP;
|
||||
char rechargeDigitals[8];
|
||||
char inquiryDigitals[8];
|
||||
u_short proc_used;
|
||||
u_short proc_begin[7];
|
||||
u_short ro_used;
|
||||
u_short gy_used;
|
||||
u_long totalCharge;
|
||||
u_long control_state_ts;
|
||||
char asciiIn[128];
|
||||
char asciiOut[8192];
|
||||
char reserved0[8192];
|
||||
int reserved1[8192];
|
||||
long reserved2[8192];
|
||||
}_display;
|
||||
|
||||
typedef struct _debug_mib
|
||||
{
|
||||
_msg_statistics msgstatistics;
|
||||
_measurement measurement;
|
||||
u_char watch_dog[4*16];
|
||||
int report_sum[7][4];
|
||||
_display display;
|
||||
}_debug_mib;
|
||||
|
||||
// fix multiple definition====================================
|
||||
extern _debug_mib debugmib;
|
||||
//
|
||||
|
||||
typedef struct _PpsParam
|
||||
{
|
||||
u_char ppsNumber[MSISDN_LENGTH]; /* byte0 = length */
|
||||
u_char smscNumber[MSISDN_LENGTH];
|
||||
u_char esmeNumber[MSISDN_LENGTH];
|
||||
|
||||
u8 param_ver;
|
||||
u8 reserve[127];
|
||||
|
||||
PpsServiceConrol serviceControl;
|
||||
VmsRouteParam routeParam;
|
||||
PPSFileOperation fileOperation;
|
||||
PpsTable ppsTables;
|
||||
u_long rcm_ip;
|
||||
int max_call_duration;
|
||||
long max_quota_per_request;
|
||||
int scf_work_as_adaptor;
|
||||
int scf_work_as_adaptor_with_vcs;
|
||||
int data_quota_as_postpaid;
|
||||
int new_flags[31];
|
||||
_ocsCRMConrol ocs_crm_control;
|
||||
}PPSParamStruct;
|
||||
|
||||
|
||||
int SetDefaultParam();
|
||||
int DecodePPSAsciiIn(int pageno, char *cmd);
|
||||
int GetCDR_Record();
|
||||
|
||||
void SetLoadFileFlag(int dataID);
|
||||
void AddPPSStatistics(int index,int dir);
|
||||
|
||||
int pps_debug_set();
|
||||
int GetCSTA_Record();
|
||||
int GetMO_CDR();
|
||||
int GetMT_CDR();
|
||||
int ppsDeubgRt();
|
||||
int pps_smppInit();
|
||||
int PeerServerRamInitRequest(u_char oidLen, DWORD *oid,
|
||||
u_char *pdata,BYTE *vartype);
|
||||
int reportCDRIncrement(int calltype,int duration, float charge,ulong gprsVolume);
|
||||
int SetCSTASyncFlag(int instance);
|
||||
|
||||
void PrepaidAction();
|
||||
int MessageProc();
|
||||
void CallProc();
|
||||
int SystemInit();
|
||||
int WaitingforAnsweredProc(u_short);
|
||||
int BeatTrans();
|
||||
void SetServerFlag(int flag);
|
||||
int SetServerID();
|
||||
void SetActiveDataServer(int flag);
|
||||
void TariffPlanProc();
|
||||
void PeriodicChargeProc();
|
||||
void CheckLoadFile();
|
||||
void SysGuard(int sig);
|
||||
void ReleaseAll(u_short portid);
|
||||
int RequestBCSMEvent(u_short portid);
|
||||
int WaitingForInitialDP(u_short portid);
|
||||
int WaitingForEventsReport(u_short portid);
|
||||
int ppsBackupRamDataToFile();
|
||||
int ppsBackupRamDataToOMCServer();
|
||||
void PeriodicSyncRamData();
|
||||
int smppMonitor();
|
||||
void capMessageProc();
|
||||
int SyncDailyReport();
|
||||
int ReadDataFromOMCServer();
|
||||
int LoadDataFromBackfile();
|
||||
int ReadDataFromPeerSever();
|
||||
int ReadPeroidicSyncData();
|
||||
int LoadPPSParam();
|
||||
int ppsInitCSTA();
|
||||
void DisplayVoiceOperationCode();
|
||||
int UserHeadIncrement();
|
||||
int UserNumberIncrement();
|
||||
int UserHeadDecrement();
|
||||
int UserNumberDecrement();
|
||||
int ReadTariffDataFromFile(int tbindex);
|
||||
int ReadIvrSyntaxDataFromFile(FILE *fp);
|
||||
int ReadDigitalSyntaxDataFromFile(FILE *fp);
|
||||
int WaitingforAnsweredProc(u_short portid);
|
||||
int WaitingForEventsReport(u_short portid);
|
||||
int ReleasePortStatus(u_short invoke_id);
|
||||
int ConferenceRequest(u_char oidLen, DWORD *oid,
|
||||
u_char *pdata,u_short dataLen);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
17
mss/pps/src/include/plat_inc.h
Normal file
17
mss/pps/src/include/plat_inc.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/* including all platform h files */
|
||||
|
||||
#ifndef _PPS_PLAT_INC
|
||||
#define _PPS_PLAT_INC
|
||||
|
||||
#include "../../../../plat/public/src/include/pub_include.h"
|
||||
#include "../../../../plat/snmp/src/include/snmp.h"
|
||||
#include "../../../../plat/sccp/src/include/sccp.h"
|
||||
#include "../../../../plat/tcap/src/include/tcap_public.h"
|
||||
#include "../../../../plat/tcap/src/include/tcap_proc.h"
|
||||
#include "../../../../plat/xapp/src/mapp/map_code.h"
|
||||
#include "../../../../plat/xapp/src/mapp/map_acn.h"
|
||||
#include "../../../../plat/xapp/src/ixap.h"
|
||||
#include "../../../../plat/xapp/src/mapp/map_public.h"
|
||||
#include "../../../../plat/xapp/src/conv_prefix.h"
|
||||
|
||||
#endif
|
||||
830
mss/pps/src/include/ppsMibTable.h
Normal file
830
mss/pps/src/include/ppsMibTable.h
Normal file
@@ -0,0 +1,830 @@
|
||||
#ifndef PPSMIBTABLE_H
|
||||
#define PPSMIBTABLE_H
|
||||
|
||||
#include "../../../../plat/snmp/src/include/snmp.h"
|
||||
#include "../../../../plat/snmp/src/include/macro.h"
|
||||
#include "../../../../plat/radius/src/include/radius_if.h"
|
||||
|
||||
#include "ramdata.h"
|
||||
|
||||
#define EndLength 2 /* EOF,protect overflow */
|
||||
#define MAX_LANGUAGE_TYPES 5
|
||||
|
||||
#define MAX_INPUT_SMS 128
|
||||
#define MAX_TEXT_PROMPT 128
|
||||
|
||||
#define MAX_CHILD_COS_PER_PARENT 2
|
||||
|
||||
typedef enum _valueType
|
||||
{
|
||||
INTEGER = 2,
|
||||
OctetString = 4
|
||||
}valueType;
|
||||
|
||||
|
||||
typedef enum _PPS_oid {
|
||||
PPS_HEARTBEAT = 1,
|
||||
PPS_PARAMETER,
|
||||
PPS_CSTA,
|
||||
PPS_CDR,
|
||||
PPS_USERDATA
|
||||
}PPS_oid;
|
||||
|
||||
typedef enum _PPS_TYPE_DEF
|
||||
{
|
||||
CAP_TYPE_DISABLE,
|
||||
CAP_TYPE_CALL,
|
||||
CAP_TYPE_SMS,
|
||||
CAP_TYPE_BOTH
|
||||
}PPS_TYPE_DEF;
|
||||
|
||||
#define PPSOID 6
|
||||
|
||||
typedef enum _ppsParameter_oid{
|
||||
ServiceControl = 1,
|
||||
COSID ,
|
||||
SrfParameter,
|
||||
RouteVMS,
|
||||
PPSOID_FileOperation,
|
||||
Status,
|
||||
PPSOID_InitRequest,
|
||||
SMCLIRegisterOPR,
|
||||
PPSOID_COMMAND = 10
|
||||
}ppsParameter_oid;
|
||||
|
||||
|
||||
#define PpsMaxTitleLen 65
|
||||
#define MAX_SMS_LEN 100
|
||||
#define TABLE_ACTIVE_COMMAND 1
|
||||
#define TABLE_DESTROY_COMMAND 6
|
||||
|
||||
typedef struct _MnpPrefix
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u_char prefix[16+EndLength];
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}MnpPrefix;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SMS_ACCOUNT_BALANCE=0,
|
||||
SMS_ACCOUNT_PROMOTION=1,
|
||||
SMS_EXPIRED_ON=2,
|
||||
SMS_RECHARGE_ON=3,
|
||||
SMS_LAST_CALL_ON=4,
|
||||
SMS_LAST_RECEIVE_ON=5,
|
||||
SMS_AT=6,
|
||||
SMS_TO=7,
|
||||
SMS_FROM=8,
|
||||
SMS_ON=9,
|
||||
SMS_CMB_PROMPT=10,
|
||||
SMS_CMB_NOTIFY=11,
|
||||
|
||||
SMS_FREE_SERVICE_ACTIVE=12,
|
||||
SMS_FREE_SERVICE_DEACTIVE=13,
|
||||
SMS_FREE_SERVICE_ENQUIRY=14,
|
||||
SMS_FREE_SERVICE_ACTIVED_NOTIFY=15,
|
||||
SMS_FREE_SERVICE_DEACTIVED_NOTIFY=16,
|
||||
SMS_FREE_SERVICE_ACTIVE_ALREADY=17,
|
||||
SMS_FREE_SERVICE_DEACTIVE_ALREADY=18,
|
||||
SMS_FREE_SERVICE_DEACTIVED_EXPIRED=19,
|
||||
SMS_FREE_SERVICE_VALID_DAYS_LEFT=20,
|
||||
|
||||
SMS_WILL_TRANSFER_OUT=21,
|
||||
SMS_TRANSFERED_OUT=22,
|
||||
SMS_TRANSFERED_IN=23,
|
||||
SMS_SERVICE_NOT_APPLIED=24,
|
||||
SMS_TRANSFER_PROMPT=25,
|
||||
SMS_FORMAT_ERROR=26,
|
||||
SMS_INVALID_NUMBER=27,
|
||||
SMS_INSUFFICIENT_FEE=28,
|
||||
SMS_EXPIRED_ACCOUNT=29,
|
||||
SMS_YES_OR_NO=30,
|
||||
SMS_TRANSFER_SUCCESS=31,
|
||||
|
||||
SMS_POOL_CHILD_LOW_FEE=32,
|
||||
SMS_POOL_ADDED_CHILD=33,
|
||||
SMS_POOL_DELED_CHILD=34,
|
||||
SMS_POOL_BEEN_ADDED_CHILD=35,
|
||||
SMS_POOL_BEEN_DELED_CHILD=36,
|
||||
|
||||
SMS_CLEAR_FEE_NOTIFY=37,
|
||||
SMS_CAPGRPS_NOTIFY=38,
|
||||
SMS_NOT_REGISTER_PREPAID_USER=39,
|
||||
SMS_USSD_MENU=40,
|
||||
SMS_USSD_ERROR_INPUT=41,
|
||||
SMS_RECHARGE_INPUT_PIN=42,
|
||||
SMS_RECHARGE_INPUT_PIN_AGAIN=43,
|
||||
SMS_LOW_BALANCE_NOTIFY=44,
|
||||
SMS_USSD_COMPLETED=45,
|
||||
|
||||
SMS_OVERDRAFT_NOTIFICATION =46,
|
||||
SMS_GPRS_VOLUME_THIS_MONTH=47,
|
||||
SMS_GPRS_VOLUME_CONSUMED=48,
|
||||
SMS_GPRS_DURATION=49,
|
||||
SMS_GPRS_CHARGED=50,
|
||||
|
||||
SMS_GPRS_RECHARGE_SUCCESS =51,
|
||||
|
||||
SMS_PROMOTION_NEWS=52,
|
||||
SMS_FREE_SMS_NOTIFICATION=53,
|
||||
|
||||
SMS_RECHARGE_FAILED_NO_CARD=54,
|
||||
SMS_RECHARGE_FAILED_CARD_USED=55,
|
||||
SMS_RECHARGE_FAILED_CARD_EXPIRED=56,
|
||||
SMS_RECHARGE_FAILED_SYS_FAILURE=57,
|
||||
|
||||
SMS_CMB_REACH_MAX_LIMIT=58,
|
||||
SMS_CMB_AD=59,
|
||||
|
||||
SMS_ACTIVATION_NOTIFY=60,
|
||||
SMS_CAPSMS_NOTIFY=61,
|
||||
SMS_CAPSMS_1_NOTIFY=62,
|
||||
SMS_CAPSMS_2_NOTIFY=63,
|
||||
|
||||
SMS_TELL_ME_NUMBER=64,
|
||||
SMS_RENT_CHARGE=65,
|
||||
SMS_FRIEND_FAMILY_REG=66,
|
||||
SMS_FRIEND_FAMILY_REG_FAILED=67,
|
||||
SMS_FRIEND_FAMILY_SERVICE_SUSPEND=68,
|
||||
SMS_FRIEND_FAMILY_PLAN_EXHAUST=69,
|
||||
SMS_FRIEND_FAMILY_QUERY=70,
|
||||
SMS_FRIEND_FAMILY_SERIVCE_REACTIVATE=71,
|
||||
SMS_FRIEND_FAMILY_REMOVE=72,
|
||||
SMS_FRIEND_FAMILY_QUERY_NOT_REGISTERED=73,
|
||||
SMS_FRIEND_FAMILY_QUERY_NOT_PLAN=74,
|
||||
SMS_FRIEND_FAMILY_QUERY_SUSPENDT=75,
|
||||
SMS_FRIEND_FAMILY_QUERY_SUSPEND_REAC=76,
|
||||
SMS_FRIEND_FAMILY_QUERY_NO_LIMIT=77,
|
||||
SMS_BUNDLE_PLAN = 78,
|
||||
SMS_BUNDLE_PLAN_SUBSCRIBE_CMD = 79,
|
||||
SMS_BUNDLE_PLAN_SUBSCRIBE_PLEASE = 80,
|
||||
SMS_BUNDLE_PLAN_SUBSCRIBE_OK = 81,
|
||||
SMS_BUNDLE_PLAN_SUBSCRIBE_NOK = 82,
|
||||
SMS_BUNDLE_PLAN_QUERY = 83,
|
||||
SMS_BUNDLE_PLAN_DATA_WARN = 84,
|
||||
SMS_BUNDLE_PLAN_DATA_USEDUP = 85,
|
||||
SMS_BUNDLE_PLAN_DATA = 86,
|
||||
SMS_BUNDLE_PLAN_QUERY_DATA = 87,
|
||||
SMS_USSD_MENU1 = 88,
|
||||
SMS_BUNDLE_PLAN_USSD_SUB_CHOICE = 89,// has voice or sms, or have both
|
||||
SMS_BUNDLE_PLAN_USSD_DATA = 90,// no voice and sms
|
||||
SMS_BUNDLE_PLAN_NO_REFUND = 91,
|
||||
SMS_BUNDLE_PLAN_USSD_MENU = 92,
|
||||
SMS_BUNDLE_PLAN_NOT_APPLIED = 93,
|
||||
SMS_BUNDLE_PLAN_USSD_SUB_DATA_CHOICE=94,// no voice and sms
|
||||
SMS_BUNDLE_PLAN_USSD_SUB_MENU=95,// has voice or sms, or have both
|
||||
SMS_BUNDLE_PLAN_DATA_WARN_HAS_V = 96,
|
||||
SMS_BUNDLE_PLAN_VOICE_USEDUP = 97,
|
||||
SMS_BUNDLE_PLAN_SMS_USEDUP = 98,
|
||||
SMS_BUNDLE_PLAN_USSD_MENU1 = 99,
|
||||
|
||||
SMS_MAX_ITEM = 100 ,
|
||||
SMS_LAST_CALL_INFO = 101,
|
||||
SMS_LAST_SMS_INFO = 102,
|
||||
}SMS_SENTENCE;
|
||||
|
||||
typedef enum _PPS_USSD_OPERATON
|
||||
{
|
||||
USSD_OC_HOTLINE,
|
||||
USSD_OC_INQUIRY,
|
||||
USSD_OC_RECHARGE,
|
||||
USSD_OC_FEE_TRANSFER,
|
||||
USSD_OC_CALL_ME_BACK,
|
||||
USSD_OC_TELL_ME_NUMBER,
|
||||
USSD_OC_FRIEND_FAMILY_QUERY,
|
||||
USSD_OC_BUNDLE_PLAN,
|
||||
USSD_OC_BUNDLE_QUERY,
|
||||
USSD_OC_BUNDLE_PLAN_ALL,
|
||||
USSD_OC_EXIT,
|
||||
USSD_OC_MAX,
|
||||
}PPS_USSD_OPERATION;
|
||||
|
||||
typedef enum _ppsTableType
|
||||
{
|
||||
PromptResolutionTable = 20,
|
||||
MnpPrefixTable = 21,
|
||||
SmsSentenceTable = 22,
|
||||
Resered = 23,
|
||||
ThirdPartyInfoTable = 24,
|
||||
BasicTariffZoneTable = 25,
|
||||
IvrSourceTable = 26,
|
||||
SrfNumberTable = 27,
|
||||
ServiceNumberTable = 28,
|
||||
ServiceKeyTable = 29,
|
||||
VmsUserSegmentTable = 30,
|
||||
RadiusGsnTable = 31,
|
||||
RadiusSgsnTable = 32,
|
||||
BundlePlanTable = 33,
|
||||
/****************** cos tables ********************/
|
||||
CosTable = 50,
|
||||
TariffTable = 51,
|
||||
ServiceControlTable = 52,
|
||||
AccountValidityTable = 53,
|
||||
SmsNotificationInquiryTable = 54,
|
||||
RechargeCardValidityTable = 55,
|
||||
RechargePromotionTable = 56,
|
||||
CapPlanTable = 57,
|
||||
PoolAccountTable = 58,
|
||||
CosGprsTable = 59,
|
||||
FriendFamilyTable = 60,
|
||||
UssdServiceNumberTable = 61,
|
||||
UssdServiceKeyTable = 62,
|
||||
/****************** cos tables ********************/
|
||||
}ppsTableType;
|
||||
|
||||
typedef enum _ppsTableMaxItem
|
||||
{
|
||||
MaxPromptResolutionItem = 1,
|
||||
MaxMnpPrefixItem = 32,
|
||||
MaxSmsSentenceItem = SMS_MAX_ITEM,
|
||||
MaxThirdPartyInfoItem = 8,
|
||||
MaxBasicTariffZoneItem = 64,
|
||||
MaxIvrSourceItem = 1,
|
||||
MaxSrfNumberItem = 2,
|
||||
MaxServiceNumberItem = 16,
|
||||
MaxServiceKeyItem = 7,
|
||||
MaxVmsUserSegmentItem = 128,
|
||||
MaxRadiusGsnItem = RADIUS_MAX_NUM_OF_NAS,
|
||||
MaxRadiusSgsnItem = RADIUS_MAX_NUM_OF_NAS,
|
||||
/****************** cos tables ********************/
|
||||
MaxCosTableItem = 64,
|
||||
MaxTariffTableItem = 1,
|
||||
MaxServiceControlTableItem = 1,
|
||||
MaxAccountValidityTableItem = 1,
|
||||
MaxSmsNotificationInquiryTableItem = 1,
|
||||
MaxRechargeCardType = MAX_VALUE_TYPE,
|
||||
MaxcapPlanTableItem = 4,
|
||||
MaxPoolAccountTableItem = 1,
|
||||
MaxGprsTableItem = 1,
|
||||
MaxGprsCapPlan = 1,
|
||||
MaxFriendFamilyTableItem = 1,
|
||||
/****************** cos tables ********************/
|
||||
|
||||
/*** if you add items in any table,notify these value ***/
|
||||
MaxPromptResolutionReservedItem = 1,
|
||||
MaxMnpPrefixReservedItem = 1,
|
||||
MaxSmsSentenceReservedItem = 1,
|
||||
MaxThirdPartyInfoReservedItem = 1,
|
||||
MaxBasicTariffZoneReservedItem = 1,
|
||||
MaxIvrSourceReservedItem = 1,
|
||||
MaxSrfNumberReservedItem = 5,
|
||||
MaxServiceNumberReservedItem = 8,
|
||||
MaxServiceKeyReservedItem = 5,
|
||||
MaxVmsUserSegmentReservedItem = 1,
|
||||
MaxRadiusGsnReservedItem = 0,
|
||||
MaxCosTableReservedItem = 1,
|
||||
MaxTariffTableReservedItem = 1,
|
||||
MaxServiceControlReservedItem = 0,
|
||||
MaxAccountValidityReservedItem = 1,
|
||||
MaxSmsNotificationInquiryReservedItem = 1,
|
||||
MaxRechargeCardValidityReservedItem = 1,
|
||||
MaxRechargePromotionReservedItem = 1,
|
||||
MaxCapPlanReservedItem = 1,
|
||||
MaxPoolAccountReservedItem = 0,
|
||||
MaxGprsTableTableReservedItem = 1,
|
||||
/*** if you add items in any table,notify these value ***/
|
||||
}ppsTableMaxItem;
|
||||
|
||||
typedef enum _srfNumberPosition
|
||||
{
|
||||
SRF0Position = 0,
|
||||
SRF1Postion
|
||||
}srfNumberPosition;
|
||||
|
||||
typedef enum _serviceNumberPosition
|
||||
{
|
||||
HotLineNumberPosition = 0,
|
||||
InquiryNumberPosition,
|
||||
ScratchCardRechargeNumberPosition,
|
||||
CreditCardRechargeNumberPosition,
|
||||
ThirdPartyRechargeNumberPosition,
|
||||
CustomerCareCenterNumberPosition,
|
||||
RechargeNumberPosition,
|
||||
OPRNumberPosition,
|
||||
VirtualCallingCardNumberPosition,
|
||||
PalimRegisterNumberPosition, //2010-03-08
|
||||
PoolAccountPosition,
|
||||
FeeTransferPosition,
|
||||
FreeServicePosition,
|
||||
CallMeBackPosition,
|
||||
GPRSPrepaidPostion,
|
||||
TellMeNumber,
|
||||
FriendFamilyPosition,
|
||||
MAXServicePostion,
|
||||
|
||||
}serviceNumberPosition;
|
||||
|
||||
typedef struct _PromptResolution
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 currencyResolution;
|
||||
u8 dataFormat;
|
||||
u8 currencySymbolPosition;
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}PromptResolution;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8 language[MAX_SMS_LEN+EndLength];
|
||||
}LANGUAGE_INFO;
|
||||
|
||||
typedef struct _SmsSentence
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 english[MAX_SMS_LEN+EndLength];
|
||||
LANGUAGE_INFO language[MAX_LANGUAGE_TYPES];
|
||||
u8 existFlag;
|
||||
}SmsSentence;
|
||||
|
||||
typedef struct _LastCallInfo
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 lastCallSentOn[32+EndLength];
|
||||
u8 lastCallReceiveOn[32+EndLength];
|
||||
u8 at[8+EndLength];
|
||||
u8 to[8+EndLength];
|
||||
u8 from[8+EndLength];
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}LastCallInfo;
|
||||
|
||||
typedef struct _ThirdPartyInfo
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u_char serviceID[8+EndLength];
|
||||
u_char servicePassword[8+EndLength];
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}ThirdPartyInfo;
|
||||
|
||||
typedef struct _BasicTariffZone
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 mcc[3+EndLength];
|
||||
u8 mnc[3+EndLength];
|
||||
u16 lac;
|
||||
u16 cellId;
|
||||
u32 moTariffId;
|
||||
u32 mtTariffId;
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}BasicTariffZone;
|
||||
|
||||
typedef struct _IvrSource
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 inquiry;
|
||||
u8 recharge;
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}IvrSource;
|
||||
|
||||
typedef struct _SrfNumber
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 number[16+EndLength];
|
||||
u8 reachable;
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}SrfNumber;
|
||||
|
||||
typedef struct _ServiceNumber
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 number[16+EndLength];
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}ServiceNumber;
|
||||
|
||||
typedef struct _ServiceKey
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 key;
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}ServiceKey;
|
||||
|
||||
typedef struct _VmsUserSegment
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 startMsisdn[16+EndLength];
|
||||
u8 endMsisdn[16+EndLength];
|
||||
u8 vmsPLMNserviceNumber[16+EndLength];
|
||||
u8 vmsPSTNserviceNumber[16+EndLength];
|
||||
u8 leaveMessageNumber[16+EndLength];
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}VmsUserSegment;
|
||||
|
||||
typedef struct _PPS_RADIUS_NAS_INFO{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
ulong volumeMeterUnit;/*byte */
|
||||
ulong durationMeterUnit;/*s */
|
||||
u8 tariffID;
|
||||
RADIUS_NAS_INFORMATION nasInfo;
|
||||
u8 existFlag;
|
||||
}PPS_RADIUS_NAS_INFO;
|
||||
|
||||
typedef struct _PPS_RADIUS_SGSN_INFO{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
DWORD sgsnIP;
|
||||
u8 cosID;
|
||||
u8 apnName[16];
|
||||
u8 tariffID;
|
||||
u8 reserved[15];
|
||||
u8 existFlag;
|
||||
}PPS_RADIUS_SGSN_INFO;
|
||||
|
||||
|
||||
/********************** COS tables ***********************/
|
||||
typedef struct _promotion_plan_control
|
||||
{
|
||||
u_long rechargePromotionStartDate;
|
||||
u_long rechargePromotionEndDate;
|
||||
|
||||
struct{
|
||||
BOOL IDD;
|
||||
BOOL NDD;
|
||||
BOOL LOCAL;
|
||||
}usedForCall;
|
||||
|
||||
struct{
|
||||
BOOL IDD;
|
||||
BOOL NDD;
|
||||
BOOL LOCAL;
|
||||
}usedForSMS;
|
||||
|
||||
struct{
|
||||
BOOL allowed;
|
||||
}usedForGPRS;
|
||||
|
||||
struct{
|
||||
BOOL transfer;
|
||||
u_char transferPrioriy;
|
||||
}transfer;
|
||||
}promotion_plan_control;
|
||||
|
||||
typedef struct _CosTariff
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 moTariffID;
|
||||
u8 mtTariffID;
|
||||
u8 chargeBy;
|
||||
u8 capPlanResetDay;
|
||||
promotion_plan_control promotionUseControl;
|
||||
u8 promotionUsedForRoDebit;
|
||||
u8 reserve[31];
|
||||
u8 existFlag;
|
||||
}CosTariff;
|
||||
|
||||
typedef struct _CosServiceControl
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 moThresholdSet;
|
||||
int moMinimumBalance;
|
||||
u8 mtChargeFlag;
|
||||
u8 mtBalanceControl;
|
||||
int mtBalanceThreshold;
|
||||
u8 poolAccountFlag;
|
||||
u8 poolAccountChangeChargeFlag;
|
||||
u8 poolAccountFreeChangeTimes;
|
||||
u8 closeUserGroupService;
|
||||
u8 rechargeViaCreditCard;
|
||||
u8 creditVault;
|
||||
u16 creditVaultAmount;
|
||||
u8 relatedCosID;
|
||||
u8 freeSMSActiveDays;
|
||||
u8 freeSMSRentType;
|
||||
u8 callMeBackThreshold;
|
||||
u8 callMeBackMaxTimes;
|
||||
u8 mtSMSCharge;
|
||||
u8 validiDaysActivatedByInquiringAccountWithZeroBalance0;
|
||||
u8 actionWhenMOorMTExpired; /*0=mo,1=MT */
|
||||
// u16 validiDaysActivatedByInquiringAccountWithZeroBalance;
|
||||
// u16 sReserved[2];
|
||||
u16 serviceNumberFlag;
|
||||
u16 smsServiceFlag;
|
||||
u16 ussdServiceFlag;
|
||||
|
||||
u8 bundle_data_warning_threashold; /*in 5 MB */
|
||||
u8 bundle_data_warning_threashold_low; /*in 5 MB */
|
||||
u8 event_charging_flag;// 0, disable; 1, enable;
|
||||
u8 cap_or_bundle_in_tariff;// Cap or Bundle used in Tariff Table: 0, cap; 1, bundle;
|
||||
u8 bundle_plan_contorl; //0=bundle plan with data/voice/sms, 1=data plan only
|
||||
u8 reserve[11];
|
||||
u8 existFlag;
|
||||
|
||||
}CosServiceControl;
|
||||
|
||||
typedef struct _CosAccountValidity
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u16 maxAccountValidityDays;
|
||||
u8 actionWhenAccountExpires;
|
||||
u16 daysKeepingAnExpiredAccount;
|
||||
u8 actionAfterDaysKeepingAnExpiredAccount;
|
||||
u8 actionAfterRecharge;
|
||||
u8 actionAfterBalanceDepleted;
|
||||
u8 validDaysChangeTo;
|
||||
u8 activiationByInquiryIs;
|
||||
u8 validiDaysActivatedByInquiringAccountWithZeroBalance0;
|
||||
u8 actionWhenMOorMTExpired; /*0=mo,1=MT */
|
||||
u16 validiDaysActivatedByInquiringAccountWithZeroBalance;
|
||||
u8 reserve[27];
|
||||
u8 bundlePlanIDWhenActivated;
|
||||
u8 existFlag;
|
||||
}CosAccountValidity;
|
||||
|
||||
|
||||
typedef struct _CosSmsNotificationInquiry
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 smsNotificationWhenRecharge;
|
||||
u8 smsNotificationWhenInquiry;
|
||||
u8 smsNotificationWhenExpired;
|
||||
u8 theDaysSendingSMSBeforeExpiredDay;
|
||||
u8 smsNotificationWhenBalanceInsufficient;
|
||||
u16 insufficientBalanceThreshold;
|
||||
u8 chargeWhenInquiryBySMS;
|
||||
u8 freeInquiryPerDay;
|
||||
u8 smsNotificationWhenCleanBalance; //2010-03-08
|
||||
u8 smsNotificationWhenCapPlanChanged; //2010-03-08
|
||||
u8 smsNotificationWhenApplyOverdraft;
|
||||
u8 smsNotificationWhenRentCharge;
|
||||
u8 smsNotificationWhenFriendFamilyServiceReg;
|
||||
u8 smsNotificationWhenFriendFamilyServiceSuspend;
|
||||
u8 smsNotificationWhenFriendFamilyPlanExhaust;
|
||||
u8 smsNotificationWhenFriendFamilyServiceRemoved;
|
||||
u8 reserve[26];
|
||||
u8 existFlag;
|
||||
}CosSmsNotificationInquiry;
|
||||
|
||||
typedef struct _CosRechargeCardValidity
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u16 cardCredit;
|
||||
u16 moValidity;
|
||||
u16 mtValidity;
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}CosRechargeCardValidity;
|
||||
|
||||
|
||||
typedef struct _CosRechargePromotion
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
int rechargeCardCredit;
|
||||
int promotionBonus;
|
||||
int promotionValidity;
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}CosRechargePromotion;
|
||||
|
||||
typedef struct _CosCapPlan
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 flag;
|
||||
u8 type;
|
||||
u32 threshold0;
|
||||
u32 threshold1;
|
||||
u32 threshold2;
|
||||
u8 tariffID0;
|
||||
u8 tariffID1;
|
||||
u8 tariffID2;
|
||||
u8 tariffID3;
|
||||
u8 reserve[32];
|
||||
u8 existFlag;
|
||||
}CosCapPlan;
|
||||
|
||||
typedef struct{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u_char role;
|
||||
struct{
|
||||
struct
|
||||
{
|
||||
u_char cosIDForChild[MAX_CHILD_COS_PER_PARENT];
|
||||
}parent;
|
||||
struct
|
||||
{
|
||||
u_char isRechargeAllowed;
|
||||
u_char isTransferAllowed;
|
||||
u_char periodicTransferOrAutoByParent;
|
||||
u_short maxCallsPerDay;
|
||||
u_short maxSMSPerDay;
|
||||
u_long maxFeePerDay;
|
||||
}child;
|
||||
}roleParty;
|
||||
u8 existFlag;
|
||||
}COS_Pool_Account;
|
||||
|
||||
typedef struct _GPRS_VOLUME_CAP_PLAN{
|
||||
u8 type;/* 0:cap by volume;1:cap by charge */
|
||||
u32 threshold0;/* 0-1024*1024*1024KB */
|
||||
u32 threshold1;/* 0-1024*1024*1024KB */
|
||||
u32 threshold2;/* 0-1024*1024*1024KB */
|
||||
u8 tariffID0;
|
||||
u8 tariffID1;
|
||||
u8 tariffID2;
|
||||
u8 tariffID3;
|
||||
}GPRS_VOLUME_CAP_PLAN;
|
||||
|
||||
typedef struct _PPS_COS_RADIUS_ITEM
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 gprsChargeFlag;/*0:disable;1:enable */
|
||||
u32 miniBalanceForGprs;/*<=0:unlimited;other:limited */
|
||||
ulong inactiveSessionLimit;/*0:unlimit;others:limited */
|
||||
u8 notificationWhenSessionTerminate;
|
||||
u_short maxSmsForGprsNotificationPerDay;
|
||||
ulong maxVolumeQuotaEachTime;/* byte */
|
||||
ulong volumeThresholdDiff;/* byte */
|
||||
ulong maxDurationQuotaEachTime;/* s */
|
||||
ulong durationThresholdDiff;/* s */
|
||||
u8 gprsChargedBy;/*0:define by cos;1:defined by incoming GSN IP */
|
||||
GPRS_VOLUME_CAP_PLAN capPlan[MaxGprsCapPlan];
|
||||
u8 reserved[64];
|
||||
u8 existFlag;
|
||||
}PPS_COS_RADIUS_ITEM;
|
||||
|
||||
#define MAX_FAVORITE_PALN 6
|
||||
|
||||
typedef struct CosFriendFamilyPlan
|
||||
{
|
||||
u16 rentCharge;
|
||||
u8 maxNumbers;
|
||||
u16 freeSMS; /* 0 means no limitation */
|
||||
u32 freeCallDuration; /* 0 means no limitation */
|
||||
u8 rentID; /*1-8 index of rent tariff */
|
||||
u8 cReserved[4];
|
||||
u16 sReserved[2];
|
||||
u32 iReserved[2];
|
||||
}CosFriendFamilyPlan;
|
||||
|
||||
typedef struct CosFriendFamilyControl
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u8 friendFamilyFlag;
|
||||
u8 friendFamilyChangeChargeFlag;
|
||||
u8 friendFamilyFreeChangeTimes;
|
||||
u8 friendFamilyNumberTypeLocal;
|
||||
u8 friendFamilyNumberTypeNDD;
|
||||
u8 friendFamilyNumberTypeIDD;
|
||||
u16 balanceThresholdForFriendFamilyCall;
|
||||
u8 keepOrRemoveFriendFamilyNumber;
|
||||
u16 balanceThresholdToKeepFriendFamilyNumber;
|
||||
u8 cReserved[32];
|
||||
u16 sReserved[8];
|
||||
u32 lReserved[4];
|
||||
CosFriendFamilyPlan friendFamilyPlan[MAX_FAVORITE_PALN];
|
||||
u8 existFlag;
|
||||
}CosFriendFamilyControl;
|
||||
|
||||
typedef struct _COSTable
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
CosTariff tariff[MaxTariffTableItem+MaxTariffTableReservedItem];
|
||||
CosServiceControl serviceControl[MaxServiceControlTableItem+MaxServiceControlReservedItem];
|
||||
CosAccountValidity accountValidity[MaxAccountValidityTableItem+MaxAccountValidityReservedItem];
|
||||
CosSmsNotificationInquiry smsNotificationInquiry[MaxSmsNotificationInquiryTableItem+MaxSmsNotificationInquiryReservedItem];
|
||||
CosRechargeCardValidity rechargeCardValidity[MaxRechargeCardType+MaxRechargeCardValidityReservedItem];
|
||||
CosRechargePromotion rechargePromotion[MaxRechargeCardType+MaxRechargePromotionReservedItem];
|
||||
CosCapPlan capPlan[MaxcapPlanTableItem+MaxCapPlanReservedItem];
|
||||
COS_Pool_Account poolAccount[MaxPoolAccountTableItem+MaxPoolAccountReservedItem];
|
||||
PPS_COS_RADIUS_ITEM gprs[MaxGprsTableItem+MaxGprsTableTableReservedItem];
|
||||
CosFriendFamilyControl friendFamilyControl[MaxFriendFamilyTableItem+MaxServiceControlReservedItem];
|
||||
u8 existFlag;
|
||||
}COSTable;
|
||||
/********************** COS tables ***********************/
|
||||
#define MAX_BUNDLE_PLANS 16
|
||||
typedef struct serviceBundlePlan
|
||||
{
|
||||
u_char title[PpsMaxTitleLen];
|
||||
u32 charge;
|
||||
u32 data;
|
||||
u16 mo_voice;
|
||||
u16 mt_voice;
|
||||
u16 sms;
|
||||
u16 validity;
|
||||
u8 apply_flag;
|
||||
u8 apply_code;
|
||||
u8 cRes[3];
|
||||
u16 sRes[4];
|
||||
u8 existFlag;
|
||||
}serviceBundlePlan;
|
||||
|
||||
typedef struct _PpsTable
|
||||
{
|
||||
PromptResolution promptResolution[MaxPromptResolutionItem+MaxPromptResolutionReservedItem];
|
||||
MnpPrefix mnpPrefix[MaxMnpPrefixItem+MaxMnpPrefixReservedItem];
|
||||
SmsSentence smsSentence[MaxSmsSentenceItem+MaxSmsSentenceReservedItem];
|
||||
ThirdPartyInfo thirdPartyInfo[MaxThirdPartyInfoItem+MaxThirdPartyInfoReservedItem];
|
||||
BasicTariffZone basicTariffZone[MaxBasicTariffZoneItem+MaxBasicTariffZoneReservedItem];
|
||||
IvrSource ivrSource[MaxIvrSourceItem+MaxIvrSourceReservedItem];
|
||||
SrfNumber srfNumber[MaxSrfNumberItem+MaxSrfNumberReservedItem];
|
||||
ServiceNumber serviceNumber[MaxServiceNumberItem+MaxServiceNumberReservedItem];
|
||||
ServiceKey serviceKey[MaxServiceKeyItem+MaxServiceKeyReservedItem];
|
||||
VmsUserSegment vmsUserSegment[MaxVmsUserSegmentItem+MaxVmsUserSegmentReservedItem];
|
||||
PPS_RADIUS_NAS_INFO gsn[MaxRadiusGsnItem];
|
||||
PPS_RADIUS_SGSN_INFO sgsn[MaxRadiusSgsnItem];
|
||||
COSTable cosTable[MaxCosTableItem+MaxCosTableReservedItem];
|
||||
COSTable reserveTable[MaxCosTableReservedItem];
|
||||
ServiceNumber ussdServiceNumber[MaxServiceNumberItem+MaxServiceNumberReservedItem];
|
||||
ServiceKey ussdServiceKey[10+3];
|
||||
|
||||
serviceBundlePlan bundlePlans[MAX_BUNDLE_PLANS];
|
||||
|
||||
SmsSentence smsExtSentence[MaxSmsSentenceItem+MaxSmsSentenceReservedItem];
|
||||
|
||||
|
||||
}PpsTable;
|
||||
|
||||
|
||||
typedef struct _PpsServiceConrol{
|
||||
u32 licenseduser;
|
||||
u8 cdrFlag;
|
||||
u8 maxRechargeFailedNum;
|
||||
int maxBalance;// for balance overflow prevention
|
||||
u_char currencyName[8+EndLength];
|
||||
u8 cos_group_flag;
|
||||
u8 support_mnp_flag;
|
||||
u8 callingCardVadilityDays; //2010-03-08
|
||||
u8 truncation_flag;
|
||||
u8 mt_release_for_no_charge;
|
||||
u8 mo_release_for_no_charge;
|
||||
u8 delay_timer_for_roaming;
|
||||
u8 vms_allways_go;
|
||||
u8 languageSmEncodeType[MAX_LANGUAGE_TYPES];
|
||||
u8 transfer_idd_prefix;
|
||||
u8 external_vc;
|
||||
u8 charge_by_lac_flag; /* 0=by lac+ci, 1=by ci */
|
||||
u8 not_change_expiry_date_when_transfer;
|
||||
u8 only_normal_can_transfer_balance;
|
||||
u8 max_call_duration; /* in second*/
|
||||
u8 gy_delay_timer0;
|
||||
u8 gy_delay_timer1;
|
||||
char smsc_addr[12];
|
||||
u8 ussd_callback_service_key; /*service key for USSD_CALLBACK feature */
|
||||
u8 ucbc_number[16]; /* the GT number of UCBC entity */
|
||||
u8 answer_timer; /* in seconds */
|
||||
u8 gy_not_support_threshold;
|
||||
u8 gy_report_data_method; /* 0=segment, 1=accumulated */
|
||||
u8 balance_transfer_resolution; /*0=minimum , 1= currency resolution */
|
||||
u8 nai_for_diameter_proxy;
|
||||
u8 mt_play_voice_flag;
|
||||
u8 tcp_sync_flag;
|
||||
u8 smpp_over_tcp_flag;
|
||||
u8 gy_postpaid_flag;
|
||||
u8 log_func_flag;
|
||||
u8 calling_card_method;
|
||||
u8 calling_card_cos_id;
|
||||
u8 work_with_crm;
|
||||
u8 mt_not_charged_for_cdr;
|
||||
u8 crm_free_seconds;
|
||||
u8 crm_status_validity;
|
||||
u8 crm_days_before_validity;
|
||||
u8 crm_notification_for_event;
|
||||
u8 cellid_present_in_ccr;
|
||||
u8 reserved[8];
|
||||
/******* below is table ********/
|
||||
}PpsServiceConrol;
|
||||
|
||||
|
||||
/*
|
||||
CT_LOCAL_CALL_OUT=100,
|
||||
CT_TRUNK_CALL_OUT, // Local city call out
|
||||
CT_NDD_CALL_OUT, // Nation l.d.tel
|
||||
CT_HMT_CALL_OUT, // Hong Kong, Macao, TaiWan
|
||||
CT_IDD_CALL_OUT, // International L.D.Tel
|
||||
CT_LOCAL_CALL_IN,
|
||||
CT_TRUNK_CALL_IN,
|
||||
|
||||
*/
|
||||
#define MAX_CALL_TYPE_DES 10
|
||||
typedef struct ocsCRMCallTypeDes{
|
||||
char equal_or_contain; //0=equal, 1=contain
|
||||
char description[MAX_CALL_TYPE_DES][128]; //0=LOCAL CALL OUT...
|
||||
}_ocsCRMCallTypeDes;
|
||||
|
||||
typedef struct ocsCRMConrol{
|
||||
char base_prefix_file_name[128];
|
||||
_ocsCRMCallTypeDes crm_call_type;
|
||||
}_ocsCRMConrol;
|
||||
|
||||
|
||||
typedef struct _VmsRouteParam
|
||||
{
|
||||
u_char plmnServiceNumber[16+EndLength];
|
||||
u_char pstnServiceNumber[16+EndLength];
|
||||
u_char leaveMessageNumber[16+EndLength];
|
||||
u8 routeMethodOption;
|
||||
u8 routeNumberOption;
|
||||
u8 isPostpaidAllowed;
|
||||
u_char ring_back_service_key;
|
||||
u8 reserved[64];
|
||||
}VmsRouteParam;
|
||||
|
||||
#endif
|
||||
8
mss/pps/src/include/pps_public.h
Normal file
8
mss/pps/src/include/pps_public.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef PPS_PULIC_H
|
||||
#define PPS_PULIC_H
|
||||
|
||||
int pps_init(int sysCap, int sysID,u_long localip,u_long peerip,char *sn,int sync_flag);
|
||||
void pps_proc();
|
||||
int pps_exit(int flag);
|
||||
|
||||
#endif
|
||||
8
mss/pps/src/include/pps_redis.h
Normal file
8
mss/pps/src/include/pps_redis.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef _PPS_REDIS__H_
|
||||
#define _PPS_REDIS__H_
|
||||
#include "ppsm.h"
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
31
mss/pps/src/include/ppsinf.h
Normal file
31
mss/pps/src/include/ppsinf.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
**
|
||||
** file name: ppsinf.h
|
||||
**
|
||||
** Interface defined include shared memory key and permission,
|
||||
** IP address and port.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef PPSINF__H
|
||||
#define PPSINF__H
|
||||
|
||||
//#define DEBUG_SHM_KEY 0x05010000
|
||||
//#define DEBUG_SHM_PERM 0664
|
||||
|
||||
#define RAMDATA_SHM_KEY 0x05020000 /* key of shared memory about
|
||||
state machine RAM data,
|
||||
it will provide fast real time
|
||||
update of the date. */
|
||||
#define RAMDATA_SHM_PERM 0664 /* Permission flag of the shared memory */
|
||||
|
||||
#define SMMP_SHM_KEY 0x05030000 /* key of shared memory about
|
||||
state machine RAM data,
|
||||
it will provide fast real time
|
||||
update of the date. */
|
||||
#define SMMP_SHM_PERM 0664 /* Permission flag of the shared memory */
|
||||
|
||||
#define TARIFF_SHM_KEY 0x05040000
|
||||
#define TARIFF_SHM_PERM 0664
|
||||
|
||||
#endif
|
||||
1093
mss/pps/src/include/ppsm.h
Normal file
1093
mss/pps/src/include/ppsm.h
Normal file
File diff suppressed because it is too large
Load Diff
59
mss/pps/src/include/ppsoid.h
Normal file
59
mss/pps/src/include/ppsoid.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
**
|
||||
**
|
||||
** file name: ppsoid.h
|
||||
**
|
||||
** Prepaid server object id defination tree,
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef PPSOID__H
|
||||
#define PPSOID__H
|
||||
#include <sys/types.h>
|
||||
#include "../../../../plat/snmp/src/include/snmp.h"
|
||||
|
||||
typedef enum {
|
||||
WAVELOOP_SYSTEM=1,
|
||||
WAVELOOP_OMC,
|
||||
WAVELOOP_HLR,
|
||||
WAVELOOP_VLR,
|
||||
WAVELOOP_CDR,
|
||||
WAVELOOP_LAN,
|
||||
WAVELOOP_CSU,
|
||||
WAVELOOP_VPS,
|
||||
WAVELOOP_PCR,
|
||||
WAVELOOP_BSC,
|
||||
WAVELOOP_BTS,
|
||||
WAVELOOP_PPS=0x92,
|
||||
} _WAVEloop_oid;
|
||||
|
||||
typedef enum {
|
||||
ppsParam_DB=2,
|
||||
PPS_ACCOUNT_DB,
|
||||
PPS_RECHARGE_DB,
|
||||
PPS_TARIFF_DB,
|
||||
} _pps_database_id;
|
||||
|
||||
typedef enum {
|
||||
PARAM_GLOBAL=1,
|
||||
PARAM_ZONE,
|
||||
PARAM_IVR_COMMON,
|
||||
PARAM_IVR_SYNTAX,
|
||||
PARAM_IVR_DIGIT,
|
||||
} _ppsParam_db;
|
||||
|
||||
typedef enum {
|
||||
CDR_STATISTICS=1,
|
||||
CDR_CHARGESUM,
|
||||
CDR_DURATIONSUM,
|
||||
} _pps_csta_oid;
|
||||
|
||||
|
||||
#define PPS_CONFIGURE 0x02
|
||||
|
||||
int initSNMP();
|
||||
int snmpSetPPS(BYTE oidLen, DWORD *oid, BYTE *pdata, u_short dataLen);
|
||||
int snmpGetPPS(BYTE oidLen, DWORD *oid, BYTE *pdata, BYTE *vartype);
|
||||
void snmpTrapPPS(BYTE oidLen, DWORD *oid, BYTE *pdata, u_short dataLen,snmp_addr *addr);
|
||||
|
||||
#endif /* PPSOID__H */
|
||||
82
mss/pps/src/include/precard.h
Normal file
82
mss/pps/src/include/precard.h
Normal file
@@ -0,0 +1,82 @@
|
||||
#ifndef _PRECARD_H
|
||||
#define _PRECARD_H
|
||||
|
||||
#include "ramdata.h"
|
||||
|
||||
#define MAX_USED_CARD_STORED 8192
|
||||
#define MAX_CLIMAX_CARD_SEGMENT 50 /* 5000 cards stored */
|
||||
#define MAX_PREPAID_CARD_NUM (MAX_CARD_SEGMENT*MAX_CARD_NUM_PSEG)
|
||||
|
||||
typedef struct USED_PREPAID_CARD_BUFFER{
|
||||
int ptrHead;
|
||||
int ptrTail;
|
||||
_recharge_card_info used_precard[MAX_USED_CARD_STORED];
|
||||
}_USED_REPAID_CARD_BUFFER;
|
||||
|
||||
typedef struct free_mem_quence
|
||||
{
|
||||
// int front_ptr;
|
||||
// int rear_ptr;
|
||||
int pWriteSub;
|
||||
int free_pos[MAX_PREPAID_CARD_NUM+1];
|
||||
}_free_mem_quence;
|
||||
|
||||
typedef struct climax_quence
|
||||
{
|
||||
int counter;
|
||||
int store_pos[MAX_PREPAID_CARD_NUM];
|
||||
int store_pos_card_no[MAX_PREPAID_CARD_NUM];
|
||||
u_char card_pwd[MAX_PREPAID_CARD_NUM][MAX_CARD_HRN_BLEN];
|
||||
long long card_no[MAX_PREPAID_CARD_NUM];
|
||||
}_climax_quence;
|
||||
|
||||
typedef struct card_index
|
||||
{
|
||||
_free_mem_quence free_quence;
|
||||
_climax_quence card_quence;
|
||||
}_card_index;
|
||||
|
||||
typedef enum SCF_RCM_OC
|
||||
{
|
||||
OC_NULL,
|
||||
OC_UPDATE_CARD,
|
||||
OC_UPDATE_CARD_ACK,
|
||||
}_SCF_RCM_OC;
|
||||
|
||||
typedef enum SCF_RCM_RESULT
|
||||
{
|
||||
OC_RESULT_OK,
|
||||
OC_RESULT_NO_CARD,
|
||||
OC_RESULT_CARD_USED,
|
||||
OC_RESULT_CARD_EXPIRED,
|
||||
OC_RESULT_SYSTEM_FAILURE,
|
||||
}_SCF_RCM_RESULT;
|
||||
|
||||
typedef struct scf_rcm_msg{
|
||||
u_short invoke_id;
|
||||
u_char ocode;
|
||||
u_char result;
|
||||
u_char card_pwd[MAX_CARD_HRN_BLEN];
|
||||
char msisdn[32];
|
||||
_recharge_card_info card_data;
|
||||
}_scf_rcm_msg;
|
||||
|
||||
int StorePrepaidCard(int *head_no, int head);
|
||||
int InquiryPrepaidCardStorePos(long long head);
|
||||
void CardHeadInDecrement(int flag);
|
||||
void CardNumberInDecrement(int flag);
|
||||
int ImportPrepaidCardData(char *carddata);
|
||||
int RechargeCardRequest(u_short proc_id,char *card_hrn,int *result);
|
||||
int SendPrepaidCardRealSync(int instance,int ocode);
|
||||
int UpdateRechargeCard(u_short proc_id, int status);
|
||||
int SetPrepaidCardByOMC(u_char oidlen, DWORD *oid, u_char *pdata, u_short datalen);
|
||||
int GetUsedPrepaidCard(u_char oidlen, DWORD *oid, u_char *pdata, BYTE *vartype);
|
||||
int SetPrepaidCardFaceValue(long face_value);
|
||||
void MoveUsedCardToBuffer(int instance);
|
||||
void DeletePrepaidCardHead(int cardhead);
|
||||
|
||||
float ocs_get_calling_card_left_balance(int head, int tail);
|
||||
int UpdateRechargeCardBalance(_card_info *cardshmp, float charge);
|
||||
|
||||
#endif
|
||||
|
||||
102
mss/pps/src/include/public.h
Normal file
102
mss/pps/src/include/public.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
**
|
||||
** File name: public.h
|
||||
**
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _PPS_PUBLIC__H
|
||||
#define _PPS_PUBLIC__H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef _T_BYTE
|
||||
#define _T_BYTE
|
||||
typedef unsigned char BYTE;
|
||||
#endif
|
||||
|
||||
#ifndef _T_WORD
|
||||
#define _T_WORD
|
||||
typedef unsigned short WORD;
|
||||
#endif
|
||||
|
||||
#ifndef _T_DWORD
|
||||
#define _T_DWORD
|
||||
typedef unsigned int DWORD;
|
||||
#endif
|
||||
|
||||
#ifndef _T_BOOL
|
||||
#define _T_BOOL
|
||||
typedef int BOOL;
|
||||
#endif
|
||||
|
||||
#ifndef NORMAL
|
||||
#define NORMAL (1)
|
||||
#endif
|
||||
|
||||
#ifndef ABNORMAL
|
||||
#define ABNORMAL (-1)
|
||||
#endif
|
||||
|
||||
#ifndef STANDBY
|
||||
#define STANDBY (0)
|
||||
#endif
|
||||
|
||||
#ifndef SUCCESS
|
||||
#define SUCCESS (0)
|
||||
#endif
|
||||
|
||||
#ifndef FAILURE
|
||||
#define FAILURE (-1)
|
||||
#endif
|
||||
|
||||
//#ifndef OVERFLOW
|
||||
//#define OVERFLOW (-1)
|
||||
//#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE (1)
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
#endif
|
||||
|
||||
#ifndef YES
|
||||
#define YES (1)
|
||||
#endif
|
||||
|
||||
#ifndef NO
|
||||
#define NO (0)
|
||||
#endif
|
||||
|
||||
#ifndef LED_ON
|
||||
#define LED_ON (1)
|
||||
#endif
|
||||
|
||||
#ifndef LED_OFF
|
||||
#define LED_OFF (0)
|
||||
#endif
|
||||
|
||||
#ifndef ERROR
|
||||
#define ERROR (-1)
|
||||
#endif
|
||||
|
||||
#ifndef EMPTY
|
||||
#define EMPTY (0)
|
||||
#endif
|
||||
|
||||
//#define BUFSIZE 8196
|
||||
|
||||
//#define MAXBUFLEN 8196
|
||||
//#define MAXLINE 4096
|
||||
|
||||
typedef enum _number_type {
|
||||
T_BIN, T_OCT, T_DEC, T_HEX
|
||||
} _number_type;
|
||||
|
||||
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
#endif /* PUBLIC__H */
|
||||
555
mss/pps/src/include/ramdata.h
Normal file
555
mss/pps/src/include/ramdata.h
Normal file
@@ -0,0 +1,555 @@
|
||||
/*
|
||||
** The module Copyright (C) 2000-2008 interWAVE Inc.
|
||||
** Written completely by Liang Hongbin
|
||||
*/
|
||||
|
||||
#ifndef RAMDATA__H
|
||||
#define RAMDATA__H
|
||||
#include <sys/types.h>
|
||||
|
||||
#define RAMDATA_PACK_SIZE 1024
|
||||
#define RAMDATA_PACK_NUM (60*1024)
|
||||
#define RAMDATA_BLOCK_SIZE (RAMDATA_PACK_SIZE*RAMDATA_PACK_NUM) /* Ram block size is 24MB */
|
||||
|
||||
#define T_LOW_BALANCE 1
|
||||
#define T_EXPIRED 1
|
||||
|
||||
#define POOL_MAX_CHILD 5
|
||||
|
||||
#define OCS_WITH_CRM 1
|
||||
|
||||
typedef enum account_status {
|
||||
T_FRESH, /* fresh account, can't dial in or out,
|
||||
but can recharge. */
|
||||
T_NORMAL, /* normal account */
|
||||
T_SUSPEND,
|
||||
T_BLACKLIST,
|
||||
T_RELEASED,
|
||||
T_OPRTRIAL,
|
||||
T_DISABLE,
|
||||
MAX_USER_TYPE,
|
||||
|
||||
T_EXTERNAL=10,
|
||||
} _account_status;
|
||||
|
||||
typedef struct data_info
|
||||
{
|
||||
u_char version[3];
|
||||
u_long dataSize;
|
||||
}_data_info;
|
||||
|
||||
typedef enum favorite_number{
|
||||
NOT_FAVORITE_NUMBER,
|
||||
FAVORITE_NUMBER,
|
||||
}_favorite_number;
|
||||
|
||||
typedef enum last_call{
|
||||
LST_MO_CALL,
|
||||
LST_MT_CALL,
|
||||
LST_MF_CALL,
|
||||
LST_MO_SMS,
|
||||
}_last_call;
|
||||
|
||||
#define MAX_FAVORITE_NUMBERS 5
|
||||
#define MAX_MSISDN_BLEN 10
|
||||
#define MIN_MSISDN_ALEN 6
|
||||
#define MAX_MSISDN_ALEN 16
|
||||
#define MAX_PIN_LEN 6
|
||||
#define MAX_HOME_LOCATION 4
|
||||
#define MAX_PPS_USER_FIELD_NUMS 68
|
||||
|
||||
typedef struct prepaid_info_old {
|
||||
u_char msisdn[MAX_MSISDN_BLEN];
|
||||
char pin[MAX_PIN_LEN];
|
||||
u_char status;
|
||||
double balance;
|
||||
double promo_balance;
|
||||
long overdraft;
|
||||
u_long first_used_date;
|
||||
u_long mo_expiration_date; /* outgoing */
|
||||
u_long mt_expiration_date; /* incoming */
|
||||
u_long promo_date;
|
||||
u_char cos_id;
|
||||
u_char rent_type;
|
||||
u_char home_location[MAX_HOME_LOCATION];
|
||||
u_short cug_id;
|
||||
u_char language_type;
|
||||
u_char recharge_fail;
|
||||
u_char free_sm_counter;
|
||||
u_char latch_flag;
|
||||
u_char favorite_numbers;
|
||||
/* favorite number set flag
|
||||
0=no favorite number set,
|
||||
otherwise = favorite number sets */
|
||||
u_char fav_change_counter; /* favorite number edit counter */
|
||||
u_char favorite_number[MAX_FAVORITE_NUMBERS][MAX_MSISDN_BLEN];
|
||||
u_char last_call_type;
|
||||
u_long last_call_date;
|
||||
u_char last_call_number[MAX_MSISDN_BLEN];
|
||||
double in_net_cap_sms_balance;
|
||||
u_short in_net_cap_sms_counter;
|
||||
double out_net_cap_sms_balance;
|
||||
u_short out_net_cap_sms_counter;
|
||||
double in_net_cap_balance;
|
||||
double out_net_cap_balance;
|
||||
double in_net_cap_call_balance;
|
||||
u_long in_net_cap_call_duration;
|
||||
double out_net_cap_call_balance;
|
||||
u_long out_net_cap_call_duration;
|
||||
|
||||
} _prepaid_info_old;
|
||||
|
||||
typedef struct last_call_info
|
||||
{
|
||||
u_char last_call_type;
|
||||
u_long last_call_date;
|
||||
u_char last_call_number[MAX_MSISDN_BLEN];
|
||||
}_last_call_info;
|
||||
|
||||
typedef struct{
|
||||
u_char childNumber;
|
||||
u_char changeTimes;
|
||||
u_char childMsisdn[POOL_MAX_CHILD][MAX_MSISDN_BLEN];
|
||||
}PoolParent;
|
||||
|
||||
typedef struct{
|
||||
u_char parentMsisdn[MAX_MSISDN_BLEN];
|
||||
u_short callsToday;
|
||||
u_short smsToday;
|
||||
double chargedToday;
|
||||
}PoolChild;
|
||||
|
||||
typedef struct{
|
||||
u_char role;
|
||||
struct{
|
||||
PoolParent parent;
|
||||
PoolChild child;
|
||||
}roleParty;
|
||||
}UserData_Pool_Account;
|
||||
|
||||
typedef struct bundle_info
|
||||
{
|
||||
long long data; /*left in, in B */
|
||||
int mo_voice; /* in seconds */
|
||||
int mt_voice;
|
||||
u_short sms;
|
||||
u_long validity_date;
|
||||
int warning_sms_flag;// If has already sent sms notification for bundle insufficent, will not send notification again
|
||||
char cRes[4];
|
||||
int iRes[2];
|
||||
}_bundle_info;
|
||||
|
||||
typedef struct crm_info
|
||||
{
|
||||
int customer_id;
|
||||
int account_id;
|
||||
int product_id;
|
||||
u_long birthday;
|
||||
int base_plan_id;
|
||||
int rent_charge;
|
||||
int new_plan_id;
|
||||
int new_rent_charge;
|
||||
u_char vas_cug_state; /*0=not used, 1=normal, 2=suspended */
|
||||
u_long ulRes[4];
|
||||
int iRes[4];
|
||||
u_char user_class;
|
||||
u_char ucRes[3];
|
||||
}_crm_info;
|
||||
|
||||
|
||||
typedef struct prepaid_info {
|
||||
u_char msisdn[MAX_MSISDN_BLEN];
|
||||
char pin[MAX_PIN_LEN];
|
||||
u_char status;
|
||||
double balance;
|
||||
double promo_balance;
|
||||
long overdraft;// amount that can overdraft
|
||||
u_long first_used_date;
|
||||
u_long mo_expiration_date; /* outgoing */
|
||||
u_long mt_expiration_date; /* incoming */
|
||||
u_long promo_date;
|
||||
u_char cos_id;
|
||||
u_char rent_type;
|
||||
u_char home_location[MAX_HOME_LOCATION];
|
||||
u_short cug_id;
|
||||
u_char language_type;
|
||||
u_char recharge_fail;
|
||||
u_char free_sm_counter;
|
||||
u_char latch_flag;
|
||||
u_char favorite_numbers;
|
||||
/* favorite number set flag
|
||||
0=no favorite number set,
|
||||
otherwise = favorite number sets */
|
||||
u_char fav_change_counter; /* favorite number edit counter */
|
||||
u_char favorite_number[MAX_FAVORITE_NUMBERS][MAX_MSISDN_BLEN];
|
||||
u_char last_call_type;
|
||||
u_long last_call_date;
|
||||
u_char last_call_number[MAX_MSISDN_BLEN];
|
||||
|
||||
/*following fields are designed for cap CALL/SMS,Pierre, 2007-07-13 */
|
||||
|
||||
double in_net_cap_sms_balance;
|
||||
u_short in_net_cap_sms_counter;
|
||||
double out_net_cap_sms_balance;
|
||||
u_short out_net_cap_sms_counter;
|
||||
|
||||
double in_net_cap_call_balance;
|
||||
u_long in_net_cap_call_duration;
|
||||
double out_net_cap_call_balance;
|
||||
u_long out_net_cap_call_duration;
|
||||
|
||||
double call_in_cap_balance;
|
||||
u_long call_in_cap_duration;
|
||||
|
||||
double in_net_cap_balance;
|
||||
double out_net_cap_balance;
|
||||
|
||||
long long gprsVolume;
|
||||
long long gprsVolumeThisMonth;
|
||||
double gprsBalance;
|
||||
u_short gprsNotificationTimes;
|
||||
|
||||
u_char freeSMSActiveDays;
|
||||
|
||||
UserData_Pool_Account poolAccount;
|
||||
|
||||
u_char callMeBackRequestTimes;
|
||||
u_char favorite_plan_id; /* 0=default, not plan user, 1-6=index0-5*/
|
||||
u_char favorite_plan_state; /* 0=ok, 1=suspended */
|
||||
u_char cap_sms_notify_counter;
|
||||
u_char cReseverd[3];
|
||||
u_long free_favorite_call; /* in seconds */
|
||||
u_long free_favorite_sms;
|
||||
double dReserved[2];
|
||||
|
||||
_bundle_info bundle_info;
|
||||
#ifdef OCS_WITH_CRM
|
||||
_crm_info crm_info;
|
||||
#endif
|
||||
} _prepaid_info;
|
||||
|
||||
#define INVALID_UE_INDEX 0xFFFFFFFF
|
||||
|
||||
|
||||
#define UNIT_STORE_ACCOUNT 100
|
||||
#define MSISDN_HEAD_NUM 600 //1000
|
||||
#define MAX_SUBS_RECORD (MSISDN_HEAD_NUM*UNIT_STORE_ACCOUNT)
|
||||
|
||||
typedef struct prepaid_data_old{
|
||||
long long msisdn_head[MSISDN_HEAD_NUM];
|
||||
_prepaid_info_old prepaid_info[MSISDN_HEAD_NUM][UNIT_STORE_ACCOUNT];
|
||||
} _prepaid_data_old;
|
||||
|
||||
typedef struct prepaid_data {
|
||||
long long msisdn_head[MSISDN_HEAD_NUM];
|
||||
_prepaid_info prepaid_info[MSISDN_HEAD_NUM][UNIT_STORE_ACCOUNT];
|
||||
} _prepaid_data;
|
||||
|
||||
|
||||
#define MAX_CARD_HRN_BLEN 8
|
||||
#define MAX_CARD_HRN_ALEN 16
|
||||
#define MAX_CARD_SEGMENT 2000
|
||||
#define MAX_CARD_NUM_PSEG 100
|
||||
#define MAX_CARD_RECORD (MAX_CARD_SEGMENT*MAX_CARD_NUM_PSEG)
|
||||
#define MAX_CARD_LENGTH 10
|
||||
#define MAX_CUG_ID 10000
|
||||
#define NOT_CUG_ACCOUNT 0
|
||||
|
||||
#define CARD_TAIL_LEN 2
|
||||
|
||||
#define MAX_VALUE_TYPE 8
|
||||
|
||||
#define _RCI_ _recharge_card_info
|
||||
#define _recharge_card _recharge_card_info
|
||||
|
||||
typedef enum CARD_STATUS{
|
||||
CARD_FRESH,
|
||||
CARD_USED,
|
||||
CARD_SUSPEND,
|
||||
CARD_LONG_TIME_NOT_USED,
|
||||
CARD_AS_CC_USED,
|
||||
}_CARD_STATUS;
|
||||
|
||||
typedef struct {
|
||||
u_char card_no[MAX_CARD_LENGTH+1]; /* 'E' fill at the end */
|
||||
u_char card_pwd[MAX_CARD_HRN_BLEN+1];
|
||||
long face_value;
|
||||
u_char card_status;
|
||||
u_long expiry_date;
|
||||
u_short valid_time;
|
||||
char msisdn_used[18];
|
||||
u_long updated_date;
|
||||
} _recharge_card_info;
|
||||
|
||||
typedef struct card_data{
|
||||
long face_value[MAX_VALUE_TYPE];
|
||||
u_char segment_used_flag[MAX_CARD_SEGMENT];
|
||||
long long prepaid_card_head[MAX_CARD_SEGMENT];
|
||||
_recharge_card_info prepaid_card[MAX_CARD_SEGMENT][MAX_CARD_NUM_PSEG];
|
||||
}_card_data;
|
||||
|
||||
#define BILLING_BASE_NUM 1024 /* number used by billing */
|
||||
#define MAX_DISCOUNT_ID 32
|
||||
#define MAX_ZONE_NUM_OLD 16
|
||||
#ifdef _MAX_64COS_COOK_
|
||||
#define MAX_ZONE_NUM 64// used in Cook island, Diego
|
||||
#else
|
||||
#define MAX_ZONE_NUM 16// used for PNCC etc
|
||||
#endif
|
||||
#define MAX_RENT_TARIFF 8
|
||||
#define CALLED_BASE_NUM 50
|
||||
#define MAX_MO_CALLTYPE 5
|
||||
#define MAX_MT_CALLTYPE 4
|
||||
#define MAX_SMS_PREFIX 50
|
||||
#define TARIFF_PREFIX_LEN 16
|
||||
|
||||
#define MAX_GPRS_PREFIX 1
|
||||
|
||||
#define MAX_VAS_MMS_SEND_TARIFF 64
|
||||
#define MAX_VAS_MMS_RETRIEVE_TARIFF 1
|
||||
#define MAX_VAS_MMSEMAIL_DELIVER_TARIFF 1
|
||||
|
||||
|
||||
#define COS_GROUP_NUM 16
|
||||
#define MAX_ZONE_NUM_NEW (MAX_ZONE_NUM/COS_GROUP_NUM)
|
||||
|
||||
/*
|
||||
Charge on receiving call is not defined , 2003-10-10
|
||||
*/
|
||||
|
||||
typedef struct comm_tariff
|
||||
{
|
||||
u_short cfChargeUnit; /* call forward */
|
||||
float cfChargeAmount;
|
||||
u_short roamingChargeUnit; /* roaming within province */
|
||||
float roamingChargeAmount; /* roaming within province */
|
||||
u_short cugChargeUnit;
|
||||
float cugChargeAmount;
|
||||
u_short ccChargeUnit; /*conference call */
|
||||
float ccChargeAmount;
|
||||
float favEditChargeAmount;
|
||||
u_short favChargeUnit; /* favorite number call */
|
||||
float favChargeAmount;
|
||||
u_short cf_cugChargeUnit; /* call forward + cug */
|
||||
float cf_cugChargeAmount;
|
||||
u_short cf_favChargeUnit; /* call forward + favorite number */
|
||||
float cf_favChargeAmount;
|
||||
u_short cug_favChargeUnit; /* cug + favorite number */
|
||||
float cug_favChargeAmount;
|
||||
u_short cf_cug_favChargeUnit; /* call forward + cug + favorite number */
|
||||
float cf_cug_favChargeAmount;
|
||||
|
||||
float childChangeChargeAmount;
|
||||
u_short poolAccountChargeUnit;
|
||||
float poolAccountChargeAmount;
|
||||
float activeFreeSMSCharegeAmount;
|
||||
float deactiveFreeSMSCharegeAmount;
|
||||
}_comm_tariff;
|
||||
|
||||
|
||||
typedef struct _TIER_INFO{
|
||||
u_long units;
|
||||
float base_fee;
|
||||
float long_distance_fee;
|
||||
}TIER_INFO;
|
||||
|
||||
#define MAX_TIER 3
|
||||
#define TARIFF_AREA_LEN 31
|
||||
|
||||
typedef struct{
|
||||
u_char tierNumber;
|
||||
TIER_INFO rating[MAX_TIER];
|
||||
}TIER_RATING;
|
||||
|
||||
typedef struct bill_tariff {
|
||||
char bill_id[TARIFF_PREFIX_LEN+1];
|
||||
char area[TARIFF_AREA_LEN];
|
||||
char cap_flag;
|
||||
u_char call_type;
|
||||
u_char tariffID;
|
||||
u_char discountID;
|
||||
u_char free_time; /*0-240 seconds*/
|
||||
u_short unit_time;
|
||||
u_char mini_unit;
|
||||
float adjustment;
|
||||
TIER_RATING tierRating;
|
||||
} _bill_tariff;
|
||||
|
||||
typedef struct rent_tariff {
|
||||
u_char id; /* from 0-15 */
|
||||
char description[16];
|
||||
u_char rent_type; /*0: daily, 1: monthly */
|
||||
u_char charge_date; /* monthly day : 1-28*/
|
||||
float rent_amount;
|
||||
} _rent_tariff;
|
||||
|
||||
typedef struct bill_discount
|
||||
{
|
||||
u_char discount_id;
|
||||
u_char hours;
|
||||
u_char days[8];
|
||||
} _bill_discount;
|
||||
|
||||
typedef struct bill_holiday
|
||||
{
|
||||
u_char month;
|
||||
u_char day;
|
||||
u_char mflag;
|
||||
} _bill_holiday;
|
||||
|
||||
#define DEFAULT_MT_BILLING 0
|
||||
#define DEFAULT_SMS_BILLING 0
|
||||
|
||||
typedef struct bill_sms
|
||||
{
|
||||
u_char id;
|
||||
char bill_id[TARIFF_PREFIX_LEN+1];
|
||||
u_char call_type;
|
||||
char area[31];
|
||||
char cap_flag;
|
||||
u_char tariffID;
|
||||
u_char discountID;
|
||||
float base_fee;
|
||||
}_bill_sms;
|
||||
|
||||
typedef struct gprs_tariff {
|
||||
u_char tariffID;
|
||||
u_char gprsID;
|
||||
ulong destIp;
|
||||
u_short chargeUnit; /* KB */
|
||||
float basicFee;
|
||||
u_short miniChargeUnit;/* KB */
|
||||
u_short initialAdjustment;
|
||||
char cap_flag;
|
||||
u_char discountID;
|
||||
u_char reserved[32];
|
||||
} _gprs_tariff;
|
||||
|
||||
|
||||
typedef struct _VAS_MMS_SEND_TARIFF{
|
||||
u_char tariffID;
|
||||
u_char mmsSendID;
|
||||
u_char mmsType;
|
||||
u_char prefix[128];
|
||||
u_char callType;
|
||||
u_char destName[128];
|
||||
u_char discountID;
|
||||
float chargeFee;
|
||||
u_char capFlag;
|
||||
u_char reserved[32];
|
||||
}VAS_MMS_TARIFF;
|
||||
|
||||
|
||||
typedef struct _VAS_MMS_RETRIEVE_TARIFF{
|
||||
u_char tariffID;
|
||||
u_char mmsRetrieveID;
|
||||
u_char prefix[128];
|
||||
u_char callType;
|
||||
u_char destName[128];
|
||||
u_char discountID;
|
||||
float chargeFee;
|
||||
u_char capFlag;
|
||||
u_char reserved[32];
|
||||
}VAS_MMS_RETRIEVE_TARIFF;
|
||||
|
||||
|
||||
typedef struct _VAS_MMSEMAIL_RETRIEVE_TARIFF{
|
||||
u_char tariffID;
|
||||
u_char emailID;
|
||||
u_char prefix[128];
|
||||
u_char callType;
|
||||
u_char destName[128];
|
||||
u_char discountID;
|
||||
float chargeFee;
|
||||
u_char capFlag;
|
||||
u_char reserved[32];
|
||||
}VAS_MMSEMAIL_DELIVER_TARIFF;
|
||||
|
||||
|
||||
typedef struct _VAS_TARIFF{
|
||||
VAS_MMS_TARIFF vasMmsSendTariff[MAX_VAS_MMS_SEND_TARIFF];
|
||||
VAS_MMS_RETRIEVE_TARIFF vasMmsRetrieveTariff[MAX_VAS_MMS_RETRIEVE_TARIFF];
|
||||
VAS_MMSEMAIL_DELIVER_TARIFF vasMmsEmailDeliverTariff[MAX_VAS_MMSEMAIL_DELIVER_TARIFF];
|
||||
}VAS_TARIFF;
|
||||
|
||||
typedef struct base_tariff {
|
||||
char bill_id[TARIFF_PREFIX_LEN+1];
|
||||
char area[TARIFF_AREA_LEN];
|
||||
u_char call_type;
|
||||
} _base_tariff;
|
||||
|
||||
|
||||
typedef struct tariff_data_old {
|
||||
_comm_tariff comm_tariff[MAX_ZONE_NUM_OLD];
|
||||
_rent_tariff rent_tariff[MAX_ZONE_NUM_OLD][MAX_RENT_TARIFF];
|
||||
_bill_tariff bill_tariff[MAX_ZONE_NUM_OLD][BILLING_BASE_NUM];
|
||||
_bill_tariff called_tariff[MAX_ZONE_NUM_OLD][CALLED_BASE_NUM];
|
||||
_bill_discount bill_discount[MAX_DISCOUNT_ID][24]; /* id=9 for sms */
|
||||
_bill_holiday holiday_flag[12][31];
|
||||
_bill_sms bill_sms[MAX_ZONE_NUM_OLD][MAX_SMS_PREFIX];
|
||||
} _tariff_data_old;
|
||||
|
||||
typedef struct tariff_data {
|
||||
_comm_tariff comm_tariff[MAX_ZONE_NUM];
|
||||
_rent_tariff rent_tariff[MAX_ZONE_NUM][MAX_RENT_TARIFF];
|
||||
_bill_tariff bill_tariff[MAX_ZONE_NUM][BILLING_BASE_NUM];
|
||||
_bill_tariff called_tariff[MAX_ZONE_NUM][CALLED_BASE_NUM];
|
||||
_bill_discount bill_discount[MAX_DISCOUNT_ID][24]; /* id=9 for sms */
|
||||
_bill_holiday holiday_flag[12][31];
|
||||
_bill_sms bill_sms[MAX_ZONE_NUM][MAX_SMS_PREFIX];
|
||||
_gprs_tariff gprs_tariff[MAX_ZONE_NUM][MAX_GPRS_PREFIX];
|
||||
VAS_TARIFF vas_tariff[MAX_ZONE_NUM];
|
||||
_base_tariff base_tariff[BILLING_BASE_NUM];
|
||||
} _tariff_data;
|
||||
/*---------*/
|
||||
|
||||
typedef struct pps_free_index
|
||||
{
|
||||
int user_counter; /* account counter */
|
||||
int pWriteSub;
|
||||
u_char status[MAX_SUBS_RECORD];
|
||||
int free_memory[MAX_SUBS_RECORD];
|
||||
}_pps_free_index;
|
||||
|
||||
typedef struct pps_index_node
|
||||
{
|
||||
long long key;
|
||||
int store_index;
|
||||
}_pps_index_node;
|
||||
|
||||
typedef struct pps_index_table
|
||||
{
|
||||
_pps_index_node prim_index[MAX_SUBS_RECORD];
|
||||
}_pps_index_table;
|
||||
/* index table is part of shm memory , and sync. between 2 plans */
|
||||
|
||||
typedef struct pps_index_db
|
||||
{
|
||||
_pps_free_index free_index;
|
||||
_pps_index_table index_table;
|
||||
}_pps_index_db;
|
||||
|
||||
typedef struct _ram_data_old{
|
||||
_tariff_data_old tariff_data;
|
||||
_card_data card_data;
|
||||
_prepaid_data prepaid_data;
|
||||
_pps_index_db index_data;
|
||||
} _ram_data_old;
|
||||
|
||||
typedef struct _ram_data{
|
||||
_tariff_data tariff_data;
|
||||
_card_data card_data;
|
||||
_prepaid_data prepaid_data;
|
||||
_pps_index_db index_data;
|
||||
} _ram_data;
|
||||
|
||||
/* all data should be divided into 3 files:
|
||||
tariff
|
||||
recharge_card
|
||||
account
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#endif /* RAMDATA__H */
|
||||
|
||||
153
mss/pps/src/include/report.h
Normal file
153
mss/pps/src/include/report.h
Normal file
@@ -0,0 +1,153 @@
|
||||
#ifndef _REPORT_H
|
||||
#define _REPORT_H
|
||||
|
||||
#include "ramdata.h"
|
||||
|
||||
#define MAX_RECORDS_SAVED 7
|
||||
#define MAX_CALL_TYPE 16
|
||||
|
||||
typedef struct account_report
|
||||
{
|
||||
u_long user_num[MAX_USER_TYPE];
|
||||
u_long total_num;
|
||||
double total_balance;
|
||||
}_account_report;
|
||||
|
||||
|
||||
typedef struct prepaid_card_report
|
||||
{
|
||||
float face_value[MAX_VALUE_TYPE];
|
||||
u_long used_today[MAX_VALUE_TYPE];
|
||||
u_long total_used[MAX_VALUE_TYPE];
|
||||
u_long unused[MAX_VALUE_TYPE];
|
||||
}_prepaid_card_report;
|
||||
|
||||
|
||||
|
||||
typedef enum call_type
|
||||
{
|
||||
INCOMING_CALL = 0,
|
||||
LOCAL_CALL_OUT,
|
||||
IDD_CALL,
|
||||
NDD_CALL,
|
||||
RENT_CHARGE,
|
||||
AST_RECHARGE,
|
||||
AST_CHARGE,
|
||||
RECHARGE_SUC,
|
||||
RECHARGE_FAIL,
|
||||
SHORT_MESSAGE,
|
||||
CONFERENCE_CALL,
|
||||
SERVICE_CHARGE,
|
||||
SERVICE_GPRS = 16,
|
||||
SERVICE_CCC,
|
||||
MAX_SERVICE_TYPE,
|
||||
}_call_type;
|
||||
|
||||
typedef struct call_record
|
||||
{
|
||||
int call_type;
|
||||
u_long call_times;
|
||||
u_long call_duration;
|
||||
double call_charge;
|
||||
}_call_record;
|
||||
|
||||
typedef struct gprsRecord
|
||||
{
|
||||
long long gprsVolume;
|
||||
long long gprsDuration;
|
||||
double gprsCharge;
|
||||
}_gprs_record;
|
||||
|
||||
typedef struct _pps_vas_record
|
||||
{
|
||||
u_long smsNumber;
|
||||
double smsCharge;
|
||||
u_long mmsSendNumber;
|
||||
double mmsSendCharge;
|
||||
u_long mmsRetrieveNumber;
|
||||
double mmsRetrieveCharge;
|
||||
u_long mmsEmailNumber;
|
||||
double mmsEmailCharge;
|
||||
}_pps_vas_record;
|
||||
|
||||
typedef struct call_report
|
||||
{
|
||||
u_long total_call_num;
|
||||
u_long total_call_duration;
|
||||
double total_call_charge;
|
||||
_call_record call_record[MAX_CALL_TYPE];
|
||||
_gprs_record gprs_record;
|
||||
_pps_vas_record vas_record;
|
||||
}_call_report;
|
||||
|
||||
typedef struct balance_summary
|
||||
{
|
||||
double yesterday_balance;
|
||||
double today_recharge;
|
||||
double today_charge;
|
||||
double today_balance;
|
||||
}_balance_summary;
|
||||
|
||||
#ifdef _ZED_NO_CALLER_NUM_AND_EXPIRY_DATE_ // ussd_code daily report
|
||||
#define USSDCODE_QUERY_CODE_STR "114"
|
||||
#define USSDCODE_TOPUP_CODE_STR "113"
|
||||
#define USSDCODE_HOTLINE_CODE_STR "117"
|
||||
|
||||
#define USSDCODE_TYPE_QUERY 0
|
||||
#define USSDCODE_TYPE_TOPUP 1
|
||||
#define USSDCODE_TYPE_HOTLINE 2
|
||||
#define USSDCODE_TYPE_CHANNEL 3
|
||||
#define USSDCODE_MAX_CODE_NUM 8
|
||||
|
||||
#define USSDCODE_STAT_REQ 0
|
||||
#define USSDCODE_STAT_DUR 1
|
||||
#define USSDCODE_STAT_ERR_TIMEOUT 2
|
||||
#define USSDCODE_STAT_ERR_SYSTEM 3
|
||||
#define USSDCODE_STAT_ERR_MSG 4
|
||||
|
||||
typedef struct ussdcode_report
|
||||
{
|
||||
char code[8];// 114,113,117,101/707
|
||||
//char type[12];// query,topup,hotline,channel
|
||||
unsigned int req_count;
|
||||
unsigned int req_duration;// Sec
|
||||
|
||||
unsigned int err_timeout_count;
|
||||
//unsigned int err_network_count;
|
||||
unsigned int err_system_count;
|
||||
unsigned int err_msg_count;
|
||||
}_ussdcode_report;
|
||||
|
||||
int pps_update_ussd_code_state(char *code, int type, int result, int dur);
|
||||
#endif
|
||||
|
||||
typedef struct daily_report
|
||||
{
|
||||
int year_month_day[3];
|
||||
_account_report account_report;
|
||||
_prepaid_card_report prepaid_card_report;
|
||||
_call_report call_report;
|
||||
_balance_summary balance_summary;
|
||||
#ifdef _ZED_NO_CALLER_NUM_AND_EXPIRY_DATE_ // ussd_code daily report
|
||||
_ussdcode_report ussdcode_report[USSDCODE_MAX_CODE_NUM];
|
||||
#endif
|
||||
}_daily_report;
|
||||
|
||||
typedef struct _pps_report
|
||||
{
|
||||
int ptrTail;
|
||||
int saveHead;
|
||||
int saveTail;
|
||||
_daily_report daily_report[MAX_RECORDS_SAVED];
|
||||
_daily_report peer_daily_report[MAX_RECORDS_SAVED];
|
||||
}_pps_report;
|
||||
|
||||
|
||||
void reportInit();
|
||||
int reportCreatedDaily();
|
||||
int reportCDRIncrement(int calltype, int duration, float charge,ulong gprsVolume);
|
||||
int reportAccount(int segmentno);
|
||||
int reportPrepaidCard(int segmentno);
|
||||
int GetDailyReport(u_char oidLen, DWORD *oid, u_char *pdata, BYTE *vartype);
|
||||
|
||||
#endif
|
||||
829
mss/pps/src/include/restapi.h
Normal file
829
mss/pps/src/include/restapi.h
Normal file
@@ -0,0 +1,829 @@
|
||||
#ifndef _RESTAPI_H
|
||||
#define _RESTAPI_H
|
||||
|
||||
#include "../../../../plat/public/src/include/public.h"
|
||||
|
||||
#define MAX_BODY_LEN 1024
|
||||
|
||||
#define REST_PROXY_PORT 4951
|
||||
|
||||
enum RESULT_TYPE
|
||||
{
|
||||
RES_SUCCEED = 0,
|
||||
RES_FAILED = 1,
|
||||
};
|
||||
|
||||
enum ERROR_CODE
|
||||
{
|
||||
ERR_REST_SUCCESS = 2001,
|
||||
ERR_REST_COMMAND_UNSUPPORTED=3001,
|
||||
ERR_REST_UNKNOWN_PEER = 3010,
|
||||
ERR_REST_INVALID_USER_STATUS = 4001,
|
||||
ERR_REST_DEST_USER_NOT_ALLOWED = 4008,
|
||||
ERR_REST_CREDIT_LIMIT = 4012,
|
||||
ERR_REST_INVALID_PARAMETER_VALUE=5004,
|
||||
ERR_REST_MISSING_PARAMETER = 5005,
|
||||
ERR_REST_INVALID_RECHARGE_PWD = 5006,
|
||||
ERR_REST_UNABLE_TO_COMPLY=5012,
|
||||
ERR_REST_USER_UNKNOWN = 5030,
|
||||
ERR_REST_NO_LICENSE = 5040,
|
||||
};
|
||||
|
||||
enum REST_PROXY_MSG_TYPE
|
||||
{
|
||||
REST_QUERY=1,
|
||||
REST_TOPUP=2,
|
||||
REST_TRANSFER=3,
|
||||
|
||||
REST_ORDER=0x84,
|
||||
REST_FREE_RESOURCE=0x85,
|
||||
REST_DOWNLOAD_APP=0x86,
|
||||
REST_CHANNEL=0x87,
|
||||
REST_OFFER_CHANGE=0x88,
|
||||
REST_POINT_QUERY=0x89,
|
||||
REST_POINT_TRANSFER=0x8a,
|
||||
|
||||
// for selfcare
|
||||
REST_SEND_AUTHCODE_REQ=5,
|
||||
REST_SEND_AUTHCODE_RSP=6,
|
||||
REST_QUERY_USERDATA_REQ=7,
|
||||
REST_QUERY_USERDATA_RSP=8,
|
||||
REST_BUNDLE_SUBS_REQ=9,
|
||||
REST_BUNDLE_SUBS_RSP=10,
|
||||
REST_BUNDLE_USAGE_REQ=11,
|
||||
REST_BUNDLE_USAGE_RSP=12,
|
||||
REST_RECHARGE_REQ=13,
|
||||
REST_RECHARGE_RSP=14,
|
||||
REST_TRANSFER_REQ=15,
|
||||
REST_TRANSFER_RSP=16,
|
||||
REST_RECHARGE_CARD_REQ=17,
|
||||
REST_RECHARGE_CARD_RSP=18,
|
||||
REST_CHECK_BALANCE_REQ=19,
|
||||
REST_CHECK_BALANCE_RSP=20,
|
||||
REST_QUERY_BALANCE_REQ=21,
|
||||
REST_QUERY_BALANCE_RSP=22,
|
||||
|
||||
REST_QUERY_RECHARGE_CARD_REQ=23, // query recharge card interface from CRM
|
||||
REST_QUERY_RECHARGE_CARD_RSP=24,
|
||||
REST_UPDATE_RECHARGE_CARD_REQ=25, // update recharge card interface with CRM
|
||||
REST_UPDATE_RECHARGE_CARD_RSP=26,
|
||||
|
||||
REST_CRM_PAYMENT_REQ=27,
|
||||
REST_CRM_PAYMENT_RES=28,
|
||||
|
||||
REST_CRM_SMS_DELIVER_REQ=29,
|
||||
REST_CRM_SMS_DELIVER_RES=30,
|
||||
|
||||
REST_CRM_CREATE_ACCT_REQ=31,
|
||||
REST_CRM_CREATE_ACCT_RES=32,
|
||||
|
||||
REST_CRM_QUERY_TARIFF_REQ=33,
|
||||
REST_CRM_QUERY_TARIFF_RES=34,
|
||||
|
||||
REST_CRM_UPDATE_SUBS_REQ=35,
|
||||
REST_CRM_UPDATE_SUBS_RES=36,
|
||||
|
||||
REST_CRM_DELETE_SUBS_REQ=37,
|
||||
REST_CRM_DELETE_SUBS_RES=38,
|
||||
|
||||
REST_CRM_UPDATE_SESS_INFO_REQ=39,
|
||||
REST_CRM_UPDATE_SESS_INFO_RES=40,
|
||||
|
||||
REST_CRM_UPDATE_PLAN_INFO_REQ=41,
|
||||
REST_CRM_UPDATE_PLAN_INFO_RES=42,
|
||||
|
||||
REST_CRM_RENT_CHARGE=43,
|
||||
REST_CRM_RENT_CHARGE_RES=44,
|
||||
|
||||
|
||||
};
|
||||
|
||||
#if 0
|
||||
enum PAY_TYPE
|
||||
{
|
||||
PAY_TYPE_BALANCE = 1,
|
||||
PAY_TYPE_PAYPAL = 2,
|
||||
PAY_TYPE_VISA = 3,
|
||||
PAY_TYPE_MASTER = 4,
|
||||
};
|
||||
|
||||
enum ACCT_STATUS
|
||||
{
|
||||
AS_FRESH, /* fresh account, can't dial in or out,
|
||||
but can recharge. */
|
||||
AS_NORMAL, /* normal account */
|
||||
AS_SUSPEND,
|
||||
AS_BLACKLIST,
|
||||
AS_RELEASED,
|
||||
AS_OPRTRIAL,
|
||||
//AS_MAX_USER_TYPE,
|
||||
|
||||
AS_EXTERNAL=10,
|
||||
};
|
||||
#endif
|
||||
|
||||
enum REST_IE_TAG
|
||||
{
|
||||
IE_SRC_REF=1,
|
||||
IE_DST_REF,
|
||||
IE_MSISDN,
|
||||
IE_RESULT,
|
||||
IE_ERROR_CODE,
|
||||
IE_BALANCE,
|
||||
IE_MO_EXPIRY,
|
||||
IE_MT_EXPIRY,
|
||||
IE_USERNAME,
|
||||
IE_PASSWORD,
|
||||
IE_MSG_CONTENT, //value=11
|
||||
IE_STATUS,
|
||||
IE_REMARK,
|
||||
IE_GROUP_NAME,
|
||||
IE_MO_VOICE_MIN,// in minute
|
||||
IE_REMAIN_MO_VOICE_SEC,// in second
|
||||
IE_REMAIN_MO_VOICE_MIN,// in minute
|
||||
IE_MT_VOICE_MIN,// in minute
|
||||
IE_REMAIN_MT_VOICE_SEC,// in second
|
||||
IE_REMAIN_MT_VOICE_MIN,// in minute
|
||||
IE_SMS_NUM, //value=21
|
||||
IE_REMAIN_SMS_NUM,
|
||||
IE_DATA_VOL_MB,// in MB
|
||||
IE_REMAIN_DATA_VOL_KB,// in KB
|
||||
IE_REMAIN_DATA_VOL_MB,// in MB
|
||||
IE_PAY_TYPE,
|
||||
IE_AMOUNT,
|
||||
IE_VALID_DAYS,
|
||||
IE_EXPIRY_TIME,
|
||||
IE_MSISDN_TRANS_OUT,
|
||||
IE_MSISDN_TRANS_IN, //value=31
|
||||
IE_BALANCE_AVAILABLE,
|
||||
IE_RECHARGE_AMOUNT,
|
||||
IE_RECHARGE_TYPE,
|
||||
IE_RECHARGE_CARD_STATUS,
|
||||
IE_RECHARGE_CARD_FACE_VALUE,
|
||||
IE_RECHARGE_CARD_EXPIRED_TS,
|
||||
IE_RECHARGE_CARD_UPDATED_TS,
|
||||
IE_CUSTOMER_ID,
|
||||
IE_ACCOUNT_ID,
|
||||
IE_PRODUCT_ID, //value=41
|
||||
IE_PLAN_ID,
|
||||
IE_RENT_CHARGE,
|
||||
IE_BIRTHDAY,
|
||||
IE_SMS_CONTENT,
|
||||
IE_SERVICE_TYPE,
|
||||
IE_TARIIFF_PREFIX,
|
||||
IE_TARIFF_UNIT,
|
||||
IE_TARIFF_CHARGE,
|
||||
IE_TARIFF_DISCOUNT,
|
||||
IE_PLAN_VALUE,//value=51
|
||||
IE_PLAN_USED_VALUE,
|
||||
IE_BUNDLE_ID,
|
||||
IE_CAUSE,
|
||||
IE_SESS_FLAG,
|
||||
IE_TIMESTAMP,
|
||||
IE_CONSUME_VALUE,
|
||||
IE_CALLED_NUMBER,
|
||||
IE_UE_IP,
|
||||
IE_GW_IP,
|
||||
IE_CUG_ID,
|
||||
IE_VAS_CUG_STATUS,
|
||||
IE_SESS_UPDATE_TIME,
|
||||
IE_PLAN_VALUE_ADD_THIS_TIME,
|
||||
IE_USER_CLASS,
|
||||
IE_PINCODE,
|
||||
IE_CALLER_NUMBER,
|
||||
IE_MAX_NUM,
|
||||
|
||||
};
|
||||
|
||||
typedef struct rest_header
|
||||
{
|
||||
u16 src_ref;
|
||||
u16 dst_ref;
|
||||
}_rest_header;
|
||||
|
||||
typedef struct rest_query
|
||||
{
|
||||
char msisdn[24];
|
||||
}_rest_query;
|
||||
|
||||
typedef struct rest_query_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u8 error_code;
|
||||
u32 balance;
|
||||
u32 mo_expiry;
|
||||
u32 mt_expiry;
|
||||
}_rest_query_res;
|
||||
|
||||
typedef struct rest_topup
|
||||
{
|
||||
u8 optional_flag; /* optional=1 ,account_id is presented */
|
||||
char msisdn[24];
|
||||
|
||||
char username[24];
|
||||
char password[24];
|
||||
char pincode[24];
|
||||
u32 balance;
|
||||
long account_id;
|
||||
}_rest_topup;
|
||||
|
||||
typedef struct rest_topup_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u8 error_code;
|
||||
u32 balance;
|
||||
u32 mo_expiry;
|
||||
u32 mt_expiry;
|
||||
}_rest_topup_res;
|
||||
|
||||
typedef struct rest_channel
|
||||
{
|
||||
u8 optional_flag; /* optional=1 ,account_id is presented */
|
||||
char msisdn[24];
|
||||
|
||||
char sess_id[64];
|
||||
char sc_url[128];
|
||||
char input[24];
|
||||
}_rest_channel;
|
||||
|
||||
typedef struct rest_channel_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u8 error_code;
|
||||
|
||||
u8 sess_state;
|
||||
char prompt[256];
|
||||
}_rest_channel_res;
|
||||
|
||||
typedef struct rest_order
|
||||
{
|
||||
u8 optional_flag; /* optional=1 ,account_id is presented */
|
||||
char msisdn[24];
|
||||
char callerMsisdn[24];
|
||||
char payMsisdn[24];
|
||||
|
||||
u32 busicode;// 1000: recharge; 1001: order; 1002: cancel;
|
||||
u32 offer_id;
|
||||
u32 balance;// when busicode=1000
|
||||
u32 paymethod;// byte0: 4: balance; 10: mobile money; null: default balance // byte1: thirdPartyPayMethod
|
||||
char pincode[64];// when paymethod 10
|
||||
//char thirdPartyPayMethod[32];// Airtel, MTN
|
||||
//char thirdPartyPayPhone[64];// use payMsisdn
|
||||
}_rest_order;
|
||||
|
||||
|
||||
typedef struct rest_order_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u8 error_code;
|
||||
}_rest_order_res;
|
||||
|
||||
typedef struct rest_freeresource
|
||||
{
|
||||
char msisdn[24];
|
||||
}_rest_freeresource;
|
||||
|
||||
|
||||
typedef struct rest_freeresource_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u8 error_code;
|
||||
}_rest_freeresource_res;
|
||||
|
||||
typedef struct rest_downloadApp
|
||||
{
|
||||
char msisdn[24];
|
||||
}_rest_downloadApp;
|
||||
|
||||
|
||||
typedef struct rest_downloadApp_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u8 error_code;
|
||||
}_rest_downloadApp_res;
|
||||
|
||||
typedef struct rest_offerChange
|
||||
{
|
||||
char msisdn[24];
|
||||
u8 opt_out;
|
||||
}_rest_offerChange;
|
||||
|
||||
|
||||
typedef struct rest_offerChange_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u8 error_code;
|
||||
}_rest_offerChange_res;
|
||||
|
||||
typedef struct rest_queryPoint
|
||||
{
|
||||
char msisdn[24];
|
||||
}_rest_queryPoint;
|
||||
|
||||
|
||||
typedef struct rest_queryPoint_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u8 error_code;
|
||||
|
||||
u32 amount;
|
||||
u32 airtime_amount;
|
||||
}_rest_queryPoint_res;
|
||||
|
||||
typedef struct rest_transferPoint
|
||||
{
|
||||
char msisdn[24];
|
||||
char target_msisdn[24];
|
||||
|
||||
u32 amount;
|
||||
u32 busicode;
|
||||
}_rest_transferPoint;
|
||||
|
||||
|
||||
typedef struct rest_transferPoint_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u8 error_code;
|
||||
}_rest_transferPoint_res;
|
||||
|
||||
// for selfcare =============================
|
||||
typedef struct rest_send_authcode_req
|
||||
{
|
||||
char msisdn[24];
|
||||
char sms_content[MAX_BODY_LEN];
|
||||
}_rest_send_authcode_req;
|
||||
|
||||
typedef struct rest_send_authcode_rsp
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
}_rest_send_authcode_rsp;
|
||||
|
||||
typedef struct rest_query_user_data_req
|
||||
{
|
||||
char msisdn[24];
|
||||
}_rest_query_user_data_req;
|
||||
|
||||
typedef struct rest_query_user_data_rsp
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
|
||||
char msisdn[24];
|
||||
u8 status;// use ACCT_STATUS
|
||||
char remark[64];
|
||||
char usrGrpName[64];// usr data==>cos id==>cos title
|
||||
u32 balance;
|
||||
u64 mo_expiry;
|
||||
u32 mo_voc_min;// in Min
|
||||
u32 remain_mo_voc_min;
|
||||
u32 mt_voc_min;// in Min
|
||||
u32 remain_mt_voc_min;
|
||||
u32 total_sms_num;// reserved, set to 0 or do not send
|
||||
u32 remain_sms_num;
|
||||
u32 total_data_vol;// reserved, set to 0 or do not send
|
||||
u32 remain_data_vol;// MB
|
||||
}_rest_query_user_data_rsp;
|
||||
|
||||
typedef struct rest_bundle_subs_req
|
||||
{
|
||||
char msisdn[24];
|
||||
u8 payType;// 1: balance; 2: paypal; 3: visa; 4: master, use PAY_TYPE
|
||||
u32 charge;// Conditional, mandatory if balance
|
||||
u32 moVoiceMinute;
|
||||
u32 mtVoiceMinute;
|
||||
u32 dataVolume;// MB
|
||||
u32 smsNum;
|
||||
u32 validDays;
|
||||
}_rest_bundle_subs_req;
|
||||
|
||||
|
||||
typedef struct rest_bundle_subs_rsp
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
}_rest_bundle_subs_rsp;
|
||||
|
||||
|
||||
typedef struct rest_bundle_usage_req
|
||||
{
|
||||
char msisdn[24];
|
||||
}_rest_bundle_usage_req;
|
||||
|
||||
|
||||
typedef struct rest_bundle_usage_rsp
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
u32 moVoiceInSec;// remained mo voice in second
|
||||
u32 mtVoiceInSec;// remained mt voice in second
|
||||
u32 dataVolInKB;// remained data volume in KB
|
||||
u32 smsNum;// remained sms
|
||||
u64 expiredTime;// expired time
|
||||
}_rest_bundle_usage_rsp;
|
||||
|
||||
|
||||
typedef struct rest_recharge_req
|
||||
{
|
||||
char msisdn[24];
|
||||
|
||||
u32 amount;// mandatory, add to balance
|
||||
u8 op_type;
|
||||
u16 valid_days;
|
||||
}_rest_recharge_req;
|
||||
|
||||
|
||||
typedef struct rest_recharge_rsp
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
u8 status;// current status
|
||||
u32 balance;// current balance
|
||||
u64 expiredTime;// expired time
|
||||
}_rest_recharge_rsp;
|
||||
|
||||
|
||||
typedef struct rest_transfer_req
|
||||
{
|
||||
char transferOutMsisdn[24];
|
||||
char transferInMsisdn[24];
|
||||
|
||||
u32 amount;// mandatory
|
||||
}_rest_transfer_req;
|
||||
|
||||
|
||||
typedef struct rest_transfer_rsp
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
u32 balance;
|
||||
}_rest_transfer_rsp;
|
||||
|
||||
|
||||
typedef struct rest_recharge_card_req
|
||||
{
|
||||
char msisdn[24];
|
||||
|
||||
char cardPwd[32];// rechare card password
|
||||
//u32 amount;// mandatory, add to balance
|
||||
}_rest_recharge_card_req;
|
||||
|
||||
|
||||
typedef struct rest_recharge_card_rsp
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
u32 rechargeAmount;// mandatory, add to balance
|
||||
u32 balance;// current balance
|
||||
u64 expiredTime;// expired time
|
||||
}_rest_recharge_card_rsp;
|
||||
|
||||
|
||||
typedef struct rest_check_balance_req
|
||||
{
|
||||
char msisdn[24];
|
||||
|
||||
u32 amount;// mandatory
|
||||
}_rest_check_balance_req;
|
||||
|
||||
|
||||
typedef struct rest_check_balance_rsp
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
u8 available;// 0: enough balance; 1: else
|
||||
}_rest_check_balance_rsp;
|
||||
|
||||
|
||||
typedef struct rest_query_balance_req
|
||||
{
|
||||
char msisdn[24];
|
||||
}_rest_query_balance_req;
|
||||
|
||||
|
||||
typedef struct rest_query_balance_rsp
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
u8 status;// use ACCT_STATUS
|
||||
u32 balance;// current balance
|
||||
u32 mo_expiry;
|
||||
}_rest_query_balance_rsp;
|
||||
|
||||
typedef struct rest_sms_deliver_req
|
||||
{
|
||||
char msisdn[24];
|
||||
u16 sms_len;
|
||||
char sms_content[MAX_BODY_LEN];
|
||||
}_rest_sms_deliver_req;
|
||||
|
||||
typedef struct rest_sms_deliver_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
}_rest_sms_deliver_res;
|
||||
|
||||
typedef struct rest_create_acct_req
|
||||
{
|
||||
char msisdn[24];
|
||||
u32 customer_id;
|
||||
u32 account_id;
|
||||
u32 product_id;
|
||||
u32 plan_id; /* basic plan */
|
||||
u8 user_class;
|
||||
u32 balance;
|
||||
u32 expiry_date;
|
||||
u32 rent_charge;
|
||||
u32 birthday;
|
||||
u32 cug_id;
|
||||
}_rest_create_acct_req;
|
||||
|
||||
typedef struct rest_create_acct_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
}_rest_create_acct_res;
|
||||
|
||||
typedef struct rest_query_tariff_req
|
||||
{
|
||||
char msisdn[24];
|
||||
u8 service_type; /*0=mo call, 1=mt call, 2=sms, 3=data */
|
||||
char called_number[24];
|
||||
}_rest_query_tariff_req;
|
||||
|
||||
typedef struct rest_query_tariff_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
char prefix[24];
|
||||
u32 unit_time;
|
||||
u32 unit_charge;
|
||||
u32 discount;
|
||||
u32 plan_id;
|
||||
u32 bundle_plan_id;
|
||||
u64 total_plan_value;
|
||||
u64 used_plan_value;
|
||||
}_rest_query_tariff_res;
|
||||
|
||||
typedef struct rest_update_subs_req
|
||||
{
|
||||
u32 optional_flag;
|
||||
char msisdn[24];
|
||||
u32 account_id;
|
||||
u8 status; /*falg=1*/
|
||||
u32 balance;
|
||||
u32 balance_expiry_date;
|
||||
u32 basic_plan_id;
|
||||
u32 basic_plan_rent;
|
||||
u8 vas_cug_status;
|
||||
}_rest_update_subs_req;
|
||||
|
||||
typedef struct rest_update_subs_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
}_rest_update_subs_res;
|
||||
|
||||
typedef struct rest_delete_subs_req
|
||||
{
|
||||
char msisdn[24];
|
||||
u8 cause;
|
||||
}_rest_delete_subs_req;
|
||||
|
||||
typedef struct rest_delete_subs_res
|
||||
{
|
||||
u8 optional_flag;
|
||||
u8 result;
|
||||
u32 error_code;
|
||||
}_rest_delete_subs_res;
|
||||
|
||||
typedef struct rest_update_sess_info_req
|
||||
{
|
||||
u32 optional_flag; /*bit 0=called, 1= ue_ip, 2=pgw ip */
|
||||
char msisdn[24];
|
||||
u8 first_sess; /*if 1 then clear all session in database */
|
||||
u8 service_type; /*0=mo call, 1=mt call, 2=mo sms, 3= data*/
|
||||
u32 start_time;
|
||||
u32 consumed_value; /*duration of call, bytes of data */
|
||||
char called[24]; /*for call/sms */
|
||||
u32 ue_ip;
|
||||
u32 gw_ip;
|
||||
}_rest_update_sess_info_req;
|
||||
|
||||
typedef struct rest_update_plan_info_req
|
||||
{
|
||||
u32 optional_flag; /*bit 0=called, 1= ue_ip, 2=pgw ip */
|
||||
char msisdn[24];
|
||||
u8 service_type; /*0=mo call, 1=mt call, 2=mo sms, 3= data*/
|
||||
u32 account_id;
|
||||
u32 plan_id;
|
||||
u32 bundle_id;
|
||||
u64 plan_total_value;
|
||||
u64 plan_used_value;
|
||||
u32 sess_update_times;
|
||||
u64 this_time_add_value;
|
||||
}_rest_update_plan_info_req;
|
||||
|
||||
typedef struct rest_rent_charge_req
|
||||
{
|
||||
u32 optional_flag;
|
||||
char msisdn[24];
|
||||
u32 balance;
|
||||
u32 rent_charge;
|
||||
}_rest_rent_charge_req;
|
||||
|
||||
|
||||
|
||||
//======================================
|
||||
|
||||
typedef struct rest_msg_s
|
||||
{
|
||||
u8 msg_type;
|
||||
_rest_header header;
|
||||
union
|
||||
{
|
||||
_rest_query query;
|
||||
_rest_query_res query_res;
|
||||
_rest_topup topup;
|
||||
_rest_topup_res topup_res;
|
||||
|
||||
_rest_order order;
|
||||
_rest_order_res order_res;
|
||||
_rest_freeresource free_resource;
|
||||
_rest_freeresource_res free_resource_res;
|
||||
_rest_downloadApp downloadApp;
|
||||
_rest_downloadApp_res downloadApp_res;
|
||||
_rest_channel chnl;
|
||||
_rest_channel_res chnl_res;
|
||||
_rest_offerChange offerChange;
|
||||
_rest_offerChange_res offerChange_res;
|
||||
_rest_queryPoint queryPoint;
|
||||
_rest_queryPoint_res queryPoint_res;
|
||||
_rest_transferPoint transferPoint;
|
||||
_rest_transferPoint_res transferPoint_res;
|
||||
|
||||
// for selfcare
|
||||
_rest_send_authcode_req send_authcode_req;
|
||||
_rest_send_authcode_rsp send_authcode_rsp;
|
||||
_rest_query_user_data_req query_user_data_req;
|
||||
_rest_query_user_data_rsp query_user_data_rsp;
|
||||
_rest_bundle_subs_req bundle_subs_req;
|
||||
_rest_bundle_subs_rsp bundle_subs_rsp;
|
||||
_rest_bundle_usage_req bundle_usage_req;
|
||||
_rest_bundle_usage_rsp bundle_usage_rsp;
|
||||
_rest_recharge_req recharge_req;
|
||||
_rest_recharge_rsp recharge_rsp;
|
||||
_rest_transfer_req transfer_req;
|
||||
_rest_transfer_rsp transfer_rsp;
|
||||
_rest_recharge_card_req recharge_card_req;
|
||||
_rest_recharge_card_rsp recharge_card_rsp;
|
||||
_rest_check_balance_req check_balance_req;
|
||||
_rest_check_balance_rsp check_balance_rsp;
|
||||
_rest_query_balance_req query_balance_req;
|
||||
_rest_query_balance_rsp query_balance_rsp;
|
||||
//
|
||||
_rest_sms_deliver_req sms_deliver;
|
||||
_rest_sms_deliver_res sms_deliver_res;
|
||||
|
||||
_rest_create_acct_req create_acct;
|
||||
_rest_create_acct_res create_acct_res;
|
||||
|
||||
_rest_query_tariff_req query_tariff;
|
||||
_rest_query_tariff_res query_tariff_res;
|
||||
|
||||
_rest_update_subs_req update_subs;
|
||||
_rest_update_subs_res update_subs_res;
|
||||
|
||||
_rest_delete_subs_req delete_subs;
|
||||
_rest_delete_subs_res delete_subs_res;
|
||||
|
||||
_rest_update_sess_info_req update_sess_info;
|
||||
|
||||
_rest_update_plan_info_req update_plan_info;
|
||||
|
||||
_rest_rent_charge_req rent_charge;
|
||||
|
||||
|
||||
}msg;
|
||||
}_rest_msg_s;
|
||||
|
||||
int encode_rest_query(_rest_msg_s *ptr, u8 *buf);
|
||||
|
||||
int encode_rest_query_res(_rest_msg_s *ptr, u8 *buf);
|
||||
|
||||
int encode_rest_topup(_rest_msg_s *ptr, u8 *buf);
|
||||
|
||||
int encode_rest_topup_res(_rest_msg_s *ptr, u8 *buf);
|
||||
|
||||
int decode_rest_api_msg(u8 *buf, int len, _rest_msg_s *ptr);
|
||||
|
||||
// for selfcare======================================
|
||||
int encode_rest_send_authcode_req(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_send_authcode_rsp(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_query_user_data_req(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_query_user_data_rsp(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_bundle_subs_req(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_bundle_subs_rsp(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_bundle_usage_req(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_bundle_usage_rsp(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_recharge_req(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_recharge_rsp(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_transfer_req(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_transfer_rsp(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_recharge_card_req(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_recharge_card_rsp(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_check_balance_req(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_check_balance_rsp(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_query_balance_req(_rest_msg_s *ptr, u8 *buf);
|
||||
int encode_rest_query_balance_rsp(_rest_msg_s *ptr, u8 *buf);
|
||||
//
|
||||
|
||||
// for restproxy=====================================
|
||||
#define YX_USSD_MENU_MAIN 0
|
||||
#define YX_USSD_MENU_UNLIMITED_ONCE_RECUR 1
|
||||
#define YX_USSD_MENU_PRESS_ZED_DATA 2
|
||||
#define YX_USSD_MENU_PRESS_ZED_VOICE 3
|
||||
#define YX_USSD_MENU_PRESS_MIFI_AND_ROUTER 4
|
||||
#define YX_USSD_MENU_PRESS_INPUT_NO 5
|
||||
#define YX_USSD_MENU_PRESS_BALANCE_CHECK 6
|
||||
#define YX_USSD_MENU_PRESS_AMA 7
|
||||
#define YX_USSD_MENU_PRESS_UNLIMITED_BUNDLES 8
|
||||
#define YX_USSD_MENU_PRESS_PURCHASE_AIRTIME 9
|
||||
#define YX_USSD_MENU_DATA_24HRS 10
|
||||
#define YX_USSD_MENU_DATA_7DAYS 11
|
||||
#define YX_USSD_MENU_DATA_30DAYS 12
|
||||
#define YX_USSD_MENU_VOICE_DAILY 13
|
||||
#define YX_USSD_MENU_VOICE_WEEKLY 14
|
||||
#define YX_USSD_MENU_VOICE_MONTHLY 15
|
||||
#define YX_USSD_MENU_MIFI_SUB 16
|
||||
#define YX_USSD_MENU_BUY_FOR_OTHER 17
|
||||
#define YX_USSD_MENU_SELECT_PROVIDER 18
|
||||
#define YX_USSD_MENU_ENTER_PAY_NUMBER 19
|
||||
#define YX_USSD_MENU_SELECT_MONEY 20
|
||||
#define YX_USSD_MENU_PAID_MONEY 21
|
||||
#define YX_USSD_MENU_SELECT_MOBIL_MONEY 22
|
||||
#define YX_USSD_MENU_SUBSCRIB_COMPLETE 23
|
||||
#define YX_USSD_MENU_CANCEL_RENEWAL 24
|
||||
#define YX_USSD_MENU_AIRTIME_AMOUNT 25
|
||||
#define YX_USSD_MENU_AIRTIME_NO 26
|
||||
#define YX_USSD_MENU_DIBAAMA 27
|
||||
#define YX_USSD_MENU_DIBA 28
|
||||
#define YX_USSD_MENU_MOMO_PIN 29
|
||||
#define YX_USSD_MENU_PROMO 30
|
||||
#define YX_USSD_MENU_QUERY_POINT 31
|
||||
#define YX_USSD_MENU_CUR_POINT 32
|
||||
#define YX_USSD_MENU_POINT2NUM 33
|
||||
#define YX_USSD_MENU_OFFER_CHANGED 34
|
||||
#define YX_USSD_MENU_POINT_TRANSFERED 35
|
||||
#define YX_USSD_MENU_POINT_LOW 36
|
||||
#define YX_USSD_MENU_OFFER_OUT 37
|
||||
#define YX_USSD_MENU_POINT_TRANS_FAIL 38
|
||||
#define YX_USSD_MENU_SHARE_NBR 39
|
||||
#define YX_USSD_MENU_NUM_MAX 64
|
||||
extern char yx_ussd_menu[YX_USSD_MENU_NUM_MAX][512];
|
||||
#define YX_USSD_CHNL_NUM_MAX 16
|
||||
extern char yx_chnl_info[YX_USSD_CHNL_NUM_MAX][128];
|
||||
|
||||
#define YX_MOBILE_MONEY_MAX 8
|
||||
#define YX_OFFER_TYPE_MAX 10
|
||||
#define YX_OFFER_TYPE_BUNDLE 0
|
||||
#define YX_OFFER_TYPE_DATA_1 1
|
||||
#define YX_OFFER_TYPE_DATA_2 2
|
||||
#define YX_OFFER_TYPE_DATA_3 3
|
||||
#define YX_OFFER_TYPE_VOICE_1 4
|
||||
#define YX_OFFER_TYPE_VOICE_2 5
|
||||
#define YX_OFFER_TYPE_VOICE_3 6
|
||||
#define YX_OFFER_TYPE_MIFI_1 7
|
||||
#define YX_OFFER_TYPE_AMA_1 8
|
||||
#define YX_OFFER_TYPE_DIBA_1 9
|
||||
#define YX_OFFER_PER_TYPE 12
|
||||
|
||||
int pps_third_party_plan_process(u_short portid);
|
||||
int pps_third_party_channel_process(u_short portid);
|
||||
int match_channel_info(char *sc, char *url);
|
||||
|
||||
//
|
||||
|
||||
#endif
|
||||
1
mss/pps/src/include/stamp-h
Normal file
1
mss/pps/src/include/stamp-h
Normal file
@@ -0,0 +1 @@
|
||||
timestamp
|
||||
1
mss/pps/src/include/stamp-h.in
Normal file
1
mss/pps/src/include/stamp-h.in
Normal file
@@ -0,0 +1 @@
|
||||
timestamp
|
||||
54
mss/pps/src/include/tariff.h
Normal file
54
mss/pps/src/include/tariff.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
** Written completely by Liang Hongbin
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef TARIFF__H
|
||||
#define TARIFF__H
|
||||
#include "ramdata.h"
|
||||
|
||||
#define PERIODIC_CHARGE_HOUR 9
|
||||
#define PERIODIC_CHARGE_MINUTE 0
|
||||
#define PERIODIC_CHARGE_SECOND 0
|
||||
#define PERIODIC_OF_DAY 24
|
||||
#define MAX_MEGA_SIZE 34
|
||||
#define PRIVATE_TARIFF_SIZE (MAX_MEGA_SIZE*1024*1024)
|
||||
|
||||
typedef struct {
|
||||
_comm_tariff comm_tariff[MAX_ZONE_NUM];
|
||||
_rent_tariff rent_tariff[MAX_ZONE_NUM][MAX_RENT_TARIFF];
|
||||
_bill_tariff bill_tariff[MAX_ZONE_NUM][BILLING_BASE_NUM];
|
||||
_bill_tariff called_tariff[MAX_ZONE_NUM][CALLED_BASE_NUM];
|
||||
u_char bill_discount[MAX_DISCOUNT_ID][PERIODIC_OF_DAY][8];
|
||||
u_char holiday_flag[12][31];
|
||||
_bill_sms bill_sms[MAX_ZONE_NUM][MAX_SMS_PREFIX];
|
||||
_gprs_tariff gprs_tariff[MAX_ZONE_NUM][MAX_GPRS_PREFIX];
|
||||
VAS_TARIFF vas_tariff[MAX_ZONE_NUM];
|
||||
} _tariff_private;
|
||||
|
||||
|
||||
|
||||
#define PPS_PREFIX_NODE_NUM (MAX_ZONE_NUM_NEW*4096)
|
||||
typedef struct
|
||||
{
|
||||
u_short sub[14];
|
||||
u_char flag; //bit0=0/1: prefix not exist/exist;bit1=0/1:prefix not exist in sub node/exist
|
||||
u_short prefix_index;
|
||||
}_pps_prefix_node;
|
||||
|
||||
//_pps_prefix_node pps_prefix_table[MAX_ZONE_NUM_NEW][PPS_PREFIX_NODE_NUM];
|
||||
//_pps_prefix_node pps_prefix_table[PPS_PREFIX_NODE_NUM];
|
||||
/* the ZONE NUM is as a prefix or a separate table is for further study,
|
||||
if the ZONE NUM is as prefix , then should not be larger than 16 */
|
||||
|
||||
|
||||
int ListCurrentTariff(int zone_id);
|
||||
void ListTariffPlan();
|
||||
void ListCurrentTariffWithMsisdn(char *number);
|
||||
|
||||
|
||||
int pps_create_tariff_table();
|
||||
int pps_add_charge_prefix(u_short iroot, char *prefix_digits, u_char len, u_short table_index);
|
||||
int pps_get_charge_prefix(u_char cosID,char *dialing_number);
|
||||
|
||||
#endif /* TARIFF__H */
|
||||
21
mss/pps/src/include/version.h
Normal file
21
mss/pps/src/include/version.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
**
|
||||
**
|
||||
** file name: version.h
|
||||
** CVS $Id: $
|
||||
**
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef VERSION__H
|
||||
#define VERSION__H
|
||||
void PutVersionID(char *prog_name, char *distrib_date);
|
||||
void SetVersionID(u_char *ptr); // Set version id to shared memory
|
||||
|
||||
#define VER_MAJOR 2
|
||||
#define VER_MINOR 1
|
||||
#define VER_FIX 16
|
||||
#define DISTRIB_DATE DATE_MACRO
|
||||
#define PROJECT_INFO "WAVEprepaid"
|
||||
|
||||
#endif /* VERSION__H */
|
||||
169
mss/pps/src/include/voiceID.h
Normal file
169
mss/pps/src/include/voiceID.h
Normal file
@@ -0,0 +1,169 @@
|
||||
|
||||
#ifndef ppsVoiceID_H
|
||||
#define ppsVoiceID_H
|
||||
|
||||
typedef enum _VOICE_GROUP
|
||||
{
|
||||
ERROR_ACCOUNT_STATUS =0,
|
||||
LOW_ACCOUNT_BALANCE,
|
||||
EXPIRIED_ACCOUNT,
|
||||
EMPTY_NUMBER,
|
||||
MT_ERROR_ACCOUNT_STATUS,
|
||||
MT_LOW_ACCOUNT_BALANCE,
|
||||
MT_EXPIRIED_ACCOUNT,
|
||||
MT_EMPTY_NUMBER,
|
||||
SERIVCE_NOT_APPLIED,
|
||||
CALLED_TARIFF_NOT_SET, /* called number is not set in the tariff table */
|
||||
SERVICE_SELECT_PROMPT, /* service center greeting */
|
||||
ERROR_SERVICE_KEY, /* error service key */
|
||||
ACCOUNT_BALANCE_IS, /* account balance is */
|
||||
EXPIRY_IN,
|
||||
INPUT_RECHARGE_ACCOUNT, /* please input account recharged */
|
||||
ERROR_RECHARGE_ACCOUNT, /* error recharge account, please input again */
|
||||
INPUT_PRECARD_PWD, /* please input prepaid card password */
|
||||
RECHARGE_SUCCESS, /* recharge successfully, and recharge amount is:xxx */
|
||||
RECHARGE_FAILED, /* recharge failed , error card, please input again */
|
||||
FAVORITE_NUMBER_FUNC,
|
||||
ERROR_FAVUMBER_INPUT_AND_INPUT_AGAIN,
|
||||
FULL_FAVORITE_NUMBER,
|
||||
NO_FAVORITE_NUMBER,
|
||||
ADD_FAVORITE_NUMBER_SUC,
|
||||
INPUT_EDIT_FAVORITE_NUMBER_SN,
|
||||
NO_SUCH_SN_FAVORITE_NUMBER,
|
||||
INPUT_NEW_FAVORITE_NUMBER,
|
||||
INPUT_INQUIRY_FAVORITE_NUMBER_SN,
|
||||
SN_X_FAVORITE_NUMBER_IS,
|
||||
PRE_WARNING_LOW_BALANCE,
|
||||
TO_BE_RECHARGED_NUMBER,
|
||||
YES_OR_NO=31,
|
||||
TO_BE_ADDED_NUMBER_IS,
|
||||
PRE_WARNING_EXPIRATION_DAY,
|
||||
LANGUAGE_MANAGEMENT_MENU,
|
||||
YOUR_DEFAULT_LANGUAGE_SET_IS,
|
||||
INVALID_LANGUAGE_SELECTION_KEY,
|
||||
INPUT_OLD_PIN,
|
||||
ERROR_PIN,
|
||||
INPUT_NEW_PIN,
|
||||
INPUT_NEW_PIN_AGAIN,
|
||||
ERROR_PIN_LENGTH,
|
||||
TWO_PINS_NOT_MATCH,
|
||||
PIN_SET_OK,
|
||||
INQUIRY_RECHARGE_KEY,
|
||||
LAST_CALL_AT,
|
||||
ONLY_BALANCE_IS,
|
||||
RECHARGE_TYPE_SELECTION,
|
||||
PRESS_1_TO_RECHARGE,
|
||||
PRESS_2_TO_USE_CREDIT_VAULT,
|
||||
OPERATION_SUCESSFULLY_DONE=50,
|
||||
INQUIRY_MESSAGE_FROM,
|
||||
TO_,
|
||||
FROM_,
|
||||
INQUIRY_WITH_PROMOTION=59,
|
||||
HPLMN_VMS_PROMPT = 60,
|
||||
PSTN_VMS_PROMPT,
|
||||
INPUT_VOICEBOX,
|
||||
NO_SUCH_VOICEBOX,
|
||||
ERROR_CALLER_STATUS_SUSPEND=66,
|
||||
ERROR_CALLER_STATUS_BLACKLISTED,
|
||||
ERROR_CALLER_STATUS_RELEASED,
|
||||
ERROR_CALLER_STATUS_EXTERNAL,
|
||||
ERROR_CALLED_STATUS_SUSPEND,
|
||||
ERROR_CALLED_STATUS_BLACKLISTED,
|
||||
ERROR_CALLED_STATUS_RELEASED,
|
||||
ERROR_CALLED_STATUS_EXTERNAL,
|
||||
|
||||
/** for calling card ****/
|
||||
PleaseInputCallingCardAccount = 100,
|
||||
InvalidAccountIputAgain,
|
||||
MakingCall,
|
||||
CallingCardMainMenu,
|
||||
PleaseInputCalledNumber,
|
||||
InvalidCalledNumberInputAgain,
|
||||
PleaseInputTransferInAccount,
|
||||
PleaseInputTransferOutPassword,
|
||||
TransferSuccess,
|
||||
TransferFail,
|
||||
ThankYouUseByeBye,
|
||||
CallingCardPasswordSetSuccess,
|
||||
/** for calling card ****/
|
||||
|
||||
/** for opr ****/
|
||||
OPR_SERVICE_SELECT_PROMPT = 120,
|
||||
IMEI_REGISTER_FAIL,
|
||||
MS_REGISTER_SUCCESS,
|
||||
INPUT_MOBILE_IMEI,
|
||||
INPUT_MOBILE_IMEI_AGAIN,
|
||||
IMEI_REGISTERING,
|
||||
REGISTER_OPR_IMEI_ERROR,
|
||||
REGISTER_OPR_FAIL_PWD_ERROR,
|
||||
IMEI_REGISTER_FAIL_IMEI_NOT_SAME,
|
||||
|
||||
INPUT_SWITCH_KEY,
|
||||
INPUT_SWITCH_TO_OPR_SUCCESS,
|
||||
INPUT_SWITCH_TO_OPR_FAIL,
|
||||
INPUT_SWITCH_TO_ROAMING_SUCCESS,
|
||||
INPUT_SWITCH_TO_ROAMING_FAIL,
|
||||
|
||||
INPUT_INQUERY_KEY,
|
||||
INPUT_REPLAY_OR_BACK,
|
||||
|
||||
NOT_REGISTER_STATUS,
|
||||
OPR_STATUS,
|
||||
ROAMING_STATUS,
|
||||
YOUR_NUMBER_IS,
|
||||
FIX_REGISTER_SUCCESS,
|
||||
/** for opr ****/
|
||||
|
||||
/** for fee transfer ****/
|
||||
PleaseInputTransferInAccountAgain = 150,
|
||||
NotMatchedTransferOutAccount,
|
||||
FULL_PARTIAL_TRANSFER_CHOICE,
|
||||
INPUT_FEE_TRANSFERED,
|
||||
INPUT_FEE_TRANSFERED_FORMAT_ERROR,
|
||||
TRANSFERED_FEE_INSUFFIENT,
|
||||
TRANSFERED_FEE_EXPIERED,
|
||||
INPUT_TRANSFER_CONFIRM,
|
||||
CHARGE_OR_TRANSFER,
|
||||
CONFIRM_LISTEN_AGAIN,
|
||||
/** for fee transfer ****/
|
||||
|
||||
/** for masterSlaveCard ****/
|
||||
MASTER_CARD_PROMPT = 161,
|
||||
SLAVE_CARD_PROMPT,
|
||||
ENQUIRY_EMPTY,
|
||||
MASTER_CARD_HOW_MANY_CHILDREN,
|
||||
MASTER_CARD_CHILD_NUMBER,
|
||||
NO_CHILD_NUMBER_RELATED,
|
||||
SLAVE_ENQUIRY_MENU=167,
|
||||
SLAVE_ENQUIRY_PARENT_NUMBER,
|
||||
SLAVE_ENQUIRY_LIMITS,
|
||||
SLAVE_ENQUIRY_TODAY,
|
||||
|
||||
MASTER_INPUT_CHILD_ADD=171,
|
||||
MASTER_INPUT_CHILD_DEL,
|
||||
ADD_FAIL_ALREADY_EXIST,
|
||||
DEL_FAIL_NOT_YOUR_CHILD,
|
||||
ADD_FAIL_FULL=175,
|
||||
ADD_FAIL_INSUFFICIENT_FEE,
|
||||
DEL_FAIL_EMPTY,
|
||||
MASTER_SELECT_COS,
|
||||
MASTER_CONFIRM_ADD,
|
||||
MASTER_CONFIRM_DEL,
|
||||
MASTER_ADD_SUCCESS,
|
||||
MASTER_DEL_SUCCESS,
|
||||
CHILD_REACH_CALL_LIMIT,
|
||||
CHILD_REACH_CHARGE_LIMIT=184,
|
||||
|
||||
/** for masterSlaveCard ****/
|
||||
|
||||
FAVORITE_NUMBER_FUNC_EDIT_QUERY=190,
|
||||
FAVORITE_NUMBER_FUNC_QUERY,
|
||||
FAVUMBER_EXIST_INPUT_AGAIN,
|
||||
FAVORITE_READ_NUMBER_DIDT_QUERY,
|
||||
FAVORITE_READ_NUMBER_QUERY,
|
||||
|
||||
}VOICE_GROUP;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
91
mss/pps/src/lib/Makefile
Normal file
91
mss/pps/src/lib/Makefile
Normal file
@@ -0,0 +1,91 @@
|
||||
#!/bin/sh
|
||||
# $id: $
|
||||
|
||||
# Makefile for SCSM.
|
||||
# Created by Liang Hongbin, 2003-09-25
|
||||
|
||||
CC = gcc
|
||||
CFLAGS=-D_REENTRANT -g -Wall
|
||||
oldincludedir = /usr/include
|
||||
M_COMPILE.c=$(CC) $(CFLAGS)
|
||||
M_LINK.c=$(CC) $(CFLAGS)
|
||||
COMPILE.c=$(CC) $(CFLAGS)
|
||||
LINK.c=$(CC) $(CFLAGS)
|
||||
|
||||
|
||||
LIB_OBJ = comfunc.o daemon.o debug.o error.o errorlog.o ppsfun.o iofunc.o ipcfunc.o logfunc.o queuefunc.o signal.o time.o version.o
|
||||
|
||||
|
||||
all : CHECK $(LIB_OBJ)
|
||||
ar r libppsfuns.a $(LIB_OBJ)
|
||||
|
||||
comfunc.o:comfunc.c
|
||||
$(M_COMPILE.c) -c comfunc.c
|
||||
|
||||
daemon.o:daemon.c
|
||||
$(M_COMPILE.c) -c daemon.c
|
||||
|
||||
debug.o:debug.c
|
||||
$(M_COMPILE.c) -c debug.c
|
||||
|
||||
error.o:error.c
|
||||
$(M_COMPILE.c) -c error.c
|
||||
|
||||
errorlog.o:errorlog.c
|
||||
$(M_COMPILE.c) -c errorlog.c
|
||||
|
||||
ppsfun.o:ppsfun.c
|
||||
$(M_COMPILE.c) -c ppsfun.c
|
||||
|
||||
iofunc.o:iofunc.c
|
||||
$(M_COMPILE.c) -c iofunc.c
|
||||
|
||||
ipcufnc.o:ipcfunc.c
|
||||
$(M_COMPILE.c) -c ipcfunc.c
|
||||
|
||||
logfunc.o:logfunc.c
|
||||
$(M_COMPILE.c) -c logfunc.c
|
||||
|
||||
queuefunc.o:queuefunc.c
|
||||
$(M_COMPILE.c) -c queuefunc.c
|
||||
|
||||
signal.o:signal.c
|
||||
$(M_COMPILE.c) -c signal.c
|
||||
|
||||
time.o:time.c
|
||||
$(M_COMPILE.c) -c time.c
|
||||
|
||||
version.o:version.c
|
||||
$(M_COMPILE.c) -c version.c
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
CHECK:
|
||||
@echo "Using FLAGS = $(CFLAGS)"
|
||||
@echo "Using LIBS = $(LIB_FLAGS)"
|
||||
|
||||
|
||||
MAKEDIR = || exec false; \
|
||||
if test -d "$$dir"; then :; else \
|
||||
echo mkdir "$$dir"; \
|
||||
mkdir -p "$$dir" >/dev/null 2>&1 || \
|
||||
test -d "$$dir" || \
|
||||
mkdir "$$dir" || \
|
||||
exec false; fi || exec false
|
||||
|
||||
.c.o: # .deps/.dummy
|
||||
@if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
|
||||
dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
|
||||
# @if (: >> .deps/$@ || : > .deps/$@) >/dev/null 2>&1; then :; \
|
||||
# else dir=.deps/`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` \
|
||||
# $(MAKEDIR); fi; rm -f .deps/$@ .deps/$@d
|
||||
@echo Compiling $*.c
|
||||
@$(CC) -I. $(CFLAGS) $(INCLUDE_FLAGS) -c $< \
|
||||
-o $@ # -Wp,-MD,.deps/$@
|
||||
clean:
|
||||
-rm -f core *.o *.c~ *.h~ *.a
|
||||
|
||||
# cd mapp;make clean;cd ..
|
||||
# cd capp;make clean;cd ..
|
||||
|
||||
22
mss/pps/src/lib/Makefile.am
Normal file
22
mss/pps/src/lib/Makefile.am
Normal file
@@ -0,0 +1,22 @@
|
||||
##
|
||||
##
|
||||
##
|
||||
## file name: Makefile
|
||||
##
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
##
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
include $(top_srcdir)/Rules.make
|
||||
|
||||
noinst_LIBRARIES = libppfuncs.a
|
||||
INCLUDES = -I../include
|
||||
|
||||
libppfuncs_a_SOURCES = \
|
||||
daemon.c error.c errorlog.c function.c ipcfunc.c \
|
||||
comfunc.c signal.c msgfunc.c queuefunc.c logfunc.c crypt.c \
|
||||
time.c version.c iofunc.c debug.c
|
||||
|
||||
#libppfuncs_a_LIBADD = @LIBOBJS@
|
||||
libppfuncs_a_DEPENDENCIES = $(libppfuncs_a_SOURCES)
|
||||
278
mss/pps/src/lib/Makefile.in
Normal file
278
mss/pps/src/lib/Makefile.in
Normal file
@@ -0,0 +1,278 @@
|
||||
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
#CFLAGS = -O6 -Wall
|
||||
#CFLAGS = -g -O6 -Wall
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
CC = @CC@
|
||||
CHMOD = @CHMOD@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MV = @MV@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@
|
||||
SED = @SED@
|
||||
VERSION = @VERSION@
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
LDFLAGS = -L$(MYSQLdir)/lib -lm
|
||||
PPLIBdir = $(top_srcdir)/lib
|
||||
|
||||
noinst_LIBRARIES = libppfuncs.a
|
||||
INCLUDES = -I../include
|
||||
|
||||
libppfuncs_a_SOURCES = \
|
||||
daemon.c error.c errorlog.c function.c ipcfunc.c \
|
||||
comfunc.c signal.c msgfunc.c queuefunc.c logfunc.c crypt.c \
|
||||
time.c version.c iofunc.c debug.c
|
||||
|
||||
|
||||
#libppfuncs_a_LIBADD = @LIBOBJS@
|
||||
libppfuncs_a_DEPENDENCIES = $(libppfuncs_a_SOURCES)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I../include
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LIBS = @LIBS@
|
||||
libppfuncs_a_LIBADD =
|
||||
libppfuncs_a_OBJECTS = daemon.o error.o errorlog.o function.o ipcfunc.o \
|
||||
comfunc.o signal.o msgfunc.o queuefunc.o logfunc.o crypt.o time.o \
|
||||
version.o iofunc.o debug.o
|
||||
AR = ar
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
SOURCES = $(libppfuncs_a_SOURCES)
|
||||
OBJECTS = $(libppfuncs_a_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .o .s
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/Rules.make
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps lib/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
mostlyclean-noinstLIBRARIES:
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
|
||||
distclean-noinstLIBRARIES:
|
||||
|
||||
maintainer-clean-noinstLIBRARIES:
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
|
||||
libppfuncs.a: $(libppfuncs_a_OBJECTS) $(libppfuncs_a_DEPENDENCIES)
|
||||
-rm -f libppfuncs.a
|
||||
$(AR) cru libppfuncs.a $(libppfuncs_a_OBJECTS) $(libppfuncs_a_LIBADD)
|
||||
$(RANLIB) libppfuncs.a
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = lib
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am:
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
|
||||
mostlyclean-tags mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \
|
||||
mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-noinstLIBRARIES distclean-compile \
|
||||
distclean-tags distclean-generic clean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
|
||||
maintainer-clean-compile maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
|
||||
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
|
||||
clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
|
||||
check-am installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
127
mss/pps/src/lib/comfunc.c
Normal file
127
mss/pps/src/lib/comfunc.c
Normal file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
**
|
||||
** Title: comfunc.c
|
||||
**
|
||||
** Description: Functions of comunication for WXC2.
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
|
||||
/*
|
||||
** passivesock - allocate & bind a server socket using TCP or UDP
|
||||
*/
|
||||
|
||||
int
|
||||
passivesock( const char * transport, u_short portbase, int qlen)
|
||||
{
|
||||
struct sockaddr_in sin;
|
||||
int s, type;
|
||||
|
||||
memset(& sin, 0, sizeof(sin));
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(portbase);
|
||||
sin.sin_addr.s_addr = INADDR_ANY;
|
||||
bzero(&(sin.sin_zero), 8);
|
||||
|
||||
if ( strcmp(transport, "UDP") == 0)
|
||||
type = SOCK_DGRAM;
|
||||
else
|
||||
type = SOCK_STREAM;
|
||||
s = socket(AF_INET, type, 0);
|
||||
if (s < 0) {
|
||||
perror("socket");
|
||||
return -3;
|
||||
}
|
||||
if (bind(s, (struct sockaddr *) & sin, sizeof(sin)) < 0) {
|
||||
perror("bind");
|
||||
close(s);
|
||||
return -4;
|
||||
}
|
||||
|
||||
if (type == SOCK_STREAM && listen(s, qlen) < 0) {
|
||||
perror("listen");
|
||||
close(s);
|
||||
return -5;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
** passiveUDP - create a passive socket for use in a UDP server
|
||||
*/
|
||||
|
||||
int
|
||||
passiveUDP(u_short portbase)
|
||||
{
|
||||
return (passivesock("UDP", portbase, 0) );
|
||||
}
|
||||
|
||||
const char *
|
||||
Inet_ntoa(const long addr)
|
||||
{
|
||||
struct sockaddr_in sin;
|
||||
|
||||
sin.sin_addr.s_addr = addr;
|
||||
return ((char *) inet_ntoa(sin.sin_addr) );
|
||||
}
|
||||
|
||||
|
||||
const long
|
||||
ppsInet_pton(const char *sp)
|
||||
{
|
||||
struct in_addr i_addr;
|
||||
|
||||
inet_pton(AF_INET, sp, &i_addr);
|
||||
return i_addr.s_addr;
|
||||
}
|
||||
|
||||
/*
|
||||
const long
|
||||
GetLocalIP(void)
|
||||
{
|
||||
struct hostent *hptr;
|
||||
char hostname[40]="\0";
|
||||
struct in_addr *inaddr;
|
||||
|
||||
if ((gethostname(hostname, -1)) != 0){
|
||||
return -1;
|
||||
}
|
||||
if ((hptr = gethostbyname(hostname)) == NULL){
|
||||
return -1;
|
||||
}
|
||||
inaddr = (struct in_addr *)(*hptr->h_addr_list);
|
||||
return inaddr->s_addr;
|
||||
}
|
||||
*/
|
||||
int
|
||||
RecvMsg (int sockfd, u_char *buf, int len,
|
||||
int src_ip, int src_port)
|
||||
{
|
||||
struct sockaddr_in sin;
|
||||
int nbytes;
|
||||
|
||||
socklen_t size = sizeof(sin);
|
||||
nbytes = recvfrom(sockfd, &buf, 1024,
|
||||
0, (struct sockaddr *) &sin, &size);
|
||||
src_ip = sin.sin_addr.s_addr;
|
||||
src_port = sin.sin_port;
|
||||
len = nbytes;
|
||||
return nbytes;
|
||||
}
|
||||
|
||||
int
|
||||
SendMsg (int sockfd, u_char *buf, int len,
|
||||
int dest_ip, int dest_port)
|
||||
{
|
||||
struct sockaddr_in sin;
|
||||
int retval=0;
|
||||
|
||||
bzero(&sin.sin_zero, sizeof(sin.sin_zero));
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_addr.s_addr = dest_ip;
|
||||
sin.sin_port = htons(dest_port);
|
||||
retval = sendto(sockfd, &buf, len, 0,
|
||||
(struct sockaddr *)&sin, sizeof(sin));
|
||||
return retval;
|
||||
}
|
||||
473
mss/pps/src/lib/crypt.c
Normal file
473
mss/pps/src/lib/crypt.c
Normal file
@@ -0,0 +1,473 @@
|
||||
/*
|
||||
**
|
||||
**
|
||||
** file name: crypt.c
|
||||
**
|
||||
** Crypt functions
|
||||
**
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
static unsigned char T1[] =
|
||||
{
|
||||
57,49,41,33,25,17, 9, 1,
|
||||
59,51,43,35,27,19,11, 3,
|
||||
61,53,45,37,29,21,13, 5,
|
||||
63,55,47,39,31,23,15, 7,
|
||||
56,48,40,32,24,16, 8, 0,
|
||||
58,50,42,34,26,18,10, 2,
|
||||
60,52,44,36,28,20,12, 4,
|
||||
62,54,46,38,30,22,14, 6
|
||||
};
|
||||
|
||||
static unsigned char T2[] =
|
||||
{
|
||||
39, 7,47,15,55,23,63,31,
|
||||
38, 6,46,14,54,22,62,30,
|
||||
37, 5,45,13,53,21,61,29,
|
||||
36, 4,44,12,52,20,60,28,
|
||||
35, 3,43,11,51,19,59,27,
|
||||
34, 2,42,10,50,18,58,26,
|
||||
33, 1,41, 9,49,17,57,25,
|
||||
32, 0,40, 8,48,16,56,24
|
||||
};
|
||||
|
||||
static unsigned char T3[] =
|
||||
{
|
||||
31, 0, 1, 2, 3, 4,
|
||||
3, 4, 5, 6, 7, 8,
|
||||
7, 8, 9,10,11,12,
|
||||
11,12,13,14,15,16,
|
||||
15,16,17,18,19,20,
|
||||
19,20,21,22,23,24,
|
||||
23,24,25,26,27,28,
|
||||
27,28,29,30,31, 0
|
||||
};
|
||||
|
||||
static unsigned char T5[] =
|
||||
{
|
||||
15, 6,19,20,
|
||||
28,11,27,16,
|
||||
0,14,22,25,
|
||||
4,17,30, 9,
|
||||
1, 7,23,13,
|
||||
31,26, 2, 8,
|
||||
18,12,29, 5,
|
||||
21,10, 3,24
|
||||
};
|
||||
|
||||
static unsigned char T7_1_2[] =
|
||||
{
|
||||
56,48,40,32,24,16, 8,
|
||||
0,57,49,41,33,25,17,
|
||||
9, 1,58,50,42,34,26,
|
||||
18,10, 2,59,51,43,35,
|
||||
62,54,46,38,30,22,14,
|
||||
6,61,53,45,37,29,21,
|
||||
13, 5,60,52,44,36,28,
|
||||
20,12, 4,27,19,11, 3
|
||||
};
|
||||
|
||||
static unsigned char T8[] =
|
||||
{
|
||||
0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0
|
||||
};
|
||||
|
||||
static unsigned char T9[] =
|
||||
{
|
||||
13,16,10,23, 0, 4,
|
||||
2,27,14, 5,20, 9,
|
||||
22,18,11, 3,25, 7,
|
||||
15, 6,26,19,12, 1,
|
||||
40,51,30,36,46,54,
|
||||
29,39,50,44,32,47,
|
||||
43,48,38,55,33,52,
|
||||
45,41,49,35,28,31
|
||||
};
|
||||
|
||||
static unsigned char T6[][64] =
|
||||
{
|
||||
{/* S1 */
|
||||
14, 4,13, 1, 2,15,11, 8, 3,10, 6,12, 5, 9, 0, 7,
|
||||
0,15, 7, 4,14, 2,13, 1,10, 6,12,11, 9, 5, 3, 8,
|
||||
4, 1,14, 8,13, 6, 2,11,15,12, 9, 7, 3,10, 5, 0,
|
||||
15,12, 8, 2, 4, 9, 1, 7, 5,11, 3,14,10, 0, 6,13
|
||||
},
|
||||
{/* S2 */
|
||||
15, 1, 8,14, 6,11, 3, 4, 9, 7, 2,13,12, 0, 5,10,
|
||||
3,13, 4, 7,15, 2, 8,14,12, 0, 1,10, 6, 9,11, 5,
|
||||
0,14, 7,11,10, 4,13, 1, 5, 8,12, 6, 9, 3, 2,15,
|
||||
13, 8,10, 1, 3,15, 4, 2,11, 6, 7,12, 0, 5,14, 9
|
||||
},
|
||||
{/* S3 */
|
||||
10, 0, 9,14, 6, 3,15, 5, 1,13,12, 7,11, 4, 2, 8,
|
||||
13, 7, 0, 9, 3, 4, 6,10, 2, 8, 5,14,12,11,15, 1,
|
||||
13, 6, 4, 9, 8,15, 3, 0,11, 1, 2,12, 5,10,14, 7,
|
||||
1,10,13, 0, 6, 9, 8, 7, 4,15,14, 3,11, 5, 2,12
|
||||
},
|
||||
{/* S4 */
|
||||
7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15,
|
||||
13, 8,11, 5, 6,15, 0, 3, 4, 7, 2,12, 1,10,14, 9,
|
||||
10, 6, 9, 0,12,11, 7,13,15, 1, 3,14, 5, 2, 8, 4,
|
||||
3,15, 0, 6,10, 1,13, 8, 9, 4, 5,11,12, 7, 2,14
|
||||
},
|
||||
{/* S5 */
|
||||
2,12, 4, 1, 7,10,11, 6, 8, 5, 3,15,13, 0,14, 9,
|
||||
14,11, 2,12, 4, 7,13, 1, 5, 0,15,10, 3, 9, 8, 6,
|
||||
4, 2, 1,11,10,13, 7, 8,15, 9,12, 5, 6, 3, 0,14,
|
||||
11, 8,12, 7, 1,14, 2,13, 6,15, 0, 9,10, 4, 5, 3
|
||||
},
|
||||
{/* S6 */
|
||||
12, 1,10,15, 9, 2, 6, 8, 0,13, 3, 4,14, 7, 5,11,
|
||||
10,15, 4, 2, 7,12, 9, 5, 6, 1,13,14, 0,11, 3, 8,
|
||||
9,14,15, 5, 2, 8,12, 3, 7, 0, 4,10, 1,13,11, 6,
|
||||
4, 3, 2,12, 9, 5,15,10,11,14, 1, 7, 6, 0, 8,13
|
||||
},
|
||||
{/* S7 */
|
||||
4,11, 2,14,15, 0, 8,13, 3,12, 9, 7, 5,10, 6, 1,
|
||||
13, 0,11, 7, 4, 9, 1,10,14, 3, 5,12, 2,15, 8, 6,
|
||||
1, 4,11,13,12, 3, 7,14,10,15, 6, 8, 0, 5, 9, 2,
|
||||
6,11,13, 8, 1, 4,10, 7, 9, 5, 0,15,14, 2, 3,12
|
||||
},
|
||||
{/* S8 */
|
||||
13, 2, 8, 4, 6,15,11, 1,10, 9, 3,14, 5, 0,12, 7,
|
||||
1,15,13, 8,10, 3, 7, 4,12, 5, 6,11, 0,14, 9, 2,
|
||||
7,11, 4, 1, 9,12,14, 2, 0, 6,10,13,15, 3, 5, 8,
|
||||
2, 1,14, 7, 4,10, 8,13,15,12, 9, 0, 3, 5, 6,11
|
||||
}
|
||||
};
|
||||
|
||||
unsigned char TE[][4] =
|
||||
{
|
||||
{0,0,0,0},
|
||||
{0,0,0,1},
|
||||
{0,0,1,0},
|
||||
{0,0,1,1},
|
||||
{0,1,0,0},
|
||||
{0,1,0,1},
|
||||
{0,1,1,0},
|
||||
{0,1,1,1},
|
||||
{1,0,0,0},
|
||||
{1,0,0,1},
|
||||
{1,0,1,0},
|
||||
{1,0,1,1},
|
||||
{1,1,0,0},
|
||||
{1,1,0,1},
|
||||
{1,1,1,0},
|
||||
{1,1,1,1}
|
||||
};
|
||||
|
||||
void Ks (unsigned char *Key, unsigned char Kn[16][48])
|
||||
{
|
||||
unsigned char cd[56];
|
||||
unsigned char zt[60];
|
||||
int n, i;
|
||||
unsigned char tmp11, tmp12, tmp21, tmp22;
|
||||
unsigned char *Knn;
|
||||
|
||||
/* choix 1 */
|
||||
for (i = 0; i < 56; i++)
|
||||
{
|
||||
cd[i] = Key[T7_1_2[i]];
|
||||
}
|
||||
|
||||
for (n = 0; n < 16; n++)
|
||||
{
|
||||
if (T8[n] == 0)
|
||||
{
|
||||
tmp11 = cd[0];
|
||||
tmp21 = cd[28];
|
||||
memcpy( zt , &cd[1] , 55 );
|
||||
memcpy( cd , zt , 55 );
|
||||
cd[27] = tmp11;
|
||||
cd[55] = tmp21;
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp11 = cd[0];
|
||||
tmp12 = cd[1];
|
||||
tmp21= cd[28];
|
||||
tmp22 = cd[29];
|
||||
|
||||
memcpy( zt , &cd[2] , 54 );
|
||||
memcpy( cd , zt , 54 );
|
||||
|
||||
cd[26] = tmp11;
|
||||
cd[27] = tmp12;
|
||||
cd[54] = tmp21;
|
||||
cd[55] = tmp22;
|
||||
}
|
||||
Knn = Kn[n];
|
||||
for (i = 0; i < 48; i++)
|
||||
{
|
||||
Knn[i] = cd[T9[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void fonction(unsigned char *Knn, unsigned char *r, unsigned char *s)
|
||||
{
|
||||
|
||||
unsigned char x[32];
|
||||
unsigned long *px;
|
||||
int i, l;
|
||||
unsigned char c;
|
||||
unsigned char t;
|
||||
|
||||
for (i = 0, l = 0, px = (unsigned long *) x; i < 8;)
|
||||
{
|
||||
c = 32 * (r[T3[l]] ^ Knn[l]);
|
||||
l++;
|
||||
c += 8 * (r[T3[l]] ^ Knn[l]);
|
||||
l++;
|
||||
c += 4 * (r[T3[l]] ^ Knn[l]);
|
||||
l++;
|
||||
c += 2 * (r[T3[l]] ^ Knn[l]);
|
||||
l++;
|
||||
c += 1 * (r[T3[l]] ^ Knn[l]);
|
||||
l++;
|
||||
c += 16 * (r[T3[l]] ^ Knn[l]);
|
||||
l++;
|
||||
t = T6[i][c];
|
||||
i++;
|
||||
*px = *(long *)TE[t];
|
||||
px++;
|
||||
}
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
s[i] = x[T5[i]];
|
||||
}
|
||||
}
|
||||
|
||||
void permutation(unsigned char *org, unsigned char *tab)
|
||||
{
|
||||
unsigned char tmp[64];
|
||||
int i;
|
||||
|
||||
|
||||
memcpy(tmp, org, 64);
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
org[i] = tmp[tab[i]];
|
||||
}
|
||||
}
|
||||
|
||||
void chiffrement(unsigned char *xi, unsigned char *xo, unsigned char Kn[16][48])
|
||||
{
|
||||
unsigned char r[32], l[32];
|
||||
unsigned char rp[32], lp[32];
|
||||
|
||||
int i;
|
||||
int n;
|
||||
|
||||
memcpy(l, &xi[0], 32);
|
||||
memcpy(r, &xi[32], 32);
|
||||
|
||||
for (n = 0; n < 16; n++)
|
||||
{
|
||||
memcpy(lp, r, 32);
|
||||
|
||||
fonction(Kn[n], r, rp);
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
r[i] =( ( l[i]) ^ (rp[i] ) ) ;
|
||||
}
|
||||
memcpy(l, lp, 32);
|
||||
}
|
||||
memcpy(&xo[0], r, 32);
|
||||
memcpy(&xo[32], l, 32);
|
||||
|
||||
}
|
||||
|
||||
void dechiffrement(unsigned char *xi, unsigned char *xo, unsigned char Kn[16][48])
|
||||
{
|
||||
unsigned char r[32], l[32], rp[32], lp[32];
|
||||
|
||||
int i;
|
||||
int n;
|
||||
|
||||
memcpy(l, &xi[0], 32);
|
||||
memcpy(r, &xi[32], 32);
|
||||
|
||||
for (n = 0; n < 16; n++)
|
||||
{
|
||||
memcpy(lp, r, 32);
|
||||
fonction(Kn[15 - n], r, rp);
|
||||
for (i = 0; i < 32; i++)
|
||||
{
|
||||
r[i] =( ( l[i] ) ^ ( rp[i] )) ;
|
||||
}
|
||||
memcpy(l, lp, 32);
|
||||
}
|
||||
|
||||
memcpy(&xo[0], r, 32);
|
||||
memcpy(&xo[32], l, 32);
|
||||
}
|
||||
|
||||
void eclater(const unsigned char *buf_bit, unsigned char *byte)
|
||||
{
|
||||
int i;
|
||||
unsigned char m;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
for (m = 0x80; m != 0; )
|
||||
{
|
||||
if ((buf_bit[i] & m) != 0)
|
||||
*byte = 1;
|
||||
else
|
||||
*byte = 0;
|
||||
byte++;
|
||||
m=m/2 ;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void compacter(unsigned char *byte, unsigned char *buf_bit)
|
||||
{
|
||||
int i;
|
||||
unsigned char m, n;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
n = 0;
|
||||
for (m = 0x80; m != 0; )
|
||||
{
|
||||
if (*byte++)
|
||||
n = n | m;
|
||||
m=m/2 ;
|
||||
|
||||
}
|
||||
buf_bit[i] = n;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void des(unsigned char *boutput, const unsigned char *binput, const unsigned char *bkey, int direction)
|
||||
{
|
||||
unsigned char input[64]; /* data input */
|
||||
unsigned char output[64]; /* data output */
|
||||
unsigned char Key[64];
|
||||
unsigned char Kn[16][48];
|
||||
|
||||
eclater(binput, input);
|
||||
eclater(bkey, Key);
|
||||
Ks(Key, Kn);
|
||||
permutation(input, T1);
|
||||
|
||||
if (direction) dechiffrement(input, output, Kn);
|
||||
else chiffrement(input, output, Kn);
|
||||
|
||||
permutation(output, T2);
|
||||
compacter(output, boutput);
|
||||
}
|
||||
|
||||
void atob (unsigned char *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;
|
||||
}
|
||||
}
|
||||
|
||||
void btoa (char *ascii_buf, const unsigned char *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 EncryptPIN (unsigned char cipher[], const char plain[], const char pan[], const unsigned char pin_key[])
|
||||
{
|
||||
char pin[20];
|
||||
unsigned char buf1[8], buf2[8];
|
||||
int i;
|
||||
|
||||
i = strlen(plain);
|
||||
buf1[0] = i;
|
||||
strcpy(pin, plain);
|
||||
for (; i<14; ++i) pin[i] = 'F';
|
||||
atob(buf1+1, pin, 14);
|
||||
buf2[0] = buf2[1] = 0x00;
|
||||
atob(buf2+2, pan+strlen(pan)-13, 12);
|
||||
for (i=0; i<8; ++i) buf1[i] ^= buf2[i];
|
||||
des(cipher, buf1, pin_key, 0);
|
||||
}
|
||||
|
||||
/* length of pan more than 13, and length of pin key more than 8 */
|
||||
void DecryptPIN (char plain[], const unsigned char cipher[], const char pan[], const unsigned char pin_key[])
|
||||
{
|
||||
unsigned char buf1[8], buf2[8];
|
||||
int i;
|
||||
|
||||
des(buf1, cipher, pin_key, 1);
|
||||
buf2[0] = buf2[1] = 0x00;
|
||||
atob(buf2+2, pan+strlen(pan)-13, 12);
|
||||
for (i=0; i<8; i++) buf1[i] ^= buf2[i];
|
||||
i = buf1[0];
|
||||
if (i <= 14) btoa(plain, buf1+1, i);
|
||||
else plain[0] = '\0';
|
||||
}
|
||||
|
||||
void CalcMAC (char mac[], const char data[], const unsigned char mac_key[])
|
||||
{
|
||||
int i;
|
||||
unsigned char m[8];
|
||||
|
||||
memset(m, 0, 8);
|
||||
for (i=0; data[i];)
|
||||
{
|
||||
m[i&7] ^= data[i];
|
||||
++i;
|
||||
if (!((i&7) && data[i])) des(m, m, mac_key, 0);
|
||||
}
|
||||
btoa(mac, m, 8);
|
||||
}
|
||||
|
||||
void CalcMAC1 (unsigned char mac[], const unsigned char data[], int len, const unsigned char mac_key[])
|
||||
{
|
||||
int i;
|
||||
|
||||
memset(mac, 0, 8);
|
||||
for (i=0; i<len; ++i) mac[i&7] ^= data[i];
|
||||
des(mac, mac, mac_key, 0);
|
||||
}
|
||||
|
||||
static unsigned char kkey[] =
|
||||
{0x35, 0x01, 0x27, 0x73, 0x11, 0x08, 0x43, 0x1F};
|
||||
|
||||
void EncryptKey (char cipher[], const unsigned char plain[])
|
||||
{
|
||||
unsigned char buf[8];
|
||||
|
||||
des(buf, plain, kkey, 0);
|
||||
btoa(cipher, buf, 16);
|
||||
}
|
||||
|
||||
void DecryptKey (unsigned char plain[], const char cipher[])
|
||||
{
|
||||
unsigned char buf[8];
|
||||
|
||||
atob(buf, cipher, 16);
|
||||
des(plain, buf, kkey, 1);
|
||||
}
|
||||
62
mss/pps/src/lib/daemon.c
Normal file
62
mss/pps/src/lib/daemon.c
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
** daemon.c
|
||||
** Functions of daemon process.
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#define MAXFD 4
|
||||
|
||||
int
|
||||
InitDaemon(void)
|
||||
{
|
||||
pid_t pid;
|
||||
|
||||
if ( (pid = fork()) < 0)
|
||||
return FAILURE;
|
||||
else if (pid != 0)
|
||||
exit(0); /* parent goes bye-bye */
|
||||
/* child continues */
|
||||
setsid(); /* become session leader */
|
||||
// chdir("/"); /* change working direactory */
|
||||
umask(0); /* clear our file mode creation mask */
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DaemonInit(const char *pname, int facility)
|
||||
{
|
||||
int i;
|
||||
pid_t pid;
|
||||
|
||||
if ( (pid = fork()) < 0) /* parent terminates */
|
||||
err_sys("%s: %s: fork (%d)",
|
||||
FILE_MACRO, FUNCTION_MACRO, LINE_MACRO);
|
||||
else if (pid != 0)
|
||||
{
|
||||
exit(0);
|
||||
} /* parent goes bye-bye */
|
||||
|
||||
/* 41st child continues */
|
||||
setsid(); /* become session leader */
|
||||
|
||||
signal(SIGHUP, SIG_IGN);
|
||||
|
||||
if ( (pid = fork()) < 0) /* 1st child terminates */
|
||||
err_sys("%s: %s: fork (%d)",
|
||||
FILE_MACRO, FUNCTION_MACRO, LINE_MACRO);
|
||||
else if (pid != 0)
|
||||
exit(0); /* 1st child goes bye-bye */
|
||||
|
||||
|
||||
// chdir("/"); /* change working directory */
|
||||
|
||||
umask(0); /* clear our file mode creation mask */
|
||||
|
||||
for (i = 0; i < MAXFD; i++)
|
||||
close(i);
|
||||
|
||||
}
|
||||
175
mss/pps/src/lib/debug.c
Normal file
175
mss/pps/src/lib/debug.c
Normal file
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
**
|
||||
** file name: logfunc.c
|
||||
**
|
||||
** The module performs log functions.
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
#include <stdarg.h> /* ANSI C header file */
|
||||
#include <syslog.h>
|
||||
|
||||
|
||||
static void DebugDoIt(int, void *ptr, const char *, va_list ap);
|
||||
|
||||
|
||||
/*
|
||||
** Nonfatal error related to a system call.
|
||||
** Print a message with the system's errno value and return.
|
||||
*/
|
||||
|
||||
void
|
||||
DebugRet(void *ptr, const char *fmt, ...)
|
||||
{
|
||||
va_list apa;
|
||||
|
||||
va_start(apa, fmt);
|
||||
DebugDoIt(1, ptr, fmt, apa);
|
||||
va_end(apa);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fatal error related to a system call.
|
||||
** Print a message and terminate.
|
||||
*/
|
||||
|
||||
void
|
||||
DebugSys(void *ptr, const char *fmt, ...)
|
||||
{
|
||||
va_list apa;
|
||||
|
||||
va_start(apa, fmt);
|
||||
DebugDoIt(1, ptr, fmt, apa);
|
||||
va_end(apa);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
/*
|
||||
** Nonfatal error unrelated to a system call.
|
||||
** Print a message and return.
|
||||
*/
|
||||
|
||||
void
|
||||
DebugMsg(void *ptr, const char *fmt, ...)
|
||||
{
|
||||
|
||||
//if(get_debug_log_flag() == 0)
|
||||
// return ;
|
||||
|
||||
va_list apa;
|
||||
va_start(apa, fmt);
|
||||
DebugDoIt(0, ptr, fmt, apa);
|
||||
va_end(apa);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fatal error unrelated to a system call.
|
||||
** Print a message and terminate.
|
||||
*/
|
||||
|
||||
void
|
||||
DebugQuit(void *ptr, const char *fmt, ...)
|
||||
{
|
||||
va_list apa;
|
||||
|
||||
va_start(apa, fmt);
|
||||
DebugDoIt(0, ptr, fmt, apa);
|
||||
va_end(apa);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
/*
|
||||
** Print a message and return to caller.
|
||||
** Caller specifies "errnoflag" and "priority".
|
||||
*/
|
||||
|
||||
static void
|
||||
DebugDoIt(int errnoflag, void *ptr, const char *fmt, va_list apa)
|
||||
{
|
||||
int errno_save;
|
||||
char buf[8192];
|
||||
int len, old_len;
|
||||
|
||||
errno_save = errno; /* value caller might want printed */
|
||||
vsprintf(buf, fmt, apa);
|
||||
|
||||
if (errnoflag)
|
||||
sprintf(buf+strlen(buf), ": %s", strerror(errno_save));
|
||||
|
||||
strcat(buf, "\r\n");
|
||||
len = strlen(buf);
|
||||
if(len >= 4096)
|
||||
return;
|
||||
|
||||
old_len = strlen(ptr);
|
||||
if((len+old_len) < 4096)
|
||||
strcat(ptr,buf);
|
||||
else
|
||||
strcpy(ptr,buf);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Write a message to loop queue. */
|
||||
BOOL
|
||||
WriteDebugMsg(void *dest, const void *src)
|
||||
{
|
||||
_debug_info *p;
|
||||
|
||||
p = (_debug_info *) dest;
|
||||
memcpy(&p->infoDebug[p->subWrite], src, DEBUG_LINE_LEN);
|
||||
p->subWrite ++;
|
||||
|
||||
/*
|
||||
** if write subscript more than max_num,
|
||||
** write subscript equal 0.
|
||||
*/
|
||||
if (p->subWrite == DEBUG_BUFFER_LINE)
|
||||
p->subWrite = 0;
|
||||
|
||||
/*
|
||||
** if message written successful,
|
||||
** Read subscript is same as Write subscript,
|
||||
** then Read subsrcipt add 1.
|
||||
*/
|
||||
if (p->subWrite == p->subRead) {
|
||||
(p->subRead == DEBUG_BUFFER_LINE-1) ?
|
||||
(p->subRead = 0) : (p->subRead ++);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/* Read a message from loop queue. */
|
||||
BOOL
|
||||
ReadDebugMsg(void *dest, const void *src)
|
||||
{
|
||||
_debug_info *p;
|
||||
|
||||
p = (_debug_info *) src;
|
||||
/*
|
||||
** these are some messages not to be read
|
||||
** while subscript of read isn't equal to subscipt of write.
|
||||
*/
|
||||
if (p->subRead == p->subWrite)
|
||||
return FAILURE;
|
||||
|
||||
memcpy(dest, &p->infoDebug[p->subRead], DEBUG_LINE_LEN);
|
||||
/*
|
||||
** increase READ SUBSCRIPT after got a message,
|
||||
** set READ SUBSCRIPT to 0 while it equal to max_num.
|
||||
*/
|
||||
p->subRead ++;
|
||||
if (p->subRead == DEBUG_BUFFER_LINE)
|
||||
{
|
||||
p->subRead = 0;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
113
mss/pps/src/lib/error.c
Normal file
113
mss/pps/src/lib/error.c
Normal file
@@ -0,0 +1,113 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h> /* for definition of errno */
|
||||
#include <stdarg.h> /* ANSI C header file */
|
||||
#include <string.h>
|
||||
#include "../include/public.h"
|
||||
#include "../include/errlog.h"
|
||||
|
||||
static void err_doit(int, const char *, va_list);
|
||||
|
||||
char *pname = NULL; /* caller can set this from argv[0] */
|
||||
|
||||
/*
|
||||
** Nonfatal error related to a system call.
|
||||
** Print a message and return.
|
||||
*/
|
||||
|
||||
void
|
||||
err_ret(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
err_doit(1, fmt, ap);
|
||||
va_end(ap);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fatal error related to a system call.
|
||||
** Print a message and terminate.
|
||||
*/
|
||||
|
||||
void
|
||||
err_sys(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
err_doit(1, fmt, ap);
|
||||
va_end(ap);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
** Fatal error related to a system call.
|
||||
** Print a message, dump core, and terminate.
|
||||
*/
|
||||
|
||||
void
|
||||
err_dump(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
err_doit(1, fmt, ap);
|
||||
va_end(ap);
|
||||
abort(); /* dump core and terminate */
|
||||
exit(1); /* shouldn't get here */
|
||||
}
|
||||
|
||||
/*
|
||||
** Nonfatal error unrelated to a system call.
|
||||
** Print a message and return.
|
||||
*/
|
||||
|
||||
void
|
||||
err_msg(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
err_doit(0, fmt, ap);
|
||||
va_end(ap);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fatal error unrelated to a system call.
|
||||
** Print a message and terminate.
|
||||
*/
|
||||
|
||||
void
|
||||
err_quit(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
err_doit(0, fmt, ap);
|
||||
va_end(ap);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/*
|
||||
** Print a message and return to caller.
|
||||
** Caller specifies "errnoflag".
|
||||
*/
|
||||
|
||||
static void
|
||||
err_doit(int errnoflag, const char *fmt, va_list ap)
|
||||
{
|
||||
int errno_save;
|
||||
char buf[4096];
|
||||
|
||||
errno_save = errno; /* value caller might want printed */
|
||||
vsprintf(buf, fmt, ap);
|
||||
if (errnoflag)
|
||||
sprintf(buf+strlen(buf), ": %s", strerror(errno_save));
|
||||
strcat(buf, "\n");
|
||||
fflush(stdout); /* in case stdout and stderr are the same */
|
||||
fputs(buf, stderr);
|
||||
fflush(NULL); /* flushes all stdio output streams */
|
||||
return;
|
||||
}
|
||||
128
mss/pps/src/lib/errorlog.c
Normal file
128
mss/pps/src/lib/errorlog.c
Normal file
@@ -0,0 +1,128 @@
|
||||
/* Error routines for programs that can run as a daemon. */
|
||||
|
||||
#include <errno.h> /* for definition of errno */
|
||||
#include <stdarg.h> /* ANSI C header file */
|
||||
#include <syslog.h>
|
||||
#include "../include/errlog.h"
|
||||
|
||||
static void log_doit(int, int, const char *, va_list ap);
|
||||
|
||||
int debug=1; /* caller must define and set this:
|
||||
nonzero if interactive, zero if daemon */
|
||||
int under_develop=1;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Initialize syslog(), if running as daemon. */
|
||||
void
|
||||
log_open(const char *ident, int option, int facility)
|
||||
{
|
||||
if (debug == 0)
|
||||
openlog(ident, option, facility);
|
||||
}
|
||||
|
||||
/*
|
||||
** Nonfatal error related to a system call.
|
||||
** Print a message with the system's errno value and return.
|
||||
*/
|
||||
|
||||
void
|
||||
log_ret(const char *fmt, ...)
|
||||
{
|
||||
va_list apa;
|
||||
|
||||
va_start(apa, fmt);
|
||||
log_doit(1, LOG_ERR, fmt, apa);
|
||||
va_end(apa);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fatal error related to a system call.
|
||||
** Print a message and terminate.
|
||||
*/
|
||||
|
||||
void
|
||||
log_sys(const char *fmt, ...)
|
||||
{
|
||||
va_list apa;
|
||||
|
||||
va_start(apa, fmt);
|
||||
log_doit(1, LOG_ERR, fmt, apa);
|
||||
va_end(apa);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
/*
|
||||
** Nonfatal error unrelated to a system call.
|
||||
** Print a message and return.
|
||||
*/
|
||||
|
||||
void
|
||||
log_msg(const char *fmt, ...)
|
||||
{
|
||||
va_list apa;
|
||||
|
||||
va_start(apa, fmt);
|
||||
log_doit(0, LOG_ERR, fmt, apa);
|
||||
va_end(apa);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Debug message unrelated to a system call.
|
||||
** Print a message and return while .
|
||||
*/
|
||||
|
||||
void
|
||||
log_debug(const char *fmt, ...)
|
||||
{
|
||||
va_list apa;
|
||||
|
||||
va_start(apa, fmt);
|
||||
log_doit(0, LOG_ERR, fmt, apa);
|
||||
va_end(apa);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fatal error unrelated to a system call.
|
||||
** Print a message and terminate.
|
||||
*/
|
||||
|
||||
void
|
||||
log_quit(const char *fmt, ...)
|
||||
{
|
||||
va_list apa;
|
||||
|
||||
va_start(apa, fmt);
|
||||
log_doit(0, LOG_ERR, fmt, apa);
|
||||
va_end(apa);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
/*
|
||||
** Print a message and return to caller.
|
||||
** Caller specifies "errnoflag" and "priority".
|
||||
*/
|
||||
|
||||
static void
|
||||
log_doit(int errnoflag, int priority, const char *fmt, va_list apa)
|
||||
{
|
||||
int errno_save;
|
||||
char buf[4096];
|
||||
|
||||
errno_save = errno; /* value caller might want printed */
|
||||
vsprintf(buf, fmt, apa);
|
||||
if (errnoflag)
|
||||
sprintf(buf+strlen(buf), ": %s", strerror(errno_save));
|
||||
strcat(buf, "\n");
|
||||
if (debug) {
|
||||
fflush(stdout);
|
||||
fputs(buf, stderr);
|
||||
fflush(stderr);
|
||||
} else
|
||||
syslog(priority, "%s", buf);
|
||||
return;
|
||||
}
|
||||
391
mss/pps/src/lib/function.c
Normal file
391
mss/pps/src/lib/function.c
Normal file
@@ -0,0 +1,391 @@
|
||||
/*
|
||||
**
|
||||
** function.c
|
||||
**
|
||||
** Functions for data conversion, tools.
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
|
||||
void
|
||||
SafeFree(void *pmem)
|
||||
{
|
||||
if (pmem != NULL)
|
||||
free(pmem);
|
||||
}
|
||||
|
||||
/*
|
||||
** Exchange between a and b
|
||||
*/
|
||||
void
|
||||
Exchange(long a, long b)
|
||||
{
|
||||
long c;
|
||||
|
||||
c = a;
|
||||
a = b;
|
||||
b = c;
|
||||
}
|
||||
|
||||
int
|
||||
ByteLength(BYTE *bcd, int c)
|
||||
{
|
||||
int length=0;
|
||||
|
||||
while (*bcd++ != c)
|
||||
{
|
||||
length ++;
|
||||
// if(length>64) break;
|
||||
}
|
||||
return length+1;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fill string 'c' into last area of 'str'.
|
||||
*/
|
||||
/*
|
||||
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[] = "";
|
||||
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';
|
||||
}
|
||||
*/
|
||||
char *
|
||||
FormatOutput(char *sp, size_t size, int len, int c)
|
||||
{
|
||||
char buf[1024];
|
||||
int i, j=0;
|
||||
|
||||
strcpy(buf, sp);
|
||||
for(i=0; i<size; i+=len) {
|
||||
strncpy(sp, buf+i, len);
|
||||
sp +=len;
|
||||
j +=len;
|
||||
if ( (j % 80)!=0 ) {
|
||||
*sp++ = c;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
*sp = 0;
|
||||
|
||||
return sp;
|
||||
}
|
||||
|
||||
/* Convert data from ASCII form to right-aligned compact BCD form. */
|
||||
|
||||
void ppsAsciiToBcdR (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%2==0)
|
||||
{
|
||||
*bcd_buf = ch & 0x0f; ;
|
||||
}
|
||||
else
|
||||
{
|
||||
*(bcd_buf) |= ((ch&0x0f) <<4 ) ;
|
||||
bcd_buf ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Convert data from right-aligned compact BCD form to ASCII form. */
|
||||
|
||||
void ppsBcdToAsciiR (char *ascii_buf, const BYTE *bcd_buf, int len)
|
||||
{
|
||||
int i;
|
||||
char ch;
|
||||
|
||||
for (i=0; i<len/2; i++) {
|
||||
ch = bcd_buf[i] & 0x0f;
|
||||
ascii_buf[i*2] = ch + ((ch > 9)? 'A'-10 : '0');
|
||||
ch = bcd_buf[i]>> 4;
|
||||
ascii_buf[i*2+1] = ch + ((ch > 9)? 'A'-10 : '0');
|
||||
}
|
||||
ascii_buf[len] = '\0';
|
||||
}
|
||||
|
||||
int AsciiToMsisdn(char *charin, u_char *msgout, int len)
|
||||
{
|
||||
u_char tmpbuf[64];
|
||||
char msgin[64];
|
||||
int msglen;
|
||||
if(len>18) return 0;
|
||||
memcpy(msgin,charin,len);
|
||||
msglen = len;
|
||||
if(len%2!=0){
|
||||
msgin[len] = 'f';
|
||||
msgin[len+1] = 0x00;
|
||||
msglen = len+1;
|
||||
}
|
||||
ppsAsciiToBcdR(tmpbuf,msgin,msglen);
|
||||
msgout[0] = msglen/2;
|
||||
msgout[1] = 0x91;
|
||||
if(tmpbuf[0] !=0x19 && tmpbuf[0] != 0x18)
|
||||
{
|
||||
msgout[0] ++;
|
||||
memcpy(msgout+2,tmpbuf,msglen/2);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(msgout+2,tmpbuf+1,msglen/2);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void GetVersionID(char *cversion, BYTE *version)
|
||||
{
|
||||
int i,start,len,index;
|
||||
char buf[3][32]={"","",""};
|
||||
|
||||
start = 0,index = 0;
|
||||
len = strlen(cversion);
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
if(cversion[i] !='.')
|
||||
buf[index][start++] = cversion[i];
|
||||
else
|
||||
{
|
||||
index++;
|
||||
start = 0;
|
||||
}
|
||||
}
|
||||
version[0] = atoi(buf[0]);
|
||||
version[1] = atoi(buf[1]);
|
||||
version[2] = atoi(buf[2]);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
StringCutString(char *strbase, char *strcut)
|
||||
{
|
||||
char *start=NULL;
|
||||
int end;
|
||||
start = strstr(strbase,strcut);
|
||||
if(start)
|
||||
{
|
||||
end = start - strbase;
|
||||
strbase[end] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void string2ltime(time_t *nowtime,char *timestr)
|
||||
{
|
||||
struct tm mytime;
|
||||
char tmp[5];
|
||||
if(timestr==NULL||nowtime==NULL)
|
||||
return;
|
||||
strncpy(tmp,timestr,4);
|
||||
tmp[4]='\0';
|
||||
mytime.tm_year=atoi(tmp)-1900;
|
||||
strncpy(tmp,timestr+4,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_mon =atoi(tmp)-1;
|
||||
strncpy(tmp,timestr+6,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_mday=atoi(tmp);
|
||||
strncpy(tmp,timestr+8,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_hour =atoi(tmp);
|
||||
strncpy(tmp,timestr+10,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_min =atoi(tmp);
|
||||
strncpy(tmp,timestr+12,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_sec =atoi(tmp);
|
||||
|
||||
*nowtime=mktime(&mytime);
|
||||
}
|
||||
|
||||
unsigned int HstrToInt(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;
|
||||
}
|
||||
111
mss/pps/src/lib/iofunc.c
Normal file
111
mss/pps/src/lib/iofunc.c
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
**
|
||||
** The module performs I/O functions.
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
#include <stdarg.h> /* ANSI C header file */
|
||||
#include <syslog.h>
|
||||
#include "../include/iofunc.h"
|
||||
|
||||
/*
|
||||
void
|
||||
InitParport(char *prog_name, u_short partport_range)
|
||||
{
|
||||
if (iopl(3) ) {
|
||||
log_sys("%s: %s", prog_name, FUNCTION_MACRO);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void
|
||||
InitParport(char *prog_name, u_short parport_range)
|
||||
{
|
||||
if (ioperm(parport_range, 3, 1) ) {
|
||||
log_sys("%s: %s: ioperm", prog_name, FUNCTION_MACRO);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SetParport(u_short parport_range, u_char flag)
|
||||
{
|
||||
outb(flag, parport_range);
|
||||
}
|
||||
|
||||
void
|
||||
SetParportOn(char ledbit,u_short parport_range)
|
||||
{
|
||||
BYTE inbyte,outbyte;
|
||||
BYTE ledstatus = 0x01;
|
||||
ledstatus >>= ledbit;
|
||||
inbyte = inb(parport_range);
|
||||
outbyte = inbyte | ledstatus;
|
||||
outb(outbyte, parport_range);
|
||||
}
|
||||
|
||||
void
|
||||
SetParportOff(char ledbit, u_short parport_range)
|
||||
{
|
||||
BYTE inbyte,outbyte;
|
||||
inbyte = inb(parport_range);
|
||||
outbyte = inbyte & 0xbf;
|
||||
outb(outbyte, parport_range);
|
||||
}
|
||||
|
||||
void
|
||||
SetNonblock(int id)
|
||||
{
|
||||
fcntl(id, F_SETFL, O_NONBLOCK);
|
||||
}
|
||||
|
||||
|
||||
/* +++++++++++++++++++++++++++++ */
|
||||
/* Write parallel port data */
|
||||
/* +++++++++++++++++++++++++++++ */
|
||||
void SetParalPort(BYTE flag,BYTE data)
|
||||
{ // Parallel port address: flag=0,address=0x37a B1;flag=1,address=0x37a B2
|
||||
// flag=2--9,address=0x378 B0--B7
|
||||
BYTE ii,jj;
|
||||
|
||||
if (flag > 9)
|
||||
return;
|
||||
if (data != 0 && data != 1)
|
||||
return;
|
||||
if (flag == 0 || flag == 1) // read or write 0x37a
|
||||
{
|
||||
ii = inb(0x37a);
|
||||
/*
|
||||
jj = 1 << (flag + 1);
|
||||
ii = ii & (~jj);
|
||||
if (flag == 0)
|
||||
jj = (~data & 0x01) << (flag + 1);
|
||||
else
|
||||
jj = data << (flag + 1);
|
||||
*/
|
||||
jj = 1<<flag;
|
||||
ii = ii & (~jj);
|
||||
jj = data<<flag;
|
||||
ii = ii | jj;
|
||||
outb(ii,0x37a);
|
||||
}
|
||||
else
|
||||
{
|
||||
ii = inb(0x378);
|
||||
jj = 1 << (flag - 2);
|
||||
ii = ii & (~jj);
|
||||
jj = data << (flag - 2);
|
||||
ii = ii | jj;
|
||||
outb(ii,0x378);
|
||||
/*
|
||||
ii = inb(0x378);
|
||||
jj = 1<<(flag-2);
|
||||
if(data){
|
||||
ii = ii | jj;
|
||||
}else{
|
||||
ii = ii & (~jj);
|
||||
}
|
||||
outb(ii,0x378);
|
||||
*/
|
||||
}
|
||||
}
|
||||
81
mss/pps/src/lib/ipcfunc.c
Normal file
81
mss/pps/src/lib/ipcfunc.c
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
**
|
||||
** ipcfunc.c
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
|
||||
void *
|
||||
ShmInit(int shm_id, char *prog_name, key_t key, int size, int shmflg)
|
||||
{
|
||||
void *retp;
|
||||
char *func_name = "ShmInit";
|
||||
|
||||
shm_id = shmget(key, size, shmflg);
|
||||
if (shm_id == -1)
|
||||
log_sys("%s: %s: shmget(key: %x)", prog_name, func_name, key);
|
||||
|
||||
retp = shmat(shm_id, (char *)0, 0);
|
||||
if (retp == (void *) -1)
|
||||
log_sys("%s: %s: shmat", prog_name, func_name);
|
||||
|
||||
return retp;
|
||||
}
|
||||
|
||||
int
|
||||
SemInit(char *prog_name, key_t key, int sem_num, int sem_flg)
|
||||
{
|
||||
int initarray[sem_num];
|
||||
int sem_id, retval, i;
|
||||
char *func_name = "SemInit";
|
||||
|
||||
sem_id = semget(key, sem_num, sem_flg);
|
||||
if (sem_id == -1)
|
||||
log_sys("%s: %s: semget", prog_name, func_name);
|
||||
for (i=0; i<sem_num; i++) {
|
||||
initarray[i] = 1;
|
||||
retval = semctl(sem_id, i, SETVAL, initarray[i]);
|
||||
if (retval == -1)
|
||||
log_sys("%s: %s: semctl", prog_name, func_name);
|
||||
}
|
||||
|
||||
return sem_id;
|
||||
}
|
||||
|
||||
BOOL
|
||||
SemLock(char *prog_name, 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) {
|
||||
// char *func_name = "SemLock";
|
||||
// log_ret("%s: %s: semop(%d)", prog_name, func_name, sem_num);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL
|
||||
SemUnlock(char *prog_name, int sem_id, int sem_num, unsigned nsops, int sem_flg)
|
||||
{
|
||||
int retval;
|
||||
struct sembuf unlock = {0, 1, IPC_NOWAIT|SEM_UNDO};
|
||||
|
||||
unlock.sem_num = sem_num;
|
||||
unlock.sem_flg |= sem_flg;
|
||||
retval = semop(sem_id, &unlock, nsops);
|
||||
if (retval == -1) {
|
||||
// char *func_name = "SemUnlock";
|
||||
// log_ret("%s: %s: semop(%d)", prog_name, func_name, sem_num);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
196
mss/pps/src/lib/logfunc.c
Normal file
196
mss/pps/src/lib/logfunc.c
Normal file
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
#include <stdarg.h> /* ANSI C header file */
|
||||
#include <syslog.h>
|
||||
|
||||
static void LogDoIt(int, void *fp, int, const char *, va_list ap);
|
||||
|
||||
int debug; /* caller must define and set this:
|
||||
nonzero if interactive, zero if daemon */
|
||||
|
||||
|
||||
|
||||
|
||||
/* Initialize syslog(), if running as daemon. */
|
||||
void *
|
||||
OpenLog (const char *prog_name, const char *ident,
|
||||
int option, int facility)
|
||||
{
|
||||
char *logpath=NULL, filename[100];
|
||||
void *fp = NULL;
|
||||
|
||||
switch(debug) {
|
||||
case D_CONSOLE_ONLY:
|
||||
fp = stderr;
|
||||
break;
|
||||
case D_LOG_ONLY:
|
||||
case D_CONSOLE_LOG:
|
||||
if ((logpath = (char *)getenv("LOG_FILE_PATH")) == NULL) {
|
||||
log_ret("%s: %s: getenv", prog_name, FUNCTION_MACRO);
|
||||
fp = stderr;
|
||||
break;
|
||||
}
|
||||
sprintf(filename, "%s/%s.log", logpath, prog_name);
|
||||
if ((fp = fopen(filename, "w")) == NULL) {
|
||||
log_sys("%s: %s: fopen", prog_name, FUNCTION_MACRO);
|
||||
fp = stderr;
|
||||
}
|
||||
break;
|
||||
case D_SYSLOG_MODE:
|
||||
openlog(ident, option, facility);
|
||||
break;
|
||||
case D_NO_DEBUG:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return fp;
|
||||
}
|
||||
|
||||
/*
|
||||
** Nonfatal error related to a system call.
|
||||
** Print a message with the system's errno value and return.
|
||||
*/
|
||||
|
||||
void
|
||||
LogRet(void *fp, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int priority = LOG_ERR;
|
||||
|
||||
va_start(ap, fmt);
|
||||
LogDoIt(1, fp, priority, fmt, ap);
|
||||
va_end(ap);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fatal error related to a system call.
|
||||
** Print a message and terminate.
|
||||
*/
|
||||
|
||||
void
|
||||
LogSys(void *fp, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int priority = LOG_ERR;
|
||||
|
||||
va_start(ap, fmt);
|
||||
LogDoIt(1, fp, priority, fmt, ap);
|
||||
va_end(ap);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
/*
|
||||
** Nonfatal error unrelated to a system call.
|
||||
** Print a message and return.
|
||||
*/
|
||||
|
||||
void
|
||||
LogMsg(void *fp, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int priority = LOG_ERR;
|
||||
|
||||
if (fp == NULL) return;
|
||||
va_start(ap, fmt);
|
||||
LogDoIt(0, fp, priority, fmt, ap);
|
||||
va_end(ap);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fatal error unrelated to a system call.
|
||||
** Print a message and terminate.
|
||||
*/
|
||||
|
||||
void
|
||||
LogQuit(void *fp, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int priority = LOG_ERR;
|
||||
|
||||
va_start(ap, fmt);
|
||||
LogDoIt(0, fp, priority, fmt, ap);
|
||||
va_end(ap);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
/*
|
||||
** Print a message and return to caller.
|
||||
** Caller specifies "errnoflag" and "priority".
|
||||
*/
|
||||
|
||||
static void
|
||||
LogDoIt(int errnoflag, void *fp, int priority,
|
||||
const char *fmt, va_list ap)
|
||||
{
|
||||
int errno_save;
|
||||
char buf[4096];
|
||||
|
||||
errno_save = errno; /* value caller might want printed */
|
||||
vsprintf(buf, fmt, ap);
|
||||
if (errnoflag)
|
||||
sprintf(buf+strlen(buf), ": %s", strerror(errno_save));
|
||||
strcat(buf, "\n");
|
||||
switch (debug) {
|
||||
case D_CONSOLE_ONLY:
|
||||
fflush(stdout);
|
||||
fputs(buf, stderr);
|
||||
fflush(stderr);
|
||||
break;
|
||||
case D_CONSOLE_LOG:
|
||||
fflush(stdout);
|
||||
fputs(buf, stderr);
|
||||
fflush(stderr);
|
||||
if (fp != stderr) {
|
||||
fputs(buf, fp);
|
||||
fflush(fp);
|
||||
}
|
||||
break;
|
||||
case D_LOG_ONLY:
|
||||
fflush(stdout);
|
||||
fputs(buf, fp);
|
||||
fflush(fp);
|
||||
break;
|
||||
case D_SYSLOG_MODE:
|
||||
syslog(priority, "%s", buf); break;
|
||||
case D_NO_DEBUG:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
GetErrnoMsg(char *sp, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int errno_save;
|
||||
char buf[4096*2];
|
||||
|
||||
errno_save = errno; /* value caller might want printed */
|
||||
va_start(ap, fmt);
|
||||
vsprintf(buf, fmt, ap);
|
||||
va_end(ap);
|
||||
sprintf(buf+strlen(buf), ": %s", strerror(errno_save));
|
||||
strcpy(sp, buf);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
** Close log file point.
|
||||
** Return 0 on success, -1 on failure.
|
||||
*/
|
||||
void
|
||||
CloseLog (void *fp)
|
||||
{
|
||||
fclose(fp);
|
||||
fp = stdout;
|
||||
}
|
||||
|
||||
372
mss/pps/src/lib/ppsfun.c
Normal file
372
mss/pps/src/lib/ppsfun.c
Normal file
@@ -0,0 +1,372 @@
|
||||
/*
|
||||
**
|
||||
** function.c
|
||||
**
|
||||
** Functions for data conversion, tools.
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
|
||||
void
|
||||
SafeFree(void *pmem)
|
||||
{
|
||||
if (pmem != NULL)
|
||||
free(pmem);
|
||||
}
|
||||
|
||||
/*
|
||||
** Exchange between a and b
|
||||
*/
|
||||
void
|
||||
Exchange(long a, long b)
|
||||
{
|
||||
long c;
|
||||
|
||||
c = a;
|
||||
a = b;
|
||||
b = c;
|
||||
}
|
||||
|
||||
int
|
||||
ByteLength(BYTE *bcd, int c)
|
||||
{
|
||||
int length=0;
|
||||
|
||||
while (*bcd++ != c)
|
||||
{
|
||||
length ++;
|
||||
// if(length>64) break;
|
||||
}
|
||||
return length+1;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fill string 'c' into last area of 'str'.
|
||||
*/
|
||||
/*
|
||||
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[] = "";
|
||||
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);
|
||||
}
|
||||
*/
|
||||
/*
|
||||
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';
|
||||
}
|
||||
*/
|
||||
char *
|
||||
FormatOutput(char *sp, size_t size, int len, int c)
|
||||
{
|
||||
char buf[1024];
|
||||
int i, j=0;
|
||||
|
||||
strcpy(buf, sp);
|
||||
for(i=0; i<size; i+=len) {
|
||||
strncpy(sp, buf+i, len);
|
||||
sp +=len;
|
||||
j +=len;
|
||||
if ( (j % 80)!=0 ) {
|
||||
*sp++ = c;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
*sp = 0;
|
||||
|
||||
return sp;
|
||||
}
|
||||
|
||||
/* Convert data from ASCII form to right-aligned compact BCD form. */
|
||||
|
||||
void ppsAsciiToBcdR (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%2==0)
|
||||
{
|
||||
*bcd_buf = ch & 0x0f; ;
|
||||
}
|
||||
else
|
||||
{
|
||||
*(bcd_buf) |= ((ch&0x0f) <<4 ) ;
|
||||
bcd_buf ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Convert data from right-aligned compact BCD form to ASCII form. */
|
||||
|
||||
void ppsBcdToAsciiR (char *ascii_buf, const BYTE *bcd_buf, int len)
|
||||
{
|
||||
int i;
|
||||
char ch;
|
||||
|
||||
for (i=0; i<len/2; i++) {
|
||||
ch = bcd_buf[i] & 0x0f;
|
||||
ascii_buf[i*2] = ch + ((ch > 9)? 'A'-10 : '0');
|
||||
ch = bcd_buf[i]>> 4;
|
||||
ascii_buf[i*2+1] = ch + ((ch > 9)? 'A'-10 : '0');
|
||||
}
|
||||
ascii_buf[len] = '\0';
|
||||
}
|
||||
|
||||
int AsciiToMsisdn(char *charin, u_char *msgout, int len)
|
||||
{
|
||||
u_char tmpbuf[64];
|
||||
char msgin[64];
|
||||
int msglen;
|
||||
if(len>18) return 0;
|
||||
memcpy(msgin,charin,len);
|
||||
msglen = len;
|
||||
if(len%2!=0){
|
||||
msgin[len] = 'f';
|
||||
msgin[len+1] = 0x00;
|
||||
msglen = len+1;
|
||||
}
|
||||
ppsAsciiToBcdR(tmpbuf,msgin,msglen);
|
||||
msgout[0] = msglen/2;
|
||||
msgout[1] = 0x91;
|
||||
if(tmpbuf[0] !=0x19 && tmpbuf[0] != 0x18)
|
||||
{
|
||||
msgout[0] ++;
|
||||
memcpy(msgout+2,tmpbuf,msglen/2);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(msgout+2,tmpbuf+1,msglen/2);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void GetVersionID(char *cversion, BYTE *version)
|
||||
{
|
||||
int i,start,len,index;
|
||||
char buf[3][32]={"","",""};
|
||||
|
||||
start = 0,index = 0;
|
||||
len = strlen(cversion);
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
if(cversion[i] !='.')
|
||||
buf[index][start++] = cversion[i];
|
||||
else
|
||||
{
|
||||
index++;
|
||||
start = 0;
|
||||
}
|
||||
}
|
||||
version[0] = atoi(buf[0]);
|
||||
version[1] = atoi(buf[1]);
|
||||
version[2] = atoi(buf[2]);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
StringCutString(char *strbase, char *strcut)
|
||||
{
|
||||
char *start=NULL;
|
||||
int end;
|
||||
start = strstr(strbase,strcut);
|
||||
if(start)
|
||||
{
|
||||
end = start - strbase;
|
||||
strbase[end] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void string2ltime(time_t *nowtime,char *timestr)
|
||||
{
|
||||
struct tm mytime;
|
||||
char tmp[5];
|
||||
if(timestr==NULL||nowtime==NULL)
|
||||
return;
|
||||
strncpy(tmp,timestr,4);
|
||||
tmp[4]='\0';
|
||||
mytime.tm_year=atoi(tmp)-1900;
|
||||
strncpy(tmp,timestr+4,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_mon =atoi(tmp)-1;
|
||||
strncpy(tmp,timestr+6,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_mday=atoi(tmp);
|
||||
strncpy(tmp,timestr+8,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_hour =atoi(tmp);
|
||||
strncpy(tmp,timestr+10,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_min =atoi(tmp);
|
||||
strncpy(tmp,timestr+12,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_sec =atoi(tmp);
|
||||
|
||||
*nowtime=mktime(&mytime);
|
||||
}
|
||||
|
||||
unsigned int HstrToInt(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;
|
||||
}
|
||||
372
mss/pps/src/lib/ppsfunc.c
Normal file
372
mss/pps/src/lib/ppsfunc.c
Normal file
@@ -0,0 +1,372 @@
|
||||
/*
|
||||
**
|
||||
** function.c
|
||||
**
|
||||
** Functions for data conversion, tools.
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
|
||||
void
|
||||
SafeFree(void *pmem)
|
||||
{
|
||||
if (pmem != NULL)
|
||||
free(pmem);
|
||||
}
|
||||
|
||||
/*
|
||||
** Exchange between a and b
|
||||
*/
|
||||
void
|
||||
Exchange(long a, long b)
|
||||
{
|
||||
long c;
|
||||
|
||||
c = a;
|
||||
a = b;
|
||||
b = c;
|
||||
}
|
||||
|
||||
int
|
||||
ByteLength(BYTE *bcd, int c)
|
||||
{
|
||||
int length=0;
|
||||
|
||||
while (*bcd++ != c)
|
||||
{
|
||||
length ++;
|
||||
// if(length>64) break;
|
||||
}
|
||||
return length+1;
|
||||
}
|
||||
|
||||
/*
|
||||
** Fill string 'c' into last area of 'str'.
|
||||
*/
|
||||
/*
|
||||
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[] = "";
|
||||
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);
|
||||
}
|
||||
*/
|
||||
/*
|
||||
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';
|
||||
}
|
||||
*/
|
||||
char *
|
||||
FormatOutput(char *sp, size_t size, int len, int c)
|
||||
{
|
||||
char buf[BUFSIZE];
|
||||
int i, j=0;
|
||||
|
||||
strcpy(buf, sp);
|
||||
for(i=0; i<size; i+=len) {
|
||||
strncpy(sp, buf+i, len);
|
||||
sp +=len;
|
||||
j +=len;
|
||||
if ( (j % 80)!=0 ) {
|
||||
*sp++ = c;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
*sp = 0;
|
||||
|
||||
return sp;
|
||||
}
|
||||
|
||||
/* Convert data from ASCII form to right-aligned compact BCD form. */
|
||||
|
||||
void ppsAsciiToBcdR (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%2==0)
|
||||
{
|
||||
*bcd_buf = ch & 0x0f; ;
|
||||
}
|
||||
else
|
||||
{
|
||||
*(bcd_buf) |= ((ch&0x0f) <<4 ) ;
|
||||
bcd_buf ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Convert data from right-aligned compact BCD form to ASCII form. */
|
||||
|
||||
void ppsBcdToAsciiR (char *ascii_buf, const BYTE *bcd_buf, int len)
|
||||
{
|
||||
int i;
|
||||
char ch;
|
||||
|
||||
for (i=0; i<len/2; i++) {
|
||||
ch = bcd_buf[i] & 0x0f;
|
||||
ascii_buf[i*2] = ch + ((ch > 9)? 'A'-10 : '0');
|
||||
ch = bcd_buf[i]>> 4;
|
||||
ascii_buf[i*2+1] = ch + ((ch > 9)? 'A'-10 : '0');
|
||||
}
|
||||
ascii_buf[len] = '\0';
|
||||
}
|
||||
|
||||
int AsciiToMsisdn(char *charin, u_char *msgout, int len)
|
||||
{
|
||||
u_char tmpbuf[64];
|
||||
char msgin[64];
|
||||
int msglen;
|
||||
if(len>18) return 0;
|
||||
memcpy(msgin,charin,len);
|
||||
msglen = len;
|
||||
if(len%2!=0){
|
||||
msgin[len] = 'f';
|
||||
msgin[len+1] = 0x00;
|
||||
msglen = len+1;
|
||||
}
|
||||
ppsAsciiToBcdR(tmpbuf,msgin,msglen);
|
||||
msgout[0] = msglen/2;
|
||||
msgout[1] = 0x91;
|
||||
if(tmpbuf[0] !=0x19 && tmpbuf[0] != 0x18)
|
||||
{
|
||||
msgout[0] ++;
|
||||
memcpy(msgout+2,tmpbuf,msglen/2);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(msgout+2,tmpbuf+1,msglen/2);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void GetVersionID(char *cversion, BYTE *version)
|
||||
{
|
||||
int i,start,len,index;
|
||||
char buf[3][32]={"","",""};
|
||||
|
||||
start = 0,index = 0;
|
||||
len = strlen(cversion);
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
if(cversion[i] !='.')
|
||||
buf[index][start++] = cversion[i];
|
||||
else
|
||||
{
|
||||
index++;
|
||||
start = 0;
|
||||
}
|
||||
}
|
||||
version[0] = atoi(buf[0]);
|
||||
version[1] = atoi(buf[1]);
|
||||
version[2] = atoi(buf[2]);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
StringCutString(char *strbase, char *strcut)
|
||||
{
|
||||
char *start=NULL;
|
||||
int end;
|
||||
start = strstr(strbase,strcut);
|
||||
if(start)
|
||||
{
|
||||
end = start - strbase;
|
||||
strbase[end] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void string2ltime(time_t *nowtime,char *timestr)
|
||||
{
|
||||
struct tm mytime;
|
||||
char tmp[5];
|
||||
if(timestr==NULL||nowtime==NULL)
|
||||
return;
|
||||
strncpy(tmp,timestr,4);
|
||||
tmp[4]='\0';
|
||||
mytime.tm_year=atoi(tmp)-1900;
|
||||
strncpy(tmp,timestr+4,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_mon =atoi(tmp)-1;
|
||||
strncpy(tmp,timestr+6,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_mday=atoi(tmp);
|
||||
strncpy(tmp,timestr+8,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_hour =atoi(tmp);
|
||||
strncpy(tmp,timestr+10,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_min =atoi(tmp);
|
||||
strncpy(tmp,timestr+12,2);
|
||||
tmp[2]='\0';
|
||||
mytime.tm_sec =atoi(tmp);
|
||||
|
||||
*nowtime=mktime(&mytime);
|
||||
}
|
||||
|
||||
unsigned int HstrToInt(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;
|
||||
}
|
||||
53
mss/pps/src/lib/queuefunc.c
Normal file
53
mss/pps/src/lib/queuefunc.c
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
|
||||
u_char *
|
||||
ByteRev(u_char *ptr, size_t size,int flag)
|
||||
{
|
||||
int len = size;
|
||||
/*
|
||||
if(flag)
|
||||
{ //internation msisdn,as: 8675557127049
|
||||
*ptr++;
|
||||
len --;
|
||||
}
|
||||
*/
|
||||
while (len--) {
|
||||
*ptr = (*ptr >> 4) | (*ptr << 4);
|
||||
ptr ++;
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void
|
||||
Strrev(char *sp)
|
||||
{
|
||||
char ch;
|
||||
ch = sp[0];
|
||||
sp[0] = sp[1];
|
||||
sp[1] = ch;
|
||||
}
|
||||
|
||||
void
|
||||
ByteReverse(BYTE *pbuf, BYTE *p, size_t size)
|
||||
{
|
||||
|
||||
int i;
|
||||
char *sp=NULL, tmpbuf[3];
|
||||
|
||||
sp = (char *) malloc(4*size + 1);
|
||||
bzero(p, size);
|
||||
|
||||
for (i=0; i<2*size; i+=2) {
|
||||
sprintf(tmpbuf, "%02x", *(pbuf++));
|
||||
tmpbuf[2]=0;
|
||||
Strrev(tmpbuf);
|
||||
strncpy(sp+i, tmpbuf, 2);
|
||||
}
|
||||
AsciiToBcd(pbuf, sp, 4*size);
|
||||
memcpy(p, pbuf, 2*size);
|
||||
free(sp);
|
||||
}
|
||||
44
mss/pps/src/lib/signal.c
Normal file
44
mss/pps/src/lib/signal.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
**
|
||||
** Signal functions
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
|
||||
/*
|
||||
** Set termination signal in a loop program,
|
||||
** handler of function mostly deal with something,
|
||||
** e.g. closing file handler, socket handler or free allocatied memory.
|
||||
*/
|
||||
void
|
||||
SetTermSignal(struct termio *ptermio, void (*handler)(int))
|
||||
{
|
||||
ioctl(0, TCGETA, ptermio);
|
||||
ptermio->c_cc[VINTR] = '\x03';
|
||||
ioctl(0, TCSETA, ptermio);
|
||||
|
||||
signal(SIGINT, handler);
|
||||
signal(SIGTERM, handler);
|
||||
signal(SIGSTOP, handler);
|
||||
signal(SIGKILL, handler);
|
||||
signal(SIGQUIT, handler);
|
||||
signal(SIGABRT, handler);
|
||||
signal(SIGHUP, handler);
|
||||
}
|
||||
|
||||
void
|
||||
SetFaultSignal(void (*handler)(int) )
|
||||
{
|
||||
signal(SIGSEGV, handler);
|
||||
}
|
||||
|
||||
void
|
||||
SetRefreshSignal(struct termio *ptermio, void (*handler)(int))
|
||||
{
|
||||
ioctl(0, TCGETA, ptermio);
|
||||
ptermio->c_cc[VQUIT] = '\x12'; /* QUIT: Ctrl+R */
|
||||
ioctl(0, TCSETA, ptermio);
|
||||
|
||||
signal(SIGQUIT, handler);
|
||||
}
|
||||
377
mss/pps/src/lib/time.c
Normal file
377
mss/pps/src/lib/time.c
Normal file
@@ -0,0 +1,377 @@
|
||||
/*
|
||||
**
|
||||
** file name: tim.c
|
||||
**
|
||||
** time functions
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
|
||||
|
||||
char * GetASCTime(char *timep)
|
||||
{
|
||||
struct tm *tp, tb;
|
||||
long ltime;
|
||||
|
||||
tp = &tb;
|
||||
ltime = time((long *)0);
|
||||
tp = localtime(<ime);
|
||||
timep = asctime(tp);
|
||||
timep[24] = 0;
|
||||
return timep;
|
||||
}
|
||||
|
||||
char * CharTime(char *ptr, const time_t *timep)
|
||||
{
|
||||
strncpy(ptr, ctime(timep), 24);
|
||||
ptr[24] = 0;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/* Get current hour */
|
||||
/*
|
||||
int gethour(char * hour_buf)
|
||||
{
|
||||
struct tm *t, tt;
|
||||
long curr_time;
|
||||
|
||||
t=&tt;
|
||||
curr_time=time((long *)0);
|
||||
t=localtime(&curr_time);
|
||||
sprintf(hour_buf, "%d", t -> tm_hour);
|
||||
hour_buf[2]=0;
|
||||
return t -> tm_hour;
|
||||
}
|
||||
*/
|
||||
u_short
|
||||
GetHour(time_t t)
|
||||
{
|
||||
struct tm tmb;
|
||||
|
||||
memcpy(&tmb, localtime(&t), sizeof(struct tm));
|
||||
return tmb.tm_hour;
|
||||
}
|
||||
|
||||
u_short
|
||||
GetTmHour()
|
||||
{
|
||||
struct tm tmb;
|
||||
time_t curr_time;
|
||||
|
||||
curr_time = time(NULL);
|
||||
memcpy(&tmb, localtime(&curr_time), sizeof(struct tm));
|
||||
return tmb.tm_hour;
|
||||
}
|
||||
|
||||
/* Get current hour */
|
||||
/*
|
||||
int getmin(char * min_buf)
|
||||
{
|
||||
struct tm *t, tt;
|
||||
long curr_time;
|
||||
|
||||
t=&tt;
|
||||
curr_time=time((long *)0);
|
||||
t=localtime(&curr_time);
|
||||
sprintf(min_buf, "%d", t -> tm_min);
|
||||
min_buf[2]=0;
|
||||
return t -> tm_min;
|
||||
}
|
||||
*/
|
||||
u_short
|
||||
GetMinute(time_t t)
|
||||
{
|
||||
struct tm tmb;
|
||||
memcpy(&tmb, localtime(&t), sizeof(struct tm));
|
||||
return tmb.tm_min;
|
||||
}
|
||||
|
||||
u_short
|
||||
GetTmMinute()
|
||||
{
|
||||
struct tm tmb;
|
||||
time_t curr_time;
|
||||
|
||||
curr_time = time(NULL);
|
||||
memcpy(&tmb, localtime(&curr_time), sizeof(struct tm));
|
||||
return tmb.tm_min;
|
||||
}
|
||||
|
||||
/* Get current time */
|
||||
/*
|
||||
int getsec(char * sec_buf)
|
||||
{
|
||||
struct tm *t, tt;
|
||||
long curr_time;
|
||||
|
||||
t=&tt;
|
||||
curr_time=time((long *)0);
|
||||
t=localtime(&curr_time);
|
||||
sprintf(sec_buf, "%d", t -> tm_sec);
|
||||
sec_buf[2]=0;
|
||||
return t -> tm_sec;
|
||||
}
|
||||
*/
|
||||
u_short
|
||||
GetTmSecond()
|
||||
{
|
||||
struct tm tmb;
|
||||
time_t curr_time;
|
||||
|
||||
curr_time = time(NULL);
|
||||
memcpy(&tmb, localtime(&curr_time), sizeof(struct tm));
|
||||
return tmb.tm_sec;
|
||||
}
|
||||
|
||||
/* Get current time */
|
||||
/*
|
||||
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 * ppsgetdaytime(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;
|
||||
}
|
||||
|
||||
const int getnowtime(int *time_buf)
|
||||
{
|
||||
struct tm *t,tt;
|
||||
long curr_time;
|
||||
|
||||
t=&tt;
|
||||
curr_time=time((long *)0);
|
||||
t=localtime(&curr_time);
|
||||
time_buf[0] = t->tm_year+1900;
|
||||
time_buf[1] = t->tm_mon+1;
|
||||
time_buf[2] = t->tm_mday;
|
||||
time_buf[3] = t->tm_hour;
|
||||
time_buf[4] = t->tm_min;
|
||||
time_buf[5] = t->tm_sec;
|
||||
time_buf[6] = t->tm_wday;
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char * AsciiTime(char *ptr, time_t time)
|
||||
{
|
||||
struct tm *t,tt;
|
||||
|
||||
t=&tt;
|
||||
t=localtime(&time);
|
||||
sprintf(ptr,"%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);
|
||||
ptr[14] = 0;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
const char * AsciiTimeYMD(char *ptr, time_t time)
|
||||
{
|
||||
struct tm *t,tt;
|
||||
|
||||
t=&tt;
|
||||
t=localtime(&time);
|
||||
|
||||
sprintf(ptr,"%04d-%02d-%02d",
|
||||
t->tm_year+1900, t->tm_mon+1, t->tm_mday);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
const char * AsciiTimeYMDHMS(char *ptr, time_t time)
|
||||
{
|
||||
struct tm *t,tt;
|
||||
|
||||
t=&tt;
|
||||
t=localtime(&time);
|
||||
sprintf(ptr,"%02d-%02d-%04d %02d:%02d:%02d",
|
||||
t->tm_mday, t->tm_mon+1,t->tm_year+1900, t->tm_hour,
|
||||
t->tm_min, t->tm_sec);
|
||||
ptr[19] = 0;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
u_short
|
||||
GetTmDay()
|
||||
{
|
||||
struct tm tmb;
|
||||
time_t curr_time;
|
||||
|
||||
curr_time = time(NULL);
|
||||
memcpy(&tmb, localtime(&curr_time), sizeof(struct tm));
|
||||
return tmb.tm_mday;
|
||||
}
|
||||
|
||||
u_short
|
||||
GetTmMonth()
|
||||
{
|
||||
struct tm tmb;
|
||||
time_t curr_time;
|
||||
|
||||
curr_time = time(NULL);
|
||||
memcpy(&tmb, localtime(&curr_time), sizeof(struct tm));
|
||||
return tmb.tm_mon+1;
|
||||
}
|
||||
/*
|
||||
int getday(day_buf)
|
||||
char *day_buf;
|
||||
{
|
||||
struct tm *t,tt;
|
||||
long curr_date;
|
||||
|
||||
t=&tt;
|
||||
curr_date=time((long *)0);
|
||||
t=localtime(&curr_date);
|
||||
sprintf(day_buf,"%02d", t->tm_mday);
|
||||
day_buf[2]=0;
|
||||
return t->tm_mday;
|
||||
}
|
||||
*/
|
||||
u_short
|
||||
GetTmYear()
|
||||
{
|
||||
struct tm tmb;
|
||||
time_t curr_time;
|
||||
|
||||
curr_time = time(NULL);
|
||||
memcpy(&tmb, localtime(&curr_time), sizeof(struct tm));
|
||||
return tmb.tm_year+1900;
|
||||
}
|
||||
|
||||
int getweek(week_buf)
|
||||
char *week_buf;
|
||||
{
|
||||
struct tm *t,tt;
|
||||
long curr_date;
|
||||
|
||||
t=&tt;
|
||||
curr_date=time((long *)0);
|
||||
t=localtime(&curr_date);
|
||||
sprintf(week_buf,"%02d", t->tm_wday);
|
||||
week_buf[2]=0;
|
||||
return t->tm_wday;
|
||||
}
|
||||
/*
|
||||
int getmon(mon_buf)
|
||||
char *mon_buf;
|
||||
{
|
||||
struct tm *t,tt;
|
||||
long curr_date;
|
||||
|
||||
t=&tt;
|
||||
curr_date=time((long *)0);
|
||||
t=localtime(&curr_date);
|
||||
sprintf(mon_buf,"%02d", t->tm_mon+1);
|
||||
mon_buf[2]=0;
|
||||
return t->tm_mon;
|
||||
}
|
||||
|
||||
int getyear(year_buf)
|
||||
char *year_buf;
|
||||
{
|
||||
struct tm *t,tt;
|
||||
long curr_date;
|
||||
|
||||
t=&tt;
|
||||
curr_date=time((long *)0);
|
||||
t=localtime(&curr_date);
|
||||
sprintf(year_buf,"%04d", t->tm_year+1900);
|
||||
year_buf[4]=0;
|
||||
return t->tm_year;
|
||||
}
|
||||
*/
|
||||
/* Get current date */
|
||||
/*
|
||||
void getdate(date_buf)
|
||||
char *date_buf;
|
||||
{
|
||||
struct tm *t,tt;
|
||||
long curr_date;
|
||||
|
||||
t=&tt;
|
||||
curr_date=time((long *)0);
|
||||
t=localtime(&curr_date);
|
||||
sprintf(date_buf,"%04d-%02d-%02d",t->tm_year+1900,t->tm_mon+1,t->tm_mday);
|
||||
date_buf[10]=0;
|
||||
}
|
||||
*/
|
||||
time_t
|
||||
MakeTime(struct tm *timep, char *ptr)
|
||||
{
|
||||
char tempbuf[5];
|
||||
struct tm tm, *timeptr;
|
||||
time_t retval;
|
||||
memset(&tm, 0, sizeof(struct tm));
|
||||
timeptr = &tm;
|
||||
strncpy(tempbuf, ptr, 4);
|
||||
tempbuf[4] = 0;
|
||||
timeptr->tm_year = atoi(tempbuf) - 1900;
|
||||
strncpy(tempbuf, ptr+4, 2);
|
||||
tempbuf[2] = 0;
|
||||
timeptr->tm_mon = atoi(tempbuf) - 1;
|
||||
strncpy(tempbuf, ptr+6, 2);
|
||||
tempbuf[2] = 0;
|
||||
timeptr->tm_mday = atoi(tempbuf);
|
||||
strncpy(tempbuf, ptr+8, 2);
|
||||
tempbuf[2] = 0;
|
||||
timeptr->tm_hour = atoi(tempbuf);
|
||||
strncpy(tempbuf, ptr+10, 2);
|
||||
tempbuf[2] = 0;
|
||||
timeptr->tm_min = atoi(tempbuf);
|
||||
strncpy(tempbuf, ptr+12, 2);
|
||||
tempbuf[2] = 0;
|
||||
timeptr->tm_sec = atoi(tempbuf);
|
||||
retval = mktime(timeptr);
|
||||
if (NULL != timep)
|
||||
timep = timeptr;
|
||||
return (retval);
|
||||
}
|
||||
|
||||
char *
|
||||
GetTmDate(char *date_buf)
|
||||
{
|
||||
struct tm tmb;
|
||||
time_t curr_time;
|
||||
|
||||
curr_time = time(NULL);
|
||||
memcpy(&tmb, localtime(&curr_time), sizeof(struct tm));
|
||||
sprintf(date_buf, "%04d%02d%02d",
|
||||
tmb.tm_year+1900, tmb.tm_mon+1, tmb.tm_mday);
|
||||
date_buf[9] = 0;
|
||||
return (char *)date_buf;
|
||||
}
|
||||
|
||||
void
|
||||
CharToTimeStamp(u_char *btime, char *atime)
|
||||
{
|
||||
char timestamp[128]={""};
|
||||
char buf[128];
|
||||
BcdToAscii(buf, (BYTE *)atime, 14);
|
||||
memcpy(timestamp,&buf[2],12);
|
||||
|
||||
sprintf(×tamp[12],"%02d",0);
|
||||
sprintf(×tamp[14],"%02d",8);
|
||||
AsciiToBcd(btime,timestamp,16);
|
||||
}
|
||||
15
mss/pps/src/lib/version.c
Normal file
15
mss/pps/src/lib/version.c
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
** module name: version.c
|
||||
**
|
||||
*/
|
||||
|
||||
#include "../include/includes.h"
|
||||
#include "../include/version.h"
|
||||
|
||||
void
|
||||
SetVersionID(u_char *ptr)
|
||||
{
|
||||
*ptr++ = VER_MAJOR;
|
||||
*ptr++ = VER_MINOR;
|
||||
*ptr = VER_FIX;
|
||||
}
|
||||
BIN
mss/pps/src/log/dailyreport.bak
Normal file
BIN
mss/pps/src/log/dailyreport.bak
Normal file
Binary file not shown.
33
mss/pps/src/log/pps_trace.log
Normal file
33
mss/pps/src/log/pps_trace.log
Normal file
@@ -0,0 +1,33 @@
|
||||
Last function : (31)
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
->
|
||||
36
mss/pps/src/log/snmp_log.txt
Normal file
36
mss/pps/src/log/snmp_log.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
-------- SNMP log info -------
|
||||
----------------------------------
|
||||
---> Lastest log No. = 31 <-----
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
--
|
||||
------------- End --------------
|
||||
BIN
mss/pps/src/main/.Makefile.swp
Normal file
BIN
mss/pps/src/main/.Makefile.swp
Normal file
Binary file not shown.
160
mss/pps/src/main/Cook_Makefile
Normal file
160
mss/pps/src/main/Cook_Makefile
Normal file
@@ -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
|
||||
163
mss/pps/src/main/Makefile
Normal file
163
mss/pps/src/main/Makefile
Normal file
@@ -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
|
||||
|
||||
163
mss/pps/src/main/Rdb_Makefile
Normal file
163
mss/pps/src/main/Rdb_Makefile
Normal file
@@ -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
|
||||
|
||||
163
mss/pps/src/main/Zed_Makefile
Normal file
163
mss/pps/src/main/Zed_Makefile
Normal file
@@ -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
|
||||
|
||||
508
mss/pps/src/main/callMeBack.c
Normal file
508
mss/pps/src/main/callMeBack.c
Normal file
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
849
mss/pps/src/main/callingCardMsg.c
Normal file
849
mss/pps/src/main/callingCardMsg.c
Normal file
@@ -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;
|
||||
}
|
||||
1206
mss/pps/src/main/callingCardState.c
Normal file
1206
mss/pps/src/main/callingCardState.c
Normal file
File diff suppressed because it is too large
Load Diff
8
mss/pps/src/main/calling_card.c
Normal file
8
mss/pps/src/main/calling_card.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
void function_abc()
|
||||
{
|
||||
printf("abc\n");
|
||||
printf("add new printf\n");
|
||||
}
|
||||
1389
mss/pps/src/main/capmsg.c
Normal file
1389
mss/pps/src/main/capmsg.c
Normal file
File diff suppressed because it is too large
Load Diff
660
mss/pps/src/main/comfunc.c
Normal file
660
mss/pps/src/main/comfunc.c
Normal file
@@ -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;
|
||||
}
|
||||
95
mss/pps/src/main/conf/.svn/all-wcprops
Normal file
95
mss/pps/src/main/conf/.svn/all-wcprops
Normal file
@@ -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
|
||||
538
mss/pps/src/main/conf/.svn/entries
Normal file
538
mss/pps/src/main/conf/.svn/entries
Normal file
@@ -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
|
||||
5
mss/pps/src/main/conf/.svn/prop-base/help_page.svn-base
Normal file
5
mss/pps/src/main/conf/.svn/prop-base/help_page.svn-base
Normal file
@@ -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
|
||||
5
mss/pps/src/main/conf/.svn/prop-base/menu_page.svn-base
Normal file
5
mss/pps/src/main/conf/.svn/prop-base/menu_page.svn-base
Normal file
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
5
mss/pps/src/main/conf/.svn/prop-base/mtp3.conf.svn-base
Normal file
5
mss/pps/src/main/conf/.svn/prop-base/mtp3.conf.svn-base
Normal file
@@ -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
|
||||
5
mss/pps/src/main/conf/.svn/prop-base/sccp.conf.svn-base
Normal file
5
mss/pps/src/main/conf/.svn/prop-base/sccp.conf.svn-base
Normal file
@@ -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
|
||||
BIN
mss/pps/src/main/conf/.svn/text-base/conv_prefix.conf.svn-base
Normal file
BIN
mss/pps/src/main/conf/.svn/text-base/conv_prefix.conf.svn-base
Normal file
Binary file not shown.
16
mss/pps/src/main/conf/.svn/text-base/help_page.svn-base
Normal file
16
mss/pps/src/main/conf/.svn/text-base/help_page.svn-base
Normal file
@@ -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.
|
||||
$
|
||||
30
mss/pps/src/main/conf/.svn/text-base/iptrans.conf.svn-base
Normal file
30
mss/pps/src/main/conf/.svn/text-base/iptrans.conf.svn-base
Normal file
@@ -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
|
||||
40
mss/pps/src/main/conf/.svn/text-base/map_acn.conf.svn-base
Normal file
40
mss/pps/src/main/conf/.svn/text-base/map_acn.conf.svn-base
Normal file
@@ -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)
|
||||
23
mss/pps/src/main/conf/.svn/text-base/menu_page.svn-base
Normal file
23
mss/pps/src/main/conf/.svn/text-base/menu_page.svn-base
Normal file
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1408
mss/pps/src/main/conf/.svn/text-base/mtp3.conf.svn-base
Normal file
1408
mss/pps/src/main/conf/.svn/text-base/mtp3.conf.svn-base
Normal file
File diff suppressed because it is too large
Load Diff
BIN
mss/pps/src/main/conf/.svn/text-base/ppsConf.txt.svn-base
Normal file
BIN
mss/pps/src/main/conf/.svn/text-base/ppsConf.txt.svn-base
Normal file
Binary file not shown.
BIN
mss/pps/src/main/conf/.svn/text-base/ppsCrdConf.txt.svn-base
Normal file
BIN
mss/pps/src/main/conf/.svn/text-base/ppsCrdConf.txt.svn-base
Normal file
Binary file not shown.
27
mss/pps/src/main/conf/.svn/text-base/sccp.conf.svn-base
Normal file
27
mss/pps/src/main/conf/.svn/text-base/sccp.conf.svn-base
Normal file
@@ -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
|
||||
|
||||
87
mss/pps/src/main/conf/.svn/text-base/sccp.conf_omt.svn-base
Normal file
87
mss/pps/src/main/conf/.svn/text-base/sccp.conf_omt.svn-base
Normal file
@@ -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;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user