提交 506d3768 authored 作者: Giovanni Maruzzelli's avatar Giovanni Maruzzelli

skypiax: patch from Seven Du for hunting IDLE channels in a round-robin way (RR…

skypiax: patch from Seven Du for hunting IDLE channels in a round-robin way (RR interface vs ANY interface). patch from Seven Du for removing interface as #'interface_id' and #'interface_name'. gmaruzz (meh) patch interface_remove() not to alter the global 'running' variable (it would cause all running signaling and API thread to exit) but to use a newly added tech_pvt->running variable. Also, changed behavior of interface_exists() for correct identification when using #interface_name and #interface_id. PLEASE TEST IT HEAVILY

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14410 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 f4b2efba
......@@ -238,6 +238,7 @@ struct private_object {
struct timeval transfer_time;
char transfer_callid_number[50];
char skype_transfer_call_id[512];
int running;
};
typedef struct private_object private_t;
......@@ -276,6 +277,7 @@ int skypiax_pipe_write(int pipe, short *buf, int howmany);
#endif /* WIN32 */
int skypiax_close_socket(unsigned int fd);
private_t *find_available_skypiax_interface(private_t * tech_pvt);
private_t *find_available_skypiax_interface_rr(void);
int remote_party_is_ringing(private_t * tech_pvt);
int remote_party_is_early_media(private_t * tech_pvt);
int skypiax_answer(private_t * tech_pvt, char *id, char *value);
......
......@@ -489,7 +489,7 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
fd_set fsgio;
struct timeval togio;
if (!running)
if (!(running && tech_pvt->running))
break;
FD_ZERO(&fsgio);
togio.tv_usec = 20000; //20msec
......@@ -506,7 +506,7 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) {
DEBUGA_SKYPE("ACCEPTED here I send you %d\n", SKYPIAX_P_LOG,
tech_pvt->tcp_srv_port);
if (!running)
if (!(running && tech_pvt->running))
break;
while (tech_pvt->interface_state != SKYPIAX_STATE_DOWN
&& (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS
......@@ -519,7 +519,7 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
fd_set fs;
struct timeval to;
if (!running)
if (!(running && tech_pvt->running))
break;
//exit = 1;
......@@ -677,7 +677,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
fd_set fsgio;
struct timeval togio;
if (!running)
if (!(running && tech_pvt->running))
break;
FD_ZERO(&fsgio);
togio.tv_usec = 20000; //20msec
......@@ -698,7 +698,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
fcntl(tech_pvt->audioskypepipe[0], F_SETFL, O_NONBLOCK);
#endif //WIN32
if (!running)
if (!(running && tech_pvt->running))
break;
while (tech_pvt->interface_state != SKYPIAX_STATE_DOWN
&& (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS
......@@ -710,7 +710,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
fd_set fs;
struct timeval to;
if (!running)
if (!(running && tech_pvt->running))
break;
FD_ZERO(&fs);
to.tv_usec = 120000; //120msec
......@@ -1238,9 +1238,9 @@ void *skypiax_do_skypeapi_thread_func(void *obj)
(WPARAM) tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, 0) != 0) {
tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle =
tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle;
while (running) {
while (running && tech_pvt->running) {
MSG oMessage;
if (!running)
if (! (running && tech_pvt->running))
break;
while (GetMessage(&oMessage, 0, 0, 0)) {
TranslateMessage(&oMessage);
......@@ -1264,7 +1264,7 @@ int X11_errors_handler(Display * dpy, XErrorEvent * err)
private_t *tech_pvt = NULL;
xerror = err->error_code;
ERRORA("Received error code %d from X Server\n\n", SKYPIAX_P_LOG, xerror);
ERRORA("Received error code %d from X Server\n\n", SKYPIAX_P_LOG, xerror); ///FIXME why crash the entire skypiax? just crash the interface, instead
running = 0;
return 0; /* ignore the error */
}
......@@ -1489,7 +1489,7 @@ void *skypiax_do_skypeapi_thread_func(void *obj)
while (1) {
XNextEvent(disp, &an_event);
if (!running)
if (! (running && tech_pvt->running))
break;
switch (an_event.type) {
case ClientMessage:
......@@ -1557,7 +1557,7 @@ void *skypiax_do_skypeapi_thread_func(void *obj)
running = 0;
return NULL;
}
running = 0;
//running = 0;
return NULL;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论