mgw: Add RTP_CodecPort throguh which we can send/receive RTP+RTCP

This commit is contained in:
Harald Welte 2017-11-18 13:28:07 +01:00
parent 45295c517f
commit a7261d7312
5 changed files with 170 additions and 1 deletions

61
mgw/RTP_CodecPort.ttcn Normal file
View File

@ -0,0 +1,61 @@
module RTP_CodecPort {
import from IPL4asp_PortType all;
import from IPL4asp_Types all;
import from RTP_Types all;
type record RTP_RecvFrom {
ConnectionId connId,
HostName remName,
PortNumber remPort,
HostName locName,
PortNumber locPort,
RTP_messages_union msg
};
template RTP_RecvFrom t_RTP_RecvFrom(template RTP_messages_union msg) := {
connId := ?,
remName := ?,
remPort := ?,
locName := ?,
locPort := ?,
msg := msg
}
type record RTP_Send {
ConnectionId connId,
RTP_messages_union msg
}
template RTP_Send t_RTP_Send(template ConnectionId connId, template RTP_messages_union msg) := {
connId := connId,
msg := msg
}
private function IPL4_to_RTP_RecvFrom(in ASP_RecvFrom pin, out RTP_RecvFrom pout) {
pout.connId := pin.connId;
pout.remName := pin.remName;
pout.remPort := pin.remPort;
pout.locName := pin.locName;
pout.locPort := pin.locPort;
pout.msg := f_RTP_dec(pin.msg)
} with { extension "prototype(fast)" };
private function RTP_to_IPL4_Send(in RTP_Send pin, out ASP_Send pout) {
pout.connId := pin.connId;
pout.proto := { udp := {} };
pout.msg := f_RTP_enc(pin.msg);
} with { extension "prototype(fast)" };
type port RTP_CODEC_PT message {
out RTP_Send;
in RTP_RecvFrom,
ASP_ConnId_ReadyToRelease,
ASP_Event;
} with { extension "user IPL4asp_PT
out(RTP_Send -> ASP_Send:function(RTP_to_IPL4_Send))
in(ASP_RecvFrom -> RTP_RecvFrom: function(IPL4_to_RTP_RecvFrom);
ASP_ConnId_ReadyToRelease -> ASP_ConnId_ReadyToRelease: simple;
ASP_Event -> ASP_Event: simple)"
}
}

View File

@ -0,0 +1,44 @@
module RTP_CodecPort_CtrlFunct {
import from RTP_CodecPort all;
import from IPL4asp_Types all;
external function f_IPL4_listen(
inout RTP_CODEC_PT portRef,
in HostName locName,
in PortNumber locPort,
in ProtoTuple proto,
in OptionList options := {}
) return Result;
external function f_IPL4_connect(
inout RTP_CODEC_PT portRef,
in HostName remName,
in PortNumber remPort,
in HostName locName,
in PortNumber locPort,
in ConnectionId connId,
in ProtoTuple proto,
in OptionList options := {}
) return Result;
external function f_IPL4_close(
inout RTP_CODEC_PT portRef,
in ConnectionId id,
in ProtoTuple proto := { unspecified := {} }
) return Result;
external function f_IPL4_setUserData(
inout RTP_CODEC_PT portRef,
in ConnectionId id,
in UserData userData
) return Result;
external function f_IPL4_getUserData(
inout RTP_CODEC_PT portRef,
in ConnectionId id,
out UserData userData
) return Result;
}

View File

@ -0,0 +1,56 @@
#include "IPL4asp_PortType.hh"
#include "RTP_CodecPort.hh"
#include "IPL4asp_PT.hh"
namespace RTP__CodecPort__CtrlFunct {
IPL4asp__Types::Result f__IPL4__listen(
RTP__CodecPort::RTP__CODEC__PT& portRef,
const IPL4asp__Types::HostName& locName,
const IPL4asp__Types::PortNumber& locPort,
const IPL4asp__Types::ProtoTuple& proto,
const IPL4asp__Types::OptionList& options)
{
return f__IPL4__PROVIDER__listen(portRef, locName, locPort, proto, options);
}
IPL4asp__Types::Result f__IPL4__connect(
RTP__CodecPort::RTP__CODEC__PT& portRef,
const IPL4asp__Types::HostName& remName,
const IPL4asp__Types::PortNumber& remPort,
const IPL4asp__Types::HostName& locName,
const IPL4asp__Types::PortNumber& locPort,
const IPL4asp__Types::ConnectionId& connId,
const IPL4asp__Types::ProtoTuple& proto,
const IPL4asp__Types::OptionList& options)
{
return f__IPL4__PROVIDER__connect(portRef, remName, remPort,
locName, locPort, connId, proto, options);
}
IPL4asp__Types::Result f__IPL4__close(
RTP__CodecPort::RTP__CODEC__PT& portRef,
const IPL4asp__Types::ConnectionId& connId,
const IPL4asp__Types::ProtoTuple& proto)
{
return f__IPL4__PROVIDER__close(portRef, connId, proto);
}
IPL4asp__Types::Result f__IPL4__setUserData(
RTP__CodecPort::RTP__CODEC__PT& portRef,
const IPL4asp__Types::ConnectionId& connId,
const IPL4asp__Types::UserData& userData)
{
return f__IPL4__PROVIDER__setUserData(portRef, connId, userData);
}
IPL4asp__Types::Result f__IPL4__getUserData(
RTP__CodecPort::RTP__CODEC__PT& portRef,
const IPL4asp__Types::ConnectionId& connId,
IPL4asp__Types::UserData& userData)
{
return f__IPL4__PROVIDER__getUserData(portRef, connId, userData);
}
}

View File

@ -31,3 +31,11 @@ DIR=$BASEDIR/titan.ProtocolModules.SDP/src
FILES="SDP_EncDec.cc SDP_Types.ttcn SDP_parse_.tab.c SDP_parse_.tab.h SDP_parse_parser.h SDP_parser.l
SDP_parser.y lex.SDP_parse_.c"
gen_links $DIR $FILES
DIR=$BASEDIR/titan.ProtocolModules.RTP/src
FILES="RTP_EncDec.cc RTP_Types.ttcn"
gen_links $DIR $FILES
DIR=../library
FILES="General_Types.ttcn"
gen_links $DIR $FILES

View File

@ -1,6 +1,6 @@
#!/bin/sh
FILES="*.ttcn SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc"
FILES="*.ttcn SDP_EncDec.cc *.c MGCP_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc RTP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc"
ttcn3_makefilegen -f MGCP_Test.ttcn $FILES
sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile