2018.12.24 v4.0//send_voip_full_json_log add survey judgement for K
This commit is contained in:
@@ -75,6 +75,8 @@
|
||||
#define SURVEY_PIC_MONITOR_TYPE 0xB1
|
||||
#define SURVEY_PIC_KEYWORD_TYPE 0xB2
|
||||
|
||||
#define SURVER_VOIP_COLLECT_TPYE 0xA4//for K voip_collect
|
||||
|
||||
// FD<46><44><EFBFBD><EFBFBD>, 0<><30>ʾblacklist<73><74>1<EFBFBD><31>ʾstatic configures<65><73>2<EFBFBD><32>ʾcontent hit<69><74>
|
||||
#define FD_TYPE_DYNAMIC_LIST 0
|
||||
#define FD_TYPE_STATIC_CONF 1
|
||||
|
||||
@@ -906,9 +906,13 @@ void send_voip_full_json_log(media_t* mdi)
|
||||
{
|
||||
if(NULL == mdi)
|
||||
return;
|
||||
|
||||
if(NULL == mdi->jc_buf)
|
||||
return;
|
||||
resp_checkresult_t* survey_res = (resp_checkresult_t*) (mdi->jc_buf + sizeof(msg_header_t));
|
||||
if(survey_res->service != SURVER_VOIP_COLLECT_TPYE)
|
||||
return;
|
||||
|
||||
cJSON* root = NULL;
|
||||
|
||||
string topic_name = TOPIC_NTC_COLLECT_VOIP_LOG;
|
||||
char pid_buf[64] = {0};
|
||||
char pbuf[32] = {0};
|
||||
@@ -1038,48 +1042,25 @@ void send_voip_full_json_log(media_t* mdi)
|
||||
cJSON_AddStringToObject(root, "user_agent", mdi->sip_opt[SIP_USERAGENT_OPT_INDEX]->opt_value);
|
||||
}
|
||||
|
||||
char* survey = NULL;
|
||||
uint32_t survey_len = 0;
|
||||
if(mdi->sip_survey_type&SIP_SURVEY_TYPE_FD)
|
||||
char* survey = mdi->jc_buf;
|
||||
uint32_t survey_len = mdi->jc_buflen;
|
||||
char* locate_url = NULL;
|
||||
uint32_t locate_urllen = survey_len-sizeof(msg_header_t)-sizeof(resp_checkresult_t);
|
||||
char locate_urlbuf[1024] = {0};
|
||||
|
||||
if(locate_urllen>0)
|
||||
{
|
||||
survey = mdi->fd_buf;
|
||||
survey_len = mdi->fd_buflen;
|
||||
}
|
||||
if(mdi->sip_survey_type&SIP_SURVEY_TYPE_JC)
|
||||
{
|
||||
survey = mdi->jc_buf;
|
||||
survey_len = mdi->jc_buflen;
|
||||
}
|
||||
if(NULL != survey)
|
||||
{
|
||||
char* locate_url = NULL;
|
||||
uint32_t locate_urllen = survey_len-sizeof(msg_header_t)-sizeof(resp_checkresult_t);
|
||||
char locate_ipbuf[64] = {0};
|
||||
char locate_urlbuf[1024] = {0};
|
||||
char* locate_url_pos = NULL;
|
||||
|
||||
if(locate_urllen>0)
|
||||
locate_url = survey + sizeof(msg_header_t) + sizeof(resp_checkresult_t);
|
||||
memcpy(locate_urlbuf, locate_url, locate_urllen);
|
||||
if(mdi->re_offset==2)
|
||||
{
|
||||
locate_url = survey + sizeof(msg_header_t) + sizeof(resp_checkresult_t);
|
||||
locate_url_pos = (char*)memchr(locate_url, ':', locate_urllen);
|
||||
if(NULL != locate_url_pos)
|
||||
{
|
||||
|
||||
memcpy(locate_ipbuf, locate_url, locate_url_pos-locate_url);
|
||||
memcpy(locate_urlbuf, locate_url_pos, locate_urllen-(locate_url_pos-locate_url+1));
|
||||
if(mdi->re_offset==2)
|
||||
{
|
||||
cJSON_AddStringToObject(root, "to_from_store_ip", locate_ipbuf);
|
||||
cJSON_AddStringToObject(root, "to_from_store_url", locate_urlbuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
cJSON_AddStringToObject(root, "from_to_store_ip", locate_ipbuf);
|
||||
cJSON_AddStringToObject(root, "from_to_store_url", locate_urlbuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cJSON_AddStringToObject(root, "to_from_store_url", locate_urlbuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
cJSON_AddStringToObject(root, "from_to_store_url", locate_urlbuf);
|
||||
}
|
||||
}
|
||||
|
||||
outbuf = cJSON_Print(root);
|
||||
len = strlen(outbuf);
|
||||
|
||||
@@ -42,9 +42,9 @@ const char* frag_rssb_version = "2018-08-13T09:00:00";
|
||||
const char* frag_rssb_version_time = "2018-08-13T09:00:00";
|
||||
const char* frag_rssb_version_des = "MESA@iie rssb_maskey";
|
||||
|
||||
int FRAG_RSSB_VERSION_1_0_20181211 = 0;
|
||||
const char* frag_rssb_version_time_in = "2018-12-11";
|
||||
const char* frag_rssb_version_des_in = "resp_checkresult_search_media_cb add K_PROJECT";
|
||||
int FRAG_RSSB_VERSION_1_0_20181224 = 0;
|
||||
const char* frag_rssb_version_time_in = "2018-12-24";
|
||||
const char* frag_rssb_version_des_in = "send_voip_full_json_log add survey judgement for K";
|
||||
void frag_rssb_history()
|
||||
{
|
||||
//2015.11.15 v1.0 create the project
|
||||
@@ -227,6 +227,7 @@ void frag_rssb_history()
|
||||
//2018.12.10 v4.0//1.recv_msg_fd not unix 2.MsgPort
|
||||
//2018.12.11 v4.0//1.file mediatype
|
||||
//2018.12.11 v4.0//resp_checkresult_search_media_cb add K_PROJECT,and delete send_json_log
|
||||
//2018.12.24 v4.0//send_voip_full_json_log add survey judgement for K
|
||||
}
|
||||
|
||||
frag_rssb_parameter_t g_frag_run;
|
||||
|
||||
@@ -894,6 +894,26 @@ long resp_checkresult_search_media_cb(void *data, const uint8_t *key, uint size,
|
||||
g_frag_stat.stat_info[RESP_CHECKRESULT_INDEX_SURVEY][TOTAL_BYTES] += buflen;
|
||||
}
|
||||
|
||||
/*<2A><>ǰ<EFBFBD>˷<EFBFBD><CBB7><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
#if K_PROJECT
|
||||
if(check_res->service != SURVER_VOIP_COLLECT_TPYE)
|
||||
{
|
||||
for(i=0; i<QD_MAXNUM; i++)
|
||||
{
|
||||
ip = mdi->qd_info[i].cap_ip;
|
||||
if(!ip)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
inet_ntop(AF_INET, &ip, pbuf, buf_len);
|
||||
resp_write_to_log(RESP_SEND_BLOCK, check_res, pbuf, mdi, mdi->qd_info[i].mid);
|
||||
*(uint64_t*)check_res->prog_id = mdi->qd_info[i].mid;
|
||||
bizman_send(g_frag_run.answer_sapp_bizman, mdi->thread_seq, ip, g_frag_cfg.qd_msg_port, (const char*)buf, buflen,
|
||||
1,BIZMAN_RELIABLE_SEND|BIZMAN_SMOOTH_DEST|BIZMAN_PUSH_SEND);
|
||||
g_frag_stat.stat_info[RESP_CHECKRESULT_BLACKLIST_OUT_BLOCK][TOTAL_PKTS]++;
|
||||
g_frag_stat.stat_info[RESP_CHECKRESULT_BLACKLIST_OUT_BLOCK][TOTAL_BYTES] += buflen;
|
||||
}
|
||||
}
|
||||
#else
|
||||
for(i=0; i<QD_MAXNUM; i++)
|
||||
{
|
||||
@@ -908,7 +928,10 @@ long resp_checkresult_search_media_cb(void *data, const uint8_t *key, uint size,
|
||||
bizman_send(g_frag_run.answer_sapp_bizman, mdi->thread_seq, ip, g_frag_cfg.qd_msg_port, (const char*)buf, buflen,
|
||||
1,BIZMAN_RELIABLE_SEND|BIZMAN_SMOOTH_DEST|BIZMAN_PUSH_SEND);
|
||||
g_frag_stat.stat_info[RESP_CHECKRESULT_BLACKLIST_OUT_BLOCK][TOTAL_PKTS]++;
|
||||
g_frag_stat.stat_info[RESP_CHECKRESULT_BLACKLIST_OUT_BLOCK][TOTAL_BYTES] += buflen;
|
||||
g_frag_stat.stat_info[RESP_CHECKRESULT_BLACKLIST_OUT_BLOCK][TOTAL_BYTES] += buflen;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*<2A><>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD><C2A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƴװ<C6B4><D7B0>ǰ<EFBFBD>˷<EFBFBD><CBB7><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
|
||||
Reference in New Issue
Block a user