mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-25 11:16:04 +00:00
update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1162 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
0e0e1e3673
commit
5d47cffc28
@ -411,6 +411,7 @@ static int on_presence(void *user_data, ikspak *pak)
|
|||||||
|
|
||||||
if (resource && strstr(resource, "talk") && (buffer = apr_hash_get(handle->probe_hash, id, APR_HASH_KEY_STRING))) {
|
if (resource && strstr(resource, "talk") && (buffer = apr_hash_get(handle->probe_hash, id, APR_HASH_KEY_STRING))) {
|
||||||
apr_cpystrn(buffer->buf, from, buffer->len);
|
apr_cpystrn(buffer->buf, from, buffer->len);
|
||||||
|
fflush(stderr);
|
||||||
buffer->hit = 1;
|
buffer->hit = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ typedef enum {
|
|||||||
TFLAG_VOICE = (1 << 6),
|
TFLAG_VOICE = (1 << 6),
|
||||||
TFLAG_RTP_READY = (1 << 7),
|
TFLAG_RTP_READY = (1 << 7),
|
||||||
TFLAG_CODEC_READY = (1 << 8),
|
TFLAG_CODEC_READY = (1 << 8),
|
||||||
|
TFLAG_INIT = (1 << 9),
|
||||||
} TFLAGS;
|
} TFLAGS;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -238,12 +239,12 @@ static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread *thread, void
|
|||||||
|
|
||||||
if (!tech_pvt->last_cand) {
|
if (!tech_pvt->last_cand) {
|
||||||
tech_pvt->last_cand = switch_time_now();
|
tech_pvt->last_cand = switch_time_now();
|
||||||
next_cand = tech_pvt->last_cand;
|
next_cand = tech_pvt->last_cand + DL_CAND_WAIT;
|
||||||
} else {
|
} else {
|
||||||
next_cand = tech_pvt->last_cand + DL_CAND_WAIT;
|
next_cand = tech_pvt->last_cand + DL_CAND_WAIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
while(! (switch_test_flag(tech_pvt, TFLAG_CODEC_READY) && switch_test_flag(tech_pvt, TFLAG_RTP_READY))) {
|
while(! (switch_test_flag(tech_pvt, TFLAG_CODEC_READY) && switch_test_flag(tech_pvt, TFLAG_RTP_READY) && switch_test_flag(tech_pvt, TFLAG_INIT))) {
|
||||||
now = switch_time_now();
|
now = switch_time_now();
|
||||||
elapsed = (unsigned int)((now - started) / 1000);
|
elapsed = (unsigned int)((now - started) / 1000);
|
||||||
|
|
||||||
@ -329,6 +330,7 @@ static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread *thread, void
|
|||||||
cand[0].pref = 1;
|
cand[0].pref = 1;
|
||||||
cand[0].protocol = "udp";
|
cand[0].protocol = "udp";
|
||||||
tech_pvt->cand_id = ldl_session_candidates(tech_pvt->dlsession, cand, 1);
|
tech_pvt->cand_id = ldl_session_candidates(tech_pvt->dlsession, cand, 1);
|
||||||
|
switch_set_flag(tech_pvt, TFLAG_RTP_READY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (elapsed > 60000) {
|
if (elapsed > 60000) {
|
||||||
@ -341,7 +343,7 @@ static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread *thread, void
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
switch_yield(1000);
|
switch_yield(1000);
|
||||||
//printf("WAIT %s %d\n", switch_channel_get_name(channel), switch_test_flag(tech_pvt, TFLAG_OUTBOUND));
|
//printf("WAIT %s %d %d %d\n", switch_channel_get_name(channel), switch_test_flag(tech_pvt, TFLAG_OUTBOUND), switch_test_flag(tech_pvt, TFLAG_CODEC_READY), switch_test_flag(tech_pvt, TFLAG_RTP_READY));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1210,6 +1212,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
|||||||
ldl_payload_t *payloads;
|
ldl_payload_t *payloads;
|
||||||
unsigned int len = 0;
|
unsigned int len = 0;
|
||||||
|
|
||||||
|
switch_set_flag(tech_pvt, TFLAG_INIT);
|
||||||
if (tech_pvt->codec_index > -1) {
|
if (tech_pvt->codec_index > -1) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Already decided on a codec\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Already decided on a codec\n");
|
||||||
break;
|
break;
|
||||||
@ -1260,7 +1263,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
|
|||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%u candidates\n", len);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%u candidates\n", len);
|
||||||
for(x = 0; x < len; x++) {
|
for(x = 0; x < len; x++) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "candidates %s:%d\n", candidates[x].address, candidates[x].port);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "candidates %s:%d\n", candidates[x].address, candidates[x].port);
|
||||||
if (!strcasecmp(candidates[x].protocol, "udp") &&
|
if (!strcasecmp(candidates[x].protocol, "udp") && (!strcasecmp(candidates[x].type, "local") || !strcasecmp(candidates[x].type, "stun")) &&
|
||||||
((profile->lanaddr && !strncasecmp(candidates[x].address, profile->lanaddr, strlen(profile->lanaddr))) ||
|
((profile->lanaddr && !strncasecmp(candidates[x].address, profile->lanaddr, strlen(profile->lanaddr))) ||
|
||||||
(strncasecmp(candidates[x].address, "10.", 3) &&
|
(strncasecmp(candidates[x].address, "10.", 3) &&
|
||||||
strncasecmp(candidates[x].address, "192.168.", 8) &&
|
strncasecmp(candidates[x].address, "192.168.", 8) &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user