push 'outgoing' flag from sig_XXX up to chan_dahdi

'p->outgoing' in chan_dahdi and sig_analog wern't kept in sync, particulary FXS ast_hangup didn't clear the 'outgoing' flag.
sig_pri and sig_ss7 were keeping 'outgoing' flag insync.

Now provides a callback for all the low level sig_XXX modules.

(issue ASTERISK-19316)

alecdavis (license 585)
Reported by: Jeremy Pepper
Tested by: alecdavis
 
Review: https://reviewboard.asterisk.org/r/1747/
........

Merged revisions 355850 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 355851 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Alec L Davis
2012-02-18 08:02:08 +00:00
parent 3816fdde94
commit a4f6d96b2e
7 changed files with 48 additions and 11 deletions

View File

@@ -120,6 +120,14 @@ static void sig_ss7_set_digital(struct sig_ss7_chan *p, int is_digital)
}
}
static void sig_ss7_set_outgoing(struct sig_ss7_chan *p, int is_outgoing)
{
p->outgoing = is_outgoing;
if (p->calls->set_outgoing) {
p->calls->set_outgoing(p->chan_pvt, is_outgoing);
}
}
static void sig_ss7_set_inservice(struct sig_ss7_chan *p, int is_inservice)
{
if (p->calls->set_inservice) {
@@ -1570,7 +1578,7 @@ int sig_ss7_hangup(struct sig_ss7_chan *p, struct ast_channel *ast)
p->owner = NULL;
sig_ss7_set_dialing(p, 0);
p->outgoing = 0;
sig_ss7_set_outgoing(p, 0);
p->progress = 0;
p->rlt = 0;
p->exten[0] = '\0';
@@ -1755,10 +1763,10 @@ struct ast_channel *sig_ss7_request(struct sig_ss7_chan *p, enum sig_ss7_law law
{
struct ast_channel *ast;
p->outgoing = 1;
sig_ss7_set_outgoing(p, 1);
ast = sig_ss7_new_ast_channel(p, AST_STATE_RESERVED, law, transfercapability, p->exten, requestor);
if (!ast) {
p->outgoing = 0;
sig_ss7_set_outgoing(p, 0);
/* Release the allocated channel. Only have to deal with the linkset lock. */
ast_mutex_lock(&p->ss7->lock);