fix parking (bug #3396)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2005-01-28 01:24:59 +00:00
parent 1714f299c9
commit 2bb388ebc8

View File

@@ -224,12 +224,6 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou
if (adsipark && adsi_available(peer)) { if (adsipark && adsi_available(peer)) {
adsi_unload_session(peer); adsi_unload_session(peer);
} }
if (pu->notquiteyet) {
/* Wake up parking thread if we're really done */
ast_moh_start(pu->chan, NULL);
pu->notquiteyet = 0;
pthread_kill(parking_thread, SIGURG);
}
} }
con = ast_context_find(parking_con); con = ast_context_find(parking_con);
if (!con) { if (!con) {
@@ -242,6 +236,13 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou
snprintf(exten, sizeof(exten), "%d", x); snprintf(exten, sizeof(exten), "%d", x);
ast_add_extension2(con, 1, exten, 1, NULL, parkedcall, strdup(exten), free, registrar); ast_add_extension2(con, 1, exten, 1, NULL, parkedcall, strdup(exten), free, registrar);
} }
if (pu->notquiteyet) {
/* Wake up parking thread if we're really done */
ast_moh_start(pu->chan, NULL);
pu->notquiteyet = 0;
pthread_kill(parking_thread, SIGURG);
}
return 0; return 0;
} else { } else {
ast_log(LOG_WARNING, "No more parking spaces\n"); ast_log(LOG_WARNING, "No more parking spaces\n");
@@ -551,7 +552,6 @@ static void *do_parking_thread(void *ignore)
char exten[AST_MAX_EXTENSION]; char exten[AST_MAX_EXTENSION];
struct ast_context *con; struct ast_context *con;
int x; int x;
int gc=0;
fd_set rfds, efds; fd_set rfds, efds;
fd_set nrfds, nefds; fd_set nrfds, nefds;
FD_ZERO(&rfds); FD_ZERO(&rfds);
@@ -572,10 +572,6 @@ static void *do_parking_thread(void *ignore)
pu = pu->next; pu = pu->next;
continue; continue;
} }
if (gc < 5 && !pu->chan->generator) {
gc++;
ast_moh_start(pu->chan,NULL);
}
tms = (tv.tv_sec - pu->start.tv_sec) * 1000 + (tv.tv_usec - pu->start.tv_usec) / 1000; tms = (tv.tv_sec - pu->start.tv_sec) * 1000 + (tv.tv_usec - pu->start.tv_usec) / 1000;
if (tms > pu->parkingtime) { if (tms > pu->parkingtime) {
/* They've been waiting too long, send them back to where they came. Theoretically they /* They've been waiting too long, send them back to where they came. Theoretically they