process stack command even if gatekeeper client isn't register

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
changes/97/197/1
Alexandr Anikin 11 years ago
parent 597f25db69
commit a35ce3924b

@ -2204,6 +2204,10 @@ int onCallCleared(ooCallData *call)
ast_module_unref(myself);
}
if (!p->rtp) {
ast_cond_signal(&p->rtpcond);
}
ast_set_flag(p, H323_NEEDDESTROY);
ooh323c_stop_call_thread(call);

@ -172,11 +172,6 @@ int ooReadAndProcessStackCommand()
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:
@ -336,11 +331,6 @@ int ooReadAndProcessCallStackCommand(OOH323CallData* call)
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:

@ -210,7 +210,7 @@ int ooGkClientStart(ooGkClient *pGkClient)
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;
}
@ -433,7 +433,7 @@ int ooGkClientReceive(ooGkClient *pGkClient)
if(iRet != OO_OK)
{
OOTRACEERR1("Error: Failed to handle received RAS message\n");
pGkClient->state = GkClientFailed;
pGkClient->state = GkClientGkErr;
}
memReset(pctxt);
}
@ -702,7 +702,7 @@ int ooGkClientSendGRQ(ooGkClient *pGkClient)
{
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;
}
@ -1530,7 +1530,7 @@ int ooGkClientSendURQ(ooGkClient *pGkClient, ooAliases *aliases)
{
OOTRACEERR1("Error:Failed to send UnregistrationRequest message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@ -1909,7 +1909,7 @@ int ooGkClientSendAdmissionRequest
{
OOTRACEERR1("Error:Failed to send AdmissionRequest message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@ -2423,7 +2423,7 @@ int ooGkClientSendIRR
{
OOTRACEERR1("Error:Failed to send IRR message\n");
memReset(pctxt);
pGkClient->state = GkClientFailed;
pGkClient->state = GkClientGkErr;
ast_mutex_unlock(&pGkClient->Lock);
return OO_FAILED;
}
@ -2576,7 +2576,7 @@ int ooGkClientSendDisengageRequest(ooGkClient *pGkClient, OOH323CallData *call)
if(iRet != OO_OK)
{
OOTRACEERR1("Error: Failed to send DRQ message\n");
pGkClient->state = GkClientFailed;
pGkClient->state = GkClientGkErr;
}
@ -2736,7 +2736,7 @@ int ooGkClientREGTimerExpired(void *pdata)
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;

@ -822,7 +822,8 @@ int ooMonitorChannels()
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();
}
}

@ -1719,12 +1719,12 @@ int ooHandleH2250Message(OOH323CallData *call, Q931Message *q931Msg)
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)

@ -2604,11 +2604,11 @@ int ooH323MakeCall(char *dest, char *callToken, ooCallOptions *opts)
{
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)

Loading…
Cancel
Save