aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addons/chan_ooh323.c12
-rw-r--r--addons/ooh323c/src/oochannels.c24
-rw-r--r--addons/ooh323c/src/ooh245.c2
3 files changed, 28 insertions, 10 deletions
diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c
index a795c9f1d..5c2131c93 100644
--- a/addons/chan_ooh323.c
+++ b/addons/chan_ooh323.c
@@ -1044,6 +1044,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");
@@ -1051,8 +1052,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);
@@ -1220,6 +1231,7 @@ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *d
}
p->alertsent = 1;
}
+ p->alertsent = 1;
}
break;
case AST_CONTROL_SRCUPDATE:
diff --git a/addons/ooh323c/src/oochannels.c b/addons/ooh323c/src/oochannels.c
index 891a12d17..e3ac30fbb 100644
--- a/addons/ooh323c/src/oochannels.c
+++ b/addons/ooh323c/src/oochannels.c
@@ -682,10 +682,11 @@ int ooProcessCallFDSETsAndTimers
if (0 != call->pH245Channel && 0 != call->pH245Channel->sock)
{
- if(call->pH245Channel->outQueue.count>0)
- {
- if(ooPDWrite(pfds, nfds, call->pH245Channel->sock))
- ooSendMsg(call, OOH245MSG);
+ if(ooPDWrite(pfds, nfds, call->pH245Channel->sock)) {
+ while (call->pH245Channel->outQueue.count>0) {
+ if (ooSendMsg(call, OOH245MSG) != OO_OK)
+ break;
+ }
}
}
else if(call->h245listener)
@@ -702,20 +703,23 @@ int ooProcessCallFDSETsAndTimers
{
if(ooPDWrite(pfds, nfds, call->pH225Channel->sock))
{
- if(call->pH225Channel->outQueue.count>0)
+ while (call->pH225Channel->outQueue.count>0)
{
OOTRACEDBGC3("Sending H225 message (%s, %s)\n",
call->callType, call->callToken);
- ooSendMsg(call, OOQ931MSG);
+ if (ooSendMsg(call, OOQ931MSG) != OO_OK)
+ break;
}
if(call->pH245Channel &&
call->pH245Channel->outQueue.count>0 &&
- OO_TESTFLAG (call->flags, OO_M_TUNNELING))
- {
+ OO_TESTFLAG (call->flags, OO_M_TUNNELING)) {
+ while (call->pH245Channel->outQueue.count>0) {
OOTRACEDBGC3("H245 message needs to be tunneled. "
"(%s, %s)\n", call->callType,
call->callToken);
- ooSendMsg(call, OOH245MSG);
+ if (ooSendMsg(call, OOH245MSG) != OO_OK)
+ break;
+ }
}
}
}
@@ -1330,7 +1334,7 @@ int ooSendMsg(OOH323CallData *call, int type)
{
OOTRACEDBGA3("Warning:Call marked for cleanup. Can not send message."
"(%s, %s)\n", call->callType, call->callToken);
- return OO_OK;
+ return OO_FAILED;
}
if(type == OOQ931MSG)
diff --git a/addons/ooh323c/src/ooh245.c b/addons/ooh323c/src/ooh245.c
index 940b8d838..efb0c21f2 100644
--- a/addons/ooh323c/src/ooh245.c
+++ b/addons/ooh323c/src/ooh245.c
@@ -2126,6 +2126,8 @@ int ooHandleH245Command(OOH323CallData *call,
ooClearAllLogicalChannels(call);
}
ooSendEndSessionCommand(call);
+ if (call->callState < OO_CALL_CLEAR)
+ call->callState = OO_CALL_CLEAR;
}