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

@@ -512,6 +512,14 @@ static int analog_on_hook(struct analog_pvt *p)
return -1;
}
static void analog_set_outgoing(struct analog_pvt *p, int is_outgoing)
{
p->outgoing = is_outgoing;
if (p->calls->set_outgoing) {
p->calls->set_outgoing(p->chan_pvt, is_outgoing);
}
}
static int analog_check_for_conference(struct analog_pvt *p)
{
if (p->calls->check_for_conference) {
@@ -796,11 +804,11 @@ struct ast_channel * analog_request(struct analog_pvt *p, int *callwait, const s
}
}
p->outgoing = 1;
analog_set_outgoing(p, 1);
ast = analog_new_ast_channel(p, AST_STATE_RESERVED, 0,
p->owner ? ANALOG_SUB_CALLWAIT : ANALOG_SUB_REAL, requestor);
if (!ast) {
p->outgoing = 0;
analog_set_outgoing(p, 0);
}
return ast;
}
@@ -1026,7 +1034,7 @@ int analog_call(struct analog_pvt *p, struct ast_channel *ast, const char *rdest
}
p->dialednone = 0;
p->outgoing = 1;
analog_set_outgoing(p, 1);
mysig = p->sig;
if (p->outsigmod > -1) {
@@ -1429,7 +1437,7 @@ int analog_hangup(struct analog_pvt *p, struct ast_channel *ast)
analog_set_ringtimeout(p, 0);
analog_set_confirmanswer(p, 0);
analog_set_pulsedial(p, 0);
p->outgoing = 0;
analog_set_outgoing(p, 0);
p->onhooktime = time(NULL);
p->cidrings = 1;