skypopen: brought almost all sleeps to at least 20millisec, because various platforms have no smaller granularity (eg: virtual machines). Fixed bogus values in 'sk list' report
This commit is contained in:
parent
d93c4edd50
commit
06322d33e0
|
@ -364,7 +364,7 @@ static switch_status_t interface_exists(char *the_interface)
|
||||||
if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread) {
|
if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread) {
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
skypopen_signaling_write(tech_pvt, "DIE");
|
skypopen_signaling_write(tech_pvt, "DIE");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
switch_file_write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
|
switch_file_write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
|
||||||
#else /* WIN32 */
|
#else /* WIN32 */
|
||||||
howmany = write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", howmany);
|
howmany = write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", howmany);
|
||||||
|
@ -381,7 +381,7 @@ static switch_status_t interface_exists(char *the_interface)
|
||||||
if (tech_pvt->running && tech_pvt->SkypopenHandles.disp) {
|
if (tech_pvt->running && tech_pvt->SkypopenHandles.disp) {
|
||||||
XEvent e;
|
XEvent e;
|
||||||
Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
|
Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
|
||||||
switch_sleep(1000);
|
switch_sleep(20000);
|
||||||
XFlush(tech_pvt->SkypopenHandles.disp);
|
XFlush(tech_pvt->SkypopenHandles.disp);
|
||||||
memset(&e, 0, sizeof(e));
|
memset(&e, 0, sizeof(e));
|
||||||
e.xclient.type = ClientMessage;
|
e.xclient.type = ClientMessage;
|
||||||
|
@ -494,9 +494,9 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
|
||||||
DEBUGA_SKYPE("audio tcp threads to DIE\n", SKYPOPEN_P_LOG);
|
DEBUGA_SKYPE("audio tcp threads to DIE\n", SKYPOPEN_P_LOG);
|
||||||
conta = 0;
|
conta = 0;
|
||||||
while (tech_pvt->tcp_srv_thread) {
|
while (tech_pvt->tcp_srv_thread) {
|
||||||
switch_sleep(5000);
|
switch_sleep(50000);
|
||||||
conta++;
|
conta++;
|
||||||
if (conta == 200) {
|
if (conta == 20) {
|
||||||
ERRORA("tcp_srv_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
|
ERRORA("tcp_srv_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -504,9 +504,9 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
|
||||||
DEBUGA_SKYPE("audio tcp srv thread DEAD %d\n", SKYPOPEN_P_LOG, conta);
|
DEBUGA_SKYPE("audio tcp srv thread DEAD %d\n", SKYPOPEN_P_LOG, conta);
|
||||||
conta = 0;
|
conta = 0;
|
||||||
while (tech_pvt->tcp_cli_thread) {
|
while (tech_pvt->tcp_cli_thread) {
|
||||||
switch_sleep(5000);
|
switch_sleep(50000);
|
||||||
conta++;
|
conta++;
|
||||||
if (conta == 200) {
|
if (conta == 20) {
|
||||||
ERRORA("tcp_cli_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
|
ERRORA("tcp_cli_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -873,11 +873,13 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
||||||
|
|
||||||
try = 0;
|
try = 0;
|
||||||
if (!bytes_read) {
|
if (!bytes_read) {
|
||||||
switch_sleep(1000);
|
switch_sleep(1000); //XXX don't like this
|
||||||
try++;
|
try++;
|
||||||
if (try < 5)
|
if (try < 5){
|
||||||
|
DEBUGA_SKYPE("skypopen_audio_read going back to read\n", SKYPOPEN_P_LOG);
|
||||||
goto read;
|
goto read;
|
||||||
DEBUGA_SKYPE("skypopen_audio_read Silence\n", SKYPOPEN_P_LOG);
|
}
|
||||||
|
WARNINGA("skypopen_audio_read Silence\n", SKYPOPEN_P_LOG);
|
||||||
memset(tech_pvt->read_frame.data, 255, BYTES_PER_FRAME);
|
memset(tech_pvt->read_frame.data, 255, BYTES_PER_FRAME);
|
||||||
tech_pvt->read_frame.datalen = BYTES_PER_FRAME;
|
tech_pvt->read_frame.datalen = BYTES_PER_FRAME;
|
||||||
|
|
||||||
|
@ -1056,9 +1058,9 @@ static switch_status_t channel_answer_channel(switch_core_session_t *session)
|
||||||
if (switch_channel_get_state(channel) == CS_RESET) {
|
if (switch_channel_get_state(channel) == CS_RESET) {
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
switch_sleep(5000);
|
switch_sleep(50000);
|
||||||
conta++;
|
conta++;
|
||||||
if (conta == 100) { //0.5 seconds
|
if (conta == 10) { //0.5 seconds
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1361,7 +1363,6 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||||
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
|
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
tech_pvt->ob_calls++;
|
|
||||||
|
|
||||||
rdest = strchr(caller_profile->destination_number, '/');
|
rdest = strchr(caller_profile->destination_number, '/');
|
||||||
*rdest++ = '\0';
|
*rdest++ = '\0';
|
||||||
|
@ -1371,6 +1372,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
|
||||||
caller_profile->destination_number = rdest;
|
caller_profile->destination_number = rdest;
|
||||||
|
|
||||||
switch_mutex_lock(tech_pvt->flag_mutex);
|
switch_mutex_lock(tech_pvt->flag_mutex);
|
||||||
|
tech_pvt->ob_calls++;
|
||||||
switch_set_flag(tech_pvt, TFLAG_OUTBOUND);
|
switch_set_flag(tech_pvt, TFLAG_OUTBOUND);
|
||||||
switch_mutex_unlock(tech_pvt->flag_mutex);
|
switch_mutex_unlock(tech_pvt->flag_mutex);
|
||||||
switch_channel_set_state(channel, CS_INIT);
|
switch_channel_set_state(channel, CS_INIT);
|
||||||
|
@ -1428,7 +1430,7 @@ static void *SWITCH_THREAD_FUNC skypopen_signaling_thread_func(switch_thread_t *
|
||||||
if (channel) {
|
if (channel) {
|
||||||
switch_channel_state_t state = switch_channel_get_state(channel);
|
switch_channel_state_t state = switch_channel_get_state(channel);
|
||||||
if (state < CS_EXECUTE) {
|
if (state < CS_EXECUTE) {
|
||||||
switch_sleep(10000); //10 msec, let the state evolve from CS_NEW
|
switch_sleep(20000); //20 msec, let the state evolve from CS_NEW
|
||||||
}
|
}
|
||||||
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
|
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1442,9 +1444,9 @@ static void *SWITCH_THREAD_FUNC skypopen_signaling_thread_func(switch_thread_t *
|
||||||
DEBUGA_SKYPE("audio tcp threads to DIE\n", SKYPOPEN_P_LOG);
|
DEBUGA_SKYPE("audio tcp threads to DIE\n", SKYPOPEN_P_LOG);
|
||||||
conta = 0;
|
conta = 0;
|
||||||
while (tech_pvt->tcp_srv_thread) {
|
while (tech_pvt->tcp_srv_thread) {
|
||||||
switch_sleep(5000);
|
switch_sleep(50000);
|
||||||
conta++;
|
conta++;
|
||||||
if (conta == 200) {
|
if (conta == 20) {
|
||||||
ERRORA("tcp_srv_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
|
ERRORA("tcp_srv_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1452,9 +1454,9 @@ static void *SWITCH_THREAD_FUNC skypopen_signaling_thread_func(switch_thread_t *
|
||||||
DEBUGA_SKYPE("audio tcp srv thread DEAD %d\n", SKYPOPEN_P_LOG, conta);
|
DEBUGA_SKYPE("audio tcp srv thread DEAD %d\n", SKYPOPEN_P_LOG, conta);
|
||||||
conta = 0;
|
conta = 0;
|
||||||
while (tech_pvt->tcp_cli_thread) {
|
while (tech_pvt->tcp_cli_thread) {
|
||||||
switch_sleep(5000);
|
switch_sleep(50000);
|
||||||
conta++;
|
conta++;
|
||||||
if (conta == 200) {
|
if (conta == 20) {
|
||||||
ERRORA("tcp_cli_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
|
ERRORA("tcp_cli_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1647,7 +1649,7 @@ static switch_status_t load_config(int reload_type)
|
||||||
} else {
|
} else {
|
||||||
DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPOPEN_P_LOG);
|
DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPOPEN_P_LOG);
|
||||||
}
|
}
|
||||||
switch_sleep(1000);
|
switch_sleep(20000);
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
|
||||||
if (interface_id && interface_id < SKYPOPEN_MAX_INTERFACES) {
|
if (interface_id && interface_id < SKYPOPEN_MAX_INTERFACES) {
|
||||||
|
@ -1795,20 +1797,20 @@ static switch_status_t load_config(int reload_type)
|
||||||
SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].skype_user);
|
SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].skype_user);
|
||||||
|
|
||||||
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "PROTOCOL 7");
|
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "PROTOCOL 7");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET AUTOAWAY OFF");
|
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET AUTOAWAY OFF");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET WINDOWSTATE HIDDEN");
|
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET WINDOWSTATE HIDDEN");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET USERSTATUS ONLINE");
|
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET USERSTATUS ONLINE");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
if (globals.SKYPOPEN_INTERFACES[interface_id].silent_mode) {
|
if (globals.SKYPOPEN_INTERFACES[interface_id].silent_mode) {
|
||||||
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET SILENT_MODE ON");
|
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET SILENT_MODE ON");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET SILENT_MODE OFF");
|
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET SILENT_MODE OFF");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET SILENT_MODE ON");
|
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET SILENT_MODE ON");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ERRORA
|
ERRORA
|
||||||
|
@ -1929,7 +1931,7 @@ static switch_status_t chat_send(const char *proto, const char *from, const char
|
||||||
|
|
||||||
snprintf(skype_msg, sizeof(skype_msg), "CHAT CREATE %s", to);
|
snprintf(skype_msg, sizeof(skype_msg), "CHAT CREATE %s", to);
|
||||||
skypopen_signaling_write(tech_pvt, skype_msg);
|
skypopen_signaling_write(tech_pvt, skype_msg);
|
||||||
switch_sleep(1000);
|
switch_sleep(20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
found = 0;
|
found = 0;
|
||||||
|
@ -1946,11 +1948,12 @@ static switch_status_t chat_send(const char *proto, const char *from, const char
|
||||||
if (found) {
|
if (found) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (tried > 1000) {
|
tried++;
|
||||||
|
if (tried > 20) {
|
||||||
ERRORA("No chat with dialog_partner='%s' was found\n", SKYPOPEN_P_LOG, to);
|
ERRORA("No chat with dialog_partner='%s' was found\n", SKYPOPEN_P_LOG, to);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch_sleep(1000);
|
switch_sleep(50000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2032,12 +2035,12 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypopen_shutdown)
|
||||||
if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread) {
|
if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread) {
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
skypopen_signaling_write(tech_pvt, "DIE");
|
skypopen_signaling_write(tech_pvt, "DIE");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
switch_file_write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
|
switch_file_write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
|
||||||
|
|
||||||
#else /* WIN32 */
|
#else /* WIN32 */
|
||||||
skypopen_signaling_write(tech_pvt, "DIE");
|
skypopen_signaling_write(tech_pvt, "DIE");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
howmany = write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", howmany);
|
howmany = write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", howmany);
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
}
|
}
|
||||||
|
@ -2053,7 +2056,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypopen_shutdown)
|
||||||
XEvent e;
|
XEvent e;
|
||||||
Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN",
|
Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN",
|
||||||
False);
|
False);
|
||||||
switch_sleep(1000);
|
switch_sleep(20000);
|
||||||
XFlush(tech_pvt->SkypopenHandles.disp);
|
XFlush(tech_pvt->SkypopenHandles.disp);
|
||||||
memset(&e, 0, sizeof(e));
|
memset(&e, 0, sizeof(e));
|
||||||
e.xclient.type = ClientMessage;
|
e.xclient.type = ClientMessage;
|
||||||
|
@ -2456,12 +2459,12 @@ SWITCH_STANDARD_API(sk_function)
|
||||||
for (tmp_i = 0; tmp_i < SKYPOPEN_MAX_INTERFACES; tmp_i++) {
|
for (tmp_i = 0; tmp_i < SKYPOPEN_MAX_INTERFACES; tmp_i++) {
|
||||||
if (strlen(globals.SKYPOPEN_INTERFACES[tmp_i].name)) {
|
if (strlen(globals.SKYPOPEN_INTERFACES[tmp_i].name)) {
|
||||||
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[tmp_i], "GET PROFILE PSTN_BALANCE");
|
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[tmp_i], "GET PROFILE PSTN_BALANCE");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
|
|
||||||
strncpy(tmp_message, globals.SKYPOPEN_INTERFACES[tmp_i].message, sizeof(globals.SKYPOPEN_INTERFACES[tmp_i].message));
|
strncpy(tmp_message, globals.SKYPOPEN_INTERFACES[tmp_i].message, sizeof(globals.SKYPOPEN_INTERFACES[tmp_i].message));
|
||||||
|
|
||||||
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[tmp_i], "GET PROFILE PSTN_BALANCE_CURRENCY");
|
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[tmp_i], "GET PROFILE PSTN_BALANCE_CURRENCY");
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
if(strlen(tmp_message)>21 && strlen(globals.SKYPOPEN_INTERFACES[tmp_i].message) > 30)
|
if(strlen(tmp_message)>21 && strlen(globals.SKYPOPEN_INTERFACES[tmp_i].message) > 30)
|
||||||
stream->write_function(stream, " %s \t%s\t%s\n", globals.SKYPOPEN_INTERFACES[tmp_i].name, tmp_message+21, globals.SKYPOPEN_INTERFACES[tmp_i].message+30);
|
stream->write_function(stream, " %s \t%s\t%s\n", globals.SKYPOPEN_INTERFACES[tmp_i].name, tmp_message+21, globals.SKYPOPEN_INTERFACES[tmp_i].message+30);
|
||||||
}
|
}
|
||||||
|
@ -2480,13 +2483,13 @@ SWITCH_STANDARD_API(sk_function)
|
||||||
stream->write_function(stream, "= ====\t ======== \t======= =======\t======\t============\t======\n");
|
stream->write_function(stream, "= ====\t ======== \t======= =======\t======\t============\t======\n");
|
||||||
|
|
||||||
for (i = 0; i < SKYPOPEN_MAX_INTERFACES; i++) {
|
for (i = 0; i < SKYPOPEN_MAX_INTERFACES; i++) {
|
||||||
|
if (strlen(globals.SKYPOPEN_INTERFACES[i].name)) {
|
||||||
next_flag_char = i == globals.next_interface ? '*' : ' ';
|
next_flag_char = i == globals.next_interface ? '*' : ' ';
|
||||||
ib += globals.SKYPOPEN_INTERFACES[i].ib_calls;
|
ib += globals.SKYPOPEN_INTERFACES[i].ib_calls;
|
||||||
ib_failed += globals.SKYPOPEN_INTERFACES[i].ib_failed_calls;
|
ib_failed += globals.SKYPOPEN_INTERFACES[i].ib_failed_calls;
|
||||||
ob += globals.SKYPOPEN_INTERFACES[i].ob_calls;
|
ob += globals.SKYPOPEN_INTERFACES[i].ob_calls;
|
||||||
ob_failed += globals.SKYPOPEN_INTERFACES[i].ob_failed_calls;
|
ob_failed += globals.SKYPOPEN_INTERFACES[i].ob_failed_calls;
|
||||||
|
|
||||||
if (strlen(globals.SKYPOPEN_INTERFACES[i].name)) {
|
|
||||||
stream->write_function(stream,
|
stream->write_function(stream,
|
||||||
"%c %d\t[%s]\t%3u/%u\t%6u/%u\t%s\t%s\t%s\n",
|
"%c %d\t[%s]\t%3u/%u\t%6u/%u\t%s\t%s\t%s\n",
|
||||||
next_flag_char,
|
next_flag_char,
|
||||||
|
@ -2498,7 +2501,7 @@ SWITCH_STANDARD_API(sk_function)
|
||||||
interface_status[globals.SKYPOPEN_INTERFACES[i].interface_state],
|
interface_status[globals.SKYPOPEN_INTERFACES[i].interface_state],
|
||||||
skype_callflow[globals.SKYPOPEN_INTERFACES[i].skype_callflow], globals.SKYPOPEN_INTERFACES[i].session_uuid_str);
|
skype_callflow[globals.SKYPOPEN_INTERFACES[i].skype_callflow], globals.SKYPOPEN_INTERFACES[i].session_uuid_str);
|
||||||
} else if (argc > 1 && !strcasecmp(argv[1], "full")) {
|
} else if (argc > 1 && !strcasecmp(argv[1], "full")) {
|
||||||
stream->write_function(stream, "%c\t%d\n", next_flag_char, i);
|
stream->write_function(stream, "%c %d\n", next_flag_char, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2915,7 +2918,7 @@ int skypopen_transfer(private_t *tech_pvt)
|
||||||
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", id);
|
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", id);
|
||||||
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
skypopen_signaling_write(tech_pvt, msg_to_skype);
|
||||||
}
|
}
|
||||||
switch_sleep(10000);
|
switch_sleep(20000);
|
||||||
DEBUGA_SKYPE
|
DEBUGA_SKYPE
|
||||||
("We have NOT answered a Skype RING from skype_call %s, because we are already in a skypopen call (%s)\n",
|
("We have NOT answered a Skype RING from skype_call %s, because we are already in a skypopen call (%s)\n",
|
||||||
SKYPOPEN_P_LOG, id, tech_pvt->skype_call_id);
|
SKYPOPEN_P_LOG, id, tech_pvt->skype_call_id);
|
||||||
|
|
|
@ -186,7 +186,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
|
||||||
SKYPOPEN_P_LOG);
|
SKYPOPEN_P_LOG);
|
||||||
skypopen_sleep(1000000);
|
skypopen_sleep(1000000);
|
||||||
skypopen_signaling_write(tech_pvt, "PROTOCOL 7");
|
skypopen_signaling_write(tech_pvt, "PROTOCOL 7");
|
||||||
skypopen_sleep(10000);
|
skypopen_sleep(20000);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!strncasecmp(message, "ERROR 92 CALL", 12)) {
|
if (!strncasecmp(message, "ERROR 92 CALL", 12)) {
|
||||||
|
@ -898,6 +898,9 @@ void *skypopen_do_tcp_srv_thread_func(void *obj)
|
||||||
|
|
||||||
if (tech_pvt->timer_read_srv.timer_interface && tech_pvt->timer_read_srv.timer_interface->timer_next) {
|
if (tech_pvt->timer_read_srv.timer_interface && tech_pvt->timer_read_srv.timer_interface->timer_next) {
|
||||||
switch_core_timer_next(&tech_pvt->timer_read_srv);
|
switch_core_timer_next(&tech_pvt->timer_read_srv);
|
||||||
|
} else {
|
||||||
|
skypopen_sleep(20000);
|
||||||
|
|
||||||
}
|
}
|
||||||
//rt = select(fdselect + 1, &fs, NULL, NULL, &to);
|
//rt = select(fdselect + 1, &fs, NULL, NULL, &to);
|
||||||
if (rt > 0) {
|
if (rt > 0) {
|
||||||
|
@ -905,12 +908,12 @@ void *skypopen_do_tcp_srv_thread_func(void *obj)
|
||||||
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
|
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
|
||||||
len = recv(fd, (char *) srv_in, BYTES_PER_FRAME * 2, 0);
|
len = recv(fd, (char *) srv_in, BYTES_PER_FRAME * 2, 0);
|
||||||
} else {
|
} else {
|
||||||
skypopen_sleep(10000);
|
//skypopen_sleep(10000);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tech_pvt->begin_to_read == 0) {
|
if (tech_pvt->begin_to_read == 0) {
|
||||||
DEBUGA_SKYPE("len=%d\n", SKYPOPEN_P_LOG, len);
|
DEBUGA_SKYPE("len=%d\n", SKYPOPEN_P_LOG, len);
|
||||||
skypopen_sleep(10000);
|
//skypopen_sleep(10000);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1054,6 +1057,8 @@ void *skypopen_do_tcp_cli_thread_func(void *obj)
|
||||||
if (tech_pvt->timer_write.timer_interface && tech_pvt->timer_write.timer_interface->timer_next
|
if (tech_pvt->timer_write.timer_interface && tech_pvt->timer_write.timer_interface->timer_next
|
||||||
&& tech_pvt->interface_state != SKYPOPEN_STATE_HANGUP_REQUESTED) {
|
&& tech_pvt->interface_state != SKYPOPEN_STATE_HANGUP_REQUESTED) {
|
||||||
switch_core_timer_next(&tech_pvt->timer_write);
|
switch_core_timer_next(&tech_pvt->timer_write);
|
||||||
|
} else {
|
||||||
|
skypopen_sleep(20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tech_pvt->begin_to_write == 0) {
|
if (tech_pvt->begin_to_write == 0) {
|
||||||
|
@ -1064,7 +1069,7 @@ void *skypopen_do_tcp_cli_thread_func(void *obj)
|
||||||
DEBUGA_SKYPE("len=%d, error: %s\n", SKYPOPEN_P_LOG, len, strerror(errno));
|
DEBUGA_SKYPE("len=%d, error: %s\n", SKYPOPEN_P_LOG, len, strerror(errno));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
skypopen_sleep(10000);
|
//skypopen_sleep(10000);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1367,7 +1372,7 @@ LRESULT APIENTRY skypopen_present(HWND hWindow, UINT uiMessage, WPARAM uiParam,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION:
|
case SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION:
|
||||||
skypopen_sleep(5000);
|
skypopen_sleep(20000);
|
||||||
break;
|
break;
|
||||||
case SKYPECONTROLAPI_ATTACH_REFUSED:
|
case SKYPECONTROLAPI_ATTACH_REFUSED:
|
||||||
ERRORA("Skype client refused to be connected by Skypopen!\n", SKYPOPEN_P_LOG);
|
ERRORA("Skype client refused to be connected by Skypopen!\n", SKYPOPEN_P_LOG);
|
||||||
|
@ -1377,7 +1382,7 @@ LRESULT APIENTRY skypopen_present(HWND hWindow, UINT uiMessage, WPARAM uiParam,
|
||||||
break;
|
break;
|
||||||
case SKYPECONTROLAPI_ATTACH_API_AVAILABLE:
|
case SKYPECONTROLAPI_ATTACH_API_AVAILABLE:
|
||||||
DEBUGA_SKYPE("Skype API available\n", SKYPOPEN_P_LOG);
|
DEBUGA_SKYPE("Skype API available\n", SKYPOPEN_P_LOG);
|
||||||
skypopen_sleep(5000);
|
skypopen_sleep(20000);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WARNINGA("GOT AN UNKNOWN SKYPE WINDOWS MSG\n", SKYPOPEN_P_LOG);
|
WARNINGA("GOT AN UNKNOWN SKYPE WINDOWS MSG\n", SKYPOPEN_P_LOG);
|
||||||
|
@ -1681,7 +1686,7 @@ void skypopen_clean_disp(void *data)
|
||||||
DEBUGA_SKYPE("NOT destroyed disp\n", SKYPOPEN_P_LOG);
|
DEBUGA_SKYPE("NOT destroyed disp\n", SKYPOPEN_P_LOG);
|
||||||
}
|
}
|
||||||
DEBUGA_SKYPE("OUT destroyed disp\n", SKYPOPEN_P_LOG);
|
DEBUGA_SKYPE("OUT destroyed disp\n", SKYPOPEN_P_LOG);
|
||||||
skypopen_sleep(1000);
|
skypopen_sleep(20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *skypopen_do_skypeapi_thread_func(void *obj)
|
void *skypopen_do_skypeapi_thread_func(void *obj)
|
||||||
|
@ -1927,13 +1932,14 @@ void *skypopen_do_skypeapi_thread_func(void *obj)
|
||||||
SKYPOPEN_P_LOG, buf);
|
SKYPOPEN_P_LOG, buf);
|
||||||
skypopen_sleep(1000000); //1 sec
|
skypopen_sleep(1000000); //1 sec
|
||||||
}
|
}
|
||||||
skypopen_sleep(1000); //0.1 msec
|
skypopen_sleep(20000); //20 msec
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (continue_is_broken) {
|
if (continue_is_broken) {
|
||||||
XFlush(disp);
|
XFlush(disp);
|
||||||
skypopen_sleep(1000); //0.1 msec
|
skypopen_sleep(20000); //20 msec
|
||||||
|
WARNINGA("continue_is_broken\n", SKYPOPEN_P_LOG);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
strcat(buffer, buf);
|
strcat(buffer, buf);
|
||||||
|
|
Loading…
Reference in New Issue