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