diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-01-26 06:19:13 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-01-26 06:19:13 +0000 |
commit | 731016a327909c6cafe3106ab45a23973d6ee24d (patch) | |
tree | 6f10108b749e06788f7cd2a048fc8b55e5bcefb4 /res/res_features.c | |
parent | eb7466d0c7ec05295b4a84b15364fdabd66443bd (diff) |
Fix parking issue (bug #3396)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4894 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_features.c')
-rwxr-xr-x | res/res_features.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/res/res_features.c b/res/res_features.c index 3e4f6be30..f91a4d10d 100755 --- a/res/res_features.c +++ b/res/res_features.c @@ -241,8 +241,7 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou pu->parkingtime = parkingtime; if (extout) *extout = x; - if (peer) - { + if (peer) { strncpy(pu->peername,peer->name,sizeof(pu->peername) - 1); } /* Remember what had been dialed, so that if the parking @@ -290,12 +289,6 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou if (adsipark && adsi_available(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); if (!con) { @@ -309,6 +302,12 @@ int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeou ast_add_extension2(con, 1, exten, 1, NULL, NULL, parkedcall, strdup(exten), free, registrar); } if (peer) ast_say_digits(peer, pu->parkingnum, "", peer->language); + 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; } else { ast_log(LOG_WARNING, "No more parking spaces\n"); @@ -1085,7 +1084,6 @@ static void *do_parking_thread(void *ignore) char *peername,*cp; struct ast_context *con; int x; - int gc=0; fd_set rfds, efds; fd_set nrfds, nefds; FD_ZERO(&rfds); @@ -1106,10 +1104,6 @@ static void *do_parking_thread(void *ignore) pu = pu->next; continue; } - if (gc < 5 && !pu->chan->generator) { - gc++; - ast_moh_start(pu->chan,NULL); - } gettimeofday(&tv, NULL); tms = (tv.tv_sec - pu->start.tv_sec) * 1000 + (tv.tv_usec - pu->start.tv_usec) / 1000; if (tms > pu->parkingtime) { |