Added direct media support to ooh323 channel driver

options are documented in config sample
sample config rename to proper name - ooh323.conf

To change media address ooh323 send empty TCS if there was 
completed TCS exchange or send facility forwardedelements 
with new fast start proposal if not.
Then close transmit logical channels and renew TCS exchange.

If new fast start proposal is received then ooh323 stack call back
channel driver routine to change rtp address in the rtp instance.
If empty TCS is received then close transmit logical channels and
renew TCS exchange

Review: https://reviewboard.asterisk.org/r/1607/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369613 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Alexandr Anikin
2012-07-04 21:42:05 +00:00
parent 50765000e6
commit fa10f3f8a8
16 changed files with 855 additions and 152 deletions

View File

@@ -77,8 +77,9 @@ OOLogicalChannel* ooAddNewLogicalChannel(OOH323CallData *call, int channelNo,
{
OOTRACEDBGC3("Using configured media info (%s, %s)\n", call->callType,
call->callToken);
pNewChannel->localRtpPort = pMediaInfo->lMediaPort;
pNewChannel->localRtcpPort = pMediaInfo->lMediaCntrlPort;
pNewChannel->localRtpPort = pMediaInfo->lMediaRedirPort ? pMediaInfo->lMediaRedirPort : pMediaInfo->lMediaPort;
/* check MediaRedirPort here because RedirCPort is ReditPort + 1 and can't be 0 ;) */
pNewChannel->localRtcpPort = pMediaInfo->lMediaRedirPort ? pMediaInfo->lMediaRedirCPort : pMediaInfo->lMediaCntrlPort;
/* If user application has not specified a specific ip and is using
multihomed mode, substitute appropriate ip.
*/
@@ -86,6 +87,8 @@ OOLogicalChannel* ooAddNewLogicalChannel(OOH323CallData *call, int channelNo,
strcpy(pNewChannel->localIP, call->localIP);
else
strcpy(pNewChannel->localIP, pMediaInfo->lMediaIP);
OOTRACEDBGC5("Configured media info (%s, %s) %s:%d\n", call->callType, call->callToken, pNewChannel->localIP, pNewChannel->localRtcpPort);
}
else{
OOTRACEDBGC3("Using default media info (%s, %s)\n", call->callType,
@@ -254,6 +257,26 @@ OOLogicalChannel* ooGetTransmitLogicalChannel
return NULL;
}
OOLogicalChannel* ooGetReceiveLogicalChannel
(OOH323CallData *call)
{
OOLogicalChannel * pChannel = NULL;
pChannel = call->logicalChans;
while (pChannel) {
OOTRACEINFO6("Listing logical channel %d cap %d state %d for (%s, %s)\n",
pChannel->channelNo, pChannel->chanCap->cap, pChannel->state,
call->callType, call->callToken);
if (!strcmp(pChannel->dir, "receive") && pChannel->state != OO_LOGICALCHAN_IDLE &&
pChannel->state != OO_LOGICALCHAN_PROPOSEDFS) {
return pChannel;
} else {
pChannel = pChannel->next;
}
}
return NULL;
}
int ooClearAllLogicalChannels(OOH323CallData *call)
{
OOLogicalChannel * temp = NULL, *prev = NULL;
@@ -326,7 +349,7 @@ int ooClearLogicalChannel(OOH323CallData *call, int channelNo)
ooRemoveLogicalChannel(call, channelNo);/* TODO: efficiency - This causes re-search of
of logical channel in the list. Can be
easily improved.*/
} while ((pLogicalChannel = ooFindLogicalChannelByLogicalChannelNo(call,channelNo)));
} while ((pLogicalChannel = ooFindLogicalChannelByLogicalChannelNo(call, channelNo)));
return OO_OK;
}