exosip2,抓包发现会定时发送心跳包,4个字节,转成assic就是jak
原以为是业务逻辑的原因,查了发现不是,最后exosip库代码里面找到了
static int
udp_tl_keepalive (struct eXosip_t *excontext)
{
struct eXtludp *reserved = (struct eXtludp *) excontext->eXtludp_reserved;
char buf[4] = "jaK";
eXosip_reg_t *jr;
if (excontext->keep_alive <= 0) {
return 0;
}
if (reserved->udp_socket <= 0)
return OSIP_UNDEFINED_ERROR;
for (jr = excontext->j_reg; jr != NULL; jr = jr->next) {
if (jr->len > 0) {
if (sendto (reserved->udp_socket, (const void *) buf, 4, 0, (struct sockaddr *) &(jr->addr), jr->len) > 0) {
OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_INFO1, NULL, "eXosip: Keep Alive sent on UDP!\n"));
}
}
}
return OSIP_SUCCESS;
}
这就比较明了了,如果不需要这个心跳保持包,用下面代码可以屏蔽:
int opt_keepalive = 0;
eXosip_set_option(m_contexteXosip,EXOSIP_OPT_UDP_KEEP_ALIVE, &opt_keepalive);