Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d670b5c31 | ||
|
|
a76e6170e2 | ||
|
|
26d005a5f6 | ||
|
|
4805437477 | ||
|
|
e428b18ac4 | ||
|
|
7caf18ffef | ||
|
|
2a7ceb99a6 |
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,48 @@
|
||||
ClearCase CopyAreaDB|4
|
||||
vobs\r9\mss\main\conf
|
||||
2
|
||||
2c
|
||||
9:help_page|1|11ab98fac5b|21f|d62d8a1f|2d495c7ebfa311dc832b001c23e19543|0
|
||||
c:msc_rzs.conf|1|11ab98fb3ec|29c|48ecc3c0|7869699ebfa311dc832b001c23e19543|0
|
||||
f:msc_system.conf|1|11ab98fb2d3|59|e97d1aaa|7609692ebfa311dc832b001c23e19543|0
|
||||
12:cap_operation.conf|1|11ab98fb0fe|4b0|9c725776|70196816bfa311dc832b001c23e19543|0
|
||||
c:cap_acn.conf|1|11ab98fae20|f1|ba0a4b11|33495d7abfa311dc832b001c23e19543|0
|
||||
10:conv_prefix.conf|1|11ab98fadc2|3940|d52c0a58|31795d42bfa311dc832b001c23e19543|0
|
||||
e:smsc_csta.conf|1|11ab98fb227|16b|27e474c8|73a968bebfa311dc832b001c23e19543|0
|
||||
c:map_acn.conf|1|11ab98fad74|5e5|45d6ce17|30495d0abfa311dc832b001c23e19543|0
|
||||
d:wxc2_sys.conf|1|11ab98faca9|42|438e1272|2e795cb6bfa311dc832b001c23e19543|0
|
||||
c:iptrans.conf|1|11ab98fb41b|227|b33f8c12|790969babfa311dc832b001c23e19543|0
|
||||
9:menu_page|1|11ab98fabce|2ce|7a7341|2b895c2abfa311dc832b001c23e19543|0
|
||||
a:system.ini|1|11ab98fb3bd|e8c|69e55b25|77d96982bfa311dc832b001c23e19543|0
|
||||
a:HlrSysPara|1|11ab98fb13d|1c50|326a8f75|70a96832bfa311dc832b001c23e19543|0
|
||||
d:smsc_sys.conf|1|11ab98fb1f8|54|50a31776|730968a2bfa311dc832b001c23e19543|0
|
||||
4:conf|2|0|0|0|3b995f02bfa311dc832b001c23e19543|0
|
||||
c:systemhh.ini|1|11ab98fae7e|4a8|153f5a60|34795db2bfa311dc832b001c23e19543|0
|
||||
c:msc_cua.conf|1|11ab98faf68|15e7|d014cac6|37795e3ebfa311dc832b001c23e19543|0
|
||||
9:ussd.conf|1|11ab98fb2a4|124|e2154d2c|75696912bfa311dc832b001c23e19543|0
|
||||
d:ussd_bak.conf|1|11ab98fadf1|e7|a8564408|32a95d5ebfa311dc832b001c23e19543|0
|
||||
12:map_operation.conf|1|11ab98fb081|a57|cf9ff375|3b095ee6bfa311dc832b001c23e19543|0
|
||||
a:debug.conf|1|11ab98fb16c|67|af3f196c|7149684ebfa311dc832b001c23e19543|0
|
||||
9:vlr_index|1|11ab98faf97|88|af192153|38095e5abfa311dc832b001c23e19543|0
|
||||
13:is41_operation.conf|1|11ab98fb052|886|d103743d|3a695ecabfa311dc832b001c23e19543|0
|
||||
a:AucSysPara|1|11ab98fb275|38|a03e055a|74d968f6bfa311dc832b001c23e19543|0
|
||||
7:vlr_err|1|11ab98fb311|c4|d24e2f78|7699694abfa311dc832b001c23e19543|0
|
||||
a:EirSysPara|1|11ab98fafc6|4444|47900a1d|38a95e76bfa311dc832b001c23e19543|0
|
||||
9:sccp.conf|1|11ab98fabfd|fa31|cbce0f2|2c195c46bfa311dc832b001c23e19543|0
|
||||
e:system.ini.old|1|11ab98fb39e|4a8|dc5068df|77396966bfa311dc832b001c23e19543|0
|
||||
b:ppsConf.txt|1|11ab98fac2c|1bf0|7736b2e4|2cb95c62bfa311dc832b001c23e19543|0
|
||||
9:mtp3.conf|1|11ab98fad35|1c03d|9a278bd3|2fb95ceebfa311dc832b001c23e19543|0
|
||||
b:msc_mg.conf|1|11ab98fad93|30d|52a3e524|30e95d26bfa311dc832b001c23e19543|0
|
||||
4:stop|1|11ab98fad07|11000|160383d4|2f195cd2bfa311dc832b001c23e19543|0
|
||||
e:ppsCrdConf.txt|1|11ab98fb1c9|2832|28320001|72796886bfa311dc832b001c23e19543|0
|
||||
12:smsc_parambit.conf|1|11ab98fb0b0|968|3c4a89a2|6f7967fabfa311dc832b001c23e19543|0
|
||||
8:vlr.conf|1|11ab98fac7a|80|5d091aab|2de95c9abfa311dc832b001c23e19543|0
|
||||
d:cc_table.conf|1|11ab98fae4f|1156|31d07a59|33d95d96bfa311dc832b001c23e19543|0
|
||||
c:wxc2exit.txt|1|11ab98faf0a|4a|539c1559|36395e06bfa311dc832b001c23e19543|0
|
||||
11:xap_sysparam.conf|1|11ab98faff5|10|3b390840|39395e92bfa311dc832b001c23e19543|0
|
||||
8:srf.conf|1|11ab98fb023|1782c|11d18f04|39d95eaebfa311dc832b001c23e19543|0
|
||||
b:msc_tg.conf|1|11ab98faedb|22b0|6de108a2|35a95deabfa311dc832b001c23e19543|0
|
||||
e:xap_mscid.conf|1|11ab98fb246|c00|c000001|743968dabfa311dc832b001c23e19543|0
|
||||
9:smpp.conf|1|11ab98faf39|c1a|20460689|36d95e22bfa311dc832b001c23e19543|0
|
||||
b:msc_la.conf|1|11ab98fb19a|17d|78566e3f|71d9686abfa311dc832b001c23e19543|0
|
||||
c:msc_dps.conf|1|11ab98faeac|112a|8d7ba7b5|35095dcebfa311dc832b001c23e19543|0
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
./makeclean
|
||||
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "==== Building AGT OCS Platform Modules===="
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
cd ../../plat
|
||||
cd public ; make release ; cd .. ;
|
||||
cd debug ; make release ; cd .. ;
|
||||
cd snmp ; make release ; cd .. ;
|
||||
cd iptrans; make release ; cd .. ;
|
||||
cd mtp3 ; make release ; cd .. ;
|
||||
cd sccp ; make release ; cd .. ;
|
||||
cd tcap ; make release ; cd .. ;
|
||||
cd xapp ; make release ; cd .. ;
|
||||
cd m2ua ; make release ; cd .. ;
|
||||
cd smpp ; make release ; cd .. ;
|
||||
cd scf ; make release ; cd .. ;
|
||||
cd radius ; make release ; cd .. ;
|
||||
cd tcp ; make release ; cd .. ;
|
||||
cd diameter ; make clean; make ; cd .. ;
|
||||
cd ..
|
||||
|
||||
echo ""
|
||||
echo "============================================="
|
||||
echo "==== Building AGT OCS Application Modules===="
|
||||
echo "============================================="
|
||||
echo ""
|
||||
cd mss
|
||||
cd pps ; make rdb_tariff ; cd .. ;
|
||||
cd main ; make release ;
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
./makeclean
|
||||
|
||||
echo ""
|
||||
echo "=========================================="
|
||||
echo "==== Building AGT OCS Platform Modules===="
|
||||
echo "=========================================="
|
||||
echo ""
|
||||
cd ../../plat
|
||||
cd public ; make release ; cd .. ;
|
||||
cd debug ; make release ; cd .. ;
|
||||
cd snmp ; make release ; cd .. ;
|
||||
cd iptrans; make release ; cd .. ;
|
||||
cd mtp3 ; make release ; cd .. ;
|
||||
cd sccp ; make release ; cd .. ;
|
||||
cd tcap ; make release ; cd .. ;
|
||||
cd xapp ; make release ; cd .. ;
|
||||
cd m2ua ; make release ; cd .. ;
|
||||
cd smpp ; make release ; cd .. ;
|
||||
cd scf ; make release ; cd .. ;
|
||||
cd radius ; make release ; cd .. ;
|
||||
cd tcp ; make release ; cd .. ;
|
||||
cd diameter ; make clean; make ; cd .. ;
|
||||
cd ..
|
||||
|
||||
echo ""
|
||||
echo "============================================="
|
||||
echo "==== Building AGT OCS Application Modules===="
|
||||
echo "============================================="
|
||||
echo ""
|
||||
cd mss
|
||||
cd pps ; make zed_mobile ; cd .. ;
|
||||
cd main ; make release ;
|
||||
Binary file not shown.
+184
-1
@@ -290,7 +290,7 @@ extern int gx_fsm(long sec, int msec);
|
||||
|
||||
/*----------------------------------------------------*/
|
||||
|
||||
static u8 wxc2_version[4] = {1, 0, 1, 50};
|
||||
static u8 wxc2_version[4] = {1, 0, 1, 46};
|
||||
//static char wxc2_mini_version[4]={""};
|
||||
|
||||
static int wxc2_update_version(char *state_str)
|
||||
@@ -730,6 +730,188 @@ static int CheckHDLicense(unsigned char *HDSerailNumber)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if 1//def Kylin_and_2204_lic
|
||||
static int GetHDInfo()
|
||||
{
|
||||
FILE *fpConf=NULL;
|
||||
int i,j=0,k;
|
||||
char ethmac[64]="",meminfo[64]="",hwinfo[128]="",*start,*offset,*offset_0,buf[8192]="",tmp[2048]="";//,cpuinfo[64]=""
|
||||
char ascii_buf[128] = {0};
|
||||
unsigned char TmpStr[64] = {0}, act_req_code[128] = {0}, act_req_code_des[128] = {0};
|
||||
int ret, offset_len;
|
||||
|
||||
printf("Get HD info ...\n");
|
||||
|
||||
memset(ethmac, 0, 64);
|
||||
sprintf(buf,"ip a > ../log/hwinfo");
|
||||
ret = system(buf);
|
||||
fpConf = fopen("../log/hwinfo","r");
|
||||
if (fpConf == NULL) {
|
||||
printf("Log directory may be missing!\n");
|
||||
return 0;
|
||||
}
|
||||
ret = fread(buf,2048,1,fpConf);
|
||||
start = buf;
|
||||
for (;;) {
|
||||
offset = strstr(start,"ether ");
|
||||
if (offset == NULL) {
|
||||
offset = strstr(start,"HWaddr ");
|
||||
offset_len = 7;
|
||||
} else {
|
||||
offset_len = 6;
|
||||
}
|
||||
if (offset != NULL) {
|
||||
strncpy(tmp, start, offset-start);
|
||||
tmp[offset-start] = 0;
|
||||
if (strstr(tmp, "docker") != NULL) {
|
||||
start = offset + offset_len;
|
||||
continue;
|
||||
}
|
||||
offset += offset_len;
|
||||
for(i=0,j=0;i<64;i++) {
|
||||
if ((*(offset+i)=='\n') ||
|
||||
(*(offset+i)==' ')) {
|
||||
ethmac[j] = 0;
|
||||
break;
|
||||
} else if (*(offset+i)==':') {
|
||||
continue;
|
||||
} else {
|
||||
ethmac[j] = tolower(*(offset+i));
|
||||
j++;
|
||||
}
|
||||
}
|
||||
ethmac[j] = 0;
|
||||
}
|
||||
fclose(fpConf);
|
||||
remove("../log/hwinfo");
|
||||
break;
|
||||
}
|
||||
|
||||
int uuid_or_cpuid=0; //0=CPUID, 1=UUID
|
||||
memset(meminfo, 0, 64);
|
||||
sprintf(buf,"dmidecode | grep UUID > ../log/hwinfo");
|
||||
ret = system(buf);
|
||||
fpConf = fopen("../log/hwinfo","r");
|
||||
if(fpConf != NULL) {
|
||||
ret = fread(buf,2048,1,fpConf);
|
||||
offset_0=offset = strstr(buf,"UUID: ");
|
||||
if (offset != NULL) {
|
||||
uuid_or_cpuid = 1;
|
||||
for(i=6,j=0;i<64;i++) {
|
||||
if (*(offset+i)=='\n') {
|
||||
meminfo[j] = 0;
|
||||
break;
|
||||
} else if (isdigit(*(offset+i))) {
|
||||
meminfo[j] = *(offset+i);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(fpConf);
|
||||
remove("../log/hwinfo");
|
||||
}
|
||||
|
||||
if( uuid_or_cpuid == 0) {//UUID not found
|
||||
// CPUID
|
||||
memset(meminfo, 0, 64);
|
||||
sprintf(buf,"dmidecode -t 4 | grep ID >../log/hwinfo");
|
||||
ret = system(buf);
|
||||
fpConf = fopen("../log/hwinfo","r");
|
||||
if(fpConf != NULL) {
|
||||
ret = fread(buf,2048,1,fpConf);
|
||||
offset_0=offset = strstr(buf,"ID: ");
|
||||
if (offset != NULL) {
|
||||
for(i=4,j=0;i<64;i++) {
|
||||
if (*(offset+i)=='\n') {
|
||||
meminfo[j] = 0;
|
||||
break;
|
||||
} else if (isdigit(*(offset+i))) {
|
||||
meminfo[j] = *(offset+i);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
offset = strstr(offset_0+4,"ID: ");
|
||||
if (offset != NULL) {
|
||||
for(i=4;i<64;i++) {
|
||||
if (*(offset+i)=='\n') {
|
||||
meminfo[j] = 0;
|
||||
break;
|
||||
} else if (isdigit(*(offset+i))) {
|
||||
meminfo[j] = *(offset+i);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(fpConf);
|
||||
remove("../log/hwinfo");
|
||||
}
|
||||
}
|
||||
|
||||
strcpy(hwinfo, "");
|
||||
strcat(hwinfo, ethmac);
|
||||
i = j = strlen(ethmac);
|
||||
hwinfo[i++] = ethmac[0];
|
||||
hwinfo[i++] = ethmac[1];
|
||||
hwinfo[i++] = ethmac[2];
|
||||
hwinfo[i++] = ethmac[3];
|
||||
hwinfo[i] = 0;
|
||||
strcat(hwinfo, meminfo);
|
||||
j = strlen(meminfo);
|
||||
i += j;
|
||||
hwinfo[i++] = ethmac[4];
|
||||
hwinfo[i++] = ethmac[5];
|
||||
hwinfo[i++] = ethmac[6];
|
||||
hwinfo[i++] = ethmac[7];
|
||||
hwinfo[i] = 0;
|
||||
//strcat(hwinfo, cpuinfo);
|
||||
//j = strlen(cpuinfo);
|
||||
//i += j;
|
||||
hwinfo[i++] = ethmac[8];
|
||||
hwinfo[i++] = ethmac[9];
|
||||
hwinfo[i++] = ethmac[10];
|
||||
hwinfo[i++] = ethmac[11];
|
||||
hwinfo[i] = 0;
|
||||
|
||||
j = strlen(hwinfo);
|
||||
if (j == 0) {
|
||||
printf("Missing Activation Request Info!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
k = (j + 7) / 8;
|
||||
memset(hwinfo + j, '0', 128 - j);
|
||||
|
||||
memset(act_req_code, 0, 128);
|
||||
for (i = 0; i < k; i++) {
|
||||
memset(TmpStr, 0, 64);
|
||||
DesCrypt(TmpStr, (unsigned char *)hwinfo + 8 * i, NULL, 0);
|
||||
memcpy(act_req_code + 8 * i, TmpStr, 8);
|
||||
}
|
||||
memset(ascii_buf, 0, 128);
|
||||
BcdToAscii(ascii_buf, act_req_code, k * 16);
|
||||
|
||||
fpConf = fopen("../log/Activation_request_code.txt","w");
|
||||
if (fpConf != NULL) {
|
||||
fprintf(fpConf, "%s\n", ascii_buf);
|
||||
fclose(fpConf);
|
||||
} else {
|
||||
printf("Missing Activation_request_code file!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(act_req_code_des, 0, 128);
|
||||
for (i = 0; i < k; i++) {
|
||||
memset(TmpStr, 0, 64);
|
||||
DesCrypt(TmpStr, act_req_code + 8 * i, NULL, 0);
|
||||
memcpy(act_req_code_des + 8 * i, TmpStr, 8);
|
||||
}
|
||||
wxc2HDInfo[0] = k*8;
|
||||
memcpy(&wxc2HDInfo[1],act_req_code_des,k*8);
|
||||
printf("Get HD info... OK!\n");
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
static int GetHDInfo()
|
||||
{
|
||||
FILE *fpConf=NULL;
|
||||
@@ -1076,6 +1258,7 @@ if(lic_mem_cpu)
|
||||
printf("Get HD info... OK!\n");
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void SaveWxc2SystemConf()
|
||||
{
|
||||
|
||||
@@ -8,6 +8,16 @@ cook_island:
|
||||
@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 ..
|
||||
|
||||
@@ -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'
|
||||
@@ -80,6 +80,7 @@ typedef struct _tocdr_report {
|
||||
BYTE gprsDestIP[64];
|
||||
BYTE gprsVolume[4];
|
||||
BYTE peerAddress[128];
|
||||
BYTE plan_id[4];
|
||||
} _tocdr_report;
|
||||
|
||||
/*
|
||||
|
||||
@@ -102,9 +102,9 @@ void GetSubsCapInfo(_account_info *ptr,int cap_type, float *balance, int *counte
|
||||
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[], _state_data *shmp);
|
||||
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, _state_data *shmp);
|
||||
int subscribe_bundle_plan_send_used_up_info(char *caller_number, SMS_SENTENCE id);
|
||||
|
||||
int GetAccountVoiceID(int head,int tail);
|
||||
|
||||
@@ -176,6 +176,8 @@ extern void SendSmsDirectDebitAndRefundCDR(_state_data *shmp, int sent_num, int
|
||||
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);
|
||||
@@ -283,6 +285,11 @@ 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
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ typedef struct _PpsParam
|
||||
int scf_work_as_adaptor_with_vcs;
|
||||
int data_quota_as_postpaid;
|
||||
int new_flags[31];
|
||||
|
||||
_ocsCRMConrol ocs_crm_control;
|
||||
}PPSParamStruct;
|
||||
|
||||
|
||||
|
||||
@@ -179,13 +179,10 @@ typedef enum
|
||||
SMS_BUNDLE_PLAN_VOICE_USEDUP = 97,
|
||||
SMS_BUNDLE_PLAN_SMS_USEDUP = 98,
|
||||
SMS_BUNDLE_PLAN_USSD_MENU1 = 99,
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
SMS_BUNDLE_PLAN_ROAM_AND_NOTROAM = 100,
|
||||
|
||||
SMS_MAX_ITEM = 101//100
|
||||
#else
|
||||
SMS_MAX_ITEM = 100
|
||||
#endif
|
||||
SMS_MAX_ITEM = 100 ,
|
||||
SMS_LAST_CALL_INFO = 101,
|
||||
SMS_LAST_SMS_INFO = 102,
|
||||
}SMS_SENTENCE;
|
||||
|
||||
typedef enum _PPS_USSD_OPERATON
|
||||
@@ -261,22 +258,14 @@ typedef enum _ppsTableMaxItem
|
||||
MaxcapPlanTableItem = 4,
|
||||
MaxPoolAccountTableItem = 1,
|
||||
MaxGprsTableItem = 1,
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
MaxGprsCapPlan = 2,
|
||||
#else
|
||||
MaxGprsCapPlan = 1,
|
||||
#endif
|
||||
MaxFriendFamilyTableItem = 1,
|
||||
/****************** cos tables ********************/
|
||||
|
||||
/*** if you add items in any table,notify these value ***/
|
||||
MaxPromptResolutionReservedItem = 1,
|
||||
MaxMnpPrefixReservedItem = 1,
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
MaxSmsSentenceReservedItem = 0,//1,
|
||||
#else
|
||||
MaxSmsSentenceReservedItem = 1,
|
||||
#endif
|
||||
MaxThirdPartyInfoReservedItem = 1,
|
||||
MaxBasicTariffZoneReservedItem = 1,
|
||||
MaxIvrSourceReservedItem = 1,
|
||||
@@ -323,6 +312,7 @@ typedef enum _serviceNumberPosition
|
||||
GPRSPrepaidPostion,
|
||||
TellMeNumber,
|
||||
FriendFamilyPosition,
|
||||
MAXServicePostion,
|
||||
|
||||
}serviceNumberPosition;
|
||||
|
||||
@@ -569,9 +559,7 @@ typedef struct _CosSmsNotificationInquiry
|
||||
u8 smsNotificationWhenFriendFamilyServiceSuspend;
|
||||
u8 smsNotificationWhenFriendFamilyPlanExhaust;
|
||||
u8 smsNotificationWhenFriendFamilyServiceRemoved;
|
||||
u8 smsNotificationWhenPromotionInsufficient;
|
||||
u8 insufficientPromotionThreshold;
|
||||
u8 reserve[24];
|
||||
u8 reserve[26];
|
||||
u8 existFlag;
|
||||
}CosSmsNotificationInquiry;
|
||||
|
||||
@@ -657,13 +645,8 @@ typedef struct _PPS_COS_RADIUS_ITEM
|
||||
ulong maxDurationQuotaEachTime;/* s */
|
||||
ulong durationThresholdDiff;/* s */
|
||||
u8 gprsChargedBy;/*0:define by cos;1:defined by incoming GSN IP */
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
GPRS_VOLUME_CAP_PLAN capPlan[MaxGprsCapPlan];
|
||||
u8 reserved[44];
|
||||
#else
|
||||
GPRS_VOLUME_CAP_PLAN capPlan[MaxGprsCapPlan];
|
||||
u8 reserved[64];
|
||||
#endif
|
||||
u8 existFlag;
|
||||
}PPS_COS_RADIUS_ITEM;
|
||||
|
||||
@@ -754,6 +737,9 @@ typedef struct _PpsTable
|
||||
|
||||
serviceBundlePlan bundlePlans[MAX_BUNDLE_PLANS];
|
||||
|
||||
SmsSentence smsExtSentence[MaxSmsSentenceItem+MaxSmsSentenceReservedItem];
|
||||
|
||||
|
||||
}PpsTable;
|
||||
|
||||
|
||||
@@ -795,10 +781,39 @@ typedef struct _PpsServiceConrol{
|
||||
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[14];
|
||||
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
|
||||
{
|
||||
|
||||
@@ -2,82 +2,6 @@
|
||||
#define _PPS_REDIS__H_
|
||||
#include "ppsm.h"
|
||||
|
||||
// all Redis field of one KEY
|
||||
#define OCS_REDIS_FIELD_NULL 0
|
||||
#define OCS_REDIS_FIELD_BALANCE 1
|
||||
#define OCS_REDIS_FIELD_PROMO_BALANCE 2
|
||||
#define OCS_REDIS_FIELD_BUNDLE_DATA 3
|
||||
#define OCS_REDIS_FIELD_BUNDLE_MOV 4
|
||||
#define OCS_REDIS_FIELD_BUNDLE_MTV 5
|
||||
#define OCS_REDIS_FIELD_BUNDLE_SMS 6
|
||||
#define OCS_REDIS_FIELD_BUNDLE_VALIDITY 7
|
||||
#define OCS_REDIS_FIELD_BUNDLE_WARN_SMS_FLAG 8
|
||||
#define OCS_REDIS_FIELD_MAX_NUM 9
|
||||
|
||||
typedef struct OCS_usr_redis{
|
||||
char msisdn[24];
|
||||
double usr_balance;
|
||||
double pro_balance;
|
||||
|
||||
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;
|
||||
}OCS_usr_redis;
|
||||
|
||||
extern int RedisInit(u32 localip, u32 peerip);
|
||||
extern void RedisLinkMon();
|
||||
extern int RedisFlushDb();
|
||||
extern void RedisCreateDbFromOcs();
|
||||
extern void RedisSaveDbToOcs();
|
||||
//extern void RedisLoadFromRedis();
|
||||
|
||||
extern int RedisSetUserBalanceFromOcs(_prepaid_info *pUsr, double balance);
|
||||
extern int RedisUpdateUserBalance(OCS_usr_redis *usr_redis);
|
||||
extern int RedisUpdateUserInfo(OCS_usr_redis *usr_redis);
|
||||
extern int RedisUpdateUserInfoFromOcs(_prepaid_info *pUsr);
|
||||
extern int RedisUpdateBundleInfoFromOcs(_prepaid_info *pUsr);
|
||||
extern int RedisUpdateUsrFieldFromOcs(_prepaid_info *pUsr, int field_id);
|
||||
extern int RedisUpdateUserField(OCS_usr_redis *pUsr, int field_id);
|
||||
extern int RedisGetUserInfo(_prepaid_info *pUsr, OCS_usr_redis *usr_redis);
|
||||
extern int RedisGetBundleInfo(_prepaid_info *pUsr, OCS_usr_redis *usr_redis);
|
||||
extern int RedisGetUserInfo2Ocs(_prepaid_info *pUsr);
|
||||
extern int RedisGetUserField(_prepaid_info *pUsr, OCS_usr_redis *usr_redis, int field_id);
|
||||
extern int RedisGetUserBalance(_prepaid_info *pUsr, OCS_usr_redis *usr_redis);
|
||||
|
||||
extern int RedisClearUserBundle(OCS_usr_redis *pUsr);
|
||||
extern int RedisDelUserInfoByMsisdn(char *msisdn);
|
||||
extern int RedisDelUserInfo(_prepaid_info *pUsr);
|
||||
extern void RedisTest(int i);
|
||||
extern int RedisCreateLogTask(pthread_t *idTask);
|
||||
extern void RedisAddLogStr(char *time, char *level, char *, int line, char *text);
|
||||
|
||||
|
||||
// Redis log writer
|
||||
#define MAX_REDIS_LOG_LINES 81920
|
||||
#define MAX_REDIS_LINE_LEN 512
|
||||
typedef struct OCS_redis_log_t
|
||||
{
|
||||
int header;
|
||||
int tailer;
|
||||
|
||||
char log_str[MAX_REDIS_LOG_LINES][MAX_REDIS_LINE_LEN];
|
||||
}OCS_redis_log_t;
|
||||
|
||||
// simple log
|
||||
enum RedisLogLevel
|
||||
{
|
||||
RS_ERROR = 1,
|
||||
RS_WARN = 2,
|
||||
RS_INFO = 3,
|
||||
RS_DEBUG = 4,
|
||||
};
|
||||
|
||||
void mylog1(const char* filename, int line, enum RedisLogLevel level, const char* fmt, ...) __attribute__((format(printf,4,5)));
|
||||
|
||||
#define redislog(level, format, ...) mylog1(__FILE__, __LINE__, level, format, ## __VA_ARGS__)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -12,11 +12,12 @@
|
||||
#include "ramdata.h"
|
||||
#include "tariff.h"
|
||||
#include "cdrme.h"
|
||||
#include "../../../../plat/diameter/include/gy_message.h"
|
||||
|
||||
//#define OCS_USE_REDIS_DB 1
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
#include "pps_redis.h"
|
||||
#endif
|
||||
//#ifdef OCS_USE_REDIS_DB
|
||||
//#include "pps_redis.h"
|
||||
//#endif
|
||||
|
||||
#define SMMP_IT_INTERVAL_SEC 0
|
||||
#define SMMP_IT_INTERVAL_USEC 10000
|
||||
@@ -33,7 +34,7 @@
|
||||
#define PERIODIC_ACTIONS (CYCLE_STATE_INTERVAL)
|
||||
|
||||
#define NORMAL_DELAY_TIMER (10*CYCLE_STATE_INTERVAL)
|
||||
#define SSHORT_DELAY_TIMER (2*CYCLE_STATE_INTERVAL)
|
||||
#define SSHORT_DELAY_TIMER (5*CYCLE_STATE_INTERVAL)
|
||||
#define PROMPT_AND_COLLECT_TIMER (5*ONE_MINUTE_STATE_TIME)
|
||||
#define SPECIAL_RESOURCE_REPORT_TIMER (5*ONE_MINUTE_STATE_TIME)
|
||||
|
||||
@@ -185,6 +186,8 @@ typedef enum _call_state {
|
||||
S_GY_PS_WAIT_TERM,
|
||||
S_GY_PS_RELEASE,
|
||||
S_GY_PS_POSTPAID,
|
||||
S_RO_VOC_GET_TARIFF_FROM_CRM,//S_GY_PS_GET_TARIFF_FROM_CRM,
|
||||
S_GY_PS_GET_TARIFF_FROM_CRM_RES,
|
||||
|
||||
S_RO_ADAPTOR_CALL_INIT = 130,
|
||||
S_RO_CALL_WAIT_FIRST_CCA,
|
||||
@@ -197,6 +200,8 @@ typedef enum _call_state {
|
||||
S_SMPP_MAIN,
|
||||
|
||||
S_CC_CHECK_CALL_VALIDITY,
|
||||
|
||||
S_CRM_QUERY_TARIFF_TEST,
|
||||
|
||||
} _call_state;
|
||||
|
||||
@@ -208,6 +213,7 @@ typedef enum _pps_map_state {
|
||||
S_MAP_SEND_PUSSR_ACK,
|
||||
S_MAP_CHECK_USSD_INPUT_CARD_VALIDITY,
|
||||
S_MAP_USSD_CHECK_CARD_DATA_RCM,
|
||||
S_MAP_USSD_CHECK_CARD_DATA_CRM,
|
||||
S_MAP_USSD_INPUT_CARD_PWD_AGAIN,
|
||||
S_MAP_SEND_PUSSR_ACK_SEND_USSN,
|
||||
S_MAP_SEND_USSN_LOWBALANCE_PROMPT,
|
||||
@@ -220,6 +226,8 @@ typedef enum _pps_map_state {
|
||||
S_MAP_BUNDLE_PLAN,
|
||||
S_MAP_BUNDLE_QUERY,
|
||||
S_MAP_REST_TOPUP,
|
||||
S_MAP_THIRD_PARTY_HOTLINE,
|
||||
S_MAP_THIRD_PARTY_CHANNEL,
|
||||
}_pps_map_state;
|
||||
|
||||
typedef enum _pps_smpp_state {
|
||||
@@ -292,6 +300,7 @@ typedef enum recharge_state
|
||||
S_REC_CHECK_CARD_WITH_RCM,
|
||||
S_REC_CHECK_CARD_WITH_REST,
|
||||
S_REC_CHECK_CARD_WITH_REST_GET,
|
||||
S_REC_CHECK_CARD_WITH_CRM,
|
||||
}_recharge_state;
|
||||
|
||||
typedef enum rec_mng_retval
|
||||
@@ -402,8 +411,7 @@ enum _call_type {
|
||||
CT_MT_SM,
|
||||
CT_CONFERENCE_CALL,
|
||||
CT_THIRD_PARTY_CHARGE,
|
||||
CT_EMERGENCY_CALL,
|
||||
|
||||
CT_IDD_CALL_IN,
|
||||
CT_SERVICE,
|
||||
CT_FREE_SERVICE_CALL,
|
||||
CT_INVALID_CALL,
|
||||
@@ -411,6 +419,8 @@ enum _call_type {
|
||||
CT_MT_CALL,
|
||||
CT_MF_CALL,
|
||||
CT_INVALID_MO_SMS,// 123
|
||||
CT_EMERGENCY_CALL,
|
||||
|
||||
CT_DIRECT_DEBITING = 138,
|
||||
CT_REFUND_ACCOUNT = 139,
|
||||
CT_TRANFER_OUT=140,
|
||||
@@ -437,6 +447,7 @@ enum _call_type {
|
||||
CT_RO_DEBIT,
|
||||
|
||||
CT_MO_CC_CALL,
|
||||
CT_MAX_CALL_TYPE,
|
||||
};
|
||||
|
||||
#define MAX_ASCII_NUMBER_LEN 24
|
||||
@@ -445,6 +456,7 @@ typedef struct {
|
||||
u_char number[MAX_ASCII_NUMBER_LEN];
|
||||
u_char IMSI[8];
|
||||
char location;
|
||||
u_char free_flag;
|
||||
unsigned int valid_time;
|
||||
float fee;
|
||||
float charge;
|
||||
@@ -555,9 +567,18 @@ typedef struct gprs_process{
|
||||
RADIUS_TLV_TS acct_session_id;
|
||||
u_char calculateCount;
|
||||
u_char calledType;
|
||||
int update_quote_counter;
|
||||
RADIUS_ATTRIBUTE_CALLED_STATION_ID *calledList;
|
||||
}_gprs_process;
|
||||
|
||||
typedef struct _ussd_chnl_info{
|
||||
char scUrl[256];
|
||||
char prompt[256];
|
||||
char input[24];
|
||||
char sessId[64];
|
||||
u_char sess_state;
|
||||
}ussd_chnl_info;
|
||||
|
||||
typedef struct {
|
||||
u_short portid;// handle port
|
||||
u_char state; /* state of the process */
|
||||
@@ -633,6 +654,8 @@ typedef struct {
|
||||
CMB callMeBack;
|
||||
MASTER_SLAVE_CARD masterSlaveCard;
|
||||
_gprs_process gprs_process;
|
||||
ussd_chnl_info chnl_info;
|
||||
char areaName[32];
|
||||
}ppsService;
|
||||
u_char update_card_ack;
|
||||
u_char update_card_result;
|
||||
@@ -657,9 +680,12 @@ typedef struct {
|
||||
u_char last_ro_quota_type;// 0: bundle; 1: cap; for Ro refund
|
||||
unsigned int last_bundle_duration;// for Ro refund
|
||||
unsigned int last_cap_duration;// for Ro refund
|
||||
_gy_msg gy_ccr_info;
|
||||
}ro_if;
|
||||
struct
|
||||
{
|
||||
u_short src_ref;
|
||||
u_short dst_ref;
|
||||
u_short timer;
|
||||
u_char rest_src; /* 0/1/2=USSD, SMS, VOICE */
|
||||
u_char rest_oc; /* 0/1 = query, recharge */
|
||||
@@ -669,6 +695,17 @@ typedef struct {
|
||||
long balance;
|
||||
long mo_expiry_date;
|
||||
long mt_expiry_date;
|
||||
u_char query_tariff_status;
|
||||
int unit;
|
||||
float unit_charge;
|
||||
int tariff_discount;
|
||||
int plan_id;
|
||||
int bundle_plan_id;
|
||||
unsigned long long total_plan_value;
|
||||
unsigned long long used_plan_value;
|
||||
int sess_update_times;
|
||||
int busicode;
|
||||
unsigned long long plan_value_add_this_time;
|
||||
}rest_if;
|
||||
|
||||
} _process_info;
|
||||
@@ -1041,5 +1078,16 @@ int load_tariff_main();
|
||||
int IdleProc(u_short);
|
||||
int EstablishProc(int invokeid);
|
||||
int realSyncTcpSend(DWORD db_type, DWORD instance, DWORD ocode, BYTE *payload, WORD len);
|
||||
int OCS_with_external_CRM();
|
||||
void pps_send_rent_charge_to_crm(int head, int tail);
|
||||
extern int pps_send_query_tariff_req(u_short portid);
|
||||
extern int BillingProc_crm(_state_data *shmp, int sub_flag0);
|
||||
extern int pps_send_update_plan_value_req(u_short portid);
|
||||
int pps_send_selfcare_topup_req(u_short portid);
|
||||
int RechargeSucceedwithCRM(u_short portid);
|
||||
unsigned int ocs_get_ue_index(long long msisdn);
|
||||
long long ocs_get_ue_by_index(int store_index);
|
||||
void pps_send_update_subs_status_to_crm(_prepaid_info *user_ptr, int update_flag);
|
||||
|
||||
|
||||
#endif /* SMMP__H */
|
||||
@@ -15,7 +15,8 @@
|
||||
#define T_EXPIRED 1
|
||||
|
||||
#define POOL_MAX_CHILD 5
|
||||
#define HAS_BUNDLE_ROAMING 1
|
||||
|
||||
#define OCS_WITH_CRM 1
|
||||
|
||||
typedef enum account_status {
|
||||
T_FRESH, /* fresh account, can't dial in or out,
|
||||
@@ -25,6 +26,7 @@ typedef enum account_status {
|
||||
T_BLACKLIST,
|
||||
T_RELEASED,
|
||||
T_OPRTRIAL,
|
||||
T_DISABLE,
|
||||
MAX_USER_TYPE,
|
||||
|
||||
T_EXTERNAL=10,
|
||||
@@ -54,11 +56,7 @@ typedef enum last_call{
|
||||
#define MAX_MSISDN_ALEN 16
|
||||
#define MAX_PIN_LEN 6
|
||||
#define MAX_HOME_LOCATION 4
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
#define MAX_PPS_USER_FIELD_NUMS 74//68
|
||||
#else
|
||||
#define MAX_PPS_USER_FIELD_NUMS 68
|
||||
#endif
|
||||
|
||||
typedef struct prepaid_info_old {
|
||||
u_char msisdn[MAX_MSISDN_BLEN];
|
||||
@@ -141,75 +139,23 @@ typedef struct bundle_info
|
||||
int iRes[2];
|
||||
}_bundle_info;
|
||||
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
typedef struct prepaid_info_no_bundle_roam {
|
||||
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;
|
||||
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;
|
||||
|
||||
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;
|
||||
} _prepaid_info_no_bundle_roam;
|
||||
#endif
|
||||
|
||||
typedef struct prepaid_info {
|
||||
u_char msisdn[MAX_MSISDN_BLEN];
|
||||
@@ -252,13 +198,8 @@ typedef struct prepaid_info {
|
||||
double out_net_cap_call_balance;
|
||||
u_long out_net_cap_call_duration;
|
||||
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
double out_net_cap_gprsBalance;
|
||||
long long out_net_cap_gprsVolume;
|
||||
#else
|
||||
double call_in_cap_balance;
|
||||
u_long call_in_cap_duration;
|
||||
#endif
|
||||
|
||||
double in_net_cap_balance;
|
||||
double out_net_cap_balance;
|
||||
@@ -282,11 +223,13 @@ typedef struct prepaid_info {
|
||||
double dReserved[2];
|
||||
|
||||
_bundle_info bundle_info;
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
_bundle_info bundle_roam;
|
||||
#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
|
||||
@@ -297,13 +240,6 @@ typedef struct prepaid_data_old{
|
||||
_prepaid_info_old prepaid_info[MSISDN_HEAD_NUM][UNIT_STORE_ACCOUNT];
|
||||
} _prepaid_data_old;
|
||||
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
typedef struct prepaid_data_no_bundle_roam{
|
||||
long long msisdn_head[MSISDN_HEAD_NUM];
|
||||
_prepaid_info_no_bundle_roam prepaid_info[MSISDN_HEAD_NUM][UNIT_STORE_ACCOUNT];
|
||||
} _prepaid_data_no_bundle_roam;
|
||||
#endif
|
||||
|
||||
typedef struct prepaid_data {
|
||||
long long msisdn_head[MSISDN_HEAD_NUM];
|
||||
_prepaid_info prepaid_info[MSISDN_HEAD_NUM][UNIT_STORE_ACCOUNT];
|
||||
@@ -377,10 +313,6 @@ typedef struct card_data{
|
||||
#define COS_GROUP_NUM 16
|
||||
#define MAX_ZONE_NUM_NEW (MAX_ZONE_NUM/COS_GROUP_NUM)
|
||||
|
||||
#define BUNDLE_DISABLE 0
|
||||
#define BUNDLE_HOME_PLMN 1
|
||||
#define BUNDLE_OTHER_NETWORK 2
|
||||
|
||||
/*
|
||||
Charge on receiving call is not defined , 2003-10-10
|
||||
*/
|
||||
@@ -540,6 +472,13 @@ typedef struct _VAS_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];
|
||||
@@ -560,6 +499,7 @@ typedef struct tariff_data {
|
||||
_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;
|
||||
/*---------*/
|
||||
|
||||
|
||||
@@ -88,6 +88,39 @@ typedef struct balance_summary
|
||||
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];
|
||||
@@ -95,6 +128,9 @@ typedef struct daily_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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "../../../../plat/public/src/include/public.h"
|
||||
|
||||
#define MAX_BODY_LEN 128
|
||||
#define MAX_BODY_LEN 1024
|
||||
|
||||
#define REST_PROXY_PORT 4951
|
||||
|
||||
@@ -26,6 +26,7 @@ enum ERROR_CODE
|
||||
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
|
||||
@@ -34,6 +35,14 @@ enum REST_PROXY_MSG_TYPE
|
||||
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,
|
||||
@@ -53,7 +62,40 @@ enum REST_PROXY_MSG_TYPE
|
||||
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
|
||||
@@ -92,7 +134,7 @@ enum REST_IE_TAG
|
||||
IE_MT_EXPIRY,
|
||||
IE_USERNAME,
|
||||
IE_PASSWORD,
|
||||
IE_MSG_CONTENT,
|
||||
IE_MSG_CONTENT, //value=11
|
||||
IE_STATUS,
|
||||
IE_REMARK,
|
||||
IE_GROUP_NAME,
|
||||
@@ -102,7 +144,7 @@ enum REST_IE_TAG
|
||||
IE_MT_VOICE_MIN,// in minute
|
||||
IE_REMAIN_MT_VOICE_SEC,// in second
|
||||
IE_REMAIN_MT_VOICE_MIN,// in minute
|
||||
IE_SMS_NUM,
|
||||
IE_SMS_NUM, //value=21
|
||||
IE_REMAIN_SMS_NUM,
|
||||
IE_DATA_VOL_MB,// in MB
|
||||
IE_REMAIN_DATA_VOL_KB,// in KB
|
||||
@@ -112,9 +154,45 @@ enum REST_IE_TAG
|
||||
IE_VALID_DAYS,
|
||||
IE_EXPIRY_TIME,
|
||||
IE_MSISDN_TRANS_OUT,
|
||||
IE_MSISDN_TRANS_IN,
|
||||
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
|
||||
@@ -140,13 +218,16 @@ typedef struct 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;
|
||||
@@ -157,11 +238,128 @@ typedef struct rest_topup_res
|
||||
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[128];
|
||||
char sms_content[MAX_BODY_LEN];
|
||||
}_rest_send_authcode_req;
|
||||
|
||||
typedef struct rest_send_authcode_rsp
|
||||
@@ -243,6 +441,8 @@ typedef struct rest_recharge_req
|
||||
char msisdn[24];
|
||||
|
||||
u32 amount;// mandatory, add to balance
|
||||
u8 op_type;
|
||||
u16 valid_days;
|
||||
}_rest_recharge_req;
|
||||
|
||||
|
||||
@@ -251,6 +451,7 @@ 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;
|
||||
@@ -322,8 +523,139 @@ 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
|
||||
@@ -337,6 +669,21 @@ typedef struct rest_msg_s
|
||||
_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;
|
||||
@@ -357,6 +704,28 @@ typedef struct rest_msg_s
|
||||
_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;
|
||||
|
||||
@@ -391,4 +760,70 @@ 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
|
||||
@@ -14,7 +14,6 @@
|
||||
#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];
|
||||
@@ -38,7 +37,7 @@ typedef struct
|
||||
}_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];
|
||||
//_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 */
|
||||
|
||||
|
||||
@@ -36,7 +36,9 @@ DaemonInit(const char *pname, int facility)
|
||||
err_sys("%s: %s: fork (%d)",
|
||||
FILE_MACRO, FUNCTION_MACRO, LINE_MACRO);
|
||||
else if (pid != 0)
|
||||
exit(0); /* parent goes bye-bye */
|
||||
{
|
||||
exit(0);
|
||||
} /* parent goes bye-bye */
|
||||
|
||||
/* 41st child continues */
|
||||
setsid(); /* become session leader */
|
||||
|
||||
@@ -138,7 +138,7 @@ WriteDebugMsg(void *dest, const void *src)
|
||||
if (p->subWrite == p->subRead) {
|
||||
(p->subRead == DEBUG_BUFFER_LINE-1) ?
|
||||
(p->subRead = 0) : (p->subRead ++);
|
||||
return OVERFLOW;
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
@@ -165,7 +165,9 @@ ReadDebugMsg(void *dest, const void *src)
|
||||
*/
|
||||
p->subRead ++;
|
||||
if (p->subRead == DEBUG_BUFFER_LINE)
|
||||
{
|
||||
p->subRead = 0;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
+13
-5
@@ -179,11 +179,6 @@ const char * AsciiTime(char *ptr, time_t time)
|
||||
|
||||
t=&tt;
|
||||
t=localtime(&time);
|
||||
if (t==NULL)
|
||||
{
|
||||
sprintf(ptr,"%04d%02d%02d%02d%02d%02d",1970,1,1,0,0,0);
|
||||
return ptr;
|
||||
}
|
||||
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);
|
||||
@@ -205,6 +200,18 @@ const char * AsciiTimeYMD(char *ptr, time_t time)
|
||||
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()
|
||||
@@ -316,6 +323,7 @@ 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;
|
||||
|
||||
@@ -7,7 +7,7 @@ INC_TRUE=1
|
||||
INC_FALSE=0
|
||||
|
||||
CC = gcc
|
||||
CFLAGS=-D_REENTRANT -D_MAX_64COS_COOK_ -Wall -Wno-unused-function -g -lhiredis
|
||||
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
|
||||
@@ -66,7 +66,7 @@ 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 pps_redis.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
|
||||
@@ -152,6 +152,8 @@ 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:
|
||||
|
||||
@@ -7,7 +7,9 @@ INC_TRUE=1
|
||||
INC_FALSE=0
|
||||
|
||||
CC = gcc
|
||||
CFLAGS=-D_REENTRANT -Wall -Wno-unused-function -g -lhiredis
|
||||
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
|
||||
@@ -44,7 +46,7 @@ PPS_LIBRARY = -lopr
|
||||
|
||||
STATIC=
|
||||
|
||||
COMPILE.c=$(CC) $(CFLAGS)
|
||||
COMPILE.c=$(CC) $(CFLAGS) $(CFLAGS_IN)
|
||||
LINK.c=$(CC) $(CFLAGS)
|
||||
|
||||
COMPILE_SUFFIX=$(STATIC) $(INC_FLAGS)
|
||||
@@ -66,7 +68,7 @@ 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 pps_redis.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
|
||||
@@ -152,7 +154,10 @@ vas.o:vas.c
|
||||
$(COMPILE.c) -c vas.c $(INCLUDES)
|
||||
restapi.o:restapi.c
|
||||
$(COMPILE.c) -c restapi.c $(INCLUDES)
|
||||
ocs_user_table.o:ocs_user_table.c
|
||||
$(COMPILE.c) -c ocs_user_table.c $(INCLUDES)
|
||||
pps_redis.o:pps_redis.c
|
||||
$(COMPILE.c) -c pps_redis.c $(INCLUDES)
|
||||
clean:
|
||||
rm -f *.c~ *.o core ppsm *.c.bak
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
# !/bin/sh
|
||||
# Makefile for heart beating processor
|
||||
# Created by Huang QL, 2000/12/26
|
||||
#If you want to include which Module,Set the INC_XXX=$(INC_TRUE),
|
||||
#or set it to $(INC_FALSE),then run the command: make alt
|
||||
INC_TRUE=1
|
||||
INC_FALSE=0
|
||||
|
||||
CC = gcc
|
||||
CFLAGS=-D_REENTRANT -DOCS_USE_REDIS_DB -Wall -Wno-unused-function -g
|
||||
CFLAGS_IN=-D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
|
||||
|
||||
#-O2
|
||||
prefix = /usr
|
||||
includedir = $(prefix)/include
|
||||
libdir = $(prefix)/lib
|
||||
localinclude = ../include
|
||||
platLIBPREFIX =../../../wxc2plat
|
||||
INC_FLAGS = -I$(includedir)
|
||||
INCLUDES = -I../include
|
||||
|
||||
XAPPLIB_FLAGS = -L$(platLIBPREFIX)/xapp
|
||||
XAPPLD_LIBRARY = -lxapp
|
||||
TCAPLIB_FLAGS = -L$(platLIBPREFIX)/tcap
|
||||
TCAPLD_LIBRARY = -ltcap
|
||||
SCCPLIB_FLAGS = -L$(platLIBPREFIX)/sccp
|
||||
SCCPLD_LIBRARY = -lsccp
|
||||
MTP3LIB_FLAGS = -L$(platLIBPREFIX)/mtp3 -lcurses
|
||||
MTP3LD_LIBRARY = -lmtp3
|
||||
PUBLICLIB_FLAGS = -L$(platLIBPREFIX)/public
|
||||
PUBLICLD_LIBRARY = -lpublic
|
||||
DEBUGLIB_FLAGS = -L$(platLIBPREFIX)/debug
|
||||
DEBUGLD_LIBRARY = -ldebug
|
||||
SNMPLIB_FLAGS_I = -L$(platLIBPREFIX)/snmp
|
||||
SNMPLD_LIBRARY_I = -lsnmp
|
||||
SMPPLIB_FLAGS = -L$(platLIBPREFIX)/smppold
|
||||
SMPPLD_LIBRARY = -lsmpp
|
||||
IPTRANS_FLAGS = -L$(platLIBPREFIX)/iptrans
|
||||
IPTRANS_LIBRARY = -liptrans
|
||||
SCF_FLAGS = -L$(platLIBPREFIX)/scf
|
||||
SCF_LIBRARY = -lscf
|
||||
PPS_FLAGS = -L ../../OPR/lib
|
||||
PPS_LIBRARY = -lopr
|
||||
|
||||
|
||||
|
||||
STATIC=
|
||||
|
||||
COMPILE.c=$(CC) $(CFLAGS) $(CFLAGS_IN)
|
||||
LINK.c=$(CC) $(CFLAGS)
|
||||
|
||||
COMPILE_SUFFIX=$(STATIC) $(INC_FLAGS)
|
||||
|
||||
LINK_SUFFIX= $(INC_FLAGS) \
|
||||
$(PUBLICLIB_FLAGS) $(PUBLICLD_LIBRARY) \
|
||||
$(SNMPLIB_FLAGS_I) $(SNMPLD_LIBRARY_I) \
|
||||
$(XAPPLIB_FLAGS) $(XAPPLD_LIBRARY) \
|
||||
$(TCAPLIB_FLAGS) $(TCAPLD_LIBRARY) \
|
||||
$(SCCPLIB_FLAGS) $(SCCPLD_LIBRARY) \
|
||||
$(MTP3LIB_FLAGS) $(MTP3LD_LIBRARY) \
|
||||
$(DEBUGLIB_FLAGS) $(DEBUGLD_LIBRARY) \
|
||||
$(SMPPLIB_FLAGS) $(SMPPLD_LIBRARY) \
|
||||
$(IPTRANS_FLAGS) $(IPTRANS_LIBRARY) \
|
||||
$(SCF_FLAGS) $(SCF_LIBRARY)\
|
||||
$(PPS_FLAGS) $(PPS_LIBRARY)
|
||||
|
||||
PROGS=ppsm
|
||||
|
||||
#pps_OBJ = ppsmain.o capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o ppsopr.o callingCardMsg.o callingCardState.o
|
||||
|
||||
pps_OBJ = capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o callingCardMsg.o callingCardState.o tariffApplication.o callMeBack.o freeSMS.o feeTransfer.o masterSlaveCard.o radius.o gprs.o vas.o restapi.o ocs_user_table.o pps_redis.o
|
||||
all:$(PROGS)
|
||||
#$(pps_OBJ)
|
||||
# executive file
|
||||
ppsm:$(pps_OBJ)
|
||||
@echo Linking $@
|
||||
@echo $(LINK_SUFFIX)
|
||||
# @$(LINK.c) -o $(PROGS) $(pps_OBJ) $(LINK_SUFFIX) -L../lib/ -lppsfuns -ldl -lz -lpopt -lncurses -lm
|
||||
|
||||
# obj files
|
||||
#ppsmain.o:ppsmain.c
|
||||
# $(COMPILE.c) -c ppsmain.c $(INCLUDES)
|
||||
capmsg.o:capmsg.c
|
||||
$(COMPILE.c) -c capmsg.c $(INCLUDES)
|
||||
|
||||
crd.o:crd.c
|
||||
$(COMPILE.c) -c crd.c $(INCLUDES)
|
||||
|
||||
dailyreport.o:dailyreport.c
|
||||
$(COMPILE.c) -c dailyreport.c $(INCLUDES)
|
||||
|
||||
loadtl.o:loadtl.c
|
||||
$(COMPILE.c) -c loadtl.c $(INCLUDES)
|
||||
|
||||
message.o:message.c
|
||||
$(COMPILE.c) -c message.c $(INCLUDES)
|
||||
|
||||
mfunc.o:mfunc.c
|
||||
$(COMPILE.c) -c mfunc.c $(INCLUDES)
|
||||
|
||||
ppsmap.o:ppsmap.c
|
||||
$(COMPILE.c) -c ppsmap.c $(INCLUDES)
|
||||
|
||||
ppsMibTable.o:ppsMibTable.c
|
||||
$(COMPILE.c) -c ppsMibTable.c $(INCLUDES)
|
||||
|
||||
ppsmib.o:ppsmib.c
|
||||
$(COMPILE.c) -c ppsmib.c $(INCLUDES)
|
||||
|
||||
ppsfunc.o:ppsfunc.c
|
||||
$(COMPILE.c) -c ppsfunc.c $(INCLUDES)
|
||||
|
||||
ppsm.o:ppsm.c
|
||||
$(COMPILE.c) -c ppsm.c $(INCLUDES)
|
||||
|
||||
precard.o:precard.c
|
||||
$(COMPILE.c) -c precard.c $(INCLUDES)
|
||||
|
||||
rammng.o:rammng.c
|
||||
$(COMPILE.c) -c rammng.c $(INCLUDES)
|
||||
|
||||
smppapi.o:smppapi.c
|
||||
$(COMPILE.c) -c smppapi.c $(INCLUDES)
|
||||
|
||||
ppsussd.o:ppsussd.c
|
||||
$(COMPILE.c) -c ppsussd.c $(INCLUDES)
|
||||
|
||||
callingCardMsg.o:callingCardMsg.c
|
||||
$(COMPILE.c) -c callingCardMsg.c $(INCLUDES)
|
||||
|
||||
callingCardState.o:callingCardState.c
|
||||
$(COMPILE.c) -c callingCardState.c $(INCLUDES)
|
||||
|
||||
|
||||
tariffApplication.o:tariffApplication.c
|
||||
$(COMPILE.c) -c tariffApplication.c $(INCLUDES)
|
||||
|
||||
callMeBack.o:callMeBack.c
|
||||
$(COMPILE.c) -c callMeBack.c $(INCLUDES)
|
||||
|
||||
freeSMS.o:freeSMS.c
|
||||
$(COMPILE.c) -c freeSMS.c $(INCLUDES)
|
||||
|
||||
feeTransfer.o:feeTransfer.c
|
||||
$(COMPILE.c) -c feeTransfer.c $(INCLUDES)
|
||||
|
||||
masterSlaveCard.o:masterSlaveCard.c
|
||||
$(COMPILE.c) -c masterSlaveCard.c $(INCLUDES)
|
||||
radius.o:radius.c
|
||||
$(COMPILE.c) -c radius.c $(INCLUDES)
|
||||
gprs.o:gprs.c
|
||||
$(COMPILE.c) -c gprs.c $(INCLUDES)
|
||||
vas.o:vas.c
|
||||
$(COMPILE.c) -c vas.c $(INCLUDES)
|
||||
restapi.o:restapi.c
|
||||
$(COMPILE.c) -c restapi.c $(INCLUDES)
|
||||
ocs_user_table.o:ocs_user_table.c
|
||||
$(COMPILE.c) -c ocs_user_table.c $(INCLUDES)
|
||||
pps_redis.o:pps_redis.c
|
||||
$(COMPILE.c) -c pps_redis.c $(INCLUDES)
|
||||
clean:
|
||||
rm -f *.c~ *.o core ppsm *.c.bak
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
# !/bin/sh
|
||||
# Makefile for heart beating processor
|
||||
# Created by Huang QL, 2000/12/26
|
||||
#If you want to include which Module,Set the INC_XXX=$(INC_TRUE),
|
||||
#or set it to $(INC_FALSE),then run the command: make alt
|
||||
INC_TRUE=1
|
||||
INC_FALSE=0
|
||||
|
||||
CC = gcc
|
||||
CFLAGS=-D_REENTRANT -D_ZED_NO_CALLER_NUM_AND_EXPIRY_DATE_ -Wall -Wno-unused-function -g
|
||||
CFLAGS_IN=-D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
|
||||
|
||||
#-O2
|
||||
prefix = /usr
|
||||
includedir = $(prefix)/include
|
||||
libdir = $(prefix)/lib
|
||||
localinclude = ../include
|
||||
platLIBPREFIX =../../../wxc2plat
|
||||
INC_FLAGS = -I$(includedir)
|
||||
INCLUDES = -I../include
|
||||
|
||||
XAPPLIB_FLAGS = -L$(platLIBPREFIX)/xapp
|
||||
XAPPLD_LIBRARY = -lxapp
|
||||
TCAPLIB_FLAGS = -L$(platLIBPREFIX)/tcap
|
||||
TCAPLD_LIBRARY = -ltcap
|
||||
SCCPLIB_FLAGS = -L$(platLIBPREFIX)/sccp
|
||||
SCCPLD_LIBRARY = -lsccp
|
||||
MTP3LIB_FLAGS = -L$(platLIBPREFIX)/mtp3 -lcurses
|
||||
MTP3LD_LIBRARY = -lmtp3
|
||||
PUBLICLIB_FLAGS = -L$(platLIBPREFIX)/public
|
||||
PUBLICLD_LIBRARY = -lpublic
|
||||
DEBUGLIB_FLAGS = -L$(platLIBPREFIX)/debug
|
||||
DEBUGLD_LIBRARY = -ldebug
|
||||
SNMPLIB_FLAGS_I = -L$(platLIBPREFIX)/snmp
|
||||
SNMPLD_LIBRARY_I = -lsnmp
|
||||
SMPPLIB_FLAGS = -L$(platLIBPREFIX)/smppold
|
||||
SMPPLD_LIBRARY = -lsmpp
|
||||
IPTRANS_FLAGS = -L$(platLIBPREFIX)/iptrans
|
||||
IPTRANS_LIBRARY = -liptrans
|
||||
SCF_FLAGS = -L$(platLIBPREFIX)/scf
|
||||
SCF_LIBRARY = -lscf
|
||||
PPS_FLAGS = -L ../../OPR/lib
|
||||
PPS_LIBRARY = -lopr
|
||||
|
||||
|
||||
|
||||
STATIC=
|
||||
|
||||
COMPILE.c=$(CC) $(CFLAGS) $(CFLAGS_IN)
|
||||
LINK.c=$(CC) $(CFLAGS)
|
||||
|
||||
COMPILE_SUFFIX=$(STATIC) $(INC_FLAGS)
|
||||
|
||||
LINK_SUFFIX= $(INC_FLAGS) \
|
||||
$(PUBLICLIB_FLAGS) $(PUBLICLD_LIBRARY) \
|
||||
$(SNMPLIB_FLAGS_I) $(SNMPLD_LIBRARY_I) \
|
||||
$(XAPPLIB_FLAGS) $(XAPPLD_LIBRARY) \
|
||||
$(TCAPLIB_FLAGS) $(TCAPLD_LIBRARY) \
|
||||
$(SCCPLIB_FLAGS) $(SCCPLD_LIBRARY) \
|
||||
$(MTP3LIB_FLAGS) $(MTP3LD_LIBRARY) \
|
||||
$(DEBUGLIB_FLAGS) $(DEBUGLD_LIBRARY) \
|
||||
$(SMPPLIB_FLAGS) $(SMPPLD_LIBRARY) \
|
||||
$(IPTRANS_FLAGS) $(IPTRANS_LIBRARY) \
|
||||
$(SCF_FLAGS) $(SCF_LIBRARY)\
|
||||
$(PPS_FLAGS) $(PPS_LIBRARY)
|
||||
|
||||
PROGS=ppsm
|
||||
|
||||
#pps_OBJ = ppsmain.o capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o ppsopr.o callingCardMsg.o callingCardState.o
|
||||
|
||||
pps_OBJ = capmsg.o dailyreport.o loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o ppsfunc.o ppsm.o precard.o rammng.o smppapi.o crd.o ppsmap.o ppsussd.o callingCardMsg.o callingCardState.o tariffApplication.o callMeBack.o freeSMS.o feeTransfer.o masterSlaveCard.o radius.o gprs.o vas.o restapi.o ocs_user_table.o pps_redis.o
|
||||
all:$(PROGS)
|
||||
#$(pps_OBJ)
|
||||
# executive file
|
||||
ppsm:$(pps_OBJ)
|
||||
@echo Linking $@
|
||||
@echo $(LINK_SUFFIX)
|
||||
# @$(LINK.c) -o $(PROGS) $(pps_OBJ) $(LINK_SUFFIX) -L../lib/ -lppsfuns -ldl -lz -lpopt -lncurses -lm
|
||||
|
||||
# obj files
|
||||
#ppsmain.o:ppsmain.c
|
||||
# $(COMPILE.c) -c ppsmain.c $(INCLUDES)
|
||||
capmsg.o:capmsg.c
|
||||
$(COMPILE.c) -c capmsg.c $(INCLUDES)
|
||||
|
||||
crd.o:crd.c
|
||||
$(COMPILE.c) -c crd.c $(INCLUDES)
|
||||
|
||||
dailyreport.o:dailyreport.c
|
||||
$(COMPILE.c) -c dailyreport.c $(INCLUDES)
|
||||
|
||||
loadtl.o:loadtl.c
|
||||
$(COMPILE.c) -c loadtl.c $(INCLUDES)
|
||||
|
||||
message.o:message.c
|
||||
$(COMPILE.c) -c message.c $(INCLUDES)
|
||||
|
||||
mfunc.o:mfunc.c
|
||||
$(COMPILE.c) -c mfunc.c $(INCLUDES)
|
||||
|
||||
ppsmap.o:ppsmap.c
|
||||
$(COMPILE.c) -c ppsmap.c $(INCLUDES)
|
||||
|
||||
ppsMibTable.o:ppsMibTable.c
|
||||
$(COMPILE.c) -c ppsMibTable.c $(INCLUDES)
|
||||
|
||||
ppsmib.o:ppsmib.c
|
||||
$(COMPILE.c) -c ppsmib.c $(INCLUDES)
|
||||
|
||||
ppsfunc.o:ppsfunc.c
|
||||
$(COMPILE.c) -c ppsfunc.c $(INCLUDES)
|
||||
|
||||
ppsm.o:ppsm.c
|
||||
$(COMPILE.c) -c ppsm.c $(INCLUDES)
|
||||
|
||||
precard.o:precard.c
|
||||
$(COMPILE.c) -c precard.c $(INCLUDES)
|
||||
|
||||
rammng.o:rammng.c
|
||||
$(COMPILE.c) -c rammng.c $(INCLUDES)
|
||||
|
||||
smppapi.o:smppapi.c
|
||||
$(COMPILE.c) -c smppapi.c $(INCLUDES)
|
||||
|
||||
ppsussd.o:ppsussd.c
|
||||
$(COMPILE.c) -c ppsussd.c $(INCLUDES)
|
||||
|
||||
callingCardMsg.o:callingCardMsg.c
|
||||
$(COMPILE.c) -c callingCardMsg.c $(INCLUDES)
|
||||
|
||||
callingCardState.o:callingCardState.c
|
||||
$(COMPILE.c) -c callingCardState.c $(INCLUDES)
|
||||
|
||||
|
||||
tariffApplication.o:tariffApplication.c
|
||||
$(COMPILE.c) -c tariffApplication.c $(INCLUDES)
|
||||
|
||||
callMeBack.o:callMeBack.c
|
||||
$(COMPILE.c) -c callMeBack.c $(INCLUDES)
|
||||
|
||||
freeSMS.o:freeSMS.c
|
||||
$(COMPILE.c) -c freeSMS.c $(INCLUDES)
|
||||
|
||||
feeTransfer.o:feeTransfer.c
|
||||
$(COMPILE.c) -c feeTransfer.c $(INCLUDES)
|
||||
|
||||
masterSlaveCard.o:masterSlaveCard.c
|
||||
$(COMPILE.c) -c masterSlaveCard.c $(INCLUDES)
|
||||
radius.o:radius.c
|
||||
$(COMPILE.c) -c radius.c $(INCLUDES)
|
||||
gprs.o:gprs.c
|
||||
$(COMPILE.c) -c gprs.c $(INCLUDES)
|
||||
vas.o:vas.c
|
||||
$(COMPILE.c) -c vas.c $(INCLUDES)
|
||||
restapi.o:restapi.c
|
||||
$(COMPILE.c) -c restapi.c $(INCLUDES)
|
||||
ocs_user_table.o:ocs_user_table.c
|
||||
$(COMPILE.c) -c ocs_user_table.c $(INCLUDES)
|
||||
pps_redis.o:pps_redis.c
|
||||
$(COMPILE.c) -c pps_redis.c $(INCLUDES)
|
||||
clean:
|
||||
rm -f *.c~ *.o core ppsm *.c.bak
|
||||
|
||||
@@ -56,13 +56,13 @@ void capMessageProc()
|
||||
PutLogFunID("capMessageProc");
|
||||
for(loop=0;loop<64;loop++)
|
||||
{
|
||||
if(!GetScfOpen(&capmsg)) // ��Open�����ж�ȡ��Ϣ�����ڵ���
|
||||
if(!GetScfOpen(&capmsg)) // 从Open队列中读取消息,定期调用
|
||||
break;
|
||||
if(capmsg.msgLength[0]==0 && capmsg.msgLength[1]==0) {// ��鳤�����Ƿ�> 0
|
||||
if(capmsg.msgLength[0]==0 && capmsg.msgLength[1]==0) {// 检查长度域是否> 0
|
||||
debugmib.display.proc_begin[6] ++;
|
||||
continue;
|
||||
}
|
||||
portid = AssignProcID(0);// ���䴦���˿�
|
||||
portid = AssignProcID(0);// 分配处理端口
|
||||
if( portid< MAX_FSM_PROCESS && portid>=0 )
|
||||
{
|
||||
AddPPSStatistics(MIBPPS_CAPOPEN,0);
|
||||
@@ -80,6 +80,7 @@ void capMessageProc()
|
||||
|
||||
tcap_change_local_ssn(dlgid, SSN_SCF, 0x92);
|
||||
|
||||
if(0)
|
||||
if((logMsgFlag & 0x04) || (logMsgFlag & 0x02))
|
||||
{
|
||||
DebugMsgDelimiter();
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 52
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf
|
||||
END
|
||||
ppsCrdConf.txt
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 67
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/ppsCrdConf.txt
|
||||
END
|
||||
map_operation.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 71
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/map_operation.conf
|
||||
END
|
||||
map_acn.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 65
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/map_acn.conf
|
||||
END
|
||||
help_page
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/help_page
|
||||
END
|
||||
ppsConf.txt
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 64
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/ppsConf.txt
|
||||
END
|
||||
xap_sysparam.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 70
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/xap_sysparam.conf
|
||||
END
|
||||
sccp.conf_omt
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 66
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/sccp.conf_omt
|
||||
END
|
||||
menu_page
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/menu_page
|
||||
END
|
||||
iptrans.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 65
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/iptrans.conf
|
||||
END
|
||||
wxc2_sys.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 66
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/wxc2_sys.conf
|
||||
END
|
||||
conv_prefix.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 69
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/conv_prefix.conf
|
||||
END
|
||||
mtp3.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/mtp3.conf
|
||||
END
|
||||
cap_operation.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 71
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/cap_operation.conf
|
||||
END
|
||||
cap_acn.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 65
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/cap_acn.conf
|
||||
END
|
||||
sccp.conf
|
||||
K 25
|
||||
svn:wc:ra_dav:version-url
|
||||
V 62
|
||||
/svn/wxc2/!svn/ver/1/trunk/R4S/mss/pps/src/main/conf/sccp.conf
|
||||
END
|
||||
@@ -0,0 +1,538 @@
|
||||
10
|
||||
|
||||
dir
|
||||
114
|
||||
http://172.25.201.20/svn/wxc2/trunk/R4S/mss/pps/src/main/conf
|
||||
http://172.25.201.20/svn/wxc2
|
||||
|
||||
|
||||
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
4a7aa47d-8bee-446f-9599-049dc37ff264
|
||||
|
||||
ppsCrdConf.txt
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.093750Z
|
||||
33217000814fb308373097dd6d015d55
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
10289
|
||||
|
||||
map_operation.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.109375Z
|
||||
bc4f58d51ae8fdff18b7ec71c18bfdd7
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2647
|
||||
|
||||
map_acn.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.109375Z
|
||||
c2eeff43e897f1191ff6dda1e51c31da
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1509
|
||||
|
||||
help_page
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.109375Z
|
||||
487a2b3a13e1b0077495bc54ad5d8df1
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
386
|
||||
|
||||
ppsConf.txt
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.140625Z
|
||||
8add96d879bffb4071178c299efd21f1
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
5040
|
||||
|
||||
xap_sysparam.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.187500Z
|
||||
07db917a0a4b0ccba0a5543d2c64f904
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
16
|
||||
|
||||
sccp.conf_omt
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.171875Z
|
||||
535e4352e3f516c242faa58bc866eb30
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
5361
|
||||
|
||||
menu_page
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.093750Z
|
||||
fed7c4dea77026a9421bd72171df6002
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
583
|
||||
|
||||
iptrans.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.125000Z
|
||||
b0b3666a5a447b7d63550fae7e1934f4
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
516
|
||||
|
||||
wxc2_sys.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.125000Z
|
||||
85ad7cc8ef48e2afa8eaeeeab97855ec
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
86
|
||||
|
||||
conv_prefix.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.140625Z
|
||||
789b365e94dc068bb5090f254a6bbd73
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
6976
|
||||
|
||||
mtp3.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.156250Z
|
||||
937821b810444c6fbd6a1365cb8330a0
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
95312
|
||||
|
||||
cap_operation.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.156250Z
|
||||
15cd724ea91b96d8c6ff14aee06b7bcf
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1200
|
||||
|
||||
cap_acn.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.171875Z
|
||||
6eb5596aab256989a2e072f0858b47c0
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
209
|
||||
|
||||
sccp.conf
|
||||
file
|
||||
|
||||
|
||||
|
||||
|
||||
2012-12-28T03:06:58.187500Z
|
||||
ae0e3a6cac430bf387542d641941deda
|
||||
2011-09-23T09:01:37.023785Z
|
||||
1
|
||||
xueqiang.sheng
|
||||
has-props
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1228
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,9 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 24
|
||||
application/octet-stream
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,9 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 24
|
||||
application/octet-stream
|
||||
END
|
||||
@@ -0,0 +1,9 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 24
|
||||
application/octet-stream
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,5 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
END
|
||||
@@ -0,0 +1,9 @@
|
||||
K 14
|
||||
svn:executable
|
||||
V 1
|
||||
*
|
||||
K 13
|
||||
svn:mime-type
|
||||
V 24
|
||||
application/octet-stream
|
||||
END
|
||||
@@ -0,0 +1,7 @@
|
||||
#application context name configure file for CAP
|
||||
total data length=3
|
||||
|
||||
#application context name data
|
||||
No.1:50 02 // gsmSSF to gsmSCF
|
||||
No.2:51 02 // assist handoff gsmSSF to gsmSCF
|
||||
No.3:52 02 // gsmSRF to gsmSCF
|
||||
@@ -0,0 +1,34 @@
|
||||
# operation code configure file for CAP
|
||||
total data length=30
|
||||
|
||||
#operation code
|
||||
No.1:00 02 5 // initial DP
|
||||
No.2:16 02 5 // assist request instructions
|
||||
No.3:17 02 20 // establish temporary connection
|
||||
No.4:18 04 5 // disconnect forward connection
|
||||
No.5:19 04 5 // connect to resource
|
||||
No.6:20 04 5 // connect
|
||||
No.7:22 04 5 // release call
|
||||
No.8:23 02 5 // request report BCSM event
|
||||
No.9:24 02 5 // event report BCSM
|
||||
No.10:31 04 5 // continue
|
||||
No.11:33 04 5 // reset timer
|
||||
No.12:34 04 5 // furnish charging information
|
||||
No.13:35 02 5 // apply charging
|
||||
No.14:36 04 5 // apply charging report
|
||||
No.15:44 04 5 // call information report
|
||||
No.16:45 04 5 // call information request
|
||||
No.17:46 04 5 // send charging information
|
||||
No.18:47 04 60 // play announcement
|
||||
No.19:48 01 60 // prompt and collect user information
|
||||
No.20:49 04 5 // specialized resource report
|
||||
No.21:53 02 5 // cancel
|
||||
No.22:55 01 5 // activity test
|
||||
No.23:60 02 5 // initial DPSMS
|
||||
No.24:61 02 5 // Furnishing charging info.SMS
|
||||
No.25:62 02 5 // connect DPSMS
|
||||
No.26:63 02 5 // request SMS event
|
||||
No.27:64 02 5 // event report SMS
|
||||
No.28:65 04 5 // continue SMS
|
||||
No.29:66 04 5 // release DPSMS
|
||||
No.30:67 02 5 // reset timer DPSMS
|
||||
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
|
||||
******************
|
||||
* HELP PAGE *
|
||||
******************
|
||||
|
||||
Welcome to DEBUG MONITOR.
|
||||
|
||||
Press 's' or 'S' to enter "SUB MODULE SELECTION PAGE".
|
||||
|
||||
In "SUB MODULE SELECTION PAGE",
|
||||
Press 'x' or 'X' to return "HELP PAGE",
|
||||
Press 'a-p' or 'A-P' to select sub module.
|
||||
|
||||
In each sub module,
|
||||
Press '0-9' and 'a-f' to select pages.
|
||||
$
|
||||
@@ -0,0 +1,30 @@
|
||||
#ipconfig
|
||||
#port=type,num,interface
|
||||
#type=UDP/TCP
|
||||
#num=0-6
|
||||
#interface=BUFFER/DIRECT
|
||||
|
||||
4950=UDP,6,DIRECT
|
||||
4951=UDP,0,BUFFER
|
||||
4952=UDP,0,BUFFER
|
||||
4953=UDP,3,BUFFER
|
||||
4954=UDP,3,BUFFER
|
||||
4955=UDP,3,BUFFER
|
||||
4956=UDP,0,BUFFER
|
||||
4957=UDP,4,BUFFER
|
||||
4958=UDP,0,BUFFER
|
||||
4959=UDP,0,BUFFER
|
||||
4960=UDP,0,BUFFER
|
||||
4961=UDP,0,BUFFER
|
||||
4962=UDP,0,BUFFER
|
||||
4963=UDP,0,BUFFER
|
||||
4964=UDP,0,BUFFER
|
||||
4965=TCP,2,BUFFER
|
||||
4966=UDP,0,BUFFER
|
||||
4967=UDP,0,BUFFER
|
||||
4968=UDP,0,BUFFER
|
||||
4969=UDP,0,BUFFER
|
||||
4970=UDP,0,BUFFER
|
||||
4971=UDP,2,BUFFER
|
||||
4972=UDP,0,BUFFER
|
||||
4973=UDP,0,BUFFER
|
||||
@@ -0,0 +1,40 @@
|
||||
#application context name configure file
|
||||
total data length=36
|
||||
|
||||
#application context name data
|
||||
No.1:01 03 // network location update
|
||||
No.2:02 03 // location cancel
|
||||
No.3:03 03 // roaming number enquiry
|
||||
No.4:05 03 // location info retrieval
|
||||
No.5:10 02 // reset context
|
||||
No.6:11 02 // handover control
|
||||
No.7:13 02 // equipment management
|
||||
No.8:14 02 // info retrieval
|
||||
No.9:15 02 // inter VLR info retrieval
|
||||
No.10:16 03 // subscriber data management
|
||||
No.11:17 03 // tracing
|
||||
No.12:18 02 // network functional SS
|
||||
No.13:19 02 // network unstructured SS
|
||||
No.14:20 03 // short message gateway
|
||||
No.15:21 03 // short message MO relay
|
||||
No.16:23 02 // short message alert
|
||||
No.17:24 03 // short message waiting data management
|
||||
No.18:25 03 // mobile terminating short message relay
|
||||
No.19:26 02 // imsi retrieval
|
||||
No.20:27 03 // MS purging
|
||||
No.21:28 03 // subscriber info enquiry
|
||||
No.22:29 03 // any time info enquiry
|
||||
No.23:06 03 // call control transfer
|
||||
No.24:36 03 // invocation notification
|
||||
No.25:12 03 // sIWFS allocation
|
||||
No.26:31 03 // group call control
|
||||
No.27:32 03 // GPRS location update
|
||||
No.28:33 03 // GPRS location info retrieval
|
||||
No.29:34 03 // failure report
|
||||
No.30:35 03 // GPRS notify
|
||||
No.31:07 03 // reporting
|
||||
No.32:08 03 // call completion
|
||||
No.33:200 02 // security triplets (MAP-H defined by Meng Xiaozhen)
|
||||
No.34:201 02 // subscriber interrogate (MAP-H defined by Meng Xiaozhen)
|
||||
No.35:202 02 // HLR subscriber management (MAP-H defined by Meng Xiaozhen)
|
||||
No.36:203 02 // HLR ping AUC (MAP-H defined by Meng Xiaozhen reserved)
|
||||
@@ -0,0 +1,66 @@
|
||||
# operation code configure file
|
||||
total data length=62
|
||||
|
||||
#operation code
|
||||
No.1:02 01 20 // update location
|
||||
No.2:03 01 10 // cancel location
|
||||
No.3:67 01 20 // purge mobile station
|
||||
No.4:55 01 05 // send identification
|
||||
No.5:68 01 20 // prepare handover
|
||||
No.6:29 03 108000 // send end signal
|
||||
No.7:33 04 05 // process access signalling
|
||||
No.8:34 04 05 // forward access signalling
|
||||
No.9:69 01 20 // prepare subsequent handover
|
||||
No.10:56 01 20 // send authentication info
|
||||
No.11:43 01 20 // check IMEI
|
||||
No.12:07 01 20 // insert subscriber data
|
||||
No.13:08 01 20 // delete subscriber data
|
||||
No.14:37 04 20 // reset
|
||||
No.15:38 04 20 // forward check ss indication
|
||||
No.16:57 01 20 // restore data
|
||||
No.17:50 01 20 // active trace mode
|
||||
No.18:51 01 20 // deactive trace mode
|
||||
No.19:58 01 20 // send imsi
|
||||
No.20:22 01 20 // send routing info
|
||||
No.21:04 01 20 // provide roaming number
|
||||
No.22:06 01 20 // resume call handling
|
||||
No.23:31 01 20 // provide SIWFS number
|
||||
No.24:32 01 20 // SIWFS signalling modify
|
||||
No.25:73 01 20 // set report state
|
||||
No.26:74 01 20 // status report
|
||||
No.27:75 01 60 // remote user free
|
||||
No.28:10 01 20 // register ss
|
||||
No.29:11 01 20 // erase ss
|
||||
No.30:12 01 20 // activate ss
|
||||
No.31:13 01 20 // deactivate ss
|
||||
No.32:14 01 20 // interrogate ss
|
||||
No.33:59 01 600 // process unstructure ss request
|
||||
No.34:60 01 60 // unstructure ss request
|
||||
No.35:61 01 60 // unstructure ss notify
|
||||
No.36:17 01 60 // register password
|
||||
No.37:18 03 20 // get password
|
||||
No.38:76 01 20 // register cc entry
|
||||
No.39:77 01 20 // erase cc entry
|
||||
No.40:45 01 20 // send routing info for sm
|
||||
No.41:46 01 60 // mo forward sm
|
||||
No.42:44 01 60 // mt forward sm
|
||||
No.43:47 01 05 // report sm delivery status
|
||||
No.44:63 04 05 // inform service centre
|
||||
No.45:64 01 05 // alert service center
|
||||
No.46:66 01 05 // ready for sm
|
||||
No.47:70 01 20 // provider subscriber info
|
||||
No.48:71 01 20 // any time interrogation
|
||||
No.49:72 01 20 // ss invocatin notification
|
||||
No.50:39 01 20 // prepare group call
|
||||
No.51:40 03 108000 // send group call end signal
|
||||
No.52:41 04 05 // process group call signalling
|
||||
No.53:42 04 05 // forward group call signalling
|
||||
No.54:23 01 20 // update GPRS location
|
||||
No.55:24 01 20 // send routing info for GPRS
|
||||
No.56:25 01 20 // failure report
|
||||
No.57:26 01 20 // note ms present for GPRS
|
||||
No.58:200 01 05 // security triplets (MAP-H defined by Meng Xiaozhen)
|
||||
No.59:201 01 05 // interrogate subscriber (MAP-H defined by Meng Xiaozhen)
|
||||
No.60:202 01 05 // hlr create subscriber (MAP-H defined by Meng Xiaozhen)
|
||||
No.61:203 01 05 // hlr delete subscriber (MAP-H defined by Meng Xiaozhen)
|
||||
No.62:204 01 05 // hlr ping auc (MAP-H defined by Meng Xiaozhen reserved)
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
*********************************
|
||||
* SUB MODULE SELECTION PAGE *
|
||||
*********************************
|
||||
|
||||
a -- IPTR i -- HLR
|
||||
b -- MTP3 j -- SMSC
|
||||
c -- SCCP k -- SCF
|
||||
d -- TCAP l -- SNMP
|
||||
e -- CAPP m -- DATA SYNC
|
||||
f -- CCF n -- DEBUG
|
||||
g -- VLR o -- reserved
|
||||
h -- SSF p -- reserved
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
#SCCP Config file (R8V0_09)
|
||||
|
||||
[Local Node]
|
||||
#ssn NetID msisdn ip0 ip1
|
||||
4 0 - 172.18.128.1 172.18.129.1
|
||||
6 0 86755900500 172.18.128.1 172.18.99.1
|
||||
8 0 2525950008 172.48.112.143 -
|
||||
9 0 86755900503 172.18.98.1 172.18.99.1
|
||||
10 0 86755900504 172.18.98.1 172.18.99.1
|
||||
11 0 86755900505 172.18.98.1 172.18.99.1
|
||||
19 0 8675557127005 172.18.136.1 172.18.137.1
|
||||
20 0 8675557127006 172.18.144.1 172.18.145.1
|
||||
146 0 2525950007 172.18.128.138 -
|
||||
147 0 2525950006 172.18.128.137 -
|
||||
254 0 - 172.18.98.1 172.18.99.1
|
||||
[GTT_Table]
|
||||
#No NP StartDigits EndDigits NI SPC SSN RI AI S E N Rep
|
||||
0 6 540015200020000 540015200029999 0 00003C 6 1 7
|
||||
1 1 4475588881000 4475588881999 0 00003C 6 1 7
|
||||
2 1 4475556000000 4475556000003 0 00003C 0 0 7
|
||||
3 1 86755900510 86755900510 3 030303 19 1 7
|
||||
4 6 460029000000000 460029000019999 0 000001 6 1 7
|
||||
5 1 86755900000 86755919999 0 000001 6 1 7
|
||||
|
||||
[RL_SSN]
|
||||
#NetID DPC SSN
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
#SCCP Config file (R8V0_04)
|
||||
|
||||
[Local Node]
|
||||
#ssn NetID msisdn ip0 ip1
|
||||
4 2 594694000006 172.18.128.1 172.18.129.1
|
||||
6 2 594694000002 172.18.98.1 172.18.99.1
|
||||
7 2 594694000005 172.18.98.1 172.18.99.1
|
||||
8 2 594694000001 172.18.98.1 172.18.99.1
|
||||
9 2 594694000007 172.18.98.1 172.18.99.1
|
||||
10 2 594694000008 172.18.98.1 172.18.99.1
|
||||
11 2 594694000000 172.18.98.1 172.18.99.1
|
||||
19 2 594694000009 172.18.98.1 172.18.99.1
|
||||
20 2 594694000010 172.18.98.1 172.18.99.1
|
||||
21 2 594694000011 172.18.128.1 172.18.129.1
|
||||
22 2 594694980012 172.18.100.1 172.18.101.1
|
||||
146 2 594694000004 172.18.98.1 172.18.99.1
|
||||
147 2 594694000003 172.18.98.1 172.18.99.1
|
||||
254 2 - 172.18.98.1 172.18.99.1
|
||||
[GTT_Table]
|
||||
#No NP StartDigits EndDigits NI SPC SSN RI AI S E N Rep
|
||||
0 6 340020000000000 340029999999999 2 001FD3 6 1 7
|
||||
2 1 594694001000 594694009998 2 001FD3 6 1 7
|
||||
3 1 594694460000 594694469998 2 001FD3 6 1 7
|
||||
4 1 594694471000 594694479998 2 001FD3 6 1 7
|
||||
5 1 594694980012 594694980012 2 000003 8 0 7
|
||||
6 1 594694980013 594694980013 2 000004 8 0 7
|
||||
7 1 338 338 2 000B03 0 0 6
|
||||
8 1 33609 33609 2 000B03 0 0 6
|
||||
9 1 33603 33608 2 000B03 0 0 6 1 1 1 3383
|
||||
10 1 33610 33629 2 000B03 0 0 6 1 1 1 3383
|
||||
11 1 5906900 5906902 2 000B03 0 0 6 1 1 1 3385
|
||||
12 1 262692 262692 2 000B03 0 0 6 1 1 1 3382
|
||||
13 1 352 352 2 000B03 0 0 6 1 1 1 3383
|
||||
14 1 33660 33660 2 000B03 0 0 6
|
||||
15 1 33662 33662 2 000B03 0 0 6
|
||||
16 6 208100000000000 208109999999999 2 000B03 6 0 6 1 5 7 33609
|
||||
26 1 594694000002 594694000002 2 001FD3 6 1 7
|
||||
28 1 5946941 5946941 2 000B03 0 0 6 1 1 1 3385
|
||||
29 1 594694480000 594694979999 2 000B03 0 0 6 1 1 1 3385
|
||||
30 7 5946940001000000 5946940001099999 2 001FD3 6 1 7 1 16 1 594694000002
|
||||
31 7 594694000100000 594694000199999 2 001FD3 6 1 7 1 15 1 594694000002
|
||||
34 1 5966960 5966961 2 000B03 0 0 6 1 1 1 3385
|
||||
37 1 59035 59035 2 000B03 0 0 6
|
||||
38 1 59669690 59669690 2 000B03 0 0 6
|
||||
41 1 59669620 59669649 2 000B03 0 0 6
|
||||
42 1 59069037 59069041 2 000B03 0 0 6
|
||||
43 1 59069030 59069035 2 000B03 0 0 6
|
||||
44 1 59069036 59069036 2 000B03 0 0 6 1 1 1 3385
|
||||
45 1 59069047 59069065 2 000B03 0 0 6
|
||||
46 1 59069067 59069068 2 000B03 0 0 6
|
||||
47 1 59069071 59069076 2 000B03 0 0 6
|
||||
48 1 59469420 59469426 2 000B03 0 0 6
|
||||
49 1 59469438 59469438 2 000B03 0 0 6
|
||||
50 1 59469440 59469445 2 000B03 0 0 6
|
||||
51 1 59669680 59669686 2 000B03 0 0 6
|
||||
52 1 59069066 59069066 2 000B03 0 0 6 1 1 1 3385
|
||||
54 1 59669699 59669699 2 000B03 0 0 6
|
||||
56 1 59069042 59069046 2 000B03 0 0 6 1 1 1 3385
|
||||
57 1 59069069 59069070 2 000B03 0 0 6 1 1 1 3385
|
||||
58 1 59069077 59069099 2 000B03 0 0 6 1 1 1 3385
|
||||
60 1 59669650 59669679 2 000B03 0 0 6
|
||||
61 1 59669691 59669698 2 000B03 0 0 6
|
||||
62 1 59469427 59469437 2 000B03 0 0 6 1 1 1 3385
|
||||
63 1 59469439 59469439 2 000B03 0 0 6 1 1 1 3385
|
||||
65 1 594694401000 594694409999 2 0000B3 0 0 6 1 1 1 3385
|
||||
70 6 746020000000000 746029999999999 2 000B03 0 0 6 1 5 7 59785
|
||||
71 1 597 597 2 000B03 0 0 6
|
||||
75 6 250020000000000 250029999999999 2 000B03 0 0 6 1 5 7 781296
|
||||
76 1 78 79 2 000B03 0 0 6
|
||||
78 6 2509900000000000 250999999999999 2 000B03 0 0 6 1 5 7 79037
|
||||
80 6 222100000000000 222109999999999 2 000B03 0 0 6 1 5 7 39349
|
||||
81 1 39 39 2 000B03 0 0 6
|
||||
85 6 738002000000000 738002999999999 2 000B03 0 0 6 1 6 7 592640
|
||||
86 1 592 592 2 000B03 0 0 6
|
||||
87 1 5926400001 5926400001 2 000B03 7 0 6
|
||||
90 6 338050000000000 338050999999999 2 000B03 0 0 6 1 6 7 187638
|
||||
91 1 18 18 2 000B03 0 0 6
|
||||
95 6 362510000000000 362519999999999 2 000B03 0 0 6 1 5 7 59952
|
||||
96 1 599 599 2 000B03 0 0 6
|
||||
98 6 4600000000000000 460009999999999 2 000B03 0 0 6 1 5 7 86139
|
||||
100 1 86 86 2 000B03 0 0 6
|
||||
102 6 724160000000000 7241699999999990 2 000B03 0 0 6 1 5 7 55016
|
||||
104 1 55 55 2 000B03 0 0 6
|
||||
|
||||
[RL_SSN]
|
||||
#NetID DPC SSN
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#system configure file
|
||||
|
||||
#IP info of wxc2
|
||||
pps-0=172.18.128.136;
|
||||
pps-1=172.18.128.137;
|
||||
Binary file not shown.
+380
-89
@@ -54,12 +54,12 @@ int SendDailyReportToPeerServerForStop();
|
||||
extern void SendOperatorRechargeCDR();
|
||||
extern int IsPromotionTime(COSTable *cosTableItem, struct timeval tvn);
|
||||
extern int smppSendAccountInfo();
|
||||
extern int smppSendMOSM(char *caller, char *called, u_char *msg,int msgLen,u_char dataCoding);
|
||||
extern int smppSendMOSM(char *called, char *caller, u_char *msg,int msgLen,u_char dataCoding);
|
||||
extern int CleanPPSUSSDStatisticsByDay();
|
||||
extern void resetPoolSlaveDaily(u_short head,u_short tail);
|
||||
extern int UseExternalVC();
|
||||
extern u_char *getSmsSentenceNative(u8 languageType,SMS_SENTENCE id);
|
||||
extern int subscribe_bundle_plan_send_used_up_info(char *caller_number, SMS_SENTENCE id, _state_data *shmp);
|
||||
extern int subscribe_bundle_plan_send_used_up_info(char *caller_number, SMS_SENTENCE id);
|
||||
extern char* ppsParseSentence(char *sentence, int varNum, char *varStr[]);
|
||||
/*----------------------------------------------*/
|
||||
void reportInit()
|
||||
@@ -293,12 +293,18 @@ int reportAccount(int segmentno)
|
||||
status = shmp->status;
|
||||
shmp->free_sm_counter = 0;
|
||||
shmp->gprsNotificationTimes = 0;
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
//rent chage for CUG service
|
||||
if(shmp->cug_id != NOT_CUG_ACCOUNT && shmp->crm_info.vas_cug_state == 0)
|
||||
{
|
||||
pps_send_rent_charge_to_crm(i, j);
|
||||
}
|
||||
}
|
||||
|
||||
pps_report.daily_report[index].account_report.total_num ++;
|
||||
pps_report.daily_report[index].account_report.total_balance =
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
// too many query in a tick if using balance of redis DB, TODO
|
||||
#endif
|
||||
totalBalance = totalBalance +
|
||||
shmp->balance +
|
||||
shmp->promo_balance;
|
||||
@@ -365,6 +371,9 @@ int reportPrepaidCard(int segmentno)
|
||||
if(UseExternalVC())
|
||||
return 1;
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
return 1;
|
||||
|
||||
now_day = (tvnow.tv_sec - timezone)/(24*3600);
|
||||
|
||||
for(i=0;i<MAX_CARD_SEGMENT;i++)
|
||||
@@ -415,6 +424,86 @@ int reportPrepaidCard(int segmentno)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef _ZED_NO_CALLER_NUM_AND_EXPIRY_DATE_ // ussd_code daily report
|
||||
extern int yx_ussd_daily_report;
|
||||
int GetUssdCodeDailyReportByIndex(u_char oidLen,DWORD *oid,
|
||||
u_char *pdata, BYTE *vartype)
|
||||
{
|
||||
int totalLen;
|
||||
int index,saveIndex;//,yesterdayIndex;
|
||||
int value=0,tag;
|
||||
char buf[256]="",tagbuf[16]="";
|
||||
_daily_report *shmp=NULL, *shmp_peer = NULL;
|
||||
ASN_BUF *asnbuf, asnbuf1;
|
||||
|
||||
PutLogFunID("GetUssdCodeDailyReportByIndex");
|
||||
asnbuf = &asnbuf1;
|
||||
AsnEncode(pdata,512,asnbuf);
|
||||
|
||||
index = oid[14];
|
||||
saveIndex = index %7;
|
||||
//yesterdayIndex = (saveIndex+7-1)%7;
|
||||
|
||||
shmp = &pps_report.daily_report[saveIndex];
|
||||
shmp_peer = &pps_report.peer_daily_report[saveIndex];
|
||||
|
||||
sprintf(buf,"%04d-%02d-%02d",
|
||||
shmp->year_month_day[0],
|
||||
shmp->year_month_day[1],
|
||||
shmp->year_month_day[2]);
|
||||
totalLen = add_tlv("1", 10, (u_char *)buf, 0x80, asnbuf);
|
||||
|
||||
PutLogFunID("GetDailyReportByIndex0");
|
||||
|
||||
strcpy(shmp->ussdcode_report[USSDCODE_TYPE_QUERY].code, USSDCODE_QUERY_CODE_STR);
|
||||
strcpy(shmp->ussdcode_report[USSDCODE_TYPE_TOPUP].code, USSDCODE_TOPUP_CODE_STR);
|
||||
strcpy(shmp->ussdcode_report[USSDCODE_TYPE_HOTLINE].code, USSDCODE_HOTLINE_CODE_STR);
|
||||
|
||||
int i=0, offset=2, tagPerCode=8, codeLen=0;
|
||||
for (i=0; i<USSDCODE_MAX_CODE_NUM; i++)
|
||||
{
|
||||
codeLen = strlen(shmp->ussdcode_report[i].code);
|
||||
if (codeLen <= 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
tag = offset + tagPerCode*i;
|
||||
sprintf(tagbuf,"%d",tag);
|
||||
totalLen = add_tlv(tagbuf, codeLen, (u_char *)shmp->ussdcode_report[i].code,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 1;
|
||||
value = shmp->ussdcode_report[i].req_count;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 2;
|
||||
value = shmp->ussdcode_report[i].req_duration;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 3;
|
||||
value = shmp->ussdcode_report[i].err_timeout_count;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 4;
|
||||
value = shmp->ussdcode_report[i].err_system_count;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 5;
|
||||
value = shmp->ussdcode_report[i].err_msg_count;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
}
|
||||
|
||||
PutLogFunID("GetUssdCodeDailyReportByIndex1");
|
||||
|
||||
//printfDailyLog(saveIndex);
|
||||
return totalLen;
|
||||
}
|
||||
#endif
|
||||
|
||||
int GetDailyReport(u_char oidLen, DWORD *oid, u_char *pdata, BYTE *vartype)
|
||||
{
|
||||
@@ -452,6 +541,18 @@ int GetDailyReport(u_char oidLen, DWORD *oid, u_char *pdata, BYTE *vartype)
|
||||
if(oid[14]>=pps_report.saveTail) return -1;
|
||||
return GetDailyReportByIndex(oidLen,oid,pdata,vartype);
|
||||
break;
|
||||
#if 0//def _ZED_NO_CALLER_NUM_AND_EXPIRY_DATE_ // ussd_code daily report
|
||||
case 0x04:
|
||||
if(oidLen<15){
|
||||
printf("error oid len: %d\n",oidLen);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// if(!masterFlag) return -1;
|
||||
if(oid[14]>=pps_report.saveTail) return -1;
|
||||
return GetUssdCodeDailyReportByIndex(oidLen,oid,pdata,vartype);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
break;
|
||||
@@ -539,7 +640,7 @@ int GetDailyReportByIndex(u_char oidLen,DWORD *oid,
|
||||
|
||||
PutLogFunID("GetDailyReportByIndex");
|
||||
asnbuf = &asnbuf1;
|
||||
AsnEncode(pdata,512,asnbuf);
|
||||
AsnEncode(pdata,1024,asnbuf);//512
|
||||
|
||||
index = oid[14];
|
||||
saveIndex = index %7;
|
||||
@@ -796,6 +897,72 @@ int GetDailyReportByIndex(u_char oidLen,DWORD *oid,
|
||||
totalLen = add_tlv(tagbuf,strlen(balancebuf), (u_char *)balancebuf,0x80,asnbuf);
|
||||
/*********************** VAS daily report **************************/
|
||||
|
||||
#ifdef _ZED_NO_CALLER_NUM_AND_EXPIRY_DATE_ // ussd_code daily report
|
||||
if (yx_ussd_daily_report == 0)
|
||||
{
|
||||
return totalLen;
|
||||
}
|
||||
int offset=86, tagPerCode=8, codeLen=0;
|
||||
for (i=0; i<USSDCODE_MAX_CODE_NUM; i++)
|
||||
{
|
||||
if (i==0)
|
||||
{
|
||||
strcpy(shmp->ussdcode_report[i].code, USSDCODE_QUERY_CODE_STR);
|
||||
}
|
||||
else if (i==1)
|
||||
{
|
||||
strcpy(shmp->ussdcode_report[i].code, USSDCODE_TOPUP_CODE_STR);
|
||||
}
|
||||
else if (i==2)
|
||||
{
|
||||
strcpy(shmp->ussdcode_report[i].code, USSDCODE_HOTLINE_CODE_STR);
|
||||
}
|
||||
codeLen = strlen(shmp->ussdcode_report[i].code);
|
||||
if (codeLen <= 0)
|
||||
{
|
||||
strcpy(shmp->ussdcode_report[i].code, "---");//continue;
|
||||
}
|
||||
|
||||
tag = offset + tagPerCode*i;
|
||||
sprintf(tagbuf,"%d",tag);
|
||||
totalLen = add_tlv(tagbuf, codeLen, (u_char *)shmp->ussdcode_report[i].code,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 1;
|
||||
value = shmp->ussdcode_report[i].req_count;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 2;
|
||||
value = shmp->ussdcode_report[i].req_duration;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 3;
|
||||
value = shmp->ussdcode_report[i].err_timeout_count;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 4;
|
||||
value = shmp->ussdcode_report[i].err_system_count;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 5;
|
||||
value = shmp->ussdcode_report[i].err_msg_count;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 6;
|
||||
value = 0;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
|
||||
tag = offset + tagPerCode*i + 7;
|
||||
value = 0;
|
||||
sprintf(tagbuf,"%d",tag++);
|
||||
totalLen = AddInteger(tagbuf,value,0x80,asnbuf);
|
||||
}
|
||||
#endif
|
||||
PutLogFunID("GetDailyReportByIndex2");
|
||||
|
||||
//printfDailyLog(saveIndex);
|
||||
@@ -1022,6 +1189,83 @@ int ReadDailyReportRequest(u_char oidLen,DWORD *oid,u_char *pdata,BYTE *vartype)
|
||||
return sizeof(_daily_report);
|
||||
}
|
||||
|
||||
#if _ZED_NO_CALLER_NUM_AND_EXPIRY_DATE_ // ussd_code daily report
|
||||
int pps_update_ussd_code_state(char *code, int type, int result, int dur)
|
||||
{
|
||||
_ussdcode_report *shmp = NULL;
|
||||
int index = pps_report.ptrTail % MAX_RECORDS_SAVED, i;
|
||||
switch (type)
|
||||
{
|
||||
case USSDCODE_TYPE_QUERY:
|
||||
shmp = &pps_report.daily_report[index].ussdcode_report[USSDCODE_TYPE_QUERY];
|
||||
break;
|
||||
case USSDCODE_TYPE_TOPUP:
|
||||
shmp = &pps_report.daily_report[index].ussdcode_report[USSDCODE_TYPE_TOPUP];
|
||||
break;
|
||||
case USSDCODE_TYPE_HOTLINE:
|
||||
shmp = &pps_report.daily_report[index].ussdcode_report[USSDCODE_TYPE_HOTLINE];
|
||||
break;
|
||||
case USSDCODE_TYPE_CHANNEL:
|
||||
for (i=USSDCODE_TYPE_CHANNEL; i<USSDCODE_MAX_CODE_NUM; i++)
|
||||
{
|
||||
if (pps_report.daily_report[index].ussdcode_report[i].code[0] == '\0')
|
||||
{
|
||||
strncpy(pps_report.daily_report[index].ussdcode_report[i].code, code, 3);
|
||||
shmp = &pps_report.daily_report[index].ussdcode_report[i];
|
||||
break;
|
||||
}
|
||||
else if (strncmp(pps_report.daily_report[index].ussdcode_report[i].code, code, 3) == 0)
|
||||
{
|
||||
shmp = &pps_report.daily_report[index].ussdcode_report[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (shmp == NULL)
|
||||
{
|
||||
return -1;// full?
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (result)
|
||||
{
|
||||
case USSDCODE_STAT_REQ:
|
||||
shmp->req_count++;
|
||||
break;
|
||||
case USSDCODE_STAT_DUR:
|
||||
shmp->req_duration += (dur / CYCLE_STATE_INTERVAL) +1;
|
||||
break;
|
||||
case USSDCODE_STAT_ERR_TIMEOUT:
|
||||
if (dur > 0)
|
||||
{
|
||||
shmp->req_duration += (dur / CYCLE_STATE_INTERVAL);
|
||||
}
|
||||
shmp->err_timeout_count ++;
|
||||
break;
|
||||
case USSDCODE_STAT_ERR_SYSTEM:
|
||||
if (dur > 0)
|
||||
{
|
||||
shmp->req_duration += (dur / CYCLE_STATE_INTERVAL);
|
||||
}
|
||||
shmp->err_system_count ++;
|
||||
break;
|
||||
case USSDCODE_STAT_ERR_MSG:
|
||||
if (dur > 0)
|
||||
{
|
||||
shmp->req_duration += (dur / CYCLE_STATE_INTERVAL);
|
||||
}
|
||||
shmp->err_msg_count ++;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
int GetDailyReportResponse(snmp_pdu *pdu, snmp_addr *addr)
|
||||
{
|
||||
|
||||
@@ -1132,15 +1376,123 @@ void PPSSendUserSMSNotification(int head, int tail,char *msgSend)
|
||||
0);
|
||||
}
|
||||
|
||||
extern int pps_crm_get_notify_days();
|
||||
extern int pps_crm_get_status_vd();
|
||||
extern void pps_send_update_subs_status_to_crm(_prepaid_info *user_ptr, int update_flag);
|
||||
int AccountExpiredDateCheck_crm(_prepaid_info *user_ptr, int instance)
|
||||
{
|
||||
int send_notify_days = pps_crm_get_notify_days();
|
||||
int status = user_ptr->status;
|
||||
int crm_update_user_status=0, crm_send_expired_notification=0;
|
||||
u_long expired_secs = user_ptr->mo_expiration_date;
|
||||
long status_changed_seconds = (30*24*3600);
|
||||
|
||||
if(user_ptr->crm_info.user_class == 0x02)//tourist
|
||||
{
|
||||
status_changed_seconds = (1*24*3600 );
|
||||
}
|
||||
else
|
||||
{
|
||||
int status_vd = pps_crm_get_status_vd();
|
||||
|
||||
if(status_vd>0)
|
||||
{
|
||||
status_changed_seconds = (status_vd * 24 * 3600);
|
||||
}
|
||||
}
|
||||
|
||||
switch(status)
|
||||
{
|
||||
case T_NORMAL:
|
||||
status_changed_seconds = 0;//status_changed_seconds;
|
||||
break;
|
||||
case T_SUSPEND:
|
||||
status_changed_seconds *= 1;
|
||||
break;
|
||||
case T_DISABLE:
|
||||
status_changed_seconds *= 2;
|
||||
break;
|
||||
}
|
||||
|
||||
if((expired_secs + status_changed_seconds )< tvnow.tv_sec)
|
||||
{
|
||||
crm_update_user_status = 1;
|
||||
}
|
||||
|
||||
if(status == T_NORMAL)
|
||||
{
|
||||
if( crm_update_user_status == 1)
|
||||
{
|
||||
user_ptr->status = T_SUSPEND;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(send_notify_days>=1)
|
||||
{
|
||||
if ((expired_secs > ( (send_notify_days-1)*24*3600 + tvnow.tv_sec)) && (expired_secs < ( send_notify_days*24*3600 + tvnow.tv_sec)))
|
||||
{
|
||||
crm_send_expired_notification = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(status == T_SUSPEND)
|
||||
{
|
||||
if( crm_update_user_status == 1)
|
||||
{
|
||||
user_ptr->status = T_DISABLE;
|
||||
}
|
||||
}
|
||||
else if(status == T_DISABLE)
|
||||
{
|
||||
if( crm_update_user_status == 1)
|
||||
{
|
||||
user_ptr->status = T_RELEASED;
|
||||
}
|
||||
}
|
||||
|
||||
// if(crm_update_user_status )
|
||||
// user_ptr->mo_expiration_date = tvnow.tv_sec;
|
||||
|
||||
if(!masterFlag) return 0;
|
||||
|
||||
if(crm_update_user_status )
|
||||
{
|
||||
pps_send_update_subs_status_to_crm(user_ptr, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(crm_send_expired_notification)
|
||||
{
|
||||
pps_send_update_subs_status_to_crm(user_ptr, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if(user_ptr->status == T_RELEASED)
|
||||
//if(status == T_DISABLE)
|
||||
{
|
||||
char msisdn[32];
|
||||
int len = user_ptr->msisdn[MAX_MSISDN_BLEN-1];
|
||||
BcdToAscii(msisdn, user_ptr->msisdn,(MAX_MSISDN_BLEN-1)*2);
|
||||
msisdn[len] = 0;
|
||||
|
||||
DebugMsg(debugmib.display.asciiOut,"%s.%d try to delete RELEASED account: msisdn=%s, instance=%d",
|
||||
__FUNCTION__, __LINE__, msisdn, instance);
|
||||
|
||||
SendAccountRealSync(instance,0.0,0.0,OMC_OCODE_DEL);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int AccountExpiredDateCheck()
|
||||
{
|
||||
static u_long LatchIndex=0;
|
||||
int i,j ,balance,cos_id;//,storeIndex;
|
||||
u_short status=0,expiredFlag = 0;
|
||||
int i, j, balance, cos_id, storeIndex;
|
||||
u_short status=0, expiredFlag = 0;
|
||||
int len;
|
||||
char caller_number[32];
|
||||
|
||||
int crm_update_user_status=0;
|
||||
COSTable *cosTableItem;
|
||||
PutLogFunID("AccountExpiredDateCheck");
|
||||
|
||||
@@ -1153,7 +1505,7 @@ int AccountExpiredDateCheck()
|
||||
|
||||
i=LatchIndex/UNIT_STORE_ACCOUNT;
|
||||
j=LatchIndex%UNIT_STORE_ACCOUNT;
|
||||
//storeIndex = LatchIndex;
|
||||
storeIndex = LatchIndex;
|
||||
if(LatchIndex ++>=MSISDN_HEAD_NUM*UNIT_STORE_ACCOUNT)
|
||||
{
|
||||
return 0;// LatchIndex = 0;
|
||||
@@ -1164,6 +1516,9 @@ int AccountExpiredDateCheck()
|
||||
status = ramshm_ptr->prepaid_data.prepaid_info[i][j].status;
|
||||
if(status == T_FRESH) return 1;
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
return AccountExpiredDateCheck_crm(&ramshm_ptr->prepaid_data.prepaid_info[i][j], storeIndex);
|
||||
|
||||
cos_id = ramshm_ptr->prepaid_data.prepaid_info[i][j].cos_id%MaxCosTableItem;
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cos_id];
|
||||
|
||||
@@ -1183,23 +1538,13 @@ int AccountExpiredDateCheck()
|
||||
if(expiredFlag)
|
||||
{
|
||||
ramshm_ptr->prepaid_data.prepaid_info[i][j].status = T_RELEASED;
|
||||
crm_update_user_status = 1;
|
||||
|
||||
if(cosTableItem->accountValidity[0].actionAfterDaysKeepingAnExpiredAccount)
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserField(&ramshm_ptr->prepaid_data.prepaid_info[i][j], &usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
if(usr_redis.usr_balance > 0)
|
||||
#else
|
||||
if(ramshm_ptr->prepaid_data.prepaid_info[i][j].balance>0)
|
||||
#endif
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
balance = usr_redis.usr_balance;
|
||||
usr_redis.usr_balance = 0.0;
|
||||
RedisUpdateUserField(&usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
#else
|
||||
balance = ramshm_ptr->prepaid_data.prepaid_info[i][j].balance;
|
||||
#endif
|
||||
ramshm_ptr->prepaid_data.prepaid_info[i][j].balance = 0;
|
||||
if(masterFlag)
|
||||
{
|
||||
@@ -1215,24 +1560,16 @@ int AccountExpiredDateCheck()
|
||||
else if(ramshm_ptr->prepaid_data.prepaid_info[i][j].mt_expiration_date<tvnow.tv_sec)
|
||||
{
|
||||
if(status != T_BLACKLIST)
|
||||
{
|
||||
ramshm_ptr->prepaid_data.prepaid_info[i][j].status = T_SUSPEND;
|
||||
crm_update_user_status = 1;
|
||||
|
||||
}
|
||||
if(cosTableItem->accountValidity[0].actionWhenAccountExpires)
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserField(&ramshm_ptr->prepaid_data.prepaid_info[i][j], &usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
if(usr_redis.usr_balance > 0)
|
||||
#else
|
||||
if(ramshm_ptr->prepaid_data.prepaid_info[i][j].balance>0)
|
||||
#endif
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
balance = usr_redis.usr_balance;
|
||||
usr_redis.usr_balance = 0.0;
|
||||
RedisUpdateUserField(&usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
#else
|
||||
balance = ramshm_ptr->prepaid_data.prepaid_info[i][j].balance;
|
||||
#endif
|
||||
ramshm_ptr->prepaid_data.prepaid_info[i][j].balance = 0;
|
||||
if(masterFlag)
|
||||
{
|
||||
@@ -1249,21 +1586,10 @@ int AccountExpiredDateCheck()
|
||||
if(ramshm_ptr->prepaid_data.prepaid_info[i][j].promo_date<
|
||||
tvnow.tv_sec)
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserField(&ramshm_ptr->prepaid_data.prepaid_info[i][j], &usr_redis, OCS_REDIS_FIELD_PROMO_BALANCE);
|
||||
if(usr_redis.pro_balance > 0)
|
||||
#else
|
||||
|
||||
if(ramshm_ptr->prepaid_data.prepaid_info[i][j].promo_balance >0)
|
||||
#endif
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
balance = usr_redis.pro_balance;
|
||||
usr_redis.pro_balance = 0.0;
|
||||
RedisUpdateUserField(&usr_redis, OCS_REDIS_FIELD_PROMO_BALANCE);
|
||||
#else
|
||||
balance = ramshm_ptr->prepaid_data.prepaid_info[i][j].promo_balance;
|
||||
#endif
|
||||
balance = ramshm_ptr->prepaid_data.prepaid_info[i][j].promo_balance;
|
||||
ramshm_ptr->prepaid_data.prepaid_info[i][j].promo_balance = 0;
|
||||
if(masterFlag)
|
||||
SendOperatorRechargeCDR(i,j,-balance);
|
||||
@@ -1279,22 +1605,20 @@ int AccountExpiredDateCheck()
|
||||
BcdToAscii(caller_number, ramshm_ptr->prepaid_data.prepaid_info[i][j].msisdn, (MAX_MSISDN_BLEN-1)*2);
|
||||
caller_number[len ] = '\0';
|
||||
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserInfo(&ramshm_ptr->prepaid_data.prepaid_info[i][j], &usr_redis);
|
||||
RedisClearUserBundle(&usr_redis);
|
||||
if (usr_redis.data > 0)
|
||||
#else
|
||||
if (ramshm_ptr->prepaid_data.prepaid_info[i][j].bundle_info.data > 0)
|
||||
#endif
|
||||
{
|
||||
subscribe_bundle_plan_send_used_up_info(caller_number, SMS_BUNDLE_PLAN_DATA_USEDUP, NULL);
|
||||
subscribe_bundle_plan_send_used_up_info(caller_number, SMS_BUNDLE_PLAN_DATA_USEDUP);
|
||||
}
|
||||
|
||||
memset(&ramshm_ptr->prepaid_data.prepaid_info[i][j].bundle_info, 0x00, sizeof(_bundle_info));
|
||||
}
|
||||
}
|
||||
|
||||
if(crm_update_user_status )
|
||||
{
|
||||
if(OCS_with_external_CRM())
|
||||
pps_send_update_subs_status_to_crm(&ramshm_ptr->prepaid_data.prepaid_info[i][j], 1);
|
||||
}
|
||||
status = ramshm_ptr->prepaid_data.prepaid_info[i][j].status;
|
||||
if(status != T_NORMAL) return 1;
|
||||
|
||||
@@ -1324,18 +1648,12 @@ int AccountLatchFlagCheck(int head, int tail)
|
||||
if(ramshm_ptr->prepaid_data.prepaid_info[i][j].msisdn[9]<MIN_MSISDN_ALEN)
|
||||
return 0;
|
||||
|
||||
|
||||
cos_id = ramshm_ptr->prepaid_data.prepaid_info[i][j].cos_id%MaxCosTableItem;
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cos_id];
|
||||
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserBalance(&ramshm_ptr->prepaid_data.prepaid_info[i][j], &usr_redis);
|
||||
if(usr_redis.usr_balance <
|
||||
cosTableItem->smsNotificationInquiry[0].insufficientBalanceThreshold)
|
||||
#else
|
||||
if(ramshm_ptr->prepaid_data.prepaid_info[i][j].balance<
|
||||
cosTableItem->smsNotificationInquiry[0].insufficientBalanceThreshold)
|
||||
#endif
|
||||
{
|
||||
if(cosTableItem->smsNotificationInquiry[0].smsNotificationWhenBalanceInsufficient)
|
||||
if(!(ramshm_ptr->prepaid_data.prepaid_info[i][j].latch_flag & 0x01))
|
||||
@@ -1367,24 +1685,6 @@ int AccountLatchFlagCheck(int head, int tail)
|
||||
}
|
||||
|
||||
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
#else
|
||||
if(ramshm_ptr->prepaid_data.prepaid_info[i][j].promo_balance<
|
||||
cosTableItem->smsNotificationInquiry[0].insufficientPromotionThreshold*100.0)
|
||||
#endif
|
||||
{
|
||||
if(cosTableItem->smsNotificationInquiry[0].smsNotificationWhenPromotionInsufficient)
|
||||
if(!(ramshm_ptr->prepaid_data.prepaid_info[i][j].latch_flag & 0x04))
|
||||
{
|
||||
ramshm_ptr->prepaid_data.prepaid_info[i][j].latch_flag |=0x04;
|
||||
smPromptFlag = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ramshm_ptr->prepaid_data.prepaid_info[i][j].latch_flag &=0xFB;
|
||||
}
|
||||
|
||||
if(smPromptFlag )
|
||||
{
|
||||
len = ramshm_ptr->prepaid_data.prepaid_info[i][j].msisdn[9];
|
||||
@@ -1410,21 +1710,12 @@ int AccountLatchFlagCheck(int head, int tail)
|
||||
AsciiTime(promotion_expire_date,
|
||||
ramshm_ptr->prepaid_data.prepaid_info[i][j].promo_date);
|
||||
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
smppSendAccountInfo(msisdn,
|
||||
ppsParam.ppsTables.serviceNumber[ScratchCardRechargeNumberPosition].number,
|
||||
(long)usr_redis.usr_balance,expire_date,
|
||||
(long)usr_redis.pro_balance,promotion_expire_date,
|
||||
0,"","",
|
||||
(0x80 | ramshm_ptr->prepaid_data.prepaid_info[i][j].language_type ));
|
||||
#else
|
||||
smppSendAccountInfo(msisdn,
|
||||
ppsParam.ppsTables.serviceNumber[ScratchCardRechargeNumberPosition].number,
|
||||
(long)ramshm_ptr->prepaid_data.prepaid_info[i][j].balance,expire_date,
|
||||
(long)ramshm_ptr->prepaid_data.prepaid_info[i][j].promo_balance,promotion_expire_date,
|
||||
0,"","",
|
||||
(0x80 | ramshm_ptr->prepaid_data.prepaid_info[i][j].language_type ));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ enum transfer_mode{
|
||||
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)
|
||||
|
||||
/*inline */u8 getTransferState(u_short portid)
|
||||
u8 getTransferState(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
|
||||
@@ -98,7 +98,7 @@ enum transfer_mode{
|
||||
return shmp->process_info.ppsService.feeTransfer.state;
|
||||
}
|
||||
|
||||
/*inline */void playPromptAndCollectVoice(u_short portid,u_short voiceID,u8 inputLen)
|
||||
void playPromptAndCollectVoice(u_short portid,u_short voiceID,u8 inputLen)
|
||||
{
|
||||
_state_data *shmp;
|
||||
|
||||
@@ -114,7 +114,7 @@ enum transfer_mode{
|
||||
SendPromptAndCollectUserInfo(portid);
|
||||
}
|
||||
|
||||
/*inline */void playPromptVoice(u_short portid,u_short voiceID)
|
||||
void playPromptVoice(u_short portid,u_short voiceID)
|
||||
{
|
||||
_state_data *shmp;
|
||||
|
||||
@@ -486,15 +486,7 @@ int GetBalanceWithOutPromotion(int head, int tail)
|
||||
PutLogFunID("getBalanceWithOutPromotion");
|
||||
|
||||
if (head < MSISDN_HEAD_NUM && tail < UNIT_STORE_ACCOUNT)
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserBalance(&shmp->prepaid_info[head][tail], &usr_redis);
|
||||
return usr_redis.usr_balance;
|
||||
#else
|
||||
return shmp->prepaid_info[head][tail].balance;
|
||||
#endif
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
@@ -576,7 +568,7 @@ static int expieredDaysTransfer(_account_info *callerInfo,_account_info *destInf
|
||||
_prepaid_info *pcalled,*pcaller;
|
||||
|
||||
if(get_not_change_transfer_expiry_date())
|
||||
return 1;
|
||||
{return 1;}
|
||||
|
||||
pcalled = &prepaidPoint->prepaid_info[destInfo->head][destInfo->tail];
|
||||
pcaller = &prepaidPoint->prepaid_info[callerInfo->head][callerInfo->tail];
|
||||
@@ -617,40 +609,17 @@ int poolTransferAccount(_account_info *callerInfo,_account_info *destInfo,float
|
||||
}
|
||||
|
||||
pcalled = &prepaidPoint->prepaid_info[destInfo->head][destInfo->tail];
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis called_redis;
|
||||
RedisGetUserBalance(pcalled, &called_redis);
|
||||
oldCalledBalance = called_redis.usr_balance;
|
||||
oldCalledPromo = called_redis.pro_balance;
|
||||
pcalled->balance = called_redis.usr_balance;
|
||||
pcalled->promo_balance = called_redis.pro_balance;
|
||||
#else
|
||||
oldCalledBalance = pcalled->balance;
|
||||
oldCalledPromo = pcalled->promo_balance;
|
||||
#endif
|
||||
pcaller = &prepaidPoint->prepaid_info[callerInfo->head][callerInfo->tail];
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis caller_redis;
|
||||
RedisGetUserBalance(pcaller, &caller_redis);
|
||||
oldCallerBalance = caller_redis.usr_balance;
|
||||
oldCallerPromo = caller_redis.pro_balance;
|
||||
pcaller->balance = caller_redis.usr_balance;
|
||||
pcaller->promo_balance = caller_redis.pro_balance;
|
||||
#else
|
||||
oldCallerBalance = pcaller->balance;
|
||||
oldCallerPromo = pcaller->promo_balance;
|
||||
#endif
|
||||
|
||||
if(isPromotionCanBeTransfered(callerInfo) == FALSE)
|
||||
{
|
||||
expieredDaysTransfer(callerInfo,destInfo,transferedFee,0);
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
called_redis.usr_balance += transferedFee;
|
||||
caller_redis.usr_balance -= transferedFee;
|
||||
#else
|
||||
pcalled->balance += transferedFee;
|
||||
pcaller->balance -= transferedFee;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -662,48 +631,19 @@ int poolTransferAccount(_account_info *callerInfo,_account_info *destInfo,float
|
||||
if(balanceExpired == TRUE)
|
||||
{
|
||||
expieredDaysTransfer(callerInfo,destInfo,0,transferedFee);
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
called_redis.pro_balance += transferedFee;
|
||||
caller_redis.pro_balance -= transferedFee;
|
||||
#else
|
||||
pcalled->promo_balance += transferedFee;
|
||||
pcaller->promo_balance -= transferedFee;
|
||||
#endif
|
||||
}
|
||||
else if(promotionExpired == TRUE)
|
||||
{
|
||||
expieredDaysTransfer(callerInfo,destInfo,transferedFee,0);
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
called_redis.usr_balance += transferedFee;
|
||||
caller_redis.usr_balance -= transferedFee;
|
||||
#else
|
||||
pcalled->balance += transferedFee;
|
||||
pcaller->balance -= transferedFee;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isPromotionFirstTransfered(callerInfo) == FALSE)
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
if(transferedFee > caller_redis.usr_balance)
|
||||
{
|
||||
diff = transferedFee - caller_redis.usr_balance;
|
||||
expieredDaysTransfer(callerInfo,destInfo,transferedFee - diff,diff);
|
||||
called_redis.usr_balance += transferedFee - diff;
|
||||
caller_redis.usr_balance = 0;
|
||||
called_redis.pro_balance += diff;
|
||||
caller_redis.pro_balance -= diff;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
expieredDaysTransfer(callerInfo,destInfo,transferedFee,0);
|
||||
called_redis.usr_balance += transferedFee;
|
||||
caller_redis.usr_balance -= transferedFee;
|
||||
|
||||
}
|
||||
#else
|
||||
if(transferedFee > pcaller->balance)
|
||||
{
|
||||
diff = transferedFee - pcaller->balance;
|
||||
@@ -721,28 +661,9 @@ int poolTransferAccount(_account_info *callerInfo,_account_info *destInfo,float
|
||||
pcaller->balance -= transferedFee;
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if(isPromotionFirstTransfered(callerInfo) == TRUE)
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
if(transferedFee > caller_redis.pro_balance)
|
||||
{
|
||||
diff = transferedFee - caller_redis.pro_balance;
|
||||
expieredDaysTransfer(callerInfo,destInfo,diff,transferedFee - diff);
|
||||
called_redis.pro_balance += transferedFee - diff;
|
||||
caller_redis.pro_balance = 0;
|
||||
called_redis.usr_balance += diff;
|
||||
caller_redis.usr_balance -= diff;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
expieredDaysTransfer(callerInfo,destInfo,0,transferedFee);
|
||||
called_redis.pro_balance += transferedFee;
|
||||
caller_redis.pro_balance -= transferedFee;
|
||||
}
|
||||
#else
|
||||
if(transferedFee > pcaller->promo_balance)
|
||||
{
|
||||
diff = transferedFee - pcaller->promo_balance;
|
||||
@@ -759,19 +680,12 @@ int poolTransferAccount(_account_info *callerInfo,_account_info *destInfo,float
|
||||
pcalled->promo_balance += transferedFee;
|
||||
pcaller->promo_balance -= transferedFee;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
UpdateAccountStatus(destInfo->head, destInfo->tail, T_NORMAL);
|
||||
instance = destInfo->head * UNIT_STORE_ACCOUNT + destInfo->tail;
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
RedisUpdateUserBalance(&called_redis);
|
||||
RedisUpdateUserBalance(&caller_redis);
|
||||
if(called_redis.usr_balance >= 0)
|
||||
#else
|
||||
if(pcalled->balance >= 0)
|
||||
#endif
|
||||
{
|
||||
UpdateAccountOverdraft(destInfo->head, destInfo->tail, 0);
|
||||
}
|
||||
@@ -1559,14 +1473,14 @@ static int SendTransferExpiredAccountRequest(u_short portid,u8 ussdSmsFlag)
|
||||
static int SendTransferInfoConfirmRequest(u_short portid,u8 ussdSmsFlag)
|
||||
{
|
||||
_state_data *shmp;
|
||||
TRANSFER_FEE *transferInfo;
|
||||
//TRANSFER_FEE *transferInfo;
|
||||
float balance;
|
||||
u_char tmp[MAX_SMS_LEN*4] = {0}, /*tmpbuf[64]={0}, */buf[MAX_SMS_LEN*2]={0};
|
||||
char tmpCaller[32],tmpCalled[32];
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
shmp += portid;
|
||||
transferInfo = &shmp->process_info.ppsService.feeTransfer;
|
||||
//transferInfo = &shmp->process_info.ppsService.feeTransfer;
|
||||
|
||||
strcpy((char *)tmp, (char *)getSmsSentenceNative(0,SMS_WILL_TRANSFER_OUT));
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ extern _ram_data *ramshm_ptr;
|
||||
extern _state_machine *smshm_ptr;;
|
||||
extern _tariff_private *blf_shmp;
|
||||
|
||||
extern inline _prepaid_info *getPrepaidInfo(_account_info *account);
|
||||
extern _prepaid_info *getPrepaidInfo(_account_info *account);
|
||||
|
||||
#define FREE_SMS_ACTIVE 0x01
|
||||
#define FREE_SMS_DEACTIVE 0xFE
|
||||
@@ -184,17 +184,17 @@ static int isFreeServiceDaysDeductable(_prepaid_info *prepaidInfo)
|
||||
|
||||
void freeServiceDaysDeduct(u_short head,u_short tail)
|
||||
{
|
||||
u8 cosID=0,len;
|
||||
COSTable *cosTableItem;
|
||||
u8 len;//cosID=0,
|
||||
//COSTable *cosTableItem;
|
||||
_prepaid_data *shmp=&ramshm_ptr->prepaid_data;
|
||||
_prepaid_info *userData;
|
||||
u_char destNumber[32]={0};
|
||||
|
||||
userData = &shmp->prepaid_info[head][tail];
|
||||
cosID = userData->cos_id;
|
||||
//cosID = userData->cos_id;
|
||||
if(isFreeServiceActived(userData)== TRUE && isFreeServiceDaysDeductable(userData) == TRUE)
|
||||
{
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cosID];
|
||||
//cosTableItem = &ppsParam.ppsTables.cosTable[cosID];
|
||||
userData->freeSMSActiveDays--;
|
||||
if(userData->freeSMSActiveDays <= 0)
|
||||
{
|
||||
@@ -368,21 +368,10 @@ static int activteCharge(_state_data *shmp)
|
||||
if(tariff_id>=MAX_ZONE_NUM || tariff_id<0)
|
||||
tariff_id = 0;
|
||||
amount = blf_shmp->comm_tariff[tariff_id].activeFreeSMSCharegeAmount;
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserField(&ramshm_ptr->prepaid_data.prepaid_info[head][tail], &usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
if((usr_redis.usr_balance + ptr->overdraft) - amount < 0)
|
||||
#else
|
||||
if((ptr->balance + ptr->overdraft) - amount < 0)
|
||||
#endif
|
||||
return -2;
|
||||
enableUserRentFlag(ptr);
|
||||
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
ptr->balance = usr_redis.usr_balance;
|
||||
usr_redis.usr_balance -= amount;
|
||||
RedisUpdateUserField(&usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
#endif
|
||||
ptr->balance -= amount;
|
||||
SendManualOperationCDR(&shmp->caller_info,&shmp->called_info,-amount);
|
||||
return amount;
|
||||
@@ -410,22 +399,11 @@ static int deactivteCharge(_state_data *shmp)
|
||||
if(tariff_id>=MAX_ZONE_NUM || tariff_id<0)
|
||||
tariff_id = 0;
|
||||
amount = blf_shmp->comm_tariff[tariff_id].deactiveFreeSMSCharegeAmount;
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserField(&ramshm_ptr->prepaid_data.prepaid_info[head][tail], &usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
if((usr_redis.usr_balance + ptr->overdraft) - amount < 0)
|
||||
#else
|
||||
if((ptr->balance + ptr->overdraft) - amount < 0)
|
||||
#endif
|
||||
return -2;
|
||||
disableUserRentFlag(ptr);
|
||||
|
||||
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
ptr->balance = usr_redis.usr_balance;
|
||||
usr_redis.usr_balance -= amount;
|
||||
RedisUpdateUserField(&usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
#endif
|
||||
ptr->balance -= amount;
|
||||
SendManualOperationCDR(&shmp->caller_info,&shmp->called_info,-amount);
|
||||
return amount;
|
||||
|
||||
+244
-283
@@ -29,7 +29,7 @@
|
||||
#define MAX_VQ_BYTES_EACH_TIME_POST (1024*1024*5)/* 5MB */
|
||||
#define MAX_VTH_BYTES_DIFF_POST (1024*1024*1)/*1MB */
|
||||
|
||||
#define MAX_BYTES_PER_SESSION (((long long)10)*1024*1024*1024)/* 10G */
|
||||
#define MAX_BYTES_PER_SESSION (((long long)100)*1024*1024*1024)/* 10G */
|
||||
|
||||
#define pps_set_gprs_state(val) do { \
|
||||
gprsProc->state = val; \
|
||||
@@ -189,40 +189,11 @@ int pps_get_gprs_inactive_timer(_state_data *shmp)
|
||||
|
||||
radiusItem = getCosRadiusItem(&shmp->caller_info);
|
||||
if(radiusItem->inactiveSessionLimit <= 0)
|
||||
return 0;
|
||||
return 900;
|
||||
return radiusItem->inactiveSessionLimit;
|
||||
|
||||
}
|
||||
|
||||
int pps_get_quota_holding_timer(_state_data *shmp)
|
||||
{
|
||||
PPS_COS_RADIUS_ITEM *radiusItem;
|
||||
|
||||
radiusItem = getCosRadiusItem(&shmp->caller_info);
|
||||
if(radiusItem->maxDurationQuotaEachTime <= 0)
|
||||
return 0;
|
||||
return (radiusItem->maxDurationQuotaEachTime);
|
||||
}
|
||||
|
||||
ulong pps_get_cos_quota(_state_data *shmp)
|
||||
{
|
||||
PPS_COS_RADIUS_ITEM *radiusItem;
|
||||
|
||||
radiusItem = getCosRadiusItem(&shmp->caller_info);
|
||||
if(radiusItem->maxVolumeQuotaEachTime <= 0)
|
||||
return (5*1024*1024);
|
||||
return (radiusItem->maxVolumeQuotaEachTime);
|
||||
}
|
||||
|
||||
ulong pps_get_volume_threshold(_state_data *shmp)
|
||||
{
|
||||
PPS_COS_RADIUS_ITEM *radiusItem;
|
||||
|
||||
radiusItem = getCosRadiusItem(&shmp->caller_info);
|
||||
if(radiusItem->volumeThresholdDiff <= 0)
|
||||
return 0;
|
||||
return (radiusItem->volumeThresholdDiff);
|
||||
}
|
||||
|
||||
BOOL isAccessTimeout(_state_data *shmp)
|
||||
{
|
||||
@@ -616,7 +587,7 @@ static BOOL isGprsRoaming(_state_data *shmp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void getGprsCapInfo(u_char cap_flag, _account_info *ptr,long long *gprsVolume,double *gprsCharged)
|
||||
void getGprsCapInfo(_account_info *ptr,long long *gprsVolume,double *gprsCharged)
|
||||
{
|
||||
_prepaid_data *shmp=&ramshm_ptr->prepaid_data;
|
||||
|
||||
@@ -624,21 +595,8 @@ void getGprsCapInfo(u_char cap_flag, _account_info *ptr,long long *gprsVolume,do
|
||||
|
||||
if (ptr->head < MSISDN_HEAD_NUM && ptr->tail < UNIT_STORE_ACCOUNT)
|
||||
{
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
if(cap_flag==1) /* int net */
|
||||
{
|
||||
*gprsVolume = shmp->prepaid_info[ptr->head][ptr->tail].gprsVolume;
|
||||
*gprsCharged = shmp->prepaid_info[ptr->head][ptr->tail].gprsBalance;
|
||||
}
|
||||
else /* out net */
|
||||
{
|
||||
*gprsVolume = shmp->prepaid_info[ptr->head][ptr->tail].out_net_cap_gprsVolume;
|
||||
*gprsCharged = shmp->prepaid_info[ptr->head][ptr->tail].out_net_cap_gprsBalance;
|
||||
}
|
||||
#else
|
||||
*gprsVolume = shmp->prepaid_info[ptr->head][ptr->tail].gprsVolume;
|
||||
*gprsCharged = shmp->prepaid_info[ptr->head][ptr->tail].gprsBalance;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -664,22 +622,9 @@ int GetGprsCapTariffID(_state_data *shmp)
|
||||
|
||||
radiusItem = getCosRadiusItem(&shmp->caller_info);
|
||||
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
int loop, cap_plan = 0;
|
||||
for(loop=0;loop<MaxGprsCapPlan;loop++)
|
||||
{
|
||||
if(shmp->process_info.cap_flag == (loop%2+1))
|
||||
{
|
||||
cap_plan = loop;
|
||||
break;
|
||||
}
|
||||
}
|
||||
shmp->process_info.cap_plan = cap_plan;
|
||||
capPlanPtr = &radiusItem->capPlan[cap_plan];
|
||||
#else
|
||||
capPlanPtr = &radiusItem->capPlan[0];
|
||||
#endif
|
||||
getGprsCapInfo(shmp->process_info.cap_flag, &shmp->caller_info,&gprsVolume,&gprsCharged);// Get CAP GPRS volume & balance from user profile
|
||||
|
||||
getGprsCapInfo(&shmp->caller_info,&gprsVolume,&gprsCharged);// Get CAP GPRS volume & balance from user profile
|
||||
if(gprsVolume<0 || gprsVolume>4000000000000LL) gprsVolume = 0;
|
||||
if(gprsCharged<0) gprsCharged = 0;
|
||||
|
||||
@@ -746,19 +691,15 @@ int GetGprsCapTariffID(_state_data *shmp)
|
||||
|
||||
static _gprs_tariff *getGprsVolumeTariffWithRoamAndCap(_state_data *shmp)
|
||||
{
|
||||
_gprs_process *gprsProc;
|
||||
_gprs_tariff *tariff;
|
||||
int tariffID;
|
||||
COSTable *cosTableItem;
|
||||
CosServiceControl *serviceControlItem = NULL;
|
||||
int cosID;
|
||||
#ifndef HAS_BUNDLE_ROAMING
|
||||
_gprs_process *gprsProc;
|
||||
PPS_COS_RADIUS_ITEM *radiusItem;
|
||||
#endif
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
//shmp->process_info.cap_flag = 0;
|
||||
tariffID = shmp->caller_info.location;// charged by cos:0 or cgi:1
|
||||
#else
|
||||
COSTable *cosTableItem;
|
||||
int cosID;
|
||||
|
||||
shmp->process_info.cap_flag = 0;
|
||||
|
||||
radiusItem = getCosRadiusItem(&shmp->caller_info); // user profile ==> cos ID ==> Radius Item
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
|
||||
@@ -790,53 +731,13 @@ static _gprs_tariff *getGprsVolumeTariffWithRoamAndCap(_state_data *shmp)
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cosID];
|
||||
tariffID = cosTableItem->tariff[0].moTariffID%MAX_ZONE_NUM;
|
||||
//}
|
||||
#endif
|
||||
|
||||
tariff = &blf_shmp->gprs_tariff[tariffID][0];
|
||||
if(tariff->destIp == 0)
|
||||
{
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]invalid gprs tariff:%d",shmp->process_info.portid,tariff->tariffID);
|
||||
return NULL;
|
||||
}
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
shmp->process_info.cap_flag = tariff->cap_flag;//shmp->process_info.tariff.cap_flag;
|
||||
/* Check Cap or Bundle is used================================
|
||||
cosID = shmp->caller_info.cos_id;
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cosID];
|
||||
serviceControlItem = &cosTableItem->serviceControl[0];
|
||||
if(serviceControlItem->cap_or_bundle_in_tariff)// bundle is used, so we can set bundle flag and clear cap flag
|
||||
{
|
||||
shmp->process_info.bundle_flag = shmp->process_info.cap_flag; // cap flag is reused as bundle call
|
||||
shmp->process_info.cap_flag = 0;
|
||||
}*/
|
||||
//==================================================
|
||||
|
||||
/*if(shmp->process_info.cap_flag>0)
|
||||
{
|
||||
tariffID = GetGprsCapTariffID(shmp);
|
||||
if(tariffID >= 0)
|
||||
{
|
||||
tariff = &blf_shmp->gprs_tariff[tariffID][0];
|
||||
if(tariff->destIp == 0)
|
||||
{
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]invalid gprs tariff:%d",shmp->process_info.portid,tariff->tariffID);
|
||||
return NULL;
|
||||
}
|
||||
shmp->process_info.cap_flag = tariff->cap_flag;
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]Cap plan,charged by tariff id:%d",shmp->process_info.portid,tariff->tariffID);
|
||||
}
|
||||
else
|
||||
{
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]charged by cap plan error,no releated cap point",shmp->process_info.portid);
|
||||
return NULL;
|
||||
}
|
||||
return tariff;
|
||||
}
|
||||
else*/
|
||||
{
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]Normal,charged by tariff id:%d",shmp->process_info.portid,tariff->tariffID);
|
||||
return tariff;
|
||||
}
|
||||
#else
|
||||
if(tariff->cap_flag)
|
||||
{
|
||||
tariffID = GetGprsCapTariffID(shmp);
|
||||
@@ -863,7 +764,6 @@ static _gprs_tariff *getGprsVolumeTariffWithRoamAndCap(_state_data *shmp)
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]Normal,charged by tariff id:%d",shmp->process_info.portid,tariff->tariffID);
|
||||
return tariff;
|
||||
}
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -871,7 +771,7 @@ static _gprs_tariff *getGprsVolumeTariffWithRoamAndCap(_state_data *shmp)
|
||||
static void CheckGprsCAPSMSNotification(_state_data *staPtr, _account_info *accountPtr, u_char cos_id,
|
||||
float charge, int amount ) /* cap_type: 0=volume, 1=charged */
|
||||
{
|
||||
int cap_plan,cap_seg, notifyFlag=0;
|
||||
int cap_seg, notifyFlag=0;//cap_plan,
|
||||
float c_threshold=0;
|
||||
_prepaid_info *subPtr=NULL;
|
||||
|
||||
@@ -884,18 +784,14 @@ static void CheckGprsCAPSMSNotification(_state_data *staPtr, _account_info *acco
|
||||
if(staPtr->process_info.cap_notify_flag) /* already send notification SM in this call */
|
||||
return;
|
||||
|
||||
cap_plan = staPtr->process_info.cap_plan;
|
||||
//cap_plan = staPtr->process_info.cap_plan;
|
||||
cap_seg = staPtr->process_info.cap_seg;
|
||||
if((cap_seg>=3) || (cap_plan>=MaxGprsCapPlan)) return; /* reach the last CAP segment */
|
||||
if(cap_seg>=3) return; /* reach the last CAP segment */
|
||||
|
||||
subPtr = &ramshm_ptr->prepaid_data.prepaid_info[accountPtr->head][accountPtr->tail];
|
||||
|
||||
cosTableItem = &ppsParam.ppsTables.cosTable[cos_id];
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
capPlanPtr = &cosTableItem->gprs[0].capPlan[cap_plan];
|
||||
#else
|
||||
capPlanPtr = &cosTableItem->gprs[0].capPlan[0];
|
||||
#endif
|
||||
|
||||
gprsVolume = subPtr->gprsVolume;
|
||||
if(gprsVolume<0 || gprsVolume>4000000000000LL)
|
||||
@@ -988,50 +884,6 @@ static void UpdateGprsBundleInfo(_account_info *ptr,float charge, long long amou
|
||||
subPtr->gprsBalance += charge;
|
||||
}
|
||||
*/
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetBundleInfo(subPtr, &usr_redis);
|
||||
usr_redis.data += amount;
|
||||
if (usr_redis.data <=0)
|
||||
{
|
||||
usr_redis.data = 0;
|
||||
}
|
||||
|
||||
if (usr_redis.validity_date < tvnow.tv_sec)
|
||||
{
|
||||
usr_redis.data = 0;
|
||||
}
|
||||
RedisUpdateUserField(&usr_redis, OCS_REDIS_FIELD_BUNDLE_DATA);
|
||||
subPtr->bundle_info.data = usr_redis.data;
|
||||
#else
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
if(sta_ptr->process_info.bundle_flag == BUNDLE_HOME_PLMN)
|
||||
{
|
||||
subPtr->bundle_info.data += amount;
|
||||
if (subPtr->bundle_info.data <=0)
|
||||
{
|
||||
subPtr->bundle_info.data = 0;
|
||||
}
|
||||
|
||||
if (subPtr->bundle_info.validity_date < tvnow.tv_sec)
|
||||
{
|
||||
subPtr->bundle_info.data = 0;
|
||||
}
|
||||
}
|
||||
else if(sta_ptr->process_info.bundle_flag == BUNDLE_OTHER_NETWORK)
|
||||
{
|
||||
subPtr->bundle_roam.data += amount;
|
||||
if (subPtr->bundle_roam.data <=0)
|
||||
{
|
||||
subPtr->bundle_roam.data = 0;
|
||||
}
|
||||
|
||||
if (subPtr->bundle_roam.validity_date < tvnow.tv_sec)
|
||||
{
|
||||
subPtr->bundle_roam.data = 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
subPtr->bundle_info.data += amount;
|
||||
if (subPtr->bundle_info.data <=0)
|
||||
{
|
||||
@@ -1042,8 +894,6 @@ static void UpdateGprsBundleInfo(_account_info *ptr,float charge, long long amou
|
||||
{
|
||||
subPtr->bundle_info.data = 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1068,32 +918,6 @@ static void UpdateGprsCapInfo(_account_info *ptr,float charge, long long amount,
|
||||
{// If reach next cap, send notification or not.
|
||||
CheckGprsCAPSMSNotification(sta_ptr,ptr,cos_id,charge, amount);
|
||||
}
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
if (sta_ptr->process_info.cap_flag == 1)// in net
|
||||
{
|
||||
cap_type = cosTableItem->gprs[0].capPlan[0].type;
|
||||
if(cap_type==0)/* volume */
|
||||
{
|
||||
subPtr->gprsVolume += amount;
|
||||
}
|
||||
else
|
||||
{
|
||||
subPtr->gprsBalance += charge;
|
||||
}
|
||||
}
|
||||
else if (sta_ptr->process_info.cap_flag == 2)// out net
|
||||
{
|
||||
cap_type = cosTableItem->gprs[0].capPlan[1].type;
|
||||
if(cap_type==0)/* volume */
|
||||
{
|
||||
subPtr->out_net_cap_gprsVolume += amount;
|
||||
}
|
||||
else
|
||||
{
|
||||
subPtr->out_net_cap_gprsBalance += charge;
|
||||
}
|
||||
}
|
||||
#else
|
||||
cap_type = cosTableItem->gprs[0].capPlan[0].type;
|
||||
if(cap_type==0)/* volume */
|
||||
{
|
||||
@@ -1103,7 +927,6 @@ static void UpdateGprsCapInfo(_account_info *ptr,float charge, long long amount,
|
||||
{
|
||||
subPtr->gprsBalance += charge;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1402,19 +1225,12 @@ static void refund(_account_info *ptr, float refundFee,CHARGED_FEE *chargeFee)
|
||||
}
|
||||
chargeFee->balance = refundBalance;
|
||||
chargeFee->promotion= refundPromotioin;
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserBalance(&shmp->prepaid_info[ptr->head][ptr->tail], &usr_redis);
|
||||
usr_redis.usr_balance += refundBalance;
|
||||
usr_redis.pro_balance += refundPromotioin;
|
||||
RedisUpdateUserField(&usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
shmp->prepaid_info[ptr->head][ptr->tail].promo_balance = usr_redis.pro_balance;
|
||||
shmp->prepaid_info[ptr->head][ptr->tail].balance = usr_redis.usr_balance;
|
||||
#else
|
||||
shmp->prepaid_info[ptr->head][ptr->tail].promo_balance += refundPromotioin;
|
||||
shmp->prepaid_info[ptr->head][ptr->tail].balance += refundBalance;
|
||||
#endif
|
||||
|
||||
if(refundBalance <= ppsParam.serviceControl.maxBalance)
|
||||
shmp->prepaid_info[ptr->head][ptr->tail].balance += refundBalance;
|
||||
if(shmp->prepaid_info[ptr->head][ptr->tail].balance < 0)
|
||||
shmp->prepaid_info[ptr->head][ptr->tail].balance = 0;
|
||||
|
||||
increPoolChildCharged(ptr,-(refundBalance+refundPromotioin));
|
||||
debugmib.display.totalCharge -= refundBalance+refundPromotioin;
|
||||
}
|
||||
@@ -1423,7 +1239,7 @@ static int firstAccessAcceptRefund(_state_data *shmp)
|
||||
{
|
||||
_gprs_process *gprsProc;
|
||||
_gprs_tariff *tariff;
|
||||
PPS_COS_RADIUS_ITEM *radiusItem;
|
||||
//PPS_COS_RADIUS_ITEM *radiusItem;
|
||||
long long refundBytes;
|
||||
float refundFee;//,basicFee;
|
||||
float discount;
|
||||
@@ -1432,10 +1248,13 @@ static int firstAccessAcceptRefund(_state_data *shmp)
|
||||
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
|
||||
radiusItem = getCosRadiusItem(&shmp->caller_info);
|
||||
//radiusItem = getCosRadiusItem(&shmp->caller_info);
|
||||
tariff = gprsProc->gprsTariff;
|
||||
discount = gprsProc->discount;
|
||||
|
||||
if(tariff->basicFee == 0 || (discount == 0 && shmp->process_info.cap_flag==0))
|
||||
return 0;
|
||||
|
||||
if(getReportedBytes(shmp) <= MINI_CHARGED_BYTES)
|
||||
{
|
||||
refundBytes = gprsProc->vqConsumed.integer - MINI_CHARGED_BYTES;
|
||||
@@ -1491,6 +1310,9 @@ static int otherAccessAcceptRefund(_state_data *shmp)
|
||||
gprsProc->vqConsumed.integer -= refundBytes;
|
||||
tariff = gprsProc->gprsTariff;
|
||||
discount = gprsProc->discount;
|
||||
|
||||
if(tariff->basicFee == 0 || (discount == 0 && shmp->process_info.cap_flag==0))
|
||||
return 0;
|
||||
|
||||
refundFee = (refundBytes/BYTES_PER_BASIC_FEE)*tariff->basicFee*discount;
|
||||
|
||||
@@ -1841,10 +1663,32 @@ void SendGprsCDR(_account_info *caller_info,_state_data *shmp)
|
||||
ulong duration,volume;
|
||||
_gprs_process *gprsProc;
|
||||
struct in_addr nas_addr;
|
||||
|
||||
long long consumed_data_value=0;
|
||||
|
||||
PutLogFunID("SendGprsCDR");
|
||||
|
||||
if(shmp == NULL)
|
||||
return;
|
||||
|
||||
if(caller_info->charge < 0.0)
|
||||
return;
|
||||
if(caller_info->charge > 1000000.00)
|
||||
return;
|
||||
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
|
||||
if(0)
|
||||
{
|
||||
consumed_data_value = gprsProc->vqConsumed.integer;
|
||||
}
|
||||
if(1)
|
||||
{
|
||||
consumed_data_value = gprsProc->dqConsumed;
|
||||
}
|
||||
|
||||
if( consumed_data_value == 0)
|
||||
return;
|
||||
|
||||
memset(&pcdr,0,sizeof(_tocdr_report));
|
||||
|
||||
head = caller_info->head;
|
||||
@@ -1852,12 +1696,11 @@ void SendGprsCDR(_account_info *caller_info,_state_data *shmp)
|
||||
|
||||
pcdr.mtype = MO_CDR_TYPE;
|
||||
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
if (gprsProc->vqConsumed.integer < 0)
|
||||
if (consumed_data_value < 0)
|
||||
{
|
||||
pcdr.type[0] = CT_GPRS_REFUND;// add a new cdr type for GPRS refund
|
||||
pcdr.type[1] = CT_GPRS_REFUND>>8;
|
||||
gprsProc->vqConsumed.integer = -gprsProc->vqConsumed.integer;
|
||||
consumed_data_value = -consumed_data_value;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1877,10 +1720,10 @@ void SendGprsCDR(_account_info *caller_info,_state_data *shmp)
|
||||
memcpy(pcdr.duration,&duration,4);
|
||||
|
||||
charge = caller_info->charge;
|
||||
charge = abs(charge + 0.5);
|
||||
memcpy(pcdr.charge,&charge,4);
|
||||
balance = (int) (GetAccountBalance(head, tail) + 0.5);
|
||||
memcpy(pcdr.balance,&balance,4);
|
||||
charge = (int)(charge + 0.5);// ceil ==> int
|
||||
memcpy(pcdr.charge,&charge,4);
|
||||
balance = (int) (GetAccountBalance(head, tail) + 0.5);
|
||||
memcpy(pcdr.balance,&balance,4);
|
||||
|
||||
GetAccountMsisdn(head,tail,&pcdr.msisdn[1]);
|
||||
ByteRev(pcdr.msisdn,9,0);
|
||||
@@ -1899,7 +1742,7 @@ void SendGprsCDR(_account_info *caller_info,_state_data *shmp)
|
||||
nas_addr.s_addr = gprsProc->destIP;
|
||||
sprintf((char *)pcdr.gprsDestIP, "%s",inet_ntoa(nas_addr));
|
||||
|
||||
volume = (gprsProc->vqConsumed.integer+BYTES_PER_KB-1) >> 10;
|
||||
volume = (consumed_data_value+BYTES_PER_KB-1) >> 10;
|
||||
pcdr.gprsVolume[0] = volume >> 24;
|
||||
pcdr.gprsVolume[1] = volume >> 16;
|
||||
pcdr.gprsVolume[2] = volume >> 8;
|
||||
@@ -1907,17 +1750,19 @@ void SendGprsCDR(_account_info *caller_info,_state_data *shmp)
|
||||
|
||||
pcdr.tcos[0] = NORMAL_CLEARING%256;
|
||||
|
||||
memcpy(pcdr.plan_id, &shmp->process_info.rest_if.plan_id, 4);
|
||||
|
||||
GprsCDRStatistics(&pcdr,charge,volume);
|
||||
StoreCDR(&pcdr);
|
||||
pps_real_update_user_file(head, tail);
|
||||
sendGprsSessionInfo(shmp,gprsProc->vqConsumed.integer,duration,charge);
|
||||
sendGprsSessionInfo(shmp,consumed_data_value,duration,charge);
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]%s send gprs cdr",shmp->process_info.portid ,caller_info->number);
|
||||
}
|
||||
|
||||
int allocate_ps_data_volume_quota(_state_data *shmp, char *failReason)
|
||||
int allocate_ps_data_volume_quota(_state_data *shmp, char *failReason)
|
||||
{
|
||||
_gprs_process *gprsProc;
|
||||
_gprs_tariff *tariff;
|
||||
_gprs_tariff *tariff, gprsTariff;
|
||||
float balance,chargedThisTime,quotaCharged;
|
||||
float basicFee = 0.0;
|
||||
float discount;
|
||||
@@ -1951,26 +1796,72 @@ int allocate_ps_data_volume_quota(_state_data *shmp, char *failReason)
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d] Max volume(10G) per session reached",shmp->process_info.portid);
|
||||
return -3;
|
||||
}
|
||||
|
||||
tariff = getGprsVolumeTariffWithRoamAndCap(shmp);// read Gprs tariff
|
||||
if(tariff == NULL)
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
strcpy(failReason,"no gprs tariff assigned");
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]no gprs tariff assigned",shmp->process_info.portid);
|
||||
return -4;
|
||||
#ifdef OCS_USE_REDIS_DB// get tariff and bundle
|
||||
pps_send_query_tariff_req(shmp->process_info.portid);
|
||||
#endif
|
||||
if(shmp->process_info.rest_if.query_tariff_status == 3)
|
||||
{
|
||||
strcpy(failReason,"no gprs tariff assigned");
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]no gprs tariff assigned",shmp->process_info.portid);
|
||||
|
||||
#ifndef OCS_USE_REDIS_DB
|
||||
pps_send_query_tariff_req(shmp->process_info.portid);
|
||||
#endif
|
||||
return -4;
|
||||
}
|
||||
memset(&gprsTariff, 0x00, sizeof(_gprs_tariff));
|
||||
tariff = gprsProc->gprsTariff = &gprsTariff;
|
||||
gprsProc->gprsTariff->chargeUnit = shmp->process_info.rest_if.unit/1024;
|
||||
gprsProc->gprsTariff->basicFee = shmp->process_info.rest_if.unit_charge;
|
||||
discount = shmp->process_info.rest_if.tariff_discount;
|
||||
gprsProc->discount = discount;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
gprsProc->gprsTariff = tariff;
|
||||
gprsProc->destIP = tariff->destIp;
|
||||
#ifndef HAS_BUNDLE_ROAMING
|
||||
shmp->process_info.cap_flag = tariff->cap_flag;
|
||||
tariff = getGprsVolumeTariffWithRoamAndCap(shmp);// read Gprs tariff
|
||||
if(tariff == NULL)
|
||||
{
|
||||
strcpy(failReason,"no gprs tariff assigned");
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]no gprs tariff assigned",shmp->process_info.portid);
|
||||
return -4;
|
||||
}
|
||||
else
|
||||
{
|
||||
gprsProc->gprsTariff = tariff;
|
||||
gprsProc->destIP = tariff->destIp;
|
||||
}
|
||||
}
|
||||
|
||||
max_quota_bytes = pps_get_quota_per_request(); //MAX_VQ_BYTES_EACH_TIME_POST;// Quota for every CCR request
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
if(shmp->process_info.rest_if.total_plan_value > 0)
|
||||
left_bundle_volume = shmp->process_info.rest_if.total_plan_value - shmp->process_info.rest_if.used_plan_value;
|
||||
if(left_bundle_volume<=0)
|
||||
{
|
||||
left_bundle_volume = 0;
|
||||
shmp->process_info.bundle_flag = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
shmp->process_info.bundle_flag = 1;
|
||||
if(left_bundle_volume>max_quota_bytes)
|
||||
left_bundle_volume = max_quota_bytes ;
|
||||
shmp->process_info.rest_if.used_plan_value += left_bundle_volume;
|
||||
shmp->process_info.rest_if.plan_value_add_this_time = left_bundle_volume;
|
||||
pps_send_update_plan_value_req(shmp->process_info.portid);
|
||||
}
|
||||
#ifndef OCS_USE_REDIS_DB
|
||||
pps_send_query_tariff_req(shmp->process_info.portid);//get next tariff
|
||||
#endif
|
||||
}
|
||||
|
||||
max_quota_bytes = pps_get_cos_quota(shmp);//pps_get_quota_per_request(); //MAX_VQ_BYTES_EACH_TIME_POST;// Quota for every CCR request
|
||||
|
||||
left_bundle_volume = pps_get_account_bundle_data(shmp);// remain volume in bundle of user
|
||||
else
|
||||
left_bundle_volume = pps_get_account_bundle_data(shmp);// remain volume in bundle of user
|
||||
|
||||
if(left_bundle_volume > 0)
|
||||
{
|
||||
@@ -1980,10 +1871,7 @@ int allocate_ps_data_volume_quota(_state_data *shmp, char *failReason)
|
||||
}
|
||||
|
||||
basicFee = 0;// use bundle, do not charge other way
|
||||
shmp->process_info.bundle_flag = shmp->process_info.cap_flag;// bundle identifier
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
shmp->process_info.cap_flag = 0;
|
||||
#endif
|
||||
shmp->process_info.bundle_flag = 1;// bundle identifier
|
||||
|
||||
subscribe_bundle_plan_send_warning_info(shmp);// low bundle reach threshold(<2048K), send SMS notification
|
||||
}
|
||||
@@ -2002,21 +1890,24 @@ int allocate_ps_data_volume_quota(_state_data *shmp, char *failReason)
|
||||
gprsProc->vqAllocatedThisTime = 0;
|
||||
shmp->process_info.bundle_flag = 0;
|
||||
|
||||
subscribe_bundle_plan_send_used_up_info((char *)shmp->caller_info.number, SMS_BUNDLE_PLAN_DATA_USEDUP, shmp);
|
||||
subscribe_bundle_plan_send_used_up_info((char *)shmp->caller_info.number, SMS_BUNDLE_PLAN_DATA_USEDUP);
|
||||
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]Bundle data is used up!",shmp->process_info.portid );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(shmp->process_info.ro_if.request_type == RT_INITIAL_REQUEST)
|
||||
if(1)//no need to allocate non-charged small quote
|
||||
{
|
||||
max_quota_bytes = pps_get_cos_quota(shmp);//pps_get_postpaid_quota_for_first_request();
|
||||
shmp->process_info.ro_if.post_charge = 1;
|
||||
if(shmp->process_info.ro_if.request_type == RT_INITIAL_REQUEST)
|
||||
{
|
||||
max_quota_bytes = pps_get_postpaid_quota_for_first_request();
|
||||
shmp->process_info.ro_if.post_charge = 1;
|
||||
}
|
||||
else
|
||||
shmp->process_info.ro_if.post_charge = 0;
|
||||
}
|
||||
else
|
||||
shmp->process_info.ro_if.post_charge = 0;
|
||||
|
||||
|
||||
basicFee = tariff->basicFee;
|
||||
|
||||
shmp->process_info.bundle_flag = 0;
|
||||
@@ -2036,13 +1927,16 @@ int allocate_ps_data_volume_quota(_state_data *shmp, char *failReason)
|
||||
memset(chargedFee,0,sizeof(CHARGED_FEE));
|
||||
chargedThisTime = 0;
|
||||
quotaCharged = 0;
|
||||
discount = (float)GetDiscount(tvnow.tv_sec,tariff->discountID)/100;
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
discount = shmp->process_info.rest_if.tariff_discount/100;
|
||||
else
|
||||
discount = (float)GetDiscount(tvnow.tv_sec,tariff->discountID)/100;
|
||||
|
||||
quotaCharged = ((max_quota_bytes+BYTES_PER_BASIC_FEE-1)/BYTES_PER_BASIC_FEE)*basicFee*discount;
|
||||
//quotaCharged = ((max_quota_bytes+BYTES_PER_BASIC_FEE-1)/BYTES_PER_BASIC_FEE)*basicFee*discount;
|
||||
quotaCharged = (max_quota_bytes*basicFee*discount)/BYTES_PER_BASIC_FEE;
|
||||
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]tariff:need allocate:%lld bytes,bascic fee:%0.4f,discount:%0.4f,bundle data=%lld",
|
||||
shmp->process_info.portid ,max_quota_bytes, basicFee,discount, left_bundle_volume);
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]tariff:need allocate:%lld bytes,bascic fee:%0.4f,discount:%0.4f,bundle data=%lld,quotaCharged:%.4f",
|
||||
shmp->process_info.portid ,max_quota_bytes, basicFee,discount, left_bundle_volume,quotaCharged);
|
||||
|
||||
if(balance >= quotaCharged)
|
||||
{
|
||||
@@ -2052,20 +1946,30 @@ int allocate_ps_data_volume_quota(_state_data *shmp, char *failReason)
|
||||
}
|
||||
else
|
||||
{
|
||||
long long extraBytes;
|
||||
float extraCharged;
|
||||
|
||||
extraCharged = balance/discount;
|
||||
extraBytes = (extraCharged/tariff->basicFee)*BYTES_PER_BASIC_FEE;
|
||||
gprsProc->vqAllocated.integer += extraBytes;
|
||||
gprsProc->vqAllocated.exponent = 0;
|
||||
gprsProc->vthAllocated.integer = 0;
|
||||
gprsProc->vthAllocated.exponent = 0;
|
||||
chargedThisTime = balance;
|
||||
quotaBytes = extraBytes;
|
||||
if(0)
|
||||
{
|
||||
long long extraBytes;
|
||||
float extraCharged;
|
||||
|
||||
shmp->process_info.ro_if.post_charge = 0;
|
||||
extraCharged = balance/discount;
|
||||
extraBytes = (extraCharged/tariff->basicFee)*BYTES_PER_BASIC_FEE;
|
||||
gprsProc->vqAllocated.integer += extraBytes;
|
||||
gprsProc->vqAllocated.exponent = 0;
|
||||
gprsProc->vthAllocated.integer = 0;
|
||||
gprsProc->vthAllocated.exponent = 0;
|
||||
chargedThisTime = balance;
|
||||
quotaBytes = extraBytes;
|
||||
|
||||
shmp->process_info.ro_if.post_charge = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(failReason,"low fee");
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]low fee for a minu charge",
|
||||
shmp->process_info.portid);
|
||||
return -5;
|
||||
}
|
||||
}
|
||||
|
||||
gprsProc->discount = discount;
|
||||
@@ -2092,6 +1996,7 @@ int allocate_ps_data_volume_quota(_state_data *shmp, char *failReason)
|
||||
instance = shmp->caller_info.head * UNIT_STORE_ACCOUNT + shmp->caller_info.tail;
|
||||
SendAccountRealSync(instance,chargedFee->balance,chargedFee->promotion,OMC_OCODE_EDIT);// dual platform sync
|
||||
}
|
||||
|
||||
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d]allocate %lld bytes,charged %0.4f(balance:%0.4f,promotion:%0.4f),vq is %lld,vth is %lld at %s",
|
||||
shmp->process_info.portid ,quotaBytes,chargedThisTime,chargedFee->balance,chargedFee->promotion,
|
||||
@@ -2103,7 +2008,7 @@ int allocate_ps_data_volume_quota(_state_data *shmp, char *failReason)
|
||||
int pps_refund_data_volume(_state_data *shmp)
|
||||
{
|
||||
_gprs_process *gprsProc;
|
||||
_gprs_tariff *tariff;
|
||||
_gprs_tariff *tariff, gprsTariff;
|
||||
long long refundBytes;
|
||||
CHARGED_FEE *chargedFee;
|
||||
float discount, refundFee;
|
||||
@@ -2122,18 +2027,43 @@ int pps_refund_data_volume(_state_data *shmp)
|
||||
//gprsProc->vqConsumed.integer = 0;
|
||||
gprsProc->vqConsumed.integer -= refundBytes;// negative for cdr of GPRS refund
|
||||
}
|
||||
|
||||
tariff = gprsProc->gprsTariff;
|
||||
discount = gprsProc->discount;
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
memset(&gprsTariff, 0x00, sizeof(_gprs_tariff));
|
||||
tariff = gprsProc->gprsTariff = &gprsTariff;
|
||||
gprsProc->gprsTariff->chargeUnit = shmp->process_info.rest_if.unit/1024;
|
||||
gprsProc->gprsTariff->basicFee = shmp->process_info.rest_if.unit_charge;
|
||||
discount = shmp->process_info.rest_if.tariff_discount/100.00;
|
||||
gprsProc->discount = discount;
|
||||
|
||||
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d] Refund %lld bytes, basicFee:%.4f, unit:%d, discount:%.f, at %s",
|
||||
shmp->process_info.portid ,
|
||||
refundBytes,
|
||||
tariff->basicFee,
|
||||
tariff->chargeUnit,
|
||||
discount,
|
||||
__FUNCTION__);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
tariff = gprsProc->gprsTariff;
|
||||
discount = gprsProc->discount;
|
||||
}
|
||||
|
||||
chargedFee = &gprsProc->chargedFee;
|
||||
|
||||
if(shmp->process_info.bundle_flag > 0)
|
||||
if(shmp->process_info.bundle_flag == 1)
|
||||
{
|
||||
refundFee = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(tariff->basicFee == 0 || (discount == 0 && shmp->process_info.cap_flag==0))
|
||||
return 0;
|
||||
|
||||
refundFee = (refundBytes/BYTES_PER_BASIC_FEE)*tariff->basicFee*discount;
|
||||
shmp->caller_info.charge = shmp->caller_info.charge - refundFee;
|
||||
refund(&shmp->caller_info, refundFee,chargedFee);
|
||||
@@ -2147,7 +2077,19 @@ int pps_refund_data_volume(_state_data *shmp)
|
||||
}
|
||||
if(shmp->process_info.bundle_flag)
|
||||
{
|
||||
UpdateGprsBundleInfo(&shmp->caller_info,refundFee, refundBytes,shmp);
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
if(shmp->process_info.rest_if.used_plan_value>=refundBytes)
|
||||
{
|
||||
shmp->process_info.rest_if.used_plan_value -= refundBytes;
|
||||
shmp->process_info.rest_if.plan_value_add_this_time = (0x8000000000000000) | refundBytes;
|
||||
pps_send_update_plan_value_req(shmp->process_info.portid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateGprsBundleInfo(&shmp->caller_info,refundFee, refundBytes,shmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2163,7 +2105,7 @@ int pps_refund_data_volume(_state_data *shmp)
|
||||
int pps_charge_postpaid_data(_state_data *shmp, long consumed_volume, long *uncharged_volume)
|
||||
{
|
||||
_gprs_process *gprsProc;
|
||||
_gprs_tariff *tariff;
|
||||
_gprs_tariff *tariff, gprsTariff;
|
||||
float balance,chargedThisTime,quotaCharged;
|
||||
float basicFee = 0.0;
|
||||
float discount;
|
||||
@@ -2175,31 +2117,48 @@ int pps_charge_postpaid_data(_state_data *shmp, long consumed_volume, long *unch
|
||||
gprsProc = &shmp->process_info.ppsService.gprs_process;
|
||||
gprsProc->vqAllocatedThisTime = 0;
|
||||
|
||||
tariff = getGprsVolumeTariffWithRoamAndCap(shmp);// read Gprs tariff
|
||||
if(tariff == NULL)
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]no gprs tariff assigned",shmp->process_info.portid);
|
||||
return -4;
|
||||
memset(&gprsTariff, 0x00, sizeof(_gprs_tariff));
|
||||
tariff = gprsProc->gprsTariff = &gprsTariff;
|
||||
gprsProc->gprsTariff->chargeUnit = shmp->process_info.rest_if.unit/1024;
|
||||
gprsProc->gprsTariff->basicFee = shmp->process_info.rest_if.unit_charge;
|
||||
discount = shmp->process_info.rest_if.tariff_discount/100.00;
|
||||
gprsProc->discount = discount;
|
||||
|
||||
|
||||
pps_print_event(shmp->process_info.logMsisdn,"[%05d] Consumed %lld bytes, basicFee:%.4f, unit:%d, discount:%.f, at %s",
|
||||
shmp->process_info.portid ,
|
||||
consumed_volume,
|
||||
tariff->basicFee,
|
||||
tariff->chargeUnit,
|
||||
discount,
|
||||
__FUNCTION__);
|
||||
}
|
||||
else
|
||||
{
|
||||
gprsProc->gprsTariff = tariff;
|
||||
gprsProc->destIP = tariff->destIp;
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
shmp->process_info.cap_flag = tariff->cap_flag;
|
||||
#endif
|
||||
}
|
||||
tariff = getGprsVolumeTariffWithRoamAndCap(shmp);// read Gprs tariff
|
||||
|
||||
if(tariff == NULL)
|
||||
{
|
||||
pps_print_error(shmp->process_info.logMsisdn,"[%05d]no gprs tariff assigned",shmp->process_info.portid);
|
||||
return -4;
|
||||
}
|
||||
else
|
||||
{
|
||||
gprsProc->gprsTariff = tariff;
|
||||
gprsProc->destIP = tariff->destIp;
|
||||
discount = (float)GetDiscount(tvnow.tv_sec,tariff->discountID)/100.00;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
left_bundle_volume = pps_get_account_bundle_data(shmp);// remain volume in bundle of user
|
||||
|
||||
if(left_bundle_volume > 0)
|
||||
{
|
||||
if(left_bundle_volume > consumed_volume)// left bundle less than quota for each quest, allocate all left quota
|
||||
{
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
shmp->process_info.bundle_flag = shmp->process_info.cap_flag;// bundle identifier
|
||||
shmp->process_info.cap_flag = 0;
|
||||
#endif
|
||||
UpdateGprsBundleInfo(&shmp->caller_info, 0.0, -consumed_volume, shmp);
|
||||
basicFee = 0;// use bundle, do not charge other way
|
||||
max_quota_bytes = 0;
|
||||
@@ -2219,8 +2178,11 @@ int pps_charge_postpaid_data(_state_data *shmp, long consumed_volume, long *unch
|
||||
//max_quota_bytes = consumed_volume;
|
||||
//basicFee = tariff->basicFee;
|
||||
*uncharged_volume = consumed_volume;
|
||||
max_quota_bytes = 0;
|
||||
basicFee = 0.0;
|
||||
//max_quota_bytes = 0;
|
||||
//basicFee = 0.0;
|
||||
max_quota_bytes = consumed_volume;
|
||||
basicFee = tariff->basicFee;
|
||||
|
||||
}
|
||||
|
||||
balance = GetBalanceWithPromotionControl(shmp,&shmp->caller_info)+GetOverdraft(&shmp->caller_info);
|
||||
@@ -2235,7 +2197,6 @@ int pps_charge_postpaid_data(_state_data *shmp, long consumed_volume, long *unch
|
||||
memset(chargedFee,0,sizeof(CHARGED_FEE));
|
||||
chargedThisTime = 0;
|
||||
quotaCharged = 0;
|
||||
discount = (float)GetDiscount(tvnow.tv_sec,tariff->discountID)/100;
|
||||
|
||||
quotaCharged = ((max_quota_bytes+BYTES_PER_BASIC_FEE-1)/BYTES_PER_BASIC_FEE)*basicFee*discount;
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "../include/ppsm.h"
|
||||
#include "../include/param.h"
|
||||
|
||||
_pps_prefix_node pps_prefix_table[PPS_PREFIX_NODE_NUM];
|
||||
|
||||
char HolidayDes[12][31][32];
|
||||
extern _tariff_private *blf_shmp;
|
||||
extern _ram_data *ramshm_ptr;
|
||||
@@ -21,7 +23,9 @@ extern _state_machine *smshm_ptr;
|
||||
|
||||
extern int GetMOTariffData();
|
||||
|
||||
|
||||
#ifdef OCS_WITH_CRM
|
||||
int ocs_create_crm_base_tariff_tree();
|
||||
#endif
|
||||
int load_tariff_main()
|
||||
{
|
||||
int i,j,len,tariffID;
|
||||
@@ -35,7 +39,19 @@ int load_tariff_main()
|
||||
|
||||
sprintf(prog_name,"load tariff");
|
||||
|
||||
/*
|
||||
#ifdef OCS_WITH_CRM
|
||||
ocs_create_crm_base_tariff_tree();
|
||||
return 1;
|
||||
#endif
|
||||
*/
|
||||
if(OCS_with_external_CRM()==1)
|
||||
{
|
||||
ocs_create_crm_base_tariff_tree();
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
memcpy(&blf_shmp->comm_tariff,
|
||||
&ramshm_ptr->tariff_data.comm_tariff,
|
||||
sizeof(_comm_tariff)*MAX_ZONE_NUM);
|
||||
@@ -338,7 +354,7 @@ int load_tariff_main()
|
||||
|
||||
void ListTariffPlan(int tariff_id)
|
||||
{
|
||||
char buf[1024],bill_str[16],area[32];
|
||||
char buf[1024],bill_str[20],area[32];
|
||||
_bill_tariff *shmp = NULL;
|
||||
int num,i=0,j=0,len=0;
|
||||
|
||||
@@ -1073,4 +1089,59 @@ int pps_get_charge_prefix(u_char cosID,char *dialing_number)
|
||||
len = TARIFF_PREFIX_LEN;
|
||||
*/
|
||||
return pps_search_charge_prefix(cosID, dialing_number, len);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef OCS_WITH_CRM
|
||||
int ocs_create_crm_base_tariff_tree()
|
||||
{
|
||||
int iroot=0,len=0;
|
||||
int index=0;
|
||||
char tmpBuf[128];
|
||||
|
||||
|
||||
pps_prefix_node_ptr = 1;
|
||||
memset(&pps_prefix_table,0,sizeof(_pps_prefix_node)*PPS_PREFIX_NODE_NUM);
|
||||
|
||||
for(index=0;index<BILLING_BASE_NUM;index++)
|
||||
{
|
||||
|
||||
strcpy(tmpBuf, ramshm_ptr->tariff_data.base_tariff[index].bill_id);
|
||||
|
||||
len = strlen(tmpBuf);
|
||||
if(len==0 )
|
||||
continue;
|
||||
if(len>TARIFF_PREFIX_LEN)
|
||||
len = TARIFF_PREFIX_LEN;
|
||||
|
||||
pps_add_charge_prefix(iroot, tmpBuf, len, index);
|
||||
}
|
||||
|
||||
DebugMsg(debugmib.display.asciiOut,"prefix ptr=%d",pps_prefix_node_ptr);
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int ocs_get_charge_prefix(char *dialed_number, char *prefix, char *area_name, int *call_type)
|
||||
{
|
||||
int len;
|
||||
int index = -1;
|
||||
|
||||
len = strlen(dialed_number);
|
||||
if(len==0)
|
||||
return 0;
|
||||
|
||||
index = pps_search_charge_prefix(0, dialed_number, len);
|
||||
if(index == -1)
|
||||
return 0;
|
||||
|
||||
strcpy(prefix, ramshm_ptr->tariff_data.base_tariff[index].bill_id);
|
||||
strcpy(area_name, ramshm_ptr->tariff_data.base_tariff[index].area);
|
||||
*call_type = ramshm_ptr->tariff_data.base_tariff[index].call_type;
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -71,7 +71,7 @@ enum{
|
||||
|
||||
|
||||
/****************************** enquiry ***********************************************/
|
||||
/*inline */_prepaid_info *getPrepaidInfo(_account_info *account)
|
||||
_prepaid_info *getPrepaidInfo(_account_info *account)
|
||||
{
|
||||
int head,tail;
|
||||
|
||||
@@ -653,7 +653,7 @@ static void playChildNumber(u_short portid,u_char *childNumber)
|
||||
} while(0)
|
||||
|
||||
|
||||
static inline u8 getEnquirySlaveState(portid)
|
||||
static u8 getEnquirySlaveState(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
MASTER_SLAVE_ENQUIRY *enquiry;
|
||||
@@ -1057,7 +1057,7 @@ static int masterEnquiryProc(u_short portid)
|
||||
} while(0)
|
||||
|
||||
|
||||
static inline u8 getMasterAddState(portid)
|
||||
static u8 getMasterAddState(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
MASTER_SLAVE_ADD *add;
|
||||
@@ -1606,7 +1606,7 @@ static int masterAddProc(u_short portid)
|
||||
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 inline u8 getMasterDelState(portid)
|
||||
static u8 getMasterDelState(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
MASTER_SLAVE_DEL *del;
|
||||
@@ -2036,7 +2036,7 @@ static int masterDelProc(u_short portid)
|
||||
} while(0)
|
||||
|
||||
|
||||
static inline u8 getMasterSlaveState(portid)
|
||||
static u8 getMasterSlaveState(u_short portid)
|
||||
{
|
||||
_state_data *shmp;
|
||||
|
||||
@@ -2395,19 +2395,10 @@ static int childAutoTransferInFromMaster(_prepaid_info *slave)
|
||||
|
||||
transferFee = pA->roleParty.child.maxFeePerDay;
|
||||
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserBalance(slave, &usr_redis);
|
||||
if(isPromotionCanBeTransfered(&masterAccount) == TRUE)
|
||||
diff = transferFee - (usr_redis.usr_balance + usr_redis.pro_balance);
|
||||
else
|
||||
diff = transferFee - usr_redis.usr_balance;
|
||||
#else
|
||||
if(isPromotionCanBeTransfered(&masterAccount) == TRUE)
|
||||
diff = transferFee - (slave->balance+slave->promo_balance);
|
||||
else
|
||||
diff = transferFee - slave->balance;
|
||||
#endif
|
||||
|
||||
rst = checkTransferedPartialFee(&masterAccount,diff);
|
||||
switch(rst)
|
||||
@@ -2553,13 +2544,7 @@ static BOOL isSlaveNeedTransferFee(_prepaid_info *slave)
|
||||
|
||||
transferFee = pA->roleParty.child.maxFeePerDay;
|
||||
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserBalance(slave, &usr_redis);
|
||||
if(usr_redis.usr_balance + usr_redis.pro_balance >= transferFee)
|
||||
#else
|
||||
if(slave->balance + slave->promo_balance >= transferFee)
|
||||
#endif
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -2966,13 +2951,6 @@ int masterChangeSlaveCharge(_state_data *shmp,_account_info *slaveInfo)
|
||||
|
||||
amount = getAddSlaveCharge(&shmp->caller_info);
|
||||
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserBalance(ptr, &usr_redis);
|
||||
ptr->balance = usr_redis.usr_balance;
|
||||
usr_redis.usr_balance -= amount;
|
||||
RedisUpdateUserField(&usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
#endif
|
||||
ptr->balance -= amount;
|
||||
|
||||
SendManualOperationCDR(&shmp->caller_info,&shmp->called_info,-amount);
|
||||
@@ -2997,13 +2975,6 @@ int BillingChildNumberChange(_state_data *shmp)
|
||||
|
||||
ptr = &ramshm_ptr->prepaid_data.prepaid_info[head][tail];
|
||||
amount = ramshm_ptr->tariff_data.comm_tariff[tariff_id].childChangeChargeAmount;
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserField(&ramshm_ptr->prepaid_data.prepaid_info[head][tail], &usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
ptr->balance = usr_redis.usr_balance;
|
||||
usr_redis.usr_balance -= amount;
|
||||
RedisUpdateUserField(&usr_redis, OCS_REDIS_FIELD_BALANCE);
|
||||
#endif
|
||||
ptr->balance = ptr->balance - amount;
|
||||
shmp->caller_info.charge = amount;
|
||||
return 1;
|
||||
|
||||
+119
-17
@@ -69,9 +69,9 @@ extern int ListAllPortStatus();
|
||||
extern int sccp_GetSSNType ( BYTE ssn );
|
||||
extern int CheckPromotionLatchFlag();
|
||||
extern int cdr_submit(unsigned char ssn, unsigned short length, char *data);
|
||||
extern const char * AsciiTimeYMDHMS(char *ptr, time_t time);
|
||||
extern int ReplaceStr(char *sSrc, char *sMatchStr, char *sReplaceStr);
|
||||
/*------------------------------------------------*/
|
||||
|
||||
|
||||
void PutWarningMessage(u_short portid)
|
||||
{
|
||||
_state_data *shmp=(_state_data *) &smshm_ptr->state_data;
|
||||
@@ -1292,7 +1292,7 @@ void SendSrfPlayAnnouncement(u_short portid)
|
||||
}else
|
||||
*/
|
||||
{
|
||||
pPlayAnnouncement->informationToSend.inbandInfo.numberOfRepetitions = 1;
|
||||
pPlayAnnouncement->informationToSend.inbandInfo.numberOfRepetitions = 3;
|
||||
pPlayAnnouncement->informationToSend.inbandInfo.duration = 0x00;
|
||||
pPlayAnnouncement->informationToSend.inbandInfo.interval = 0x01; /* 1seconds */
|
||||
pPlayAnnouncement->optional_flag = 0x03;
|
||||
@@ -1672,7 +1672,7 @@ int SendAccountInfoPromptToSrf(u_short portid,u_char isOnlyBalance,u_char isLast
|
||||
}
|
||||
|
||||
pPlayAnnouncement->informationToSend.inbandInfo.optional_flag = 0x07;
|
||||
pPlayAnnouncement->informationToSend.inbandInfo.numberOfRepetitions = 0x01;
|
||||
pPlayAnnouncement->informationToSend.inbandInfo.numberOfRepetitions = 0x03;
|
||||
pPlayAnnouncement->informationToSend.inbandInfo.duration = 0x00;
|
||||
pPlayAnnouncement->informationToSend.inbandInfo.interval = 0x01;
|
||||
|
||||
@@ -2913,6 +2913,13 @@ int encodePPS_MO_CDR(_tocdr_report *pcdr,u_char *pdata)
|
||||
len = add_tlv("0-2.1",8,pcdr->imsi,0x80,asnbuf); /* served IMSI */
|
||||
len = add_tlv("0-2.4",9,pcdr->caller,0x80,asnbuf); /* calling number */
|
||||
len = add_tlv("0-2.5",12,pcdr->called,0x80,asnbuf); /* called number */
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
if (strlen(pcdr->peerAddress) > 0)
|
||||
{
|
||||
len = add_tlv("0-2.39",strlen((char *)pcdr->peerAddress),pcdr->peerAddress,0x80,asnbuf);/* area name */
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2927,7 +2934,19 @@ int encodePPS_MO_CDR(_tocdr_report *pcdr,u_char *pdata)
|
||||
balance[2] = pcdr->balance[1];
|
||||
balance[3] = pcdr->balance[0];
|
||||
len = add_tlv("0-2.130",4,balance,0x80,asnbuf); /* balance */
|
||||
len = add_int("0-2.131",pcdr->cos_id,0x80,asnbuf);
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
char plan_id[4];
|
||||
plan_id[0] = pcdr->plan_id[3];
|
||||
plan_id[1] = pcdr->plan_id[2];
|
||||
plan_id[2] = pcdr->plan_id[1];
|
||||
plan_id[3] = pcdr->plan_id[0];
|
||||
len = add_tlv("0-2.131",4,(u_char *)plan_id,0x80,asnbuf); /* balance */
|
||||
}
|
||||
else
|
||||
{
|
||||
len = add_int("0-2.131",pcdr->cos_id,0x80,asnbuf);
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -2973,7 +2992,17 @@ int encodePPS_MT_CDR(_tocdr_report *pcdr,u_char *pdata)
|
||||
balance[2] = pcdr->balance[1];
|
||||
balance[3] = pcdr->balance[0];
|
||||
len = add_tlv("1-2.130",4,balance,0x80,asnbuf); /* balance */
|
||||
len = add_int("0-2.131",pcdr->cos_id,0x80,asnbuf);
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
char plan_id[4];
|
||||
plan_id[0] = pcdr->plan_id[3];
|
||||
plan_id[1] = pcdr->plan_id[2];
|
||||
plan_id[2] = pcdr->plan_id[1];
|
||||
plan_id[3] = pcdr->plan_id[0];
|
||||
len = add_tlv("0-2.131",4,(u_char *)plan_id,0x80,asnbuf); /* balance */
|
||||
}
|
||||
else
|
||||
len = add_int("0-2.131",pcdr->cos_id,0x80,asnbuf);
|
||||
|
||||
switch(pcdr->type[0])
|
||||
{
|
||||
@@ -2987,17 +3016,27 @@ int encodePPS_MT_CDR(_tocdr_report *pcdr,u_char *pdata)
|
||||
len = add_tlv("1-2.3",9,pcdr->called,0x80,asnbuf); /* called number */
|
||||
len = add_tlv("1-2.4",9,pcdr->caller,0x80,asnbuf); /* calling number */
|
||||
len = add_tlv("1-2.5",9,pcdr->called,0x80,asnbuf); /* connected number */
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
if (strlen(pcdr->peerAddress) > 0)
|
||||
{
|
||||
len = add_tlv("0-2.39",strlen((char *)pcdr->peerAddress),pcdr->peerAddress,0x80,asnbuf);/* area name */
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
int
|
||||
StoreCDR(_tocdr_report *pcdr)
|
||||
static pthread_mutex_t store_cdr_mutx = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
int StoreCDR(_tocdr_report *pcdr)
|
||||
{
|
||||
int pWriteSub ,pReadSub;
|
||||
int tmpLen=0;
|
||||
|
||||
|
||||
pthread_mutex_lock(&store_cdr_mutx);
|
||||
|
||||
PutLogFunID("StoreCDR");
|
||||
|
||||
if((ppsParam.serviceControl.cdrFlag & 0x0f)== 0) return 0;
|
||||
@@ -3039,12 +3078,15 @@ StoreCDR(_tocdr_report *pcdr)
|
||||
if(pWriteSub>=MAX_CDR_LEN) pWriteSub = 0;
|
||||
pps_cdr_buffer.pWriteSub = pWriteSub;
|
||||
AddPPSStatistics(MIBPPS_CDRNUMBER,0);
|
||||
|
||||
|
||||
pthread_mutex_unlock(&store_cdr_mutx);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
SendCDR(int proc_id)
|
||||
extern int pps_crm_get_sms_notification_for_event_flag();
|
||||
extern void pps_send_last_call_info(_account_info *user_ptr, int call_type, int charge, int duration);
|
||||
void SendCDR(int proc_id)
|
||||
{
|
||||
_state_data *shmp=(_state_data *) &smshm_ptr->state_data;
|
||||
_tocdr_report *pcdr,cdrreport;
|
||||
@@ -3078,7 +3120,7 @@ SendCDR(int proc_id)
|
||||
if(shmp->caller_info.charge<0)
|
||||
charge = (int) shmp->caller_info.charge;
|
||||
else
|
||||
charge = (int)(shmp->caller_info.charge+0.5);
|
||||
charge = (int)(shmp->caller_info.charge+0.5);// ceil ==> int
|
||||
|
||||
switch(shmp->process_info.call_type)
|
||||
{
|
||||
@@ -3107,7 +3149,7 @@ SendCDR(int proc_id)
|
||||
pcdr->type[1] = 0;
|
||||
|
||||
memcpy(pcdr->charge, &charge,4); //
|
||||
balance = (int) (GetBalance(&shmp->caller_info)+0.5) ;
|
||||
balance = ceil (GetBalance(&shmp->caller_info)) ;
|
||||
|
||||
memcpy(pcdr->balance,&balance,4);
|
||||
memcpy(pcdr->imsi,shmp->caller_info.IMSI,8);
|
||||
@@ -3131,6 +3173,16 @@ SendCDR(int proc_id)
|
||||
|
||||
pcdr->cos_id = GetAccountCosID(&shmp->caller_info);
|
||||
|
||||
memcpy(pcdr->plan_id, &shmp->process_info.rest_if.plan_id, 4);
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
if ((shmp->process_info.call_type != CT_BUNDLE_PLAN_CHARGE)
|
||||
&& (shmp->process_info.call_type != CT_SERVICE))
|
||||
{
|
||||
strncpy(pcdr->peerAddress, shmp->process_info.ppsService.areaName, 31);
|
||||
}
|
||||
}
|
||||
CDRStatistics(pcdr,shmp->caller_info.charge, 0);
|
||||
StoreCDR(pcdr);
|
||||
|
||||
@@ -3146,14 +3198,15 @@ SendCDR(int proc_id)
|
||||
break;
|
||||
case CT_LOCAL_CALL_IN:
|
||||
case CT_TRUNK_CALL_IN:
|
||||
case CT_IDD_CALL_IN:
|
||||
case CT_MT_SM:
|
||||
pcdr->mtype = MT_CDR_TYPE;
|
||||
pcdr->type[0] = shmp->process_info.call_type;
|
||||
pcdr->type[1] = 0;
|
||||
|
||||
charge = (int)(shmp->called_info.charge+0.5);
|
||||
charge = (int)(shmp->called_info.charge+0.5);// ceil ==> int
|
||||
memcpy(pcdr->charge, &charge,4); /* called_info.charge */
|
||||
balance = (int) (GetBalance(&shmp->called_info) + 0.5); /* called_info */
|
||||
balance = ceil(GetBalance(&shmp->called_info) ); /* called_info */
|
||||
memcpy(pcdr->balance,&balance,4);
|
||||
memcpy(pcdr->imsi,shmp->called_info.IMSI,8);
|
||||
|
||||
@@ -3176,6 +3229,12 @@ SendCDR(int proc_id)
|
||||
|
||||
pcdr->tcos[0] = 0;
|
||||
pcdr->cos_id = GetAccountCosID(&shmp->called_info);
|
||||
memcpy(pcdr->plan_id, &shmp->process_info.rest_if.plan_id, 4);
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
strncpy(pcdr->peerAddress, shmp->process_info.ppsService.areaName, 31);
|
||||
}
|
||||
CDRStatistics(pcdr,shmp->called_info.charge, 0);
|
||||
StoreCDR(pcdr);
|
||||
CheckPromotionLatchFlag(&shmp->called_info);
|
||||
@@ -3224,6 +3283,14 @@ SendCDR(int proc_id)
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
if(charge>0 && pps_crm_get_sms_notification_for_event_flag())
|
||||
{
|
||||
pps_send_last_call_info(&shmp->caller_info, shmp->process_info.call_type, charge, duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4142,7 +4209,7 @@ void SendAccountInfoBySMPP(_account_info *ptr,char *called)
|
||||
_last_call_info callInfo;
|
||||
int len;
|
||||
char msisdn[32];
|
||||
unsigned char flag = 0;
|
||||
|
||||
char expire_date[64],promotion_expire_date[64]={0};
|
||||
char expire_date1[64];
|
||||
|
||||
@@ -4188,6 +4255,41 @@ void SendAccountInfoBySMPP(_account_info *ptr,char *called)
|
||||
AddPPSStatistics(MIBPPS_ACCOUNTINFO,0);
|
||||
}
|
||||
|
||||
void pps_send_last_call_info(_account_info *user_ptr, int call_type, int charge, int duration)
|
||||
{
|
||||
char sms_content[256];
|
||||
// char to_be_replace_str[16][32]={"[Charge]","[Charged Units]","[ACCOUNT BALANCE]","[EXPIRY DATE]"};
|
||||
char to_be_replace_str[16][32]={"$C","$D","$B","$E"};
|
||||
char charge_str[32],duration_str[32],balance_str[32],expire_str[32];
|
||||
int balance;
|
||||
long expired_day;
|
||||
|
||||
//SendAccountInfoBySMPP(ptr, ppsParam.ppsTables.serviceNumber[HotLineNumberPosition].number);
|
||||
|
||||
if(call_type == CT_MO_SM )
|
||||
strcpy(sms_content, (char *)getSmsSentenceNative(0,SMS_LAST_SMS_INFO));
|
||||
else
|
||||
strcpy(sms_content, (char *)getSmsSentenceNative(0,SMS_LAST_CALL_INFO));
|
||||
|
||||
balance = GetAccountBalance(user_ptr->head, user_ptr->tail);
|
||||
expired_day = GetExpiration(user_ptr);
|
||||
AsciiTimeYMDHMS(expire_str,expired_day);
|
||||
|
||||
sprintf(charge_str, "%.2f", charge/100.00);
|
||||
sprintf(duration_str, "%d", duration);
|
||||
sprintf(balance_str, "%.2f", balance/100.00);
|
||||
|
||||
ReplaceStr(sms_content, to_be_replace_str[0], charge_str);
|
||||
ReplaceStr(sms_content, to_be_replace_str[1], duration_str);
|
||||
ReplaceStr(sms_content, to_be_replace_str[2], balance_str);
|
||||
ReplaceStr(sms_content, to_be_replace_str[3], expire_str);
|
||||
|
||||
smppSendMOSM((char *)user_ptr->number,
|
||||
(char *)ppsParam.ppsTables.serviceNumber[HotLineNumberPosition].number,
|
||||
(u_char *)sms_content, strlen(sms_content), 0);
|
||||
|
||||
}
|
||||
|
||||
void SendAccountInfoBySMPPtoThirdParty(_account_info *ptr,char *called, char *third_party_number)
|
||||
{
|
||||
long balance,promotion, expired_date,promo_expired_date;
|
||||
|
||||
+651
-627
File diff suppressed because it is too large.
Load diff
@@ -51,7 +51,7 @@ static int isIndexValid(ppsTableType tableType,int index)
|
||||
return FALSE;
|
||||
break;
|
||||
case SmsSentenceTable:
|
||||
if(index < 0 || index >= MaxSmsSentenceItem)
|
||||
if(index < 0 || index >= MaxSmsSentenceItem*2)
|
||||
return FALSE;
|
||||
break;
|
||||
case ThirdPartyInfoTable:
|
||||
@@ -801,7 +801,7 @@ int isIndexBusy(ppsTableType tableType,index_t *id)
|
||||
return ppsTablePoint->mnpPrefix[index].existFlag;
|
||||
break;
|
||||
case SmsSentenceTable:
|
||||
if(index >= MaxSmsSentenceItem)
|
||||
if(index >= MaxSmsSentenceItem*2)
|
||||
return TRUE;
|
||||
return ppsTablePoint->smsSentence[index].existFlag;
|
||||
break;
|
||||
@@ -1923,14 +1923,20 @@ static void initSmsSentence()
|
||||
sprintf((char *)smsSentenceItem->english,"%s", "1 Check Plan Status\n2 Subscribe Bundle Plan\n0 Exit");
|
||||
smsSentenceItem->existFlag = TRUE;
|
||||
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
smsSentenceItem = &ppsParam.ppsTables.smsSentence[SMS_BUNDLE_PLAN_ROAM_AND_NOTROAM];
|
||||
smsSentenceItem = &ppsParam.ppsTables.smsExtSentence[SMS_LAST_CALL_INFO-SMS_MAX_ITEM-1];
|
||||
memset(smsSentenceItem->title,0,PpsMaxTitleLen);
|
||||
sprintf((char *)smsSentenceItem->title,"%s", "Bundle Plan Name Local and Roaming");
|
||||
sprintf((char *)smsSentenceItem->title,"%s", "Call Event Notification");
|
||||
memset(smsSentenceItem->english,0,MAX_SMS_LEN);
|
||||
sprintf((char *)smsSentenceItem->english,"%s", "local bundle plan;roaming bundle plan");
|
||||
sprintf((char *)smsSentenceItem->english,"%s", "Last Call Cost: AUD $C. Call Duration: $Ds. Your current balance is AUD $B expiring on $E.");
|
||||
smsSentenceItem->existFlag = TRUE;
|
||||
#endif
|
||||
|
||||
smsSentenceItem = &ppsParam.ppsTables.smsExtSentence[SMS_LAST_SMS_INFO-SMS_MAX_ITEM-1];
|
||||
memset(smsSentenceItem->title,0,PpsMaxTitleLen);
|
||||
sprintf((char *)smsSentenceItem->title,"%s", "SMS Event Notification");
|
||||
memset(smsSentenceItem->english,0,MAX_SMS_LEN);
|
||||
sprintf((char *)smsSentenceItem->english,"%s", "Last SMS Cost: AUD $C. Your current balance is AUD $B expiring on $E.");
|
||||
smsSentenceItem->existFlag = TRUE;
|
||||
|
||||
|
||||
initPrep();
|
||||
initCMB();
|
||||
@@ -1958,11 +1964,18 @@ void initSMSTable()
|
||||
initSmsSentence();
|
||||
}
|
||||
|
||||
u_char *getSmsSentenceNative(u8 languageType,SMS_SENTENCE id)
|
||||
u_char *getSmsSentenceNative(u8 languageType,SMS_SENTENCE org_id)
|
||||
{
|
||||
LANGUAGE_INFO *languageInfo;
|
||||
int id = org_id;
|
||||
|
||||
languageInfo = &ppsParam.ppsTables.smsSentence[id].language[languageType%MAX_LANGUAGE_TYPES];
|
||||
if(org_id>SMS_MAX_ITEM)
|
||||
{
|
||||
id = org_id-(SMS_MAX_ITEM+1);
|
||||
languageInfo = &ppsParam.ppsTables.smsExtSentence[id].language[languageType%MAX_LANGUAGE_TYPES];
|
||||
}
|
||||
else
|
||||
languageInfo = &ppsParam.ppsTables.smsSentence[id].language[languageType%MAX_LANGUAGE_TYPES];
|
||||
|
||||
switch(id)
|
||||
{
|
||||
@@ -1972,8 +1985,16 @@ u_char *getSmsSentenceNative(u8 languageType,SMS_SENTENCE id)
|
||||
default:
|
||||
if(languageInfo->language[MAX_SMS_LEN] == 0)
|
||||
{
|
||||
ppsParam.ppsTables.smsSentence[id].english[MAX_SMS_LEN] = strlen((char *)ppsParam.ppsTables.smsSentence[id].english);
|
||||
return ppsParam.ppsTables.smsSentence[id].english;
|
||||
if(org_id>SMS_MAX_ITEM)
|
||||
{
|
||||
ppsParam.ppsTables.smsExtSentence[id].english[MAX_SMS_LEN] = strlen((char *)ppsParam.ppsTables.smsExtSentence[id].english);
|
||||
return ppsParam.ppsTables.smsExtSentence[id].english;
|
||||
}
|
||||
else
|
||||
{
|
||||
ppsParam.ppsTables.smsSentence[id].english[MAX_SMS_LEN] = strlen((char *)ppsParam.ppsTables.smsSentence[id].english);
|
||||
return ppsParam.ppsTables.smsSentence[id].english;
|
||||
}
|
||||
}
|
||||
if(strcasecmp((char *)languageInfo->language,"null") == 0)
|
||||
return ((u_char *)"");
|
||||
@@ -2007,7 +2028,13 @@ int pps_get_smsSentence(u32 column, u32 *instance, u8 *pdata, u8 *vartype)
|
||||
return -1;
|
||||
if(isIndexBusy(SmsSentenceTable,(index_t *)&index) == FALSE)
|
||||
return -1;
|
||||
smsSentenceItem = &ppsParam.ppsTables.smsSentence[index];
|
||||
if(index>SMS_MAX_ITEM)
|
||||
{
|
||||
index -= (SMS_MAX_ITEM+1);
|
||||
smsSentenceItem = &ppsParam.ppsTables.smsExtSentence[index];
|
||||
}
|
||||
else
|
||||
smsSentenceItem = &ppsParam.ppsTables.smsSentence[index];
|
||||
*vartype = OctetString;
|
||||
switch(column)
|
||||
{
|
||||
@@ -2073,7 +2100,13 @@ int pps_set_smsSentence(u32 column, u32 *instance, u8 *pdata, u16 datalen)
|
||||
{
|
||||
strReplace(pdata,datalen,'|','\n');
|
||||
}
|
||||
smsSentenceItem = &ppsParam.ppsTables.smsSentence[index];
|
||||
if(index>SMS_MAX_ITEM)
|
||||
{
|
||||
index -= (SMS_MAX_ITEM+1);
|
||||
smsSentenceItem = &ppsParam.ppsTables.smsExtSentence[index];
|
||||
}
|
||||
else
|
||||
smsSentenceItem = &ppsParam.ppsTables.smsSentence[index];
|
||||
switch(column)
|
||||
{
|
||||
case 1:/* create */
|
||||
@@ -3963,21 +3996,21 @@ int pps_set_cosTariff(u32 column, u32 *instance, u8 *pdata, u16 datalen)
|
||||
case 7:
|
||||
{
|
||||
u_char buf[32] = {0};
|
||||
struct tm tmnow;
|
||||
//struct tm tmnow;
|
||||
|
||||
memcpy(buf,pdata,8);
|
||||
strcat((char *)buf+8, "000000");
|
||||
tariffCosItem->promotionUseControl.rechargePromotionStartDate = MakeTime(&tmnow, (char *)buf);
|
||||
tariffCosItem->promotionUseControl.rechargePromotionStartDate = MakeTime(NULL, (char *)buf);
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
u_char buf[32] = {0};
|
||||
struct tm tmnow;
|
||||
//struct tm tmnow;
|
||||
|
||||
memcpy(buf,pdata,8);
|
||||
strcat((char *)buf+8, "000000");
|
||||
tariffCosItem->promotionUseControl.rechargePromotionEndDate = MakeTime(&tmnow, (char *)buf);
|
||||
tariffCosItem->promotionUseControl.rechargePromotionEndDate = MakeTime(NULL, (char *)buf);
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
@@ -4892,13 +4925,7 @@ int pps_get_cosSmsNotification(u32 column, u32 *instance, u8 *pdata, u8 *vartype
|
||||
case 19:
|
||||
pdata[0] = smsNotificationItem->smsNotificationWhenFriendFamilyServiceRemoved;
|
||||
break;
|
||||
case 20:
|
||||
pdata[0] = smsNotificationItem->smsNotificationWhenPromotionInsufficient;
|
||||
break;
|
||||
case 21:
|
||||
pdata[0] = smsNotificationItem->insufficientPromotionThreshold;
|
||||
break;
|
||||
case 22:/* rowStatus */ //2010-03-08
|
||||
case 20:/* rowStatus */ //2010-03-08
|
||||
*vartype = INTEGER;
|
||||
pdata[0] = TABLE_ACTIVE_COMMAND;
|
||||
break;
|
||||
@@ -4981,13 +5008,7 @@ int pps_set_cosSmsNotification(u32 column, u32 *instance, u8 *pdata, u16 datalen
|
||||
case 19:
|
||||
smsNotificationItem->smsNotificationWhenFriendFamilyServiceRemoved = pdata[0];
|
||||
break;
|
||||
case 20:
|
||||
smsNotificationItem->smsNotificationWhenPromotionInsufficient = pdata[0];
|
||||
break;
|
||||
case 21:
|
||||
smsNotificationItem->insufficientPromotionThreshold = pdata[0];
|
||||
break;
|
||||
case 22:/* command */
|
||||
case 20:/* command */
|
||||
if(pdata[0] == TABLE_DESTROY_COMMAND)
|
||||
{
|
||||
memset(smsNotificationItem,0,sizeof(CosSmsNotificationInquiry));
|
||||
@@ -5679,41 +5700,10 @@ int pps_get_cosGprs(u32 column, u32 *instance, u8 *pdata, u8 *vartype)
|
||||
case 21:
|
||||
pdata[0] = gprsItem->capPlan[0].tariffID3;
|
||||
break;
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
case 22:
|
||||
pdata[0] = gprsItem->capPlan[1].type;
|
||||
break;
|
||||
case 23:
|
||||
datalen = PPS_GET_INTEGER(gprsItem->capPlan[1].threshold0,pdata,vartype);
|
||||
break;
|
||||
case 24:
|
||||
datalen = PPS_GET_INTEGER(gprsItem->capPlan[1].threshold1,pdata,vartype);
|
||||
break;
|
||||
case 25:
|
||||
datalen = PPS_GET_INTEGER(gprsItem->capPlan[1].threshold2,pdata,vartype);
|
||||
break;
|
||||
case 26:
|
||||
pdata[0] = gprsItem->capPlan[1].tariffID0;
|
||||
break;
|
||||
case 27:
|
||||
pdata[0] = gprsItem->capPlan[1].tariffID1;
|
||||
break;
|
||||
case 28:
|
||||
pdata[0] = gprsItem->capPlan[1].tariffID2;
|
||||
break;
|
||||
case 29:
|
||||
pdata[0] = gprsItem->capPlan[1].tariffID3;
|
||||
break;
|
||||
case 30:/* rowStatus */
|
||||
*vartype = INTEGER;
|
||||
pdata[0] = TABLE_ACTIVE_COMMAND;
|
||||
break;
|
||||
#else
|
||||
case 22:/* rowStatus */ //2010-03-08
|
||||
*vartype = INTEGER;
|
||||
pdata[0] = TABLE_ACTIVE_COMMAND;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
break;
|
||||
@@ -5800,41 +5790,6 @@ int pps_set_cosGprs(u32 column, u32 *instance, u8 *pdata, u16 datalen)
|
||||
case 21:
|
||||
gprsItem->capPlan[0].tariffID3 = pdata[0];
|
||||
break;
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
case 22:
|
||||
gprsItem->capPlan[1].type = pdata[0];
|
||||
break;
|
||||
case 23:
|
||||
gprsItem->capPlan[1].threshold0 = PPS_SET_INTEGER(pdata,datalen);
|
||||
break;
|
||||
case 24:
|
||||
gprsItem->capPlan[1].threshold1 = PPS_SET_INTEGER(pdata,datalen);
|
||||
break;
|
||||
case 25:
|
||||
gprsItem->capPlan[1].threshold2 = PPS_SET_INTEGER(pdata,datalen);
|
||||
break;
|
||||
case 26:
|
||||
gprsItem->capPlan[1].tariffID0 = pdata[0];
|
||||
break;
|
||||
case 27:
|
||||
gprsItem->capPlan[1].tariffID1 = pdata[0];
|
||||
break;
|
||||
case 28:
|
||||
gprsItem->capPlan[1].tariffID2 = pdata[0];
|
||||
break;
|
||||
case 29:
|
||||
gprsItem->capPlan[1].tariffID3 = pdata[0];
|
||||
break;
|
||||
case 30:/* command */
|
||||
if(pdata[0] == TABLE_DESTROY_COMMAND)
|
||||
{
|
||||
memset(gprsItem,0,sizeof(PPS_COS_RADIUS_ITEM));
|
||||
gprsItem->existFlag = FALSE;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
break;
|
||||
#else
|
||||
case 22:/* command */
|
||||
if(pdata[0] == TABLE_DESTROY_COMMAND)
|
||||
{
|
||||
@@ -5844,7 +5799,6 @@ int pps_set_cosGprs(u32 column, u32 *instance, u8 *pdata, u16 datalen)
|
||||
else
|
||||
return -1;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
break;
|
||||
|
||||
+1223
-1203
File diff suppressed because it is too large.
Load diff
@@ -40,7 +40,7 @@ StringCut(char *str, int c)
|
||||
*/
|
||||
void Bstr2Hstr(char *cptr)
|
||||
{
|
||||
char s[] = "";
|
||||
char s[12] = "";
|
||||
unsigned int i, j = 0;
|
||||
|
||||
while (cptr && *cptr && strchr("01", *cptr)) {
|
||||
|
||||
+1158
-273
File diff suppressed because it is too large.
Load diff
+371
-225
@@ -529,6 +529,12 @@ int LoadPPSParam()
|
||||
|
||||
}
|
||||
|
||||
#ifdef _ZED_NO_CALLER_NUM_AND_EXPIRY_DATE_
|
||||
if (ppsParam.scf_work_as_adaptor)
|
||||
{
|
||||
read_yx_ussd_param();
|
||||
}
|
||||
#endif
|
||||
|
||||
CalcSumOfParameter();
|
||||
|
||||
@@ -674,7 +680,7 @@ int snmpSetPPS(BYTE oidLen, DWORD *oid, BYTE *pdata, u_short dataLen)
|
||||
{
|
||||
int oid0,oid1,oid2,loop;
|
||||
char buf[BUFSIZE];
|
||||
struct tm tmnow;
|
||||
//struct tm tmnow;
|
||||
int iValue=0;
|
||||
|
||||
PutLogFunID("snmpSetPPS");
|
||||
@@ -825,7 +831,7 @@ int snmpSetPPS(BYTE oidLen, DWORD *oid, BYTE *pdata, u_short dataLen)
|
||||
case 4: /* tariff time*/
|
||||
memset(buf,0,sizeof(buf));
|
||||
memcpy(buf,pdata,dataLen);
|
||||
ppsParam.fileOperation.nextTariffStartTime = MakeTime(&tmnow,buf);
|
||||
ppsParam.fileOperation.nextTariffStartTime = MakeTime(NULL,buf);
|
||||
break;
|
||||
case 5:
|
||||
|
||||
@@ -2270,11 +2276,11 @@ void ListData()
|
||||
|
||||
void ListSubInfo(char *msisdn)
|
||||
{
|
||||
int len,head,tail,instance,i;
|
||||
int len,head,tail,instance;//,i;
|
||||
char buf[BUFSIZE];
|
||||
_prepaid_info *shmp=NULL;
|
||||
PoolParent *pParent;
|
||||
PoolChild *pChild;
|
||||
_prepaid_info *shmp=NULL;
|
||||
//PoolParent *pParent;
|
||||
//PoolChild *pChild;
|
||||
|
||||
PutLogFunID("ListSubInfo");
|
||||
|
||||
@@ -2293,29 +2299,29 @@ void ListSubInfo(char *msisdn)
|
||||
tail = instance % UNIT_STORE_ACCOUNT;
|
||||
|
||||
shmp = &ramshm_ptr->prepaid_data.prepaid_info[head][tail];
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserInfo(shmp, &usr_redis);
|
||||
#endif
|
||||
DebugMsg(debugmib.display.asciiOut,
|
||||
"<<----------- Sub. Info @ <%d> --------",instance);
|
||||
DebugMsg(debugmib.display.asciiOut,"msisdn: %s",msisdn);
|
||||
DebugMsg(debugmib.display.asciiOut,"PIN: %s",shmp->pin);
|
||||
DebugMsg(debugmib.display.asciiOut,"status: %d",shmp->status);
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
DebugMsg(debugmib.display.asciiOut,"balance: %07.4f+%07.4f",
|
||||
usr_redis.usr_balance,usr_redis.pro_balance);
|
||||
#else
|
||||
DebugMsg(debugmib.display.asciiOut,"balance: %07.4f+%07.4f",
|
||||
shmp->balance,shmp->promo_balance);
|
||||
#endif
|
||||
AsciiTime(buf,shmp->mo_expiration_date);
|
||||
AsciiTime(buf,shmp->mo_expiration_date);
|
||||
DebugMsg(debugmib.display.asciiOut,"mo expire date: %s",buf);
|
||||
AsciiTime(buf,shmp->mt_expiration_date);
|
||||
AsciiTime(buf,shmp->mt_expiration_date);
|
||||
DebugMsg(debugmib.display.asciiOut,"mt expire date: %s",buf);
|
||||
DebugMsg(debugmib.display.asciiOut,"cos id: %d",shmp->cos_id);
|
||||
DebugMsg(debugmib.display.asciiOut,"cos id: %d, CUG ID: %d",shmp->cos_id, shmp->cug_id);
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"CRM ID: %d.%d",shmp->crm_info.account_id, shmp->crm_info.base_plan_id);
|
||||
DebugMsg(debugmib.display.asciiOut,"Rent: %d",shmp->crm_info.rent_charge);
|
||||
}
|
||||
|
||||
DebugMsg(debugmib.display.asciiOut,"free SMS status: %d",shmp->freeSMSActiveDays);
|
||||
/*
|
||||
DebugMsg(debugmib.display.asciiOut,"fav numbers: %d",shmp->favorite_numbers);
|
||||
DebugMsg(debugmib.display.asciiOut,"fav counter: %d",shmp->fav_change_counter);
|
||||
|
||||
for(i=0;i<5;i++)
|
||||
{
|
||||
len = shmp->favorite_number[i][MAX_MSISDN_BLEN-1];
|
||||
@@ -2324,8 +2330,6 @@ void ListSubInfo(char *msisdn)
|
||||
DebugMsg(debugmib.display.asciiOut,"fav number[%d]: %s",i,buf);
|
||||
}
|
||||
|
||||
DebugMsg(debugmib.display.asciiOut,"free SMS status: %d",shmp->freeSMSActiveDays);
|
||||
|
||||
if(shmp->poolAccount.role == MASTER_SLAVE_CHILD)
|
||||
{
|
||||
pChild = &shmp->poolAccount.roleParty.child;
|
||||
@@ -2354,7 +2358,7 @@ void ListSubInfo(char *msisdn)
|
||||
}
|
||||
else
|
||||
DebugMsg(debugmib.display.asciiOut,"pool account role: Normal account");
|
||||
|
||||
*/
|
||||
DebugMsg(debugmib.display.asciiOut,"Gprs volume: %lld",shmp->gprsVolume);
|
||||
DebugMsg(debugmib.display.asciiOut,"Gprs balance: %0.4f",shmp->gprsBalance);
|
||||
DebugMsg(debugmib.display.asciiOut,"Gprs volume ths month: %lld",shmp->gprsVolumeThisMonth);
|
||||
@@ -2362,16 +2366,6 @@ void ListSubInfo(char *msisdn)
|
||||
DebugMsg(debugmib.display.asciiOut,"Call me back times: %d",shmp->callMeBackRequestTimes);
|
||||
|
||||
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
AsciiTimeYMD(buf,usr_redis.validity_date);
|
||||
DebugMsg(debugmib.display.asciiOut,"Bundle Info >>>");
|
||||
DebugMsg(debugmib.display.asciiOut," data (KB) : %lld", (usr_redis.data + 1023) / 1024);
|
||||
DebugMsg(debugmib.display.asciiOut," MO (S) : %d", usr_redis.mo_voice);
|
||||
DebugMsg(debugmib.display.asciiOut," MT (S) : %d", usr_redis.mt_voice);
|
||||
DebugMsg(debugmib.display.asciiOut," SMS : %d", usr_redis.sms);
|
||||
DebugMsg(debugmib.display.asciiOut," Validity : %s", buf);
|
||||
DebugMsg(debugmib.display.asciiOut," SMS Sent : %d", usr_redis.warning_sms_flag);
|
||||
#else
|
||||
AsciiTimeYMD(buf,shmp->bundle_info.validity_date);
|
||||
DebugMsg(debugmib.display.asciiOut,"Bundle Info >>>");
|
||||
DebugMsg(debugmib.display.asciiOut," data (KB) : %lld", (shmp->bundle_info.data + 1023) / 1024);
|
||||
@@ -2380,7 +2374,6 @@ void ListSubInfo(char *msisdn)
|
||||
DebugMsg(debugmib.display.asciiOut," SMS : %d", shmp->bundle_info.sms);
|
||||
DebugMsg(debugmib.display.asciiOut," Validity : %s", buf);
|
||||
DebugMsg(debugmib.display.asciiOut," SMS Sent : %d", shmp->bundle_info.warning_sms_flag);
|
||||
#endif
|
||||
|
||||
DebugMsg(debugmib.display.asciiOut," ");
|
||||
|
||||
@@ -2522,9 +2515,6 @@ void SumAccountBalance()
|
||||
len = shmp->msisdn[9];
|
||||
if(len==0) continue;
|
||||
balance = balance + shmp->balance + shmp->promo_balance;
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
// too many query in a tick if using balance of redis DB, TODO
|
||||
#endif
|
||||
}
|
||||
DebugMsg(debugmib.display.asciiOut,"Total balance: %.0f", balance);
|
||||
}
|
||||
@@ -2541,9 +2531,6 @@ int pps_set_all_balance(int balance)
|
||||
len = shmp->msisdn[9];
|
||||
if(len==0) continue;
|
||||
shmp->balance = balance;
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
RedisSetUserBalanceFromOcs(shmp, (double)balance);
|
||||
#endif
|
||||
}
|
||||
|
||||
DebugMsg(debugmib.display.asciiOut,"Set balance to : %d", balance);
|
||||
@@ -2672,6 +2659,9 @@ void PrintCmdOK()
|
||||
DebugMsg(debugmib.display.asciiOut,"COMMAND OK!");
|
||||
}
|
||||
|
||||
extern void ppsAddBalanceToAll(int balance);
|
||||
extern int query_tariff_test(u_char call_type);
|
||||
extern int ocs_get_charge_prefix(char *dialed_number, char *prefix, char *area_name, int *call_type);
|
||||
int DecodePPSAsciiIn(int pageno, char *cmd)
|
||||
{
|
||||
char cvalue[128];
|
||||
@@ -2831,6 +2821,15 @@ int DecodePPSAsciiIn(int pageno, char *cmd)
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"add balance to all=",19))
|
||||
{
|
||||
ivalue = atoi(&cmd[19]);
|
||||
|
||||
ppsAddBalanceToAll(ivalue);
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
|
||||
}
|
||||
if(!strncasecmp(cmd,"recreate index",12))
|
||||
{
|
||||
CreatePPSDataIndexForAll();
|
||||
@@ -2872,6 +2871,14 @@ int DecodePPSAsciiIn(int pageno, char *cmd)
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strcmp(cmd,"mt cdr enable"))
|
||||
{
|
||||
ppsParam.serviceControl.mt_not_charged_for_cdr = 0;
|
||||
SavePPSParam();
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(!strcmp(cmd,"pps mo release"))
|
||||
{
|
||||
ppsParam.serviceControl.mo_release_for_no_charge = 1;
|
||||
@@ -3246,20 +3253,23 @@ int DecodePPSAsciiIn(int pageno, char *cmd)
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"external vc yes",15))
|
||||
if(!strncasecmp(cmd,"with crm yes",12))
|
||||
{
|
||||
ppsParam.serviceControl.external_vc = 0;
|
||||
ppsParam.serviceControl.work_with_crm = 1;
|
||||
|
||||
SavePPSParam();
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"external vc no",14))
|
||||
if(!strncasecmp(cmd,"with crm no",11))
|
||||
{
|
||||
ppsParam.serviceControl.external_vc = 1;
|
||||
ppsParam.serviceControl.work_with_crm = 0;
|
||||
|
||||
SavePPSParam();
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(!strncasecmp(cmd,"change expiry day",17))
|
||||
{
|
||||
ppsParam.serviceControl.not_change_expiry_date_when_transfer= 0;
|
||||
@@ -3365,7 +3375,12 @@ int DecodePPSAsciiIn(int pageno, char *cmd)
|
||||
{
|
||||
ppsParam.scf_work_as_adaptor = atoi(&cmd[8]);
|
||||
SavePPSParam();
|
||||
|
||||
#ifdef _ZED_NO_CALLER_NUM_AND_EXPIRY_DATE_
|
||||
if (ppsParam.scf_work_as_adaptor)
|
||||
{
|
||||
read_yx_ussd_param();
|
||||
}
|
||||
#endif
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
@@ -3557,6 +3572,67 @@ int DecodePPSAsciiIn(int pageno, char *cmd)
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"test crm tariff=", 16))
|
||||
{
|
||||
u_char call_type = 1;/*1=mo call, 2=mo sms, 3=data*/
|
||||
if(cmd[16] == 'c')
|
||||
call_type = 1;
|
||||
else if(cmd[16] == 's')
|
||||
call_type = 2;
|
||||
else if(cmd[16] == 'd')
|
||||
call_type = 3;
|
||||
|
||||
query_tariff_test(call_type);
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(strstr(cmd,"reload prefix definition"))
|
||||
{
|
||||
ocs_get_crm_prefix_definition();
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"free seconds=", 13))
|
||||
{
|
||||
ppsParam.serviceControl.crm_free_seconds = atoi(&cmd[13]);
|
||||
SavePPSParam();
|
||||
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"status vd=", 10))
|
||||
{
|
||||
ppsParam.serviceControl.crm_status_validity = atoi(&cmd[10]);
|
||||
SavePPSParam();
|
||||
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"days before vd=", 15))
|
||||
{
|
||||
ppsParam.serviceControl.crm_days_before_validity = atoi(&cmd[15]);
|
||||
SavePPSParam();
|
||||
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"sms for event=", 14))
|
||||
{
|
||||
ppsParam.serviceControl.crm_notification_for_event = atoi(&cmd[14]);
|
||||
SavePPSParam();
|
||||
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"crm tariff=", 11))
|
||||
{
|
||||
char prefix[128], areaName[32]="";
|
||||
int call_type;
|
||||
ocs_get_charge_prefix(&cmd[11], prefix, areaName, &call_type);
|
||||
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"cellid in ccr=", 14))
|
||||
{
|
||||
ppsParam.serviceControl.cellid_present_in_ccr = atoi(&cmd[14]);
|
||||
@@ -3564,27 +3640,7 @@ int DecodePPSAsciiIn(int pageno, char *cmd)
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
if(!strncasecmp(cmd,"redis load", 10))
|
||||
{
|
||||
RedisCreateDbFromOcs();
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"redis save", 10))
|
||||
{
|
||||
RedisSaveDbToOcs();
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
if(!strncasecmp(cmd,"redis test", 10))
|
||||
{
|
||||
RedisTest(atoi(&cmd[10]));
|
||||
PrintCmdOK();
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
DebugMsg(debugmib.display.asciiOut,"ERROR COMMAND!");
|
||||
break;
|
||||
case 1: /* parameter */
|
||||
@@ -3803,7 +3859,7 @@ int ImportUserData(char *userdata)
|
||||
|
||||
token = buf;
|
||||
|
||||
if(strlen(userdata)<30)
|
||||
if(strlen(userdata)<10)
|
||||
{
|
||||
if(load_file.log_fp[_FILE_ID_USER_DATA] != NULL)
|
||||
{
|
||||
@@ -3814,14 +3870,14 @@ int ImportUserData(char *userdata)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int up_balance_only_flag = 0, first_id_not_nul = 0, invalid_record_flag = 0;
|
||||
while(index<MAX_PPS_USER_FIELD_NUMS)
|
||||
{
|
||||
|
||||
token = strsep((char **)&(userdata),delimiter);
|
||||
if(token == NULL )
|
||||
{
|
||||
if(index<21)
|
||||
if((index == 0) || ((replaceableFlag == 0) && (index<21)))
|
||||
{
|
||||
if(load_file.log_fp[_FILE_ID_USER_DATA] != NULL)
|
||||
{
|
||||
@@ -3832,11 +3888,28 @@ int ImportUserData(char *userdata)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (index < 21)// invalid record when replaceableFlag == 1
|
||||
{
|
||||
invalid_record_flag = 1;
|
||||
}
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (index > 0)
|
||||
{
|
||||
if (first_id_not_nul == 0)
|
||||
{
|
||||
if (strlen(token) > 0){
|
||||
first_id_not_nul = index;
|
||||
if ((index == 0x03) && replaceableFlag)// first index is balance
|
||||
{
|
||||
up_balance_only_flag = 1;// set update balance only
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
strcpy(buf,token);
|
||||
|
||||
switch(index)
|
||||
@@ -4009,6 +4082,16 @@ int ImportUserData(char *userdata)
|
||||
index++;
|
||||
}//while
|
||||
|
||||
if (invalid_record_flag && !up_balance_only_flag)
|
||||
{
|
||||
if(load_file.log_fp[_FILE_ID_USER_DATA] != NULL)
|
||||
{
|
||||
fprintf(load_file.log_fp[_FILE_ID_USER_DATA],
|
||||
"Error: Wrong record : %s,index=%d\n",userdata,index);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
shmp->favorite_numbers = favorite_numbers;
|
||||
|
||||
retval = FindPPSSubsStoreIndex(atoll(msisdn));
|
||||
@@ -4034,21 +4117,46 @@ int ImportUserData(char *userdata)
|
||||
tail = retval % UNIT_STORE_ACCOUNT;
|
||||
shmp_old = &ramshm_ptr->prepaid_data.prepaid_info[head][tail];
|
||||
|
||||
if(shmp->balance != shmp_old->balance && masterFlag)
|
||||
if (up_balance_only_flag)
|
||||
{
|
||||
chargeFlag |= 0x01;
|
||||
difbalance = shmp->balance-shmp_old->balance;
|
||||
if(shmp->balance != shmp_old->balance && masterFlag)
|
||||
{
|
||||
chargeFlag |= 0x01;
|
||||
difbalance = shmp->balance-shmp_old->balance;
|
||||
|
||||
double new_balance = shmp->balance;
|
||||
memcpy(shmp, shmp_old, sizeof(_prepaid_info));
|
||||
shmp->balance = new_balance;
|
||||
ModifyPPSSubsData(shmp);
|
||||
}
|
||||
}
|
||||
if(shmp->promo_balance != shmp_old->promo_balance && masterFlag)
|
||||
else
|
||||
{
|
||||
chargeFlag |= 0x02;
|
||||
dif_promo_balance = shmp->promo_balance - shmp_old->promo_balance;
|
||||
if(shmp->balance != shmp_old->balance && masterFlag)
|
||||
{
|
||||
chargeFlag |= 0x01;
|
||||
difbalance = shmp->balance-shmp_old->balance;
|
||||
}
|
||||
if(shmp->promo_balance != shmp_old->promo_balance && masterFlag)
|
||||
{
|
||||
chargeFlag |= 0x02;
|
||||
dif_promo_balance = shmp->promo_balance - shmp_old->promo_balance;
|
||||
}
|
||||
|
||||
ModifyPPSSubsData(shmp);
|
||||
}
|
||||
|
||||
ModifyPPSSubsData(shmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (up_balance_only_flag)
|
||||
{
|
||||
if(load_file.log_fp[_FILE_ID_USER_DATA] !=NULL)
|
||||
{
|
||||
fprintf(load_file.log_fp[_FILE_ID_USER_DATA],
|
||||
"Error: can't create user from balance only record!\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
if(debugmib.measurement.usernumber>=ppsParam.serviceControl.licenseduser)
|
||||
{
|
||||
if(load_file.log_fp[_FILE_ID_USER_DATA] !=NULL)
|
||||
@@ -5681,7 +5789,7 @@ int SetUserDataByOMC(BYTE oidlen, DWORD *oid, BYTE *pdata, WORD datalen)
|
||||
int i,vallen,chargeFlag=0,/*addFlag=0,*/charge=0;
|
||||
char buf[2048]="";
|
||||
char valbuf[32]="";
|
||||
struct tm tmnow;
|
||||
//struct tm tmnow;
|
||||
CosServiceControl *serviceControlItem;
|
||||
CosFriendFamilyControl *friendFamilyControl;
|
||||
int totalLen=0;
|
||||
@@ -5880,7 +5988,7 @@ int SetUserDataByOMC(BYTE oidlen, DWORD *oid, BYTE *pdata, WORD datalen)
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
if(shmp->msisdn[MAX_MSISDN_BLEN-1]==0) /*addFlag = 1*/;
|
||||
if(shmp->msisdn[MAX_MSISDN_BLEN-1]==0) {/*addFlag = 1*/;}
|
||||
AsciiToBcd(shmp->msisdn, (char *)pdata2,(vallen+1)/2*2);
|
||||
if(vallen%2==0)
|
||||
shmp->msisdn[vallen/2] = 0xFF;
|
||||
@@ -6018,7 +6126,7 @@ int SetUserDataByOMC(BYTE oidlen, DWORD *oid, BYTE *pdata, WORD datalen)
|
||||
else if(ocode==OMC_OCODE_EDIT || ocode==OMC_OCODE_ADD)
|
||||
{
|
||||
BcdToAscii(buf,pdata2,vallen*2);
|
||||
shmp->first_used_date = MakeTime(&tmnow,buf);
|
||||
shmp->first_used_date = MakeTime(NULL,buf);
|
||||
if(ocode==OMC_OCODE_ADD)
|
||||
{
|
||||
shmp->first_used_date = tvnow.tv_sec;
|
||||
@@ -6039,7 +6147,7 @@ int SetUserDataByOMC(BYTE oidlen, DWORD *oid, BYTE *pdata, WORD datalen)
|
||||
else if(ocode==OMC_OCODE_EDIT || ocode==OMC_OCODE_ADD)
|
||||
{
|
||||
BcdToAscii(buf,pdata2,vallen*2);
|
||||
shmp->mo_expiration_date = MakeTime(&tmnow,buf);
|
||||
shmp->mo_expiration_date = MakeTime(NULL,buf);
|
||||
|
||||
AsciiTime(buf,shmp->mo_expiration_date);
|
||||
AsciiToBcd((BYTE *)valbuf,buf,14);
|
||||
@@ -6057,7 +6165,7 @@ int SetUserDataByOMC(BYTE oidlen, DWORD *oid, BYTE *pdata, WORD datalen)
|
||||
}else if(ocode==OMC_OCODE_EDIT || ocode==OMC_OCODE_ADD)
|
||||
{
|
||||
BcdToAscii(buf,pdata2,vallen*2);
|
||||
shmp->mt_expiration_date = MakeTime(&tmnow,buf);
|
||||
shmp->mt_expiration_date = MakeTime(NULL,buf);
|
||||
AsciiTime(buf,shmp->mt_expiration_date);
|
||||
AsciiToBcd((BYTE *)valbuf,buf,14);
|
||||
len = 7;
|
||||
@@ -6074,7 +6182,7 @@ int SetUserDataByOMC(BYTE oidlen, DWORD *oid, BYTE *pdata, WORD datalen)
|
||||
}else if(ocode==OMC_OCODE_EDIT || ocode==OMC_OCODE_ADD)
|
||||
{
|
||||
BcdToAscii(buf,pdata2,vallen*2);
|
||||
shmp->promo_date = MakeTime(&tmnow,buf);
|
||||
shmp->promo_date = MakeTime(NULL,buf);
|
||||
|
||||
AsciiTime(buf,shmp->promo_date);
|
||||
AsciiToBcd((BYTE *)valbuf,buf,14);
|
||||
@@ -6898,42 +7006,6 @@ int SetUserDataByOMC(BYTE oidlen, DWORD *oid, BYTE *pdata, WORD datalen)
|
||||
totalLen = AddInteger(tagbuf,tmpval,0x80,asnbuf);
|
||||
}
|
||||
break;
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
case 55:/* KB */
|
||||
if(ocode ==OMC_OCODE_READ)
|
||||
{
|
||||
totalLen = AddInteger(tagbuf,(u32)((shmp->out_net_cap_gprsVolume+BYTES_PER_KB-1) >> 10),0x80,asnbuf);
|
||||
}
|
||||
else if(ocode==OMC_OCODE_EDIT || ocode ==OMC_OCODE_ADD)
|
||||
{
|
||||
if(GetInteger(tagbuf, (int *)&tmpval ,pflag,asnbuf2)<=0) continue;
|
||||
shmp->out_net_cap_gprsVolume= (long)tmpval << 10;
|
||||
totalLen = AddInteger(tagbuf,(u32)(shmp->out_net_cap_gprsVolume>>10),0x80,asnbuf);
|
||||
if (shmp->out_net_cap_gprsVolume < 1)
|
||||
{
|
||||
shmp->cap_sms_notify_counter = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 56:
|
||||
if(ocode ==OMC_OCODE_READ)
|
||||
{
|
||||
totalLen = AddInteger(tagbuf,(u32)shmp->out_net_cap_gprsBalance,0x80,asnbuf);
|
||||
}
|
||||
else if(ocode==OMC_OCODE_EDIT || ocode ==OMC_OCODE_ADD)
|
||||
{
|
||||
if(GetInteger(tagbuf, (int *)&tmpval ,pflag,asnbuf2)<=0) continue;
|
||||
if(tmpval>ppsParam.serviceControl.maxBalance)
|
||||
{
|
||||
sprintf((char *)pdata,"Too big value(%d),should be(0-%d)",
|
||||
tmpval,ppsParam.serviceControl.maxBalance);
|
||||
return -2;
|
||||
}
|
||||
shmp->out_net_cap_gprsBalance= (double)tmpval;
|
||||
totalLen = AddInteger(tagbuf,tmpval,0x80,asnbuf);
|
||||
}
|
||||
break;
|
||||
#else
|
||||
case 55:/* KB */
|
||||
if(ocode ==OMC_OCODE_READ)
|
||||
{
|
||||
@@ -6958,7 +7030,6 @@ int SetUserDataByOMC(BYTE oidlen, DWORD *oid, BYTE *pdata, WORD datalen)
|
||||
totalLen = AddInteger(tagbuf,shmp->gprsNotificationTimes,0x80,asnbuf);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case 57:
|
||||
if(ocode ==OMC_OCODE_READ)
|
||||
{
|
||||
@@ -7144,7 +7215,7 @@ int SetUserDataByOMC(BYTE oidlen, DWORD *oid, BYTE *pdata, WORD datalen)
|
||||
}else if(ocode==OMC_OCODE_EDIT || ocode==OMC_OCODE_ADD)
|
||||
{
|
||||
BcdToAscii(buf,pdata2,vallen*2);
|
||||
shmp->bundle_info.validity_date = MakeTime(&tmnow,buf);
|
||||
shmp->bundle_info.validity_date = MakeTime(NULL,buf);
|
||||
AsciiTime(buf,shmp->bundle_info.validity_date);
|
||||
AsciiToBcd((BYTE *)valbuf,buf,14);
|
||||
len = 7;
|
||||
@@ -7177,112 +7248,6 @@ int SetUserDataByOMC(BYTE oidlen, DWORD *oid, BYTE *pdata, WORD datalen)
|
||||
totalLen = AddInteger(tagbuf,shmp->cap_sms_notify_counter, 0x80, asnbuf);
|
||||
}
|
||||
break;
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
case 69: //roaming bundle data
|
||||
if(ocode ==OMC_OCODE_READ)
|
||||
{
|
||||
totalLen = AddInteger(tagbuf,(u32)((shmp->bundle_roam.data+BYTES_PER_KB-1) >> 10),0x80,asnbuf);
|
||||
}
|
||||
else if(ocode==OMC_OCODE_EDIT || ocode ==OMC_OCODE_ADD)
|
||||
{
|
||||
if(GetInteger(tagbuf, (int *)&tmpval ,pflag,asnbuf2)<=0) continue;
|
||||
shmp->bundle_roam.data = (long)tmpval << 10;
|
||||
totalLen = AddInteger(tagbuf,(u32)(shmp->bundle_roam.data >> 10),0x80,asnbuf);
|
||||
}
|
||||
|
||||
break;
|
||||
case 70: //roaming bundle mo voice
|
||||
if(ocode ==OMC_OCODE_READ)
|
||||
{
|
||||
totalLen = AddInteger(tagbuf,shmp->bundle_roam.mo_voice,0x80,asnbuf);
|
||||
}
|
||||
else if(ocode==OMC_OCODE_EDIT || ocode ==OMC_OCODE_ADD)
|
||||
{
|
||||
if(GetInteger(tagbuf, (int *)&tmpval ,pflag,asnbuf2)<=0) continue;
|
||||
shmp->bundle_roam.mo_voice = tmpval;
|
||||
totalLen = AddInteger(tagbuf,shmp->bundle_roam.mo_voice,0x80,asnbuf);
|
||||
}
|
||||
break;
|
||||
case 71: //mt voice
|
||||
if(ocode ==OMC_OCODE_READ)
|
||||
{
|
||||
totalLen = AddInteger(tagbuf,shmp->bundle_roam.mt_voice,0x80,asnbuf);
|
||||
}
|
||||
else if(ocode==OMC_OCODE_EDIT || ocode ==OMC_OCODE_ADD)
|
||||
{
|
||||
if(GetInteger(tagbuf, (int *)&tmpval ,pflag,asnbuf2)<=0) continue;
|
||||
shmp->bundle_roam.mt_voice = tmpval;
|
||||
totalLen = AddInteger(tagbuf,shmp->bundle_roam.mt_voice,0x80,asnbuf);
|
||||
}
|
||||
break;
|
||||
case 72: //sms
|
||||
if(ocode ==OMC_OCODE_READ)
|
||||
{
|
||||
totalLen = AddInteger(tagbuf,shmp->bundle_roam.sms,0x80,asnbuf);
|
||||
}
|
||||
else if(ocode==OMC_OCODE_EDIT || ocode ==OMC_OCODE_ADD)
|
||||
{
|
||||
if(GetInteger(tagbuf, (int *)&tmpval ,pflag,asnbuf2)<=0) continue;
|
||||
shmp->bundle_roam.sms= tmpval;
|
||||
totalLen = AddInteger(tagbuf,shmp->bundle_roam.sms,0x80,asnbuf);
|
||||
}
|
||||
break;
|
||||
case 73: //validity
|
||||
if(ocode==OMC_OCODE_READ)
|
||||
{
|
||||
AsciiTime(buf,shmp->bundle_roam.validity_date);
|
||||
AsciiToBcd((BYTE *)valbuf,buf,14);
|
||||
len = 7;
|
||||
totalLen = add_tlv(tagbuf,len, (u_char *)valbuf,0x80,asnbuf);
|
||||
}else if(ocode==OMC_OCODE_EDIT || ocode==OMC_OCODE_ADD)
|
||||
{
|
||||
BcdToAscii(buf,pdata2,vallen*2);
|
||||
shmp->bundle_roam.validity_date = MakeTime(&tmnow,buf);
|
||||
AsciiTime(buf,shmp->bundle_roam.validity_date);
|
||||
AsciiToBcd((BYTE *)valbuf,buf,14);
|
||||
len = 7;
|
||||
totalLen = add_tlv(tagbuf,len, (u_char *)valbuf,0x80,asnbuf);
|
||||
}
|
||||
|
||||
break;
|
||||
case 74:
|
||||
if(ocode ==OMC_OCODE_READ)
|
||||
{
|
||||
totalLen = AddInteger(tagbuf,shmp->bundle_roam.warning_sms_flag,0x80,asnbuf);
|
||||
}
|
||||
else if(ocode==OMC_OCODE_EDIT || ocode ==OMC_OCODE_ADD)
|
||||
{
|
||||
if(GetInteger(tagbuf, (int *)&tmpval ,pflag,asnbuf2)<=0) continue;
|
||||
shmp->bundle_roam.warning_sms_flag= tmpval;
|
||||
totalLen = AddInteger(tagbuf,shmp->bundle_roam.warning_sms_flag,0x80,asnbuf);
|
||||
}
|
||||
|
||||
break;
|
||||
case 75:/* KB */
|
||||
if(ocode ==OMC_OCODE_READ)
|
||||
{
|
||||
totalLen = AddInteger(tagbuf,(u32)((shmp->gprsVolumeThisMonth+BYTES_PER_KB-1) >> 10),0x80,asnbuf);
|
||||
}
|
||||
else if(ocode==OMC_OCODE_EDIT || ocode ==OMC_OCODE_ADD)
|
||||
{
|
||||
if(GetInteger(tagbuf, (int *)&tmpval ,pflag,asnbuf2)<=0) continue;
|
||||
shmp->gprsVolumeThisMonth = (long)tmpval << 10;
|
||||
totalLen = AddInteger(tagbuf,(u32)(shmp->gprsVolumeThisMonth >> 10),0x80,asnbuf);
|
||||
}
|
||||
break;
|
||||
case 76:
|
||||
if(ocode ==OMC_OCODE_READ)
|
||||
{
|
||||
totalLen = AddInteger(tagbuf,shmp->gprsNotificationTimes,0x80,asnbuf);
|
||||
}
|
||||
else if(ocode==OMC_OCODE_EDIT || ocode ==OMC_OCODE_ADD)
|
||||
{
|
||||
if(GetInteger(tagbuf, (int *)&tmpval ,pflag,asnbuf2)<=0) continue;
|
||||
shmp->gprsNotificationTimes= tmpval;
|
||||
totalLen = AddInteger(tagbuf,shmp->gprsNotificationTimes,0x80,asnbuf);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return 0;
|
||||
break;
|
||||
@@ -7617,6 +7582,11 @@ int UseExternalVC()
|
||||
return ppsParam.serviceControl.external_vc;
|
||||
}
|
||||
|
||||
int OCS_with_external_CRM()
|
||||
{
|
||||
return ppsParam.serviceControl.work_with_crm;
|
||||
}
|
||||
|
||||
static int pps_week_index = 8;
|
||||
|
||||
int ppsGetWeekDay()
|
||||
@@ -7847,6 +7817,11 @@ int pps_mt_play_voice_flag()
|
||||
return ppsParam.serviceControl.mt_play_voice_flag;
|
||||
}
|
||||
|
||||
int pps_mt_cdr_enable_flag()
|
||||
{
|
||||
return ppsParam.serviceControl.mt_not_charged_for_cdr;
|
||||
}
|
||||
|
||||
int get_debug_log_flag();
|
||||
int pps_debug_info(char *app_name, char *str_to_show)
|
||||
{
|
||||
@@ -8059,7 +8034,178 @@ int ocs_get_calling_card_cos_id()
|
||||
|
||||
}
|
||||
|
||||
char *pps_get_service_number(unsigned int num_pos)
|
||||
{
|
||||
char *ptr = NULL;
|
||||
|
||||
if(num_pos < MAXServicePostion)
|
||||
ptr = (char *)ppsParam.ppsTables.serviceNumber[num_pos].number;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
char *ocs_get_crm_prefix_filename(char *ptr)
|
||||
{
|
||||
if(ptr == NULL)
|
||||
return NULL;
|
||||
|
||||
// strcpy(ptr , ppsParam.ocs_crm_control.base_prefix_file_name);
|
||||
strcpy(ptr, "/usr/local/agt/etc/tariff/prefix_table.txt");
|
||||
return ptr;
|
||||
}
|
||||
|
||||
int ocs_get_crm_prefix_call_type_method()
|
||||
{
|
||||
return ppsParam.ocs_crm_control.crm_call_type.equal_or_contain;
|
||||
}
|
||||
|
||||
static char local_mobile_prefix_des[128][128]={"35","67235","0067235"};
|
||||
static char local_pstn_prefix_des[128][128]={"32","67232","0067232"};
|
||||
static int local_mobile_index=0, local_pstn_index=0;
|
||||
|
||||
void ocs_get_crm_prefix_definition()
|
||||
{
|
||||
char s[80],s1[80];
|
||||
int len;
|
||||
unsigned char conf_state=0xFF;
|
||||
FILE *fpConf;
|
||||
char file_name[128]={"/usr/local/agt/etc/tariff/prefix_definition.txt"};
|
||||
|
||||
fpConf = fopen(file_name, "rb");
|
||||
|
||||
if(fpConf == NULL)
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
strcpy(s,"");
|
||||
strcpy(s1,"");
|
||||
while(fgets(s,1024,fpConf) !=(char *)0)
|
||||
{
|
||||
if( (int *)strchr(s,'#') !=NULL) continue;
|
||||
if( !strlen(s) ) continue;
|
||||
len = strlen(s);
|
||||
if(len < 2) continue;
|
||||
|
||||
if(s[len-1] == 0x0d ||s[len-1] == 0x0a)
|
||||
{
|
||||
if(s[len-2] == 0x0d ||s[len-2] == 0x0a)
|
||||
{
|
||||
s[len-2] = 0;
|
||||
len -= 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
s[len-1] = 0;
|
||||
len -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(strstr(s,"[local mobile]"))
|
||||
{
|
||||
conf_state = 0;
|
||||
local_mobile_index = 0;
|
||||
continue;
|
||||
}
|
||||
else if(strstr(s,"[local pstn]"))
|
||||
{
|
||||
conf_state = 1;
|
||||
local_pstn_index = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(conf_state)
|
||||
{
|
||||
case 0:
|
||||
if(local_mobile_index<128)
|
||||
strcpy(local_mobile_prefix_des[local_mobile_index++], s);
|
||||
break;
|
||||
case 1:
|
||||
if(local_pstn_index<128)
|
||||
strcpy(local_pstn_prefix_des[local_pstn_index++], s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fclose(fpConf);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int ocs_get_crm_prefix_call_type_des(const char *prefix)
|
||||
{
|
||||
int len,index;
|
||||
|
||||
if(prefix == NULL)
|
||||
return 0;
|
||||
|
||||
for(index=0; index<=local_mobile_index; index++)
|
||||
{
|
||||
len = strlen(local_mobile_prefix_des[index]);
|
||||
if(len<=0) continue;
|
||||
if(strncasecmp(prefix, local_mobile_prefix_des[index],len) == 0)
|
||||
return 0; //local mobile
|
||||
}
|
||||
|
||||
for(index=0; index<=local_pstn_index; index++)
|
||||
{
|
||||
len = strlen(local_pstn_prefix_des[index]);
|
||||
if(len<=0) continue;
|
||||
if(strncasecmp(prefix, local_pstn_prefix_des[index],len) == 0)
|
||||
return 1;//local pstn
|
||||
}
|
||||
|
||||
return (index=4);//idd
|
||||
}
|
||||
|
||||
int ocs_get_call_type_by_des(const char *prefix)
|
||||
{
|
||||
int index = 0;
|
||||
//int match_method = ocs_get_crm_prefix_call_type_method();
|
||||
//char configured_des[128];
|
||||
|
||||
index = ocs_get_crm_prefix_call_type_des(prefix);
|
||||
/*
|
||||
for(index=0; index<MAX_CALL_TYPE_DES; index++)
|
||||
{
|
||||
ocs_get_crm_prefix_call_type_des(index, configured_des);
|
||||
if(match_method == 0)
|
||||
{
|
||||
if(strcmp(des, configured_des) == 0)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(strstr(des, configured_des) != NULL)
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
return index;
|
||||
}
|
||||
|
||||
int ocs_get_crm_free_seconds()
|
||||
{
|
||||
return ppsParam.serviceControl.crm_free_seconds;
|
||||
}
|
||||
|
||||
int pps_crm_get_notify_days()
|
||||
{
|
||||
return ppsParam.serviceControl.crm_days_before_validity;
|
||||
}
|
||||
|
||||
int pps_crm_get_status_vd()
|
||||
{
|
||||
return ppsParam.serviceControl.crm_status_validity;
|
||||
}
|
||||
|
||||
int pps_crm_get_sms_notification_for_event_flag()
|
||||
{
|
||||
return ppsParam.serviceControl.crm_notification_for_event;
|
||||
}
|
||||
|
||||
int ocs_get_cellid_present_flag()
|
||||
{
|
||||
return ppsParam.serviceControl.cellid_present_in_ccr;
|
||||
}
|
||||
|
||||
+4052
-90
File diff suppressed because it is too large.
Load diff
@@ -845,7 +845,7 @@ int SetPrepaidCardByOMC(u_char oidlen, DWORD *oid, BYTE *pdata, u_short datalen)
|
||||
int vallen;//chargeFlag=0;
|
||||
char buf[1025]={""},workbuf[128]={""};
|
||||
char valbuf[128]="";
|
||||
struct tm tmnow;
|
||||
//struct tm tmnow;
|
||||
long long cardNo;
|
||||
int totalLen=0;
|
||||
int loop=0;
|
||||
@@ -1131,7 +1131,7 @@ int SetPrepaidCardByOMC(u_char oidlen, DWORD *oid, BYTE *pdata, u_short datalen)
|
||||
else if(ocode==2 || ocode==3)
|
||||
{
|
||||
BcdToAscii(buf,pdata2,vallen*2);
|
||||
shmp->updated_date = MakeTime(&tmnow,buf);
|
||||
shmp->updated_date = MakeTime(NULL,buf);
|
||||
|
||||
AsciiTime(buf,shmp->updated_date);
|
||||
AsciiToBcd((BYTE *)valbuf,buf,14);
|
||||
|
||||
@@ -628,7 +628,7 @@ int sendRadiusAccessAccept(u_short portid,BOOL volumeFlag,BOOL durationFlag)
|
||||
RADIUS_VENDOR_ATTRIBUTE_3GPP2_PPAQ *ppaq;
|
||||
DWORD qid=0;
|
||||
ulong meterUnit;
|
||||
PPS_COS_RADIUS_ITEM *radiusItem;
|
||||
//PPS_COS_RADIUS_ITEM *radiusItem;
|
||||
|
||||
|
||||
shmp = (_state_data *)&smshm_ptr->state_data;
|
||||
@@ -669,7 +669,7 @@ int sendRadiusAccessAccept(u_short portid,BOOL volumeFlag,BOOL durationFlag)
|
||||
}
|
||||
ppaq->qid.qid.value = qid | (gprsProc->qid & 0xffff);
|
||||
|
||||
radiusItem = getCosRadiusItem(&shmp->caller_info);
|
||||
//radiusItem = getCosRadiusItem(&shmp->caller_info);
|
||||
|
||||
|
||||
if(volumeFlag == TRUE)
|
||||
|
||||
+188
-47
@@ -437,7 +437,7 @@ int ReadDataFromPeerSever()
|
||||
|
||||
int snmpResponse(snmp_pdu *pdu, snmp_addr *addr)
|
||||
{
|
||||
//int request_id,pdu_type;
|
||||
//int request_id;//,pdu_type;
|
||||
int instance,dataType;
|
||||
void *ptr = (void *)ramshm_ptr;
|
||||
|
||||
@@ -593,34 +593,100 @@ int LoadDataFromBackfile()
|
||||
if(fileinfo.st_size == sizeof(_prepaid_data))
|
||||
{ //check length
|
||||
fread(&ramshm_ptr->prepaid_data,sizeof(_prepaid_data),1,fp);
|
||||
}
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
else if(fileinfo.st_size == sizeof(_prepaid_data_no_bundle_roam))
|
||||
{
|
||||
_prepaid_data_no_bundle_roam *poldDat = (_prepaid_data_no_bundle_roam *)malloc(sizeof(_prepaid_data_no_bundle_roam));
|
||||
fread(poldDat, sizeof(_prepaid_data_no_bundle_roam), 1, fp);
|
||||
memset(&ramshm_ptr->prepaid_data, 0, sizeof(_prepaid_data));
|
||||
int i, j;
|
||||
for (i=0; i<MSISDN_HEAD_NUM; i++)
|
||||
{
|
||||
ramshm_ptr->prepaid_data.msisdn_head[i] = poldDat->msisdn_head[i];
|
||||
for (j=0; j<UNIT_STORE_ACCOUNT; j++)
|
||||
{
|
||||
memcpy(&ramshm_ptr->prepaid_data.prepaid_info[i][j], &poldDat->prepaid_info[i][j], sizeof(_prepaid_info_no_bundle_roam));
|
||||
}
|
||||
}
|
||||
|
||||
free(poldDat);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
}else
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int base_prefix_index = 0;
|
||||
|
||||
int ocs_set_crm_base_prefix_record(char *prefix, char *area, int call_type, int base_prefix_index)
|
||||
{
|
||||
_base_tariff * ptr = &ramshm_ptr->tariff_data.base_tariff[base_prefix_index];
|
||||
|
||||
strcpy(ptr->bill_id, prefix);
|
||||
strcpy(ptr->area, area);
|
||||
ptr->call_type = call_type;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
extern int ocs_get_call_type_by_des(const char *prefix);
|
||||
int ocs_parse_base_prefix(char *data)
|
||||
{
|
||||
const char delimiter[] = ",; ";
|
||||
char buf[1024] = {""},*token;
|
||||
char prefix[64], area[128];
|
||||
int index = 0;
|
||||
int call_type = PPS_CSTA_TYPE_BASE;
|
||||
|
||||
while(index<3)
|
||||
{
|
||||
token = strsep((char **)&(data),delimiter);
|
||||
if(token == NULL )
|
||||
{
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
|
||||
strcpy(buf,token);
|
||||
|
||||
switch(index)
|
||||
{
|
||||
case 0x00: //prefix
|
||||
strcpy(prefix, buf);
|
||||
break;
|
||||
case 0x01: //area des
|
||||
strcpy(area, buf);
|
||||
break;
|
||||
}
|
||||
index ++;
|
||||
}
|
||||
|
||||
call_type = ocs_get_call_type_by_des(prefix) + PPS_CSTA_TYPE_BASE;
|
||||
|
||||
ocs_set_crm_base_prefix_record(prefix, area, call_type, base_prefix_index);
|
||||
base_prefix_index ++;
|
||||
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
extern void ocs_get_crm_prefix_definition();
|
||||
extern char *ocs_get_crm_prefix_filename(char *ptr);
|
||||
int ocs_read_crm_base_prefix_file()
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
char file_name[128] = {""};
|
||||
char buf[1024];
|
||||
|
||||
ocs_get_crm_prefix_definition();
|
||||
|
||||
ocs_get_crm_prefix_filename(file_name);
|
||||
fp = fopen(file_name,"rb");
|
||||
if(fp == NULL)
|
||||
{
|
||||
printf("can't open file %s\r\n", file_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
base_prefix_index = 0;
|
||||
while(fgets(buf,1023,fp) !=(char *)0)
|
||||
{
|
||||
if( (int *)strchr(buf,'#') !=NULL) continue;
|
||||
if( !strlen(buf) ) continue;
|
||||
ocs_parse_base_prefix(buf);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ppsBackupRamDataToFile()
|
||||
{
|
||||
static int backupState = 0;
|
||||
@@ -1182,7 +1248,13 @@ int FindPPSSubsStoreIndex(long long key)
|
||||
{
|
||||
int index;
|
||||
int store_index = 0;
|
||||
|
||||
|
||||
#ifdef OCS_WITH_CRM
|
||||
store_index = ocs_get_ue_index(key);
|
||||
if(store_index == INVALID_UE_INDEX)
|
||||
store_index = -1;
|
||||
return store_index;
|
||||
#endif
|
||||
index = FindPPSTableIndex(key);
|
||||
|
||||
|
||||
@@ -1214,7 +1286,19 @@ int GetAccountInfoBySortIndex(int index, char *msisdn)
|
||||
return retval;
|
||||
|
||||
retval = 1;
|
||||
sprintf(msisdn,"%lld",ramshm_ptr->index_data.index_table.prim_index[index].key);
|
||||
#ifdef OCS_WITH_CRM
|
||||
//if(OCS_with_external_CRM())
|
||||
{
|
||||
long long llmsisdn = ocs_get_ue_by_index(index);
|
||||
sprintf(msisdn,"%lld",llmsisdn);
|
||||
}
|
||||
//else
|
||||
#else
|
||||
{
|
||||
sprintf(msisdn,"%lld",ramshm_ptr->index_data.index_table.prim_index[index].key);
|
||||
}
|
||||
#endif
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -1231,6 +1315,7 @@ int GetPPSSubsRecord(char *msisdn, _prepaid_info *shmp)
|
||||
if(len<MIN_MSISDN_ALEN || len>MAX_MSISDN_ALEN) return -1;
|
||||
|
||||
store_index = FindPPSSubsStoreIndex(atoll(msisdn));
|
||||
|
||||
if(store_index<0) return -1;
|
||||
head = store_index /UNIT_STORE_ACCOUNT;
|
||||
tail = store_index % UNIT_STORE_ACCOUNT;
|
||||
@@ -1242,6 +1327,7 @@ int GetPPSSubsRecord(char *msisdn, _prepaid_info *shmp)
|
||||
}
|
||||
|
||||
/*-----------------subs management ----------------*/
|
||||
extern int ocs_add_ue_record(long long msisdn, int store_index);
|
||||
int CreatePPSSubsIndexTable()
|
||||
{
|
||||
int loop,len,head,tail,l;
|
||||
@@ -1309,7 +1395,15 @@ int CreatePPSSubsIndexTable()
|
||||
}
|
||||
|
||||
shmp->latch_flag = 0;
|
||||
|
||||
#ifdef OCS_WITH_CRM
|
||||
if(ocs_add_ue_record(atoll(msisdn), loop)==0)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,
|
||||
"msisdn %s is duplicated, delete!", msisdn);
|
||||
memset(shmp,0,sizeof(_prepaid_info));
|
||||
FreePPSStoreIndex(loop);
|
||||
}
|
||||
#else
|
||||
if(!AddPPSTableIndex(atoll(msisdn), loop))
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,
|
||||
@@ -1318,10 +1412,12 @@ int CreatePPSSubsIndexTable()
|
||||
FreePPSStoreIndex(loop);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
user_counter++;
|
||||
UserNumberIncrement();
|
||||
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
DebugMsg(debugmib.display.asciiOut,"total user: %d",user_counter);
|
||||
DebugMsg(debugmib.display.asciiOut,"free index: %d",
|
||||
@@ -1332,7 +1428,8 @@ int CreatePPSSubsIndexTable()
|
||||
return 1;
|
||||
}
|
||||
|
||||
int pps_real_update_user_file(int head, int tail);
|
||||
extern int pps_real_update_user_file(int head, int tail);
|
||||
extern int ocs_delete_ue_record(long long msisdn);
|
||||
int AddPPSSubsData(_prepaid_info *shmp)
|
||||
{
|
||||
int store_index,head,tail;
|
||||
@@ -1351,9 +1448,6 @@ int AddPPSSubsData(_prepaid_info *shmp)
|
||||
lmsisdn = atoll(msisdn);
|
||||
pdata_shmp = &ramshm_ptr->prepaid_data;
|
||||
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
RedisUpdateUserInfoFromOcs(shmp);
|
||||
#endif
|
||||
if(debugmib.measurement.usernumber>0)
|
||||
{
|
||||
store_index = FindPPSSubsStoreIndex(lmsisdn);
|
||||
@@ -1383,13 +1477,20 @@ int AddPPSSubsData(_prepaid_info *shmp)
|
||||
return -1;
|
||||
}
|
||||
//DebugMsg(debugmib.display.asciiOut,"Subs. %s does not exist,stored at: %d!\n",msisdn,store_index);
|
||||
#ifdef OCS_WITH_CRM
|
||||
if(ocs_add_ue_record(lmsisdn, store_index) == 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
|
||||
if(!AddPPSTableIndex(lmsisdn,store_index))
|
||||
{
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
head = store_index / UNIT_STORE_ACCOUNT;
|
||||
tail = store_index % UNIT_STORE_ACCOUNT;
|
||||
memcpy(&pdata_shmp->prepaid_info[head][tail],
|
||||
@@ -1419,10 +1520,15 @@ int ModifyPPSSubsData(_prepaid_info *shmp)
|
||||
BcdToAscii(msisdn,shmp->msisdn,9*2);
|
||||
msisdn[len] = 0;
|
||||
lmsisdn = atoll(msisdn);
|
||||
|
||||
#ifdef OCS_WITH_CRM
|
||||
store_index = ocs_get_ue_index(lmsisdn);
|
||||
|
||||
#else
|
||||
store_index = FindPPSSubsStoreIndex(lmsisdn);
|
||||
#endif
|
||||
|
||||
if(store_index==-1)
|
||||
if(store_index==-1 || store_index == INVALID_UE_INDEX)
|
||||
{
|
||||
//AddPPSSubsData(shmp);
|
||||
return 0;
|
||||
@@ -1436,16 +1542,13 @@ int ModifyPPSSubsData(_prepaid_info *shmp)
|
||||
sizeof(_prepaid_info));
|
||||
|
||||
pps_real_update_user_file(head, tail);
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
RedisUpdateUserInfoFromOcs(shmp);
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int DeletePPSSubsData(_prepaid_info *shmp)
|
||||
{
|
||||
int index, store_index;
|
||||
int store_index;
|
||||
int head, tail;
|
||||
|
||||
int len=0;
|
||||
@@ -1462,32 +1565,41 @@ int DeletePPSSubsData(_prepaid_info *shmp)
|
||||
}
|
||||
BcdToAscii(msisdn,shmp->msisdn,9*2);
|
||||
msisdn[len] = 0;
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
RedisDelUserInfoByMsisdn(msisdn);
|
||||
#endif
|
||||
lmsisdn = atoll(msisdn);
|
||||
|
||||
index = FindPPSTableIndex(lmsisdn);
|
||||
#ifdef OCS_WITH_CRM
|
||||
store_index = ocs_get_ue_index(lmsisdn);
|
||||
if(store_index == INVALID_UE_INDEX)
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"Subs. %s doesn't exist, cann't delete it!\n",msisdn);
|
||||
return 0;
|
||||
}
|
||||
ocs_delete_ue_record(lmsisdn);
|
||||
|
||||
DebugMsg(debugmib.display.asciiOut,"Delete subs %s ,stored at: %d!\n",msisdn, store_index);
|
||||
|
||||
#else
|
||||
int index = FindPPSTableIndex(lmsisdn);
|
||||
if(index==-1)
|
||||
{
|
||||
debugmib.watch_dog[50]++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
store_index = ramshm_ptr->index_data.index_table.prim_index[index].store_index;
|
||||
|
||||
if(store_index==-1)/* never set to -1? , 10-12 */
|
||||
{
|
||||
debugmib.watch_dog[51]++;
|
||||
printf("Subs. %s doesn't exist, cann't delete it!\n",msisdn);
|
||||
DebugMsg(debugmib.display.asciiOut,"Subs. %s doesn't exist, cann't delete it!\n",msisdn);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"Delete subs %s ,stored at: %d.%d!\n",msisdn,index,store_index);
|
||||
}
|
||||
|
||||
DeletePPSTableIndex(index,store_index);
|
||||
{
|
||||
DebugMsg(debugmib.display.asciiOut,"Delete subs %s ,stored at: %d.%d!\n",msisdn,index,store_index);
|
||||
}
|
||||
#endif
|
||||
|
||||
pdata_shmp = &ramshm_ptr->prepaid_data;
|
||||
|
||||
@@ -1578,6 +1690,7 @@ void ppsListAllSubsMSISDN()
|
||||
FILE *fp=NULL;
|
||||
_prepaid_info *shmp;
|
||||
char msisdn[32];
|
||||
char timebuf[128];
|
||||
|
||||
fp = fopen("/usr/local/subsManage/pps_msisdn.txt","w");
|
||||
if(fp==NULL)
|
||||
@@ -1599,11 +1712,39 @@ void ppsListAllSubsMSISDN()
|
||||
}
|
||||
BcdToAscii(msisdn,shmp->msisdn,(MAX_MSISDN_BLEN-1)*2);
|
||||
msisdn[len] = 0;
|
||||
fprintf(fp,"%05d %s\n", loop,msisdn);
|
||||
AsciiTime(timebuf,shmp->mo_expiration_date);
|
||||
fprintf(fp,"%05d %s-%d-%s-%.02f\n", loop,msisdn, shmp->status, timebuf, shmp->balance);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
void ppsAddBalanceToAll(int balance)
|
||||
{
|
||||
int len;
|
||||
int head,tail,loop;
|
||||
|
||||
_prepaid_info *shmp;
|
||||
//char msisdn[32];
|
||||
|
||||
for(loop=0;loop<MAX_SUBS_RECORD;loop++)
|
||||
{
|
||||
head = loop / UNIT_STORE_ACCOUNT;
|
||||
tail = loop % UNIT_STORE_ACCOUNT;
|
||||
|
||||
if(head>=MSISDN_HEAD_NUM) continue;
|
||||
shmp = &ramshm_ptr->prepaid_data.prepaid_info[head][tail];
|
||||
len = shmp->msisdn[MAX_MSISDN_BLEN-1];
|
||||
|
||||
if(len<2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
shmp->balance += balance;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*--------- real time write user/card data functions -------*/
|
||||
/*--------- definitions -------------------------------*/
|
||||
|
||||
+1642
-18
File diff suppressed because it is too large.
Load diff
+31
-80
@@ -594,7 +594,14 @@ int DecodeDeliverSM(SMPP_MSG *pMsg)
|
||||
shmp->process_info.sub_state = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
{
|
||||
strcpy((char *)shmp->called_info.number, short_message);
|
||||
shmp->process_info.state = S_SMMP_RECHAGE_ACCOUNT;
|
||||
shmp->process_info.sub_state = 2;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(pps_get_adaptor_flag())
|
||||
{
|
||||
strcpy((char *)shmp->called_info.number, short_message);
|
||||
@@ -670,13 +677,6 @@ int DecodeDeliverSM(SMPP_MSG *pMsg)
|
||||
{
|
||||
ocs_bundle_plan_query(shmp, short_message, 0, NULL);
|
||||
}
|
||||
else if(action == SRV_TELL_ME_NUMBER)
|
||||
{
|
||||
char ret_str[256];
|
||||
sprintf(ret_str, "%s %s", getSmsSentenceNative(0,SMS_TELL_ME_NUMBER), shmp->caller_info.number);
|
||||
|
||||
smppSendMOSM(shmp->caller_info.number, shmp->called_info.number,ret_str, strlen(ret_str), 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(0)
|
||||
@@ -701,11 +701,14 @@ int get_cos_bundle_control(int cos_id)
|
||||
|
||||
}
|
||||
|
||||
int subscribe_bundle_plan_send_used_up_info(char *caller_number, SMS_SENTENCE id, _state_data *shmp)
|
||||
int subscribe_bundle_plan_send_used_up_info(char *caller_number, SMS_SENTENCE id)
|
||||
{
|
||||
char sms_msg[256];
|
||||
char bundle_service_number[32];
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
return 0;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case SMS_BUNDLE_PLAN_DATA_USEDUP:
|
||||
@@ -716,33 +719,7 @@ int subscribe_bundle_plan_send_used_up_info(char *caller_number, SMS_SENTENCE id
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
char bundleName[64] = "";
|
||||
strcpy(bundleName, getSmsSentenceNative(0, SMS_BUNDLE_PLAN_ROAM_AND_NOTROAM));
|
||||
char *found = strchr(bundleName, ';');
|
||||
if (found != NULL)
|
||||
{
|
||||
*found = '\0';
|
||||
if ((shmp == NULL) || (shmp->process_info.bundle_flag == BUNDLE_HOME_PLMN))
|
||||
{
|
||||
found = bundleName;
|
||||
}
|
||||
else
|
||||
{
|
||||
found ++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
found = bundleName;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
sprintf(sms_msg, (char *)getSmsSentenceNative(0, id), found);
|
||||
#else
|
||||
sprintf(sms_msg, "%s" , getSmsSentenceNative(0, id));
|
||||
#endif
|
||||
sprintf(bundle_service_number, "%s",
|
||||
ppsParam.ppsTables.serviceNumber[CreditCardRechargeNumberPosition].number);
|
||||
|
||||
@@ -762,13 +739,16 @@ int subscribe_bundle_plan_send_warning_info(_state_data *shmp)
|
||||
long ret_value[10], data_warning_threshold = 2, data_warning_threshold_low=1, warning_sms_counter=0;
|
||||
|
||||
int cos_id;
|
||||
|
||||
if(OCS_with_external_CRM())
|
||||
return 0;
|
||||
|
||||
cos_id = GetAccountCosID(&shmp->caller_info);
|
||||
|
||||
data_warning_threshold = ppsParam.ppsTables.cosTable[cos_id].serviceControl[0].bundle_data_warning_threashold * 5;// COS
|
||||
data_warning_threshold_low = ppsParam.ppsTables.cosTable[cos_id].serviceControl[0].bundle_data_warning_threashold_low * 5;// COS
|
||||
|
||||
GetAccountBundlePlanInfo(&shmp->caller_info, ret_value, shmp);
|
||||
GetAccountBundlePlanInfo(&shmp->caller_info, ret_value);
|
||||
|
||||
warning_sms_counter = ret_value[5];
|
||||
if(warning_sms_counter >= 2)// warning_sms_flag, don't send warning SMS, if 2 threshold warning SMS is already sent.
|
||||
@@ -781,47 +761,15 @@ int subscribe_bundle_plan_send_warning_info(_state_data *shmp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
char bundleName[64] = "";
|
||||
strcpy(bundleName, getSmsSentenceNative(0, SMS_BUNDLE_PLAN_ROAM_AND_NOTROAM));
|
||||
char *found = strchr(bundleName, ';');
|
||||
if (found != NULL)
|
||||
{
|
||||
*found = '\0';
|
||||
if (shmp->process_info.bundle_flag == BUNDLE_HOME_PLMN)
|
||||
{
|
||||
found = bundleName;
|
||||
}
|
||||
else
|
||||
{
|
||||
found ++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
found = bundleName;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((ret_value[1] > 0) || (ret_value[3] > 0))
|
||||
{
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
sprintf(sms_msg, (char *)getSmsSentenceNative(0, SMS_BUNDLE_PLAN_DATA_WARN_HAS_V),
|
||||
ret_value[0], ret_value[1], ret_value[3], found);
|
||||
#else
|
||||
sprintf(sms_msg, (char *)getSmsSentenceNative(0, SMS_BUNDLE_PLAN_DATA_WARN_HAS_V),
|
||||
ret_value[0], ret_value[1], ret_value[3]);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef HAS_BUNDLE_ROAMING
|
||||
sprintf(sms_msg, (char *)getSmsSentenceNative(0, SMS_BUNDLE_PLAN_DATA_WARN),
|
||||
ret_value[0], found);
|
||||
#else
|
||||
sprintf(sms_msg, (char *)getSmsSentenceNative(0, SMS_BUNDLE_PLAN_DATA_WARN),
|
||||
ret_value[0]);
|
||||
#endif
|
||||
}
|
||||
|
||||
sprintf(bundle_service_number, "%s",
|
||||
@@ -1104,7 +1052,7 @@ int subscribe_bundle_plan_subs_index(_state_data *shmp, int plan_index, int meth
|
||||
|
||||
SendCDR(shmp->process_info.portid);
|
||||
|
||||
GetAccountBundlePlanInfo(&shmp->caller_info, ret_value, shmp);
|
||||
GetAccountBundlePlanInfo(&shmp->caller_info, ret_value);
|
||||
|
||||
AsciiTimeYMD(expire_date,ret_value[4]);
|
||||
|
||||
@@ -1174,7 +1122,7 @@ int ocs_bundle_plan_query(_state_data *shmp, char *sms, int method, char *ret_pr
|
||||
|
||||
if(1)
|
||||
{
|
||||
if(GetAccountBundlePlanInfo(&shmp->caller_info, (long *)ret_value, shmp))
|
||||
if(GetAccountBundlePlanInfo(&shmp->caller_info, (long *)ret_value))
|
||||
{
|
||||
AsciiTimeYMD(expire_date,ret_value[4]);
|
||||
|
||||
@@ -1224,9 +1172,9 @@ int subscribe_bundle_plan(_state_data *shmp, char *sms, int method, char *ret_pr
|
||||
char expire_date[64];
|
||||
char sms_msg[256];
|
||||
int menu_index=1;
|
||||
int cos_bundle_control=0;
|
||||
//int cos_bundle_control=0;
|
||||
|
||||
cos_bundle_control = get_cos_bundle_control(shmp->caller_info.cos_id);
|
||||
//cos_bundle_control = get_cos_bundle_control(shmp->caller_info.cos_id);
|
||||
|
||||
sms_len = strlen(sms);
|
||||
|
||||
@@ -1312,7 +1260,7 @@ int subscribe_bundle_plan(_state_data *shmp, char *sms, int method, char *ret_pr
|
||||
return 0;
|
||||
|
||||
{
|
||||
if(GetAccountBundlePlanInfo(&shmp->caller_info, (long *)ret_value, shmp))
|
||||
if(GetAccountBundlePlanInfo(&shmp->caller_info, (long *)ret_value))
|
||||
{
|
||||
AsciiTimeYMD(expire_date,ret_value[4]);
|
||||
|
||||
@@ -1647,7 +1595,7 @@ int smppSendMOSMReal(SMPP_MSG *sm_msg)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int smppSendMOSM(char *caller, char *called, u_char *msg, int msgLen,u_char dataCoding)
|
||||
int smppSendMOSM(char *called, char *caller, u_char *msg, int msgLen,u_char dataCoding)
|
||||
{
|
||||
static int smpp_sm_ref_id = 0;
|
||||
|
||||
@@ -1670,16 +1618,16 @@ int smppSendMOSM(char *caller, char *called, u_char *msg, int msgLen,u_char data
|
||||
sm_msg.pdu.submit_sm.source_addr_ton = 0x00;
|
||||
//Unknown , 1=international, 2=National
|
||||
sm_msg.pdu.submit_sm.source_addr_npi = 0x01; //ISDN
|
||||
strcpy(sm_msg.pdu.submit_sm.source_addr, called);
|
||||
strcpy(sm_msg.pdu.submit_sm.source_addr, caller);
|
||||
sm_msg.pdu.submit_sm.dest_addr_ton = 0x01; //National
|
||||
sm_msg.pdu.submit_sm.dest_addr_npi = 0x01; //ISDN
|
||||
strcpy(sm_msg.pdu.submit_sm.destination_addr, caller);
|
||||
strcpy(sm_msg.pdu.submit_sm.destination_addr, called);
|
||||
sm_msg.pdu.submit_sm.esm_class = 0x00;
|
||||
sm_msg.pdu.submit_sm.protocol_id = 0x00;
|
||||
sm_msg.pdu.submit_sm.priority_flag = 0x03;
|
||||
memset(sm_msg.pdu.submit_sm.schedule_delivery_time, 0,1);
|
||||
memset(sm_msg.pdu.submit_sm.validity_period, 0,1);
|
||||
sm_msg.pdu.submit_sm.registered_delivery = 0x10;//0x11;
|
||||
sm_msg.pdu.submit_sm.registered_delivery = 0x00;//0x11;
|
||||
sm_msg.pdu.submit_sm.replace_if_present_flag = 0x01;
|
||||
sm_msg.pdu.submit_sm.data_coding = dataCoding;
|
||||
sm_msg.pdu.submit_sm.sm_default_msg_id = 0x01;
|
||||
@@ -1911,6 +1859,9 @@ int fillMoneyAndDate(
|
||||
}
|
||||
memset(buf,0,128);
|
||||
totalLen += len;
|
||||
#ifdef _ZED_NO_CALLER_NUM_AND_EXPIRY_DATE_
|
||||
return totalLen;
|
||||
#endif
|
||||
if(strlen((char *)getSmsSentenceNative(0,SMS_EXPIRED_ON)) || !(flag&0x80))
|
||||
{
|
||||
sprintf(buf,",");
|
||||
@@ -1961,11 +1912,11 @@ int smppSendAccountInfo(char *caller, char *called,
|
||||
|
||||
char smMsgBuf[MAX_SMS_LEN*8]={0},buf[MAX_SMS_LEN*2]={0};
|
||||
u_char daybuf[32]={0},bcd_buf[140];
|
||||
int instance=0,len,totalLen;
|
||||
int len,totalLen;//instance=0,
|
||||
u_char dataCoding=0;
|
||||
int calltype = calltype0;
|
||||
|
||||
instance = (flag & 0x7f)%MAX_LANGUAGE_TYPES;
|
||||
//instance = (flag & 0x7f)%MAX_LANGUAGE_TYPES;
|
||||
//dataCoding = ppsParam.ppsTables.smsSentence[instance].smEncodeType;
|
||||
|
||||
memset(smMsgBuf,0,MAX_SMS_LEN*8);
|
||||
@@ -2170,7 +2121,7 @@ int GetAccountPromptInfo(_account_info *caller_info,char *prompt_info)
|
||||
|
||||
int smppSendActivicationInfo(_account_info *caller_info, char *called)
|
||||
{
|
||||
char account_info[256], msg_send[512], notify_sms[256];
|
||||
char account_info[256], msg_send[560], notify_sms[256];
|
||||
|
||||
GetAccountPromptInfo(caller_info, account_info);
|
||||
|
||||
|
||||
@@ -148,36 +148,20 @@ double GetBalanceWithPromotionControl(_state_data *stateProc,_account_info *ptr
|
||||
|
||||
if (ptr->head < MSISDN_HEAD_NUM && ptr->tail < UNIT_STORE_ACCOUNT)
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
OCS_usr_redis usr_redis;
|
||||
RedisGetUserBalance(&shmp->prepaid_info[ptr->head][ptr->tail], &usr_redis);
|
||||
if(usr_redis.usr_balance>=ppsParam.serviceControl.maxBalance)// balance overflow prevetion
|
||||
#else
|
||||
if(shmp->prepaid_info[ptr->head][ptr->tail].balance>=ppsParam.serviceControl.maxBalance)// balance overflow prevetion
|
||||
#endif
|
||||
shmp->prepaid_info[ptr->head][ptr->tail].status = T_SUSPEND;
|
||||
if(shmp->prepaid_info[ptr->head][ptr->tail].msisdn[MAX_MSISDN_BLEN-1]<=2)// msisdn length field
|
||||
return 0;
|
||||
if(GetExpiration(ptr) > tvnow.tv_sec)// check validity date
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
balance = usr_redis.usr_balance;
|
||||
#else
|
||||
balance = shmp->prepaid_info[ptr->head][ptr->tail].balance;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
pps_print_error(stateProc->process_info.logMsisdn,"[%05d]%s balance validity expired",stateProc->process_info.portid,ptr->number);
|
||||
if(isPromotionCanBeUsedAtThisPoint(stateProc))
|
||||
{
|
||||
if(GetPromotionExpiration(ptr)> tvnow.tv_sec)
|
||||
{
|
||||
#ifdef OCS_USE_REDIS_DB
|
||||
balance += usr_redis.pro_balance;
|
||||
#else
|
||||
balance += shmp->prepaid_info[ptr->head][ptr->tail].promo_balance;
|
||||
#endif
|
||||
}
|
||||
if(GetPromotionExpiration(ptr)> tvnow.tv_sec)
|
||||
balance += shmp->prepaid_info[ptr->head][ptr->tail].promo_balance ;
|
||||
else
|
||||
; //pps_print_error(stateProc->process_info.logMsisdn,"[%05d]%s promotion validity expired",stateProc->process_info.portid,ptr->number);
|
||||
}
|
||||
@@ -324,7 +308,7 @@ static void supplementaryServiceChangeBasciFee(_state_data *shmp,_bill_tariff *
|
||||
}
|
||||
}
|
||||
|
||||
static inline int getTierIndex(_state_data *shmp,_bill_tariff *ptar,u32 talkTime)
|
||||
static int getTierIndex(_state_data *shmp,_bill_tariff *ptar,u32 talkTime)
|
||||
{
|
||||
TIER_RATING *pTierRating;
|
||||
u8 tierNum,tierIndex;
|
||||
@@ -420,7 +404,7 @@ float getCurrentFee(_state_data *shmp)
|
||||
return pTierRating->rating[tier].base_fee + pTierRating->rating[tier].long_distance_fee;
|
||||
}
|
||||
|
||||
inline float BillingFormula(_state_data *shmp,_bill_tariff *ptar,int startTime)
|
||||
float BillingFormula(_state_data *shmp,_bill_tariff *ptar,int startTime)
|
||||
{
|
||||
float num=0;
|
||||
u8 index;
|
||||
@@ -464,6 +448,9 @@ float TimeToCharge(_state_data *shmp,_bill_tariff *ptar, int duration,int begin_
|
||||
for (i=1; i<=itimes; i++)
|
||||
{
|
||||
curr_time = begin_time + unit_time * (i - 1);
|
||||
if(OCS_with_external_CRM())//query tariff from CRM database
|
||||
discount = shmp->process_info.rest_if.tariff_discount;
|
||||
else
|
||||
discount = GetDiscount(curr_time,ptar->discountID);
|
||||
if (i <= ptar->mini_unit && (!init_bill))
|
||||
{
|
||||
|
||||
@@ -710,11 +710,11 @@ static long getVasTotalFee(_state_data *shmp,u_char authOrCharge,u_char *failR
|
||||
static int vasPreAuth(_state_data *shmp,u_char *failReason)
|
||||
{
|
||||
_gprs_process *vasProc;
|
||||
u_short portid;
|
||||
//u_short portid;
|
||||
float balance;
|
||||
long totalChargedFee;
|
||||
|
||||
portid = shmp->process_info.portid;
|
||||
//portid = shmp->process_info.portid;
|
||||
vasProc = &shmp->process_info.ppsService.gprs_process;
|
||||
|
||||
totalChargedFee = getVasTotalFee(shmp,VAS_SELECT_PREAUTH,failReason);
|
||||
@@ -787,12 +787,12 @@ static int vasChargeNow(_state_data *shmp,float fee,u_char *peerAddr)
|
||||
|
||||
static int vasCharge(_state_data *shmp,u_char *failReason)
|
||||
{
|
||||
_gprs_process *vasProc;
|
||||
u_short portid;
|
||||
//_gprs_process *vasProc;
|
||||
//u_short portid;
|
||||
long totalChargedFee;
|
||||
|
||||
portid = shmp->process_info.portid;
|
||||
vasProc = &shmp->process_info.ppsService.gprs_process;
|
||||
//portid = shmp->process_info.portid;
|
||||
//vasProc = &shmp->process_info.ppsService.gprs_process;
|
||||
|
||||
totalChargedFee = getVasTotalFee(shmp,VAS_SELECT_CHARGE,failReason);
|
||||
switch(totalChargedFee)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
create:
|
||||
cp -f ../lib/*.o .
|
||||
cp -f ../main/*.o .
|
||||
ar r libpps.a loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o 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 capmsg.o smppapi.o precard.o dailyreport.o rammng.o ppsm.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 pps_redis.o
|
||||
ar r libpps.a loadtl.o message.o mfunc.o ppsmib.o ppsMibTable.o 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 capmsg.o smppapi.o precard.o dailyreport.o rammng.o ppsm.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
|
||||
# rm -f ../../wxc2app/applib/pps/libpps.a
|
||||
# cp -uf libpps.a /home/mnp/wxc2app/applib/pps
|
||||
clean:
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
V 170618165451Z 00 unknown /DC=com/DC=example/CN=OCSP Signer for Test Certifying CA
|
||||
V 170618165451Z 01 unknown /DC=com/DC=example/mail=root@example.com/CN=localhost
|
||||
V 170618165451Z 00 unknown /DC=com/DC=example/CN=OCSP Signer for Test Certifying CA
|
||||
V 170618165451Z 01 unknown /DC=com/DC=example/mail=root@example.com/CN=localhost
|
||||
@@ -28,6 +28,7 @@ static long gx_start_ts = 0;
|
||||
|
||||
static int gx_rec_ccr( struct msg ** msg, struct avp * avp, struct session * sess, void * opaque, enum disp_action * act);
|
||||
static void gx_rec_cca(void *para, struct msg **msg);
|
||||
_gy_port *gy_get_port_by_cxt_id(char *cxt_id);
|
||||
|
||||
static struct disp_hdl * ccr_cb_hdl = NULL; /* handler for ccr req cb */
|
||||
//static struct disp_hdl * cca_cb_hdl = NULL; /* handler for cca req cb */
|
||||
@@ -186,10 +187,35 @@ static void gy_port_init(_gy_port *gy_port_ptr, int index)
|
||||
return ;
|
||||
}
|
||||
|
||||
// start==================================
|
||||
static int print_duplicated_sess_id(const char *cxt_id)
|
||||
{
|
||||
int loop=0;
|
||||
FILE *fpSess=NULL;
|
||||
|
||||
fpSess = fopen("../log/dul_sess_id.txt","a");
|
||||
if(fpSess == NULL)
|
||||
return 0;
|
||||
|
||||
fprintf(fpSess,"now ts=%ld, sess: %s\r\n", ts_sec, cxt_id);
|
||||
|
||||
fclose(fpSess);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int gy_assign_port(char *cxt_id)
|
||||
{
|
||||
int i, index, retval = INVALID_GY_PORT;
|
||||
_gy_port *gy_port_ptr = NULL;
|
||||
|
||||
// check if session id already in use========start
|
||||
gy_port_ptr = gy_get_port_by_cxt_id(cxt_id);
|
||||
if (gy_port_ptr != NULL)
|
||||
{
|
||||
print_duplicated_sess_id(cxt_id);
|
||||
return retval;
|
||||
}
|
||||
|
||||
CHECK_POSIX_DO( pthread_mutex_lock(&gy_port_lock), { ASSERT(0); } );
|
||||
|
||||
@@ -244,6 +270,7 @@ int gy_release_port(unsigned short index)
|
||||
if(gy_port_ptr->used_flag)
|
||||
{
|
||||
pthread_mutex_lock(&sess_hash_mutx);
|
||||
if(g_sess_hash != NULL)
|
||||
g_hash_table_remove(g_sess_hash, gy_port_ptr->context_id);// delete hash index
|
||||
pthread_mutex_unlock(&sess_hash_mutx);
|
||||
|
||||
@@ -437,24 +464,26 @@ int free_gx_sm(struct gx_sm_t *sm)
|
||||
|
||||
int fd_get_session_id(char *src_buf, char *dst_buf, int flag)
|
||||
{
|
||||
char *first_off, *second_off, *third_off;
|
||||
int len;
|
||||
//int len;
|
||||
|
||||
first_off = strchr(src_buf, ';');
|
||||
second_off = strchr(first_off+1, ';');
|
||||
third_off = strchr(second_off+1, ';');
|
||||
len = third_off - second_off -1;
|
||||
//second_off = strchr(first_off+1, ';');
|
||||
//third_off = strchr(second_off+1, ';');
|
||||
//len = third_off - second_off -1;
|
||||
|
||||
//if(flag == 0)
|
||||
if(0)
|
||||
/*if(0)
|
||||
{
|
||||
memcpy(dst_buf, second_off+1, len);
|
||||
dst_buf[len] = '\0';
|
||||
}
|
||||
}*/
|
||||
|
||||
if(1)
|
||||
{
|
||||
char *first_off;//, *second_off, *third_off;
|
||||
first_off = strchr(src_buf, ';');
|
||||
strcpy(dst_buf, first_off+1);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -748,7 +777,7 @@ static int gx_parse_cca( struct msg ** msg)
|
||||
|
||||
if(gy_msg.request_type == RT_TERMINATE_REQUEST ||
|
||||
gy_msg.request_type == RT_EVENT_REQUEST ||
|
||||
cca_ptr->result != 2001)
|
||||
(cca_ptr->result != 2001 && gy_msg.request_type != RT_UPDATE_REQUEST))
|
||||
{
|
||||
unsigned int gy_port;
|
||||
|
||||
@@ -796,7 +825,8 @@ static int gx_parse_ccr( struct msg ** msg, struct gy_msg *gy_ptr)
|
||||
memcpy(sess_id, avphdr->avp_value->os.data, avphdr->avp_value->os.len);
|
||||
sess_id[avphdr->avp_value->os.len] = '\0';
|
||||
//sprintf(sess_id, "%s",avphdr->avp_value->os.data);
|
||||
fd_get_session_id(sess_id, gy_ptr->cxt_id, 0);
|
||||
//fd_get_session_id(sess_id, gy_ptr->cxt_id, 0);
|
||||
strcpy(gy_ptr->cxt_id, sess_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -986,22 +1016,6 @@ static int gx_parse_ccr( struct msg ** msg, struct gy_msg *gy_ptr)
|
||||
}
|
||||
}
|
||||
|
||||
/* 3GPP-User-Location-Info */
|
||||
struct dict_object *tgpp_user_loc_info = NULL;
|
||||
SEARCH_AVP_("3GPP-User-Location-Info", 10415, &tgpp_user_loc_info);
|
||||
PARSE_GRPAVP_STR(groupedavp_sub, tgpp_user_loc_info, avp, avphdr, "Parse CCR 3GPP-User-Location-Info", avphdr->avp_value->os.data)
|
||||
if(avphdr != NULL )
|
||||
{
|
||||
if(avphdr->avp_value != NULL)
|
||||
{
|
||||
if((avphdr->avp_value->os.data != NULL) && (avphdr->avp_value->os.data[0]==0x82))// TAI and ECGI
|
||||
{
|
||||
memcpy(&gy_ptr->msg_body.ccr.cellid, &avphdr->avp_value->os.data[1], 5);// mcc, mnc and tac
|
||||
gy_ptr->msg_body.ccr.cellid[5] = 0x00;
|
||||
gy_ptr->msg_body.ccr.cellid[6] = avphdr->avp_value->os.data[12];// CellId
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1260,8 +1274,7 @@ static int gx_parse_ccr( struct msg ** msg, struct gy_msg *gy_ptr)
|
||||
PARSE_AVP_U32(ccr_msg, multiple_services_indicator, avp, avphdr, "Parse CCR Multiple-Services-Indicator", avphdr->avp_value->u32)
|
||||
|
||||
/* Multiple-Services-Credit-Control */
|
||||
gy_ptr->msg_body.ccr.mscc_presented = 0;
|
||||
gy_ptr->msg_body.ccr.used_unit = 0;
|
||||
//gy_ptr->msg_body.ccr.mscc_presented = 0;
|
||||
struct dict_object *multiple_services_credit_control = NULL;
|
||||
SEARCH_AVP_("Multiple-Services-Credit-Control", 0, &multiple_services_credit_control);
|
||||
CHECK_FCT( fd_msg_search_avp ( ccr_msg, multiple_services_credit_control, &groupedavp) );
|
||||
@@ -1272,7 +1285,7 @@ static int gx_parse_ccr( struct msg ** msg, struct gy_msg *gy_ptr)
|
||||
{
|
||||
LOG_N("fj Parse CCR Multiple-Services-Credit-Control");
|
||||
|
||||
gy_ptr->msg_body.ccr.mscc_presented = 1;
|
||||
//gy_ptr->msg_body.ccr.mscc_presented = 1;
|
||||
/* Requested-Service-Unit */
|
||||
struct dict_object *requested_service_unit = NULL;
|
||||
SEARCH_AVP_("Requested-Service-Unit", 0, &requested_service_unit);
|
||||
@@ -1442,7 +1455,7 @@ int gx_send_cca(_gy_msg *gy_ptr)
|
||||
long granted_value = gy_ptr->msg_body.cca.grant_value;
|
||||
int port = gy_ptr->fd_port;
|
||||
_gy_port *gy_port = NULL;
|
||||
//long valid_time_len = 900;
|
||||
long valid_time_len = 900;
|
||||
|
||||
gy_port = gy_get_port_space(port);
|
||||
if(gy_port == NULL)
|
||||
@@ -1479,23 +1492,23 @@ int gx_send_cca(_gy_msg *gy_ptr)
|
||||
{
|
||||
EN_AVP_U32(result_code, gy_ptr->msg_body.cca.result, ans, "fj CCA Result-Code");
|
||||
}
|
||||
else if (gy_ptr->msg_body.ccr.mscc_presented==0)
|
||||
/*else if (gy_ptr->msg_body.ccr.mscc_presented==0)
|
||||
{
|
||||
int result = gy_ptr->msg_body.cca.result;
|
||||
if (result < 2001)
|
||||
{
|
||||
result = 2001;
|
||||
}
|
||||
//else if (result == 4012)
|
||||
//{
|
||||
// result = 4547;
|
||||
//}
|
||||
else if (result != 2001)
|
||||
else if (resutl == 4012)
|
||||
{
|
||||
result = 4547;
|
||||
}
|
||||
else if (resutl != 2001)
|
||||
{
|
||||
result = 5012;
|
||||
}
|
||||
EN_AVP_U32(result_code, result, ans, "fj CCA Result-Code");
|
||||
}
|
||||
}*/
|
||||
else
|
||||
{
|
||||
CHECK_FCT_DO( fd_msg_rescode_set( ans, "DIAMETER_SUCCESS", NULL, NULL, 1 ), goto out );
|
||||
@@ -1514,7 +1527,7 @@ int gx_send_cca(_gy_msg *gy_ptr)
|
||||
EN_AVP_U32(check_balance_result, gy_ptr->msg_body.cca.check_balance_result, ans, "fj CCA check_balance_result");
|
||||
}
|
||||
}
|
||||
else if(gy_ptr->msg_body.ccr.mscc_presented > 0)
|
||||
else// if (gy_ptr->msg_body.ccr.mscc_presented)
|
||||
/* Multiple-Services-Credit-Control */
|
||||
{
|
||||
CHECK_FCT_DO( fd_msg_avp_new ( multiple_services_credit_control, 0, &grpavp ), goto out );
|
||||
@@ -1551,7 +1564,7 @@ int gx_send_cca(_gy_msg *gy_ptr)
|
||||
}
|
||||
|
||||
struct dict_object *valid_time = NULL;
|
||||
EN_GRPAVP_U32("Validity-Time", 0, valid_time, gy_ptr->msg_body.cca.validity_time);//valid_time_len);
|
||||
EN_GRPAVP_U32("Validity-Time", 0, valid_time, valid_time_len);
|
||||
|
||||
if (gy_ptr->request_type != RT_TERMINATE_REQUEST)
|
||||
{
|
||||
@@ -1594,7 +1607,14 @@ int gx_send_cca(_gy_msg *gy_ptr)
|
||||
EN_GRPAVP_U32("Volume-Quota-Threshold", 10415, volume_threshold, gy_ptr->msg_body.cca.volume_threshold);
|
||||
|
||||
struct dict_object *quota_hold_time = NULL;
|
||||
EN_GRPAVP_U32("Quota-Holding-Time", 10415, quota_hold_time, gy_ptr->msg_body.cca.time_threshold);
|
||||
EN_GRPAVP_U32("Quota-Holding-Time", 10415, quota_hold_time, gy_ptr->msg_body.cca.time_threshold + 10);
|
||||
|
||||
if(1)
|
||||
{
|
||||
struct dict_object *time_threshold = NULL;
|
||||
EN_GRPAVP_U32("Time-Quota-Threshold", 10415, time_threshold, gy_ptr->msg_body.cca.time_threshold);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CHECK_FCT_DO( fd_msg_avp_add( ans, MSG_BRW_LAST_CHILD, grpavp ), goto out );
|
||||
@@ -1815,7 +1835,7 @@ int gx_send_ccr_real(struct gx_sm_t **sm , struct dict_object *cmd_r, _gy_msg *m
|
||||
gx_stat_increase_send_ccr(msg_ptr->request_type);
|
||||
|
||||
/* Create the request from template */
|
||||
CHECK_FCT_DO( fd_msg_new( cmd_r, MSGFL_ALLOC_ETEID, &req ), goto out );
|
||||
CHECK_FCT_DO( fd_msg_new( cmd_r, MSGFL_ALLOC_ETEID, &req ), goto out1 );
|
||||
|
||||
/* set application id */
|
||||
{
|
||||
@@ -1872,11 +1892,32 @@ int gx_send_ccr_real(struct gx_sm_t **sm , struct dict_object *cmd_r, _gy_msg *m
|
||||
CHECK_FCT_DO( fd_msg_avp_add( req, MSG_BRW_FIRST_CHILD, avp ), goto out );
|
||||
}
|
||||
|
||||
char *pRealm = g_sh_conf_ext.pi_diamid_realm_peer, *pHost = g_sh_conf_ext.pi_diamid_peer;
|
||||
if ((msg_ptr->service_type == ST_CS_SMS) || (msg_ptr->service_type == ST_CS_VOICE))
|
||||
{
|
||||
GetRoDiamIdPeer(&pRealm, &pHost, (msg_ptr->service_type == ST_CS_SMS)?1:0);
|
||||
}
|
||||
if (pRealm == NULL || pHost == NULL)
|
||||
{
|
||||
LOG_N("fj gx_send_ccr_real, no link available, pRealm[%p], pHost[%p]", pRealm, pHost);
|
||||
return 0;
|
||||
}
|
||||
/*if ((msg_ptr->service_type == ST_CS_SMS) && (g_rosms_conf_ext.pi_diamid_realm_peer!=NULL) && (g_rosms_conf_ext.pi_diamid_peer!=NULL))
|
||||
{
|
||||
pRealm = g_rosms_conf_ext.pi_diamid_realm_peer;
|
||||
pHost = g_rosms_conf_ext.pi_diamid_peer;
|
||||
}
|
||||
else if ((msg_ptr->service_type == ST_CS_VOICE) && (g_rovoice_conf_ext.pi_diamid_realm_peer!=NULL) && (g_rovoice_conf_ext.pi_diamid_peer!=NULL))
|
||||
{
|
||||
pRealm = g_rovoice_conf_ext.pi_diamid_realm_peer;
|
||||
pHost = g_rovoice_conf_ext.pi_diamid_peer;
|
||||
}*/
|
||||
|
||||
/* Destination-Realm */
|
||||
EN_AVP_STR(dest_realm, g_sh_conf_ext.pi_diamid_realm_peer, req, "fj CCR Destination-Realm Ok");
|
||||
EN_AVP_STR(dest_realm, pRealm, req, "fj CCR Destination-Realm Ok");
|
||||
|
||||
/* Destination-Host */
|
||||
EN_AVP_STR(dest_host, g_sh_conf_ext.pi_diamid_peer, req, "fj CCR Destination-Host-Ok");
|
||||
EN_AVP_STR(dest_host, pHost, req, "fj CCR Destination-Host-Ok");
|
||||
|
||||
/* Origin-Host & Origin-Realm */
|
||||
CHECK_FCT_DO( fd_msg_add_origin ( req, 0 ), goto out );
|
||||
@@ -1887,12 +1928,14 @@ int gx_send_ccr_real(struct gx_sm_t **sm , struct dict_object *cmd_r, _gy_msg *m
|
||||
/* Service-Context-ID */
|
||||
if(msg_ptr->service_type == ST_CS_SMS)
|
||||
{
|
||||
EN_AVP_STR(service_cxt_id, "agrandtech_sms@3gpp.org", req, "fj CCR Service-Context-ID Ok");
|
||||
//EN_AVP_STR(service_cxt_id, "agrandtech_sms@3gpp.org", req, "fj CCR Service-Context-ID Ok");
|
||||
EN_AVP_STR(service_cxt_id, fd_g_config->service_context_sms, req, "fj CCR Service-Context-ID Ok");
|
||||
//EN_AVP_STR(route_record, "ocsclient.seagullCTF.org", req , "fj CCR Route-Record OK");
|
||||
}
|
||||
else
|
||||
{
|
||||
EN_AVP_STR(service_cxt_id, "agrandtech_ro@3gpp.org", req, "fj CCR Service-Context-ID Ok");
|
||||
//EN_AVP_STR(service_cxt_id, "agrandtech_ro@3gpp.org", req, "fj CCR Service-Context-ID Ok");
|
||||
EN_AVP_STR(service_cxt_id, fd_g_config->service_context_voice, req, "fj CCR Service-Context-ID Ok");
|
||||
}
|
||||
|
||||
/* CC-Request-Type */
|
||||
@@ -2049,7 +2092,7 @@ int gx_send_ccr_real(struct gx_sm_t **sm , struct dict_object *cmd_r, _gy_msg *m
|
||||
struct dict_object *service_specific_info = NULL;
|
||||
SEARCH_AVP_("Service-Specific-Info", SH_VND_ID, &service_specific_info);
|
||||
CHECK_FCT_DO( fd_msg_avp_new ( service_specific_info, 0, &grpavp_sub2 ), goto out);
|
||||
{ /* ������ҪӦ�ò�������� */
|
||||
{ /* 根据需要应用层填入参数 */
|
||||
EN_GRPAVP_U32_("Service-Specific-Type", SH_VND_ID, dict_obj_tmp, 6006, grpavp_sub2)
|
||||
EN_GRPAVP_STR("Service-Specific-Data", SH_VND_ID, dict_obj_tmp, msg_ptr->msg_body.ccr.cellid, grpavp_sub2)
|
||||
CHECK_FCT_DO( fd_msg_avp_add( grpavp_sub1, MSG_BRW_LAST_CHILD, grpavp_sub2 ), goto out );
|
||||
@@ -2065,6 +2108,7 @@ int gx_send_ccr_real(struct gx_sm_t **sm , struct dict_object *cmd_r, _gy_msg *m
|
||||
|
||||
EN_GRPAVP_U32_("Node-Functionality", SH_VND_ID, dict_obj_tmp, 6, grpavp_sub1)
|
||||
|
||||
|
||||
if(msg_ptr->msg_body.ccr.cellid_presented == 1)
|
||||
{
|
||||
|
||||
@@ -2072,7 +2116,7 @@ int gx_send_ccr_real(struct gx_sm_t **sm , struct dict_object *cmd_r, _gy_msg *m
|
||||
struct dict_object *service_specific_info = NULL;
|
||||
SEARCH_AVP_("Service-Specific-Info", SH_VND_ID, &service_specific_info);
|
||||
CHECK_FCT_DO( fd_msg_avp_new ( service_specific_info, 0, &grpavp_sub2 ), goto out);
|
||||
{ /* ������ҪӦ�ò�������� */
|
||||
{ /* 根据需要应用层填入参数 */
|
||||
EN_GRPAVP_U32_("Service-Specific-Type", SH_VND_ID, dict_obj_tmp, 6006, grpavp_sub2)
|
||||
EN_GRPAVP_STR("Service-Specific-Data", SH_VND_ID, dict_obj_tmp, msg_ptr->msg_body.ccr.cellid, grpavp_sub2)
|
||||
CHECK_FCT_DO( fd_msg_avp_add( grpavp_sub1, MSG_BRW_LAST_CHILD, grpavp_sub2 ), goto out );
|
||||
@@ -2110,7 +2154,7 @@ int gx_send_ccr_real(struct gx_sm_t **sm , struct dict_object *cmd_r, _gy_msg *m
|
||||
EN_GRPAVP_STR("Originating-IOI", SH_VND_ID, dict_obj_tmp, fd_g_config->cnf_diamid, grpavp_sub2)
|
||||
|
||||
// EN_GRPAVP_STR("Originating-IOI", SH_VND_ID, dict_obj_tmp, "agrandtech_ocs@3gpp.org", grpavp_sub2)
|
||||
EN_GRPAVP_STR("Terminating-IOI", SH_VND_ID, dict_obj_tmp, g_sh_conf_ext.pi_diamid_peer, grpavp_sub2)
|
||||
EN_GRPAVP_STR("Terminating-IOI", SH_VND_ID, dict_obj_tmp, pHost, grpavp_sub2)
|
||||
|
||||
CHECK_FCT_DO( fd_msg_avp_add( grpavp_sub1, MSG_BRW_LAST_CHILD, grpavp_sub2 ), goto out );
|
||||
}
|
||||
@@ -2148,7 +2192,23 @@ int gx_send_ccr_real(struct gx_sm_t **sm , struct dict_object *cmd_r, _gy_msg *m
|
||||
}
|
||||
}
|
||||
|
||||
if(msg_ptr->msg_body.ccr.cellid_presented == 1)
|
||||
{
|
||||
if (msg_ptr->msg_body.ccr.cellid[3] == 'F')
|
||||
{
|
||||
char mcc[8]="";
|
||||
strncpy(mcc, msg_ptr->msg_body.ccr.cellid, 3);
|
||||
sprintf(tmp_buf, "3GPP-GERAN;cgi-3gpp=%s%s", mcc, &msg_ptr->msg_body.ccr.cellid[4]);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(tmp_buf, "3GPP-GERAN;cgi-3gpp=%s", msg_ptr->msg_body.ccr.cellid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(tmp_buf, "XDSL;'location-info=%s'", phostAddr );
|
||||
}
|
||||
EN_GRPAVP_STR("Access-Network-Information", SH_VND_ID, dict_obj_tmp, tmp_buf, grpavp_sub1)
|
||||
|
||||
if(msg_ptr->msg_body.ccr.role_of_node == 2)
|
||||
@@ -2563,6 +2623,9 @@ int gx_send_ccr_real(struct gx_sm_t **sm , struct dict_object *cmd_r, _gy_msg *m
|
||||
CHECK_FCT_DO( fd_msg_send( &req, gx_rec_cca, NULL ), goto out );
|
||||
|
||||
out:
|
||||
if(req != NULL)
|
||||
fd_msg_free(req);
|
||||
out1:
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3168,7 +3231,7 @@ int gx_send_ccr_from_client(struct gy_msg *gy_ptr)
|
||||
|
||||
gy_port_ptr->service_type = gy_ptr->request_type;
|
||||
gy_port_ptr->as_client = 1;
|
||||
|
||||
fd_sess_destroy(&gy_sess[sh_port]);
|
||||
gy_sess[sh_port] = NULL;
|
||||
}
|
||||
else
|
||||
@@ -3218,7 +3281,17 @@ int gx_release_port_for_timerout(unsigned short pid)
|
||||
|
||||
}
|
||||
|
||||
CHECK_POSIX_DO( pthread_mutex_lock(&gy_port_lock), { ASSERT(0); } );
|
||||
if(1)
|
||||
{
|
||||
gy_port_init(gy_port, pid);
|
||||
gy_space.used_ports --;
|
||||
}
|
||||
else
|
||||
{
|
||||
gy_release_port(pid);
|
||||
}
|
||||
CHECK_POSIX_DO( pthread_mutex_unlock(&gy_port_lock), { ASSERT(0); } );
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -73,15 +73,17 @@ static int ta_init_peer_addr(struct peer_info* inf)
|
||||
static void peer_free_cb(struct peer_info *died_peer, void *cb_data)
|
||||
{
|
||||
LOG_N("peer_free_cb.%p %p", died_peer, cb_data);
|
||||
SH_CONF_S *ptr = (SH_CONF_S *)cb_data;
|
||||
if(NULL == died_peer && MODE_CLI == ta_conf->mode)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(g_sh_conf_ext.pi_diamid_peer);
|
||||
inf.pi_diamid = strdup(ptr->pi_diamid_peer);//strdup(g_sh_conf_ext.pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = ptr->peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, NULL));
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, ptr));//NULL));
|
||||
}
|
||||
}
|
||||
static int ta_conf_init(void)
|
||||
@@ -99,14 +101,74 @@ static int ta_conf_init(void)
|
||||
ta_conf->mode = g_sh_conf_ext.mode;
|
||||
/* fj added 20170114. only diameter client connect to peer. In this case, connect to peer when started. */
|
||||
if(MODE_CLI == ta_conf->mode)
|
||||
{
|
||||
if (g_sh_conf_ext.pi_diamid_peer != NULL)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(g_sh_conf_ext.pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = g_sh_conf_ext.peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, &g_sh_conf_ext));
|
||||
}
|
||||
|
||||
int i=0;
|
||||
SH_CONF_S *pcfg = NULL;
|
||||
for (i=0; i<rolkset.smslknum; i++)
|
||||
{
|
||||
pcfg = &rolkset.smslk[i].cfg;
|
||||
if (pcfg->pi_diamid_peer != NULL)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(pcfg->pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = pcfg->peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, NULL));
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, pcfg));
|
||||
}
|
||||
}
|
||||
for (i=0; i<rolkset.voicelknum; i++)
|
||||
{
|
||||
pcfg = &rolkset.voicelk[i].cfg;
|
||||
if (pcfg->pi_diamid_peer != NULL)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(pcfg->pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = pcfg->peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, pcfg));
|
||||
}
|
||||
}
|
||||
/*if (g_rosms_conf_ext.pi_diamid_peer != NULL)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(g_rosms_conf_ext.pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = g_rosms_conf_ext.peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, &g_rosms_conf_ext));
|
||||
}
|
||||
|
||||
if (g_rovoice_conf_ext.pi_diamid_peer != NULL)
|
||||
{
|
||||
struct peer_info inf;
|
||||
memset(&inf, 0, sizeof(inf));
|
||||
inf.pi_diamid = strdup(g_rovoice_conf_ext.pi_diamid_peer);
|
||||
inf.config.pic_flags.sec = PI_SEC_NONE;
|
||||
inf.config.pic_port = g_rovoice_conf_ext.peer_port;
|
||||
// ta_init_peer_addr( (struct peer_info*)(&inf.pi_endpoints) );
|
||||
|
||||
ASSERT( 0 == fd_peer_add(&inf, __FILE__, peer_free_cb, &g_rovoice_conf_ext));
|
||||
}*/
|
||||
}
|
||||
|
||||
ta_conf->dest_realm = strdup(fd_g_config->cnf_diamrlm);
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
{ \
|
||||
SEARCH_AVP_(udr_search_name, vendor_id, &udr); \
|
||||
CHECK_FCT_DO( fd_msg_avp_new ( udr, 0, &avp ), goto out ); \
|
||||
val.os.data = (uint8_t*)strdup(str); \
|
||||
val.os.data = (uint8_t*)(str); \
|
||||
val.os.len = strlen(str); \
|
||||
CHECK_FCT_DO( fd_msg_avp_setvalue( avp, &val ), goto out ); \
|
||||
CHECK_FCT_DO( fd_msg_avp_add( grpavp, MSG_BRW_LAST_CHILD, avp ), goto out ); \
|
||||
@@ -129,7 +129,7 @@
|
||||
{ \
|
||||
SEARCH_AVP_(udr_search_name, vendor_id, &udr); \
|
||||
CHECK_FCT_DO( fd_msg_avp_new ( udr, 0, &avp ), goto out ); \
|
||||
val.os.data = (uint8_t*)malloc(str_len); \
|
||||
val.os.data = (uint8_t*)(str); \
|
||||
memcpy(val.os.data, str, str_len);\
|
||||
val.os.len = str_len; \
|
||||
CHECK_FCT_DO( fd_msg_avp_setvalue( avp, &val ), goto out ); \
|
||||
|
||||
@@ -1,7 +1,131 @@
|
||||
#include "sh_conf.h"
|
||||
|
||||
Ro_LinkSet rolkset={0,0};
|
||||
|
||||
int GetRoDiamIdPeer(DiamId_t **realm, DiamId_t **host, int bSms)
|
||||
{
|
||||
struct peer_hdr*peer = NULL;
|
||||
SH_CONF_S *pcfg = NULL;
|
||||
int i;
|
||||
int ret = -1;
|
||||
int peer_state = -1;
|
||||
if (bSms)
|
||||
{
|
||||
int curlk = rolkset.cursmslk;
|
||||
for (i=0; i<rolkset.smslknum; i++)
|
||||
{
|
||||
curlk = (curlk + i +1) % rolkset.smslknum;
|
||||
pcfg = &rolkset.smslk[curlk].cfg;
|
||||
if (pcfg->pi_diamid_peer != NULL)
|
||||
{
|
||||
ret = fd_peer_getbyid(pcfg->pi_diamid_peer, strlen(pcfg->pi_diamid_peer), 0, &peer);
|
||||
if( !ret && peer )
|
||||
{
|
||||
peer_state = fd_peer_get_state(peer);
|
||||
if( STATE_OPEN == peer_state )
|
||||
{
|
||||
if (rolkset.smslk[curlk].bconn == 0)
|
||||
{
|
||||
printf("diam peer disconn to conn, host[%s]\r\n", pcfg->pi_diamid_peer);
|
||||
rolkset.smslk[curlk].bconn = 1;
|
||||
}
|
||||
*realm = pcfg->pi_diamid_realm_peer;
|
||||
*host = pcfg->pi_diamid_peer;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rolkset.smslk[curlk].bconn == 1)
|
||||
{
|
||||
printf("diam peer conn to discon, host[%s]\r\n", pcfg->pi_diamid_peer);
|
||||
rolkset.smslk[curlk].bconn = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("diam peer NA, host[%s], ret[%d], peer[%p]\r\n", pcfg->pi_diamid_peer, ret, peer);
|
||||
rolkset.smslk[curlk].bconn = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int curlk = rolkset.curvoicelk;
|
||||
for (i=0; i<rolkset.voicelknum; i++)
|
||||
{
|
||||
curlk = (curlk + i +1) % rolkset.voicelknum;
|
||||
pcfg = &rolkset.voicelk[curlk].cfg;
|
||||
if (pcfg->pi_diamid_peer != NULL)
|
||||
{
|
||||
ret = fd_peer_getbyid(pcfg->pi_diamid_peer, strlen(pcfg->pi_diamid_peer), 0, &peer);
|
||||
if( !ret && peer )
|
||||
{
|
||||
peer_state = fd_peer_get_state(peer);
|
||||
if( STATE_OPEN == peer_state )
|
||||
{
|
||||
if (rolkset.voicelk[curlk].bconn == 0)
|
||||
{
|
||||
printf("diam peer disconn to conn, host[%s]\r\n", pcfg->pi_diamid_peer);
|
||||
rolkset.voicelk[curlk].bconn = 1;
|
||||
}
|
||||
*realm = pcfg->pi_diamid_realm_peer;
|
||||
*host = pcfg->pi_diamid_peer;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rolkset.voicelk[curlk].bconn == 1)
|
||||
{
|
||||
printf("diam peer conn to discon, host[%s]\r\n", pcfg->pi_diamid_peer);
|
||||
rolkset.voicelk[curlk].bconn = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("diam peer NA, host[%s], ret[%d], peer[%p]\r\n", pcfg->pi_diamid_peer, ret, peer);
|
||||
rolkset.voicelk[curlk].bconn = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AddRoLink(SH_CONF_S *cfg, uint16_t port, int bSms)
|
||||
{
|
||||
if (bSms)
|
||||
{
|
||||
if(rolkset.smslknum >= MaxRoLinkNum)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
rolkset.smslk[rolkset.smslknum].cfg.pi_diamid_peer = strdup(cfg->pi_diamid_peer);
|
||||
rolkset.smslk[rolkset.smslknum].cfg.pi_diamid_realm_peer = strdup(cfg->pi_diamid_realm_peer);
|
||||
rolkset.smslk[rolkset.smslknum].cfg.peer_port = port;
|
||||
rolkset.smslknum++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(rolkset.voicelknum >= MaxRoLinkNum)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
rolkset.voicelk[rolkset.voicelknum].cfg.pi_diamid_peer = strdup(cfg->pi_diamid_peer);
|
||||
rolkset.voicelk[rolkset.voicelknum].cfg.pi_diamid_realm_peer = strdup(cfg->pi_diamid_realm_peer);
|
||||
rolkset.voicelk[rolkset.voicelknum].cfg.peer_port = port;
|
||||
rolkset.voicelknum++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
SH_CONF_S g_sh_conf_ext;
|
||||
//SH_CONF_S g_rovoice_conf_ext;
|
||||
//SH_CONF_S g_rosms_conf_ext;
|
||||
|
||||
#define SH_PARSE_BUFFER_LEN 1024
|
||||
|
||||
@@ -19,7 +143,7 @@ static char* shParseStr_(char* buffer, char* _key, char *ret_str, int flag_from_
|
||||
if(NULL != pos_2)
|
||||
{
|
||||
memcpy(ret_str, pos_1 + 1, pos_2 - pos_1 - 1);
|
||||
ret_str[pos_1 - pos_2] = '\0';
|
||||
ret_str[pos_2 - pos_1] = '\0';
|
||||
// fprintf(stderr, "%s=%s\n", _key, ret_str);
|
||||
return ret_str;
|
||||
}
|
||||
@@ -102,6 +226,10 @@ int shParse_(struct fd_config * conf)
|
||||
return 2;
|
||||
}
|
||||
|
||||
conf->ro_voiceport = 29100;
|
||||
conf->ro_smsport = 19500;
|
||||
strcpy(conf->service_context_voice, "agrandtech_ro@3gpp.org");
|
||||
strcpy(conf->service_context_sms, "agrandtech_sms@3gpp.org");
|
||||
/* Copy process */
|
||||
while((fgets(buffer, SH_PARSE_BUFFER_LEN, fd)) != NULL)
|
||||
{
|
||||
@@ -119,6 +247,18 @@ int shParse_(struct fd_config * conf)
|
||||
|
||||
memset( ret_str, 0, strlen(ret_str) );
|
||||
}
|
||||
if( shParseStr(buffer, "ServiceCxtRoVoice", ret_str) )
|
||||
{
|
||||
strcpy(conf->service_context_voice, ret_str);
|
||||
memset( ret_str, 0, strlen(ret_str) );
|
||||
}
|
||||
if( shParseStr(buffer, "ServiceCxtRoSms", ret_str) )
|
||||
{
|
||||
strcpy(conf->service_context_sms, ret_str);
|
||||
memset( ret_str, 0, strlen(ret_str) );
|
||||
}
|
||||
shParseInt(buffer, "RoVoicePort", &conf->ro_voiceport);
|
||||
shParseInt(buffer, "RoSmsPort", &conf->ro_smsport);
|
||||
shParseInt(buffer, "Port", &conf->cnf_port);
|
||||
shParseInt(buffer, "SecPort", &conf->cnf_port_tls);
|
||||
shParseInt(buffer, "SCTPStr", &conf->cnf_sctp_str);
|
||||
@@ -189,6 +329,29 @@ int shParseExt(struct fd_config * conf)
|
||||
g_sh_conf_ext.pi_diamid_realm_peer = strdup(ret_str);
|
||||
memset( ret_str, 0, strlen(ret_str) );
|
||||
}
|
||||
g_sh_conf_ext.peer_port = fd_g_config->cnf_port;
|
||||
if( shParseFlags(buffer, "ConnectPeer", "Ro_SMS") )
|
||||
{
|
||||
//g_rosms_conf_ext.pi_diamid_peer = strdup(g_sh_conf_ext.pi_diamid_peer);
|
||||
//g_rosms_conf_ext.pi_diamid_realm_peer = strdup(g_sh_conf_ext.pi_diamid_realm_peer);
|
||||
//g_rosms_conf_ext.peer_port = fd_g_config->ro_smsport;
|
||||
AddRoLink(&g_sh_conf_ext, fd_g_config->ro_smsport, 1);
|
||||
free(g_sh_conf_ext.pi_diamid_peer);
|
||||
g_sh_conf_ext.pi_diamid_peer = NULL;
|
||||
free(g_sh_conf_ext.pi_diamid_realm_peer);
|
||||
g_sh_conf_ext.pi_diamid_realm_peer = NULL;
|
||||
}
|
||||
if( shParseFlags(buffer, "ConnectPeer", "Ro_VOICE") )
|
||||
{
|
||||
//g_rovoice_conf_ext.pi_diamid_peer = strdup(g_sh_conf_ext.pi_diamid_peer);
|
||||
//g_rovoice_conf_ext.pi_diamid_realm_peer = strdup(g_sh_conf_ext.pi_diamid_realm_peer);
|
||||
//g_rovoice_conf_ext.peer_port = fd_g_config->ro_voiceport;
|
||||
AddRoLink(&g_sh_conf_ext, fd_g_config->ro_voiceport, 0);
|
||||
free(g_sh_conf_ext.pi_diamid_peer);
|
||||
g_sh_conf_ext.pi_diamid_peer = NULL;
|
||||
free(g_sh_conf_ext.pi_diamid_realm_peer);
|
||||
g_sh_conf_ext.pi_diamid_realm_peer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,12 +13,36 @@ typedef struct _SH_CONF_S
|
||||
int mode;
|
||||
DiamId_t pi_diamid_peer;
|
||||
DiamId_t pi_diamid_realm_peer;
|
||||
uint16_t peer_port;
|
||||
}SH_CONF_S;
|
||||
|
||||
|
||||
extern SH_CONF_S g_sh_conf_ext;
|
||||
|
||||
// Ro link from scp to ocs===============================
|
||||
typedef struct _Ro_Link_S
|
||||
{
|
||||
int bconn;
|
||||
SH_CONF_S cfg;
|
||||
}Ro_Link_S;
|
||||
|
||||
#define MaxRoLinkNum 4
|
||||
typedef struct _Ro_LinkSet
|
||||
{
|
||||
int smslknum;
|
||||
int voicelknum;
|
||||
int cursmslk;
|
||||
int curvoicelk;
|
||||
|
||||
Ro_Link_S smslk[MaxRoLinkNum];
|
||||
Ro_Link_S voicelk[MaxRoLinkNum];
|
||||
}Ro_LinkSet;
|
||||
extern Ro_LinkSet rolkset;
|
||||
//
|
||||
|
||||
//extern SH_CONF_S g_rosms_conf_ext;
|
||||
//extern SH_CONF_S g_rovoice_conf_ext;
|
||||
|
||||
int shParse(struct fd_config * conf);
|
||||
|
||||
|
||||
#endif /* __SH_CONF_H__ */
|
||||
#endif /* __SH_CONF_H__ */
|
||||
@@ -1067,7 +1067,7 @@ int sh_dict_def_cmd_udr()
|
||||
/* User-Data-Request (UDR) Command */
|
||||
/*
|
||||
The User-Data-Request (UDR) command, indicated by the Com
|
||||
mand-Code field set to 306 and the �R� bit set in the
|
||||
mand-Code field set to 306 and the ‘R?bit set in the
|
||||
Command Flags field, is sent by a Diameter client to a Diameter server in order to request user data.
|
||||
Message Format:
|
||||
|
||||
@@ -1151,7 +1151,7 @@ int sh_dict_def_cmd_uda()
|
||||
{
|
||||
/* User-Data-Answer (UDA) Command */
|
||||
/*
|
||||
The User-Data-Answer (UDA) command, indicated by the Command-Code field set to 306 and the �R� bit cleared in
|
||||
The User-Data-Answer (UDA) command, indicated by the Command-Code field set to 306 and the ‘R?bit cleared in
|
||||
the Command Flags field, is sent by a server in response to the User-Data-Request command. The Experimental-Result
|
||||
AVP may contain one of the values defined in section 6.2 or in 3GPP TS 29.229 [6].
|
||||
Message Format:
|
||||
@@ -1209,7 +1209,7 @@ int sh_dict_def_cmd_pur()
|
||||
{
|
||||
/* Profile-Update-Request (PUR) Command */
|
||||
/*
|
||||
The Profile-Update-Request (PUR) command, indicated by the Command-Code field set to 307 and the �R� bit set in
|
||||
The Profile-Update-Request (PUR) command, indicated by the Command-Code field set to 307 and the ‘R?bit set in
|
||||
the Command Flags field, is sent by a Diameter client to a Diameter server in order to update user data in the server.
|
||||
Message Format:
|
||||
|
||||
@@ -1270,7 +1270,7 @@ int sh_dict_def_cmd_pua()
|
||||
{
|
||||
/* Profile-Update-Answer (PUA) Command */
|
||||
/*
|
||||
The Profile-Update-Answer (PUA) command, indicated by the Command-Code field set to 307 and the �R� bit cleared
|
||||
The Profile-Update-Answer (PUA) command, indicated by the Command-Code field set to 307 and the ‘R?bit cleared
|
||||
in the Command Flags field, is sent by a server in response to the Profile-Update-Request command. The Experimental-
|
||||
Result AVP may contain one of the values defined in section 6.2 or in 3GPP TS 29.229 [6].
|
||||
Message Format:
|
||||
@@ -4411,7 +4411,7 @@ int sh_dict_init_bak(char * conffile)
|
||||
#endif
|
||||
|
||||
|
||||
/* Error: Editor�s Note: The code for DRMP AVP is to be updated when it is available within the draft-ietf-dime-drmp-02 [13]. */
|
||||
/* Error: Editor’s Note: The code for DRMP AVP is to be updated when it is available within the draft-ietf-dime-drmp-02 [13]. */
|
||||
/* DRMP AVP */
|
||||
{
|
||||
struct dict_avp_data data = {
|
||||
@@ -4460,7 +4460,7 @@ int sh_dict_init_bak(char * conffile)
|
||||
{
|
||||
/*
|
||||
The User-Data-Request (UDR) command, indicated by the Com
|
||||
mand-Code field set to 306 and the �R� bit set in the
|
||||
mand-Code field set to 306 and the ‘R?bit set in the
|
||||
Command Flags field, is sent by a Diameter client to a Diameter server in order to request user data.
|
||||
Message Format:
|
||||
|
||||
@@ -4542,7 +4542,7 @@ int sh_dict_init_bak(char * conffile)
|
||||
/* User-Data-Answer (UDA) Command */
|
||||
{
|
||||
/*
|
||||
The User-Data-Answer (UDA) command, indicated by the Command-Code field set to 306 and the �R� bit cleared in
|
||||
The User-Data-Answer (UDA) command, indicated by the Command-Code field set to 306 and the ‘R?bit cleared in
|
||||
the Command Flags field, is sent by a server in response to the User-Data-Request command. The Experimental-Result
|
||||
AVP may contain one of the values defined in section 6.2 or in 3GPP TS 29.229 [6].
|
||||
Message Format:
|
||||
@@ -4598,7 +4598,7 @@ int sh_dict_init_bak(char * conffile)
|
||||
/* Profile-Update-Request (PUR) Command */
|
||||
{
|
||||
/*
|
||||
The Profile-Update-Request (PUR) command, indicated by the Command-Code field set to 307 and the �R� bit set in
|
||||
The Profile-Update-Request (PUR) command, indicated by the Command-Code field set to 307 and the ‘R?bit set in
|
||||
the Command Flags field, is sent by a Diameter client to a Diameter server in order to update user data in the server.
|
||||
Message Format:
|
||||
|
||||
@@ -4657,7 +4657,7 @@ int sh_dict_init_bak(char * conffile)
|
||||
/* Profile-Update-Answer (PUA) Command */
|
||||
{
|
||||
/*
|
||||
The Profile-Update-Answer (PUA) command, indicated by the Command-Code field set to 307 and the �R� bit cleared
|
||||
The Profile-Update-Answer (PUA) command, indicated by the Command-Code field set to 307 and the ‘R?bit cleared
|
||||
in the Command Flags field, is sent by a server in response to the Profile-Update-Request command. The Experimental-
|
||||
Result AVP may contain one of the values defined in section 6.2 or in 3GPP TS 29.229 [6].
|
||||
Message Format:
|
||||
|
||||
@@ -69,7 +69,7 @@ extern "C" {
|
||||
/* #undef ERRORS_ON_TODO */
|
||||
/* #undef DEBUG */
|
||||
|
||||
#define FD_PROJECT_BINARY "freeDiameterd"
|
||||
#define FD_PROJECT_BINARY "agtocs"
|
||||
//#define FD_PROJECT_NAME "freeDiameter"
|
||||
#define FD_PROJECT_NAME "AGT_OCS"
|
||||
|
||||
|
||||
@@ -127,6 +127,10 @@ struct fd_config {
|
||||
unsigned int cnf_timer_tc; /* The value in seconds of the default Tc timer */
|
||||
unsigned int cnf_timer_tw; /* The value in seconds of the default Tw timer */
|
||||
|
||||
char service_context_voice[128];
|
||||
char service_context_sms[128];
|
||||
uint16_t ro_voiceport;// yaxin
|
||||
uint16_t ro_smsport;// yaxin
|
||||
uint16_t cnf_port; /* the local port for legacy Diameter (default: 3868) in host byte order */
|
||||
uint16_t cnf_port_tls; /* the local port for Diameter/TLS (default: 5868) in host byte order */
|
||||
uint16_t cnf_port_3436; /* Open an additional server port to listen to old TLS/SCTP clients (RFC3436, freeDiameter versions < 1.2.0) */
|
||||
|
||||
@@ -69,13 +69,13 @@ typedef struct gy_ccr
|
||||
char msc_addr[NUMBER_LEN];
|
||||
char vlr_number[NUMBER_LEN];
|
||||
char imsi[NUMBER_LEN];
|
||||
char cellid[16];
|
||||
char apn[GY_APN_LEN];
|
||||
char cellid[16];
|
||||
int sgsn_ip;
|
||||
int ggsn_ip;
|
||||
char request_action;
|
||||
char cellid_presented;
|
||||
char mscc_presented;
|
||||
//char mscc_presented;
|
||||
char role_of_node;
|
||||
//long balance_to_check;
|
||||
float req_service_unit;
|
||||
@@ -92,8 +92,7 @@ typedef struct gy_cca
|
||||
int check_balance_result;
|
||||
long grant_value;
|
||||
long volume_threshold;
|
||||
int validity_time;
|
||||
int time_threshold;
|
||||
long time_threshold;
|
||||
int is_final;
|
||||
}_gy_cca;
|
||||
|
||||
|
||||
@@ -470,6 +470,7 @@ int fd_conf_parse()
|
||||
|
||||
unsigned int verify;
|
||||
time_t now;
|
||||
/*
|
||||
GNUTLS_TRACE( gnutls_certificate_get_x509_cas (fd_g_config->cnf_sec_data.credentials, &CA_list, (unsigned int *) &CA_list_length) );
|
||||
GNUTLS_TRACE( gnutls_certificate_get_x509_crls (fd_g_config->cnf_sec_data.credentials, &CRL_list, (unsigned int *) &CRL_list_length) );
|
||||
CHECK_GNUTLS_DO( gnutls_x509_crt_list_verify(certs, cert_max, CA_list, CA_list_length, CRL_list, CRL_list_length, 0, &verify),
|
||||
@@ -477,7 +478,7 @@ int fd_conf_parse()
|
||||
TRACE_ERROR("Failed to verify the local certificate '%s' against local credentials. Please check your certificate is valid.", fd_g_config->cnf_sec_data.cert_file);
|
||||
return EINVAL;
|
||||
} );
|
||||
|
||||
*/
|
||||
if (verify) {
|
||||
fd_log_debug("TLS: Local certificate chain '%s' is invalid :", fd_g_config->cnf_sec_data.cert_file);
|
||||
if (verify & GNUTLS_CERT_INVALID)
|
||||
|
||||
@@ -128,6 +128,8 @@ static void core_shutdown(void)
|
||||
|
||||
static void * core_runner_thread(void * arg)
|
||||
{
|
||||
char cause[128]={"no cb"};
|
||||
|
||||
fd_log_threadname("fD Core Runner");
|
||||
|
||||
core_state_wait(CORE_RUNNING);
|
||||
@@ -144,6 +146,7 @@ static void * core_runner_thread(void * arg)
|
||||
{
|
||||
TRACE_DEBUG(NONE, "Internal error: got FDEV_TRIGGER without trigger value!");
|
||||
ASSERT(0);
|
||||
sprintf(cause,"Internal error: got FDEV_TRIGGER without trigger value!");
|
||||
goto end;
|
||||
} );
|
||||
p = data;
|
||||
@@ -154,6 +157,8 @@ static void * core_runner_thread(void * arg)
|
||||
break;
|
||||
|
||||
case FDEV_TERMINATE_INT:
|
||||
sprintf(cause,"Internal error: got FDEV_TERMINATE_INT!");
|
||||
|
||||
goto end;
|
||||
|
||||
default:
|
||||
@@ -163,7 +168,18 @@ static void * core_runner_thread(void * arg)
|
||||
|
||||
end:
|
||||
core_shutdown();
|
||||
if(1)
|
||||
{
|
||||
FILE *fp=NULL;
|
||||
|
||||
fp = fopen("fd_cause.txt","w");
|
||||
if(fp)
|
||||
{
|
||||
fprintf(fp,"%s\r\n",cause);
|
||||
fclose(fp);
|
||||
}
|
||||
exit(12);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,9 @@
|
||||
/* #define OLD_SCTP_SOCKET_API */
|
||||
|
||||
/* Automatically fallback to old API if some of the new symbols are not defined */
|
||||
#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_RECVRCVINFO)) || (!defined(SCTP_SNDINFO)))
|
||||
//#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_RECVRCVINFO)) || (!defined(SCTP_SNDINFO)))
|
||||
#if (!defined(SCTP_CONNECTX_4_ARGS) || (!defined(SCTP_RECVRCVINFO)) || (!defined(SCTP_SNDINFO)) || \
|
||||
(!defined(SCTP_SEND_FAILED_EVENT)) || (!defined(SCTP_NOTIFICATIONS_STOPPED_EVENT)) )
|
||||
# define OLD_SCTP_SOCKET_API
|
||||
#endif
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ static void set_sess_transport(gnutls_session_t session, struct sctp3436_ctx *ct
|
||||
/* Reset the low water value, since we don't use sockets */
|
||||
#ifndef GNUTLS_VERSION_300
|
||||
/* starting version 2.12, this call is not needed */
|
||||
GNUTLS_TRACE( gnutls_transport_set_lowat( session, 0 ) );
|
||||
//GNUTLS_TRACE( gnutls_transport_set_lowat( session, 0 ) );
|
||||
#else /* GNUTLS_VERSION_300 */
|
||||
/* but in 3.0 we have to provide the pull_timeout callback */
|
||||
GNUTLS_TRACE( gnutls_transport_set_pull_timeout_function( session, sctp3436_pull_timeout ) );
|
||||
|
||||
@@ -24,7 +24,7 @@ $(TGT):$(OBJS)
|
||||
|
||||
$(OBJS):%.o:%.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $< $(INCDIR)
|
||||
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJS) $(TGT)
|
||||
rm -rf $(TOPDIR)/lib/libdiameter.a
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
#include <stdarg.h> /* ANSI C header file */
|
||||
#include <syslog.h>
|
||||
#include <sys/io.h>
|
||||
//#include <sys/io.h>
|
||||
#include <error.h>
|
||||
#include "../../debug/src/include/debug.h"
|
||||
#include "./include/iptrans.h"
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -13,7 +13,7 @@
|
||||
#include <setjmp.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <stropts.h>
|
||||
//#include <stropts.h>
|
||||
#include <time.h>
|
||||
#include <syslog.h>
|
||||
#include <termio.h>
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/io.h>
|
||||
//#include <sys/io.h>
|
||||
#include <sys/poll.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
#ifndef _M2UA_PUB__H
|
||||
#define _M2UA_PUB__H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <memory.h>
|
||||
#include <netdb.h>
|
||||
#include <setjmp.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
//#include <stropts.h>
|
||||
#include <time.h>
|
||||
#include <syslog.h>
|
||||
#include <termio.h>
|
||||
#include <fcntl.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/io.h>
|
||||
#include <sys/poll.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
#include <sys/sem.h>
|
||||
#include <sys/msg.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/timeb.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#ifndef _LKSCTP
|
||||
#include <sys/tpi.h>
|
||||
#include <sys/tpi_sctp.h>
|
||||
#include <sys/xti_ip.h>
|
||||
#include <sys/xti_sctp.h>
|
||||
#else
|
||||
#include <netinet/sctp.h>
|
||||
#endif
|
||||
|
||||
#ifndef _T_BYTE
|
||||
#define _T_BYTE
|
||||
typedef unsigned char BYTE;
|
||||
#endif
|
||||
|
||||
#ifndef _T_WORD
|
||||
#define _T_WORD
|
||||
typedef unsigned short WORD;
|
||||
#endif
|
||||
|
||||
#ifndef _T_DWORD
|
||||
#define _T_DWORD
|
||||
typedef unsigned int DWORD;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Loaded 100 of 339 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user