Fix double alerting, add forced alerting before answer

Fix double alerting (it wasn't fixed here by issue #18542)
Add forced alerting before connect (if it wasn't before)
Try to send all packets from outgoing queue rather than one only
Call goes into clearing state when disconnect command is received

(closes issue #19361)
Reported by: vmikhelson
Patches: 
      issue19361-3.patch uploaded by may213 (license 454)
Tested by: vmikhelson



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@321528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Alexandr Anikin
2011-06-01 10:40:19 +00:00
parent 8668ec7ef9
commit c8c5461a76
3 changed files with 28 additions and 10 deletions

View File

@@ -1079,6 +1079,7 @@ static int ooh323_hangup(struct ast_channel *ast)
static int ooh323_answer(struct ast_channel *ast)
{
struct ooh323_pvt *p = ast->tech_pvt;
char *callToken = (char *)NULL;
if (gH323Debug)
ast_verbose("--- ooh323_answer\n");
@@ -1086,8 +1087,18 @@ static int ooh323_answer(struct ast_channel *ast)
if (p) {
ast_mutex_lock(&p->lock);
callToken = (p->callToken ? strdup(p->callToken) : NULL);
if (ast->_state != AST_STATE_UP) {
ast_channel_lock(ast);
if (!p->alertsent) {
if (gH323Debug) {
ast_debug(1, "Sending forced ringback for %s, res = %d\n",
callToken, ooManualRingback(callToken));
} else {
ooManualRingback(callToken);
}
p->alertsent = 1;
}
ast_setstate(ast, AST_STATE_UP);
if (option_debug)
ast_debug(1, "ooh323_answer(%s)\n", ast->name);
@@ -1252,6 +1263,7 @@ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *d
} else {
ooManualRingback(callToken);
}
p->alertsent = 1;
}
}
break;