From 4e0947c5f1f9c9583bff9f2be1b0c2810263e3e9 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 1 Aug 2007 15:39:54 +0000 Subject: 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: https://origsvn.digium.com/svn/asterisk/trunk@77858 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- pbx/pbx_dundi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pbx') 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); -- cgit v1.2.3