#include <libdingaling.h>
#define DL_CAND_WAIT 10000000
+#define DL_CAND_INITIAL_WAIT 2000000
static const char modname[] = "mod_dingaling";
started = switch_time_now();
- if (!tech_pvt->last_cand) {
+
+ if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
tech_pvt->last_cand = switch_time_now();
- next_cand = tech_pvt->last_cand;
+ next_cand = tech_pvt->last_cand + DL_CAND_INITIAL_WAIT;
} else {
next_cand = tech_pvt->last_cand + DL_CAND_WAIT;
}
return NULL;
}
switch_yield(1000);
- //printf("WAIT %s %d %d %d\n", switch_channel_get_name(channel), switch_test_flag(tech_pvt, TFLAG_INIT), switch_test_flag(tech_pvt, TFLAG_CODEC_READY), switch_test_flag(tech_pvt, TFLAG_RTP_READY));
+ printf("WAIT %s %d %d %d\n", switch_channel_get_name(channel), switch_test_flag(tech_pvt, TFLAG_INIT), switch_test_flag(tech_pvt, TFLAG_CODEC_READY), switch_test_flag(tech_pvt, TFLAG_RTP_READY));
}
packet = switch_stun_packet_parse(buf, sizeof(buf));
rtp_session->last_stun = switch_time_now();
+
switch_stun_packet_first_attribute(packet, attr);
do {
} while (switch_stun_packet_next_attribute(attr));
- if (packet->header.type == SWITCH_STUN_BINDING_REQUEST && !strcmp(rtp_session->user_ice, username)) {
+ if (packet->header.type == SWITCH_STUN_BINDING_REQUEST) {// && !strcmp(rtp_session->user_ice, username)) {
uint8_t buf[512];
switch_stun_packet_t *rpacket;
char *remote_ip;