diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-01 15:39:54 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-08-01 15:39:54 +0000 |
commit | b3ceaa6a9ef31d084b0eb8cfa4717cebfe9298ed (patch) | |
tree | 8669ddf483350f2bd54e6b146d9a2a5a56e9c141 /pbx/pbx_dundi.c | |
parent | b7bc7c5b5e8f9db94219fee0037f12d0b8a86b15 (diff) |
Convert code that checks the _softhangup member of ast_channel directory to use
the ast_check_hangup() funciton. This function takes scheduled hangups into
account.
(closes issue #10230, patch by Juggie)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77858 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/pbx_dundi.c')
-rw-r--r-- | pbx/pbx_dundi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index b37c4ed29..41866f0c9 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -3484,7 +3484,7 @@ static int dundi_lookup_internal(struct dundi_result *result, int maxret, struct struct timeval start; /* Don't do anthing for a hungup channel */ - if (chan && chan->_softhangup) + if (chan && ast_check_hangup(chan)) return 0; ttlms = DUNDI_FLUFF_TIME + ttl * DUNDI_TTL_TIME; @@ -3525,7 +3525,7 @@ static int dundi_lookup_internal(struct dundi_result *result, int maxret, struct ast_log(LOG_DEBUG, "Waiting for similar request for '%s@%s' for '%s'\n", dr.number,dr.dcontext,dundi_eid_to_str(eid_str, sizeof(eid_str), &pending->root_eid)); start = ast_tvnow(); - while(check_request(pending) && (ast_tvdiff_ms(ast_tvnow(), start) < ttlms) && (!chan || !chan->_softhangup)) { + while(check_request(pending) && (ast_tvdiff_ms(ast_tvnow(), start) < ttlms) && (!chan || !ast_check_hangup(chan))) { /* XXX Would be nice to have a way to poll/select here XXX */ /* XXX this is a busy wait loop!!! */ usleep(1); @@ -3558,11 +3558,11 @@ static int dundi_lookup_internal(struct dundi_result *result, int maxret, struct discover_transactions(&dr); /* Wait for transaction to come back */ start = ast_tvnow(); - while (!AST_LIST_EMPTY(&dr.trans) && (ast_tvdiff_ms(ast_tvnow(), start) < ttlms) && (!chan || !chan->_softhangup)) { + while (!AST_LIST_EMPTY(&dr.trans) && (ast_tvdiff_ms(ast_tvnow(), start) < ttlms) && (!chan || !ast_check_hangup(chan))) { ms = 100; ast_waitfor_n_fd(dr.pfds, 1, &ms, NULL); } - if (chan && chan->_softhangup && option_debug) + if (chan && ast_check_hangup(chan) && option_debug) ast_log(LOG_DEBUG, "Hrm, '%s' hungup before their query for %s@%s finished\n", chan->name, dr.number, dr.dcontext); cancel_request(&dr); unregister_request(&dr); |