don't destroy gatekeeper client if it is not started
don't destroy gatekeeper client in some sort of gatekeeper errors
signal rtp create condition when call cleared before rtp structure created
(closes issue ASTERISK-23460)
Reported by: Dmitry Melekhov
Patches:
ASTERISK-23460-2.patch
Tested by: Dmitry Melekhov
........
Merged revisions 411531 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 411532 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411533
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
ast_module_unref(myself);
}
+ if (!p->rtp) {
+ ast_cond_signal(&p->rtpcond);
+ }
+
ast_set_flag(p, H323_NEEDDESTROY);
ooh323c_stop_call_thread(call);
if(cmd.type == OO_CMD_NOOP)
continue;
- if(gH323ep.gkClient && gH323ep.gkClient->state != GkClientRegistered && cmd.type != OO_CMD_STOPMONITOR)
- {
- OOTRACEINFO1("Ignoring stack command as Gk Client is not registered"
- " yet\n");
- }
else {
switch(cmd.type) {
case OO_CMD_MAKECALL:
if(cmd.type == OO_CMD_NOOP)
continue;
- if(gH323ep.gkClient && gH323ep.gkClient->state != GkClientRegistered)
- {
- OOTRACEINFO1("Ignoring stack command as Gk Client is not registered"
- " yet\n");
- }
else {
switch(cmd.type) {
case OO_CMD_MAKECALL:
if(iRet != OO_OK)
{
OOTRACEERR1("Error:Failed to send GRQ message\n");
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
if(iRet != OO_OK)
{
OOTRACEERR1("Error: Failed to handle received RAS message\n");
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
}
memReset(pctxt);
}
{
OOTRACEERR1("Error: Failed to send GRQ message\n");
memReset(&pGkClient->msgCtxt);
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
{
OOTRACEERR1("Error:Failed to send UnregistrationRequest message\n");
memReset(pctxt);
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
{
OOTRACEERR1("Error:Failed to send AdmissionRequest message\n");
memReset(pctxt);
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
{
OOTRACEERR1("Error:Failed to send IRR message\n");
memReset(pctxt);
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
if(iRet != OO_OK)
{
OOTRACEERR1("Error: Failed to send DRQ message\n");
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
}
if(ret != OO_OK)
{
OOTRACEERR1("Error:Failed to send Additive RRQ message\n");
- pGkClient->state = GkClientFailed;
+ pGkClient->state = GkClientGkErr;
return OO_FAILED;
}
return OO_OK;
if(OO_OK != ooGkClientStart(gH323ep.gkClient))
{
OOTRACEERR1("Error:Failed to start Gatekeeper client\n");
- ooGkClientDestroy();
+ // not need more, now it can be restarted correctly
+ // ooGkClientDestroy();
}
}
if(gH323ep.gkClient->state == GkClientRegistered)
{
call->callState = OO_CALL_WAITING_ADMISSION;
+ ast_mutex_lock(&call->GkLock);
ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call,
FALSE);
tv = ast_tvnow();
ts.tv_sec = tv.tv_sec + 24;
ts.tv_nsec = tv.tv_usec * 1000;
- ast_mutex_lock(&call->GkLock);
if (call->callState == OO_CALL_WAITING_ADMISSION)
ast_cond_timedwait(&call->gkWait, &call->GkLock, &ts);
if (call->callState == OO_CALL_WAITING_ADMISSION)
{
if(gH323ep.gkClient->state == GkClientRegistered) {
call->callState = OO_CALL_WAITING_ADMISSION;
+ ast_mutex_lock(&call->GkLock);
ret = ooGkClientSendAdmissionRequest(gH323ep.gkClient, call, FALSE);
tv = ast_tvnow();
ts.tv_sec = tv.tv_sec + 24;
ts.tv_nsec = tv.tv_usec * 1000;
- ast_mutex_lock(&call->GkLock);
if (call->callState == OO_CALL_WAITING_ADMISSION)
ast_cond_timedwait(&call->gkWait, &call->GkLock, &ts);
if (call->callState == OO_CALL_WAITING_ADMISSION)