Index: pbx/pbx_dundi.c =================================================================== --- pbx/pbx_dundi.c (revision 75622) +++ pbx/pbx_dundi.c (working copy) @@ -3486,7 +3486,7 @@ 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; @@ -3527,7 +3527,7 @@ 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); @@ -3560,11 +3560,11 @@ 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); Index: channels/chan_vpb.cc =================================================================== --- channels/chan_vpb.cc (revision 75622) +++ channels/chan_vpb.cc (working copy) @@ -550,11 +550,11 @@ *rc = who; ast_debug(1, "%s: vpb_bridge: Got a [%s]\n",p0->dev, f ? "digit" : "hangup"); /* - if ((c0->tech_pvt == pvt0) && (!c0->_softhangup)) { + if ((c0->tech_pvt == pvt0) && (!ast_check_hangup(c0))) { if (pr0->set_rtp_peer(c0, NULL, NULL, 0)) ast_log(LOG_WARNING, "Channel '%s' failed to revert\n", c0->name); } - if ((c1->tech_pvt == pvt1) && (!c1->_softhangup)) { + if ((c1->tech_pvt == pvt1) && (!ast_check_hangup(c1))) { if (pr1->set_rtp_peer(c1, NULL, NULL, 0)) ast_log(LOG_WARNING, "Channel '%s' failed to revert back\n", c1->name); } Index: channels/chan_local.c =================================================================== --- channels/chan_local.c (revision 75622) +++ channels/chan_local.c (working copy) @@ -246,9 +246,9 @@ we can't get everything. Remember, we'll get another chance in just a little bit */ if (!ast_mutex_trylock(&(p->chan->_bridge)->lock)) { - if (!p->chan->_bridge->_softhangup) { + if (!ast_check_hangup(p->chan->_bridge)) { if (!ast_mutex_trylock(&p->owner->lock)) { - if (!p->owner->_softhangup) { + if (!ast_check_hangup(p->owner)) { ast_channel_masquerade(p->owner, p->chan->_bridge); ast_set_flag(p, LOCAL_ALREADY_MASQED); } @@ -265,9 +265,9 @@ } else if (!isoutbound && p->owner && p->owner->_bridge && p->chan && AST_LIST_EMPTY(&p->chan->readq)) { /* Masquerade bridged channel into chan */ if (!ast_mutex_trylock(&(p->owner->_bridge)->lock)) { - if (!p->owner->_bridge->_softhangup) { + if (!ast_check_hangup(p->owner->_bridge)) { if (!ast_mutex_trylock(&p->chan->lock)) { - if (!p->chan->_softhangup) { + if (!ast_check_hangup(p->chan)) { ast_channel_masquerade(p->chan, p->owner->_bridge); ast_set_flag(p, LOCAL_ALREADY_MASQED); } Index: apps/app_zapras.c =================================================================== --- apps/app_zapras.c (revision 75622) +++ apps/app_zapras.c (working copy) @@ -161,7 +161,7 @@ res = wait4(pid, &status, WNOHANG, NULL); if (!res) { /* Check for hangup */ - if (chan->_softhangup && !signalled) { + if (ast_check_hangup(chan) && !signalled) { ast_debug(1, "Channel '%s' hungup. Signalling RAS at %d to die...\n", chan->name, pid); kill(pid, SIGTERM); signalled=1; Index: apps/app_meetme.c =================================================================== --- apps/app_meetme.c (revision 75622) +++ apps/app_meetme.c (working copy) @@ -718,7 +718,7 @@ int len; int res = -1; - if (!chan->_softhangup) + if (!ast_check_hangup(chan)) res = ast_autoservice_start(chan); AST_LIST_LOCK(&confs); Index: apps/app_macro.c =================================================================== --- apps/app_macro.c (revision 75622) +++ apps/app_macro.c (working copy) @@ -388,7 +388,7 @@ } /* don't stop executing extensions when we're in "h" */ - if (chan->_softhangup && !inhangup) { + if (ast_check_hangup(chan) && !inhangup) { ast_debug(1, "Extension %s, macroexten %s, priority %d returned normally even though call was hung up\n", chan->exten, chan->macroexten, chan->priority); goto out; } @@ -437,7 +437,7 @@ /* If we're leaving the macro normally, restore original information */ chan->priority = oldpriority; ast_copy_string(chan->context, oldcontext, sizeof(chan->context)); - if (!(chan->_softhangup & AST_SOFTHANGUP_ASYNCGOTO)) { + if (!(ast_check_hangup(chan) & AST_SOFTHANGUP_ASYNCGOTO)) { /* Copy the extension, so long as we're not in softhangup, where we could be given an asyncgoto */ const char *offsets; ast_copy_string(chan->exten, oldexten, sizeof(chan->exten)); Index: apps/app_dial.c =================================================================== --- apps/app_dial.c (revision 75622) +++ apps/app_dial.c (working copy) @@ -1816,7 +1816,7 @@ } } if (res != AST_PBX_NO_HANGUP_PEER) { - if (!chan->_softhangup) + if (!ast_check_hangup(chan)) chan->hangupcause = peer->hangupcause; ast_hangup(peer); } @@ -1835,7 +1835,7 @@ senddialendevent(chan, pa.status); ast_debug(1, "Exiting with DIALSTATUS=%s.\n", pa.status); - if ((ast_test_flag(peerflags, OPT_GO_ON)) && (!chan->_softhangup) && (res != AST_PBX_KEEPALIVE)) { + if ((ast_test_flag(peerflags, OPT_GO_ON)) && (!ast_check_hangup(chan)) && (res != AST_PBX_KEEPALIVE)) { if (calldurationlimit) chan->whentohangup = 0; res = 0; Index: apps/app_osplookup.c =================================================================== --- apps/app_osplookup.c (revision 75622) +++ apps/app_osplookup.c (working copy) @@ -1734,7 +1734,7 @@ ast_debug(1, "OSPFinish: connect '%ld'\n", connect); ast_debug(1, "OSPFinish: end '%ld'\n", end); - release = chan->_softhangup ? 0 : 1; + release = ast_check_hangup(chan) ? 0 : 1; if (osp_finish(outhandle, recorded, cause, start, connect, end, release) <= 0) { ast_debug(1, "OSPFinish: Unable to report usage for outbound call\n"); Index: apps/app_queue.c =================================================================== --- apps/app_queue.c (revision 75622) +++ apps/app_queue.c (working copy) @@ -2596,7 +2596,7 @@ } } res2 |= ast_autoservice_stop(qe->chan); - if (peer->_softhangup) { + if (ast_check_hangup(peer)) { /* Agent must have hung up */ ast_log(LOG_WARNING, "Agent on %s hungup on the customer. They're going to be pissed.\n", peer->name); ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "AGENTDUMP", "%s", ""); @@ -2885,7 +2885,7 @@ qe->chan->exten, qe->chan->context, (long) (callstart - qe->start), (long) (time(NULL) - callstart)); send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), TRANSFER); - } else if (qe->chan->_softhangup) { + } else if (ast_check_hangup(qe->chan)) { ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "COMPLETECALLER", "%ld|%ld|%d", (long) (callstart - qe->start), (long) (time(NULL) - callstart), qe->opos); send_agent_complete(qe, queuename, peer, member, callstart, vars, sizeof(vars), CALLER); Index: main/autoservice.c =================================================================== --- main/autoservice.c (revision 75622) +++ main/autoservice.c (working copy) @@ -71,7 +71,7 @@ AST_RWLIST_RDLOCK(&aslist); AST_RWLIST_TRAVERSE(&aslist, as, list) { - if (!as->chan->_softhangup) { + if (!ast_check_hangup(as->chan)) { if (x < MAX_AUTOMONS) mons[x++] = as->chan; else @@ -137,7 +137,7 @@ if (as->chan == chan) { AST_RWLIST_REMOVE_CURRENT(&aslist, list); ast_free(as); - if (!chan->_softhangup) + if (!ast_check_hangup(chan)) res = 0; break; } Index: main/pbx.c =================================================================== --- main/pbx.c (revision 75622) +++ main/pbx.c (working copy) @@ -2427,7 +2427,7 @@ /* If the AbsoluteTimeout is not reset to 0, we'll get an infinite loop */ c->whentohangup = 0; c->_softhangup &= ~AST_SOFTHANGUP_TIMEOUT; - } else if (c->_softhangup) { + } else if (ast_check_hangup(c)) { ast_debug(1, "Extension %s, priority %d returned normally even though call was hung up\n", c->exten, c->priority); error = 1; Index: res/res_features.c =================================================================== --- res/res_features.c (revision 75622) +++ res/res_features.c (working copy) @@ -863,7 +863,7 @@ ast_set_flag(&(bconfig.features_caller), AST_FEATURE_DISCONNECT); ast_set_flag(&(bconfig.features_callee), AST_FEATURE_DISCONNECT); res = ast_bridge_call(transferer, newchan, &bconfig); - if (newchan->_softhangup || !transferer->_softhangup) { + if (ast_check_hangup(newchan) || !ast_check_hangup(transferer)) { ast_hangup(newchan); if (ast_stream_and_wait(transferer, xfersound, "")) ast_log(LOG_WARNING, "Failed to play transfer sound!\n"); @@ -1463,7 +1463,7 @@ x = 0; started = ast_tvnow(); to = timeout; - while (!((transferee && transferee->_softhangup) && (!igncallerstate && ast_check_hangup(caller))) && timeout && (chan->_state != AST_STATE_UP)) { + while (!((transferee && ast_check_hangup(transferee)) && (!igncallerstate && ast_check_hangup(caller))) && timeout && (chan->_state != AST_STATE_UP)) { struct ast_frame *f = NULL; monitor_chans[0] = caller; @@ -1519,7 +1519,7 @@ f = ast_read(caller); if (f == NULL) { /*doh! where'd he go?*/ if (!igncallerstate) { - if (caller->_softhangup && !chan->_softhangup) { + if (ast_check_hangup(caller) && !ast_check_hangup(chan)) { /* make this a blind transfer */ ready = 1; break;