summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordumeijied <[email protected]>2018-12-24 18:11:20 +0800
committerdumeijied <[email protected]>2018-12-24 18:11:20 +0800
commit0059d5e31a6091316419795cb48880c21dfc71d5 (patch)
treeb289c7e9d6531826073dc2e1fa6df26e538d53d9
parent79441f345d4308d6caee3a6ab626979b4ce1531d (diff)
2018.12.24 v4.0//send_voip_full_json_log add survey judgement for K
-rw-r--r--src/AV_interface.h2
-rw-r--r--src/frag_voip.c65
-rw-r--r--src/main.c7
-rw-r--r--src/message.c25
4 files changed, 53 insertions, 46 deletions
diff --git a/src/AV_interface.h b/src/AV_interface.h
index 13996a7..6eadfa7 100644
--- a/src/AV_interface.h
+++ b/src/AV_interface.h
@@ -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����, 0��ʾblacklist��1��ʾstatic configures��2��ʾcontent hit��
#define FD_TYPE_DYNAMIC_LIST 0
#define FD_TYPE_STATIC_CONF 1
diff --git a/src/frag_voip.c b/src/frag_voip.c
index 1a96981..d8068dd 100644
--- a/src/frag_voip.c
+++ b/src/frag_voip.c
@@ -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)
- {
- 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* 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)
{
- 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);
diff --git a/src/main.c b/src/main.c
index 43052af..bd93500 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
diff --git a/src/message.c b/src/message.c
index 05c113b..c2eed5b 100644
--- a/src/message.c
+++ b/src/message.c
@@ -894,6 +894,26 @@ long resp_checkresult_search_media_cb(void *data, const uint8_t *key, uint size,
}
/*��ǰ�˷�����*/
+#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++)
{
ip = mdi->qd_info[i].cap_ip;
@@ -908,7 +928,10 @@ long resp_checkresult_search_media_cb(void *data, const uint8_t *key, uint size,
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;
- }
+ }
+#endif
+
+
/*��Դ����£���������ƴװ��ǰ�˷�����*/
for(i=0; i<QD_MAXNUM; i++)